]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.19.31/net-marvell-mvneta-fix-dma-debug-warning.patch
Linux 4.19.31
[thirdparty/kernel/stable-queue.git] / releases / 4.19.31 / net-marvell-mvneta-fix-dma-debug-warning.patch
1 From 8df5a476013634a7bb434b1582862d3e24fa81d6 Mon Sep 17 00:00:00 2001
2 From: Russell King <rmk+kernel@armlinux.org.uk>
3 Date: Fri, 15 Feb 2019 13:55:47 +0000
4 Subject: net: marvell: mvneta: fix DMA debug warning
5
6 [ Upstream commit a8fef9ba58c9966ddb1fec916d8d8137c9d8bc89 ]
7
8 Booting 4.20 on SolidRun Clearfog issues this warning with DMA API
9 debug enabled:
10
11 WARNING: CPU: 0 PID: 555 at kernel/dma/debug.c:1230 check_sync+0x514/0x5bc
12 mvneta f1070000.ethernet: DMA-API: device driver tries to sync DMA memory it has not allocated [device address=0x000000002dd7dc00] [size=240 bytes]
13 Modules linked in: ahci mv88e6xxx dsa_core xhci_plat_hcd xhci_hcd devlink armada_thermal marvell_cesa des_generic ehci_orion phy_armada38x_comphy mcp3021 spi_orion evbug sfp mdio_i2c ip_tables x_tables
14 CPU: 0 PID: 555 Comm: bridge-network- Not tainted 4.20.0+ #291
15 Hardware name: Marvell Armada 380/385 (Device Tree)
16 [<c0019638>] (unwind_backtrace) from [<c0014888>] (show_stack+0x10/0x14)
17 [<c0014888>] (show_stack) from [<c07f54e0>] (dump_stack+0x9c/0xd4)
18 [<c07f54e0>] (dump_stack) from [<c00312bc>] (__warn+0xf8/0x124)
19 [<c00312bc>] (__warn) from [<c00313b0>] (warn_slowpath_fmt+0x38/0x48)
20 [<c00313b0>] (warn_slowpath_fmt) from [<c00b0370>] (check_sync+0x514/0x5bc)
21 [<c00b0370>] (check_sync) from [<c00b04f8>] (debug_dma_sync_single_range_for_cpu+0x6c/0x74)
22 [<c00b04f8>] (debug_dma_sync_single_range_for_cpu) from [<c051bd14>] (mvneta_poll+0x298/0xf58)
23 [<c051bd14>] (mvneta_poll) from [<c0656194>] (net_rx_action+0x128/0x424)
24 [<c0656194>] (net_rx_action) from [<c000a230>] (__do_softirq+0xf0/0x540)
25 [<c000a230>] (__do_softirq) from [<c00386e0>] (irq_exit+0x124/0x144)
26 [<c00386e0>] (irq_exit) from [<c009b5e0>] (__handle_domain_irq+0x58/0xb0)
27 [<c009b5e0>] (__handle_domain_irq) from [<c03a63c4>] (gic_handle_irq+0x48/0x98)
28 [<c03a63c4>] (gic_handle_irq) from [<c0009a10>] (__irq_svc+0x70/0x98)
29 ...
30
31 This appears to be caused by mvneta_rx_hwbm() calling
32 dma_sync_single_range_for_cpu() with the wrong struct device pointer,
33 as the buffer manager device pointer is used to map and unmap the
34 buffer. Fix this.
35
36 Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
37 Signed-off-by: David S. Miller <davem@davemloft.net>
38 Signed-off-by: Sasha Levin <sashal@kernel.org>
39 ---
40 drivers/net/ethernet/marvell/mvneta.c | 2 +-
41 1 file changed, 1 insertion(+), 1 deletion(-)
42
43 diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
44 index a78a39244b79..2ba0d89aaf3c 100644
45 --- a/drivers/net/ethernet/marvell/mvneta.c
46 +++ b/drivers/net/ethernet/marvell/mvneta.c
47 @@ -2147,7 +2147,7 @@ err_drop_frame:
48 if (unlikely(!skb))
49 goto err_drop_frame_ret_pool;
50
51 - dma_sync_single_range_for_cpu(dev->dev.parent,
52 + dma_sync_single_range_for_cpu(&pp->bm_priv->pdev->dev,
53 rx_desc->buf_phys_addr,
54 MVNETA_MH_SIZE + NET_SKB_PAD,
55 rx_bytes,
56 --
57 2.19.1
58