mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Abhishek Chauhan (ABC)" <quic_abchauha@quicinc.com>
To: Quentin Schulz <quentin.schulz@cherry.de>,
	Paolo Abeni <pabeni@redhat.com>,
	Quentin Schulz <foss+kernel@0leil.net>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>
Cc: Jakob Unterwurzacher <jakob.unterwurzacher@cherry.de>,
	Heiko Stuebner <heiko@sntech.de>, <netdev@vger.kernel.org>,
	<linux-stm32@st-md-mailman.stormreply.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net] net: stmmac: platform: guarantee uniqueness of bus_id
Date: Mon, 2 Jun 2025 10:56:18 -0700	[thread overview]
Message-ID: <36a5fe83-0bb3-4df0-9fb7-bfdc849ce715@quicinc.com> (raw)
In-Reply-To: <e912504e-651b-4992-953e-1a239cbf2550@cherry.de>



On 6/2/2025 2:38 AM, Quentin Schulz wrote:
> Hi Abhishek,
> 
> On 5/30/25 12:16 AM, Abhishek Chauhan (ABC) wrote:
>> [Some people who received this message don't often get email from quic_abchauha@quicinc.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>>
>> On 5/26/2025 1:26 PM, Paolo Abeni wrote:
>>> On 5/21/25 5:21 PM, Quentin Schulz wrote:
>>>> From: Quentin Schulz <quentin.schulz@cherry.de>
>>>>
>>>> bus_id is currently derived from the ethernetX alias. If one is missing
>>>> for the device, 0 is used. If ethernet0 points to another stmmac device
>>>> or if there are 2+ stmmac devices without an ethernet alias, then bus_id
>>>> will be 0 for all of those.
>>>>
>>>> This is an issue because the bus_id is used to generate the mdio bus id
>>>> (new_bus->id in drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
>>>> stmmac_mdio_register) and this needs to be unique.
>>>>
>>>> This allows to avoid needing to define ethernet aliases for devices with
>>>> multiple stmmac controllers (such as the Rockchip RK3588) for multiple
>>>> stmmac devices to probe properly.
>>>>
>>>> Obviously, the bus_id isn't guaranteed to be stable across reboots if no
>>>> alias is set for the device but that is easily fixed by simply adding an
>>>> alias if this is desired.
>>>>
>>>> Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
>>>
>>> I think no need to CC stable here, but you need to provide a suitable
>>> fixes tag, thanks!
>>>
>> Quentin to make your life easy.
>> It fixes this patch
>> https://lore.kernel.org/lkml/1372930541-19409-1-git-send-email-srinivas.kandagatla@st.com/
>> dt:net:stmmac: Add support to dwmac version 3.610 and 3.710
>> It goes back in time to 2013 when this bus_id was introduced through dts
>>
> 
> Fortunately, we ended up finding the same "culprit" (see v2 of my patch that got merged[1] :) )
> 
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=eb7fd7aa35bfcc1e1fda4ecc42ccfcb526cdc780
> Nice!. Anyway i really like this fix because mdio creates a directory and if there are 2+ macs the directory creation will fail because 
two emac will have the same mdio directory names provided if someone forgets to mention alias in the dtsi. 
> Thanks!
> Quentin

      reply	other threads:[~2025-06-02 17:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-21 15:21 Quentin Schulz
2025-05-26 20:26 ` Paolo Abeni
2025-05-29 22:16   ` Abhishek Chauhan (ABC)
2025-06-02  9:38     ` Quentin Schulz
2025-06-02 17:56       ` Abhishek Chauhan (ABC) [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=36a5fe83-0bb3-4df0-9fb7-bfdc849ce715@quicinc.com \
    --to=quic_abchauha@quicinc.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=foss+kernel@0leil.net \
    --cc=heiko@sntech.de \
    --cc=jakob.unterwurzacher@cherry.de \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=quentin.schulz@cherry.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

all inboxes | Powered by JetHome®