aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2011-07-10 15:41:55 -0400
committerKevin O'Connor <kevin@koconnor.net>2011-07-10 15:41:55 -0400
commit6f500511dc00bece01a192a9a8be168ced065ccd (patch)
tree84f75271cb881e22967ede993c11dffe1df5184a
parent5044053c84df0d423cdb61fcf29fe2cba2326f31 (diff)
downloadseabios-6f500511dc00bece01a192a9a8be168ced065ccd.zip
seabios-6f500511dc00bece01a192a9a8be168ced065ccd.tar.gz
seabios-6f500511dc00bece01a192a9a8be168ced065ccd.tar.bz2
Minor fix - make sure not to call ohci/uhci_init from irq handler.
When CONFIG_THREAD_OPTIONROMS is enabled, accessing the PCI config space from a thread could potentially race with an option rom. Make sure the ohci/uhci_init() functions (which access PCI config space) are never run while an optionrom could also be running. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--src/usb-ehci.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/usb-ehci.c b/src/usb-ehci.c
index d60465e..5028c0d 100644
--- a/src/usb-ehci.c
+++ b/src/usb-ehci.c
@@ -50,6 +50,10 @@ ehci_note_port(struct usb_ehci_s *cntl)
struct pci_device *pci = cntl->companion[i];
if (!pci)
break;
+
+ // ohci/uhci_init call pci_config_XXX - don't run from irq handler.
+ wait_preempt();
+
if (pci_classprog(pci) == PCI_CLASS_SERIAL_USB_UHCI)
uhci_init(pci, cntl->usb.busid + i);
else if (pci_classprog(pci) == PCI_CLASS_SERIAL_USB_OHCI)