--- linux/drivers/usb/host/pci-quirks.c.orig 2006-02-12 17:54:32.000000000 +0000 +++ linux/drivers/usb/host/pci-quirks.c 2006-02-12 17:48:58.000000000 +0000 @@ -92,6 +92,8 @@ int uhci_check_and_reset_hc(struct pci_d u16 legsup; unsigned int cmd, intr; + printk("uhci_check_and_reset_hc()\n"); + /* * When restarting a suspended controller, we expect all the * settings to be the same as we left them: @@ -123,11 +125,13 @@ int uhci_check_and_reset_hc(struct pci_d __FUNCTION__, intr); goto reset_needed; } + printk("uhci_check_and_reset_hc() return, no reset needed\n"); return 0; reset_needed: dev_dbg(&pdev->dev, "Performing full reset\n"); uhci_reset_hc(pdev, base); + printk("uhci_check_and_reset_hc() return, reset complete\n"); return 1; } EXPORT_SYMBOL_GPL(uhci_check_and_reset_hc); @@ -146,8 +150,12 @@ static void __devinit quirk_usb_handoff_ unsigned long base = 0; int i; - if (!pio_enabled(pdev)) + printk("quirk_usb_handoff_uhci()\n"); + + if (!pio_enabled(pdev)) { + printk("quirk_usb_handoff_uhci() no pio\n"); return; + } for (i = 0; i < PCI_ROM_RESOURCE; i++) if ((pci_resource_flags(pdev, i) & IORESOURCE_IO)) { @@ -157,6 +165,8 @@ static void __devinit quirk_usb_handoff_ if (base) uhci_check_and_reset_hc(pdev, base); + + printk("quirk_usb_handoff_uhci() complete\n"); } static int __devinit mmio_resource_enabled(struct pci_dev *pdev, int idx) @@ -170,12 +180,19 @@ static void __devinit quirk_usb_handoff_ int wait_time; u32 control; - if (!mmio_resource_enabled(pdev, 0)) + printk("quirk_usb_handoff_ohci()\n"); + + if (!mmio_resource_enabled(pdev, 0)) { + printk("quirk_usb_handoff_ohci() no mmio\n"); return; + } base = ioremap_nocache(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0)); - if (base == NULL) return; + if (base == NULL) { + printk("quirk_usb_handoff_ohci() no base\n"); + return; + } /* On PA-RISC, PDC can leave IR set incorrectly; ignore it there. */ #ifndef __hppa__ @@ -191,8 +208,9 @@ static void __devinit quirk_usb_handoff_ } if (wait_time <= 0) printk(KERN_WARNING "%s %s: BIOS handoff " - "failed (BIOS bug ?)\n", - pdev->dev.bus_id, "OHCI"); + "failed (BIOS bug ?) %08x\n", + pdev->dev.bus_id, "OHCI", + readl(base + OHCI_CONTROL)); /* reset controller, preserving RWC */ writel(control & OHCI_CTRL_RWC, base + OHCI_CONTROL); @@ -206,6 +224,7 @@ static void __devinit quirk_usb_handoff_ writel(~(u32)0, base + OHCI_INTRSTATUS); iounmap(base); + printk("quirk_usb_handoff_ohci() complete\n"); } static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev) @@ -216,12 +235,19 @@ static void __devinit quirk_usb_disable_ u8 offset, cap_length; int count = 256/4; - if (!mmio_resource_enabled(pdev, 0)) + printk("quirk_usb_disable_ehci()\n"); + + if (!mmio_resource_enabled(pdev, 0)) { + printk("quirk_usb_disable_ehci() no mmio\n"); return; + } base = ioremap_nocache(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0)); - if (base == NULL) return; + if (base == NULL) { + printk("quirk_usb_disable_ehci() no base\n"); + return; + } cap_length = readb(base); op_reg_base = base + cap_length; @@ -243,6 +269,12 @@ static void __devinit quirk_usb_disable_ pr_debug("%s %s: BIOS handoff\n", pdev->dev.bus_id, "EHCI"); +#if 0 +/* aleksey_gorelov@phoenix.com reports that some systems need SMI forced on, + * but that seems dubious in general (the BIOS left it off intentionally) + * and is known to prevent some systems from booting. so we won't do this + * unless maybe we can determine when we're on a system that needs SMI forced. + */ /* BIOS workaround (?): be sure the * pre-Linux code receives the SMI */ @@ -252,6 +284,7 @@ static void __devinit quirk_usb_disable_ pci_write_config_dword(pdev, offset + EHCI_USBLEGCTLSTS, val | EHCI_USBLEGCTLSTS_SOOE); +#endif } /* always say Linux will own the hardware @@ -274,8 +307,8 @@ static void __devinit quirk_usb_disable_ * it down, and hope nothing goes too wrong */ printk(KERN_WARNING "%s %s: BIOS handoff " - "failed (BIOS bug ?)\n", - pdev->dev.bus_id, "EHCI"); + "failed (BIOS bug ?) %08x\n", + pdev->dev.bus_id, "EHCI", cap); pci_write_config_byte(pdev, offset + 2, 0); } @@ -326,6 +359,8 @@ static void __devinit quirk_usb_disable_ iounmap(base); + printk("quirk_usb_disable_ehci() complete\n"); + return; }