diff mbox series

[net-next,v3,1/2] net: phy: Optimize phy speed mask to be compatible to yt8821

Message ID 20240822114701.61967-2-Frank.Sae@motor-comm.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series Add driver for Motorcomm yt8821 2.5G ethernet phy | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 16 this patch: 16
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 16 this patch: 16
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 16 this patch: 16
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 25 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 35 this patch: 35
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-08-25--21-00 (tests: 714)

Commit Message

Frank Sae Aug. 22, 2024, 11:47 a.m. UTC
yt8521 and yt8531s as Gigabit transceiver use bit15:14(bit9 reserved
default 0) as phy speed mask, yt8821 as 2.5G transceiver uses bit9 bit15:14
as phy speed mask.

Be compatible to yt8821, reform phy speed mask and phy speed macro.

Signed-off-by: Frank Sae <Frank.Sae@motor-comm.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
 drivers/net/phy/motorcomm.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

Comments

Andrew Lunn Aug. 26, 2024, 1:59 a.m. UTC | #1
On Thu, Aug 22, 2024 at 04:47:00AM -0700, Frank Sae wrote:
> yt8521 and yt8531s as Gigabit transceiver use bit15:14(bit9 reserved
> default 0) as phy speed mask, yt8821 as 2.5G transceiver uses bit9 bit15:14
> as phy speed mask.
> 
> Be compatible to yt8821, reform phy speed mask and phy speed macro.
> 
> Signed-off-by: Frank Sae <Frank.Sae@motor-comm.com>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>

Ideally, your Signed-off-by: should be last. No need to repost because
of this.

	Andrew
Frank Sae Aug. 26, 2024, 5:56 a.m. UTC | #2
On 8/25/24 18:59, Andrew Lunn wrote:
> On Thu, Aug 22, 2024 at 04:47:00AM -0700, Frank Sae wrote:
>> yt8521 and yt8531s as Gigabit transceiver use bit15:14(bit9 reserved
>> default 0) as phy speed mask, yt8821 as 2.5G transceiver uses bit9 bit15:14
>> as phy speed mask.
>>
>> Be compatible to yt8821, reform phy speed mask and phy speed macro.
>>
>> Signed-off-by: Frank Sae <Frank.Sae@motor-comm.com>
>> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> Ideally, your Signed-off-by: should be last. No need to repost because
> of this.
>
> 	Andrew

Andrew, please help to confirm that the Reviewed-by: should be followed by
Signed-off-by:?

it should be like below:
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Frank Sae <Frank.Sae@motor-comm.com>

Best Regards
Andrew Lunn Aug. 26, 2024, 12:38 p.m. UTC | #3
On Sun, Aug 25, 2024 at 10:56:54PM -0700, Frank.Sae wrote:
> 
> On 8/25/24 18:59, Andrew Lunn wrote:
> > On Thu, Aug 22, 2024 at 04:47:00AM -0700, Frank Sae wrote:
> > > yt8521 and yt8531s as Gigabit transceiver use bit15:14(bit9 reserved
> > > default 0) as phy speed mask, yt8821 as 2.5G transceiver uses bit9 bit15:14
> > > as phy speed mask.
> > > 
> > > Be compatible to yt8821, reform phy speed mask and phy speed macro.
> > > 
> > > Signed-off-by: Frank Sae <Frank.Sae@motor-comm.com>
> > > Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> > Ideally, your Signed-off-by: should be last. No need to repost because
> > of this.
> > 
> > 	Andrew
> 
> Andrew, please help to confirm that the Reviewed-by: should be followed by
> Signed-off-by:?
> 
> it should be like below:
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> Signed-off-by: Frank Sae <Frank.Sae@motor-comm.com>

It is a cosmetic thing. Each Maintainer handling the patch on it way
towards mainline will add their own Signed-off-by: to the end. By
having yours last, it keeps them all together.

Just picking a random example:

commit 5b9eebc2c7a5f0cc7950d918c1e8a4ad4bed5010
Author: Pawel Dembicki <paweldembicki@gmail.com>
Date:   Fri Aug 9 21:38:03 2024 +0200

    net: dsa: vsc73xx: pass value in phy_write operation
    
    In the 'vsc73xx_phy_write' function, the register value is missing,
    and the phy write operation always sends zeros.
    
    This commit passes the value variable into the proper register.
    
    Fixes: 05bd97fc559d ("net: dsa: Add Vitesse VSC73xx DSA router driver")
    Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
    Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
    Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

David added his signed-of-by. But as i said, it is purely cosmetic.

	Andrew
diff mbox series

Patch

diff --git a/drivers/net/phy/motorcomm.c b/drivers/net/phy/motorcomm.c
index 7a11fdb687cc..fe0aabe12622 100644
--- a/drivers/net/phy/motorcomm.c
+++ b/drivers/net/phy/motorcomm.c
@@ -46,12 +46,10 @@ 
 
 /* Specific Status Register */
 #define YTPHY_SPECIFIC_STATUS_REG		0x11
-#define YTPHY_SSR_SPEED_MODE_OFFSET		14
-
-#define YTPHY_SSR_SPEED_MODE_MASK		(BIT(15) | BIT(14))
-#define YTPHY_SSR_SPEED_10M			0x0
-#define YTPHY_SSR_SPEED_100M			0x1
-#define YTPHY_SSR_SPEED_1000M			0x2
+#define YTPHY_SSR_SPEED_MASK			((0x3 << 14) | BIT(9))
+#define YTPHY_SSR_SPEED_10M			((0x0 << 14))
+#define YTPHY_SSR_SPEED_100M			((0x1 << 14))
+#define YTPHY_SSR_SPEED_1000M			((0x2 << 14))
 #define YTPHY_SSR_DUPLEX_OFFSET			13
 #define YTPHY_SSR_DUPLEX			BIT(13)
 #define YTPHY_SSR_PAGE_RECEIVED			BIT(12)
@@ -1187,8 +1185,7 @@  static int yt8521_adjust_status(struct phy_device *phydev, int status,
 	else
 		duplex = DUPLEX_FULL;	/* for fiber, it always DUPLEX_FULL */
 
-	speed_mode = (status & YTPHY_SSR_SPEED_MODE_MASK) >>
-		     YTPHY_SSR_SPEED_MODE_OFFSET;
+	speed_mode = status & YTPHY_SSR_SPEED_MASK;
 
 	switch (speed_mode) {
 	case YTPHY_SSR_SPEED_10M: