Patch "net: dsa: microchip: ksz8863_smi: fix bulk access" has been added to the 6.2-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: dsa: microchip: ksz8863_smi: fix bulk access

to the 6.2-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-dsa-microchip-ksz8863_smi-fix-bulk-access.patch
and it can be found in the queue-6.2 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 7c005e72666ca1c534314c8f376daf91dd2c7264
Author: Oleksij Rempel <linux@xxxxxxxxxxxxxxxx>
Date:   Fri Mar 24 09:06:07 2023 +0100

    net: dsa: microchip: ksz8863_smi: fix bulk access
    
    [ Upstream commit 392ff7a84cbca34118ca286dfbfe8aee24605897 ]
    
    Current regmap bulk access is broken, resulting to wrong reads/writes
    if ksz_read64/ksz_write64 functions are used.
    Mostly this issue was visible by using ksz8_fdb_dump(), which returned
    corrupt MAC address.
    
    The reason is that regmap was configured to have max_raw_read/write,
    even if ksz8863_mdio_read/write functions are able to handle unlimited
    read/write accesses. On ksz_read64 function we are using multiple 32bit
    accesses by incrementing each access by 1 instead of 4. Resulting buffer
    had 01234567.12345678 instead of 01234567.89abcdef.
    
    We have multiple ways to fix it:
    - enable 4 byte alignment for 32bit accesses. Since the HW do not have
      this requirement. It will break driver.
    - disable max_raw_* limit.
    
    This patch is removing max_raw_* limit for regmap accesses in ksz8863_smi.
    
    Fixes: 60a364760002 ("net: dsa: microchip: Add Microchip KSZ8863 SMI based driver support")
    Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
    Reviewed-by: Florian Fainelli <f.fainelli@xxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/dsa/microchip/ksz8863_smi.c b/drivers/net/dsa/microchip/ksz8863_smi.c
index 2f4623f3bd852..3698112138b78 100644
--- a/drivers/net/dsa/microchip/ksz8863_smi.c
+++ b/drivers/net/dsa/microchip/ksz8863_smi.c
@@ -82,22 +82,16 @@ static const struct regmap_bus regmap_smi[] = {
 	{
 		.read = ksz8863_mdio_read,
 		.write = ksz8863_mdio_write,
-		.max_raw_read = 1,
-		.max_raw_write = 1,
 	},
 	{
 		.read = ksz8863_mdio_read,
 		.write = ksz8863_mdio_write,
 		.val_format_endian_default = REGMAP_ENDIAN_BIG,
-		.max_raw_read = 2,
-		.max_raw_write = 2,
 	},
 	{
 		.read = ksz8863_mdio_read,
 		.write = ksz8863_mdio_write,
 		.val_format_endian_default = REGMAP_ENDIAN_BIG,
-		.max_raw_read = 4,
-		.max_raw_write = 4,
 	}
 };
 
@@ -108,7 +102,6 @@ static const struct regmap_config ksz8863_regmap_config[] = {
 		.pad_bits = 24,
 		.val_bits = 8,
 		.cache_type = REGCACHE_NONE,
-		.use_single_read = 1,
 		.lock = ksz_regmap_lock,
 		.unlock = ksz_regmap_unlock,
 	},
@@ -118,7 +111,6 @@ static const struct regmap_config ksz8863_regmap_config[] = {
 		.pad_bits = 24,
 		.val_bits = 16,
 		.cache_type = REGCACHE_NONE,
-		.use_single_read = 1,
 		.lock = ksz_regmap_lock,
 		.unlock = ksz_regmap_unlock,
 	},
@@ -128,7 +120,6 @@ static const struct regmap_config ksz8863_regmap_config[] = {
 		.pad_bits = 24,
 		.val_bits = 32,
 		.cache_type = REGCACHE_NONE,
-		.use_single_read = 1,
 		.lock = ksz_regmap_lock,
 		.unlock = ksz_regmap_unlock,
 	}



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux