aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma-buf/heaps/system_heap.c
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2025-01-12 15:50:28 +0000
committersaturneric <[email protected]>2025-01-12 15:50:28 +0000
commitb7c94eb866dd341a28367bdfabd7c2d1b14d688e (patch)
treeb6df897425af99dbfef5ad4d91a969f1e58fdae6 /drivers/dma-buf/heaps/system_heap.c
parentMerge tag 'hwmon-for-v6.13-rc7' of git://git.kernel.org/pub/scm/linux/kernel/... (diff)
downloadkernel-b7c94eb866dd341a28367bdfabd7c2d1b14d688e.tar.gz
kernel-b7c94eb866dd341a28367bdfabd7c2d1b14d688e.zip
fix: drivers patch make raspberry pi 5 work properly
Diffstat (limited to 'drivers/dma-buf/heaps/system_heap.c')
-rw-r--r--drivers/dma-buf/heaps/system_heap.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/dma-buf/heaps/system_heap.c b/drivers/dma-buf/heaps/system_heap.c
index 26d5dc89ea16..7e9a0e3615c0 100644
--- a/drivers/dma-buf/heaps/system_heap.c
+++ b/drivers/dma-buf/heaps/system_heap.c
@@ -54,6 +54,11 @@ static gfp_t order_flags[] = {HIGH_ORDER_GFP, HIGH_ORDER_GFP, LOW_ORDER_GFP};
static const unsigned int orders[] = {8, 4, 0};
#define NUM_ORDERS ARRAY_SIZE(orders)
+static unsigned int module_max_order = orders[0];
+
+module_param_named(max_order, module_max_order, uint, 0400);
+MODULE_PARM_DESC(max_order, "Maximum allocation order override.");
+
static struct sg_table *dup_sg_table(struct sg_table *table)
{
struct sg_table *new_table;
@@ -339,7 +344,7 @@ static struct dma_buf *system_heap_allocate(struct dma_heap *heap,
struct system_heap_buffer *buffer;
DEFINE_DMA_BUF_EXPORT_INFO(exp_info);
unsigned long size_remaining = len;
- unsigned int max_order = orders[0];
+ unsigned int max_order = module_max_order;
struct dma_buf *dmabuf;
struct sg_table *table;
struct scatterlist *sg;
@@ -433,6 +438,9 @@ static int __init system_heap_create(void)
if (IS_ERR(sys_heap))
return PTR_ERR(sys_heap);
+ if (module_max_order > orders[0])
+ module_max_order = orders[0];
+
return 0;
}
module_init(system_heap_create);