linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath10k: Replace ioread with wmb for data sync
@ 2015-01-26 22:25 Peter Oh
  2015-01-27 21:33 ` Bob Copeland
  0 siblings, 1 reply; 23+ messages in thread
From: Peter Oh @ 2015-01-26 22:25 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless

Using ioread() to perform data sync is excessive.
Use compact API, wmb(), that intended to be used for the case.
It reduces total 14 CPU clocks per interrupt.

Signed-off-by: Peter Oh <poh@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/pci.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 3b40a86..c353a2c 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -346,10 +346,8 @@ static void ath10k_pci_disable_and_clear_legacy_irq(struct ath10k *ar)
 	ath10k_pci_write32(ar, SOC_CORE_BASE_ADDRESS + PCIE_INTR_CLR_ADDRESS,
 			   PCIE_INTR_FIRMWARE_MASK | PCIE_INTR_CE_MASK_ALL);
 
-	/* IMPORTANT: this extra read transaction is required to
-	 * flush the posted write buffer. */
-	(void)ath10k_pci_read32(ar, SOC_CORE_BASE_ADDRESS +
-				PCIE_INTR_ENABLE_ADDRESS);
+	/* invoke data sync barrier */
+	wmb();
 }
 
 static void ath10k_pci_enable_legacy_irq(struct ath10k *ar)
@@ -358,10 +356,8 @@ static void ath10k_pci_enable_legacy_irq(struct ath10k *ar)
 			   PCIE_INTR_ENABLE_ADDRESS,
 			   PCIE_INTR_FIRMWARE_MASK | PCIE_INTR_CE_MASK_ALL);
 
-	/* IMPORTANT: this extra read transaction is required to
-	 * flush the posted write buffer. */
-	(void)ath10k_pci_read32(ar, SOC_CORE_BASE_ADDRESS +
-				PCIE_INTR_ENABLE_ADDRESS);
+	/* invoke data sync barrier */
+	wmb();
 }
 
 static inline const char *ath10k_pci_get_irq_method(struct ath10k *ar)
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2015-02-02 23:50 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-26 22:25 [PATCH] ath10k: Replace ioread with wmb for data sync Peter Oh
2015-01-27 21:33 ` Bob Copeland
2015-01-27 23:53   ` Peter Oh
2015-01-28  4:30     ` Bob Copeland
2015-01-28  5:39       ` Peter Oh
2015-01-28  7:37         ` Johannes Berg
2015-01-30 22:53           ` Peter Oh
2015-01-31  1:16             ` Sujith Manoharan
2015-01-31  1:56               ` Peter Oh
2015-01-31  2:06                 ` Sujith Manoharan
2015-02-02 17:25                   ` Peter Oh
2015-02-02 22:26                   ` Adrian Chadd
2015-02-02 23:04                     ` Peter Oh
2015-02-02 13:02             ` Johannes Berg
2015-02-02 17:33               ` Peter Oh
2015-02-02 18:54                 ` Johannes Berg
2015-02-02 19:15                   ` Peter Oh
2015-02-02 19:22                     ` Johannes Berg
2015-02-02 19:36                       ` Peter Oh
2015-02-02 19:47                         ` Johannes Berg
2015-02-02 22:06                           ` Peter Oh
2015-02-02 23:25                             ` Florian Fainelli
2015-02-02 23:49                               ` Peter Oh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).