spi: sprd: Add the support of restarting the system
authorBaolin Wang <baolin.wang@linaro.org>
Tue, 20 Mar 2018 02:42:14 +0000 (10:42 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 21 Mar 2018 01:55:19 +0000 (09:55 +0800)
commitac1775012058e13ef1522938e27f5973d9e3f053
treec64b5a4f26a2a7094c76d6e444718983b17f751a
parenta61aa683655f3182aca6e38404ae9aac03e771ae
spi: sprd: Add the support of restarting the system

On Spreadtrum platform, we use one PMIC watchdog to reset the whole system
with loading one suitable timeout value (usually 50ms) for the watchdog.

In theory, we should implement the restart function in drivers/power/reset
subsystem to access the PMIC watchdog with regmap. When restart the system,
other cores will be stopped by IPI, but if other cores were accessing PMIC
with holding the regmap mutex lock, that will cause dead-lock issue if we
try to access the PMIC watchdog with regmap to restart the whole system.
Thus we can implement the restart function in ADI driver to avoid this
issue.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-sprd-adi.c