From patchwork Wed Jun 1 06:44:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 9146115 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 109E660751 for ; Wed, 1 Jun 2016 06:45:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 01BCF1FFB9 for ; Wed, 1 Jun 2016 06:45:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EA7C623749; Wed, 1 Jun 2016 06:45:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 686F91FFB9 for ; Wed, 1 Jun 2016 06:45:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757393AbcFAGpI (ORCPT ); Wed, 1 Jun 2016 02:45:08 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:42990 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757336AbcFAGpG (ORCPT ); Wed, 1 Jun 2016 02:45:06 -0400 Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie2.idc.renesas.com with ESMTP; 01 Jun 2016 15:45:05 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id 235FB50751; Wed, 1 Jun 2016 15:45:05 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id 0B4678002E; Wed, 1 Jun 2016 15:45:05 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 03DDE8002D; Wed, 1 Jun 2016 15:45:05 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac1.idc.renesas.com with ESMTP id RAM08685; Wed, 1 Jun 2016 15:45:05 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="212509452" Received: from mail-sg2apc01lp0241.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.241]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 01 Jun 2016 15:45:04 +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=z0KTGRKN+YbSOd6fK+nStzTVl5dtK5DVkdjbMrkBuaY=; b=kixYSBrJDompBO+NiV58zrldlL9ZCTw+uNSX3XV92Z09d3WMlpkkF00gEdQo/Gi0o2yag8w6CdPzvXSS3yMXJ7UC1ao3mzyJJeXtPQYlFlqGgZkA/swqvXwmvYE4fVw8uA3OMTgCyy63qr/OzWm8+aSzwVG6FcsmVWimeLLQ6uo= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none; intel.com; dmarc=none action=none header.from=renesas.com; Received: from localhost (211.11.155.144) by SG2PR06MB0920.apcprd06.prod.outlook.com (10.162.204.153) with Microsoft SMTP Server (TLS) id 15.1.506.9; Wed, 1 Jun 2016 06:45:02 +0000 From: Yoshihiro Shimoda To: , CC: , , Yoshihiro Shimoda Subject: [PATCH v2 2/2] usb: host: xhci: rcar: fix the quirks setting of XHCI_NO_64BIT_SUPPORT Date: Wed, 1 Jun 2016 15:44:43 +0900 Message-ID: <1464763483-6224-3-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.4.msysgit.1 In-Reply-To: <1464763483-6224-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1464763483-6224-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TY1PR01CA0085.jpnprd01.prod.outlook.com (10.167.153.173) To SG2PR06MB0920.apcprd06.prod.outlook.com (10.162.204.153) X-MS-Office365-Filtering-Correlation-Id: be396eea-4da6-4ad0-71bb-08d389e84284 X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB0920; 2:qgkpSll4BCiF3F/gngx/FxfH+bs0zwVRd1dyhUwiJTesXVANVue+srpiuEy2+r93Arr896aGXQAduOXNA4RO+OMaNeJhxB2abikfVH7gAF2Ck6CGEPIM0x0NKWG1uo01r+VosLJB103+N1sLSUURoK2QTEXDxlZxTpg1iSacnHqx6s6or6n02wtD7G16w2kQ; 3:p9tsIu8hyNhF/qnC70LqzTpuF2vgcZFPqPPZuZCly/nbST2oelSyTtzgEn0P8plHzxRjExzDDf9CcJc789mtoLipPoVmiZnvAlOzrWH2XJX48qB2hVJC8KFGtUovxVXe; 25:164ysjfqDrDqg1flb1emvJdFTmAgeRrkSiy8/O8ckz+SEMfmk2v2jxeTQB6pibKE1AiuLIDEfoUg0khwQ+MaX8cHqGT6mODi8oS3EmDFuP+p9kWlDmvaKVq1Nz/Q0PEyNAJdjXuIVtQCi87L5Sw971HZfEhCKziKGxagi+CubxHPbCcvDCN63jpTJcdPEd99K+aN7mjztvEEqtFxHGd5nMQf5mbIyUlOyZlF8y2QX/x6j6kb2VONEek4SrSoo/6CRqyR9zgvMpgGy4DXvhpkI2XNLZ5tZ9oJ/Qb/2TLLHXG+I6orXZsE4ybSSaVaG5c7hxJQUtdqXNUK/lFtqUOeUU5BxJZ5CSt2KOAma7a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Mq51IGwkfyR3Y8QgVJCGw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:SG2PR06MB0920; BCL:0; PCL:0; RULEID:; SRVR:SG2PR06MB0920; X-Forefront-PRVS: 096029FF66 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6069001)(6009001)(229853001)(5001770100001)(3846002)(77096005)(586003)(107886002)(76506005)(33646002)(81166006)(8676002)(6116002)(189998001)(42186005)(36756003)(78352004)(5004730100002)(5008740100001)(2950100001)(19580395003)(19580405001)(92566002)(5003940100001)(2906002)(4326007)(50986999)(76176999)(4001430100002)(66066001)(47776003)(48376002)(68736007)(50466002)(50226002)(15760500001); DIR:OUT; SFP:1102; SCL:1; SRVR:SG2PR06MB0920; H:localhost; FPR:; SPF:None; MLV:ovrnspm; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SG2PR06MB0920; 23:uBLMgRud7ax64hizvoSevurX7ANhanEvQYskaRnJk?= =?us-ascii?Q?NKD4mG9p1yi25NbbY30KjpUYjFSBdgVIe3SeJIul4SZKg00xiWSWFnPpOhCC?= =?us-ascii?Q?nXqex8rWWHeMWiy0wpqyyBFhsU/pTqNUCI1fxnztCFutk7wPW8eBmQ1y/9gx?= =?us-ascii?Q?SO0XdgKMXjBzTAfph7gEENxNcwM5r2rvxSwr/ctOIak+s4VqVQMqfCkY0bvF?= =?us-ascii?Q?WERXr1gGIZ9keleT06wjQgj3CwLR5fbX8nBbUVCgB5KJVoOUFMKb9OfLrEak?= =?us-ascii?Q?B6tiza8gtokLeeXaZU8GJyN3JYJPgarYGTyeWFNVr9DHzxIDa1P0P4tayXSP?= =?us-ascii?Q?Qpg55JxsFiwrJiuK9TcqPGmYcmV1+lIo85fXCypXggvDIOS9wsztnfzkE68B?= =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TqTgleiaaT8o16dkfriM9gvIY=; 7:vDpKDF2ZQg53LyfGu5tOjF0XhyB/m40XZNPGQyn0VzMnEdzohbuSXFL7Yu9BABkLKZo6p/ImuNe/Cbwp4j/J9jIdWPaiB84xIjQH8hsrwOH/t/Zcd5m2wQ8UGXNBec/QeBa391BKRYYoTOUojR9N+meomqStMUP3SDDqoA+LbitgHCoE0RfcyBpK80sV6J42; 20:VMrQMBcV3nciNByQVyYMV98OjB6nnjdOinz1XZmu9HYwcrt1Mpa5PBu0NesJw/xU9XAbQH1KqAzahZHsYW9Q/x5RGzfpAc1XrVfuARrQHiJ8/shDBMk1SS4gnQpW5i5cjtuq1gS2BuTLZI6P2jOvuHvJBwmbMM/oqe3X13bD2tc= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jun 2016 06:45:02.7953 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted 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-Virus-Scanned: ClamAV using ClamSMTP Since the commit b1c127ae990b ("usb: host: xhci: plat: make use of new methods in xhci_plat_priv") changed the setting timing of xhci->quirks to xhci_rcar_init_quirk(), the quirks was overwritten by xhci_gen_setup(). So, this patch fixes the issue using a "quirks" of struct xhci_plat_priv. Signed-off-by: Yoshihiro Shimoda --- drivers/usb/host/xhci-plat.c | 12 +++++++++++- drivers/usb/host/xhci-plat.h | 1 + drivers/usb/host/xhci-rcar.c | 21 --------------------- 3 files changed, 12 insertions(+), 22 deletions(-) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 676ea45..7f03608 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -57,12 +57,14 @@ static int xhci_priv_init_quirk(struct usb_hcd *hcd) static void xhci_plat_quirks(struct device *dev, struct xhci_hcd *xhci) { + struct xhci_plat_priv *priv = xhci_to_priv(xhci); + /* * As of now platform drivers don't provide MSI support so we ensure * here that the generic code does not try to make a pci_dev from our * dev struct in order to setup MSI */ - xhci->quirks |= XHCI_PLAT; + xhci->quirks |= XHCI_PLAT | priv->quirks; } /* called during probe() after chip reset completes */ @@ -89,16 +91,24 @@ static const struct xhci_plat_priv xhci_plat_marvell_armada = { .init_quirk = xhci_mvebu_mbus_init_quirk, }; +/* + * On R-Car Gen2 and Gen3, the AC64 bit (bit 0) of HCCPARAMS1 is set to 1. + * However, these SoCs don't support 64-bit address memory pointers. So, this + * driver clears the AC64 bit of xhci->hcc_params to call + * dma_set_coherent_mask(dev, DMA_BIT_MASK(32)) in xhci_gen_setup(). + */ static const struct xhci_plat_priv xhci_plat_renesas_rcar_gen2 = { .firmware_name = XHCI_RCAR_FIRMWARE_NAME_V1, .init_quirk = xhci_rcar_init_quirk, .plat_start = xhci_rcar_start, + .quirks = XHCI_NO_64BIT_SUPPORT, }; static const struct xhci_plat_priv xhci_plat_renesas_rcar_gen3 = { .firmware_name = XHCI_RCAR_FIRMWARE_NAME_V2, .init_quirk = xhci_rcar_init_quirk, .plat_start = xhci_rcar_start, + .quirks = XHCI_NO_64BIT_SUPPORT, }; static const struct of_device_id usb_xhci_of_match[] = { diff --git a/drivers/usb/host/xhci-plat.h b/drivers/usb/host/xhci-plat.h index c652f33..15144c9 100644 --- a/drivers/usb/host/xhci-plat.h +++ b/drivers/usb/host/xhci-plat.h @@ -20,5 +20,6 @@ struct xhci_plat_priv { unsigned int quirks; }; +#define xhci_to_priv(x) ((struct xhci_plat_priv *)(x)->priv) #define hcd_to_xhci_priv(h) ((struct xhci_plat_priv *)hcd_to_xhci(h)->priv) #endif /* _XHCI_PLAT_H */ diff --git a/drivers/usb/host/xhci-rcar.c b/drivers/usb/host/xhci-rcar.c index 0e4535e..2617cd7 100644 --- a/drivers/usb/host/xhci-rcar.c +++ b/drivers/usb/host/xhci-rcar.c @@ -87,14 +87,6 @@ static int xhci_rcar_is_gen2(struct device *dev) of_device_is_compatible(node, "renensas,rcar-gen2-xhci"); } -static int xhci_rcar_is_gen3(struct device *dev) -{ - struct device_node *node = dev->of_node; - - return of_device_is_compatible(node, "renesas,xhci-r8a7795") || - of_device_is_compatible(node, "renesas,rcar-gen3-xhci"); -} - void xhci_rcar_start(struct usb_hcd *hcd) { u32 temp; @@ -175,22 +167,9 @@ static int xhci_rcar_download_firmware(struct usb_hcd *hcd) /* This function needs to initialize a "phy" of usb before */ int xhci_rcar_init_quirk(struct usb_hcd *hcd) { - struct xhci_hcd *xhci = hcd_to_xhci(hcd); - /* If hcd->regs is NULL, we don't just call the following function */ if (!hcd->regs) return 0; - /* - * On R-Car Gen2 and Gen3, the AC64 bit (bit 0) of HCCPARAMS1 is set - * to 1. However, these SoCs don't support 64-bit address memory - * pointers. So, this driver clears the AC64 bit of xhci->hcc_params - * to call dma_set_coherent_mask(dev, DMA_BIT_MASK(32)) in - * xhci_gen_setup(). - */ - if (xhci_rcar_is_gen2(hcd->self.controller) || - xhci_rcar_is_gen3(hcd->self.controller)) - xhci->quirks |= XHCI_NO_64BIT_SUPPORT; - return xhci_rcar_download_firmware(hcd); }