Skip to content

Commit 4c33bf1

Browse files
kvaneeshmpe
authored andcommitted
powerpc/mm/book3s64: Use 256M as the upper limit with coherent device memory attached
Commit 4d15721 ("powerpc/mm: Cleanup memory block size probing") used 256MB as the memory block size when we have ibm,coherent-device-memory device tree node present. Instead of returning with 256MB memory block size, continue to check the rest of the memory regions and make sure we can still map them using a 256MB memory block size. Fixes: 4d15721 ("powerpc/mm: Cleanup memory block size probing") Signed-off-by: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20230828074658.59553-2-aneesh.kumar@linux.ibm.com
1 parent f142475 commit 4c33bf1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

arch/powerpc/mm/init_64.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,8 +569,12 @@ static int __init probe_memory_block_size(unsigned long node, const char *uname,
569569
*/
570570
compatible = of_get_flat_dt_prop(node, "compatible", NULL);
571571
if (compatible && !strcmp(compatible, "ibm,coherent-device-memory")) {
572-
*block_size = SZ_256M;
573-
return 1;
572+
if (*block_size > SZ_256M)
573+
*block_size = SZ_256M;
574+
/*
575+
* We keep 256M as the upper limit with GPU present.
576+
*/
577+
return 0;
574578
}
575579
}
576580
/* continue looking for other memory device types */

0 commit comments

Comments
 (0)