From patchwork Fri Aug 31 06:48:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 10583193 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C5E5D112B for ; Fri, 31 Aug 2018 06:50:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B6A032BCE0 for ; Fri, 31 Aug 2018 06:50:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB0C92BCFD; Fri, 31 Aug 2018 06:50:26 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable 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 4CD222BCE0 for ; Fri, 31 Aug 2018 06:50:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727398AbeHaK4W (ORCPT ); Fri, 31 Aug 2018 06:56:22 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:33031 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727203AbeHaK4V (ORCPT ); Fri, 31 Aug 2018 06:56:21 -0400 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie3.idc.renesas.com with ESMTP; 31 Aug 2018 15:50:18 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id D13D778A12; Fri, 31 Aug 2018 15:50:18 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.53,309,1531753200"; d="scan'208";a="291156790" Received: from mail-os2jpn01lp0151.outbound.protection.outlook.com (HELO JPN01-OS2-obe.outbound.protection.outlook.com) ([23.103.139.151]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 31 Aug 2018 15:50:18 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0rLM+bfQJNAFwvvpowk9opqtB2Fdj4+8aKFZdkUGR2M=; b=athwH49GFLBnuibwuPcoKvjcsFcnfJnlXoJ2nlWMiRAiByL50cpvWriBJAvsg66jXTm4bKdMSwbyMptEvi4RkBYTPZiooFQb4b+pQg1fSpJVlFgy7L1+ZhDlUFbn0IrAuzxrlouvv0VJ/lkZ/AnsTI0MYt3RKtbMs+5Hb78mQ44= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; Received: from localhost.localdomain (211.11.155.144) by OSBPR01MB2293.jpnprd01.prod.outlook.com (2603:1096:603:26::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.15; Fri, 31 Aug 2018 06:50:15 +0000 From: Yoshihiro Shimoda To: balbi@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, Yoshihiro Shimoda Subject: [PATCH 1/3] usb: renesas_usbhs: Add reset_control Date: Fri, 31 Aug 2018 15:48:37 +0900 Message-Id: <1535698119-10132-2-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1535698119-10132-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1535698119-10132-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TY1PR01CA0142.jpnprd01.prod.outlook.com (2603:1096:402:1::18) To OSBPR01MB2293.jpnprd01.prod.outlook.com (2603:1096:603:26::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1d19015a-7067-4a15-d45f-08d60f0e01f6 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(8559020)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:OSBPR01MB2293; X-Microsoft-Exchange-Diagnostics: 1;OSBPR01MB2293;3:oXQWHF6KzFzhhLlUCCKftWTomh9ZBb8dWouDhPGSfZ+WYERD7LtxYgYgQMIiklcsG/07/sTpplMRBo3gJffiTNT7UlEQbvECI9Wr3HIatWP+wsvorO0emJSP5L1wforgLYyriSjMKmSUpcZGjGzO8ND9IMcxU6dMRK77VkfBVHMuWXhT3qbfI6o6vI4Fbp/0tyJbageFv6zmuXbLM9z6RjKmjuSvZk60/kkRpgTmuSNY2ruWrzwu62Yh149TDr4P;25:+AwH3LaZbn2P04dWOvlUXShxklq5hlbNgPOXsN2x1XLeSDKSnQB4VvOEWBUNFaH5oWTOX5hvJnJpjH9dor5P5GWNO2YDdSfQtGTvQS/TFNb5q4/C9l6NPVwbCQdhi+wgivmduHdlfaPFBBxbC5GLKX+mFcKPJ0NfiUBYMNxjP8X+eRHBsfzZOOLu3FiaVLAZ6Y/hGg9g4yWR3X3YauENguSBZ+UHBpokFuvJYRqYfmTVlBlOGO/nSgHOYHir0qxINgMNOD5E5zRNyqHCThRDwNYZcyyv5wPZslft1klEeoRjk2SvxK9Nvh/B2j2VW6gPJV3iOfDOr9mIKNtB9oCTuw==;31:kRE/2EKgopM4lyvRo6C2rxOHOcUkRHcqXuazS2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-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(823301075)(93006095)(3231311)(944501410)(52105095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061750153)(20161123562045)(20161123564045)(20161123558120)(20161123560045)(201708071742011)(7699016);SRVR:OSBPR01MB2293;BCL:0;PCL:0;RULEID:;SRVR:OSBPR01MB2293; X-Forefront-PRVS: 07817FCC2D X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(396003)(39860400002)(366004)(136003)(346002)(376002)(189003)(199004)(53936002)(68736007)(97736004)(2906002)(78352004)(50466002)(6512007)(2616005)(476003)(48376002)(7736002)(446003)(11346002)(956004)(8676002)(3846002)(50226002)(6116002)(305945005)(486006)(47776003)(66066001)(8936002)(81166006)(6486002)(81156014)(42882007)(105586002)(5660300001)(76176011)(25786009)(52116002)(51416003)(36756003)(106356001)(16586007)(316002)(6666003)(107886003)(498600001)(386003)(4326008)(6506007)(26005)(16526019)(69590400005)(3720700003);DIR:OUT;SFP:1102;SCL:1;SRVR:OSBPR01MB2293;H:localhost.localdomain;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:0;A:0; Received-SPF: None (protection.outlook.com: localhost.localdomain does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1;OSBPR01MB2293;23:FZSTdk/vcyMgHcK1EEpJ1EdQcmZrO4y+QtQB1IiB9rgwmH8L6thjRpyHjcdLw79N1n/374UiCQeVrPA6aW6mHdsaR0YmHWe89W/AD01l+AnSSzNAMBk00diHZdPz3BCMQ1CKweN16qcKLY5f5C7f//7gfEz2VmlwfN6jF+oKaa/760f2WHdnjaEVKmY5JQ6wSoeIoC/bYCE0G4rKerPfniw7EbxorUXeRGshFpDC9bwRMTDiuW/blC3ySCYX1BUfpgwK5JFMB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NW5jfyaPyoVKu2TIaxrVs+oFjlxZ4X9jI6f2YeE1DnHloup0Wp3GjFQGNiltq8br4w3pp5s3WsC5Rwjmhl/mhwj8khKgFrM15ph2QXCEHm37UGmglW1qkwBA9fuYaI90tLhE2ztayLWyzzzaO8485mUcfTRa06wbtzPqN SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;OSBPR01MB2293;20:emdTqXFur2QpQ67Ck4A8m/+dGMI8wRFcJJaRE63qzicOnj2Q5Hb74/Kz6KX3y4r8CY4NSKiITmiqbw1TCBe/FPp/DCZunvHSDnIWa3Vp+Xr1TtEIPjUVrv2SakH8wDFDkr28UTZQaKs7rbcvyOoTTDjRN/7THw6PdmrER/H77yo= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2018 06:50:15.4814 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1d19015a-7067-4a15-d45f-08d60f0e01f6 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSBPR01MB2293 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP R-Car Gen3 needs to deassert resets of both host and peripheral. Since [eo]hci-platform is possible to assert the reset(s) when the probing failed, renesas_usbhs driver doesn't work correctly regardless of finished probing. To fix this issue, this patch adds reset_control on this renesas_usbhs driver. Signed-off-by: Yoshihiro Shimoda --- drivers/usb/renesas_usbhs/common.c | 12 ++++++++++++ drivers/usb/renesas_usbhs/common.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c index 4310df4..1d355d5 100644 --- a/drivers/usb/renesas_usbhs/common.c +++ b/drivers/usb/renesas_usbhs/common.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include "common.h" @@ -574,6 +575,10 @@ static int usbhs_probe(struct platform_device *pdev) return PTR_ERR(priv->edev); } + priv->rsts = devm_reset_control_array_get_optional_shared(&pdev->dev); + if (IS_ERR(priv->rsts)) + return PTR_ERR(priv->rsts); + /* * care platform info */ @@ -658,6 +663,10 @@ static int usbhs_probe(struct platform_device *pdev) /* dev_set_drvdata should be called after usbhs_mod_init */ platform_set_drvdata(pdev, priv); + ret = reset_control_deassert(priv->rsts); + if (ret) + goto probe_fail_rst; + /* * deviece reset here because * USB device might be used in boot loader. @@ -711,6 +720,8 @@ static int usbhs_probe(struct platform_device *pdev) return ret; probe_end_mod_exit: + reset_control_assert(priv->rsts); +probe_fail_rst: usbhs_mod_remove(priv); probe_end_fifo_exit: usbhs_fifo_remove(priv); @@ -739,6 +750,7 @@ static int usbhs_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); usbhs_platform_call(priv, hardware_exit, pdev); + reset_control_assert(priv->rsts); usbhs_mod_remove(priv); usbhs_fifo_remove(priv); usbhs_pipe_remove(priv); diff --git a/drivers/usb/renesas_usbhs/common.h b/drivers/usb/renesas_usbhs/common.h index 6137f79..bce7d35 100644 --- a/drivers/usb/renesas_usbhs/common.h +++ b/drivers/usb/renesas_usbhs/common.h @@ -10,6 +10,7 @@ #include #include +#include #include struct usbhs_priv; @@ -277,6 +278,7 @@ struct usbhs_priv { struct usbhs_fifo_info fifo_info; struct phy *phy; + struct reset_control *rsts; }; /*