Re: [PATCH v2 net-next] net: convert suitable drivers to use phy_do_ioctl_running

2020-01-23 Thread David Miller
From: Heiner Kallweit 
Date: Tue, 21 Jan 2020 22:09:33 +0100

> Convert suitable drivers to use new helper phy_do_ioctl_running.
> 
> Signed-off-by: Heiner Kallweit 
> ---
> v2: I forgot the netdev mailing list

Applied to net-next.


Re: [PATCH v2 net-next] net: convert suitable drivers to use phy_do_ioctl_running

2020-01-21 Thread Heiner Kallweit
On 22.01.2020 05:04, Florian Fainelli wrote:
> 
> 
> On 1/21/2020 1:09 PM, Heiner Kallweit wrote:
>> Convert suitable drivers to use new helper phy_do_ioctl_running.
>>
>> Signed-off-by: Heiner Kallweit 
> The vast majority of drivers that you are converting use the following
> convention:
> 
> - !netif_running -> return -EINVAL
> - !dev->phydev -> return -ENODEV
> 
> so it may make sense to change the helper to accommodate the majority
> here, not that I believe this is going to make much practical
> difference, but if there were test cases that were specifically looking
> for such an error code, they could be failing after this changeset.
> 
Right, I also stumbled across the different error codes, mainly as you
say -EINVAL. However there is no "wrong value", if netdev isn't running,
then typically the PHY is not attached, and from a netdev point of view
it's not there. So ENODEV seems to be best suited.
In kernel code the changed return code doesn't make a difference,
but yes, in theory there could be userspace programs checking for
-EINVAL. However such userspace programs should check for ENODEV too
anyway to cover the second check that already returns -ENODEV.

> For bgmac.c, bcmgenet.c and cpmac.c:
> 
> Acked-by: Florian Fainelli 
> 
> Whether you decide to spin another version or not.
> 
Heiner


Re: [PATCH v2 net-next] net: convert suitable drivers to use phy_do_ioctl_running

2020-01-21 Thread Florian Fainelli



On 1/21/2020 1:09 PM, Heiner Kallweit wrote:
> Convert suitable drivers to use new helper phy_do_ioctl_running.
> 
> Signed-off-by: Heiner Kallweit 
The vast majority of drivers that you are converting use the following
convention:

- !netif_running -> return -EINVAL
- !dev->phydev -> return -ENODEV

so it may make sense to change the helper to accommodate the majority
here, not that I believe this is going to make much practical
difference, but if there were test cases that were specifically looking
for such an error code, they could be failing after this changeset.

For bgmac.c, bcmgenet.c and cpmac.c:

Acked-by: Florian Fainelli 

Whether you decide to spin another version or not.
-- 
Florian


Re: [PATCH v2 net-next] net: convert suitable drivers to use phy_do_ioctl_running

2020-01-21 Thread Timur Tabi

On 1/21/20 3:09 PM, Heiner Kallweit wrote:

  drivers/net/ethernet/qualcomm/emac/emac.c  | 14 +-


Acked-by: Timur Tabi