From: Takashi Iwai Subject: Re: [PATCH 1/4] ASoC: wm8962: Hold a runtime PM reference while handling interrupts Date: Fri, 31 Jan 2014 18:35:26 +0100 Message-ID: References: <1391182201-29439-1-git-send-email-broonie@kernel.org> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 06ACB264F13 for ; Fri, 31 Jan 2014 18:35:27 +0100 (CET) In-Reply-To: <1391182201-29439-1-git-send-email-broonie@kernel.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Mark Brown Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com, Liam Girdwood , linaro-kernel@lists.linaro.org, Mark Brown List-Id: alsa-devel@alsa-project.org At Fri, 31 Jan 2014 15:29:58 +0000, Mark Brown wrote: > > From: Mark Brown > > If the device is runtime suspended then we can't interact with it as it > may have been powered off and the register map will be in cache only > mode. > > Signed-off-by: Mark Brown > --- > sound/soc/codecs/wm8962.c | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) > > diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c > index 97db3b45b411..aa7ae76d5e28 100644 > --- a/sound/soc/codecs/wm8962.c > +++ b/sound/soc/codecs/wm8962.c > @@ -3003,6 +3003,12 @@ static irqreturn_t wm8962_irq(int irq, void *data) > unsigned int active; > int reg, ret; > > + ret = pm_runtime_get_sync(dev); > + if (ret < 0) { > + dev_err(dev, "Failed to resume: %d\n", ret); > + return ret; Shouldn't here return IRQ_XXX? Takashi > + } > + > ret = regmap_read(wm8962->regmap, WM8962_INTERRUPT_STATUS_2_MASK, > &mask); > if (ret != 0) { > @@ -3019,8 +3025,10 @@ static irqreturn_t wm8962_irq(int irq, void *data) > > active &= ~mask; > > - if (!active) > + if (!active) { > + pm_runtime_put(dev); > return IRQ_NONE; > + } > > /* Acknowledge the interrupts */ > ret = regmap_write(wm8962->regmap, WM8962_INTERRUPT_STATUS_2, active); > @@ -3070,6 +3078,8 @@ static irqreturn_t wm8962_irq(int irq, void *data) > msecs_to_jiffies(250)); > } > > + pm_runtime_put(dev); > + > return IRQ_HANDLED; > } > > -- > 1.9.rc1 > > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@alsa-project.org > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel >