Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1474732

[PATCH] ath9k: bring back direction setting in ath9k_{start_stop}

From Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Newsgroups linux.kernel
Subject [PATCH] ath9k: bring back direction setting in ath9k_{start_stop}
Date 2016-09-02 00:00 +0200
Message-ID <scIbE-7ol-45@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


A regression was introduced in commit id 79d4db1214a ("ath9k: cleanup
led_pin initial") that broken the WLAN status led on my laptop with
AR9287 after suspending and resuming.

Steps to reproduce:
* Suspend (laptop)
* Resume (laptop)
* Observe that the WLAN led no longer turns ON/OFF depending on the
  status and is always red

Even though for my case it only needs to be set to OUT in ath9k_start
but for consistency bring back the IN direction setting as well.

Cc: Miaoqing Pan <miaoqing@codeaurora.org>
Cc: Kalle Valo <kvalo@qca.qualcomm.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
---
This patch should be applied to all 4.7 and later kernels

Another user complaining about probably the same problem:
https://bugzilla.kernel.org/show_bug.cgi?id=151711

 drivers/net/wireless/ath/ath9k/main.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 8b63988..121dc05 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -718,9 +718,12 @@ static int ath9k_start(struct ieee80211_hw *hw)
 	if (!ath_complete_reset(sc, false))
 		ah->reset_power_on = false;
 
-	if (ah->led_pin >= 0)
+	if (ah->led_pin >= 0) {
 		ath9k_hw_set_gpio(ah, ah->led_pin,
 				  (ah->config.led_active_high) ? 1 : 0);
+		ath9k_hw_gpio_request_out(ah, ah->led_pin, NULL,
+					  AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
+	}
 
 	/*
 	 * Reset key cache to sane defaults (all entries cleared) instead of
@@ -864,9 +867,11 @@ static void ath9k_stop(struct ieee80211_hw *hw)
 
 	spin_lock_bh(&sc->sc_pcu_lock);
 
-	if (ah->led_pin >= 0)
+	if (ah->led_pin >= 0) {
 		ath9k_hw_set_gpio(ah, ah->led_pin,
 				  (ah->config.led_active_high) ? 0 : 1);
+		ath9k_hw_gpio_request_in(ah, ah->led_pin, NULL);
+	}
 
 	ath_prepare_reset(sc);
 
-- 
2.9.3

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] ath9k: bring back direction setting in ath9k_{start_stop} Giedrius Statkevičius          <giedrius.statkevicius@gmail.com> - 2016-09-02 00:00 +0200
  Re: [PATCH] ath9k: bring back direction setting in ath9k_{start_stop} Giedrius Statkevičius          <giedrius.statkevicius@gmail.com> - 2016-09-03 18:10 +0200
  Re: ath9k: bring back direction setting in ath9k_{start_stop} Kalle Valo <kvalo@qca.qualcomm.com> - 2016-09-03 19:40 +0200
  Re: ath9k: bring back direction setting in ath9k_{start_stop} Kalle Valo <kvalo@qca.qualcomm.com> - 2016-09-07 15:20 +0200
    Re: ath9k: bring back direction setting in ath9k_{start_stop} Kalle Valo <kvalo@codeaurora.org> - 2016-09-07 15:20 +0200
  Re: ath9k: bring back direction setting in ath9k_{start_stop} Kalle Valo <kvalo@qca.qualcomm.com> - 2016-09-07 15:30 +0200

csiph-web