Skip to contentSkip to conversation

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

PATCH New Boris Brezillon 2 participants 2 messages Sep 6, 2016 – Sep 13, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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().

Fixes ea31c0cf9b07 ("mfd: atmel-hlcdc: Implement config synchronization")
---
 drivers/mfd/atmel-hlcdc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/mfd/atmel-hlcdc.c +3 -2
index eca7ea69b81c..4b15b0840f16 100644
@@ -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);
Signature · 1 line
2.7.4
Applied
#1 lore raw

PATCH 1/1 mfd: atmel-hlcdc: Do not sleep in atomic context

Quoted 4 lines · Boris Brezillon

readl_poll_timeout() calls usleep_range(), but regmap_atmel_hlcdc_reg_write() is called in atomic context (regmap spinlock held).

Quoted 8 lines

Replace the readl_poll_timeout() call by readl_poll_timeout_atomic().

Fixes ea31c0cf9b07 ("mfd: atmel-hlcdc: Implement config synchronization")
---
 drivers/mfd/atmel-hlcdc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Applied, thanks.

Quoted 16 lines
drivers/mfd/atmel-hlcdc.c +3 -2
index eca7ea69b81c..4b15b0840f16 100644
@@ -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);
Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog