linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Lynch via B4 Relay <devnull+nathanl.linux.ibm.com@kernel.org>
To: Michael Ellerman <mpe@ellerman.id.au>,
	 Nicholas Piggin <npiggin@gmail.com>
Cc: Nathan Lynch <nathanl@linux.ibm.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
	Nick Child <nnac123@linux.ibm.com>,
	linuxppc-dev@lists.ozlabs.org,
	Scott Cheloha <cheloha@linux.ibm.com>
Subject: [PATCH 2/3] powerpc/pseries/memhp: Remove unbalanced dlpar_release_drc() call
Date: Tue, 14 Nov 2023 11:01:54 -0600	[thread overview]
Message-ID: <20231114-pseries-memhp-fixes-v1-2-fb8f2bb7c557@linux.ibm.com> (raw)
In-Reply-To: <20231114-pseries-memhp-fixes-v1-0-fb8f2bb7c557@linux.ibm.com>

From: Nathan Lynch <nathanl@linux.ibm.com>

Callers of dlpar_add_lmb() are responsible for first acquiring the DRC
and releasing it if dlpar_add_lmb() fails.

However, dlpar_add_lmb() performs a dlpar_release_drc() in one error
branch.  There is no corresponding dlpar_acquire_drc() in the
function, nor is there any stated justification. None of the other
error paths in dlpar_add_lmb() release the DRC.

This is a potential source of redundant attempts to release DRCs,
which is likely benign, but is confusing and inconsistent. Remove it.

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
 arch/powerpc/platforms/pseries/hotplug-memory.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index 6f2eebae7bee..ba883c1b9f6d 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -575,7 +575,6 @@ static int dlpar_add_lmb(struct drmem_lmb *lmb)
 
 	rc = update_lmb_associativity_index(lmb);
 	if (rc) {
-		dlpar_release_drc(lmb->drc_index);
 		return rc;
 	}
 

-- 
2.41.0


  parent reply	other threads:[~2023-11-14 17:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-14 17:01 [PATCH 0/3] powerpc/pseries/memhp: Fix minor bugs and improve error logging Nathan Lynch via B4 Relay
2023-11-14 17:01 ` [PATCH 1/3] powerpc/pseries/memhp: Fix access beyond end of drmem array Nathan Lynch via B4 Relay
2023-11-14 17:01 ` Nathan Lynch via B4 Relay [this message]
2023-11-15 17:31   ` [PATCH 2/3] powerpc/pseries/memhp: Remove unbalanced dlpar_release_drc() call Nick Child
2023-11-28 14:21     ` Nathan Lynch
2023-11-30 20:09       ` Scott Cheloha
2023-11-14 17:01 ` [PATCH 3/3] powerpc/pseries/memhp: Log more error conditions in add path Nathan Lynch via B4 Relay
2023-12-07 12:38 ` [PATCH 0/3] powerpc/pseries/memhp: Fix minor bugs and improve error logging 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=20231114-pseries-memhp-fixes-v1-2-fb8f2bb7c557@linux.ibm.com \
    --to=devnull+nathanl.linux.ibm.com@kernel.org \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=cheloha@linux.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=nathanl@linux.ibm.com \
    --cc=nnac123@linux.ibm.com \
    --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).