From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC V7 PATCH 3/3] USB: OHCI: make ohci-pci a separate driver
Date: Mon, 27 May 2013 22:38:08 +0200 [thread overview]
Message-ID: <201305272238.08984.arnd@arndb.de> (raw)
In-Reply-To: <1369657550-24101-4-git-send-email-manjunath.goudar@linaro.org>
On Monday 27 May 2013, Manjunath Goudar wrote:
> This patch splits the PCI portion of ohci-hcd out into its
> own separate driver module, called ohci-pci.
>
> The major point of difficulty lies in ohci-pci's many vendor- and
> device-specific workarounds. Some of them have to be applied before
> calling ohci_start() some after, which necessitates a fair amount of
> code motion. The other platform drivers require much smaller changes.
>
> The complete sb800_prefetch() function moved to ohci-q.c,because its
> only related to ohci-pci driver.
I just gave this a little test run in qemu and on my server.
> @@ -446,7 +446,7 @@ config USB_OHCI_HCD_PPC_OF
> default USB_OHCI_HCD_PPC_OF_BE || USB_OHCI_HCD_PPC_OF_LE
>
> config USB_OHCI_HCD_PCI
> - bool "OHCI support for PCI-bus USB controllers"
> + tristate "OHCI support for PCI-bus USB controllers"
> depends on PCI && (STB03xxx || PPC_MPC52xx || USB_OHCI_HCD_PPC_OF)
> default y
> select USB_OHCI_LITTLE_ENDIAN
There is a preexisting bug in this symbol: USB_OHCI_HCD_PCI was previously
unused, and has a bogus 'depends' line, which causes it to not be selectable
on anything but PPC.
You have to change this to only 'depends on PCI'.
> }
> - if (ret == 0) {
> - ohci_hcd_init (ohci);
> - return ohci_init (ohci);
> - }
> - return ret;
> -}
I found that the call to ohci_hcd_init() that is removed here is not getting
added in any other place, which caused a NULL pointer dereference the first
time we actually try to use the driver.
Adding the call back into the new ohci_setup function makes it work again.
Please fold the patch below into your patch, unless Alan discovers something
wrong with it.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index f948e8f..eef6dc5 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -454,7 +454,7 @@ config USB_OHCI_HCD_PPC_OF
config USB_OHCI_HCD_PCI
tristate "OHCI support for PCI-bus USB controllers"
- depends on PCI && (STB03xxx || PPC_MPC52xx || USB_OHCI_HCD_PPC_OF)
+ depends on PCI
default y
select USB_OHCI_CORE
select USB_OHCI_LITTLE_ENDIAN
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 3da8c3a..5601139 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -763,6 +763,8 @@ int ohci_setup(struct usb_hcd *hcd)
{
struct ohci_hcd *ohci = hcd_to_ohci(hcd);
+ ohci_hcd_init(ohci);
+
return ohci_init(ohci);
}
EXPORT_SYMBOL_GPL(ohci_setup);
diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c
index ea088c1..3133354 100644
--- a/drivers/usb/host/ohci-pci.c
+++ b/drivers/usb/host/ohci-pci.c
@@ -250,7 +250,7 @@ static int ohci_pci_reset (struct usb_hcd *hcd)
}
}
if (ret == 0)
- ohci_setup(hcd);
+ ret = ohci_setup(hcd);
/*
* After ohci setup RWC may not be set for add-in PCI cards.
* This transfers PCI PM wakeup capabilities.
next prev parent reply other threads:[~2013-05-27 20:38 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1365746856-7772-2-git-send-email-manjunath.goudar@linaro.org>
2013-05-07 9:50 ` [RFC PATCH 0/2] USB: OHCI: Start splitting up the driver Manjunath Goudar
2013-05-07 9:50 ` [RFC PATCH 1/2] USB: OHCI: prepare to make ohci-hcd a library module Manjunath Goudar
2013-05-07 15:15 ` Alan Stern
2013-05-07 9:50 ` [RFC PATCH 2/2] USB: OHCI: make ohci-pci a separate driver Manjunath Goudar
2013-05-23 11:11 ` [RFC V6 PATCH 0/3] USB: OHCI: Start splitting up the driver Manjunath Goudar
2013-05-23 11:11 ` [RFC V6 PATCH 1/3] USB: OHCI: prepare to make ohci-hcd a library module Manjunath Goudar
2013-05-23 14:27 ` Alan Stern
2013-05-23 11:11 ` [RFC PATCH 2/3] USB: OHCI: Generic changes to make ohci-pci a separate driver Manjunath Goudar
2013-05-23 13:26 ` Arnd Bergmann
2013-05-23 14:30 ` Alan Stern
2013-05-23 11:11 ` [RFC V6 PATCH 3/3] USB: OHCI: " Manjunath Goudar
2013-05-23 14:37 ` Alan Stern
2013-05-23 17:01 ` Arnd Bergmann
2013-05-23 17:37 ` Alan Stern
2013-05-23 17:42 ` Arnd Bergmann
2013-05-27 12:25 ` [RFC V7 PATCH 0/3] USB: OHCI: Start splitting up the driver Manjunath Goudar
2013-05-27 12:25 ` [RFC V7 PATCH 1/3] USB: OHCI: prepare to make ohci-hcd a library module Manjunath Goudar
2013-05-27 14:54 ` Alan Stern
2013-05-27 12:25 ` [RFC V7 PATCH 2/3] USB: OHCI: Generic changes to make ohci-pci a separate driver Manjunath Goudar
2013-05-27 14:55 ` Alan Stern
2013-05-27 12:25 ` [RFC V7 PATCH 3/3] USB: OHCI: " Manjunath Goudar
2013-05-27 14:58 ` Alan Stern
2013-05-27 20:38 ` Arnd Bergmann [this message]
2013-05-27 13:29 ` [RFC V7 PATCH 0/3] USB: OHCI: Start splitting up the driver Viresh Kumar
2013-05-28 13:04 ` [PATCH V8 " Manjunath Goudar
2013-05-28 13:04 ` [PATCH V8 1/3] USB: OHCI: prepare to make ohci-hcd a library module Manjunath Goudar
2013-05-28 13:04 ` [PATCH V8 2/3] USB: OHCI: Generic changes to make ohci-pci a separate driver Manjunath Goudar
2013-05-28 13:04 ` [PATCH V8 3/3] USB: OHCI: " Manjunath Goudar
2013-05-28 15:27 ` Alan Stern
2013-05-28 20:11 ` [PATCH V8 0/3] USB: OHCI: Start splitting up the driver Arnd Bergmann
2013-05-29 16:21 ` Alan Stern
2013-05-29 18:08 ` Arnd Bergmann
2013-05-29 18:16 ` Alan Stern
2013-05-29 22:02 ` Arnd Bergmann
2013-05-31 14:12 ` Alan Stern
2013-05-31 14:57 ` Arnd Bergmann
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=201305272238.08984.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.