1
0
Fork 0
alistair23-linux/drivers/net/dsa/microchip
Marek Vasut 013572a236 net: dsa: microchip: Add shared regmap mutex
The KSZ driver uses one regmap per register width (8/16/32), each with
it's own lock, but accessing the same set of registers. In theory, it
is possible to create a race condition between these regmaps, although
the underlying bus (SPI or I2C) locking should assure nothing bad will
really happen and the accesses would be correct.

To make the driver do the right thing, add one single shared mutex for
all the regmaps used by the driver instead. This assures that even if
some future hardware is on a bus which does not serialize the accesses
the same way SPI or I2C does, nothing bad will happen.

Note that the status_mutex was unused and only initied, hence it was
renamed and repurposed as the regmap mutex.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: David S. Miller <davem@davemloft.net>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: George McCollister <george.mccollister@gmail.com>
Cc: Tristram Ha <Tristram.Ha@microchip.com>
Cc: Woojung Huh <woojung.huh@microchip.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-10-17 15:38:46 -04:00
..
Kconfig net: dsa: microchip: add KSZ9477 I2C driver 2019-09-12 11:36:12 +01:00
Makefile net: dsa: microchip: add KSZ9477 I2C driver 2019-09-12 11:36:12 +01:00
ksz8795.c net: dsa: microchip: Do not reinit mutexes on KSZ87xx 2019-10-17 15:38:46 -04:00
ksz8795_reg.h net: dsa: ksz: Add Microchip KSZ8795 DSA driver 2019-07-30 15:12:50 -07:00
ksz8795_spi.c net: dsa: microchip: Add shared regmap mutex 2019-10-17 15:38:46 -04:00
ksz9477.c net: dsa: microchip: add ksz9567 to ksz9477 driver 2019-09-12 11:36:12 +01:00
ksz9477_i2c.c net: dsa: microchip: Add shared regmap mutex 2019-10-17 15:38:46 -04:00
ksz9477_reg.h net: dsa: microchip: Use the correct style for SPDX License Identifier 2019-10-15 14:59:58 -07:00
ksz9477_spi.c net: dsa: microchip: Add shared regmap mutex 2019-10-17 15:38:46 -04:00
ksz_common.c net: dsa: microchip: Add shared regmap mutex 2019-10-17 15:38:46 -04:00
ksz_common.h net: dsa: microchip: Add shared regmap mutex 2019-10-17 15:38:46 -04:00