Hi, Oh, I didn't know about Christian's patch.
I shall test on our device tomorrow. If it works, we will use internal PHY access. But I think that qca8k_port_to_phy should be used in the external mode as well. On our device the PHYs are mapped on 0-4 on the master bus even in that mode. Marek On Thu, 21 Mar 2019 11:26:08 -0700 Florian Fainelli <f.faine...@gmail.com> wrote: > +Christian, > > On 3/21/19 11:23 AM, Marek Behún wrote: > > The MDIO addresses of the internal PHYs on this switch for ports 1-5 > > have addresses 0-4, not 1-5. > > > > Can you provide a Fixes: tag for this? Your change will conflicts with > Christian's patch series here: > > http://patchwork.ozlabs.org/project/netdev/list/?series=98063 > > > Signed-off-by: Marek Behún <marek.be...@nic.cz> > > Cc: Andrew Lunn <and...@lunn.ch> > > Cc: Florian Fainelli <f.faine...@gmail.com> > > Cc: Michal Vokáč <voka...@gmail.com> > > Cc: John Crispin <j...@phrozen.org> > > Cc: Wei Yongjun <weiyongj...@huawei.com> > > --- > > drivers/net/dsa/qca8k.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c > > index cdcde7f8e0b2..eb199193cc3b 100644 > > --- a/drivers/net/dsa/qca8k.c > > +++ b/drivers/net/dsa/qca8k.c > > @@ -625,7 +625,7 @@ qca8k_phy_read(struct dsa_switch *ds, int phy, > > int regnum) { > > struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv; > > > > - return mdiobus_read(priv->bus, phy, regnum); > > + return mdiobus_read(priv->bus, phy - 1, regnum); > > } > > > > static int > > @@ -633,7 +633,7 @@ qca8k_phy_write(struct dsa_switch *ds, int phy, > > int regnum, u16 val) { > > struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv; > > > > - return mdiobus_write(priv->bus, phy, regnum, val); > > + return mdiobus_write(priv->bus, phy - 1, regnum, val); > > } > > > > static void > > > >