From: Sean Wang <sean.wang@xxxxxxxxxxxx> <snip> >> @@ -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 > >Regards, >Lorenzo > >> + >> 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 >> --- a/drivers/net/wireless/mediatek/mt76/sdio_txrx.c >> +++ b/drivers/net/wireless/mediatek/mt76/sdio_txrx.c >> @@ -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 >> >