* [PATCH] mfd: atmel-hlcdc: Do not sleep in atomic context
@ 2016-09-06 12:19 ` Boris Brezillon
0 siblings, 0 replies; 4+ messages in thread
From: Boris Brezillon @ 2016-09-06 12:19 UTC (permalink / raw)
To: Samuel Ortiz, Lee Jones
Cc: Nicolas Ferre, Jean-Christophe Plagniol-Villard,
Alexandre Belloni, linux-arm-kernel, Boris Brezillon, stable
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().
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Fixes: ea31c0cf9b07 ("mfd: atmel-hlcdc: Implement config synchronization")
Cc: <stable@vger.kernel.org>
---
drivers/mfd/atmel-hlcdc.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/mfd/atmel-hlcdc.c b/drivers/mfd/atmel-hlcdc.c
index eca7ea69b81c..4b15b0840f16 100644
--- a/drivers/mfd/atmel-hlcdc.c
+++ b/drivers/mfd/atmel-hlcdc.c
@@ -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);
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] mfd: atmel-hlcdc: Do not sleep in atomic context
@ 2016-09-06 12:19 ` Boris Brezillon
0 siblings, 0 replies; 4+ messages in thread
From: Boris Brezillon @ 2016-09-06 12:19 UTC (permalink / raw)
To: linux-arm-kernel
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().
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Fixes: ea31c0cf9b07 ("mfd: atmel-hlcdc: Implement config synchronization")
Cc: <stable@vger.kernel.org>
---
drivers/mfd/atmel-hlcdc.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/mfd/atmel-hlcdc.c b/drivers/mfd/atmel-hlcdc.c
index eca7ea69b81c..4b15b0840f16 100644
--- a/drivers/mfd/atmel-hlcdc.c
+++ b/drivers/mfd/atmel-hlcdc.c
@@ -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);
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mfd: atmel-hlcdc: Do not sleep in atomic context
2016-09-06 12:19 ` Boris Brezillon
@ 2016-09-13 11:27 ` Lee Jones
-1 siblings, 0 replies; 4+ messages in thread
From: Lee Jones @ 2016-09-13 11:27 UTC (permalink / raw)
To: Boris Brezillon
Cc: Samuel Ortiz, Nicolas Ferre, Jean-Christophe Plagniol-Villard,
Alexandre Belloni, linux-arm-kernel, stable
On Tue, 06 Sep 2016, Boris Brezillon wrote:
> 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().
>
> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> Fixes: ea31c0cf9b07 ("mfd: atmel-hlcdc: Implement config synchronization")
> Cc: <stable@vger.kernel.org>
> ---
> drivers/mfd/atmel-hlcdc.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
Applied, thanks.
> diff --git a/drivers/mfd/atmel-hlcdc.c b/drivers/mfd/atmel-hlcdc.c
> index eca7ea69b81c..4b15b0840f16 100644
> --- a/drivers/mfd/atmel-hlcdc.c
> +++ b/drivers/mfd/atmel-hlcdc.c
> @@ -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);
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] mfd: atmel-hlcdc: Do not sleep in atomic context
@ 2016-09-13 11:27 ` Lee Jones
0 siblings, 0 replies; 4+ messages in thread
From: Lee Jones @ 2016-09-13 11:27 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, 06 Sep 2016, Boris Brezillon wrote:
> 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().
>
> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> Fixes: ea31c0cf9b07 ("mfd: atmel-hlcdc: Implement config synchronization")
> Cc: <stable@vger.kernel.org>
> ---
> drivers/mfd/atmel-hlcdc.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
Applied, thanks.
> diff --git a/drivers/mfd/atmel-hlcdc.c b/drivers/mfd/atmel-hlcdc.c
> index eca7ea69b81c..4b15b0840f16 100644
> --- a/drivers/mfd/atmel-hlcdc.c
> +++ b/drivers/mfd/atmel-hlcdc.c
> @@ -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);
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-09-13 11:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-06 12:19 [PATCH] mfd: atmel-hlcdc: Do not sleep in atomic context Boris Brezillon
2016-09-06 12:19 ` Boris Brezillon
2016-09-13 11:27 ` Lee Jones
2016-09-13 11:27 ` Lee Jones
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.