blob: 7bfef4badfd1b7c55d031c0911e9f26ac193cd8c [file] [log] [blame]
developer1f55fcf2024-10-17 14:52:33 +08001From d85a2fe1480dfb60ca5a34afea1efdc2ca104bd5 Mon Sep 17 00:00:00 2001
developer66e89bc2024-04-23 14:50:01 +08002From: "sujuan.chen" <sujuan.chen@mediatek.com>
3Date: Thu, 20 Jul 2023 10:25:50 +0800
developer1f55fcf2024-10-17 14:52:33 +08004Subject: [PATCH 057/193] mtk: mt76: mt7996: add dma mask limitation
developer66e89bc2024-04-23 14:50:01 +08005
6Signed-off-by: sujuan.chen <sujuan.chen@mediatek.com>
7---
8 dma.c | 4 ++--
9 wed.c | 4 ++--
10 2 files changed, 4 insertions(+), 4 deletions(-)
11
12diff --git a/dma.c b/dma.c
developer1f55fcf2024-10-17 14:52:33 +080013index 1021b3e..da21f64 100644
developer66e89bc2024-04-23 14:50:01 +080014--- a/dma.c
15+++ b/dma.c
16@@ -488,7 +488,7 @@ mt76_dma_get_buf(struct mt76_dev *dev, struct mt76_queue *q, int idx,
17 } else {
18 struct mt76_queue_buf qbuf;
19
20- buf = page_frag_alloc(&q->rx_page, q->buf_size, GFP_ATOMIC);
21+ buf = page_frag_alloc(&q->rx_page, q->buf_size, GFP_ATOMIC | GFP_DMA32);
22 if (!buf)
23 return NULL;
24
25@@ -711,7 +711,7 @@ int mt76_dma_rx_fill(struct mt76_dev *dev, struct mt76_queue *q,
26 if (mt76_queue_is_wed_rro_ind(q))
27 goto done;
28
29- buf = page_frag_alloc(&q->rx_page, q->buf_size, GFP_ATOMIC);
30+ buf = page_frag_alloc(&q->rx_page, q->buf_size, GFP_ATOMIC | GFP_DMA32);
31 if (!buf)
32 break;
33
34diff --git a/wed.c b/wed.c
developer1f55fcf2024-10-17 14:52:33 +080035index 0a0b5c0..1c6d53c 100644
developer66e89bc2024-04-23 14:50:01 +080036--- a/wed.c
37+++ b/wed.c
38@@ -65,14 +65,14 @@ u32 mt76_wed_init_rx_buf(struct mtk_wed_device *wed, int size)
39 for (i = 0; i < size; i++) {
40 struct mt76_rxwi_cache *r = mt76_get_rxwi(dev);
41 dma_addr_t addr;
42- struct page *page;
43 int token;
44 void *ptr;
45
46 if (!r)
47 goto unmap;
48
49- ptr = page_frag_alloc(&wed->rx_buf_ring.rx_page, length, GFP_ATOMIC);
50+ ptr = page_frag_alloc(&wed->rx_buf_ring.rx_page, length,
51+ GFP_ATOMIC | GFP_DMA32);
52 if (!ptr) {
53 mt76_put_rxwi(dev, r);
54 goto unmap;
55--
developerd0c89452024-10-11 16:53:27 +0800562.45.2
developer66e89bc2024-04-23 14:50:01 +080057