All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: phy: fix reading fixed phy status
@ 2019-02-24 17:01 Heiner Kallweit
  2019-02-24 17:57 ` Andrew Lunn
  2019-02-25  6:29 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Heiner Kallweit @ 2019-02-24 17:01 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, David Miller; +Cc: netdev

With the switch to phy_resolve_aneg_linkmode() we don't read from the
chip any longer what is advertised but use phydev->advertising directly.
For a fixed phy however this bitmap is empty so far, what results in
no common mode being found. This breaks DSA. Fix this by advertising
everything that is supported. For a normal phy this done by phy_probe().

Fixes: 5502b218e001 ("net: phy: use phy_resolve_aneg_linkmode in genphy_read_status")
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/phy/fixed_phy.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c
index b0d1368c3..1acd8bfdb 100644
--- a/drivers/net/phy/fixed_phy.c
+++ b/drivers/net/phy/fixed_phy.c
@@ -22,6 +22,7 @@
 #include <linux/seqlock.h>
 #include <linux/idr.h>
 #include <linux/netdevice.h>
+#include <linux/linkmode.h>
 
 #include "swphy.h"
 
@@ -300,6 +301,8 @@ static struct phy_device *__fixed_phy_register(unsigned int irq,
 				 phy->supported);
 	}
 
+	linkmode_copy(phy->advertising, phy->supported);
+
 	ret = phy_device_register(phy);
 	if (ret) {
 		phy_device_free(phy);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net: phy: fix reading fixed phy status
  2019-02-24 17:01 [PATCH net] net: phy: fix reading fixed phy status Heiner Kallweit
@ 2019-02-24 17:57 ` Andrew Lunn
  2019-02-24 18:00   ` Heiner Kallweit
  2019-02-25  6:29 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Andrew Lunn @ 2019-02-24 17:57 UTC (permalink / raw)
  To: Heiner Kallweit; +Cc: Florian Fainelli, David Miller, netdev

On Sun, Feb 24, 2019 at 06:01:18PM +0100, Heiner Kallweit wrote:
> With the switch to phy_resolve_aneg_linkmode() we don't read from the
> chip any longer what is advertised but use phydev->advertising directly.
> For a fixed phy however this bitmap is empty so far, what results in
> no common mode being found. This breaks DSA. Fix this by advertising
> everything that is supported. For a normal phy this done by phy_probe().
> 
> Fixes: 5502b218e001 ("net: phy: use phy_resolve_aneg_linkmode in genphy_read_status")
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Tested-by: Andrew Lunn <andrew@lunn.ch>

But i tested on net-next, not net.

    Andrew


> ---
>  drivers/net/phy/fixed_phy.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c
> index b0d1368c3..1acd8bfdb 100644
> --- a/drivers/net/phy/fixed_phy.c
> +++ b/drivers/net/phy/fixed_phy.c
> @@ -22,6 +22,7 @@
>  #include <linux/seqlock.h>
>  #include <linux/idr.h>
>  #include <linux/netdevice.h>
> +#include <linux/linkmode.h>
>  
>  #include "swphy.h"
>  
> @@ -300,6 +301,8 @@ static struct phy_device *__fixed_phy_register(unsigned int irq,
>  				 phy->supported);
>  	}
>  
> +	linkmode_copy(phy->advertising, phy->supported);
> +
>  	ret = phy_device_register(phy);
>  	if (ret) {
>  		phy_device_free(phy);
> -- 
> 2.20.1
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net: phy: fix reading fixed phy status
  2019-02-24 17:57 ` Andrew Lunn
@ 2019-02-24 18:00   ` Heiner Kallweit
  0 siblings, 0 replies; 4+ messages in thread
From: Heiner Kallweit @ 2019-02-24 18:00 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: Florian Fainelli, David Miller, netdev

On 24.02.2019 18:57, Andrew Lunn wrote:
> On Sun, Feb 24, 2019 at 06:01:18PM +0100, Heiner Kallweit wrote:
>> With the switch to phy_resolve_aneg_linkmode() we don't read from the
>> chip any longer what is advertised but use phydev->advertising directly.
>> For a fixed phy however this bitmap is empty so far, what results in
>> no common mode being found. This breaks DSA. Fix this by advertising
>> everything that is supported. For a normal phy this done by phy_probe().
>>
>> Fixes: 5502b218e001 ("net: phy: use phy_resolve_aneg_linkmode in genphy_read_status")
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> 
> Tested-by: Andrew Lunn <andrew@lunn.ch>
> 
> But i tested on net-next, not net.
> 
You're right, it should be net-next. I just had the wrong automatism
fix = net in my mind.

>     Andrew
> 
> 
Heiner

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net: phy: fix reading fixed phy status
  2019-02-24 17:01 [PATCH net] net: phy: fix reading fixed phy status Heiner Kallweit
  2019-02-24 17:57 ` Andrew Lunn
@ 2019-02-25  6:29 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2019-02-25  6:29 UTC (permalink / raw)
  To: hkallweit1; +Cc: andrew, f.fainelli, netdev

From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Sun, 24 Feb 2019 18:01:18 +0100

> With the switch to phy_resolve_aneg_linkmode() we don't read from the
> chip any longer what is advertised but use phydev->advertising directly.
> For a fixed phy however this bitmap is empty so far, what results in
> no common mode being found. This breaks DSA. Fix this by advertising
> everything that is supported. For a normal phy this done by phy_probe().
> 
> Fixes: 5502b218e001 ("net: phy: use phy_resolve_aneg_linkmode in genphy_read_status")
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Applied to net-next.

Let me know if I got this wrong.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-02-25  6:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-24 17:01 [PATCH net] net: phy: fix reading fixed phy status Heiner Kallweit
2019-02-24 17:57 ` Andrew Lunn
2019-02-24 18:00   ` Heiner Kallweit
2019-02-25  6:29 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.