]> xenbits.xensource.com Git - seabios.git/commitdiff
usb: Eliminate USB controller setup thread
authorKevin O'Connor <kevin@koconnor.net>
Tue, 2 Feb 2016 19:35:55 +0000 (14:35 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Wed, 3 Feb 2016 03:36:41 +0000 (22:36 -0500)
There are no longer any sleep or yield calls during the usb controller
device scans, so there is no need to run these device scans in a
separate thread.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
src/hw/usb-ehci.c
src/hw/usb-ohci.c
src/hw/usb-uhci.c
src/hw/usb-xhci.c
src/hw/usb.c

index a502d36479c87e5eef403a1a929fbd4b1fbd6ab3..a519455b6e4c17e628bb4928820757aebc34ef01 100644 (file)
@@ -295,7 +295,6 @@ fail:
 static void
 ehci_controller_setup(struct pci_device *pci)
 {
-    wait_preempt();  // Avoid pci_config_readl when preempting
     u16 bdf = pci->bdf;
     u32 baseaddr = pci_config_readl(bdf, PCI_BASE_ADDRESS_0);
     struct ehci_caps *caps = (void*)(baseaddr & PCI_BASE_ADDRESS_MEM_MASK);
index 7ed964f445ac699d0521820a5a5c8e882d40803f..0c0bf60b608d54683ea8a2e4f97db05c52ff39be 100644 (file)
@@ -277,7 +277,6 @@ ohci_controller_setup(struct pci_device *pci)
     cntl->usb.pci = pci;
     cntl->usb.type = USB_TYPE_OHCI;
 
-    wait_preempt();  // Avoid pci_config_readl when preempting
     u16 bdf = pci->bdf;
     u32 baseaddr = pci_config_readl(bdf, PCI_BASE_ADDRESS_0);
     cntl->regs = (void*)(baseaddr & PCI_BASE_ADDRESS_MEM_MASK);
index 6d8aa4751924adfee954bd14cfe255f03eefc534..7a11510c73010e9d10f6a3583c17b5ad68324160 100644 (file)
@@ -250,7 +250,6 @@ uhci_controller_setup(struct pci_device *pci)
         warn_noalloc();
         return;
     }
-    wait_preempt();  // Avoid pci_config_readl when preempting
     memset(cntl, 0, sizeof(*cntl));
     cntl->usb.pci = pci;
     cntl->usb.type = USB_TYPE_UHCI;
index 089cae75cbc25c12e11eb3b1b064da15b3e83257..ad541ab7461d26cb55fe5ca1cddc7d5f312513f0 100644 (file)
@@ -534,7 +534,6 @@ xhci_controller_setup(struct pci_device *pci)
     }
     memset(xhci, 0, sizeof(*xhci));
 
-    wait_preempt();  // Avoid pci_config_readl when preempting
     xhci->baseaddr = pci_config_readl(pci->bdf, PCI_BASE_ADDRESS_0)
         & PCI_BASE_ADDRESS_MEM_MASK;
     xhci->caps  = (void*)(xhci->baseaddr);
index 2bffd2501169fad291d57bd94bd6a25ada1c9545..20731d1de9525ebcf25d54bfbaddcbe18ccff54f 100644 (file)
@@ -484,22 +484,16 @@ usb_enumerate(struct usbhub_s *hub)
         yield();
 }
 
-void
-__usb_setup(void *data)
-{
-    dprintf(3, "init usb\n");
-    xhci_setup();
-    ehci_setup();
-    uhci_setup();
-    ohci_setup();
-}
-
 void
 usb_setup(void)
 {
     ASSERT32FLAT();
     if (! CONFIG_USB)
         return;
+    dprintf(3, "init usb\n");
     usb_time_sigatt = romfile_loadint("etc/usb-time-sigatt", USB_TIME_SIGATT);
-    run_thread(__usb_setup, NULL);
+    xhci_setup();
+    ehci_setup();
+    uhci_setup();
+    ohci_setup();
 }