regmap: Add can_sleep configuration option
authorDmitry Osipenko <digetx@gmail.com>
Wed, 2 Sep 2020 14:18:43 +0000 (17:18 +0300)
committerMark Brown <broonie@kernel.org>
Wed, 2 Sep 2020 18:53:27 +0000 (19:53 +0100)
commit21f8e4828c44da39b0670c5d99d5728b739542a1
treea9343b0f35521b63cb1c37dcc7e938957af4f1f2
parentd17343b87da422a59d99a3ed130573dbeb96c582
regmap: Add can_sleep configuration option

Regmap can't sleep if spinlock is used for the locking protection.
This patch fixes regression caused by a previous commit that switched
regmap to use fsleep() and this broke Amlogic S922X platform.

This patch adds new configuration option for regmap users, allowing to
specify whether regmap operations can sleep and assuming that sleep is
allowed if mutex is used for the regmap locking protection.

Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Fixes: 2b32d2f7ce0a ("regmap: Use flexible sleep")
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://lore.kernel.org/r/20200902141843.6591-1-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/internal.h
drivers/base/regmap/regmap.c
include/linux/regmap.h