diff mbox series

[net-next,v2,1/2] net: phy: microchip: update LAN88xx phy ID and phy ID mask.

Message ID 20220427121957.13099-2-yuiko.oshino@microchip.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series net: phy: add LAN8742 phy support | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 4 maintainers not CCed: linux@armlinux.org.uk kuba@kernel.org hkallweit1@gmail.com pabeni@redhat.com
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 18 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Yuiko Oshino April 27, 2022, 12:19 p.m. UTC
update LAN88xx phy ID and phy ID mask because the existing code conflicts with the LAN8742 phy.

The current phy IDs on the available hardware.
        LAN8742 0x0007C130, 0x0007C131
        LAN88xx 0x0007C132

Signed-off-by: Yuiko Oshino <yuiko.oshino@microchip.com>
---
 drivers/net/phy/microchip.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Andrew Lunn April 27, 2022, 3:36 p.m. UTC | #1
On Wed, Apr 27, 2022 at 05:19:56AM -0700, Yuiko Oshino wrote:
> update LAN88xx phy ID and phy ID mask because the existing code conflicts with the LAN8742 phy.
> 
> The current phy IDs on the available hardware.
>         LAN8742 0x0007C130, 0x0007C131
>         LAN88xx 0x0007C132
> 
> Signed-off-by: Yuiko Oshino <yuiko.oshino@microchip.com>
> ---
>  drivers/net/phy/microchip.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/phy/microchip.c b/drivers/net/phy/microchip.c
> index 9f1f2b6c97d4..131caf659ed2 100644
> --- a/drivers/net/phy/microchip.c
> +++ b/drivers/net/phy/microchip.c
> @@ -344,8 +344,8 @@ static int lan88xx_config_aneg(struct phy_device *phydev)
>  
>  static struct phy_driver microchip_phy_driver[] = {
>  {
> -	.phy_id		= 0x0007c130,
> -	.phy_id_mask	= 0xfffffff0,
> +	.phy_id		= 0x0007c132,
> +	.phy_id_mask	= 0xfffffff2,

Just so my comment on the previous version does not get lost, is this
the correct mask, because it is very odd. I think you really want
0xfffffffe?

    Andrew
Yuiko Oshino April 27, 2022, 4:02 p.m. UTC | #2
>-----Original Message-----
>From: Andrew Lunn <andrew@lunn.ch>
>Sent: Wednesday, April 27, 2022 11:37 AM
>To: Yuiko Oshino - C18177 <Yuiko.Oshino@microchip.com>
>Cc: Woojung Huh - C21699 <Woojung.Huh@microchip.com>;
>davem@davemloft.net; netdev@vger.kernel.org; Ravi Hegde - C21689
><Ravi.Hegde@microchip.com>; UNGLinuxDriver
><UNGLinuxDriver@microchip.com>
>Subject: Re: [PATCH net-next v2 1/2] net: phy: microchip: update LAN88xx phy ID
>and phy ID mask.
>
>EXTERNAL EMAIL: Do not click links or open attachments unless you know the
>content is safe
>
>On Wed, Apr 27, 2022 at 05:19:56AM -0700, Yuiko Oshino wrote:
>> update LAN88xx phy ID and phy ID mask because the existing code conflicts
>with the LAN8742 phy.
>>
>> The current phy IDs on the available hardware.
>>         LAN8742 0x0007C130, 0x0007C131
>>         LAN88xx 0x0007C132
>>
>> Signed-off-by: Yuiko Oshino <yuiko.oshino@microchip.com>
>> ---
>>  drivers/net/phy/microchip.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/net/phy/microchip.c b/drivers/net/phy/microchip.c
>> index 9f1f2b6c97d4..131caf659ed2 100644
>> --- a/drivers/net/phy/microchip.c
>> +++ b/drivers/net/phy/microchip.c
>> @@ -344,8 +344,8 @@ static int lan88xx_config_aneg(struct phy_device
>> *phydev)
>>
>>  static struct phy_driver microchip_phy_driver[] = {  {
>> -     .phy_id         = 0x0007c130,
>> -     .phy_id_mask    = 0xfffffff0,
>> +     .phy_id         = 0x0007c132,
>> +     .phy_id_mask    = 0xfffffff2,
>
>Just so my comment on the previous version does not get lost, is this the correct
>mask, because it is very odd. I think you really want 0xfffffffe?
>
>    Andrew

Hi Andrew,

thank you for your review.
Yes, 0xfffffff2 is correct for us.
We would like to have bits for future revisions of the hardware without updating the driver source code in the future.
If we use 0xfffffffe, then we need to submit a patch again when we have a new hardware revision.

Yuiko
Andrew Lunn April 27, 2022, 5:30 p.m. UTC | #3
> >> The current phy IDs on the available hardware.
> >>         LAN8742 0x0007C130, 0x0007C131
> >>         LAN88xx 0x0007C132
> >>
> >> Signed-off-by: Yuiko Oshino <yuiko.oshino@microchip.com>
> >> ---
> >>  drivers/net/phy/microchip.c | 6 +++---
> >>  1 file changed, 3 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/net/phy/microchip.c b/drivers/net/phy/microchip.c
> >> index 9f1f2b6c97d4..131caf659ed2 100644
> >> --- a/drivers/net/phy/microchip.c
> >> +++ b/drivers/net/phy/microchip.c
> >> @@ -344,8 +344,8 @@ static int lan88xx_config_aneg(struct phy_device
> >> *phydev)
> >>
> >>  static struct phy_driver microchip_phy_driver[] = {  {
> >> -     .phy_id         = 0x0007c130,
> >> -     .phy_id_mask    = 0xfffffff0,
> >> +     .phy_id         = 0x0007c132,
> >> +     .phy_id_mask    = 0xfffffff2,
> >
> >Just so my comment on the previous version does not get lost, is this the correct
> >mask, because it is very odd. I think you really want 0xfffffffe?
> >
> >    Andrew
> 
> Hi Andrew,
> 
> thank you for your review.
> Yes, 0xfffffff2 is correct for us.
> We would like to have bits for future revisions of the hardware without updating the driver source code in the future.
> If we use 0xfffffffe, then we need to submit a patch again when we have a new hardware revision.

This has some risks. Do you really have enough control over the
hardware people to say that:

LAN8742 0x0007C130, 0x0007C131, 0x0007C134, 0x0007C135, 0x0007C138, 0x0007C139, ...
LAN88xx 0x0007C132, 0x0007C133, 0x0007C136, 0x0007C137, 0x0007C13a, 0x0007C13b, ...

It seems safer to wait until there is new hardware and then update the
list given whatever they decide on is next.

At minimum, please add a comment in the code, otherwise you are going
to get asked, is this correct, it looks wrong?

     Andrew
diff mbox series

Patch

diff --git a/drivers/net/phy/microchip.c b/drivers/net/phy/microchip.c
index 9f1f2b6c97d4..131caf659ed2 100644
--- a/drivers/net/phy/microchip.c
+++ b/drivers/net/phy/microchip.c
@@ -344,8 +344,8 @@  static int lan88xx_config_aneg(struct phy_device *phydev)
 
 static struct phy_driver microchip_phy_driver[] = {
 {
-	.phy_id		= 0x0007c130,
-	.phy_id_mask	= 0xfffffff0,
+	.phy_id		= 0x0007c132,
+	.phy_id_mask	= 0xfffffff2,
 	.name		= "Microchip LAN88xx",
 
 	/* PHY_GBIT_FEATURES */
@@ -369,7 +369,7 @@  static struct phy_driver microchip_phy_driver[] = {
 module_phy_driver(microchip_phy_driver);
 
 static struct mdio_device_id __maybe_unused microchip_tbl[] = {
-	{ 0x0007c130, 0xfffffff0 },
+	{ 0x0007c132, 0xfffffff2 },
 	{ }
 };