All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/powernv: Return for invalid IMC domain
@ 2019-05-20  8:57 Anju T Sudhakar
  2019-05-21  5:11 ` Madhavan Srinivasan
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Anju T Sudhakar @ 2019-05-20  8:57 UTC (permalink / raw)
  To: mpe; +Cc: pavsubra, maddy, linuxppc-dev, anju

Currently init_imc_pmu() can be failed either because
an IMC unit with invalid domain(i.e an IMC node not
supported by the kernel) is attempted a pmu-registration
or something went wrong while registering a valid IMC unit.
In both the cases kernel provides a 'Registration failed'
error message.

Example:
Log message, when trace-imc node is not supported by the kernel, and the
skiboot supports trace-imc node.

So for kernel, trace-imc node is now an unknown domain.

[    1.731870] nest_phb5_imc performance monitor hardware support registered
[    1.731944] nest_powerbus0_imc performance monitor hardware support registered
[    1.734458] thread_imc performance monitor hardware support registered
[    1.734460] IMC Unknown Device type
[    1.734462] IMC PMU (null) Register failed
[    1.734558] nest_xlink0_imc performance monitor hardware support registered
[    1.734614] nest_xlink1_imc performance monitor hardware support registered
[    1.734670] nest_xlink2_imc performance monitor hardware support registered
[    1.747043] Initialise system trusted keyrings
[    1.747054] Key type blacklist registered


To avoid ambiguity on the error message, return for invalid domain
before attempting a pmu registration. 

Fixes: 8f95faaac56c1 (`powerpc/powernv: Detect and create IMC device`)
Reported-by: Pavaman Subramaniyam <pavsubra@in.ibm.com>
Signed-off-by: Anju T Sudhakar <anju@linux.vnet.ibm.com>
---
 arch/powerpc/platforms/powernv/opal-imc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/powerpc/platforms/powernv/opal-imc.c b/arch/powerpc/platforms/powernv/opal-imc.c
index 58a0794..4e8b0e1 100644
--- a/arch/powerpc/platforms/powernv/opal-imc.c
+++ b/arch/powerpc/platforms/powernv/opal-imc.c
@@ -161,6 +161,10 @@ static int imc_pmu_create(struct device_node *parent, int pmu_index, int domain)
 	struct imc_pmu *pmu_ptr;
 	u32 offset;
 
+	/* Return for unknown domain */
+	if (domain < 0)
+		return -EINVAL;
+
 	/* memory for pmu */
 	pmu_ptr = kzalloc(sizeof(*pmu_ptr), GFP_KERNEL);
 	if (!pmu_ptr)
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-05-25  0:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-20  8:57 [PATCH] powerpc/powernv: Return for invalid IMC domain Anju T Sudhakar
2019-05-21  5:11 ` Madhavan Srinivasan
2019-05-21 11:48 ` Michael Ellerman
2019-05-22  5:40   ` Anju T Sudhakar
2019-05-25  0:54 ` Michael Ellerman

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.