From patchwork Mon Apr 25 02:10:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 8922471 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-renesas-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8678A9F1D3 for ; Mon, 25 Apr 2016 02:11:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 865242015A for ; Mon, 25 Apr 2016 02:11:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 66FF820154 for ; Mon, 25 Apr 2016 02:11:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753371AbcDYCLD (ORCPT ); Sun, 24 Apr 2016 22:11:03 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:57984 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751940AbcDYCLB (ORCPT ); Sun, 24 Apr 2016 22:11:01 -0400 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie2.idc.renesas.com with ESMTP; 25 Apr 2016 11:10:55 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 985BD46F1F; Mon, 25 Apr 2016 11:10:55 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id 973E58002E; Mon, 25 Apr 2016 11:10:55 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 918378002D; Mon, 25 Apr 2016 11:10:55 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac1.idc.renesas.com with ESMTP id MAQ06043; Mon, 25 Apr 2016 11:10:55 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'208";a="210027499" Received: from mail-sg2apc01lp0240.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.240]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 25 Apr 2016 11:10:54 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=uW7uh1AUTfZDqkTbLuZIijo4xz/vYqcBgZ5FFVncM40=; b=Oi3zZtqSSSestyzP0hL0XTrSAlaB+ESgCSh4Uf/njx5Lx/w4Ww5cA2ga0wDSQve9JxC84cm+oL29BR9whEShgrEkB+g7VSgWexseYc95F9i/YK1sxlrWYysURs+wG+HkN+KWhLT4GlBn9Gpb0v6czy5qGuZERTnFjv2sKA2Q8S4= Received: from SG2PR06MB0919.apcprd06.prod.outlook.com (10.162.204.152) by SG2PR06MB0917.apcprd06.prod.outlook.com (10.162.200.158) with Microsoft SMTP Server (TLS) id 15.1.466.19; Mon, 25 Apr 2016 02:10:52 +0000 Received: from SG2PR06MB0919.apcprd06.prod.outlook.com ([10.162.204.152]) by SG2PR06MB0919.apcprd06.prod.outlook.com ([10.162.204.152]) with mapi id 15.01.0466.024; Mon, 25 Apr 2016 02:10:52 +0000 From: Yoshihiro Shimoda To: Rob Herring , Felipe Balbi CC: Mathias Nyman , Greg Kroah-Hartman , Linux USB List , "linux-renesas-soc@vger.kernel.org" , stable Subject: RE: [PATCH v2] usb: host: xhci-rcar: Avoid long wait in xhci_reset() Thread-Topic: [PATCH v2] usb: host: xhci-rcar: Avoid long wait in xhci_reset() Thread-Index: AQHRnHZ6O2AbJfJg50qozvTcGnKxvp+VvAcAgABA+YCAA/KXsA== Date: Mon, 25 Apr 2016 02:10:52 +0000 Message-ID: References: <1461316076-1444-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> <87mvom7zo5.fsf@intel.com> In-Reply-To: Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=renesas.com; x-originating-ip: [211.11.155.144] x-ms-office365-filtering-correlation-id: 040ea362-166a-4ec5-0aa2-08d36caed421 x-microsoft-exchange-diagnostics: 1; SG2PR06MB0917; 5:VFtCoqACRihofQs9aLYbR+cHYGt4TvztZ5CGw4YZQI6No3fl+yxOP/aeiTzkH+QCuBnSPcTtI5yTqTBSdIvex5CVpGMusuKC3xudkKr+Kxs+6/emyVQk4tDggtA50q5NWzAcGVaVcIbn94MOXQ5f+SzwJWsusRZrV3CBIY07c38rO8EJ2fXuZfgwADiKYNHA; 24:WoKcM3KPWNbQK6aQE/8UEj1A6S94ufbwyI/jKkcPTvp3Pc6YmowebbWkOVECk0U2abY4nIHJaJtom/ZIiZvU6EaJ4BTl6W3b0hcUuLKAGDo=; 7:j033vJmAKO3yvVFMjvsymOb56nEmeGxqUhZI81I/+zGW15zPfIGnlkBPxQVkjNcot1gKVWeGtx6RNB2uS4oh2g9oMmPRIdCmg0EoML5KFF8UEsda5NYZPIcZ6WSewIouF9ulH8G4L0P9IgxamyFa3PHYruziIIhndFynd43+p00u54eZanKd/OTNp3lmmS4/vVGQ7RmhN0pMTcWKZxjbnjSgtmh8N5NP6V8fIzQ7XDA=; 20:z6u16wmWKjXP51OtSVEoLdakYwoFe2YdIb6mzIRpRgq9HTyVgMETsABbVe1hKk5egmzO0eGMAwTeSgFa5ZnDnB7/7/cmZEEK/8KXHlH7AQca2DoEq1Q0tOoIb0K5lgk4BEjUVfkzqrwn2IgRwv8eSdnBLtUPqT3ys9O5Dfn+Jxo= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SG2PR06MB0917; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(9101521026)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:SG2PR06MB0917; BCL:0; PCL:0; RULEID:; SRVR:SG2PR06MB0917; x-forefront-prvs: 0923977CCA x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(377454003)(24454002)(19580395003)(19580405001)(4326007)(74316001)(5004730100002)(76576001)(11100500001)(2906002)(66066001)(5008740100001)(3846002)(6116002)(586003)(102836003)(122556002)(77096005)(1220700001)(1096002)(5001770100001)(5002640100001)(189998001)(50986999)(3660700001)(54356999)(76176999)(5003600100002)(81166005)(86362001)(33656002)(10400500002)(92566002)(9686002)(87936001)(106116001)(3280700002)(15975445007)(2950100001); DIR:OUT; SFP:1102; SCL:1; SRVR:SG2PR06MB0917; H:SG2PR06MB0919.apcprd06.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Apr 2016 02:10:52.6385 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB0917 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, > From: Rob Herring > Sent: Friday, April 22, 2016 10:29 PM > > On Fri, Apr 22, 2016 at 4:36 AM, Felipe Balbi > wrote: > > > > Hi, > > > > Yoshihiro Shimoda writes: > >> The firmware of R-Car USB 3.0 host controller will control the reset. > >> So, if the xhci driver doesn't do firmware downloading (e.g. kernel > >> configuration is CONFIG_USB_XHCI_PLATFORM=y and CONFIG_USB_XHCI_RCAR > >> is not set), the reset of USB 3.0 host controller doesn't work > >> correctly. Then, the host controller will cause long wait in > >> xhci_reset() because the CMD_RESET bit of op_regs->command is not > >> cleared for 10 seconds. > >> > >> So, this patch modifies the xhci_rcar_init_quirk() in xhci-rcar.h > >> to exit the probe function immediately. > >> > >> Fixes: 4ac8918f3a7 (usb: host: xhci-plat: add support for the R-Car H2 and M2 xHCI controllers) > >> Cc: # v3.17+ > >> Signed-off-by: Yoshihiro Shimoda > >> --- > >> Changes from v1: > >> - Revise the commit log. > >> (http://www.spinics.net/lists/stable/msg130007.html) > >> > >> drivers/usb/host/xhci-rcar.h | 6 +++++- > >> 1 file changed, 5 insertions(+), 1 deletion(-) > >> > >> diff --git a/drivers/usb/host/xhci-rcar.h b/drivers/usb/host/xhci-rcar.h > >> index 2941a25..2afed68 100644 > >> --- a/drivers/usb/host/xhci-rcar.h > >> +++ b/drivers/usb/host/xhci-rcar.h > >> @@ -24,7 +24,11 @@ static inline void xhci_rcar_start(struct usb_hcd *hcd) > >> > >> static inline int xhci_rcar_init_quirk(struct usb_hcd *hcd) > >> { > >> - return 0; > >> + /* > >> + * To avoid wait and timeout in xhci_reset() if CONFIG_XHCI_RCAR is > >> + * disabled, this function fails. > >> + */ > >> + return -ENODEV; > > > > okay, if I understood correctly the thing is that you have a kernel > > built with XHCI platform support but without XHCI RCAR support. Then, if > > you run this kernel on RCAR board, you see this CMD_RESET problem, > > right? > > > > Isn't this pointing to the fact that xhci-plat.ko built without RCAR > > isn't exactly compatible with RCAR ? > > > > IOW: > > > > diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c > > index 676ea458148b..3e39320564ce 100644 > > --- a/drivers/usb/host/xhci-plat.c > > +++ b/drivers/usb/host/xhci-plat.c > > @@ -112,6 +112,7 @@ static const struct of_device_id usb_xhci_of_match[] = { > > }, { > > .compatible = "marvell,armada-380-xhci", > > .data = &xhci_plat_marvell_armada, > > +#if IS_ENABLED(CONFIG_USB_XHCI_RCAR) > > }, { > > .compatible = "renesas,xhci-r8a7790", > > .data = &xhci_plat_renesas_rcar_gen2, > > @@ -130,6 +131,7 @@ static const struct of_device_id usb_xhci_of_match[] = { > > }, { > > .compatible = "renesas,rcar-gen3-xhci", > > .data = &xhci_plat_renesas_rcar_gen3, > > +#endif > > }, > > {}, > > }; > > > > Rob, should we limit compatible flags like this ? Without > > CONFIG_USB_XHCI_RCAR, this driver won't work on RCAR but, as you can > > see, this driver might still work on other non-RCAR platforms. > > > > What's your take on this ? > > We should fix this in kconfig to always enable the option when RCAR is > enabled IMO. I could fix this in kconfig like the followings: If this is acceptable, I will send each patch to arm / arm64. Best regards, Yoshihiro Shimoda > Rob diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index f2bc5c3..905d1d2 100644 --- a/arch/arm/mach-shmobile/Kconfig +++ b/arch/arm/mach-shmobile/Kconfig @@ -46,6 +46,7 @@ menuconfig ARCH_RENESAS select PINCTRL select ARCH_REQUIRE_GPIOLIB select ZONE_DMA if ARM_LPAE + select USB_XHCI_RCAR if USB_XHCI_HCD if ARCH_RENESAS diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms index efa77c1..010d2b7 100644 --- a/arch/arm64/Kconfig.platforms +++ b/arch/arm64/Kconfig.platforms @@ -105,6 +105,7 @@ config ARCH_RENESAS select PM select PM_GENERIC_DOMAINS select RENESAS_IRQC + select USB_XHCI_RCAR if USB_XHCI_HCD help This enables support for the ARMv8 based Renesas SoCs.