Project

General

Profile

Actions

Bug #9806

closed

ehci_take_control() can infinite loop due to PCI invalid reads

Added by Robert Mustacchi about 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Category:
driver - device drivers
Start date:
2018-09-09
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

As part of testing the recent ACPI changes, a user hit an issue where we found an infinite loop in ehci_take_contrl().

The purpose of this function is to try and prod the BIOS to take control of the USB stack and devices. As part of trying to find this it looks through the pci configuration space in the classic PCI extension fashion. Unfortunately, if we hit an invalid read, we end up infinite looping as a result as we'll pretty much always have another capability which is the same invalid read.

The fix is simple, when we read PCI_EINAVL32, we should break out of the loop.

--

I tested this in a few ways: I worked with the user who was seeing this in the context of the new ACPI bits and verified that they no longer saw the hang. I also tested this on some other systems with EHCI and made sure that we still correctly found the capability and worked through it correctly.


Related issues

Related to illumos gate - Bug #4225: ehci can hang interminably trying to read PCI capabilitiesIn ProgressGarrett D'Amore2013-10-17

Actions
Actions #1

Updated by Adam Stylinski about 3 years ago

Could this cause the issue I'm seeing here?
https://www.illumos.org/issues/9836

Actions #2

Updated by Robert Mustacchi about 3 years ago

Unfortunately, it's unlikely that this is what's causing 9836. The way this manifested was as an infinite loop during boot up that caused a boot hang.

Actions #3

Updated by Adam Stylinski about 3 years ago

Ah, then my suspicious fall in the microcode update :-/. I might try reverting the microcode after being booted into the problematic BE and see if the issue goes away.

Actions #4

Updated by Electric Monk about 3 years ago

  • Status changed from New to Closed

git commit 9a48f6c443e5968307491ba7cc134bbdd0328801

commit  9a48f6c443e5968307491ba7cc134bbdd0328801
Author: Robert Mustacchi <rm@joyent.com>
Date:   2018-09-22T15:05:38.000Z

    9806 ehci_take_control() can infinite loop due to PCI invalid reads
    Reviewed by: Dan McDonald <danmcd@joyent.com>
    Reviewed by: Jason King <jason.king@joyent.com>
    Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Reviewed by: Garrett D'Amore <garrett@damore.org>
    Approved by: Richard Lowe <richlowe@richlowe.net>

Actions #5

Updated by Robert Mustacchi over 2 years ago

  • Related to Bug #4225: ehci can hang interminably trying to read PCI capabilities added
Actions

Also available in: Atom PDF