linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Samuel Holland <samuel@sholland.org>
To: Alexander Duyck <alexander.duyck@gmail.com>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Maxime Ripard <mripard@kernel.org>, Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@siol.net>,
	Corentin Labbe <clabbe@baylibre.com>,
	Ondrej Jirman <megous@megous.com>,
	Netdev <netdev@vger.kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	LKML <linux-kernel@vger.kernel.org>,
	linux-sunxi@googlegroups.com
Subject: Re: [PATCH net-next RESEND 3/5] net: stmmac: dwmac-sun8i: Use reset_control_reset
Date: Mon, 8 Feb 2021 21:24:27 -0600	[thread overview]
Message-ID: <b12c9e59-cb96-dd88-e2b7-31517bd0f63e@sholland.org> (raw)
In-Reply-To: <CAKgT0Ue3GAWbjZcX7aFxuM-iY-Ga2E0JOTftUqPBQC_dEGz_Eg@mail.gmail.com>

On 2/8/21 10:29 AM, Alexander Duyck wrote:
> On Sun, Feb 7, 2021 at 10:32 PM Samuel Holland <samuel@sholland.org> wrote:
>>
>> Use the appropriate function instead of reimplementing it,
>> and update the error message to match the code.
>>
>> Reviewed-by: Chen-Yu Tsai <wens@csie.org>
>> Signed-off-by: Samuel Holland <samuel@sholland.org>
>> ---
>>  drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 6 ++----
>>  1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
>> index 3c3d0b99d3e8..0e8d88417251 100644
>> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
>> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
>> @@ -806,11 +806,9 @@ static int sun8i_dwmac_power_internal_phy(struct stmmac_priv *priv)
>>         /* Make sure the EPHY is properly reseted, as U-Boot may leave
>>          * it at deasserted state, and thus it may fail to reset EMAC.
>>          */
>> -       reset_control_assert(gmac->rst_ephy);
>> -
>> -       ret = reset_control_deassert(gmac->rst_ephy);
>> +       ret = reset_control_reset(gmac->rst_ephy);
>>         if (ret) {
>> -               dev_err(priv->device, "Cannot deassert internal phy\n");
>> +               dev_err(priv->device, "Cannot reset internal PHY\n");
>>                 clk_disable_unprepare(gmac->ephy_clk);
>>                 return ret;
>>         }
> 
> I'm assuming you have exclusive access to the phy and this isn't a
> shared line? Just wanting to confirm since the function call has the
> following comment in the header for the documentation.

Yes, this driver has exclusive access:

	gmac->rst_ephy = of_reset_control_get_exclusive(iphynode, NULL);

And this is a reset line for the Ethernet PHY inside the SoC, that as
far as I can tell is not shared with anything else.

>  * Consumers must not use reset_control_(de)assert on shared reset lines when
>  * reset_control_reset has been used.
>  *
> 
> If that is the case it might not hurt to add some documentation to
> your call to reset_control_reset here explaining that it is safe to do
> so since you have exclusive access.

I can expand the comment above this line for v2.

Cheers,
Samuel

  reply	other threads:[~2021-02-09  3:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-08  6:28 [PATCH net-next RESEND 0/5] dwmac-sun8i cleanup and shutdown hook Samuel Holland
2021-02-08  6:28 ` [PATCH] i2c: mv64xxx: Fix check for missing clock Samuel Holland
2021-02-08  6:31   ` Samuel Holland
2021-02-08 13:20     ` Andrew Lunn
2021-02-09  3:05       ` Samuel Holland
2021-02-08 21:11     ` Jakub Kicinski
2021-02-08  6:28 ` [PATCH net-next RESEND 1/5] net: stmmac: dwmac-sun8i: Return void from PHY unpower Samuel Holland
2021-02-08  6:28 ` [PATCH net-next RESEND 2/5] net: stmmac: dwmac-sun8i: Remove unnecessary PHY power check Samuel Holland
2021-02-08  6:28 ` [PATCH net-next RESEND 3/5] net: stmmac: dwmac-sun8i: Use reset_control_reset Samuel Holland
2021-02-08 16:29   ` Alexander Duyck
2021-02-09  3:24     ` Samuel Holland [this message]
2021-02-08  6:28 ` [PATCH net-next RESEND 4/5] net: stmmac: dwmac-sun8i: Minor probe function cleanup Samuel Holland
2021-02-08  6:28 ` [PATCH net-next RESEND 5/5] net: stmmac: dwmac-sun8i: Add a shutdown callback Samuel Holland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b12c9e59-cb96-dd88-e2b7-31517bd0f63e@sholland.org \
    --to=samuel@sholland.org \
    --cc=alexander.duyck@gmail.com \
    --cc=alexandre.torgue@st.com \
    --cc=clabbe@baylibre.com \
    --cc=davem@davemloft.net \
    --cc=jernej.skrabec@siol.net \
    --cc=joabreu@synopsys.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@googlegroups.com \
    --cc=megous@megous.com \
    --cc=mripard@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    --cc=wens@csie.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).