From patchwork Thu Sep 6 05:50:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 10589895 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 3F79E14BD for ; Thu, 6 Sep 2018 05:52:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EDB62A382 for ; Thu, 6 Sep 2018 05:52:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2254E2A55F; Thu, 6 Sep 2018 05:52:04 +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=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 952BD2A382 for ; Thu, 6 Sep 2018 05:52:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726265AbeIFKZr (ORCPT ); Thu, 6 Sep 2018 06:25:47 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:22018 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725885AbeIFKZq (ORCPT ); Thu, 6 Sep 2018 06:25:46 -0400 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie3.idc.renesas.com with ESMTP; 06 Sep 2018 14:51:56 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 410C577F9A; Thu, 6 Sep 2018 14:51:56 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.53,334,1531753200"; d="scan'208";a="291703405" Received: from mail-ty1jpn01lp0176.outbound.protection.outlook.com (HELO JPN01-TY1-obe.outbound.protection.outlook.com) ([23.103.139.176]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 06 Sep 2018 14:51:55 +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=nxGv2HtH7vaKCcyrt3CGYCp/PPbuSemc114fmhT+cKAvbglUCnogft5t3S4VBCuUuQ7Ii/9q31FTxevb6mevCa5u0fhaLTrnSKBzKVbhN76rR3awZCG9Q8sNg4YZCpBsUbT2wIsV9R6W1o4ZVfuCZ0Kl69nO8h8iv9QyfOaK4Y4= Received: from localhost.localdomain (211.11.155.144) by TYAPR01MB2304.jpnprd01.prod.outlook.com (2603:1096:404:8::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.16; Thu, 6 Sep 2018 05:51:53 +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 v3 1/3] usb: renesas_usbhs: Add reset_control Date: Thu, 6 Sep 2018 14:50:12 +0900 Message-Id: <1536213014-1325-2-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1536213014-1325-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1536213014-1325-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OSAPR01CA0158.jpnprd01.prod.outlook.com (2603:1096:604:d::26) To TYAPR01MB2304.jpnprd01.prod.outlook.com (2603:1096:404:8::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9a9fe473-5030-411d-96f4-08d613bcd8e1 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:TYAPR01MB2304; X-Microsoft-Exchange-Diagnostics: 1;TYAPR01MB2304;3:Xnyf85w1YEguE6UaMArBcjBeKk2jwb8Fvp6rCWqvTv23EOUjYkxlUpqpq7Nn+xmqRTKOlAh5REEQgMoBQhodNNJLqJk7RPZR5O5RSXvrS5y5FSH5ggMWW6ECyaz571Y069S/jsInntEG8v0rJj4fKMz/ZyvmNQI6KiZ4oa5JkPowFzlTHOkTYeFYOtaW3SHgOI8SV9RQggesgyYf8WUWmlyKWHcsUWHihZ8hMy/Nido0hi9te1yZi4EQXfgtgtBM;25:uXH1IQ0p27Q0632QRICZevhdpdwRP/WoSiLZ45b4+4iUMolWnO9D6MemjP41qGQWwiSj9MpG9VtpPTvyZywRG19UREeGV9UavPUSDG0XLkXMWemFB4BsfBRF385uCDhTYg07vvX7JzeetNSOrAHeK/+zgwwuN3jVWnsIeHMuIGz8wdHKuJCNJZrKzL3BBrLU6bxMqi/GwCYJ3ZQQkuGl+8SimbKrIrM4bshcRq6Mw2mePzIz34waCMiicFSHWKMxVDqUhRq0XRokE/OziZm7xfukfTTr0B+EM87j8++LozX+XMae3oPs9+GC2RejoCHhFFmTh+etcbEG9phVAEzm3A==;31:IMXuuy9jn8PeiT5v1LSMBvloxXE0kjLsKGomNODqf4xJguziVlqRhMh8r3RLnBVbZq8J6+t39Ct54vzmK0SPrMfcUVoFqJ47k4ge5zwOq12tnYlY59pfUDwjoxKyaXESZpoapr2e1h4493yvQJXwXP9oF4SqvlxwAmjONT+VGLKtD6+HD/J4STwbQzIFrRX6AODFES6CEviRC7gfCs/zHVboW3Amk2YVO2rkYWwA6m8= X-MS-TrafficTypeDiagnostic: TYAPR01MB2304: X-Microsoft-Exchange-Diagnostics: 1;TYAPR01MB2304;20:L3tXfuJlvO2UdD42OgkR2ENns+DX472bUzZww5+TG2sjgw6Z80GjmrHbMQQkRE3EQLb+XngK71VtwxzwMl4t4b+zNnG5z/bDoIqBhllcfbfWG4Re+XvhW2fPXGfP2ukuC8AhkDYMORNUQ1ItquQQQISWvzUq1TxvUuBEW8Ncq1ZewDYHoYnNOWAJRiOH80k5/LSC+Ihv6bKPjSLPMziwRdFBXnrUe6HrWYRprzFrbMCE8g25sLrPsLg7NJHUEwwEFhSCZmgYnC+qkK/HYDURGFH4yMLxPSBpZZwuoKYkhzbWQpa/N6ZYgeM3xFuKaFj/Jb+Cv9+6uy03USzesIH20KGaa4wJSctDswBzpU8VT6nNuH+cFhOypS4ZzxojqHJZ/KUFkgnuKLTLO4cQIsh1YCs/fKuPKnORJOJs768Ddkq3JjugwzOF3Z4Hr1vhTsn7weK5Oxq5FIidpWTeN9txS3nB6U7k8dfa1Yawfx4UzpnoAejjxBR1pypiUt5mJdin;4:fstLeMXYT+pgrem6JjmXevRJfjlL/xQLur+ENdx0yhyUPxkwSK1rpSXDXQsH0fJN/XZ3LeXAEhniwIP1fo0dUFXVh62ei+sQHnDPK4klbGSfOSCc8bPeOAgSJJxPYj/0YGqtVj5gZRPNOUWxkQpAYKCsCgSXlBWm336FxO2WPxUd7q+0/+1APC4TnMRFxpNyHufLz3nkXCo8qkQJ4mLtukjojVnW/QNljcQUdZH9Z2IESM9kDs5+b36Fg2kHhdxqgjhKeTKRBZAn9srounmhGw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(823301075)(10201501046)(3002001)(3231344)(944501410)(52105095)(93006095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061750153)(201708071742011)(7699016);SRVR:TYAPR01MB2304;BCL:0;PCL:0;RULEID:;SRVR:TYAPR01MB2304; X-Forefront-PRVS: 0787459938 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(366004)(346002)(136003)(39860400002)(376002)(396003)(189003)(199004)(76176011)(52116002)(2616005)(2906002)(106356001)(16526019)(476003)(105586002)(6506007)(386003)(498600001)(6666003)(6346003)(51416003)(50466002)(5660300001)(3846002)(6116002)(68736007)(26005)(316002)(16586007)(25786009)(78352004)(66066001)(4326008)(107886003)(7736002)(305945005)(81166006)(48376002)(36756003)(42882007)(50226002)(47776003)(8936002)(53936002)(11346002)(8676002)(6486002)(6512007)(446003)(69590400006)(486006)(97736004)(956004)(81156014)(3720700003);DIR:OUT;SFP:1102;SCL:1;SRVR:TYAPR01MB2304;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) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; X-Microsoft-Exchange-Diagnostics: 1;TYAPR01MB2304;23:MaxBB5lIhhZJcYQw1CG+gcw3yUI1z9xPu9mz6GGn9SkSSXS/sPADlwVmuq97+p1aVlpSDB1J70AjuZWtbAa7xHjj0kdYdLONOap4Zo0vkW01NBxsaiq1CWmNYT3R/NgGaqtKq35lJuAo/SFBrfT4jpPhnbyziFDBpARC0NPDwBcvoF1T9hsFAGlzZ6uqTLX0UYqSv6ZLzLKpRMFDQ1Bx8RSkaw4CCw/wITy85bJdGX5Jrf0+1b9Ad3SlEpvlwnTZzJAc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GWAdqJpuqScsmwKnrTycq1tqPEOkbmJ7RimCBS0zeHtkCVhJVZ66eGQS4CP+d+lE1CYdbutZhLX3m/krV0kdJaiLcxGPWgxQPIkx3WSsW89xcZv/iqJmvusFR7iSULRkg7Vn22QKwQj2W8pa25j5l2xsEW6sfmxQuyT3XdbZT9gL3g7szUFtVN7OVHG3BRgOa2owjlJC2UNkVnxBY30uYUi SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;TYAPR01MB2304;20:yRVmZAO3RSUfxAPzC3TU6Kkr35Td1rqdpdqrF0DCdjyWZnL++xFCQe9o6iDBvS4uvbRnUjj3scRZv3aJ1siWdGYJDEdTLUMWEn7qvt0k/8AQEnRgB7rUZlOnQwQ0r1wA/GdBQmbYkuLG8Pkz8SiiFL1ePkOi8yKdGJTiMwg3GqU= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2018 05:51:53.0602 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9a9fe473-5030-411d-96f4-08d613bcd8e1 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYAPR01MB2304 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; }; /*