All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: Andrew Lunn <andrew@lunn.ch>, Vladimir Oltean <olteanv@gmail.com>,
	Russell King <linux@armlinux.org.uk>
Cc: Eric Dumazet <edumazet@google.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Alexander Duyck <alexander.duyck@gmail.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Lukasz Majewski <lukma@denx.de>
Subject: [PATCH 6/7] dsa: marvell: Correct value of max_frame_size variable after validation
Date: Thu,  9 Mar 2023 13:54:20 +0100	[thread overview]
Message-ID: <20230309125421.3900962-7-lukma@denx.de> (raw)
In-Reply-To: <20230309125421.3900962-1-lukma@denx.de>

Running of the mv88e6xxx_validate_frame_size() function provided following
results:

[    1.585565] BUG: Marvell 88E6020 has differing max_frame_size: 1632 != 2048
[    1.592540] BUG: Marvell 88E6071 has differing max_frame_size: 1632 != 2048
		^------ Correct -> mv88e6250 family max frame size = 2048B

[    1.599507] BUG: Marvell 88E6085 has differing max_frame_size: 1632 != 1522
[    1.606476] BUG: Marvell 88E6165 has differing max_frame_size: 1522 != 1632
[    1.613445] BUG: Marvell 88E6190X has differing max_frame_size: 10240 != 1522
[    1.620590] BUG: Marvell 88E6191X has differing max_frame_size: 10240 != 1522
[    1.627730] BUG: Marvell 88E6193X has differing max_frame_size: 10240 != 1522
		^------ Needs to be fixed!!!

[    1.634871] BUG: Marvell 88E6220 has differing max_frame_size: 1632 != 2048
[    1.641842] BUG: Marvell 88E6250 has differing max_frame_size: 1632 != 2048
		^------ Correct -> mv88e6250 family max frame size = 2048B

This commit removes the validation function and provides correct values
for the max frame size field.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
Changes for v5:
- New patch
---
 drivers/net/dsa/mv88e6xxx/chip.c | 32 +++++---------------------------
 1 file changed, 5 insertions(+), 27 deletions(-)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index af14eb8a1bfd..dbb69787f4ef 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -5669,7 +5669,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
 		.num_internal_phys = 5,
 		.max_vid = 4095,
 		.max_sid = 63,
-		.max_frame_size = 1522,
+		.max_frame_size = 1632,
 		.port_base_addr = 0x10,
 		.phy_base_addr = 0x0,
 		.global1_addr = 0x1b,
@@ -5837,7 +5837,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
 		.num_internal_phys = 0,
 		.max_vid = 4095,
 		.max_sid = 63,
-		.max_frame_size = 1632,
+		.max_frame_size = 1522,
 		.port_base_addr = 0x10,
 		.phy_base_addr = 0x0,
 		.global1_addr = 0x1b,
@@ -6012,7 +6012,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
 		.num_gpio = 16,
 		.max_vid = 8191,
 		.max_sid = 63,
-		.max_frame_size = 1522,
+		.max_frame_size = 10240,
 		.port_base_addr = 0x0,
 		.phy_base_addr = 0x0,
 		.global1_addr = 0x1b,
@@ -6060,7 +6060,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
 		.num_internal_phys = 9,
 		.max_vid = 8191,
 		.max_sid = 63,
-		.max_frame_size = 1522,
+		.max_frame_size = 10240,
 		.port_base_addr = 0x0,
 		.phy_base_addr = 0x0,
 		.global1_addr = 0x1b,
@@ -6084,7 +6084,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
 		.num_internal_phys = 9,
 		.max_vid = 8191,
 		.max_sid = 63,
-		.max_frame_size = 1522,
+		.max_frame_size = 10240,
 		.port_base_addr = 0x0,
 		.phy_base_addr = 0x0,
 		.global1_addr = 0x1b,
@@ -7169,27 +7169,6 @@ static int __maybe_unused mv88e6xxx_resume(struct device *dev)
 
 static SIMPLE_DEV_PM_OPS(mv88e6xxx_pm_ops, mv88e6xxx_suspend, mv88e6xxx_resume);
 
