From: Marek Vasut Date: Tue, 18 Apr 2017 18:09:06 +0000 (+0200) Subject: spi: dw: Disable clock after unregistering the host X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=400c18e3dc86e04ef5afec9b86a8586ca629b9e9;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git spi: dw: Disable clock after unregistering the host 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 Cc: Andy Shevchenko Cc: Mark Brown Signed-off-by: Mark Brown --- diff --git a/drivers/spi/spi-dw-mmio.c b/drivers/spi/spi-dw-mmio.c index 447497e9124c..d25cc4037e23 100644 --- a/drivers/spi/spi-dw-mmio.c +++ b/drivers/spi/spi-dw-mmio.c @@ -115,8 +115,8 @@ static int dw_spi_mmio_remove(struct platform_device *pdev) { struct dw_spi_mmio *dwsmmio = platform_get_drvdata(pdev); - clk_disable_unprepare(dwsmmio->clk); dw_spi_remove_host(&dwsmmio->dws); + clk_disable_unprepare(dwsmmio->clk); return 0; }