From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH 1/2] ALSA: hda: Fix mismatches for register mask and value in hdac controller Date: Wed, 09 Jan 2019 10:31:14 +0100 Message-ID: References: <20190109082051.32643-1-yang.jie@linux.intel.com> 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 mx1.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id BF1D92665E5 for ; Wed, 9 Jan 2019 10:31:15 +0100 (CET) In-Reply-To: <20190109082051.32643-1-yang.jie@linux.intel.com> 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: Keyon Jie Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org On Wed, 09 Jan 2019 09:20:50 +0100, Keyon Jie wrote: > > E.g. for azx_int_enable(), we should set both mask and value to be > "AZX_INT_CTRL_EN | AZX_INT_GLOBAL_EN"(the mask was 0) to enable > controller CIE and GIE. > > We have similar issues on setting AZX_GCTL_RESET and AZX_GCTL_UNSOL, > here try to correct all of them. > > Signed-off-by: Keyon Jie Well, the current code isn't incorrect, it serves for its purpose -- set the given bits. But yeah it's clearer to pass the mask bits explicitly. So I queued these two patches to for-next branch, for 5.1 kernel. thanks, Takashi > --- > sound/hda/hdac_controller.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/sound/hda/hdac_controller.c b/sound/hda/hdac_controller.c > index 74244d8e2909..b2e9454f5816 100644 > --- a/sound/hda/hdac_controller.c > +++ b/sound/hda/hdac_controller.c > @@ -376,7 +376,7 @@ void snd_hdac_bus_exit_link_reset(struct hdac_bus *bus) > { > unsigned long timeout; > > - snd_hdac_chip_updateb(bus, GCTL, 0, AZX_GCTL_RESET); > + snd_hdac_chip_updateb(bus, GCTL, AZX_GCTL_RESET, AZX_GCTL_RESET); > > timeout = jiffies + msecs_to_jiffies(100); > while (!snd_hdac_chip_readb(bus, GCTL) && time_before(jiffies, timeout)) > @@ -415,7 +415,7 @@ int snd_hdac_bus_reset_link(struct hdac_bus *bus, bool full_reset) > } > > /* Accept unsolicited responses */ > - snd_hdac_chip_updatel(bus, GCTL, 0, AZX_GCTL_UNSOL); > + snd_hdac_chip_updatel(bus, GCTL, AZX_GCTL_UNSOL, AZX_GCTL_UNSOL); > > /* detect codecs */ > if (!bus->codec_mask) { > @@ -431,7 +431,9 @@ EXPORT_SYMBOL_GPL(snd_hdac_bus_reset_link); > static void azx_int_enable(struct hdac_bus *bus) > { > /* enable controller CIE and GIE */ > - snd_hdac_chip_updatel(bus, INTCTL, 0, AZX_INT_CTRL_EN | AZX_INT_GLOBAL_EN); > + snd_hdac_chip_updatel(bus, INTCTL, > + AZX_INT_CTRL_EN | AZX_INT_GLOBAL_EN, > + AZX_INT_CTRL_EN | AZX_INT_GLOBAL_EN); > } > > /* disable interrupts */ > -- > 2.17.1 > >