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: 112946 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp3981082qgf; Mon, 18 Sep 2017 11:33:06 -0700 (PDT) X-Received: by 10.99.184.9 with SMTP id p9mr16051565pge.6.1505759585978; Mon, 18 Sep 2017 11:33:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505759585; cv=none; d=google.com; s=arc-20160816; b=k2BPI3qMr1/0MpVx6bMWf5NHnNZMxTMClXfwQRBw8UIJKplW+H/kz6LOkobtmRjGii NyKYV+e/qzUS1ZJrAhRaXog8uX5njm63l0pxziBcB3zpAMWUAUVvU+Hc0LzAC1Hoqabe kiqYKLEFcYf9/u/NZFlgzCX0ZTCDsXAk31/VrIcVy7ZuR1bNpQAiy01FUKVgK9bbhdSy aD98YmvqX93p+1AXonK6I6CCFNHbNXO2ZeisSjQgeWiBqKpNgpAIV008I/jG4YK5cDQ8 336if1RDRtSR4omGI7e6zTSJr2xbwSOxe1OCJXv3lR1KeUrpYO14l1gm/qhMNilD26NB Bb4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=Vk9qsmQwPg0W7dP69KngWGL9NnjbTA2fncWis5TdAdg=; b=BxrcNk2hL/08H5ht5Vu+TrY59KYmqfMWI3o7wpTezeqmDK4o/lNrn6ZN953jEeo2m+ 9V7M2dsf9BthvstwkGqY53Ov8jmXqkd2JehPmCuFXzhZgsNPZlHgR5sx+m9wNhWk9LiU Li4FSKu9382dvVSXbxQ4+83VuAF4BVF2djMD8H7+bZFSLSEivN9kxLx8ROrr5qS3Gy83 U8D+pcb7E9i8kiFVpW0z+s0TRCwzCn9CPSZKB/9qWjCH620AjnA1uj401UaDcKeVFTKy zdnNIjWksa4d8Sywz/Ae87LgQqUdI3IHvzvy3OiJRQDicMhkyBAhxUyoIb00kMlceMGI aQHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Z/yvWszU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x17si46790pfj.324.2017.09.18.11.33.05; Mon, 18 Sep 2017 11:33:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Z/yvWszU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756773AbdIRSdD (ORCPT + 26 others); Mon, 18 Sep 2017 14:33:03 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33272 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753928AbdIRSdB (ORCPT ); Mon, 18 Sep 2017 14:33:01 -0400 Received: by mail-wm0-f67.google.com with SMTP id m127so1736216wmm.0; Mon, 18 Sep 2017 11:33:00 -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=l6EnQBoT7rU/Ofva0oN3BlJJtsHKgXdX7hS9eYlusThNpcIu9hFyezWjA0DbbC7tb/ dw0/eBWCoNi+Buvl4De50UZqhHvR9uje283FM8zSGpqsoPBbwNzKSYFs7uYE4QsKeDhM 7++zJQRze6CYyQjtxHYCPUGOF/UCVR4tFz86ZcAlRZk8ZvKldbTeNoTscK3z3wbJbGB4 llxUMXIzkQKNdIwTJmw68Qvd/QsLthxwdu8fOwNFQtclOL5OJGV4cyJZmiUGkptjeyza zSbDYD9tBuE1KgiBtJ/mJ9fpV03Otcd2ROR2HEAG1krR0eDH+/LFS+2BDlcp/0jrK1F2 X7tQ== X-Gm-Message-State: AHPjjUhLFrOE+pjdjIrj4z0qUGvPRnQWgU8L9PaBhc3kLFPls46umaEf teMIH2068uCZHX4hYZvrw2Y= 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 Cc: netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Corentin Labbe 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.13.5 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)