public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.19 5/6] mt7530 fix mt7530_fdb_write vid missing ivl bit
       [not found] <20210727132015.835651-1-sashal@kernel.org>
@ 2021-07-27 13:20 ` Sasha Levin
  2021-07-31 13:27   ` Eric Woudstra
  0 siblings, 1 reply; 3+ messages in thread
From: Sasha Levin @ 2021-07-27 13:20 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Eric Woudstra, David S . Miller, Sasha Levin, netdev,
	linux-arm-kernel, linux-mediatek

From: Eric Woudstra <ericwouds@gmail.com>

[ Upstream commit 11d8d98cbeef1496469b268d79938b05524731e8 ]

According to reference guides mt7530 (mt7620) and mt7531:

NOTE: When IVL is reset, MAC[47:0] and FID[2:0] will be used to
read/write the address table. When IVL is set, MAC[47:0] and CVID[11:0]
will be used to read/write the address table.

Since the function only fills in CVID and no FID, we need to set the
IVL bit. The existing code does not set it.

This is a fix for the issue I dropped here earlier:

http://lists.infradead.org/pipermail/linux-mediatek/2021-June/025697.html

With this patch, it is now possible to delete the 'self' fdb entry
manually. However, wifi roaming still has the same issue, the entry
does not get deleted automatically. Wifi roaming also needs a fix
somewhere else to function correctly in combination with vlan.

Signed-off-by: Eric Woudstra <ericwouds@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/dsa/mt7530.c | 1 +
 drivers/net/dsa/mt7530.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
index 6335c4ea0957..96dbc51caf48 100644
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -414,6 +414,7 @@ mt7530_fdb_write(struct mt7530_priv *priv, u16 vid,
 	int i;
 
 	reg[1] |= vid & CVID_MASK;
+	reg[1] |= ATA2_IVL;
 	reg[2] |= (aging & AGE_TIMER_MASK) << AGE_TIMER;
 	reg[2] |= (port_mask & PORT_MAP_MASK) << PORT_MAP;
 	/* STATIC_ENT indicate that entry is static wouldn't
diff --git a/drivers/net/dsa/mt7530.h b/drivers/net/dsa/mt7530.h
index 101d309ee445..72f53e6bc145 100644
--- a/drivers/net/dsa/mt7530.h
+++ b/drivers/net/dsa/mt7530.h
@@ -43,6 +43,7 @@
 #define  STATIC_EMP			0
 #define  STATIC_ENT			3
 #define MT7530_ATA2			0x78
+#define  ATA2_IVL			BIT(15)
 
 /* Register for address table write data */
 #define MT7530_ATWD			0x7c
-- 
2.30.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH AUTOSEL 4.19 5/6] mt7530 fix mt7530_fdb_write vid missing ivl bit
  2021-07-27 13:20 ` [PATCH AUTOSEL 4.19 5/6] mt7530 fix mt7530_fdb_write vid missing ivl bit Sasha Levin
@ 2021-07-31 13:27   ` Eric Woudstra
  2021-08-04 17:41     ` Sasha Levin
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Woudstra @ 2021-07-31 13:27 UTC (permalink / raw)
  To: Sasha Levin
  Cc: linux-kernel, stable, David S . Miller, netdev, linux-arm-kernel,
	linux-mediatek


A few days after this patch, I send in another as it needs a fix. If you apply this patch, please also apply the other: set ivl bit only for vid larger than 1.

On Jul 27, 2021, 3:20 PM, at 3:20 PM, Sasha Levin <sashal@kernel.org> wrote:
>From: Eric Woudstra <ericwouds@gmail.com>
>
>[ Upstream commit 11d8d98cbeef1496469b268d79938b05524731e8 ]
>
>According to reference guides mt7530 (mt7620) and mt7531:
>
>NOTE: When IVL is reset, MAC[47:0] and FID[2:0] will be used to
>read/write the address table. When IVL is set, MAC[47:0] and CVID[11:0]
>will be used to read/write the address table.
>
>Since the function only fills in CVID and no FID, we need to set the
>IVL bit. The existing code does not set it.
>
>This is a fix for the issue I dropped here earlier:
>
>http://lists.infradead.org/pipermail/linux-mediatek/2021-June/025697.html
>
>With this patch, it is now possible to delete the 'self' fdb entry
>manually. However, wifi roaming still has the same issue, the entry
>does not get deleted automatically. Wifi roaming also needs a fix
>somewhere else to function correctly in combination with vlan.
>
>Signed-off-by: Eric Woudstra <ericwouds@gmail.com>
>Signed-off-by: David S. Miller <davem@davemloft.net>
>Signed-off-by: Sasha Levin <sashal@kernel.org>
>---
> drivers/net/dsa/mt7530.c | 1 +
> drivers/net/dsa/mt7530.h | 1 +
> 2 files changed, 2 insertions(+)
>
>diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
>index 6335c4ea0957..96dbc51caf48 100644
>--- a/drivers/net/dsa/mt7530.c
>+++ b/drivers/net/dsa/mt7530.c
>@@ -414,6 +414,7 @@ mt7530_fdb_write(struct mt7530_priv *priv, u16 vid,
> 	int i;
> 
> 	reg[1] |= vid & CVID_MASK;
>+	reg[1] |= ATA2_IVL;
> 	reg[2] |= (aging & AGE_TIMER_MASK) << AGE_TIMER;
> 	reg[2] |= (port_mask & PORT_MAP_MASK) << PORT_MAP;
> 	/* STATIC_ENT indicate that entry is static wouldn't
>diff --git a/drivers/net/dsa/mt7530.h b/drivers/net/dsa/mt7530.h
>index 101d309ee445..72f53e6bc145 100644
>--- a/drivers/net/dsa/mt7530.h
>+++ b/drivers/net/dsa/mt7530.h
>@@ -43,6 +43,7 @@
> #define  STATIC_EMP			0
> #define  STATIC_ENT			3
> #define MT7530_ATA2			0x78
>+#define  ATA2_IVL			BIT(15)
> 
> /* Register for address table write data */
> #define MT7530_ATWD			0x7c
>-- 
>2.30.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH AUTOSEL 4.19 5/6] mt7530 fix mt7530_fdb_write vid missing ivl bit
  2021-07-31 13:27   ` Eric Woudstra
@ 2021-08-04 17:41     ` Sasha Levin
  0 siblings, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2021-08-04 17:41 UTC (permalink / raw)
  To: Eric Woudstra
  Cc: linux-kernel, stable, David S . Miller, netdev, linux-arm-kernel,
	linux-mediatek

On Sat, Jul 31, 2021 at 03:27:04PM +0200, Eric Woudstra wrote:
>
>A few days after this patch, I send in another as it needs a fix. If you apply this patch, please also apply the other: set ivl bit only for vid larger than 1.

Looks like the fix didn't make it yet, so I'll drop this one for now.

-- 
Thanks,
Sasha

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-08-04 17:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20210727132015.835651-1-sashal@kernel.org>
2021-07-27 13:20 ` [PATCH AUTOSEL 4.19 5/6] mt7530 fix mt7530_fdb_write vid missing ivl bit Sasha Levin
2021-07-31 13:27   ` Eric Woudstra
2021-08-04 17:41     ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox