[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ae6f72ec-a2af-3082-e481-58899d5ff5c9@gmail.com>
Date: Tue, 10 Jul 2018 21:20:09 +0200
From: Heiner Kallweit <hkallweit1@...il.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: David Miller <davem@...emloft.net>,
Florian Fainelli <f.fainelli@...il.com>,
Realtek linux nic maintainers <nic_swsd@...ltek.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next v2 01/10] r8169: add basic phylib support
On 10.07.2018 21:10, Andrew Lunn wrote:
>> +static int r8169_mdio_read_reg(struct mii_bus *mii_bus, int phyaddr, int phyreg)
>> +{
>> + struct rtl8169_private *tp = mii_bus->priv;
>> +
>> + if (phyaddr > 0)
>> + return -EINVAL;
>
> Please use ENODEV.
>
> The mdio bus is scanned for devices in __mdiobus_register(). If
> mdiobus_scan() returns -ENODEV, it is not considered an error, and it
> will continue scanning other addresses on the bus. Any other error is
> a real error, and will abort the scan. That will probably abort the
> bus registration.
>
OK
>> +static int r8169_mdio_register(struct rtl8169_private *tp)
>> +{
>> + struct pci_dev *pdev = tp->pci_dev;
>> + struct mii_bus *new_bus;
>> + int ret;
>> +
>> + new_bus = devm_mdiobus_alloc(&pdev->dev);
>> + if (!new_bus)
>> + return -ENOMEM;
>> +
>> + new_bus->name = "r8169";
>> + new_bus->phy_mask = ~1;
>
> Once your handling of addr > 0 is correct, you don't need this. Let
> is scan all addresses, just like a normal MDIO bus. The more we can
> keep it normal, the better.
>
Sounds good. I'll wait for feedback on other patches of the
series and then prepare a v3.
Heiner
> Andrew
>
Powered by blists - more mailing lists