Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: atmel-hlcdc: Do not sleep in atomic context

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>

authored by

Boris Brezillon and committed by
Lee Jones
2c2469bc 22a96b85

+3 -2
+3 -2
drivers/mfd/atmel-hlcdc.c
··· 50 50 if (reg <= ATMEL_HLCDC_DIS) { 51 51 u32 status; 52 52 53 - readl_poll_timeout(hregmap->regs + ATMEL_HLCDC_SR, status, 54 - !(status & ATMEL_HLCDC_SIP), 1, 100); 53 + readl_poll_timeout_atomic(hregmap->regs + ATMEL_HLCDC_SR, 54 + status, !(status & ATMEL_HLCDC_SIP), 55 + 1, 100); 55 56 } 56 57 57 58 writel(val, hregmap->regs + reg);