linux-stable/drivers/nvmem
Christophe Kerello f6c052afe6 nvmem: core: Fix a conflict between MTD and NVMEM on wp-gpios property
Wp-gpios property can be used on NVMEM nodes and the same property can
be also used on MTD NAND nodes. In case of the wp-gpios property is
defined at NAND level node, the GPIO management is done at NAND driver
level. Write protect is disabled when the driver is probed or resumed
and is enabled when the driver is released or suspended.

When no partitions are defined in the NAND DT node, then the NAND DT node
will be passed to NVMEM framework. If wp-gpios property is defined in
this node, the GPIO resource is taken twice and the NAND controller
driver fails to probe.

It would be possible to set config->wp_gpio at MTD level before calling
nvmem_register function but NVMEM framework will toggle this GPIO on
each write when this GPIO should only be controlled at NAND level driver
to ensure that the Write Protect has not been enabled.

A way to fix this conflict is to add a new boolean flag in nvmem_config
named ignore_wp. In case ignore_wp is set, the GPIO resource will
be managed by the provider.

Fixes: 2a127da461 ("nvmem: add support for the write-protect pin")
Cc: stable@vger.kernel.org
Signed-off-by: Christophe Kerello <christophe.kerello@foss.st.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220220151432.16605-2-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-21 17:59:25 +01:00
..
bcm-ocotp.c
brcm_nvram.c nvmem: brcm_nvram: new driver exposing Broadcom's NVRAM 2021-04-02 16:26:33 +02:00
core.c nvmem: core: Fix a conflict between MTD and NVMEM on wp-gpios property 2022-02-21 17:59:25 +01:00
imx-iim.c nvmem: imx-iim: Use of_device_get_match_data() 2021-02-04 17:04:18 +01:00
imx-ocotp-scu.c
imx-ocotp.c nvmem: imx-ocotp: add support for post processing 2021-10-13 15:33:17 +02:00
jz4780-efuse.c
Kconfig nvmem: NVMEM_NINTENDO_OTP should depend on WII 2021-09-21 17:38:37 +02:00
lpc18xx_eeprom.c
lpc18xx_otp.c
Makefile nvmem: nintendo-otp: Add new driver for the Wii and Wii U OTP 2021-08-13 10:27:20 +02:00
meson-efuse.c
meson-mx-efuse.c
mtk-efuse.c nvmem: mtk-efuse: support minimum one byte access stride and granularity 2021-12-21 10:26:50 +01:00
mxs-ocotp.c
nintendo-otp.c nvmem: nintendo-otp: Add new driver for the Wii and Wii U OTP 2021-08-13 10:27:20 +02:00
qcom-spmi-sdam.c nvmem: convert comma to semicolon 2021-04-02 16:26:33 +02:00
qfprom.c nvmem: qfprom: sc7280: Handle the additional power-domains vote 2021-08-06 15:18:40 +02:00
rave-sp-eeprom.c
rmem.c nvmem: Add driver to expose reserved memory as nvmem 2021-02-04 17:04:18 +01:00
rockchip-efuse.c
rockchip-otp.c
sc27xx-efuse.c
snvs_lpgpr.c nvmem: convert comma to semicolon 2021-04-02 16:26:33 +02:00
sprd-efuse.c nvmem: sprd: Fix an error message 2021-05-14 13:39:50 +02:00
stm32-romem.c
sunxi_sid.c nvmem: sunxi_sid: Set type to OTP 2021-06-11 10:57:52 +02:00
uniphier-efuse.c
vf610-ocotp.c
zynqmp_nvmem.c