Hi Luis, Please kindly help to review this patch. We need a atheros driver expert's help or give as any comment. :-) I found on 2.6.33 kernel, The AR9285 wifi module always turn off wifi LED on fn+f11 function key on HP mini 210. After trace main.c, found it was always do disable_radio after call ath9k_config because the all_wiphys_idle is true on HP mini 210. This LED works fine on 2.6.32 kernel, the following patch causes this side effect: ath9k: fix listening to idle requests 194b7c13b4c516db94db8ee004342f8935922739 http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.33.y.git;a=commit;h=194b7c13b4c516db94db8ee004342f8935922739 There have 3 attached files in this mail: - 0001-Fix-AR9285-always-turn-off-LED-on-HP-mini-210.patch - before-fail.log - after-apply.log There have 2 log files were generated by I simply add log to main.c, hw.c and virtual.c. The before-fail.log was generated before applied my draft patch, after-apply.log was generated after applied patch. In before-fail.log, the latest line have show the it was always call ath_radio_disable when user press fn+f11 key to turn on radio. And, please look at after-apply.log I also print out the num_sec_wiphy value in ath9k_all_wiphys_idle, this value is 0, that means ath9k_all_wiphys_idle was return true on HP mini 210 for AR9285. I am not good for atheros driver or and wifi dirver, just simply trace the LED light problem. Can you kindly give us any good suggestion or help to review my draft patch like the attached? Thank's a lot! Joey Lee
>From b725acf8fda0866aab49807a93c925e07994e2a4 Mon Sep 17 00:00:00 2001 From: Lee, Chun-Yi <jlee@xxxxxxxxxx> Date: Sun, 9 May 2010 06:47:07 +0800 Subject: [PATCH] Fix AR9285 always turn off LED on HP mini 210 On 2.6.33 kernel, The AR9285 wifi module always turn off wifi LED on fn+f11 function key on HP mini 210. After trace main.c, found it was always disable_radio after call ath9k_config because the all_wiphys_idle is true on HP mini 210. This LED works fine on 2.6.32 kernel, the following patch causes this side effect: ath9k: fix listening to idle requests 194b7c13b4c516db94db8ee004342f8935922739 Signed-off-by: Lee, Chun-Yi <jlee@xxxxxxxxxx> --- drivers/net/wireless/ath/ath9k/main.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 643bea3..d4ca82e 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c @@ -2704,6 +2704,9 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed) if (!idle && all_wiphys_idle) enable_radio = true; + if (idle && all_wiphys_idle) + disable_radio = true; + /* * After we unlock here its possible another wiphy * can be re-renabled so to account for that we will @@ -2804,10 +2807,6 @@ skip_chan_change: if (changed & IEEE80211_CONF_CHANGE_POWER) sc->config.txpowlimit = 2 * conf->power_level; - spin_lock_bh(&sc->wiphy_lock); - disable_radio = ath9k_all_wiphys_idle(sc); - spin_unlock_bh(&sc->wiphy_lock); - if (disable_radio) { ath_print(common, ATH_DBG_CONFIG, "idle: disabling radio\n"); ath_radio_disable(sc, hw); -- 1.6.0.2
May 8 06:06:01 (none) kernel: [23019.079091] ath_led_brightness May 8 06:06:01 (none) kernel: [23019.079105] LED_FULL led_type: 0 May 8 06:06:01 (none) kernel: [23019.079113] ->ath9k_kw_set_gpio, val: 0 May 8 06:06:01 (none) kernel: [23019.096074] ath9k_config->ath_radio_enable->ath9k_kw_set_gpio, val: 0 May 8 06:06:01 (none) kernel: [23019.111139] idle: disabling radio->ath_radio_disable->ath9k_kw_set_gpio, val: 1 May 8 06:06:01 (none) kernel: [23019.118745] ADDRCONF(NETDEV_UP): wlan0: link is not ready May 8 06:06:01 (none) dbus-daemon: Rejected send message, 2 matched rules; type="method_return", sender=":1.5" (uid=0 pid=970 comm="/usr/sbin/NetworkManager ") interface="(unset)" member="(unset)" error name="(unset)" requested_reply=0 destination=":1.14" (uid=1000 pid=1061 comm="/usr/lib/network-manager-netbook ")) May 8 06:06:01 (none) kernel: [23019.150647] ath9k_config->ath_radio_enable->ath9k_kw_set_gpio, val: 0 May 8 06:06:01 (none) kernel: [23019.284578] ath9k_config->ath_led_brightness May 8 06:06:01 (none) kernel: [23019.316951] ath_led_brightness May 8 06:06:01 (none) kernel: [23019.344087] ath9k_config->ath_led_brightness May 8 06:06:01 (none) kernel: [23019.372945] ath_led_brightness May 8 06:06:01 (none) kernel: [23019.400094] ath9k_config->ath_led_brightness May 8 06:06:01 (none) kernel: [23019.429433] ath_led_brightness May 8 06:06:01 (none) kernel: [23019.456088] ath9k_config->ath_led_brightness May 8 06:06:01 (none) kernel: [23019.485466] ath_led_brightness May 8 06:06:01 (none) kernel: [23019.512085] ath9k_config->ath_led_brightness May 8 06:06:01 (none) kernel: [23019.540962] ath_led_brightness May 8 06:06:01 (none) kernel: [23019.568084] ath9k_config->ath_led_brightness May 8 06:06:01 (none) kernel: [23019.596997] ath_led_brightness May 8 06:06:01 (none) kernel: [23019.624109] ath9k_config->ath_led_brightness May 8 06:06:01 (none) kernel: [23019.652952] ath_led_brightness May 8 06:06:01 (none) kernel: [23019.680079] ath9k_config->ath_led_brightness May 8 06:06:01 (none) kernel: [23019.708945] ath_led_brightness May 8 06:06:01 (none) kernel: [23019.736111] ath9k_config->ath_led_brightness May 8 06:06:01 (none) kernel: [23019.765451] ath_led_brightness May 8 06:06:01 (none) kernel: [23019.792084] ath9k_config->ath_led_brightness May 8 06:06:01 (none) kernel: [23019.820943] ath_led_brightness May 8 06:06:01 (none) kernel: [23019.848083] ath9k_config->ath_led_brightness May 8 06:06:01 (none) kernel: [23019.876964] ath_led_brightness May 8 06:06:01 (none) kernel: [23019.904094] ath9k_config->ath9k_config->ath_radio_enable->ath9k_kw_set_gpio, val: 0 May 8 06:06:01 (none) kernel: [23019.913302] idle: disabling radio->ath_radio_disable->ath9k_kw_set_gpio, val: 1
May 8 06:22:28 (none) kernel: [24006.069588] ath_led_brightness May 8 06:22:28 (none) kernel: [24006.069602] LED_FULL led_type: 0 May 8 06:22:28 (none) kernel: [24006.069610] ->ath9k_kw_set_gpio, val: 0 May 8 06:22:28 (none) kernel: [24006.080067] ath9k_config->athok_all_wiphys_idle, num_sec_wiphy: 0 May 8 06:22:28 (none) kernel: [24006.080081] ath_radio_enable->ath9k_kw_set_gpio, val: 0 May 8 06:22:28 (none) kernel: [24006.095711] ADDRCONF(NETDEV_UP): wlan0: link is not ready May 8 06:22:28 (none) dbus-daemon: Rejected send message, 2 matched rules; type="method_return", sender=":1.5" (uid=0 pid=970 comm="/usr/sbin/NetworkManager ") interface="(unset)" member="(unset)" error name="(unset)" requested_reply=0 destination=":1.14" (uid=1000 pid=1061 comm="/usr/lib/network-manager-netbook ")) May 8 06:22:28 (none) kernel: [24006.125662] ath9k_config->athok_all_wiphys_idle, num_sec_wiphy: 0 May 8 06:22:28 (none) kernel: [24006.125675] ath_radio_enable->ath9k_kw_set_gpio, val: 0 May 8 06:22:28 (none) kernel: [24006.260071] ath9k_config->ath_led_brightness May 8 06:22:28 (none) kernel: [24006.292969] ath_led_brightness May 8 06:22:28 (none) kernel: [24006.320081] ath9k_config->ath_led_brightness May 8 06:22:28 (none) kernel: [24006.348977] ath_led_brightness May 8 06:22:28 (none) kernel: [24006.376089] ath9k_config->ath_led_brightness May 8 06:22:28 (none) kernel: [24006.404946] ath_led_brightness May 8 06:22:28 (none) kernel: [24006.432079] ath9k_config->ath_led_brightness May 8 06:22:28 (none) kernel: [24006.461456] ath_led_brightness May 8 06:22:28 (none) kernel: [24006.488088] ath9k_config->ath_led_brightness May 8 06:22:28 (none) kernel: [24006.516953] ath_led_brightness May 8 06:22:28 (none) kernel: [24006.544110] ath9k_config->ath_led_brightness May 8 06:22:28 (none) kernel: [24006.572950] ath_led_brightness May 8 06:22:28 (none) kernel: [24006.600084] ath9k_config->ath_led_brightness May 8 06:22:28 (none) kernel: [24006.628973] ath_led_brightness May 8 06:22:28 (none) kernel: [24006.656079] ath9k_config->ath_led_brightness May 8 06:22:28 (none) kernel: [24006.684972] ath_led_brightness May 8 06:22:28 (none) kernel: [24006.712081] ath9k_config->ath_led_brightness May 8 06:22:28 (none) kernel: [24006.740980] ath_led_brightness May 8 06:22:28 (none) kernel: [24006.768144] ath9k_config->ath_led_brightness May 8 06:22:28 (none) kernel: [24006.796968] ath_led_brightness May 8 06:22:28 (none) kernel: [24006.824098] ath9k_config->ath_led_brightness May 8 06:22:28 (none) kernel: [24006.852952] ath_led_brightness May 8 06:22:28 (none) kernel: [24006.880098] ath9k_config->ath9k_config->ath_radio_enable->ath9k_kw_set_gpio, val: 0