]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: rawnand: marvell: use regmap_update_bits() for syscon access
authorThomas Petazzoni <thomas.petazzoni@bootlin.com>
Thu, 2 Aug 2018 08:56:25 +0000 (10:56 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Tue, 4 Sep 2018 21:36:55 +0000 (23:36 +0200)
commit859c60e1b9ce6ed596275c79d6992e7bf32c935e
treeb78f280fe0249391e17eca3e511ceeced336dce8
parent615aa128a7c696d8d9fd4d05a7eca81395d35279
mtd: rawnand: marvell: use regmap_update_bits() for syscon access

The marvell_nfc_init() function fiddles with some bits of a system
controller on Armada 7K/8K. However, it does a read/modify/write
sequence on GENCONF_CLK_GATING_CTRL and GENCONF_ND_CLK_CTRL, which
isn't safe from a concurrency point of view, as the regmap lock isn't
taken accross the read/modify/write sequence. To solve this issue, use
regmap_update_bits().

While at it, since the "reg" variable is no longer needed for the
read/modify/write sequences, get rid of it for the regmap_write() to
GENCONF_SOC_DEVICE_MUX, and directly pass the value to be written as
argument.

Fixes: 8cfde04381f0f ("mtd: nand: add reworked Marvell NAND controller driver")
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/marvell_nand.c