From: Takashi Iwai Subject: Re: [PATCH] ALSA: hdac_regmap - fix the register access for runtime PM Date: Fri, 17 Jun 2016 14:14:11 +0200 Message-ID: References: <1466163356-28195-1-git-send-email-perex@perex.cz> 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 (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 8EFC6265A78 for ; Fri, 17 Jun 2016 14:14:11 +0200 (CEST) In-Reply-To: <1466163356-28195-1-git-send-email-perex@perex.cz> 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: Jaroslav Kysela Cc: ALSA development List-Id: alsa-devel@alsa-project.org On Fri, 17 Jun 2016 13:35:56 +0200, Jaroslav Kysela wrote: > > Call path: > > 1) snd_hdac_power_up_pm() > 2) snd_hdac_power_up() > 3) pm_runtime_get_sync() > 4) __pm_runtime_resume() > 5) rpm_resume() > > The rpm_resume() returns 1 when the device is already active. > Because the return value is unmodified, the hdac regmap read/write > functions should allow this value for the retry I/O operation, too. > > Signed-off-by: Jaroslav Kysela Thanks, a good catch. Applied now. Takashi > --- > sound/hda/hdac_regmap.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/sound/hda/hdac_regmap.c b/sound/hda/hdac_regmap.c > index 87041dd..47a358f 100644 > --- a/sound/hda/hdac_regmap.c > +++ b/sound/hda/hdac_regmap.c > @@ -444,7 +444,7 @@ int snd_hdac_regmap_write_raw(struct hdac_device *codec, unsigned int reg, > err = reg_raw_write(codec, reg, val); > if (err == -EAGAIN) { > err = snd_hdac_power_up_pm(codec); > - if (!err) > + if (err >= 0) > err = reg_raw_write(codec, reg, val); > snd_hdac_power_down_pm(codec); > } > @@ -470,7 +470,7 @@ static int __snd_hdac_regmap_read_raw(struct hdac_device *codec, > err = reg_raw_read(codec, reg, val, uncached); > if (err == -EAGAIN) { > err = snd_hdac_power_up_pm(codec); > - if (!err) > + if (err >= 0) > err = reg_raw_read(codec, reg, val, uncached); > snd_hdac_power_down_pm(codec); > } > -- > 2.5.5 >