OSDN Git Service

spi: dw: Disable clock after unregistering the host
authorMarek Vasut <marex@denx.de>
Tue, 18 Apr 2017 18:09:06 +0000 (20:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 24 Mar 2018 10:00:10 +0000 (11:00 +0100)
commitf5df9a59c68ea8272960cb88d31434ccb69b3510
tree5fdecb234d56f3f6e340ecd743bbdeb8b8a7f40b
parent61ea482ba847c373e2dd7c5de9132d9ca47cf90a
spi: dw: Disable clock after unregistering the host

[ Upstream commit 400c18e3dc86e04ef5afec9b86a8586ca629b9e9 ]

The dw_mmio driver disables the block clock before unregistering
the host. The code unregistering the host may access the SPI block
registers. If register access happens with block clock disabled,
this may lead to a bus hang. Disable the clock after unregistering
the host to prevent such situation.

This bug was observed on Altera Cyclone V SoC.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/spi/spi-dw-mmio.c