All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodolfo Giometti <giometti@enneenne.com>
To: Florian Fainelli <f.fainelli@gmail.com>, Andrew Lunn <andrew@lunn.ch>
Cc: Vivien Didelot <vivien.didelot@savoirfairelinux.com>,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org
Subject: Re: Possible bug into DSA2 code.
Date: Mon, 18 Feb 2019 11:38:22 +0100	[thread overview]
Message-ID: <f3fc92ec-606c-fc48-6482-a3015a82c72d@enneenne.com> (raw)
In-Reply-To: <24527f56-41dd-f257-0f5e-c568cb80881e@gmail.com>

On 11/02/2019 20:13, Florian Fainelli wrote:
> Does that work:
> 
> diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
> index a1917025e155..54cf6a5c865d 100644
> --- a/net/dsa/dsa2.c
> +++ b/net/dsa/dsa2.c
> @@ -368,6 +368,9 @@ static int dsa_switch_setup(struct dsa_switch *ds)
>          if (err)
>                  return err;
> 
> +       if (ds->slave_mii_bus && (ds->ops->phy_read || ds->ops->phy_write))
> +               return -EINVAL;
> +
>          if (!ds->slave_mii_bus && ds->ops->phy_read) {
>                  ds->slave_mii_bus = devm_mdiobus_alloc(ds->dev);
>                  if (!ds->slave_mii_bus)
> diff --git a/net/dsa/legacy.c b/net/dsa/legacy.c
> index cb42939db776..0796c6213be6 100644
> --- a/net/dsa/legacy.c
> +++ b/net/dsa/legacy.c
> @@ -176,6 +176,9 @@ static int dsa_switch_setup_one(struct dsa_switch *ds,
>          if (ret)
>                  return ret;
> 
> +       if (ds->slave_mii_bus && (ops->phy_read || ops->phy_write))
> +               return -EINVAL;
> +
>          if (!ds->slave_mii_bus && ops->phy_read) {
>                  ds->slave_mii_bus = devm_mdiobus_alloc(ds->dev);
>                  if (!ds->slave_mii_bus)

OK, now probing of mv88e6085 fails!

[   42.745004] mv88e6085: probe of d0032004.mdio-mii:01 failed with error -22

Now I suppose mv88e6085's driver should set ds->slave_mii_bus as follow:

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 54a5b660640a..bb46ebbb2bb8 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -2399,7 +2399,7 @@ static int mv88e6xxx_setup(struct dsa_switch *ds)
         int i;

         chip->ds = ds;
-       ds->slave_mii_bus = mv88e6xxx_default_mdio_bus(chip);
+       ds->slave_mii_bus = NULL;

         mutex_lock(&chip->reg_lock);

Is that right?

Ciao,

Rodolfo


-- 
GNU/Linux Solutions                  e-mail: giometti@enneenne.com
Linux Device Driver                          giometti@linux.it
Embedded Systems                     phone:  +39 349 2432127
UNIX programming                     skype:  rodolfo.giometti

  reply	other threads:[~2019-02-18 10:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <a121e6b5-03cd-da9e-42e8-41c68e12babe@enneenne.com>
2019-02-09  8:24 ` Possible bug into DSA2 code Rodolfo Giometti
2019-02-09 19:34   ` Andrew Lunn
2019-02-10 11:45     ` Rodolfo Giometti
2019-02-11 17:28       ` Florian Fainelli
2019-02-11 17:51         ` Rodolfo Giometti
2019-02-11 18:01           ` Florian Fainelli
2019-02-11 19:13             ` Florian Fainelli
2019-02-18 10:38               ` Rodolfo Giometti [this message]
2019-02-19  0:03                 ` Andrew Lunn
2019-02-20  7:54                   ` Rodolfo Giometti
2019-02-20 15:02                     ` Andrew Lunn

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=f3fc92ec-606c-fc48-6482-a3015a82c72d@enneenne.com \
    --to=giometti@enneenne.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@savoirfairelinux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.