From: Stanislaw Pal The regmap is created with .disable_locking, on the ground that the qca8k read and write callbacks do their own locking. They only lock the bus transaction, though. Since the driver moved to the regmap read/write API, regmap formats the register and parses the value in the map's shared work_buf, outside of the callbacks, so two concurrent users can swap or corrupt each other's register and value. Most register access runs under rtnl, but not all of it: phylink's resolve work (mac_link_up/down) and the LED class callbacks do not, so a link change can race with an ethtool or LED access and write the wrong switch register or read back the wrong value. Let regmap take its own lock. Every user of the map can already sleep, on the MDIO bus or on the management frame round trip. Fixes: c766e077d927 ("net: dsa: qca8k: convert to regmap read/write API") Signed-off-by: Stanislaw Pal Signed-off-by: Yongzhao Chen --- drivers/net/dsa/qca/qca8k-8xxx.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/dsa/qca/qca8k-8xxx.c b/drivers/net/dsa/qca/qca8k-8xxx.c index 07227ae8b..1e4f83e9e 100644 --- a/drivers/net/dsa/qca/qca8k-8xxx.c +++ b/drivers/net/dsa/qca/qca8k-8xxx.c @@ -579,7 +579,6 @@ static const struct regmap_config qca8k_regmap_config = { .write = qca8k_bulk_write, .reg_update_bits = qca8k_regmap_update_bits, .rd_table = &qca8k_readable_table, - .disable_locking = true, /* Locking is handled by qca8k read/write */ .cache_type = REGCACHE_NONE, /* Explicitly disable CACHE */ .max_raw_read = 32, /* mgmt eth can read up to 8 registers at time */ /* ATU regs suffer from a bug where some data are not correctly -- 2.43.0