From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
davem@davemloft.net
Cc: netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH] net: sh_eth: fix mdio access in sh_eth_close() for some SoCs
Date: Wed, 15 May 2019 18:41:22 +0300 [thread overview]
Message-ID: <0ab08e61-833d-1d9e-ef71-311964854d46@cogentembedded.com> (raw)
In-Reply-To: <1557898601-26231-1-git-send-email-yoshihiro.shimoda.uh@renesas.com>
Hello!
It's not "some SoCs", it's only R-Car gen2 and RZ/G1 SoCs.
On 05/15/2019 08:36 AM, Yoshihiro Shimoda wrote:
> The sh_eth_close() resets the MAC and then calls phy_stop()
> so that mdio read access result is incorrect without any error
> according to kernel trace like below:
>
> ifconfig-216 [003] .n.. 109.133124: mdio_access: ee700000.ethernet-ffffffff read phy:0x01 reg:0x00 val:0xffff
Not sure how RMII mode affects the MDIO transfers...
> To fix the issue, this patch adds a condition and set the RMII mode
> regiseter in sh_eth_dev_exit() for some SoCs.
>
> Note that when I have tried to move the sh_eth_dev_exit() calling
> after phy_stop() on sh_eth_close(), but it gets worse.
Ah, I was going to suggest changing the call order... what happens then?
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> ---
> drivers/net/ethernet/renesas/sh_eth.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
> index e33af37..106ae90 100644
> --- a/drivers/net/ethernet/renesas/sh_eth.c
> +++ b/drivers/net/ethernet/renesas/sh_eth.c
> @@ -1596,6 +1596,10 @@ static void sh_eth_dev_exit(struct net_device *ndev)
>
> /* Set MAC address again */
> update_mac_address(ndev);
> +
> + /* Set the mode again if required */
Should be "RMII mode", n ot just "Mode". We prolly need more detailed explanation...
> + if (mdp->cd->rmiimode)
> + sh_eth_write(ndev, 0x1, RMIIMODE);
> }
>
> static void sh_eth_rx_csum(struct sk_buff *skb)
MBR, Sergei
next prev parent reply other threads:[~2019-05-15 15:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-15 5:36 [PATCH] net: sh_eth: fix mdio access in sh_eth_close() for some SoCs Yoshihiro Shimoda
2019-05-15 15:41 ` Sergei Shtylyov [this message]
2019-05-20 7:42 ` Yoshihiro Shimoda
2019-05-25 18:06 ` Sergei Shtylyov
2019-05-28 2:33 ` Yoshihiro Shimoda
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=0ab08e61-833d-1d9e-ef71-311964854d46@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=davem@davemloft.net \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=yoshihiro.shimoda.uh@renesas.com \
/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).