Skip to content

Commit 392ff7a

Browse files
oleremdavem330
authored andcommitted
net: dsa: microchip: ksz8863_smi: fix bulk access
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: 60a3647 ("net: dsa: microchip: Add Microchip KSZ8863 SMI based driver support") Signed-off-by: Oleksij Rempel <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 492606c commit 392ff7a

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

drivers/net/dsa/microchip/ksz8863_smi.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,22 +82,16 @@ static const struct regmap_bus regmap_smi[] = {
8282
{
8383
.read = ksz8863_mdio_read,
8484
.write = ksz8863_mdio_write,
85-
.max_raw_read = 1,
86-
.max_raw_write = 1,
8785
},
8886
{
8987
.read = ksz8863_mdio_read,
9088
.write = ksz8863_mdio_write,
9189
.val_format_endian_default = REGMAP_ENDIAN_BIG,
92-
.max_raw_read = 2,
93-
.max_raw_write = 2,
9490
},
9591
{
9692
.read = ksz8863_mdio_read,
9793
.write = ksz8863_mdio_write,
9894
.val_format_endian_default = REGMAP_ENDIAN_BIG,
99-
.max_raw_read = 4,
100-
.max_raw_write = 4,
10195
}
10296
};
10397

@@ -108,7 +102,6 @@ static const struct regmap_config ksz8863_regmap_config[] = {
108102
.pad_bits = 24,
109103
.val_bits = 8,
110104
.cache_type = REGCACHE_NONE,
111-
.use_single_read = 1,
112105
.lock = ksz_regmap_lock,
113106
.unlock = ksz_regmap_unlock,
114107
},
@@ -118,7 +111,6 @@ static const struct regmap_config ksz8863_regmap_config[] = {
118111
.pad_bits = 24,
119112
.val_bits = 16,
120113
.cache_type = REGCACHE_NONE,
121-
.use_single_read = 1,
122114
.lock = ksz_regmap_lock,
123115
.unlock = ksz_regmap_unlock,
124116
},
@@ -128,7 +120,6 @@ static const struct regmap_config ksz8863_regmap_config[] = {
128120
.pad_bits = 24,
129121
.val_bits = 32,
130122
.cache_type = REGCACHE_NONE,
131-
.use_single_read = 1,
132123
.lock = ksz_regmap_lock,
133124
.unlock = ksz_regmap_unlock,
134125
}

0 commit comments

Comments
 (0)