linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH wireless-drivers] mt76: mt7663s: fix rx buffer refcounting
@ 2021-01-14 17:26 Lorenzo Bianconi
  2021-01-15  7:08 ` Kalle Valo
  2021-01-18 15:23 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Lorenzo Bianconi @ 2021-01-14 17:26 UTC (permalink / raw)
  To: linux-wireless; +Cc: lorenzo.bianconi, kuba, nbd, sean.wang

Similar to mt7601u driver, fix erroneous rx page refcounting

Fixes: a66cbdd6573d ("mt76: mt7615: introduce mt7663s support")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c b/drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c
index 13d77f8fca86..9fb506f2ace6 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c
@@ -83,7 +83,7 @@ static int mt7663s_rx_run_queue(struct mt76_dev *dev, enum mt76_rxq_id qid,
 {
 	struct mt76_queue *q = &dev->q_rx[qid];
 	struct mt76_sdio *sdio = &dev->sdio;
-	int len = 0, err, i, order;
+	int len = 0, err, i;
 	struct page *page;
 	u8 *buf;
 
@@ -96,8 +96,7 @@ static int mt7663s_rx_run_queue(struct mt76_dev *dev, enum mt76_rxq_id qid,
 	if (len > sdio->func->cur_blksize)
 		len = roundup(len, sdio->func->cur_blksize);
 
-	order = get_order(len);
-	page = __dev_alloc_pages(GFP_KERNEL, order);
+	page = __dev_alloc_pages(GFP_KERNEL, get_order(len));
 	if (!page)
 		return -ENOMEM;
 
@@ -106,7 +105,7 @@ static int mt7663s_rx_run_queue(struct mt76_dev *dev, enum mt76_rxq_id qid,
 	err = sdio_readsb(sdio->func, buf, MCR_WRDR(qid), len);
 	if (err < 0) {
 		dev_err(dev->dev, "sdio read data failed:%d\n", err);
-		__free_pages(page, order);
+		put_page(page);
 		return err;
 	}
 
@@ -123,7 +122,7 @@ static int mt7663s_rx_run_queue(struct mt76_dev *dev, enum mt76_rxq_id qid,
 		if (q->queued + i + 1 == q->ndesc)
 			break;
 	}
-	__free_pages(page, order);
+	put_page(page);
 
 	spin_lock_bh(&q->lock);
 	q->head = (q->head + i) % q->ndesc;
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH wireless-drivers] mt76: mt7663s: fix rx buffer refcounting
  2021-01-14 17:26 [PATCH wireless-drivers] mt76: mt7663s: fix rx buffer refcounting Lorenzo Bianconi
@ 2021-01-15  7:08 ` Kalle Valo
  2021-01-18 15:23 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2021-01-15  7:08 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: linux-wireless, lorenzo.bianconi, kuba, nbd, sean.wang

Lorenzo Bianconi <lorenzo@kernel.org> writes:

> Similar to mt7601u driver, fix erroneous rx page refcounting
>
> Fixes: a66cbdd6573d ("mt76: mt7615: introduce mt7663s support")
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>

I'll queue this to v5.11 and assigned to me on patchwork.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH wireless-drivers] mt76: mt7663s: fix rx buffer refcounting
  2021-01-14 17:26 [PATCH wireless-drivers] mt76: mt7663s: fix rx buffer refcounting Lorenzo Bianconi
  2021-01-15  7:08 ` Kalle Valo
@ 2021-01-18 15:23 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2021-01-18 15:23 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: linux-wireless, lorenzo.bianconi, kuba, nbd, sean.wang

Lorenzo Bianconi <lorenzo@kernel.org> wrote:

> Similar to mt7601u driver, fix erroneous rx page refcounting
> 
> Fixes: a66cbdd6573d ("mt76: mt7615: introduce mt7663s support")
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>

Patch applied to wireless-drivers.git, thanks.

952de419b617 mt76: mt7663s: fix rx buffer refcounting

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/dca19c9d445156201bc41f7cbb6e894bbc9a678c.1610644945.git.lorenzo@kernel.org/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-18 15:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-14 17:26 [PATCH wireless-drivers] mt76: mt7663s: fix rx buffer refcounting Lorenzo Bianconi
2021-01-15  7:08 ` Kalle Valo
2021-01-18 15:23 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).