wifi: mt76: mt7921: reduce the size of MCU firmware download Rx queue
authorSean Wang <sean.wang@mediatek.com>
Tue, 21 Nov 2023 22:27:22 +0000 (06:27 +0800)
committerFelix Fietkau <nbd@nbd.name>
Mon, 11 Dec 2023 12:11:52 +0000 (13:11 +0100)
We actually don't need the reserve the 512 entries for the MCU firmware
download Rx queue because the queue was only used in the firmware download
phase to save the most of space and the reduction can significantly help
with reducing latency we spent by ~20% further in resetting the Rx queue
as the device was waking up from deep sleep mode.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h
drivers/net/wireless/mediatek/mt76/mt7921/pci.c

index f28621121927e5c16eab8b4ff72ee4e25ba9c524..fcca93b3e14c52e83ba81926a4f49aaafa1a494f 100644 (file)
@@ -12,7 +12,8 @@
 #define MT7921_TX_FWDL_RING_SIZE       128
 
 #define MT7921_RX_RING_SIZE            1536
-#define MT7921_RX_MCU_RING_SIZE                512
+#define MT7921_RX_MCU_RING_SIZE                8
+#define MT7921_RX_MCU_WA_RING_SIZE     512
 
 #define MT7921_EEPROM_SIZE             3584
 #define MT7921_TOKEN_SIZE              8192
index 6f83c4c5fce26edf72e771a0cf41d737c0630092..9bdaddd310be9053d024f423c4ddb035338f7198 100644 (file)
@@ -200,7 +200,7 @@ static int mt7921_dma_init(struct mt792x_dev *dev)
        /* Change mcu queue after firmware download */
        ret = mt76_queue_alloc(dev, &dev->mt76.q_rx[MT_RXQ_MCU_WA],
                               MT7921_RXQ_MCU_WM,
-                              MT7921_RX_MCU_RING_SIZE,
+                              MT7921_RX_MCU_WA_RING_SIZE,
                               MT_RX_BUF_SIZE, MT_WFDMA0(0x540));
        if (ret)
                return ret;