public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Don't touch USB controllers with MMIO disabled in quirks
@ 2005-11-01  4:03 Paul Mackerras
  2005-11-01  4:33 ` Linus Torvalds
  2005-11-01  4:50 ` David Brownell
  0 siblings, 2 replies; 8+ messages in thread
From: Paul Mackerras @ 2005-11-01  4:03 UTC (permalink / raw)
  To: akpm, torvalds
  Cc: David Brownell, Alan Stern, Greg Kroah-Hartman, linux-kernel

Recently a quirk was added which attempts to do usb-handoff on all USB
host controllers on all platforms.  This is causing machine checks on
various machines such as my G4 powerbook, because the quirk code
attempts to do MMIO to the device without calling pci_enable_device,
or even checking that MMIO is enabled.

I still think that a FIXUP_HEADER header is the wrong place to be
doing this sort of thing, and that code that touches a device without
doing pci_enable_device is just asking for trouble; however, in order
to get my machine to be able to boot, this patch adds a check that
MMIO is enabled for the device, and if it isn't, leaves the device
alone.  With this patch my powerbook will boot.

Signed-off-by: Paul Mackerras <paulus@samba.org>
---

diff -urN powerpc-merge/drivers/usb/host/pci-quirks.c merge-hack/drivers/usb/host/pci-quirks.c
--- powerpc-merge/drivers/usb/host/pci-quirks.c	2005-10-31 13:15:27.000000000 +1100
+++ merge-hack/drivers/usb/host/pci-quirks.c	2005-11-01 14:47:47.000000000 +1100
@@ -286,6 +286,11 @@
 
 static void __devinit quirk_usb_early_handoff(struct pci_dev *pdev)
 {
+	u16 cmd;
+
+	if (pci_read_config_word(pdev, PCI_COMMAND, &cmd) ||
+	    (cmd & PCI_COMMAND_MEMORY) == 0)
+		return;
 	if (pdev->class == PCI_CLASS_SERIAL_USB_UHCI)
 		quirk_usb_handoff_uhci(pdev);
 	else if (pdev->class == PCI_CLASS_SERIAL_USB_OHCI)

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-11-02 21:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-01  4:03 [PATCH] Don't touch USB controllers with MMIO disabled in quirks Paul Mackerras
2005-11-01  4:33 ` Linus Torvalds
2005-11-01  4:48   ` Paul Mackerras
2005-11-01 15:32   ` Alan Stern
2005-11-01 15:54     ` Linus Torvalds
2005-11-01 16:43       ` Alan Stern
2005-11-02 21:13       ` Benjamin Herrenschmidt
2005-11-01  4:50 ` David Brownell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox