lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9098cfde-ab40-494e-bda2-11a498ff36a4@gmail.com>
Date: Sat, 3 Feb 2024 13:07:46 -0800
From: Florian Fainelli <f.fainelli@...il.com>
To: Andrew Lunn <andrew@...n.ch>, Heiner Kallweit <hkallweit1@...il.com>,
 Russell King <linux@...linux.org.uk>, "David S. Miller"
 <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
 Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
 Vladimir Oltean <olteanv@...il.com>
Cc: netdev@...r.kernel.org, Tim Menninger <tmenninger@...estorage.com>
Subject: Re: [PATCH net-next 2/2] net: dsa: mv88e6xxx: Return -ENODEV when
 C22/C45 not supported



On 2/3/2024 12:52 PM, Andrew Lunn wrote:
> MDIO bus drivers can return -ENODEV when they know the bus does not
> have a device at the given address, e.g. because of hardware
> limitation. One such limitation is that the bus does not support C22
> or C45 at all. This is more efficient than returning 0xffff, since it
> immediately stops the probing on the given address, where as further
> reads can be made when 0xffff is returned.
> 
> Signed-off-by: Andrew Lunn <andrew@...n.ch>
> ---
>   drivers/net/dsa/mv88e6xxx/chip.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
> index 6eec2e4aa031..ce4e4bdf475d 100644
> --- a/drivers/net/dsa/mv88e6xxx/chip.c
> +++ b/drivers/net/dsa/mv88e6xxx/chip.c
> @@ -3633,7 +3633,7 @@ static int mv88e6xxx_mdio_read(struct mii_bus *bus, int phy, int reg)
>   	int err;
>   
>   	if (!chip->info->ops->phy_read)
> -		return -EOPNOTSUPP;
> +		return -ENODEV;

Still not sure this is the right way to do do it here.

>   
>   	mv88e6xxx_reg_lock(chip);
>   	err = chip->info->ops->phy_read(chip, bus, phy, reg, &val);
> @@ -3659,7 +3659,7 @@ static int mv88e6xxx_mdio_read_c45(struct mii_bus *bus, int phy, int devad,
>   	int err;
>   
>   	if (!chip->info->ops->phy_read_c45)
> -		return 0xffff;
> +		return -ENODEV;

Whereas here it makes sense to me to switch to -ENODEV.
-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