public inbox for linuxppc-dev@ozlabs.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>,
	david@gibson•dropbear.id.au
Subject: [PATCH v2 1/4] powerpc/pseries: Set UNISOLATE on dlpar_memory_remove_by_ic() error
Date: Wed, 12 May 2021 17:28:06 -0300	[thread overview]
Message-ID: <20210512202809.95363-2-danielhb413@gmail.com> (raw)
In-Reply-To: <20210512202809.95363-1-danielhb413@gmail.com>

As previously done in dlpar_cpu_remove() for CPUs, this patch changes
dlpar_memory_remove_by_ic() to unisolate the LMB DRC when the LMB is
failed to be removed. The hypervisor, seeing a LMB DRC that was supposed
to be removed being unisolated instead, can do error recovery on its
side.

This change is done in dlpar_memory_remove_by_ic() only because, as of
today, only QEMU is using this code path for error recovery (via the
PSERIES_HP_ELOG_ID_DRC_IC event). phyp treats it as a no-op.

Reviewed-by: David Gibson <david@gibson•dropbear.id.au>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail•com>
---
 arch/powerpc/platforms/pseries/hotplug-memory.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index 8377f1f7c78e..bb98574a84a2 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -551,6 +551,13 @@ static int dlpar_memory_remove_by_ic(u32 lmbs_to_remove, u32 drc_index)
 			if (!drmem_lmb_reserved(lmb))
 				continue;
 
+			/*
+			 * Setting the isolation state of an UNISOLATED/CONFIGURED
+			 * device to UNISOLATE is a no-op, but the hypervisor can
+			 * use it as a hint that the LMB removal failed.
+			 */
+			dlpar_unisolate_drc(lmb->drc_index);
+
 			rc = dlpar_add_lmb(lmb);
 			if (rc)
 				pr_err("Failed to add LMB, drc index %x\n",
-- 
2.31.1


  reply	other threads:[~2021-05-12 20:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-12 20:28 [PATCH v2 0/4] Unisolate LMBs DRC on removal error + cleanups Daniel Henrique Barboza
2021-05-12 20:28 ` Daniel Henrique Barboza [this message]
2021-05-12 20:28 ` [PATCH v2 2/4] powerpc/pseries: check DRCONF_MEM_RESERVED in lmb_is_removable() Daniel Henrique Barboza
2021-05-13  5:12   ` David Gibson
2021-05-12 20:28 ` [PATCH v2 3/4] powerpc/pseries: break early in dlpar_memory_remove_by_count() loops Daniel Henrique Barboza
2021-05-13  5:20   ` David Gibson
2021-05-12 20:28 ` [PATCH v2 4/4] powerpc/pseries: minor enhancements in dlpar_memory_remove_by_ic() Daniel Henrique Barboza
2021-05-13  5:21   ` David Gibson
2021-06-06 12:08 ` [PATCH v2 0/4] Unisolate LMBs DRC on removal error + cleanups 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=20210512202809.95363-2-danielhb413@gmail.com \
    --to=danielhb413@gmail$(echo .)com \
    --cc=david@gibson$(echo .)dropbear.id.au \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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