From patchwork Mon May 27 20:38:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 17234 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gg0-f200.google.com (mail-gg0-f200.google.com [209.85.161.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5CE0B238E8 for ; Mon, 27 May 2013 20:39:23 +0000 (UTC) Received: by mail-gg0-f200.google.com with SMTP id w6sf7887212ggk.3 for ; Mon, 27 May 2013 13:38:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-beenthere:x-forwarded-to:x-forwarded-for:delivered-to:from:to :subject:date:user-agent:cc:references:in-reply-to:mime-version :message-id:x-provags-id:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type:content-transfer-encoding; bh=FG0acyOkfws/R3a7jJWpCfIt84Yg6Ri8lIoLeJoS7o0=; b=RYS4ZPNJto2uJ0tPyNO8lszeBo4/S3aded8UItzinfEYR9f7UUjS4k/EBP9OnVplej DAwTUfHGNFR/6Om232yx8Kuaim8aDoecMf6MU9YnDZte5MD/A9Yhy0jhtGHHoqkssLs9 xrQv4TV9VlKnXeeZGI7BiiMQ0S8YJHs3IW1WQvsSp2FFr+x3VuKNrDrdjfHKUo98t35w zS+aDJzlzp4fmz8I47lcxd8uOnR/D/8XpeBmlpNZroi5+SxGsux/d9YHksweevkUbBqI Nbf4P4cFjcUe/LbNY325Vx5PcYEy5UahVbke1w1D4bd2vhVKac5dgCKSbhinkPR1FTd2 WXjw== X-Received: by 10.236.139.67 with SMTP id b43mr15538287yhj.26.1369687098064; Mon, 27 May 2013 13:38:18 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.98.166 with SMTP id ej6ls3187088qeb.37.gmail; Mon, 27 May 2013 13:38:17 -0700 (PDT) X-Received: by 10.220.85.204 with SMTP id p12mr16180499vcl.1.1369687097790; Mon, 27 May 2013 13:38:17 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id p20si17471870veh.30.2013.05.27.13.38.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 May 2013 13:38:17 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.169; Received: by mail-vc0-f169.google.com with SMTP id kw10so5037350vcb.28 for ; Mon, 27 May 2013 13:38:17 -0700 (PDT) X-Received: by 10.52.233.34 with SMTP id tt2mr13595997vdc.70.1369687097255; Mon, 27 May 2013 13:38:17 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.229.199 with SMTP id jj7csp11901vcb; Mon, 27 May 2013 13:38:16 -0700 (PDT) X-Received: by 10.14.182.5 with SMTP id n5mr11185544eem.151.1369687095593; Mon, 27 May 2013 13:38:15 -0700 (PDT) Received: from moutng.kundenserver.de (moutng.kundenserver.de. [212.227.126.171]) by mx.google.com with ESMTPS id z42si12971674eel.88.2013.05.27.13.38.14 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 27 May 2013 13:38:15 -0700 (PDT) Received-SPF: neutral (google.com: 212.227.126.171 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) client-ip=212.227.126.171; Received: from klappe2.localnet (HSI-KBW-095-208-002-043.hsi5.kabel-badenwuerttemberg.de [95.208.2.43]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0LiIi3-1U2Ysw24e3-00nLkv; Mon, 27 May 2013 22:38:13 +0200 From: Arnd Bergmann To: Manjunath Goudar Subject: Re: [RFC V7 PATCH 3/3] USB: OHCI: make ohci-pci a separate driver Date: Mon, 27 May 2013 22:38:08 +0200 User-Agent: KMail/1.12.2 (Linux/3.8.0-22-generic; KDE/4.3.2; x86_64; ; ) Cc: linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, patches@linaro.org, stern@rowland.harvard.edu, linaro-dev@lists.linaro.org, Greg KH References: <1365746856-7772-2-git-send-email-manjunath.goudar@linaro.org> <1369657550-24101-1-git-send-email-manjunath.goudar@linaro.org> <1369657550-24101-4-git-send-email-manjunath.goudar@linaro.org> In-Reply-To: <1369657550-24101-4-git-send-email-manjunath.goudar@linaro.org> MIME-Version: 1.0 Message-Id: <201305272238.08984.arnd@arndb.de> X-Provags-ID: V02:K0:fEpywTBcMbvw6hMEBM5Bqp1fbubmCUD+1vRknX+RRJD 9H9/mx7RegOEV+o5qTtULh7maBqbVQeVolUUsdtfamxDjuvane xuqXIZwDaAcKPVWN1YtBmLkkmGI/OMtUzrAzUfpaRmCsSPuj2G cf0j07cesfAtjm01Lu3WPR8PeE9e8W4YmsjLavUeIJ2yTSDOxJ /G9sDssbmy3AlBXk9CDgVEDuCFZY1UotugHLfbmq/R5b+OTYfb fePN9DJLZXWSenAsSsjlFrl/Sg70ZUD7NxSFcco9rbAiC8enw0 Ug1AXF1COS3aPkILEuMft08FshebDn5zzDne7UNYVUvagEUsIL cK8q3+T1EH/Emw9U0O9o= X-Gm-Message-State: ALoCoQmkUmAiO9WbSPzqZV+GIZIRjESZ+CXtDQO2uEFxSHFwmt71rhpNC47YXWgnOux7krpwEjVf X-Original-Sender: arnd@arndb.de X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 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.