[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211218235404.3963475-20-davidm@egauge.net>
Date: Sat, 18 Dec 2021 23:54:17 +0000 (UTC)
From: David Mosberger-Tang <davidm@...uge.net>
To: Ajay Singh <ajay.kathat@...rochip.com>
Cc: Claudiu Beznea <claudiu.beznea@...rochip.com>,
Kalle Valo <kvalo@...eaurora.org>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
David Mosberger-Tang <davidm@...uge.net>
Subject: [PATCH 19/23] wilc1000: don't tell the chip to go to sleep while
copying tx packets
Putting the chip to sleep and waking it up again is relatively slow,
so there is no point to put the chip to sleep for the short time it
takes to copy a couple of packets.
Signed-off-by: David Mosberger-Tang <davidm@...uge.net>
---
.../net/wireless/microchip/wilc1000/wlan.c | 24 +++++++++----------
1 file changed, 11 insertions(+), 13 deletions(-)
diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.c b/drivers/net/wireless/microchip/wilc1000/wlan.c
index b7c8ff95b646a..8652ec9f6d9c8 100644
--- a/drivers/net/wireless/microchip/wilc1000/wlan.c
+++ b/drivers/net/wireless/microchip/wilc1000/wlan.c
@@ -920,29 +920,27 @@ int wilc_wlan_handle_txq(struct wilc *wilc, u32 *txq_count)
acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP);
ret = send_vmm_table(wilc, i, vmm_table);
+ if (ret <= 0) {
+ if (ret == 0)
+ /* No VMM space available in firmware. Inform
+ * caller to retry later.
+ */
+ ret = WILC_VMM_ENTRY_FULL_RETRY;
+ goto out_release_bus;
+ }
- release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP);
-
- if (ret < 0)
- goto out_unlock;
+ release_bus(wilc, WILC_BUS_RELEASE_ONLY);
entries = ret;
- if (entries == 0) {
- /* No VMM space available in firmware. Inform caller
- * to retry later.
- */
- ret = WILC_VMM_ENTRY_FULL_RETRY;
- goto out_unlock;
- }
-
len = copy_packets(wilc, entries, vmm_table, vmm_entries_ac);
if (len <= 0)
goto out_unlock;
- acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP);
+ acquire_bus(wilc, WILC_BUS_ACQUIRE_ONLY);
ret = send_packets(wilc, len);
+out_release_bus:
release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP);
out_unlock:
--
2.25.1
Powered by blists - more mailing lists