summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mediatek/mt76/mt7921/sdio.c
diff options
context:
space:
mode:
authorSean Wang <sean.wang@mediatek.com>2022-01-15 07:56:32 +0800
committerFelix Fietkau <nbd@nbd.name>2022-02-03 13:58:00 +0100
commitbf08d58543415f5e31a0e7a6401abcdd76826847 (patch)
tree493320e057ecfd1a2fd1d63a77ce643861e742bf /drivers/net/wireless/mediatek/mt76/mt7921/sdio.c
parentc41d2a075206fcbdc89695b874a6ac06160b4f1a (diff)
mt76: sdio: honor the largest Tx buffer the hardware can support
We don't have to create a separate sdio.xmit_buf buffer for each queue. Instead, we just need to create one, reuse it across all queues to reduce memory consumption further. And then we should take it into account the actual the host and the device MMC capability to determine what the appropriate xmit_buf_size can be. Both MT7921S and MT7663 can support up to Tx FIFO size of 0x3fe00 which means the device can receive 511 blocks of block size 512 in a row from the host. So if the driver aggregates the frames as many as possible the the device can support, we can merge multiple MMC requests into a single one to get rid of the overhead of the handling and synchronizing in those unnecessary MMC requests and reduce the SDIO lock contention with the Bluetooth concurrent traffic and finally to have the higher bus utilization with less idle cycle. With the patch, it is helpful for WiFi to have steady throughput performance especially while running Bluetooth concurrently. Co-developed-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Acked-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt7921/sdio.c')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7921/sdio.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/sdio.c b/drivers/net/wireless/mediatek/mt76/mt7921/sdio.c
index 743b63f66efa..a6ae29c97e0e 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/sdio.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/sdio.c
@@ -121,7 +121,7 @@ static int mt7921s_probe(struct sdio_func *func,
struct mt7921_dev *dev;
struct mt76_dev *mdev;
- int ret, i;
+ int ret;
mdev = mt76_alloc_device(&func->dev, sizeof(*dev), &mt7921_ops,
&drv_ops);
@@ -154,16 +154,6 @@ static int mt7921s_probe(struct sdio_func *func,
goto error;
}
- for (i = 0; i < ARRAY_SIZE(mdev->sdio.xmit_buf); i++) {
- mdev->sdio.xmit_buf[i] = devm_kmalloc(mdev->dev,
- MT76S_XMIT_BUF_SZ,
- GFP_KERNEL);
- if (!mdev->sdio.xmit_buf[i]) {
- ret = -ENOMEM;
- goto error;
- }
- }
-
ret = mt76s_alloc_rx_queue(mdev, MT_RXQ_MAIN);
if (ret)
goto error;