From: Paul Mackerras <paulus@samba.org>
To: akpm@osdl.org, torvalds@osdl.org
Cc: David Brownell <david-b@pacbell.net>,
Alan Stern <stern@rowland.harvard.edu>,
Greg Kroah-Hartman <gregkh@suse.de>,
linux-kernel@vger.kernel.org
Subject: [PATCH] Don't touch USB controllers with MMIO disabled in quirks
Date: Tue, 1 Nov 2005 15:03:54 +1100 [thread overview]
Message-ID: <17254.59690.713323.294726@cargo.ozlabs.ibm.com> (raw)
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)
next reply other threads:[~2005-11-01 4:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-01 4:03 Paul Mackerras [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=17254.59690.713323.294726@cargo.ozlabs.ibm.com \
--to=paulus@samba.org \
--cc=akpm@osdl.org \
--cc=david-b@pacbell.net \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®