From 1c055e55a242a33e574e48be530e06770a210dcd Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Mon, 19 Feb 2024 03:26:26 +0000
Subject: [PATCH] add r8169 read mac form eeprom

---
 kernel/drivers/dma-buf/heaps/rk_system_heap.c |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/kernel/drivers/dma-buf/heaps/rk_system_heap.c b/kernel/drivers/dma-buf/heaps/rk_system_heap.c
index 2b68c98..52dcfc2 100644
--- a/kernel/drivers/dma-buf/heaps/rk_system_heap.c
+++ b/kernel/drivers/dma-buf/heaps/rk_system_heap.c
@@ -58,12 +58,11 @@
 	bool uncached;
 };
 
-#define LOW_ORDER_GFP (GFP_HIGHUSER | __GFP_ZERO | __GFP_COMP)
-#define MID_ORDER_GFP (LOW_ORDER_GFP | __GFP_NOWARN)
+#define LOW_ORDER_GFP (GFP_HIGHUSER | __GFP_ZERO)
 #define HIGH_ORDER_GFP  (((GFP_HIGHUSER | __GFP_ZERO | __GFP_NOWARN \
 				| __GFP_NORETRY) & ~__GFP_RECLAIM) \
 				| __GFP_COMP)
-static gfp_t order_flags[] = {HIGH_ORDER_GFP, MID_ORDER_GFP, LOW_ORDER_GFP};
+static gfp_t order_flags[] = {HIGH_ORDER_GFP, HIGH_ORDER_GFP, LOW_ORDER_GFP};
 /*
  * The selection of the orders used for allocation (1MB, 64K, 4K) is designed
  * to match with the sizes often found in IOMMUs. Using order 4 pages instead
@@ -266,7 +265,7 @@
 	return 0;
 }
 
-static int
+static int __maybe_unused
 system_heap_dma_buf_begin_cpu_access_partial(struct dma_buf *dmabuf,
 					     enum dma_data_direction direction,
 					     unsigned int offset,
@@ -296,7 +295,7 @@
 	return ret;
 }
 
-static int
+static int __maybe_unused
 system_heap_dma_buf_end_cpu_access_partial(struct dma_buf *dmabuf,
 					   enum dma_data_direction direction,
 					   unsigned int offset,
@@ -479,8 +478,10 @@
 	.unmap_dma_buf = system_heap_unmap_dma_buf,
 	.begin_cpu_access = system_heap_dma_buf_begin_cpu_access,
 	.end_cpu_access = system_heap_dma_buf_end_cpu_access,
+#ifdef CONFIG_DMABUF_PARTIAL
 	.begin_cpu_access_partial = system_heap_dma_buf_begin_cpu_access_partial,
 	.end_cpu_access_partial = system_heap_dma_buf_end_cpu_access_partial,
+#endif
 	.mmap = system_heap_mmap,
 	.vmap = system_heap_vmap,
 	.vunmap = system_heap_vunmap,
@@ -702,9 +703,6 @@
 
 	if (!heap_dev)
 		return -EINVAL;
-
-	/* Set a dma ops(swiotlb) for the heap device. */
-	arch_setup_dma_ops(heap_dev, 0, 0, NULL, 0);
 
 	dma_coerce_mask_and_coherent(heap_dev, DMA_BIT_MASK(64));
 

--
Gitblit v1.6.2