Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751394AbdISIp2 (ORCPT ); Tue, 19 Sep 2017 04:45:28 -0400 Received: from mail.free-electrons.com ([62.4.15.54]:58009 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750747AbdISIp0 (ORCPT ); Tue, 19 Sep 2017 04:45:26 -0400 Date: Tue, 19 Sep 2017 10:45:25 +0200 From: Maxime Ripard To: Corentin Labbe 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 v2] net: stmmac: dwmac-sun8i: Use reset exclusive Message-ID: <20170919084525.vdbjrqx5qvhhxmor@flea.lan> References: <20170918183043.8028-1-clabbe.montjoie@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7mqomjgivpyllpcv" Content-Disposition: inline In-Reply-To: <20170918183043.8028-1-clabbe.montjoie@gmail.com> User-Agent: NeoMutt/20170714 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2563 Lines: 73 --7mqomjgivpyllpcv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 18, 2017 at 08:30:43PM +0200, Corentin Labbe wrote: > The current dwmac_sun8i module cannot be rmmod/modprobe due to that > the reset controller was not released when removed. >=20 > This patch remove ambiguity, by using of_reset_control_get_exclusive and > add the missing reset_control_put(). >=20 > Note that we cannot use devm_reset_control_get, since the reset is not > in the device node. >=20 > Signed-off-by: Corentin Labbe > --- > Changes since v1: > - added a note about devm_reset_control_get in commit message That comment would be better if it was in the code. >=20 > drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > 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 su= nxi_priv_data *gmac) > =20 > clk_disable_unprepare(gmac->ephy_clk); > reset_control_assert(gmac->rst_ephy); > + reset_control_put(gmac->rst_ephy); Putting it here is weird. What would happen if power_phy / unpower_phy is called several times? Can't we just make it symetric and undo in remove what we do in probe? Maxime --=20 Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com --7mqomjgivpyllpcv Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBAgAGBQJZwNklAAoJEBx+YmzsjxAgc1sQALqO1I3/P84NAW9+qGwxSTxI ba/GiF/zhUPXY7yHr525XqpS0Jw4W7UeUdFeUvLIO2egKbsWF1gkDw6s1+vr2Mmz 5Ontv4Dcsl3gtGufu02QGmLfscfdwsru7xAC6zZaKi95pNxnrtlxFxcBRkibgRYa qqquX92ejLAwuhnm7W2YdP/GafdoDVvbXlEQ3e3wmNEXJ+6u/a6KkEwUmrzlWf8N SF7SpXXcORLK8MFwAoqnQeI+HASyEQMWk8kxwM73YKiRl9eHx8Xa8dVSJ70G3tK4 FZN/Cm191I1WH+E9tJlvE4lrfoJBdWYIQBWPnNcmq5WrsLBmexn30NVp/72Jlibf 9G+6rY0vbvI4SQKjxWrEKtb2XU577vfg2tC9OFhGULA6hHp2qshw2G2eHDIklVra b8919uhgLLtHUC5HRh23x1XsKBtuQ972RyAEiz1lfSiThPawbwYbRf9JrDeV9l02 SnuAmEGNvK72NHET+JRmmb4TqhGhMISasTF7XLUcrCYqfGjel54LApvSXirDeQ1H BnLyyC+IZ5iCtSI9RFbAdbw6eEnzWW1SLcHK+yIc4+U2Bw+GxYvICmFMg7ad85Fz NAZxSmRgrd9m5GZltoZZH9H1pGv/qhIdQ3X5kW6LeScmvdz5crjy1STQCXAlY1St U9Cavy0g78jKumyev0PA =Xp24 -----END PGP SIGNATURE----- --7mqomjgivpyllpcv--