From: Takashi Iwai Subject: Re: [PATCH] ALSA: hda: ignore assoc when comparing pin configurations Date: Tue, 06 Dec 2016 08:07:00 +0100 Message-ID: References: <20161206063941.13876-1-kai.heng.feng@canonical.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 mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 72639266F01 for ; Tue, 6 Dec 2016 08:07:01 +0100 (CET) In-Reply-To: <20161206063941.13876-1-kai.heng.feng@canonical.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: Kai-Heng Feng Cc: hui.wang@canonical.com, alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org On Tue, 06 Dec 2016 07:39:41 +0100, Kai-Heng Feng wrote: > > Commit [64047d7f4912 ALSA: hda - ignore the assoc and seq when comparing > pin configurations] may still fail to match pins on some machines, > because the bitmask it used only ignore seq but not assoc. > Change the bitmask to also ignore assoc. So you are ignoring *both* assoc and seq numbers? Or did you intend to ignore only assoc number? In anyway, it'd be better to use a macro like if ((t_pins->val & ~AC_DEFCFGDEF_ASSOC) == (cfg & ~AC_DEFCFG_ASSOC)) thanks, Takashi > > Thanks to Hui Wang for the analysis. > > Signed-off-by: Kai-Heng Feng > --- > sound/pci/hda/hda_auto_parser.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sound/pci/hda/hda_auto_parser.c b/sound/pci/hda/hda_auto_parser.c > index 4ad29f8..fdc30d0 100644 > --- a/sound/pci/hda/hda_auto_parser.c > +++ b/sound/pci/hda/hda_auto_parser.c > @@ -901,7 +901,7 @@ static bool pin_config_match(struct hda_codec *codec, > for (; t_pins->nid; t_pins++) { > if (t_pins->nid == nid) { > found = 1; > - if ((t_pins->val & 0xfffffff0) == (cfg & 0xfffffff0)) > + if ((t_pins->val & 0xffffff00) == (cfg & 0xffffff00)) > break; > else if ((cfg & 0xf0000000) == 0x40000000 && (t_pins->val & 0xf0000000) == 0x40000000) > break; > -- > 2.10.2 > >