* [PATCH 1/2] ath10k: wake up device before accessing registers @ 2015-12-10 9:44 ` Rajkumar Manoharan 0 siblings, 0 replies; 6+ messages in thread From: Rajkumar Manoharan @ 2015-12-10 9:44 UTC (permalink / raw) To: ath10k; +Cc: linux-wireless, Rajkumar Manoharan commit 1aaf8efba0ae ("ath10k: disable PCI PS for QCA988X and QCA99X0") partially reverts pci soc powersave support added by commit 77258d409ce4 ("ath10k: enable pci soc powersaving"). While reverting the change, pci wake up function is called after accessing pci registers instead of prior to access. The assumption is that chip is woken up before accessing its registers.Though this change does not fix any known issues, this might help to avoid unknown or low power platform specific issues. Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> --- drivers/net/wireless/ath/ath10k/pci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index 202c775..473a141 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -3071,9 +3071,6 @@ static int ath10k_pci_probe(struct pci_dev *pdev, goto err_sleep; } - ath10k_pci_ce_deinit(ar); - ath10k_pci_irq_disable(ar); - if (ar_pci->pci_ps == 0) { ret = ath10k_pci_force_wake(ar); if (ret) { @@ -3082,6 +3079,9 @@ static int ath10k_pci_probe(struct pci_dev *pdev, } } + ath10k_pci_ce_deinit(ar); + ath10k_pci_irq_disable(ar); + ret = ath10k_pci_init_irq(ar); if (ret) { ath10k_err(ar, "failed to init irqs: %d\n", ret); -- 2.6.3 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 1/2] ath10k: wake up device before accessing registers @ 2015-12-10 9:44 ` Rajkumar Manoharan 0 siblings, 0 replies; 6+ messages in thread From: Rajkumar Manoharan @ 2015-12-10 9:44 UTC (permalink / raw) To: ath10k; +Cc: linux-wireless, Rajkumar Manoharan commit 1aaf8efba0ae ("ath10k: disable PCI PS for QCA988X and QCA99X0") partially reverts pci soc powersave support added by commit 77258d409ce4 ("ath10k: enable pci soc powersaving"). While reverting the change, pci wake up function is called after accessing pci registers instead of prior to access. The assumption is that chip is woken up before accessing its registers.Though this change does not fix any known issues, this might help to avoid unknown or low power platform specific issues. Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> --- drivers/net/wireless/ath/ath10k/pci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index 202c775..473a141 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -3071,9 +3071,6 @@ static int ath10k_pci_probe(struct pci_dev *pdev, goto err_sleep; } - ath10k_pci_ce_deinit(ar); - ath10k_pci_irq_disable(ar); - if (ar_pci->pci_ps == 0) { ret = ath10k_pci_force_wake(ar); if (ret) { @@ -3082,6 +3079,9 @@ static int ath10k_pci_probe(struct pci_dev *pdev, } } + ath10k_pci_ce_deinit(ar); + ath10k_pci_irq_disable(ar); + ret = ath10k_pci_init_irq(ar); if (ret) { ath10k_err(ar, "failed to init irqs: %d\n", ret); -- 2.6.3 _______________________________________________ ath10k mailing list ath10k@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath10k ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] ath10k: reduce indentation by moving powersave check within function 2015-12-10 9:44 ` Rajkumar Manoharan @ 2015-12-10 9:44 ` Rajkumar Manoharan -1 siblings, 0 replies; 6+ messages in thread From: Rajkumar Manoharan @ 2015-12-10 9:44 UTC (permalink / raw) To: ath10k; +Cc: linux-wireless, Rajkumar Manoharan For devices that does not support PCI power save, force wake up API is used. So move powersave check inside force wakeup to reduce one level indentation. Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> --- drivers/net/wireless/ath/ath10k/pci.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index 473a141..c6aaad2 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -487,6 +487,9 @@ static int ath10k_pci_force_wake(struct ath10k *ar) unsigned long flags; int ret = 0; + if (ar_pci->pci_ps) + return ret; + spin_lock_irqsave(&ar_pci->ps_lock, flags); if (!ar_pci->ps_awake) { @@ -2480,12 +2483,10 @@ static int ath10k_pci_hif_resume(struct ath10k *ar) u32 val; int ret = 0; - if (ar_pci->pci_ps == 0) { - ret = ath10k_pci_force_wake(ar); - if (ret) { - ath10k_err(ar, "failed to wake up target: %d\n", ret); - return ret; - } + ret = ath10k_pci_force_wake(ar); + if (ret) { + ath10k_err(ar, "failed to wake up target: %d\n", ret); + return ret; } /* Suspend/Resume resets the PCI configuration space, so we have to @@ -2592,13 +2593,10 @@ static irqreturn_t ath10k_pci_interrupt_handler(int irq, void *arg) struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); int ret; - if (ar_pci->pci_ps == 0) { - ret = ath10k_pci_force_wake(ar); - if (ret) { - ath10k_warn(ar, "failed to wake device up on irq: %d\n", - ret); - return IRQ_NONE; - } + ret = ath10k_pci_force_wake(ar); + if (ret) { + ath10k_warn(ar, "failed to wake device up on irq: %d\n", ret); + return IRQ_NONE; } if (ar_pci->num_msi_intrs == 0) { @@ -3071,12 +3069,10 @@ static int ath10k_pci_probe(struct pci_dev *pdev, goto err_sleep; } - if (ar_pci->pci_ps == 0) { - ret = ath10k_pci_force_wake(ar); - if (ret) { - ath10k_warn(ar, "failed to wake up device : %d\n", ret); - goto err_free_pipes; - } + ret = ath10k_pci_force_wake(ar); + if (ret) { + ath10k_warn(ar, "failed to wake up device : %d\n", ret); + goto err_free_pipes; } ath10k_pci_ce_deinit(ar); -- 2.6.3 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] ath10k: reduce indentation by moving powersave check within function @ 2015-12-10 9:44 ` Rajkumar Manoharan 0 siblings, 0 replies; 6+ messages in thread From: Rajkumar Manoharan @ 2015-12-10 9:44 UTC (permalink / raw) To: ath10k; +Cc: linux-wireless, Rajkumar Manoharan For devices that does not support PCI power save, force wake up API is used. So move powersave check inside force wakeup to reduce one level indentation. Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> --- drivers/net/wireless/ath/ath10k/pci.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index 473a141..c6aaad2 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -487,6 +487,9 @@ static int ath10k_pci_force_wake(struct ath10k *ar) unsigned long flags; int ret = 0; + if (ar_pci->pci_ps) + return ret; + spin_lock_irqsave(&ar_pci->ps_lock, flags); if (!ar_pci->ps_awake) { @@ -2480,12 +2483,10 @@ static int ath10k_pci_hif_resume(struct ath10k *ar) u32 val; int ret = 0; - if (ar_pci->pci_ps == 0) { - ret = ath10k_pci_force_wake(ar); - if (ret) { - ath10k_err(ar, "failed to wake up target: %d\n", ret); - return ret; - } + ret = ath10k_pci_force_wake(ar); + if (ret) { + ath10k_err(ar, "failed to wake up target: %d\n", ret); + return ret; } /* Suspend/Resume resets the PCI configuration space, so we have to @@ -2592,13 +2593,10 @@ static irqreturn_t ath10k_pci_interrupt_handler(int irq, void *arg) struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); int ret; - if (ar_pci->pci_ps == 0) { - ret = ath10k_pci_force_wake(ar); - if (ret) { - ath10k_warn(ar, "failed to wake device up on irq: %d\n", - ret); - return IRQ_NONE; - } + ret = ath10k_pci_force_wake(ar); + if (ret) { + ath10k_warn(ar, "failed to wake device up on irq: %d\n", ret); + return IRQ_NONE; } if (ar_pci->num_msi_intrs == 0) { @@ -3071,12 +3069,10 @@ static int ath10k_pci_probe(struct pci_dev *pdev, goto err_sleep; } - if (ar_pci->pci_ps == 0) { - ret = ath10k_pci_force_wake(ar); - if (ret) { - ath10k_warn(ar, "failed to wake up device : %d\n", ret); - goto err_free_pipes; - } + ret = ath10k_pci_force_wake(ar); + if (ret) { + ath10k_warn(ar, "failed to wake up device : %d\n", ret); + goto err_free_pipes; } ath10k_pci_ce_deinit(ar); -- 2.6.3 _______________________________________________ ath10k mailing list ath10k@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath10k ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] ath10k: wake up device before accessing registers 2015-12-10 9:44 ` Rajkumar Manoharan @ 2015-12-31 13:14 ` Kalle Valo -1 siblings, 0 replies; 6+ messages in thread From: Kalle Valo @ 2015-12-31 13:14 UTC (permalink / raw) To: Rajkumar Manoharan; +Cc: ath10k, linux-wireless Rajkumar Manoharan <rmanohar@qti.qualcomm.com> writes: > commit 1aaf8efba0ae ("ath10k: disable PCI PS for QCA988X > and QCA99X0") partially reverts pci soc powersave support added by > commit 77258d409ce4 ("ath10k: enable pci soc powersaving"). While > reverting the change, pci wake up function is called after accessing > pci registers instead of prior to access. The assumption is that chip > is woken up before accessing its registers.Though this change does not > fix any known issues, this might help to avoid unknown or low power > platform specific issues. > > Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Both patches applied, thanks. -- Kalle Valo ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] ath10k: wake up device before accessing registers @ 2015-12-31 13:14 ` Kalle Valo 0 siblings, 0 replies; 6+ messages in thread From: Kalle Valo @ 2015-12-31 13:14 UTC (permalink / raw) To: Rajkumar Manoharan; +Cc: linux-wireless, ath10k Rajkumar Manoharan <rmanohar@qti.qualcomm.com> writes: > commit 1aaf8efba0ae ("ath10k: disable PCI PS for QCA988X > and QCA99X0") partially reverts pci soc powersave support added by > commit 77258d409ce4 ("ath10k: enable pci soc powersaving"). While > reverting the change, pci wake up function is called after accessing > pci registers instead of prior to access. The assumption is that chip > is woken up before accessing its registers.Though this change does not > fix any known issues, this might help to avoid unknown or low power > platform specific issues. > > Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Both patches applied, thanks. -- Kalle Valo _______________________________________________ ath10k mailing list ath10k@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath10k ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-12-31 13:15 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2015-12-10 9:44 [PATCH 1/2] ath10k: wake up device before accessing registers Rajkumar Manoharan 2015-12-10 9:44 ` Rajkumar Manoharan 2015-12-10 9:44 ` [PATCH 2/2] ath10k: reduce indentation by moving powersave check within function Rajkumar Manoharan 2015-12-10 9:44 ` Rajkumar Manoharan 2015-12-31 13:14 ` [PATCH 1/2] ath10k: wake up device before accessing registers Kalle Valo 2015-12-31 13:14 ` Kalle Valo
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.