From patchwork Fri Aug 31 10:32:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 10583575 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 1DB3C5A4 for ; Fri, 31 Aug 2018 10:34:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFC3528724 for ; Fri, 31 Aug 2018 10:34:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E3E612B783; Fri, 31 Aug 2018 10:34:52 +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 81F2828724 for ; Fri, 31 Aug 2018 10:34:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727864AbeHaOll (ORCPT ); Fri, 31 Aug 2018 10:41:41 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:54253 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727739AbeHaOlk (ORCPT ); Fri, 31 Aug 2018 10:41:40 -0400 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie3.idc.renesas.com with ESMTP; 31 Aug 2018 19:34:44 +0900 Received: from relmlii1.idc.renesas.com (relmlii1.idc.renesas.com [10.200.68.65]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id AC6027A54E; Fri, 31 Aug 2018 19:34:44 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.53,311,1531753200"; d="scan'208";a="289630541" Received: from mail-os2jpn01lp0152.outbound.protection.outlook.com (HELO JPN01-OS2-obe.outbound.protection.outlook.com) ([23.103.139.152]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 31 Aug 2018 19:34:44 +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=kXmMOLmjGAZPJK1vqLJBh7UQLgsfEzxzTnyUxR1UcrFIe7Ye+pbEz4au9RqQAcShxZQ+XLUdE1HayPN8HDNztwY/ouMFeVn1ghU8qeC69firo6abTaACCjz6Zvwff5fcnLRItEBj2o21BjRYS1q/ae9MybPjqbmAJ/Cl4l0wUJQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; Received: from localhost.localdomain (211.11.155.144) by OSAPR01MB2289.jpnprd01.prod.outlook.com (2603:1096:603:1c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.13; Fri, 31 Aug 2018 10:34:40 +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 v2 1/3] usb: renesas_usbhs: Add reset_control Date: Fri, 31 Aug 2018 19:32:57 +0900 Message-Id: <1535711579-15169-2-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1535711579-15169-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1535711579-15169-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TYAPR01CA0073.jpnprd01.prod.outlook.com (2603:1096:404:2c::13) To OSAPR01MB2289.jpnprd01.prod.outlook.com (2603:1096:603:1c::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3588db67-8df9-4a02-5f5b-08d60f2d5bba 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:OSAPR01MB2289; X-Microsoft-Exchange-Diagnostics: 1;OSAPR01MB2289;3:nxWQZZe8Z7nz/LyGrfVHK6bUyT2Xqfp5QoqLCf/EX/cUrS29DDq1npRMUdufrk6md9djRP7vE+2H4KEb6Oy4fS76i7yaZxQb4B9rfPjl0iW9U3VzVxtRPQdspVGg3IwvMTAfq1o73Uaz+C/e9zEc9kWQYfak46PxS/2fdTMziFBl8TQBpqNTGlfy7Ge2lBCDOebdbHYLkjwQPZIhvj1LZPrI1ZLIC0+5PRjzszWlICJs4eVa+5DiqtX+WnYphLbL;25:ZP2Ov/nFykSo/t0vhNTipqZy42YKnL7Zq/HIj01rjWX2Hcr0YvGzJqiKardQJYu3ZrcGMQqydRaRUxjeIUxkdHnZjIgjGFpLoxjFtsZL0/In+jrprtHj61EvaLiI9MtkAghuOML8r11WTcjX4y6K+D1m8qeeHXKUDV/37EywrNXH3Wi8OmWnkKhnqbfO+/521REVcNxwyKTTQ5eyBax2kDHH5qgemPkPlskFGtmL7ryT1YUyRiGyyeT7srOPG7b9yxdPn4PIjD/NVrPslh/VI1osPFFE+FlAeovxJLGGwgVv3dBtJIISrrw9ZdyS8VhDC6yLWocRz2FPpUm2wMTFxg==;31:/VBNK50NKLi5wx1Ix7JHgE6U29P/kl3isoIw7E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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)(5005006)(8121501046)(823301075)(10201501046)(3002001)(93006095)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061750153)(20161123564045)(201708071742011)(7699016);SRVR:OSAPR01MB2289;BCL:0;PCL:0;RULEID:;SRVR:OSAPR01MB2289; X-Forefront-PRVS: 07817FCC2D X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(396003)(39860400002)(366004)(346002)(136003)(376002)(189003)(199004)(446003)(6666003)(26005)(3846002)(6116002)(50466002)(106356001)(5660300001)(16586007)(105586002)(78352004)(6506007)(316002)(386003)(2906002)(11346002)(25786009)(498600001)(956004)(2616005)(48376002)(76176011)(7736002)(476003)(50226002)(51416003)(52116002)(47776003)(66066001)(6486002)(8936002)(305945005)(81166006)(81156014)(53936002)(486006)(16526019)(36756003)(4326008)(8676002)(42882007)(107886003)(6512007)(68736007)(97736004)(69590400005)(3720700003);DIR:OUT;SFP:1102;SCL:1;SRVR:OSAPR01MB2289;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;OSAPR01MB2289;23:6EaAlqBrgagdjBTeZW8JcDGxbGV6ieFWT2FjwzUzr8ZP8IZ96sKbNbeT6NcJIAOFir3TineX8+d3vM1ujQ4JfNTdfFjDals2GH2ul9ywDN+dvxM742R5iLTTMgaeAwtiL0A6cexv5XCDvBunqXMFqUiR/sRa5VQxFEeTchzbNxUOb68Eygr8joBbsH5POay6iC9j82Nm043lBMNzYBKVDbdYdsqvc8Hvcc+jDkygD9hCu9QknI0qFIPEJ0O5AsS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D6BOLKkNK92Tamm4ufbsEjgLyyX5o0M6niUc9zHKVZLYA6CmUyrwp1aZM+oVgGfuD/04yxHNGHUk+qPR1auq9jTL6mjqe+nCFVY/3aIy7LaPVQjzQLn/g4Hms14OqnG0ObMHbLAecO/AS/tJkTqnlOinPwQ/5EWAEgbUcesQ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;OSAPR01MB2289;20:uuc7QJoNlQx+EnBrDGxqbTeTrKeP1AmYpkbdAZPeD3qgQiGo1awC5JlPjxZBDcktRSke+h/lw+z8aTVvaMh3ZS1x6xniRlxi9p4wtskvaN5PVQlCPd/JtredGtDpBzpZ9ZS8m1mHGthqoBJQsEY8JFnfc83qG/PCAmvAWJEMbQ4= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2018 10:34:40.4826 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3588db67-8df9-4a02-5f5b-08d60f2d5bba X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSAPR01MB2289 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; }; /*