From: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
To: linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au,
npiggin@gmail.com, christophe.leroy@csgroup.eu
Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
foraker1@llnl.gov, Reza Arbab <arbab@linux.ibm.com>
Subject: [PATCH 2/2] powerpc/mm/book3s64: Use 256M as the upper limit with coherent device memory attached
Date: Mon, 28 Aug 2023 13:16:58 +0530 [thread overview]
Message-ID: <20230828074658.59553-2-aneesh.kumar@linux.ibm.com> (raw)
In-Reply-To: <20230828074658.59553-1-aneesh.kumar@linux.ibm.com>
commit 4d15721177d5 ("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: 4d15721177d5 ("powerpc/mm: Cleanup memory block size probing")
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
---
arch/powerpc/mm/init_64.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
index e3d7379ef480..a8557867ece0 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -569,8 +569,12 @@ static int __init probe_memory_block_size(unsigned long node, const char *uname,
*/
compatible = of_get_flat_dt_prop(node, "compatible", NULL);
if (compatible && !strcmp(compatible, "ibm,coherent-device-memory")) {
- *block_size = SZ_256M;
- return 1;
+ if (*block_size > SZ_256M)
+ *block_size = SZ_256M;
+ /*
+ * We keep 256M as the upper limit with GPU present.
+ */
+ return 0;
}
}
/* continue looking for other memory device types */
--
2.41.0
next prev parent reply other threads:[~2023-08-28 7:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-28 7:46 [PATCH 1/2] powerpc/mm/book3s64: Fix build error with SPARSEMEM disabled Aneesh Kumar K.V
2023-08-28 7:46 ` Aneesh Kumar K.V [this message]
2023-08-28 7:47 ` Aneesh Kumar K V
2023-08-31 4:02 ` Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230828074658.59553-2-aneesh.kumar@linux.ibm.com \
--to=aneesh.kumar@linux.ibm.com \
--cc=arbab@linux.ibm.com \
--cc=christophe.leroy@csgroup.eu \
--cc=foraker1@llnl.gov \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).