[openwrt/openwrt] kernel: generic: tg3: Fix DMA allocations on 57766 devices

LEDE Commits lede-commits at lists.infradead.org
Sun Dec 15 15:54:46 PST 2024


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/a3c484c3b9468a7bd9190b0fee027bb133cee3d5

commit a3c484c3b9468a7bd9190b0fee027bb133cee3d5
Author: John Audia <therealgraysky at proton.me>
AuthorDate: Sun Dec 15 09:30:52 2024 -0500

    kernel: generic: tg3: Fix DMA allocations on 57766 devices
    
    At the request of rsalvaterra, add this patch to fix an issue
    affecting tg3 ethernet interfaces[1].
    
    1. https://github.com/openwrt/openwrt/pull/17271#issuecomment-2543836518
    
    Tested-by: Rui Salvaterra <rsalvaterra at gmail.com>
    Signed-off-by: John Audia <therealgraysky at proton.me>
    Link: https://github.com/openwrt/openwrt/pull/17282
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 ...-tg3-Fix-DMA-allocations-on-57766-devices.patch | 31 ++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/target/linux/generic/pending-6.6/791-tg3-Fix-DMA-allocations-on-57766-devices.patch b/target/linux/generic/pending-6.6/791-tg3-Fix-DMA-allocations-on-57766-devices.patch
new file mode 100644
index 0000000000..a90d77c9f0
--- /dev/null
+++ b/target/linux/generic/pending-6.6/791-tg3-Fix-DMA-allocations-on-57766-devices.patch
@@ -0,0 +1,31 @@
+From f992b15965177e2f280fb6f41f292214f9a6f8d5 Mon Sep 17 00:00:00 2001
+From: Pavan Chebbi <pavan.chebbi at broadcom.com>
+Date: Tue, 10 Dec 2024 03:28:31 -0800
+Subject: [PATCH] tg3: Fix DMA allocations on 57766 devices
+
+The coherent DMA mask of 31b may not be accepted if
+the DMA mask is configured to use higher memories of
+64b. Set the DMA mask also to lower 32b for 57766
+devices.
+
+Fixes: 614f4d166eee ("tg3: Set coherent DMA mask bits to 31 for BCM57766 chipsets")
+Reported-By: Rui Salvaterra <rsalvaterra at gmail.com>
+Signed-off-by: Pavan Chebbi <pavan.chebbi at broadcom.com>
+---
+ drivers/net/ethernet/broadcom/tg3.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/broadcom/tg3.c
++++ b/drivers/net/ethernet/broadcom/tg3.c
+@@ -17731,8 +17731,10 @@ static int tg3_init_one(struct pci_dev *
+ 	} else
+ 		persist_dma_mask = dma_mask = DMA_BIT_MASK(64);
+ 
+-	if (tg3_asic_rev(tp) == ASIC_REV_57766)
++	if (tg3_asic_rev(tp) == ASIC_REV_57766) {
++		dma_mask = DMA_BIT_MASK(32);
+ 		persist_dma_mask = DMA_BIT_MASK(31);
++	}
+ 
+ 	/* Configure DMA attributes. */
+ 	if (dma_mask > DMA_BIT_MASK(32)) {




More information about the lede-commits mailing list