Skip to content

Commit

Permalink
from map220v
Browse files Browse the repository at this point in the history
HACK: anything less than 0x1001(4097) causes kernel to hang on boot for unknown reason. ( Original ptr_sz value is 0xCO(192) )

modify to be max(4097, ptr_sz)
  • Loading branch information
root authored and root committed Jun 27, 2023
1 parent 015f358 commit 0aba44a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/firmware/qcom_scm.c
Original file line number Diff line number Diff line change
Expand Up @@ -927,8 +927,8 @@ int qcom_scm_assign_mem(phys_addr_t mem_addr, size_t mem_sz,
src_sz = hweight64(srcvm_bits) * sizeof(*src);
mem_to_map_sz = sizeof(*mem_to_map);
dest_sz = dest_cnt * sizeof(*destvm);
ptr_sz = ALIGN(src_sz, SZ_64) + ALIGN(mem_to_map_sz, SZ_64) +
ALIGN(dest_sz, SZ_64);
ptr_sz = max(4097, ALIGN(src_sz, SZ_64) + ALIGN(mem_to_map_sz, SZ_64) +
ALIGN(dest_sz, SZ_64));

ptr = dma_alloc_coherent(__scm->dev, ptr_sz, &ptr_phys, GFP_KERNEL);
if (!ptr)
Expand Down

0 comments on commit 0aba44a

Please sign in to comment.