Alan Stern [stern@xxxxxxxxxxxxxxxxxxx] wrote: >On Tue, 24 Jan 2012, Jayachandran C wrote: > >> Yes. I just replicated the HC_LENGTH logic here.It seemed to me >> that the USB PCI quirk code did not try to handle the big-endian cases >> at all. >> >> After reading the code again, it looks like another solution is to just >> avoid the whole quirk_usb_early_handoff() function for our >> MIPS cpu - which does not have PC style firmware, and handoff >> is not necessary. > > Does any MIPS-based system have PC-style firmware? I am not aware of any, but MIPS supports a wide variety of systems and firmware (http://www.linux-mips.org/wiki/Firmware) >> quirk_usb_early_handoff() is declared as a fixup for PCI_ANY_ID, >> PCI_ANY_ID, so a patch that just skips Netlogic devices in >> quirk_usb_early_handoff looks like this: (will be white-space damaged, >> I will send out a proper one if it is okay.) >> >> diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c >> index caf8742..20e0e46 100644 >> --- a/drivers/usb/host/pci-quirks.c >> +++ b/drivers/usb/host/pci-quirks.c >> @@ -867,6 +867,10 @@ hc_init: >> >> static void __devinit quirk_usb_early_handoff(struct pci_dev *pdev) >> { >> + /* Skip Netlogic mips SoC's internal PCI USB controller */ >> + if (pdev->vendor == 0x184e) >> + return; >> + >> if (pdev->class == PCI_CLASS_SERIAL_USB_UHCI) >> quirk_usb_handoff_uhci(pdev); >> else if (pdev->class == PCI_CLASS_SERIAL_USB_OHCI) > > Can we put the entire function, or indeed most of the file, inside > "#ifdef CONFIG_X86"? Or perhaps a slightly more general test? The file (drivers/usb/host/pci-quirks.c) has an '#ifdef __hppa__' which seems to indicate that it is used by non-x86 platforms. So I think the possible solutions are - the readb -> readl patch I submitted first - check for vendor ids the does not need quirks (second patch) - or having a config or runtime variable to indicate if the handoff can be skipped. I am not sure if there is anything that can be used now, but if you have a suggestion here, I can implement that and send out a patch. I still think the second approach is simplest, since we are usually do quirks based on vendor/device id. I'll follow up this mail with the full version of the second patch. JC. -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html