mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: f.fainelli@gmail.com
Cc: netdev@vger.kernel.org, kuba@kernel.org, andrew@lunn.ch,
	vivien.didelot@gmail.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] net: dsa: bcm_sf2: Do not register slave MDIO bus with OF
Date: Mon, 06 Apr 2020 10:08:23 -0700 (PDT)	[thread overview]
Message-ID: <20200406.100823.2156599779063686930.davem@davemloft.net> (raw)
In-Reply-To: <20200404213517.12783-1-f.fainelli@gmail.com>

From: Florian Fainelli <f.fainelli@gmail.com>
Date: Sat,  4 Apr 2020 14:35:17 -0700

> We were registering our slave MDIO bus with OF and doing so with
> assigning the newly created slave_mii_bus of_node to the master MDIO bus
> controller node. This is a bad thing to do for a number of reasons:
> 
> - we are completely lying about the slave MII bus is arranged and yet we
>   still want to control which MDIO devices it probes. It was attempted
>   before to play tricks with the bus_mask to perform that:
>   https://www.spinics.net/lists/netdev/msg429420.html but the approach
>   was rightfully rejected
> 
> - the device_node reference counting is messed up and we are effectively
>   doing a double probe on the devices we already probed using the
>   master, this messes up all resources reference counts (such as clocks)
> 
> The proper fix for this as indicated by David in his reply to the
> thread above is to use a platform data style registration so as to
> control exactly which devices we probe:
> https://www.spinics.net/lists/netdev/msg430083.html
> 
> By using mdiobus_register(), our slave_mii_bus->phy_mask value is used
> as intended, and all the PHY addresses that must be redirected towards
> our slave MDIO bus is happening while other addresses get redirected
> towards the master MDIO bus.
> 
> Fixes: 461cd1b03e32 ("net: dsa: bcm_sf2: Register our slave MDIO bus")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Applied and queued up for -stable.

      parent reply	other threads:[~2020-04-06 17:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-04 21:35 Florian Fainelli
2020-04-06 15:30 ` Vivien Didelot
2020-04-06 17:08 ` David Miller [this message]

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=20200406.100823.2156599779063686930.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=andrew@lunn.ch \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@gmail.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

all inboxes | Powered by JetHome®