From patchwork Mon Sep 18 18:30:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 9957361 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 9F01B60385 for ; Mon, 18 Sep 2017 18:33:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9381B28D35 for ; Mon, 18 Sep 2017 18:33:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8780428D33; Mon, 18 Sep 2017 18:33:38 +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=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1F31528D33 for ; Mon, 18 Sep 2017 18:33:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=5zrjQ8nq0W1ovMN9Kupnld2iKJdU9SDrXrQ9I4onU48=; b=dPB RRRxXyhB7IiRPKFxZjodomLao22fEzLoQ23xcYkE916V8Xp1tFnQrA8rQYO7nOtc21wsIG1HYE39c GoHGCQ53BIXJH8Nf7qJlf7MQ8VetwJhsnA7JDUftdE08nwWeEC/g7Fc+o69Vx/oEGOtSOCpVocRCN nBYQgRF25sdPWQ3p5YQPvQxN85NJ/g1shoJKELuMKdwkl0Lyh5yQhVfiEKBUcpKNrDuArx+pUxsDB EhYOwNTFJashB0Ws6W/VdJ9troIyNMrVPy08lsyF//4fvYjhXPF+iVkwXaIQTkvMfKoAtss3cdoaC MWNJvgg7RRfeLvmF6fhF4MeC7PhdaeQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1du0rH-0006XG-Mp; Mon, 18 Sep 2017 18:33:27 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1du0rD-0006UQ-S2 for linux-arm-kernel@lists.infradead.org; Mon, 18 Sep 2017 18:33:25 +0000 Received: by mail-wm0-x243.google.com with SMTP id f4so1713146wmh.4 for ; Mon, 18 Sep 2017 11:33:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Vk9qsmQwPg0W7dP69KngWGL9NnjbTA2fncWis5TdAdg=; b=Z/yvWszUATwx2QueTZPmD7elife67mzsMAb78R0RuM68W61VId6LfXtQc3P/5OBTB1 8jXgxcRcaxZ94DVKD2GNLLFI1szoCbS8LZQGPIDllGMcyZXQwZf169BpTo0yO21/J4cK PM6uOc+LgdHaDYkGvF69gIH7jfd3KmWNNBL5xnP8Mo6pkmafFDzfwancFb0n6kAbXuVh DYhizF230C+7/A7fOJlKxVBeRfHll0671YbxXVni4aMVOH8jAHIsqS+zDXPQPvLVSfR2 3n0wF4wA1cIDfBSqYou5hMuVW/W+j9LYIOo8wkoAaTX7stxIMi14lci657RRjS//wjO+ z9VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Vk9qsmQwPg0W7dP69KngWGL9NnjbTA2fncWis5TdAdg=; b=Ano6GyLlgP9+aauS8/3AGT/mdpX+6cmi+tvMg2Iaoow4E67vYQW9q/MTCfA517HR0v r1FAF2uqkcgTYDr4kakdD7lBQ/quGiUjkkVMn6nAzp8F8Uueo4y1J8G0ZHPV7TYlRyR8 uiVPLREVj9IADSMmGmu+6vhHgm6R9zeWBVjdp8/Dp9fxmIBsi4Aavn37W5bEoOsp11un i0ZKcQDIpGo/V1wgdJAYqjSfOTlHuia/kksun7qpJZPwxQZjac64Ea3z45IxcXU6B7lF 9IsriqS/TTAsCh6dWdEk2hcJf1XjoIkQrOmahia85sMsl32CtTPnz38iwoQGTHckFkau jAAQ== X-Gm-Message-State: AHPjjUhIu6A+NWBn2XWqxvmg9UrdpY4tlrmPKGuRDgsQz7pROiVGkc4g N5HtognuyiG8ORiovL35VD4= X-Google-Smtp-Source: AOwi7QBagAzNtyoNA3/w6HCMJKl9qrkHkShwglERbA4zWd0KAU0Wp8U/XFlo5AmPlxZqVCQP4EB3Pw== X-Received: by 10.28.131.13 with SMTP id f13mr3004210wmd.157.1505759580096; Mon, 18 Sep 2017 11:33:00 -0700 (PDT) Received: from Red.local (LFbn-MAR-1-580-96.w90-118.abo.wanadoo.fr. [90.118.159.96]) by smtp.googlemail.com with ESMTPSA id v5sm7183996wmb.0.2017.09.18.11.32.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Sep 2017 11:32:59 -0700 (PDT) From: Corentin Labbe To: peppe.cavallaro@st.com, alexandre.torgue@st.com, maxime.ripard@free-electrons.com, wens@csie.org Subject: [PATCH v2] net: stmmac: dwmac-sun8i: Use reset exclusive Date: Mon, 18 Sep 2017 20:30:43 +0200 Message-Id: <20170918183043.8028-1-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.13.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170918_113324_070906_74E5D7BE X-CRM114-Status: GOOD ( 12.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, Corentin Labbe , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The current dwmac_sun8i module cannot be rmmod/modprobe due to that the reset controller was not released when removed. This patch remove ambiguity, by using of_reset_control_get_exclusive and add the missing reset_control_put(). Note that we cannot use devm_reset_control_get, since the reset is not in the device node. Signed-off-by: Corentin Labbe --- Changes since v1: - added a note about devm_reset_control_get in commit message drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c index 57bb6dd7b401..1736d7cb0d96 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -854,6 +854,7 @@ static int sun8i_dwmac_unpower_internal_phy(struct sunxi_priv_data *gmac) clk_disable_unprepare(gmac->ephy_clk); reset_control_assert(gmac->rst_ephy); + reset_control_put(gmac->rst_ephy); return 0; } @@ -1010,7 +1011,7 @@ static int sun8i_dwmac_probe(struct platform_device *pdev) return -EINVAL; } - gmac->rst_ephy = of_reset_control_get(plat_dat->phy_node, NULL); + gmac->rst_ephy = of_reset_control_get_exclusive(plat_dat->phy_node, NULL); if (IS_ERR(gmac->rst_ephy)) { ret = PTR_ERR(gmac->rst_ephy); if (ret == -EPROBE_DEFER)