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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Oct 2016 15:36:14 +0000 (17:36 +0200)
commit 2c2469bc03d569c49119db2cccb5cb3f0c6a5b33 upstream.

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().

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mfd/atmel-hlcdc.c

index 06c205868573e8d7d7b98e1c142156a2cc572454..c216c3a55793d9044f8c509aa1f097ca46332828 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);