From: Kelvin Cheung <keguang.zhang@gmail.com>
To: Serge Semin <fancer.lancer@gmail.com>
Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
"David S . Miller" <davem@davemloft.net>
Subject: Re: [PATCH] MIPS: loongson32: Fix the validation failure of LS1B & LS1C Ethernet PHY
Date: Sun, 28 Aug 2022 21:31:25 +0800 [thread overview]
Message-ID: <CAJhJPsW0HTs+=PD2JvXZVTkm9zrnRYKtEwLNv3dsVsf1AUNjDQ@mail.gmail.com> (raw)
In-Reply-To: <20220821171030.wc343w6zmrtcz5to@mobilestation>
Hi Serge,
Your patch also works for me.
But what about the plat_dat->interface? Is it obsolete?
Serge Semin <fancer.lancer@gmail.com> 于2022年8月22日周一 01:10写道:
>
> Hello Keguang
>
> On Thu, Aug 18, 2022 at 01:00:19PM +0800, Keguang Zhang wrote:
> > From: Kelvin Cheung <keguang.zhang@gmail.com>
> >
> > The Ethernet of LS1B/LS1C doesn't work due to the stmmac driver
> > using phylink_generic_validate() instead of stmmac_validate().
> > Moreover the driver assumes the PHY interface mode
> > passed in platform data is always supported.
> >
> > stmmaceth stmmaceth.0 eth0: validation of gmii with support 00000000,00000000,000062cf and advertisement 00000000,00000000,000062cf failed: -EINVAL
> > stmmaceth stmmaceth.0 eth0: stmmac_open: Cannot attach to PHY (error: -22)
> >
> > This patch sets phy_interface field of platform data.
>
> I've got a similar fix in my repo, though didn't have a chance to test
> it out due to lacking any loongson hardware. I've discovered the
> issues on my still going way of the STMMAC driver refactoring. Anyway
> IMO the problem is a bit different than you describe and should be
> fixed in a bit different way. Please see a patch attached to this
> email. Could you test it out on your hw? If it fixes the problem you
> can resend it as v2 patch.
>
> -Sergey
>
> >
> > Fixes: 04a0683f7db4 ("net: stmmac: convert to phylink_generic_validate()")
> > Fixes: d194923d51c9 ("net: stmmac: fill in supported_interfaces")
> > Signed-off-by: Kelvin Cheung <keguang.zhang@gmail.com>
> > ---
> > arch/mips/loongson32/common/platform.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/arch/mips/loongson32/common/platform.c b/arch/mips/loongson32/common/platform.c
> > index 794c96c2a4cd..741aace80b80 100644
> > --- a/arch/mips/loongson32/common/platform.c
> > +++ b/arch/mips/loongson32/common/platform.c
> > @@ -147,8 +147,10 @@ static struct plat_stmmacenet_data ls1x_eth0_pdata = {
> > .phy_addr = -1,
> > #if defined(CONFIG_LOONGSON1_LS1B)
> > .interface = PHY_INTERFACE_MODE_MII,
> > + .phy_interface = PHY_INTERFACE_MODE_MII,
> > #elif defined(CONFIG_LOONGSON1_LS1C)
> > .interface = PHY_INTERFACE_MODE_RMII,
> > + .phy_interface = PHY_INTERFACE_MODE_RMII,
> > #endif
> > .mdio_bus_data = &ls1x_mdio_bus_data,
> > .dma_cfg = &ls1x_eth_dma_cfg,
> >
> > base-commit: 568035b01cfb107af8d2e4bd2fb9aea22cf5b868
> > --
> > 2.34.1
> >
--
Best regards,
Kelvin Cheung
next prev parent reply other threads:[~2022-08-28 13:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-18 5:00 [PATCH] MIPS: loongson32: Fix the validation failure of LS1B & LS1C Ethernet PHY Keguang Zhang
2022-08-21 17:10 ` Serge Semin
2022-08-28 13:31 ` Kelvin Cheung [this message]
2022-09-02 22:46 ` Serge Semin
2022-09-11 6:27 ` Kelvin Cheung
2022-09-11 15:31 ` Serge Semin
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='CAJhJPsW0HTs+=PD2JvXZVTkm9zrnRYKtEwLNv3dsVsf1AUNjDQ@mail.gmail.com' \
--to=keguang.zhang@gmail.com \
--cc=davem@davemloft.net \
--cc=fancer.lancer@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=tsbogend@alpha.franken.de \
/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).