From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f53.google.com ([74.125.82.53]:35123 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751672AbcIMLZx (ORCPT ); Tue, 13 Sep 2016 07:25:53 -0400 Received: by mail-wm0-f53.google.com with SMTP id i130so26471851wmf.0 for ; Tue, 13 Sep 2016 04:25:53 -0700 (PDT) Date: Tue, 13 Sep 2016 12:27:50 +0100 From: Lee Jones To: Boris Brezillon Cc: Samuel Ortiz , Nicolas Ferre , Jean-Christophe Plagniol-Villard , Alexandre Belloni , linux-arm-kernel@lists.infradead.org, stable@vger.kernel.org Subject: Re: [PATCH] mfd: atmel-hlcdc: Do not sleep in atomic context Message-ID: <20160913112750.GC26864@dell> References: <1473164369-10033-1-git-send-email-boris.brezillon@free-electrons.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1473164369-10033-1-git-send-email-boris.brezillon@free-electrons.com> Sender: stable-owner@vger.kernel.org List-ID: 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 > Fixes: ea31c0cf9b07 ("mfd: atmel-hlcdc: Implement config synchronization") > Cc: > --- > 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