Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ath9k: Really fix LED polarity for some Mini PCI AR9220 MB92 cards.

The active_high LED of my Wistron DNMA-92 is still being recognized as
active_low on 4.7.6 mainline. When I was preparing my former commit
0f9edcdd88a9 ("ath9k: Fix LED polarity for some Mini PCI AR9220 MB92
cards.") to fix that I must have somehow messed up with testing, because
I tested the final version of that patch before sending it, and it was
apparently working; but now it is not working on 4.7.6 mainline.

I initially added the PCI_DEVICE_SUB section for 0x0029/0x2096 above the
PCI_VDEVICE section for 0x0029; but then I moved the former below the
latter after seeing how 0x002A sections were sorted in the file.

This turned out to be wrong: if a generic PCI_VDEVICE entry (that has
both subvendor and subdevice IDs set to PCI_ANY_ID) is put before a more
specific one (PCI_DEVICE_SUB), then the generic PCI_VDEVICE entry will
match first and will be used.

With this patch, 0x0029/0x2096 has finally got active_high LED on 4.7.6.

While I'm at it, let's fix 0x002A too by also moving its generic definition
below its specific ones.

Fixes: 0f9edcdd88a9 ("ath9k: Fix LED polarity for some Mini PCI AR9220 MB92 cards.")
Cc: <stable@vger.kernel.org> #4.7+
Signed-off-by: Vittorio Gambaletta <linuxbugs@vittgam.net>
[kvalo@qca.qualcomm.com: improve the commit log based on email discussions]
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>

authored by

Vittorio Gambaletta (VittGam) and committed by
Kalle Valo
79e57dd1 b9824cb8

+5 -2
+5 -2
drivers/net/wireless/ath/ath9k/pci.c
··· 26 26 { PCI_VDEVICE(ATHEROS, 0x0023) }, /* PCI */ 27 27 { PCI_VDEVICE(ATHEROS, 0x0024) }, /* PCI-E */ 28 28 { PCI_VDEVICE(ATHEROS, 0x0027) }, /* PCI */ 29 - { PCI_VDEVICE(ATHEROS, 0x0029) }, /* PCI */ 30 29 31 30 #ifdef CONFIG_ATH9K_PCOEM 32 31 /* Mini PCI AR9220 MB92 cards: Compex WLM200NX, Wistron DNMA-92 */ ··· 36 37 .driver_data = ATH9K_PCI_LED_ACT_HI }, 37 38 #endif 38 39 39 - { PCI_VDEVICE(ATHEROS, 0x002A) }, /* PCI-E */ 40 + { PCI_VDEVICE(ATHEROS, 0x0029) }, /* PCI */ 40 41 41 42 #ifdef CONFIG_ATH9K_PCOEM 42 43 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, ··· 84 85 0x10CF, /* Fujitsu */ 85 86 0x1536), 86 87 .driver_data = ATH9K_PCI_D3_L1_WAR }, 88 + #endif 87 89 90 + { PCI_VDEVICE(ATHEROS, 0x002A) }, /* PCI-E */ 91 + 92 + #ifdef CONFIG_ATH9K_PCOEM 88 93 /* AR9285 card for Asus */ 89 94 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 90 95 0x002B,