-static void mv88e6xxx_validate_frame_size(void)
-{
-	int max;
-	int i;
-
-	for (i = 0; i < ARRAY_SIZE(mv88e6xxx_table); i++) {
-		/* same logic as in mv88e6xxx_get_max_mtu() */
-		if (mv88e6xxx_table[i].ops->port_set_jumbo_size)
-			max = 10240;
-		else if (mv88e6xxx_table[i].ops->set_max_frame_size)
-			max = 1632;
-		else
-			max = 1522;
-
-		if (mv88e6xxx_table[i].max_frame_size != max)
-			pr_err("BUG: %s has differing max_frame_size: %d != %d\n",
-			       mv88e6xxx_table[i].name, max,
-			       mv88e6xxx_table[i].max_frame_size);
-	}
-}
-
 static int mv88e6xxx_probe(struct mdio_device *mdiodev)
 {
 	struct dsa_mv88e6xxx_pdata *pdata = mdiodev->dev.platform_data;
@@ -7323,7 +7302,6 @@ static int mv88e6xxx_probe(struct mdio_device *mdiodev)
 	if (err)
 		goto out_mdio;
 
-	mv88e6xxx_validate_frame_size();
 	return 0;
 
 out_mdio:
-- 
2.20.1


  parent reply	other threads:[~2023-03-09 12:55 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-09 12:54 [PATCH 0/7] dsa: marvell: Add support for mv88e6071 and 6020 switches Lukasz Majewski
2023-03-09 12:54 ` [PATCH 1/7] dsa: marvell: Provide per device information about max frame size Lukasz Majewski
2023-03-10 12:02   ` Vladimir Oltean
2023-03-10 12:25     ` Russell King (Oracle)
2023-03-10 13:04       ` Vladimir Oltean
2023-03-10 13:06         ` Vladimir Oltean
2023-03-10 13:17     ` Lukasz Majewski
2023-03-10 13:36       ` Vladimir Oltean
2023-03-10 14:10         ` Lukasz Majewski
2023-03-10 15:45       ` Vladimir Oltean
2023-03-10 16:12         ` Andrew Lunn
2023-03-12 15:55         ` Lukasz Majewski
2023-03-13 15:01           ` Vladimir Oltean
2023-03-10 14:04     ` Russell King (Oracle)
2023-03-09 12:54 ` [PATCH 2/7] net: dsa: mv88e6xxx: add support for MV88E6020 switch Lukasz Majewski
2023-03-10 14:23   ` Vladimir Oltean
2023-03-09 12:54 ` [PATCH 3/7] net: dsa: mv88e6xxx: add support for MV88E6071 switch Lukasz Majewski
2023-03-09 12:54 ` [PATCH 4/7] dsa: marvell: Define .set_max_frame_size() function for mv88e6250 SoC family Lukasz Majewski
2023-03-09 12:54 ` [PATCH 5/7] dsa: marvell: Add helper function to validate the max_frame_size variable Lukasz Majewski
2023-03-09 13:21   ` Russell King (Oracle)
2023-03-09 13:26     ` Russell King (Oracle)
2023-03-09 13:47       ` Lukasz Majewski
2023-03-09 13:52         ` Vladimir Oltean
2023-03-09 13:57           ` Lukasz Majewski
2023-03-09 12:54 ` Lukasz Majewski [this message]
2023-03-09 14:05   ` [PATCH 6/7] dsa: marvell: Correct value of max_frame_size variable after validation Russell King (Oracle)
2023-03-09 14:43     ` Lukasz Majewski
2023-03-09 15:31       ` Russell King (Oracle)
2023-03-10  9:47         ` Lukasz Majewski
2023-03-09 15:42       ` Andrew Lunn
2023-03-10 11:53         ` Lukasz Majewski
2023-03-10 12:06           ` Russell King (Oracle)
2023-03-10 13:19             ` Lukasz Majewski
2023-03-10 15:25             ` Vladimir Oltean
2023-03-09 12:54 ` [PATCH 7/7] dsa: marvell: Modify get max MTU callback to use per switch provided value Lukasz Majewski
2023-04-03 11:55 ` [PATCH 0/7] dsa: marvell: Add support for mv88e6071 and 6020 switches Vladimir Oltean

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230309125421.3900962-7-lukma@denx.de \
    --to=lukma@denx.de \
    --cc=alexander.duyck@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.