
[mac80211] ca5ee6e mac80211: Fix potential endless loop 2c14710 mac80211: add more AQL fixes/improvements 91fb3ce mac80211: remove an obsolete patch that is no longer doing anything useful acf1733 mac80211: add preliminary support for enabling 802.11ax in config d717343 mac80211: update encap offload patches to the latest version 673062f mac80211: allow bigger A-MSDU sizes in VHT, even if HT is limited caf7277 mac80211: do not allow bigger VHT MPDUs than the hardware supports cd36c0d mac80211: select the first available channel for 5GHz interfaces 1c6d456 mac80211: fix regression in station connection monitor optimization 4bd7689 mac80211: update sta connection monitor regression fix [target] Sync: at91, ath25, ath79, lantiq, mediatek, mvebu.
45 lines
1.2 KiB
Diff
45 lines
1.2 KiB
Diff
From: Felix Fietkau <nbd@nbd.name>
|
|
Date: Thu, 27 Aug 2020 09:44:43 +0200
|
|
Subject: [PATCH] net: ethernet: mtk_eth_soc: unmap rx data before calling
|
|
build_skb
|
|
|
|
Since build_skb accesses the data area (for initializing shinfo), dma unmap
|
|
needs to happen before that call
|
|
|
|
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
---
|
|
|
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
|
@@ -1293,17 +1293,18 @@ static int mtk_poll_rx(struct napi_struc
|
|
goto release_desc;
|
|
}
|
|
|
|
+ dma_unmap_single(eth->dev, trxd.rxd1,
|
|
+ ring->buf_size, DMA_FROM_DEVICE);
|
|
+
|
|
/* receive data */
|
|
skb = build_skb(data, ring->frag_size);
|
|
if (unlikely(!skb)) {
|
|
- skb_free_frag(new_data);
|
|
+ skb_free_frag(data);
|
|
netdev->stats.rx_dropped++;
|
|
- goto release_desc;
|
|
+ goto skip_rx;
|
|
}
|
|
skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN);
|
|
|
|
- dma_unmap_single(eth->dev, trxd.rxd1,
|
|
- ring->buf_size, DMA_FROM_DEVICE);
|
|
pktlen = RX_DMA_GET_PLEN0(trxd.rxd2);
|
|
skb->dev = netdev;
|
|
skb_put(skb, pktlen);
|
|
@@ -1321,6 +1322,7 @@ static int mtk_poll_rx(struct napi_struc
|
|
skb_record_rx_queue(skb, 0);
|
|
napi_gro_receive(napi, skb);
|
|
|
|
+skip_rx:
|
|
ring->data[idx] = new_data;
|
|
rxd->rxd1 = (unsigned int)dma_addr;
|
|
|