netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: airoha: Fix loopback mode configuration for GDM2 port
@ 2025-10-05 14:52 Lorenzo Bianconi
  2025-10-07 13:07 ` Paolo Abeni
  0 siblings, 1 reply; 3+ messages in thread
From: Lorenzo Bianconi @ 2025-10-05 14:52 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni
  Cc: linux-arm-kernel, linux-mediatek, netdev, Lorenzo Bianconi

Add missing configuration for loopback mode in airhoha_set_gdm2_loopback
routine.

Fixes: 9cd451d414f6e ("net: airoha: Add loopback support for GDM2")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/ethernet/airoha/airoha_eth.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/airoha/airoha_eth.c b/drivers/net/ethernet/airoha/airoha_eth.c
index 81ea01a652b9c545c348ad6390af8be873a4997f..abe7a23e3ab7a189a3a28007004572719307de90 100644
--- a/drivers/net/ethernet/airoha/airoha_eth.c
+++ b/drivers/net/ethernet/airoha/airoha_eth.c
@@ -1710,7 +1710,9 @@ static void airhoha_set_gdm2_loopback(struct airoha_gdm_port *port)
 	airoha_fe_wr(eth, REG_GDM_RXCHN_EN(2), 0xffff);
 	airoha_fe_rmw(eth, REG_GDM_LPBK_CFG(2),
 		      LPBK_CHAN_MASK | LPBK_MODE_MASK | LPBK_EN_MASK,
-		      FIELD_PREP(LPBK_CHAN_MASK, chan) | LPBK_EN_MASK);
+		      FIELD_PREP(LPBK_CHAN_MASK, chan) |
+		      FIELD_PREP(LPBK_MODE_MASK, 7) |
+		      LPBK_EN_MASK);
 	airoha_fe_rmw(eth, REG_GDM_LEN_CFG(2),
 		      GDM_SHORT_LEN_MASK | GDM_LONG_LEN_MASK,
 		      FIELD_PREP(GDM_SHORT_LEN_MASK, 60) |

---
base-commit: 1b54b0756f051c11f5a5d0fbc1581e0b9a18e2bc
change-id: 20251005-airoha-loopback-mode-fix-3a9c0036017e

Best regards,
-- 
Lorenzo Bianconi <lorenzo@kernel.org>


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

* Re: [PATCH net] net: airoha: Fix loopback mode configuration for GDM2 port
  2025-10-05 14:52 [PATCH net] net: airoha: Fix loopback mode configuration for GDM2 port Lorenzo Bianconi
@ 2025-10-07 13:07 ` Paolo Abeni
  2025-10-08  8:51   ` Lorenzo Bianconi
  0 siblings, 1 reply; 3+ messages in thread
From: Paolo Abeni @ 2025-10-07 13:07 UTC (permalink / raw)
  To: Lorenzo Bianconi, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski
  Cc: linux-arm-kernel, linux-mediatek, netdev

On 10/5/25 4:52 PM, Lorenzo Bianconi wrote:
> Add missing configuration for loopback mode in airhoha_set_gdm2_loopback
> routine.
> 
> Fixes: 9cd451d414f6e ("net: airoha: Add loopback support for GDM2")
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
>  drivers/net/ethernet/airoha/airoha_eth.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/airoha/airoha_eth.c b/drivers/net/ethernet/airoha/airoha_eth.c
> index 81ea01a652b9c545c348ad6390af8be873a4997f..abe7a23e3ab7a189a3a28007004572719307de90 100644
> --- a/drivers/net/ethernet/airoha/airoha_eth.c
> +++ b/drivers/net/ethernet/airoha/airoha_eth.c
> @@ -1710,7 +1710,9 @@ static void airhoha_set_gdm2_loopback(struct airoha_gdm_port *port)
>  	airoha_fe_wr(eth, REG_GDM_RXCHN_EN(2), 0xffff);
>  	airoha_fe_rmw(eth, REG_GDM_LPBK_CFG(2),
>  		      LPBK_CHAN_MASK | LPBK_MODE_MASK | LPBK_EN_MASK,
> -		      FIELD_PREP(LPBK_CHAN_MASK, chan) | LPBK_EN_MASK);
> +		      FIELD_PREP(LPBK_CHAN_MASK, chan) |
> +		      FIELD_PREP(LPBK_MODE_MASK, 7) |

I suggest introducing some human readable macro to replace the above
magic number.

Thanks,

Paolo


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

* Re: [PATCH net] net: airoha: Fix loopback mode configuration for GDM2 port
  2025-10-07 13:07 ` Paolo Abeni
@ 2025-10-08  8:51   ` Lorenzo Bianconi
  0 siblings, 0 replies; 3+ messages in thread
From: Lorenzo Bianconi @ 2025-10-08  8:51 UTC (permalink / raw)
  To: Paolo Abeni
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	linux-arm-kernel, linux-mediatek, netdev

[-- Attachment #1: Type: text/plain, Size: 1329 bytes --]

On Oct 07, Paolo Abeni wrote:
> On 10/5/25 4:52 PM, Lorenzo Bianconi wrote:
> > Add missing configuration for loopback mode in airhoha_set_gdm2_loopback
> > routine.
> > 
> > Fixes: 9cd451d414f6e ("net: airoha: Add loopback support for GDM2")
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > ---
> >  drivers/net/ethernet/airoha/airoha_eth.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/ethernet/airoha/airoha_eth.c b/drivers/net/ethernet/airoha/airoha_eth.c
> > index 81ea01a652b9c545c348ad6390af8be873a4997f..abe7a23e3ab7a189a3a28007004572719307de90 100644
> > --- a/drivers/net/ethernet/airoha/airoha_eth.c
> > +++ b/drivers/net/ethernet/airoha/airoha_eth.c
> > @@ -1710,7 +1710,9 @@ static void airhoha_set_gdm2_loopback(struct airoha_gdm_port *port)
> >  	airoha_fe_wr(eth, REG_GDM_RXCHN_EN(2), 0xffff);
> >  	airoha_fe_rmw(eth, REG_GDM_LPBK_CFG(2),
> >  		      LPBK_CHAN_MASK | LPBK_MODE_MASK | LPBK_EN_MASK,
> > -		      FIELD_PREP(LPBK_CHAN_MASK, chan) | LPBK_EN_MASK);
> > +		      FIELD_PREP(LPBK_CHAN_MASK, chan) |
> > +		      FIELD_PREP(LPBK_MODE_MASK, 7) |
> 
> I suggest introducing some human readable macro to replace the above
> magic number.

ack, I will do in v2.

Regards,
Lorenzo

> 
> Thanks,
> 
> Paolo
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

end of thread, other threads:[~2025-10-08  8:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-05 14:52 [PATCH net] net: airoha: Fix loopback mode configuration for GDM2 port Lorenzo Bianconi
2025-10-07 13:07 ` Paolo Abeni
2025-10-08  8:51   ` Lorenzo Bianconi

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