public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Engraf <david.engraf@netcom.eu>
To: linux-kernel@vger.kernel.org
Cc: linux-pci@atrey.karlin.mff.cuni.cz, gregkh@suse.de,
	linux-usb-devel@lists.sourceforge.net, david.engraf@netcom.eu
Subject: [PATCH] USB BIOS early handoff only when the we the driver is configured
Date: Tue, 31 Jul 2007 10:31:03 +0200	[thread overview]
Message-ID: <46AEF347.9030007@netcom.eu> (raw)

When CONFIG_USB_UHCI_HCD, CONFIG_USB_OHCI_HCD or CONFIG_USB_EHCI_HCD is
not configured we don't need to call the quirk_usb_handoff_xxxx function
in driver/usb/host/pci_quiks.c.

I think the kernel shouldn't take the control over the usb controller
when we don't have the driver for it,
so with this patch the kernel takes the control only when the driver is
configured.


linux-2.6.22.1

diff -puN drivers/usb/host/pci-quirks_orig.c drivers/usb/host/pci-quirks.c
--- drivers/usb/host/pci-quirks_orig.c    2007-07-10 20:56:30.000000000
+0200
+++ drivers/usb/host/pci-quirks.c    2007-07-31 09:55:28.000000000 +0200
@@ -142,6 +142,7 @@ static inline int io_type_enabled(struct
 #define pio_enabled(dev) io_type_enabled(dev, PCI_COMMAND_IO)
 #define mmio_enabled(dev) io_type_enabled(dev, PCI_COMMAND_MEMORY)
 
+#ifdef CONFIG_USB_UHCI_HCD
 static void __devinit quirk_usb_handoff_uhci(struct pci_dev *pdev)
 {
     unsigned long base = 0;
@@ -159,12 +160,14 @@ static void __devinit quirk_usb_handoff_
     if (base)
         uhci_check_and_reset_hc(pdev, base);
 }
+#endif
 
 static int __devinit mmio_resource_enabled(struct pci_dev *pdev, int idx)
 {
     return pci_resource_start(pdev, idx) && mmio_enabled(pdev);
 }
 
+#ifdef CONFIG_USB_OHCI_HCD
 static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev)
 {
     void __iomem *base;
@@ -209,7 +212,9 @@ static void __devinit quirk_usb_handoff_
 
     iounmap(base);
 }
+#endif
 
+#ifdef CONFIG_USB_EHCI_HCD
 static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev)
 {
     int wait_time, delta;
@@ -346,16 +351,24 @@ static void __devinit quirk_usb_disable_
 
     return;
 }
-
+#endif
 
 
 static void __devinit quirk_usb_early_handoff(struct pci_dev *pdev)
 {
+#ifdef CONFIG_USB_UHCI_HCD
     if (pdev->class == PCI_CLASS_SERIAL_USB_UHCI)
         quirk_usb_handoff_uhci(pdev);
-    else if (pdev->class == PCI_CLASS_SERIAL_USB_OHCI)
+#endif
+
+#ifdef CONFIG_USB_OHCI_HCD
+    if (pdev->class == PCI_CLASS_SERIAL_USB_OHCI)
         quirk_usb_handoff_ohci(pdev);
-    else if (pdev->class == PCI_CLASS_SERIAL_USB_EHCI)
+#endif
+
+#ifdef CONFIG_USB_EHCI_HCD
+    if (pdev->class == PCI_CLASS_SERIAL_USB_EHCI)
         quirk_usb_disable_ehci(pdev);
+#endif
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, quirk_usb_early_handoff);


Thanks

David Engraf

 

 
Netcom Sicherheitstechnik GmbH
Rheinallee 189
55120 Mainz
Tel: 	+49 6131 6305 0
Fax: 	+49 6131 6305 40
Email: 	david.engraf@netcom.eu

 
Sitz der Gesellschaft: Mainz
Registergericht: Amtsgericht Mainz, 14HRB3411
Geschäftsführer: Peter Otto


             reply	other threads:[~2007-07-31  8:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-31  8:31 David Engraf [this message]
2007-07-31 15:04 ` [linux-usb-devel] [PATCH] USB BIOS early handoff only when the we the driver is configured Alan Stern
     [not found]   ` <46B03078.5040305@netcom.eu>
2007-08-01  7:21     ` David Engraf
2007-08-01 20:23       ` Greg KH
2007-08-02  7:07         ` David Engraf
2007-08-01 14:40     ` Alan Stern
2007-08-02  7:14       ` David Engraf
2007-08-02 14:32         ` Alan Stern
2007-08-02 16:43           ` Greg KH
2007-08-03  6:52             ` David Engraf
2007-08-03 15:03               ` Alan Stern
2007-08-07  8:44                 ` David Engraf
2007-08-07 14:37                   ` Alan Stern
2007-08-03 22:24             ` Grant Grundler

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=46AEF347.9030007@netcom.eu \
    --to=david.engraf@netcom.eu \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@atrey.karlin.mff.cuni.cz \
    --cc=linux-usb-devel@lists.sourceforge.net \
    /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