mfd: atmel-hlcdc: Do not sleep in atomic context
authorBoris Brezillon <boris.brezillon@free-electrons.com>
Tue, 6 Sep 2016 12:19:29 +0000 (14:19 +0200)
committerLee Jones <lee.jones@linaro.org>
Tue, 4 Oct 2016 14:48:04 +0000 (15:48 +0100)
readl_poll_timeout() calls usleep_range(), but
regmap_atmel_hlcdc_reg_write() is called in atomic context (regmap
spinlock held).

Replace the readl_poll_timeout() call by readl_poll_timeout_atomic().

Cc: <stable@vger.kernel.org>
Fixes: ea31c0cf9b07 ("mfd: atmel-hlcdc: Implement config synchronization")
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/atmel-hlcdc.c

index eca7ea69b81c8c16085f98a803da511589599b37..4b15b0840f16991e942e0f98aca16e463cbac887 100644 (file)
@@ -50,8 +50,9 @@ static int regmap_atmel_hlcdc_reg_write(void *context, unsigned int reg,
        if (reg <= ATMEL_HLCDC_DIS) {
                u32 status;
 
-               readl_poll_timeout(hregmap->regs + ATMEL_HLCDC_SR, status,
-                                  !(status & ATMEL_HLCDC_SIP), 1, 100);
+               readl_poll_timeout_atomic(hregmap->regs + ATMEL_HLCDC_SR,
+                                         status, !(status & ATMEL_HLCDC_SIP),
+                                         1, 100);
        }
 
        writel(val, hregmap->regs + reg);