From patchwork Mon Sep 10 09:52:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 10593857 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-2.web.codeaurora.org (Postfix) with ESMTP id E57E71515 for ; Mon, 10 Sep 2018 09:54:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D63F028E24 for ; Mon, 10 Sep 2018 09:54:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C8B9128E2A; Mon, 10 Sep 2018 09:54:16 +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 A475928E24 for ; Mon, 10 Sep 2018 09:54:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728086AbeIJOr2 (ORCPT ); Mon, 10 Sep 2018 10:47:28 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:63252 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727353AbeIJOr2 (ORCPT ); Mon, 10 Sep 2018 10:47:28 -0400 Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie2.idc.renesas.com with ESMTP; 10 Sep 2018 18:54:12 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id DEC107DA78; Mon, 10 Sep 2018 18:54:12 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.53,355,1531753200"; d="scan'208";a="292071058" Received: from mail-hk2apc01lp0211.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.211]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 10 Sep 2018 18:54:11 +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=l2axIUT4Vjl7aZnoYf72trPvYluTegmitM5N+vhBdpXPk3PihmbqoKiHCMT7y4rryQU7w6uI7uo2hNaHrB9y/m5OQ3GDht2UvgPWWcTKBgV7TB5wKta+qDP4kPUKIOY/9hr/j1kIDA4Mn9GAfl0wOFeKlyF5Hm/vVSS0FPl2fW4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; Received: from localhost.localdomain (211.11.155.144) by TY2PR01MB2298.jpnprd01.prod.outlook.com (2603:1096:404:10::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.18; Mon, 10 Sep 2018 09:54:08 +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 v4 1/3] usb: renesas_usbhs: Add reset_control Date: Mon, 10 Sep 2018 18:52:18 +0900 Message-Id: <1536573140-24123-2-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1536573140-24123-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1536573140-24123-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TYAPR01CA0147.jpnprd01.prod.outlook.com (2603:1096:404:7e::15) To TY2PR01MB2298.jpnprd01.prod.outlook.com (2603:1096:404:10::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b99d388d-fb51-44ac-6ebd-08d6170359fa 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:TY2PR01MB2298; X-Microsoft-Exchange-Diagnostics: 1;TY2PR01MB2298;3:xWm5c9pkk9YRMHh6ndnYmqiQdpn4y2YIFAi1uaYcV3nyCKodnXNsG5Ihg+wOZ6NU75XzrMUGrhLAruYkiG4aUl3yXxUJH1mPIx4wCpn2S2RXx/iNpRunJ77MmnW1ATvLmYGupW8crmO5unzf7AkA7fEGnVwqgSpWyNazl1hcgWqa6QZsuaNT3tp7AaRgS5NyTh2NHcEkO8b+n4D5IYW1OB/NOFhioUJs8B+2MM93AvKmd27YAV7HlyClvsr0vYJO;25:x14x4HMVFm3Nn/syj4vsF1FXiqKXjOGtEpgiTgSsrP7DHw6LrHU6A/eS/aqOLwjGgwgdVtOJPQMl8K7fPuEwzqE6K4Q4MwV4pa3vyxg6ZEGb0NwAnTAQTfICQxZlQuq+BgRPENs4T0lEOeUhprLtIxMank0n5ZLXsb0wY+iXf6FTzbu+knUxpT6kqWgdL2Jr/TBqfXoevi7P2VmpNyDexNWP9ZXCMzoChi3oZ2h1BV/GVGemADDUm7sgb9M7Vs+JVxEE0XZY3/cb1Kd1+HBRppKgs+jFz8Qn0amFPoLnsW/82jZy8VQfV3MVHsSiWp69ITrEHmd+rRyzWexWA3x9Pg==;31:H2JQA1r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4Sb/UJ0ECCiKSW/A== 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)(3002001)(93006095)(3231311)(944501410)(52105095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061750153)(20161123564045)(201708071742011)(7699050);SRVR:TY2PR01MB2298;BCL:0;PCL:0;RULEID:;SRVR:TY2PR01MB2298; X-Forefront-PRVS: 07915F544A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(136003)(366004)(396003)(39860400002)(376002)(346002)(199004)(189003)(2906002)(498600001)(6506007)(3846002)(7736002)(305945005)(53936002)(386003)(5660300001)(97736004)(81166006)(76176011)(81156014)(52116002)(6512007)(78352004)(16526019)(51416003)(6116002)(486006)(476003)(42882007)(446003)(26005)(69590400006)(956004)(11346002)(2616005)(107886003)(16586007)(8676002)(8936002)(105586002)(6486002)(4326008)(316002)(6666003)(36756003)(68736007)(66066001)(47776003)(106356001)(48376002)(50226002)(25786009)(50466002)(3720700003);DIR:OUT;SFP:1102;SCL:1;SRVR:TY2PR01MB2298;H:localhost.localdomain;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:0;MX:0; Received-SPF: None (protection.outlook.com: localhost.localdomain does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1;TY2PR01MB2298;23:1/sAJ61k2nnAMUOhR02ho8Dd7k4cORbsQnxXUrFk90eq0iG+fe2PY3zWKv7IqWy++OYMmyi4lYnIXDFM113Y26FVJZgDOaaXzGXu6eQuOrsOjrY3YlNFXFg6hGgs67WJOXATNOD5okuzjDGg3H63hH2zda+9BTJ3T+hS6uqskVAUwWQDIZAHX4biCmjup8mivpwBIO04NJMH91js/g5uJVjuwUUet6DnChl2TJ2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BdikY+vx3AZf5HEtvcp08+K3W4/fKqD/VWP6iuhQwxAMcY+vOpns2/IbnXsAaMauzbI+chMkAUqXuImYVCJY7vdh18ketfXlcmgPD1qKrlGB2A4LSafy4Ul8GNdehfAstAUYvgY7qoYGz4T01ju0iNBb31wp+I+MxK2qpnmS9Vkc/P5Kel/ran7uHhHCh9zGg1rhtl+FpePetaUB/0Ufumvb6 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;TY2PR01MB2298;20:FfI/KF/b4mhrOKXz6h+Uv8LEOKOqm1SAPnJ4kcy+mz3kfZETnBYDDFKfhdqthYMQRgwiLR8AjqKgv+4AuGTuHNLB/9Abg0jUf/Oz5c5PpBZJqhe4HlJJPBeSbRTS3k9E8bfv4NYcmgdunGRZkkqXTmkayYJHDpdmym/J4HS01Jc= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2018 09:54:08.0618 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b99d388d-fb51-44ac-6ebd-08d6170359fa X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY2PR01MB2298 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 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; }; /*