Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751602AbdH3KW3 (ORCPT ); Wed, 30 Aug 2017 06:22:29 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:37143 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751318AbdH3KW1 (ORCPT ); Wed, 30 Aug 2017 06:22:27 -0400 Date: Wed, 30 Aug 2017 12:21:36 +0200 From: Corentin Labbe To: Maxime Ripard Cc: peppe.cavallaro@st.com, alexandre.torgue@st.com, wens@csie.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: stmmac: dwmac-sun8i: Use reset exclusive Message-ID: <20170830102136.GA21940@Red> References: <20170825143805.21733-1-clabbe.montjoie@gmail.com> <20170825144832.3w6izhri5vstbndp@flea.lan> <20170825151733.GB9475@Red> <20170825171233.4xoihzakca3mqscd@flea.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170825171233.4xoihzakca3mqscd@flea.lan> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1929 Lines: 47 On Fri, Aug 25, 2017 at 07:12:33PM +0200, Maxime Ripard wrote: > On Fri, Aug 25, 2017 at 05:17:33PM +0200, Corentin Labbe wrote: > > On Fri, Aug 25, 2017 at 04:48:32PM +0200, Maxime Ripard wrote: > > > On Fri, Aug 25, 2017 at 04:38:05PM +0200, Corentin Labbe wrote: > > > > 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(). > > > > > > > > Signed-off-by: Corentin Labbe > > > > --- > > > > 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 fffd6d5fc907..675a09629d85 100644 > > > > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c > > > > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c > > > > @@ -782,6 +782,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; > > > > } > > > > > > > > @@ -942,7 +943,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); > > > > > > Why not just use devm_reset_control_get? > > > > > > > Because there no devm_ functions with of_ > > devm_reset_control_get uses of_reset_control_get internally. Hello You are right. But since the ephy reset is in a child node, devm_ does not find it. Regards