diff mbox series

[net] net: dsa: vsc73xx: fix possible subblocks range of CAPT block

Message ID 20240903203340.1518789-1-paweldembicki@gmail.com (mailing list archive)
State Accepted
Commit 8e69c96df771ab469cec278edb47009351de4da6
Delegated to: Netdev Maintainers
Headers show
Series [net] net: dsa: vsc73xx: fix possible subblocks range of CAPT block | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-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 Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 16 this patch: 16
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 28 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-09-04--15-00 (tests: 718)

Commit Message

Pawel Dembicki Sept. 3, 2024, 8:33 p.m. UTC
CAPT block (CPU Capture Buffer) have 7 sublocks: 0-3, 4, 6, 7.
Function 'vsc73xx_is_addr_valid' allows to use only block 0 at this
moment.

This patch fix it.

Fixes: 05bd97fc559d ("net: dsa: Add Vitesse VSC73xx DSA router driver")
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
---
 drivers/net/dsa/vitesse-vsc73xx-core.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Comments

Florian Fainelli Sept. 3, 2024, 9:48 p.m. UTC | #1
On 9/3/24 13:33, Pawel Dembicki wrote:
> CAPT block (CPU Capture Buffer) have 7 sublocks: 0-3, 4, 6, 7.
> Function 'vsc73xx_is_addr_valid' allows to use only block 0 at this
> moment.
> 
> This patch fix it.

No objection to targeting 'net' as it is a proper bug fix, however there 
is nothing in 'net' that currently depends upon VSC73XX_BLOCK_CAPTURE, 
so this has no functional impact at the moment.

> 
> Fixes: 05bd97fc559d ("net: dsa: Add Vitesse VSC73xx DSA router driver")
> Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Pawel Dembicki Sept. 4, 2024, 6:42 a.m. UTC | #2
wt., 3 wrz 2024 o 23:48 Florian Fainelli <f.fainelli@gmail.com> napisał(a):
>
> On 9/3/24 13:33, Pawel Dembicki wrote:
> > CAPT block (CPU Capture Buffer) have 7 sublocks: 0-3, 4, 6, 7.
> > Function 'vsc73xx_is_addr_valid' allows to use only block 0 at this
> > moment.
> >
> > This patch fix it.
>
> No objection to targeting 'net' as it is a proper bug fix, however there
> is nothing in 'net' that currently depends upon VSC73XX_BLOCK_CAPTURE,
> so this has no functional impact at the moment.

Yes. I found it during work on the STP packet capture funcionality.
It's almost done, so I decided to send this fix to the 'net' before.
patchwork-bot+netdevbpf@kernel.org Sept. 5, 2024, 10:50 a.m. UTC | #3
Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Tue,  3 Sep 2024 22:33:41 +0200 you wrote:
> CAPT block (CPU Capture Buffer) have 7 sublocks: 0-3, 4, 6, 7.
> Function 'vsc73xx_is_addr_valid' allows to use only block 0 at this
> moment.
> 
> This patch fix it.
> 
> Fixes: 05bd97fc559d ("net: dsa: Add Vitesse VSC73xx DSA router driver")
> Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
> 
> [...]

Here is the summary with links:
  - [net] net: dsa: vsc73xx: fix possible subblocks range of CAPT block
    https://git.kernel.org/netdev/net/c/8e69c96df771

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/dsa/vitesse-vsc73xx-core.c b/drivers/net/dsa/vitesse-vsc73xx-core.c
index e3f95d2cc2c1..212421e9d42e 100644
--- a/drivers/net/dsa/vitesse-vsc73xx-core.c
+++ b/drivers/net/dsa/vitesse-vsc73xx-core.c
@@ -36,7 +36,7 @@ 
 #define VSC73XX_BLOCK_ANALYZER	0x2 /* Only subblock 0 */
 #define VSC73XX_BLOCK_MII	0x3 /* Subblocks 0 and 1 */
 #define VSC73XX_BLOCK_MEMINIT	0x3 /* Only subblock 2 */
-#define VSC73XX_BLOCK_CAPTURE	0x4 /* Only subblock 2 */
+#define VSC73XX_BLOCK_CAPTURE	0x4 /* Subblocks 0-4, 6, 7 */
 #define VSC73XX_BLOCK_ARBITER	0x5 /* Only subblock 0 */
 #define VSC73XX_BLOCK_SYSTEM	0x7 /* Only subblock 0 */
 
@@ -410,13 +410,19 @@  int vsc73xx_is_addr_valid(u8 block, u8 subblock)
 		break;
 
 	case VSC73XX_BLOCK_MII:
-	case VSC73XX_BLOCK_CAPTURE:
 	case VSC73XX_BLOCK_ARBITER:
 		switch (subblock) {
 		case 0 ... 1:
 			return 1;
 		}
 		break;
+	case VSC73XX_BLOCK_CAPTURE:
+		switch (subblock) {
+		case 0 ... 4:
+		case 6 ... 7:
+			return 1;
+		}
+		break;
 	}
 
 	return 0;