netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3 1/2] net: phy: micrel: Discern KSZ8051 and KSZ8795 PHYs
@ 2019-10-13 19:34 Marek Vasut
  2019-10-13 19:34 ` [PATCH V3 2/2] net: phy: micrel: Update KSZ87xx PHY name Marek Vasut
  2019-10-13 20:15 ` [PATCH V3 1/2] net: phy: micrel: Discern KSZ8051 and KSZ8795 PHYs Heiner Kallweit
  0 siblings, 2 replies; 6+ messages in thread
From: Marek Vasut @ 2019-10-13 19:34 UTC (permalink / raw)
  To: netdev
  Cc: Marek Vasut, Andrew Lunn, David S . Miller, Florian Fainelli,
	George McCollister, Heiner Kallweit, Sean Nyekjaer, Tristram Ha,
	Woojung Huh

The KSZ8051 PHY and the KSZ8794/KSZ8795/KSZ8765 switch share exactly the
same PHY ID. Since KSZ8051 is higher in the ksphy_driver[] list of PHYs
in the micrel PHY driver, it is used even with the KSZ87xx switch. This
is wrong, since the KSZ8051 configures registers of the PHY which are
not present on the simplified KSZ87xx switch PHYs and misconfigures
other registers of the KSZ87xx switch PHYs.

Fortunatelly, it is possible to tell apart the KSZ8051 PHY from the
KSZ87xx switch by checking the Basic Status register Bit 0, which is
read-only and indicates presence of the Extended Capability Registers.
The KSZ8051 PHY has those registers while the KSZ87xx switch does not.

This patch implements simple check for the presence of this bit for
both the KSZ8051 PHY and KSZ87xx switch, to let both use the correct
PHY driver instance.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: David S. Miller <davem@davemloft.net>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: George McCollister <george.mccollister@gmail.com>
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
Cc: Tristram Ha <Tristram.Ha@microchip.com>
Cc: Woojung Huh <woojung.huh@microchip.com>
Fixes: 9d162ed69f51 ("net: phy: micrel: add support for KSZ8795")
---
NOTE: It was also suggested to populate phydev->dev_flags to discern
      the PHY from the switch, this does not work for setups where
      the switch is used as a PHY without a DSA driver. Checking the
      BMSR Bit 0 for Extended Capability Register works for both DSA
      and non-DSA usecase.
V2: Move phy_id check into ksz8051_match_phy_device() and
    ksz8795_match_phy_device() and drop phy_id{,_mask} from the
    ksphy_driver[] list to avoid matching on other PHY IDs.
V3: Pull the logic behind discerning the KSZ8051 PHY and KSZ87xx switch
    into common ksz8051_ksz8795_match_phy_device() function. Add Fixes
    tag.
---
 drivers/net/phy/micrel.c | 40 ++++++++++++++++++++++++++++++++++++----
 1 file changed, 36 insertions(+), 4 deletions(-)

diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 2fea5541c35a..a0444e28c6e7 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -341,6 +341,35 @@ static int ksz8041_config_aneg(struct phy_device *phydev)
 	return genphy_config_aneg(phydev);
 }
 
+static int ksz8051_ksz8795_match_phy_device(struct phy_device *phydev,
+					    const u32 ksz_phy_id)
+{
+	int ret;
+
+	if ((phydev->phy_id & MICREL_PHY_ID_MASK) != ksz_phy_id)
+		return 0;
+
+	ret = phy_read(phydev, MII_BMSR);
+	if (ret < 0)
+		return ret;
+
+	/* KSZ8051 PHY and KSZ8794/KSZ8795/KSZ8765 switch share the same
+	 * exact PHY ID. However, they can be told apart by the extended
+	 * capability registers presence. The KSZ8051 PHY has them while
+	 * the switch does not.
+	 */
+	ret &= BMSR_ERCAP;
+	if (ksz_phy_id == PHY_ID_KSZ8051)
+		return ret;
+	else
+		return !ret;
+}
+
+static int ksz8051_match_phy_device(struct phy_device *phydev)
+{
+	return ksz8051_ksz8795_match_phy_device(phydev, PHY_ID_KSZ8051);
+}
+
 static int ksz8081_config_init(struct phy_device *phydev)
 {
 	/* KSZPHY_OMSO_FACTORY_TEST is set at de-assertion of the reset line
@@ -364,6 +393,11 @@ static int ksz8061_config_init(struct phy_device *phydev)
 	return kszphy_config_init(phydev);
 }
 
+static int ksz8795_match_phy_device(struct phy_device *phydev)
+{
+	return ksz8051_ksz8795_match_phy_device(phydev, PHY_ID_KSZ8795);
+}
+
 static int ksz9021_load_values_from_of(struct phy_device *phydev,
 				       const struct device_node *of_node,
 				       u16 reg,
@@ -1017,8 +1051,6 @@ static struct phy_driver ksphy_driver[] = {
 	.suspend	= genphy_suspend,
 	.resume		= genphy_resume,
 }, {
-	.phy_id		= PHY_ID_KSZ8051,
-	.phy_id_mask	= MICREL_PHY_ID_MASK,
 	.name		= "Micrel KSZ8051",
 	/* PHY_BASIC_FEATURES */
 	.driver_data	= &ksz8051_type,
@@ -1029,6 +1061,7 @@ static struct phy_driver ksphy_driver[] = {
 	.get_sset_count = kszphy_get_sset_count,
 	.get_strings	= kszphy_get_strings,
 	.get_stats	= kszphy_get_stats,
+	.match_phy_device = ksz8051_match_phy_device,
 	.suspend	= genphy_suspend,
 	.resume		= genphy_resume,
 }, {
@@ -1141,13 +1174,12 @@ static struct phy_driver ksphy_driver[] = {
 	.suspend	= genphy_suspend,
 	.resume		= genphy_resume,
 }, {
-	.phy_id		= PHY_ID_KSZ8795,
-	.phy_id_mask	= MICREL_PHY_ID_MASK,
 	.name		= "Micrel KSZ8795",
 	/* PHY_BASIC_FEATURES */
 	.config_init	= kszphy_config_init,
 	.config_aneg	= ksz8873mll_config_aneg,
 	.read_status	= ksz8873mll_read_status,
+	.match_phy_device = ksz8795_match_phy_device,
 	.suspend	= genphy_suspend,
 	.resume		= genphy_resume,
 }, {
-- 
2.23.0


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

* [PATCH V3 2/2] net: phy: micrel: Update KSZ87xx PHY name
  2019-10-13 19:34 [PATCH V3 1/2] net: phy: micrel: Discern KSZ8051 and KSZ8795 PHYs Marek Vasut
@ 2019-10-13 19:34 ` Marek Vasut
  2019-10-13 20:15 ` [PATCH V3 1/2] net: phy: micrel: Discern KSZ8051 and KSZ8795 PHYs Heiner Kallweit
  1 sibling, 0 replies; 6+ messages in thread
From: Marek Vasut @ 2019-10-13 19:34 UTC (permalink / raw)
  To: netdev
  Cc: Marek Vasut, Andrew Lunn, David S . Miller, Florian Fainelli,
	George McCollister, Heiner Kallweit, Sean Nyekjaer, Tristram Ha,
	Woojung Huh

The KSZ8795 PHY ID is in fact used by KSZ8794/KSZ8795/KSZ8765 switches.
Update the PHY ID and name to reflect that, as this family of switches
is commonly refered to as KSZ87xx

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: David S. Miller <davem@davemloft.net>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: George McCollister <george.mccollister@gmail.com>
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
Cc: Tristram Ha <Tristram.Ha@microchip.com>
Cc: Woojung Huh <woojung.huh@microchip.com>
---
V2: Rebase on top of 1/2, no functional change
V3: Rebase on top of 1/2, no functional change
---
 drivers/net/phy/micrel.c   | 4 ++--
 include/linux/micrel_phy.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index a0444e28c6e7..63dedec0433d 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -395,7 +395,7 @@ static int ksz8061_config_init(struct phy_device *phydev)
 
 static int ksz8795_match_phy_device(struct phy_device *phydev)
 {
-	return ksz8051_ksz8795_match_phy_device(phydev, PHY_ID_KSZ8795);
+	return ksz8051_ksz8795_match_phy_device(phydev, PHY_ID_KSZ87XX);
 }
 
 static int ksz9021_load_values_from_of(struct phy_device *phydev,
@@ -1174,7 +1174,7 @@ static struct phy_driver ksphy_driver[] = {
 	.suspend	= genphy_suspend,
 	.resume		= genphy_resume,
 }, {
-	.name		= "Micrel KSZ8795",
+	.name		= "Micrel KSZ87XX Switch",
 	/* PHY_BASIC_FEATURES */
 	.config_init	= kszphy_config_init,
 	.config_aneg	= ksz8873mll_config_aneg,
diff --git a/include/linux/micrel_phy.h b/include/linux/micrel_phy.h
index ad24554f11f9..75f880c25bb8 100644
--- a/include/linux/micrel_phy.h
+++ b/include/linux/micrel_phy.h
@@ -31,7 +31,7 @@
 #define PHY_ID_KSZ886X		0x00221430
 #define PHY_ID_KSZ8863		0x00221435
 
-#define PHY_ID_KSZ8795		0x00221550
+#define PHY_ID_KSZ87XX		0x00221550
 
 #define	PHY_ID_KSZ9477		0x00221631
 
-- 
2.23.0


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

* Re: [PATCH V3 1/2] net: phy: micrel: Discern KSZ8051 and KSZ8795 PHYs
  2019-10-13 19:34 [PATCH V3 1/2] net: phy: micrel: Discern KSZ8051 and KSZ8795 PHYs Marek Vasut
  2019-10-13 19:34 ` [PATCH V3 2/2] net: phy: micrel: Update KSZ87xx PHY name Marek Vasut
@ 2019-10-13 20:15 ` Heiner Kallweit
  2019-10-13 20:29   ` Marek Vasut
  1 sibling, 1 reply; 6+ messages in thread
From: Heiner Kallweit @ 2019-10-13 20:15 UTC (permalink / raw)
  To: Marek Vasut, netdev
  Cc: Andrew Lunn, David S . Miller, Florian Fainelli,
	George McCollister, Sean Nyekjaer, Tristram Ha, Woojung Huh

On 13.10.2019 21:34, Marek Vasut wrote:
> The KSZ8051 PHY and the KSZ8794/KSZ8795/KSZ8765 switch share exactly the
> same PHY ID. Since KSZ8051 is higher in the ksphy_driver[] list of PHYs
> in the micrel PHY driver, it is used even with the KSZ87xx switch. This
> is wrong, since the KSZ8051 configures registers of the PHY which are
> not present on the simplified KSZ87xx switch PHYs and misconfigures
> other registers of the KSZ87xx switch PHYs.
> 
> Fortunatelly, it is possible to tell apart the KSZ8051 PHY from the
> KSZ87xx switch by checking the Basic Status register Bit 0, which is
> read-only and indicates presence of the Extended Capability Registers.
> The KSZ8051 PHY has those registers while the KSZ87xx switch does not.
> 
> This patch implements simple check for the presence of this bit for
> both the KSZ8051 PHY and KSZ87xx switch, to let both use the correct
> PHY driver instance.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Florian Fainelli <f.fainelli@gmail.com>
> Cc: George McCollister <george.mccollister@gmail.com>
> Cc: Heiner Kallweit <hkallweit1@gmail.com>
> Cc: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
> Cc: Tristram Ha <Tristram.Ha@microchip.com>
> Cc: Woojung Huh <woojung.huh@microchip.com>
> Fixes: 9d162ed69f51 ("net: phy: micrel: add support for KSZ8795")

The Fixes tag has to be the first one. And patch still misses
the "net" annotation. For an example just see other fix submissions
on the mailing list.

> ---
> NOTE: It was also suggested to populate phydev->dev_flags to discern
>       the PHY from the switch, this does not work for setups where
>       the switch is used as a PHY without a DSA driver. Checking the
>       BMSR Bit 0 for Extended Capability Register works for both DSA
>       and non-DSA usecase.
> V2: Move phy_id check into ksz8051_match_phy_device() and
>     ksz8795_match_phy_device() and drop phy_id{,_mask} from the
>     ksphy_driver[] list to avoid matching on other PHY IDs.
> V3: Pull the logic behind discerning the KSZ8051 PHY and KSZ87xx switch
>     into common ksz8051_ksz8795_match_phy_device() function. Add Fixes
>     tag.
> ---
>  drivers/net/phy/micrel.c | 40 ++++++++++++++++++++++++++++++++++++----
>  1 file changed, 36 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
> index 2fea5541c35a..a0444e28c6e7 100644
> --- a/drivers/net/phy/micrel.c
> +++ b/drivers/net/phy/micrel.c
> @@ -341,6 +341,35 @@ static int ksz8041_config_aneg(struct phy_device *phydev)
>  	return genphy_config_aneg(phydev);
>  }
>  
> +static int ksz8051_ksz8795_match_phy_device(struct phy_device *phydev,
> +					    const u32 ksz_phy_id)
> +{
> +	int ret;
> +
> +	if ((phydev->phy_id & MICREL_PHY_ID_MASK) != ksz_phy_id)
> +		return 0;
> +
> +	ret = phy_read(phydev, MII_BMSR);
> +	if (ret < 0)
> +		return ret;
> +
> +	/* KSZ8051 PHY and KSZ8794/KSZ8795/KSZ8765 switch share the same
> +	 * exact PHY ID. However, they can be told apart by the extended
> +	 * capability registers presence. The KSZ8051 PHY has them while
> +	 * the switch does not.
> +	 */
> +	ret &= BMSR_ERCAP;
> +	if (ksz_phy_id == PHY_ID_KSZ8051)
> +		return ret;
> +	else
> +		return !ret;
> +}
> +
> +static int ksz8051_match_phy_device(struct phy_device *phydev)
> +{
> +	return ksz8051_ksz8795_match_phy_device(phydev, PHY_ID_KSZ8051);
> +}
> +
>  static int ksz8081_config_init(struct phy_device *phydev)
>  {
>  	/* KSZPHY_OMSO_FACTORY_TEST is set at de-assertion of the reset line
> @@ -364,6 +393,11 @@ static int ksz8061_config_init(struct phy_device *phydev)
>  	return kszphy_config_init(phydev);
>  }
>  
> +static int ksz8795_match_phy_device(struct phy_device *phydev)
> +{
> +	return ksz8051_ksz8795_match_phy_device(phydev, PHY_ID_KSZ8795);
> +}
> +
>  static int ksz9021_load_values_from_of(struct phy_device *phydev,
>  				       const struct device_node *of_node,
>  				       u16 reg,
> @@ -1017,8 +1051,6 @@ static struct phy_driver ksphy_driver[] = {
>  	.suspend	= genphy_suspend,
>  	.resume		= genphy_resume,
>  }, {
> -	.phy_id		= PHY_ID_KSZ8051,
> -	.phy_id_mask	= MICREL_PHY_ID_MASK,
>  	.name		= "Micrel KSZ8051",
>  	/* PHY_BASIC_FEATURES */
>  	.driver_data	= &ksz8051_type,
> @@ -1029,6 +1061,7 @@ static struct phy_driver ksphy_driver[] = {
>  	.get_sset_count = kszphy_get_sset_count,
>  	.get_strings	= kszphy_get_strings,
>  	.get_stats	= kszphy_get_stats,
> +	.match_phy_device = ksz8051_match_phy_device,
>  	.suspend	= genphy_suspend,
>  	.resume		= genphy_resume,
>  }, {
> @@ -1141,13 +1174,12 @@ static struct phy_driver ksphy_driver[] = {
>  	.suspend	= genphy_suspend,
>  	.resume		= genphy_resume,
>  }, {
> -	.phy_id		= PHY_ID_KSZ8795,
> -	.phy_id_mask	= MICREL_PHY_ID_MASK,
>  	.name		= "Micrel KSZ8795",
>  	/* PHY_BASIC_FEATURES */
>  	.config_init	= kszphy_config_init,
>  	.config_aneg	= ksz8873mll_config_aneg,
>  	.read_status	= ksz8873mll_read_status,
> +	.match_phy_device = ksz8795_match_phy_device,
>  	.suspend	= genphy_suspend,
>  	.resume		= genphy_resume,
>  }, {
> 


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

* Re: [PATCH V3 1/2] net: phy: micrel: Discern KSZ8051 and KSZ8795 PHYs
  2019-10-13 20:15 ` [PATCH V3 1/2] net: phy: micrel: Discern KSZ8051 and KSZ8795 PHYs Heiner Kallweit
@ 2019-10-13 20:29   ` Marek Vasut
  2019-10-13 20:41     ` Florian Fainelli
  2019-10-13 21:14     ` David Miller
  0 siblings, 2 replies; 6+ messages in thread
From: Marek Vasut @ 2019-10-13 20:29 UTC (permalink / raw)
  To: Heiner Kallweit, netdev
  Cc: Andrew Lunn, David S . Miller, Florian Fainelli,
	George McCollister, Sean Nyekjaer, Tristram Ha, Woojung Huh

On 10/13/19 10:15 PM, Heiner Kallweit wrote:
> On 13.10.2019 21:34, Marek Vasut wrote:
>> The KSZ8051 PHY and the KSZ8794/KSZ8795/KSZ8765 switch share exactly the
>> same PHY ID. Since KSZ8051 is higher in the ksphy_driver[] list of PHYs
>> in the micrel PHY driver, it is used even with the KSZ87xx switch. This
>> is wrong, since the KSZ8051 configures registers of the PHY which are
>> not present on the simplified KSZ87xx switch PHYs and misconfigures
>> other registers of the KSZ87xx switch PHYs.
>>
>> Fortunatelly, it is possible to tell apart the KSZ8051 PHY from the
>> KSZ87xx switch by checking the Basic Status register Bit 0, which is
>> read-only and indicates presence of the Extended Capability Registers.
>> The KSZ8051 PHY has those registers while the KSZ87xx switch does not.
>>
>> This patch implements simple check for the presence of this bit for
>> both the KSZ8051 PHY and KSZ87xx switch, to let both use the correct
>> PHY driver instance.
>>
>> Signed-off-by: Marek Vasut <marex@denx.de>
>> Cc: Andrew Lunn <andrew@lunn.ch>
>> Cc: David S. Miller <davem@davemloft.net>
>> Cc: Florian Fainelli <f.fainelli@gmail.com>
>> Cc: George McCollister <george.mccollister@gmail.com>
>> Cc: Heiner Kallweit <hkallweit1@gmail.com>
>> Cc: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
>> Cc: Tristram Ha <Tristram.Ha@microchip.com>
>> Cc: Woojung Huh <woojung.huh@microchip.com>
>> Fixes: 9d162ed69f51 ("net: phy: micrel: add support for KSZ8795")
> 
> The Fixes tag has to be the first one. And patch still misses
> the "net" annotation. For an example just see other fix submissions
> on the mailing list.

The "net" annotation ? The net: tag is right there in the subject.

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

* Re: [PATCH V3 1/2] net: phy: micrel: Discern KSZ8051 and KSZ8795 PHYs
  2019-10-13 20:29   ` Marek Vasut
@ 2019-10-13 20:41     ` Florian Fainelli
  2019-10-13 21:14     ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2019-10-13 20:41 UTC (permalink / raw)
  To: Marek Vasut, Heiner Kallweit, netdev
  Cc: Andrew Lunn, David S . Miller, George McCollister, Sean Nyekjaer,
	Tristram Ha, Woojung Huh



On 10/13/2019 1:29 PM, Marek Vasut wrote:
> On 10/13/19 10:15 PM, Heiner Kallweit wrote:
>> On 13.10.2019 21:34, Marek Vasut wrote:
>>> The KSZ8051 PHY and the KSZ8794/KSZ8795/KSZ8765 switch share exactly the
>>> same PHY ID. Since KSZ8051 is higher in the ksphy_driver[] list of PHYs
>>> in the micrel PHY driver, it is used even with the KSZ87xx switch. This
>>> is wrong, since the KSZ8051 configures registers of the PHY which are
>>> not present on the simplified KSZ87xx switch PHYs and misconfigures
>>> other registers of the KSZ87xx switch PHYs.
>>>
>>> Fortunatelly, it is possible to tell apart the KSZ8051 PHY from the
>>> KSZ87xx switch by checking the Basic Status register Bit 0, which is
>>> read-only and indicates presence of the Extended Capability Registers.
>>> The KSZ8051 PHY has those registers while the KSZ87xx switch does not.
>>>
>>> This patch implements simple check for the presence of this bit for
>>> both the KSZ8051 PHY and KSZ87xx switch, to let both use the correct
>>> PHY driver instance.
>>>
>>> Signed-off-by: Marek Vasut <marex@denx.de>
>>> Cc: Andrew Lunn <andrew@lunn.ch>
>>> Cc: David S. Miller <davem@davemloft.net>
>>> Cc: Florian Fainelli <f.fainelli@gmail.com>
>>> Cc: George McCollister <george.mccollister@gmail.com>
>>> Cc: Heiner Kallweit <hkallweit1@gmail.com>
>>> Cc: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
>>> Cc: Tristram Ha <Tristram.Ha@microchip.com>
>>> Cc: Woojung Huh <woojung.huh@microchip.com>
>>> Fixes: 9d162ed69f51 ("net: phy: micrel: add support for KSZ8795")
>>
>> The Fixes tag has to be the first one. And patch still misses
>> the "net" annotation. For an example just see other fix submissions
>> on the mailing list.
> 
> The "net" annotation ? The net: tag is right there in the subject.
> 

It is missing from within the [PATCH] part of the subject, so it should
be [PATCH net] for the net tree (bugfixes) or [PATCH net-next] for
features (broadly speaking). This is explained in the netdev-FAQ that
Heiner pointed out previously:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/networking/netdev-FAQ.rst#n94
-- 
Florian

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

* Re: [PATCH V3 1/2] net: phy: micrel: Discern KSZ8051 and KSZ8795 PHYs
  2019-10-13 20:29   ` Marek Vasut
  2019-10-13 20:41     ` Florian Fainelli
@ 2019-10-13 21:14     ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2019-10-13 21:14 UTC (permalink / raw)
  To: marex
  Cc: hkallweit1, netdev, andrew, f.fainelli, george.mccollister,
	sean.nyekjaer, Tristram.Ha, woojung.huh

From: Marek Vasut <marex@denx.de>
Date: Sun, 13 Oct 2019 22:29:31 +0200

> On 10/13/19 10:15 PM, Heiner Kallweit wrote:
>> On 13.10.2019 21:34, Marek Vasut wrote:
>>> The KSZ8051 PHY and the KSZ8794/KSZ8795/KSZ8765 switch share exactly the
>>> same PHY ID. Since KSZ8051 is higher in the ksphy_driver[] list of PHYs
>>> in the micrel PHY driver, it is used even with the KSZ87xx switch. This
>>> is wrong, since the KSZ8051 configures registers of the PHY which are
>>> not present on the simplified KSZ87xx switch PHYs and misconfigures
>>> other registers of the KSZ87xx switch PHYs.
>>>
>>> Fortunatelly, it is possible to tell apart the KSZ8051 PHY from the
>>> KSZ87xx switch by checking the Basic Status register Bit 0, which is
>>> read-only and indicates presence of the Extended Capability Registers.
>>> The KSZ8051 PHY has those registers while the KSZ87xx switch does not.
>>>
>>> This patch implements simple check for the presence of this bit for
>>> both the KSZ8051 PHY and KSZ87xx switch, to let both use the correct
>>> PHY driver instance.
>>>
>>> Signed-off-by: Marek Vasut <marex@denx.de>
>>> Cc: Andrew Lunn <andrew@lunn.ch>
>>> Cc: David S. Miller <davem@davemloft.net>
>>> Cc: Florian Fainelli <f.fainelli@gmail.com>
>>> Cc: George McCollister <george.mccollister@gmail.com>
>>> Cc: Heiner Kallweit <hkallweit1@gmail.com>
>>> Cc: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
>>> Cc: Tristram Ha <Tristram.Ha@microchip.com>
>>> Cc: Woojung Huh <woojung.huh@microchip.com>
>>> Fixes: 9d162ed69f51 ("net: phy: micrel: add support for KSZ8795")
>> 
>> The Fixes tag has to be the first one. And patch still misses
>> the "net" annotation. For an example just see other fix submissions
>> on the mailing list.
> 
> The "net" annotation ? The net: tag is right there in the subject.

It also belongs in the [ PATCH ...] area as an indicator of the target
GIT tree.

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

end of thread, other threads:[~2019-10-13 21:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-13 19:34 [PATCH V3 1/2] net: phy: micrel: Discern KSZ8051 and KSZ8795 PHYs Marek Vasut
2019-10-13 19:34 ` [PATCH V3 2/2] net: phy: micrel: Update KSZ87xx PHY name Marek Vasut
2019-10-13 20:15 ` [PATCH V3 1/2] net: phy: micrel: Discern KSZ8051 and KSZ8795 PHYs Heiner Kallweit
2019-10-13 20:29   ` Marek Vasut
2019-10-13 20:41     ` Florian Fainelli
2019-10-13 21:14     ` David Miller

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).