From patchwork Mon Apr 25 08:36:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 8924371 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-renesas-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DA9BEBF29F for ; Mon, 25 Apr 2016 08:37:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C292020173 for ; Mon, 25 Apr 2016 08:36:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A777C200E7 for ; Mon, 25 Apr 2016 08:36:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754048AbcDYIg5 (ORCPT ); Mon, 25 Apr 2016 04:36:57 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:31596 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753942AbcDYIgy (ORCPT ); Mon, 25 Apr 2016 04:36:54 -0400 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie3.idc.renesas.com with ESMTP; 25 Apr 2016 17:36:51 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id D1AE43C983; Mon, 25 Apr 2016 17:36:51 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id BF59C480A4; Mon, 25 Apr 2016 17:36:51 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id BAE29480A3; Mon, 25 Apr 2016 17:36:51 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac4.idc.renesas.com with ESMTP id TAN06548; Mon, 25 Apr 2016 17:36:51 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'208";a="210057983" Received: from mail-hk2apc01lp0216.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.216]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 25 Apr 2016 17:36:50 +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=/2htJPWTUChuULTB3CI/e41YBzSE6WfO5yFuS1R2xVE=; b=bEqdCSzEpzXQVaKm7NOghiRyTU69lKDWkTP1D46byhYDynIhQRN638WMhwLsV9/AnAKlt4K13Kty+/RKHfROxq8xGyRlG3iMfYgL/UKxT9lc9hfbuq9EUbEMoSJIan5LNWf0omu4BLyn/TW5W0lofhuWA7UaNJn0wjPaORTKCr8= Received: from SG2PR06MB0919.apcprd06.prod.outlook.com (10.162.204.152) by SG2PR06MB0920.apcprd06.prod.outlook.com (10.162.204.153) with Microsoft SMTP Server (TLS) id 15.1.466.19; Mon, 25 Apr 2016 08:36:49 +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 08:36:49 +0000 From: Yoshihiro Shimoda To: Geert Uytterhoeven CC: Rob Herring , Felipe Balbi , 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/KXsIAAVwkAgAAY8mA= Date: Mon, 25 Apr 2016 08:36:49 +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: linux-m68k.org; dkim=none (message not signed) header.d=none; linux-m68k.org; dmarc=none action=none header.from=renesas.com; x-originating-ip: [211.11.155.144] x-ms-office365-filtering-correlation-id: 2bda7ba9-45bc-4506-f0da-08d36ce4be8d x-microsoft-exchange-diagnostics: 1; SG2PR06MB0920; 5:PG1uajtZl0dFMd4jsSrj8KMnsyjK5KCvqMdaPKm2DESirIigosUP5hV+qizAiPnLMaASlSICO8Z4EkqAHyewik/4RxhnMehdlIFo/edcK5Xb44932tQivVZgY0dflQHeQQszPv6Bxz27790SicgSx+nABbsiF0V6im3lBnDK1bZqGK+JqBpbq5tBCM4y5wv6; 24:K/Y0xvja+ehdmH2HfXT8ooSPXLiZPW50BAQBSRp3bxWjZup8DPNqAzILBKWpR22l3ygR4Ha3XrVvAdxUHAc0oDTYdyntpf49ZjG/vwpyup4=; 7:DXZWK56X+g93d0dFRSpnCYlrFajqTOiKV6edNAEXXdfrhK168VJVTMZtyYK3PR+w/yKpgmetmsR6x74hR/+owoFGBIjJtQBRHgBfRo8ph2aqM6LsKaM7GSx9GodLv1FzLx86Gp8b3n0SFK/pvmdcmw4sALf8mchcVvlcwlytufES0R5rugYQeKfoWU5HAJ9n3lZ2XZZem0nYE29ofHMrUIKRqNGHL8S0B4GsqvATg1M=; 20:JLBnvXN229UCLvPETdFOxRGTPBZpvkLdf5Dz0ZSykrcG7/3Z2PYiA2OeErQaZSm63FPCLFNLw7JVPMmLhS650yLJMqkaI7PfuPpjF4Wwf+jReoVImOnkMh2A+59xQs1B2qSr8Qanjs9Gj8hrX6UuZjDd7LIivFBski8jVDZ14dg= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SG2PR06MB0920; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(9101521062)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:SG2PR06MB0920; BCL:0; PCL:0; RULEID:; SRVR:SG2PR06MB0920; x-forefront-prvs: 0923977CCA x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(377454003)(24454002)(11100500001)(5004730100002)(5008740100001)(86362001)(33656002)(15975445007)(77096005)(106116001)(50986999)(19580405001)(5002640100001)(54356999)(66066001)(19580395003)(76176999)(4326007)(87936001)(189998001)(3660700001)(74316001)(110136002)(92566002)(5003600100002)(1096002)(1220700001)(6116002)(102836003)(345774005)(586003)(9686002)(2900100001)(76576001)(122556002)(2950100001)(93886004)(81166005)(10400500002)(2906002)(3280700002)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:SG2PR06MB0920; 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 08:36:49.3594 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB0920 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 Geert-san, > From: Geert Uytterhoeven > Sent: Monday, April 25, 2016 3:58 PM > > Hi Shimoda-san, > > On Mon, Apr 25, 2016 at 4:10 AM, Yoshihiro Shimoda > wrote: > >> From: Rob Herring > >> Sent: Friday, April 22, 2016 10:29 PM > >> On Fri, Apr 22, 2016 at 4:36 AM, Felipe Balbi > >> wrote: > >> > 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? > > [...] > > >> 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: > > > > 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. > > > > If this is acceptable, I will send each patch to arm / arm64. > > What about enforcing this in a single place instead, i.e. in > drivers/usb/host/Kconfig? Thank you for the suggestion. I could make such a patch. I prefer this than each arm / arm64 patch. Best regards, Yoshihiro Shimoda > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 3050b18..e9d4dde 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -35,6 +35,7 @@ config USB_XHCI_PCI config USB_XHCI_PLATFORM tristate "Generic xHCI driver for a platform device" + select USB_XHCI_RCAR if ARCH_RENESAS ---help--- Adds an xHCI host driver for a generic platform device, which provides a memory space and an irq. @@ -63,7 +64,7 @@ config USB_XHCI_MVEBU config USB_XHCI_RCAR tristate "xHCI support for Renesas R-Car SoCs" - select USB_XHCI_PLATFORM + depends on USB_XHCI_PLATFORM depends on ARCH_RENESAS || COMPILE_TEST ---help--- Say 'Y' to enable the support for the xHCI host controller