Skip to contentSkip to conversation

ALSA: hda: ignore assoc when comparing pin configurations

PATCH Superseded Kai-Heng Feng 3 participants 4 messages Dec 6, 2016 Sound

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: hda: ignore assoc when comparing pin configurations

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.

Thanks to Hui Wang for the analysis.

---
 sound/pci/hda/hda_auto_parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/hda_auto_parser.c +1 -1
index 4ad29f8..fdc30d0 100644
@@ -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;
Signature · 1 line
2.10.2
#1 lore raw
Quoted 5 lines · Kai-Heng Feng

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

Quoted 25 lines

Thanks to Hui Wang for the analysis.

---
 sound/pci/hda/hda_auto_parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/hda_auto_parser.c +1 -1
index 4ad29f8..fdc30d0 100644
@@ -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;
Signature · 1 line
2.10.2
#2 lore raw
Quoted 8 lines · Takashi Iwai
Quoted 4 lines · Kai-Heng Feng

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?

The original intention is to ignoring both assoc and seq numbers. But my patch only ignored the seq, so this patch can fix my previous patch.

Quoted 3 lines

In anyway, it'd be better to use a macro like

	if ((t_pins->val & ~AC_DEFCFGDEF_ASSOC) == (cfg & ~AC_DEFCFG_ASSOC))

Yes, it is better to use the macro. Let us use the macro in the V2 patch.

Thanks,
Hui.

Quoted 29 lines

thanks,

Takashi

Quoted 24 lines

Thanks to Hui Wang for the analysis.

---
  sound/pci/hda/hda_auto_parser.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/hda_auto_parser.c +1 -1
index 4ad29f8..fdc30d0 100644
@@ -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;
Signature · 1 line
2.10.2
#3 lore raw
Quoted 8 lines · Hui Wang
Quoted 6 lines · Takashi Iwai
Quoted 4 lines · Kai-Heng Feng

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.

Quoted 5 lines
Quoted 2 lines

So you are ignoring *both* assoc and seq numbers?
Or did you intend to ignore only assoc number?

The original intention is to ignoring both assoc and seq numbers. But my patch only ignored the seq, so this patch can fix my previous patch.

OK, it wasn't clear in the changelog description. Please put it to v2 patch for comprehensive information.

Quoted 4 lines
Quoted 3 lines

In anyway, it'd be better to use a macro like

	if ((t_pins->val & ~AC_DEFCFGDEF_ASSOC) == (cfg & ~AC_DEFCFG_ASSOC))

Yes, it is better to use the macro. Let us use the macro in the V2 patch.

Great.

thanks,

Takashi