linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: nic_swsd@realtek.com, "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Sayanta Pattanayak <sayanta.pattanayak@arm.com>
Subject: Re: [PATCH] r8169: Avoid duplicate sysfs entry creation error
Date: Wed, 23 Jun 2021 22:43:59 +0100	[thread overview]
Message-ID: <20210623224359.5b1912d1@slackpad.fritz.box> (raw)
In-Reply-To: <1c26684c-d3eb-92b9-b93f-4dd02b47603e@gmail.com>

On Wed, 23 Jun 2021 21:48:14 +0200
Heiner Kallweit <hkallweit1@gmail.com> wrote:

Hi Heiner,

> On 22.06.2021 14:52, Andre Przywara wrote:
> > From: Sayanta Pattanayak <sayanta.pattanayak@arm.com>
> > 
> > When registering the MDIO bus for a r8169 device, we use the PCI B/D/F
> > specifier as a (seemingly) unique device identifier.
> > However the very same BDF number can be used on another PCI segment,
> > which makes the driver fail probing:
> > 
> > [ 27.544136] r8169 0002:07:00.0: enabling device (0000 -> 0003)
> > [ 27.559734] sysfs: cannot create duplicate filename '/class/mdio_bus/r8169-700'
> > ....…
> > [ 27.684858] libphy: mii_bus r8169-700 failed to register
> > [ 27.695602] r8169: probe of 0002:07:00.0 failed with error -22
> > 
> > Add the segment number to the device name to make it more unique.
> > 
> > This fixes operation on an ARM N1SDP board, where two boards might be
> > connected together to form an SMP system, and all on-board devices show
> > up twice, just on different PCI segments.
> > 
> > Signed-off-by: Sayanta Pattanayak <sayanta.pattanayak@arm.com>
> > [Andre: expand commit message]
> > Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> > ---
> >  drivers/net/ethernet/realtek/r8169_main.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
> > index 2c89cde7da1e..209dee295ce2 100644
> > --- a/drivers/net/ethernet/realtek/r8169_main.c
> > +++ b/drivers/net/ethernet/realtek/r8169_main.c
> > @@ -5086,7 +5086,8 @@ static int r8169_mdio_register(struct rtl8169_private *tp)
> >  	new_bus->priv = tp;
> >  	new_bus->parent = &pdev->dev;
> >  	new_bus->irq[0] = PHY_MAC_INTERRUPT;
> > -	snprintf(new_bus->id, MII_BUS_ID_SIZE, "r8169-%x", pci_dev_id(pdev));
> > +	snprintf(new_bus->id, MII_BUS_ID_SIZE, "r8169-%x-%x",
> > +		 pdev->bus->domain_nr, pci_dev_id(pdev));
> >    
> I think you saw the error mail from kernel test robot.
> You have to use pci_domain_nr() instead of member domain_nr directly.

Yeah, thanks, I figured already. I actually missed test-compiling for
x86 :-(

Will send v2 ASAP.

Cheers,
Andre

> 
> >  	new_bus->read = r8169_mdio_read_reg;
> >  	new_bus->write = r8169_mdio_write_reg;
> >   
> 


      reply	other threads:[~2021-06-23 21:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22 12:52 [PATCH] r8169: Avoid duplicate sysfs entry creation error Andre Przywara
2021-06-23 14:14 ` kernel test robot
2021-06-23 19:48 ` Heiner Kallweit
2021-06-23 21:43   ` Andre Przywara [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=20210623224359.5b1912d1@slackpad.fritz.box \
    --to=andre.przywara@arm.com \
    --cc=davem@davemloft.net \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    --cc=sayanta.pattanayak@arm.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;
as well as URLs for NNTP newsgroup(s).