Skip to contentSkip to conversation

ath10k: Fix PCI probe

PATCH New Sujith Manoharan 2 participants 2 messages Apr 22, 2013 – Apr 23, 2013 Qualcomm Atheros ATH10K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath10k: Fix PCI probe

From: Sujith Manoharan <[email protected]>

The target should always be woken up when the device is being probed and this shouldn't depend on the module parameter "ath10k_target_ps", which is used to enable target PowerSave.

---
 drivers/net/wireless/ath/ath10k/pci.c | 12 +++---------
 drivers/net/wireless/ath/ath10k/pci.h | 16 ++++++++++++++--
 2 files changed, 17 insertions(+), 11 deletions(-)
drivers/net/wireless/ath/ath10k/pci.c +3 -9
index e75b36b..dbe9fe4 100644
@@ -442,7 +442,7 @@ static void ath10k_pci_wait_for_target_to_awake(struct ath10k *ar)
 		ath10k_warn("Unable to wakeup target\n");
 }
 
-void ath10k_pci_wake(struct ath10k *ar)
+void ath10k_do_pci_wake(struct ath10k *ar)
 {
 	struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
 	void __iomem *pci_addr = ar_pci->mem;
@@ -450,9 +450,6 @@ void ath10k_pci_wake(struct ath10k *ar)
 	int tot_delay = 0;
 	int curr_delay = 5;
 
-	if (!ath10k_target_ps)
-		return;
-
 	if (atomic_read(&ar_pci->keep_awake_count) == 0) {
 		/* Force AWAKE */
 		iowrite32(PCIE_SOC_WAKE_V_MASK_T(ar),
@@ -483,14 +480,11 @@ void ath10k_pci_wake(struct ath10k *ar)
 		max_delay = tot_delay;
 }
 
-void ath10k_pci_sleep(struct ath10k *ar)
+void ath10k_do_pci_sleep(struct ath10k *ar)
 {
 	struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
 	void __iomem *pci_addr = ar_pci->mem;
 
-	if (!ath10k_target_ps)
-		return;
-
 	if (atomic_dec_and_test(&ar_pci->keep_awake_count)) {
 		/* Allow sleep */
 		ar_pci->verified_awake = false;
@@ -1688,7 +1682,7 @@ static int ath10k_pci_probe_device(struct ath10k *ar)
 	else {
 		/* Force AWAKE forever */
 		ath10k_dbg(ATH10K_DBG_PCI, "on-chip power save disabled\n");
-		ath10k_pci_wake(ar);
+		ath10k_do_pci_wake(ar);
 	}
 
 	ath10k_pci_ce_init(ar);
drivers/net/wireless/ath/ath10k/pci.h +14 -2
index a3b5e88..fd2cd71 100644
@@ -355,7 +355,19 @@ static inline void WAR_CE_SRC_RING_WRITE_IDX_SET(struct ath10k *ar,
 
 extern unsigned int ath10k_target_ps;
 
-void ath10k_pci_wake(struct ath10k *ar);
-void ath10k_pci_sleep(struct ath10k *ar);
+void ath10k_do_pci_wake(struct ath10k *ar);
+void ath10k_do_pci_sleep(struct ath10k *ar);
+
+static inline void ath10k_pci_wake(struct ath10k *ar)
+{
+	if (ath10k_target_ps)
+		ath10k_do_pci_wake(ar);
+}
+
+static inline void ath10k_pci_sleep(struct ath10k *ar)
+{
+	if (ath10k_target_ps)
+		ath10k_do_pci_sleep(ar);
+}
 
 #endif /* _PCI_H_ */
Signature · 1 line
1.8.2.1
Applied
#1 lore raw

PATCH 1/1 ath10k: Fix PCI probe

Quoted 8 lines · Sujith Manoharan

From: Sujith Manoharan <[email protected]>

The target should always be woken up when the device is being probed and this shouldn't depend on the module parameter "ath10k_target_ps", which is used to enable target PowerSave.

Thanks, applied.

Signature · 1 line
Kalle Valo