All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Henrique Barboza <danielhb413@gmail.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: Daniel Henrique Barboza <danielhb413@gmail.com>
Subject: [PATCH 1/3] powerpc/pseries: skip reserved LMBs in dlpar_memory_add_by_count()
Date: Tue, 22 Jun 2021 10:39:21 -0300	[thread overview]
Message-ID: <20210622133923.295373-2-danielhb413@gmail.com> (raw)
In-Reply-To: <20210622133923.295373-1-danielhb413@gmail.com>

The function is counting reserved LMBs as available to be added, but
they aren't. This will cause the function to miscalculate the available
LMBs and can trigger errors later on when executing dlpar_add_lmb().

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
 arch/powerpc/platforms/pseries/hotplug-memory.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index 36f66556a7c6..28a7fd90232f 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -683,6 +683,9 @@ static int dlpar_memory_add_by_count(u32 lmbs_to_add)
 
 	/* Validate that there are enough LMBs to satisfy the request */
 	for_each_drmem_lmb(lmb) {
+		if (lmb->flags & DRCONF_MEM_RESERVED)
+			continue;
+
 		if (!(lmb->flags & DRCONF_MEM_ASSIGNED))
 			lmbs_available++;
 
-- 
2.31.1


  reply	other threads:[~2021-06-22 13:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22 13:39 [PATCH 0/3] powerpc/pseries: cleanups for dlpar_memory_add* functions Daniel Henrique Barboza
2021-06-22 13:39 ` Daniel Henrique Barboza [this message]
2021-06-24  8:39   ` [PATCH 1/3] powerpc/pseries: skip reserved LMBs in dlpar_memory_add_by_count() Laurent Dufour
2021-06-22 13:39 ` [PATCH 2/3] powerpc/pseries: break early in dlpar_memory_add_by_count() loops Daniel Henrique Barboza
2021-06-24  8:45   ` Laurent Dufour
2021-06-25  6:21   ` Michael Ellerman
2021-06-22 13:39 ` [PATCH 3/3] powerpc/pseries: fail quicker in dlpar_memory_add_by_ic() Daniel Henrique Barboza
2021-06-24  8:48   ` Laurent Dufour
2021-06-25  6:21 ` [PATCH 0/3] powerpc/pseries: cleanups for dlpar_memory_add* functions 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=20210622133923.295373-2-danielhb413@gmail.com \
    --to=danielhb413@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.