From: Sujith Manoharan <sujith@msujith.org>
To: ath9k-devel@lists.ath9k.org
Subject: [ath9k-devel] [PATCH] ath10k: Fix PCI probe
Date: Mon, 22 Apr 2013 16:51:38 +0530 [thread overview]
Message-ID: <1366629698-12754-1-git-send-email-sujith@msujith.org> (raw)
From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
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.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/pci.c | 12 +++---------
drivers/net/wireless/ath/ath10k/pci.h | 16 ++++++++++++++--
2 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index e75b36b..dbe9fe4 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -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);
diff --git a/drivers/net/wireless/ath/ath10k/pci.h b/drivers/net/wireless/ath/ath10k/pci.h
index a3b5e88..fd2cd71 100644
--- a/drivers/net/wireless/ath/ath10k/pci.h
+++ b/drivers/net/wireless/ath/ath10k/pci.h
@@ -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_ */
--
1.8.2.1
next reply other threads:[~2013-04-22 11:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-22 11:21 Sujith Manoharan [this message]
2013-04-23 4:34 ` [ath9k-devel] [PATCH] ath10k: Fix PCI probe Kalle Valo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1366629698-12754-1-git-send-email-sujith@msujith.org \
--to=sujith@msujith.org \
--cc=ath9k-devel@lists.ath9k.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox