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)
}
struct usb_ehci_s *cntl = malloc_tmphigh(sizeof(*cntl));
+ if (!cntl) {
+ warn_noalloc();
+ return -1;
+ }
memset(cntl, 0, sizeof(*cntl));
cntl->usb.busid = busid;
cntl->usb.pci = pci;