Skip to contentSkip to conversation

mt76: sdio: honor the largest Tx buffer the hardware can support

PATCH [email protected] 1 participant 1 message Jan 13, 2022 1 message not in the archive Arm MediaTek

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

From: Sean Wang <[email protected]>

<snip>

Quoted 13 lines

Review int mt76s_hw_init(struct mt76_dev *dev, struct · line 310

Quoted 11 lines
(quoted diff) +8 -0
@@ -299,6 +301,17 @@ int mt76s_hw_init(struct mt76_dev *dev, struct
 sdio_func *func, int hw_ver)  }  EXPORT_SYMBOL_GPL(mt76s_hw_init);
 
+u32 mt76s_get_xmit_buf_sz(struct mt76_dev *dev, u32 dev_max_len) {
+	struct sdio_func *func = dev->sdio.func;
+	u32 host_max_len = min_t(u32, func->card->host->max_req_size,
+				 func->cur_blksize *
+				 func->card->host->max_blk_count);
+
+	return min_t(u32, host_max_len, dev_max_len); }
+EXPORT_SYMBOL_GPL(mt76s_get_xmit_buf_sz);

I think we can squash this patch with the previous one and move the code above in mt76s_init(). Agree?

these comments you have in the patchset all look fine to me, I will post v2 soon.

Sean

Quoted 26 lines

Regards,
Lorenzo

Quoted 21 lines
(quoted diff) +1 -0
+
 int mt76s_alloc_rx_queue(struct mt76_dev *dev, enum mt76_rxq_id qid)
 {
 	struct mt76_queue *q = &dev->q_rx[qid]; diff --git

a/drivers/net/wireless/mediatek/mt76/sdio_txrx.c
b/drivers/net/wireless/mediatek/mt76/sdio_txrx.c
index a04cd2444247..9fcf507e09bd 100644

drivers/net/wireless/mediatek/mt76/sdio_txrx.c +1 -2
@@ -254,7 +254,7 @@ static int mt76s_tx_run_queue(struct mt76_dev *dev, struct mt76_queue *q)
 		}
 
 		pad = roundup(e->skb->len, 4) - e->skb->len;
-		if (len + e->skb->len + pad + 4 > MT76S_XMIT_BUF_SZ)
+		if (len + e->skb->len + pad + 4 > dev->sdio.xmit_buf_sz)
 			break;
 
 		if (mt76s_tx_pick_quota(sdio, mcu, e->buf_sz, &pse_sz,
--

2.25.1