linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/eeh: Avoid misleading message "EEH: no capable adapters found"
@ 2018-03-23  2:10 Mauro S. M. Rodrigues
  2018-04-27  0:34 ` Russell Currey
  2018-07-11 13:24 ` Michael Ellerman
  0 siblings, 2 replies; 4+ messages in thread
From: Mauro S. M. Rodrigues @ 2018-03-23  2:10 UTC (permalink / raw)
  To: linuxppc-dev, ruscur, benh, paulus, mpe; +Cc: kernel

Due to recent refactoring in EEH in:
commit b9fde58db7e5 ("powerpc/powernv: Rework EEH initialization on
powernv")
a misleading message was seen in the kernel message buffer:

[    0.108431] EEH: PowerNV platform initialized
[    0.589979] EEH: No capable adapters found

This happened due to the removal of the initialization delay for powernv
platform.

Even though the EEH infrastructure for the devices is eventually
initialized and still works just fine the eeh device probe step is
postponed in order to assure the PEs are created. Later
pnv_eeh_post_init does the probe devices job but at that point the
message was already shown right after eeh_init flow.

This patch introduces a new flag EEH_POSTPONED_PROBE to represent that
temporary state and avoid the message mentioned above and showing the
follow one instead:

[    0.107724] EEH: PowerNV platform initialized
[    4.844825] EEH: PCI Enhanced I/O Error Handling Enabled

Signed-off-by: Mauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com>
---
 arch/powerpc/include/asm/eeh.h               | 15 ++++++++-------
 arch/powerpc/kernel/eeh.c                    |  2 +-
 arch/powerpc/platforms/powernv/eeh-powernv.c | 12 +++++++++++-
 3 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h
index fd37cc1..d16c3d6 100644
--- a/arch/powerpc/include/asm/eeh.h
+++ b/arch/powerpc/include/asm/eeh.h
@@ -36,13 +36,14 @@
 #ifdef CONFIG_EEH
 
 /* EEH subsystem flags */
-#define EEH_ENABLED		0x01	/* EEH enabled		*/
-#define EEH_FORCE_DISABLED	0x02	/* EEH disabled		*/
-#define EEH_PROBE_MODE_DEV	0x04	/* From PCI device	*/
-#define EEH_PROBE_MODE_DEVTREE	0x08	/* From device tree	*/
-#define EEH_VALID_PE_ZERO	0x10	/* PE#0 is valid	*/
-#define EEH_ENABLE_IO_FOR_LOG	0x20	/* Enable IO for log	*/
-#define EEH_EARLY_DUMP_LOG	0x40	/* Dump log immediately	*/
+#define EEH_ENABLED		0x01	/* EEH enabled			     */
+#define EEH_FORCE_DISABLED	0x02	/* EEH disabled			     */
+#define EEH_PROBE_MODE_DEV	0x04	/* From PCI device		     */
+#define EEH_PROBE_MODE_DEVTREE	0x08	/* From device tree		     */
+#define EEH_VALID_PE_ZERO	0x10	/* PE#0 is valid		     */
+#define EEH_ENABLE_IO_FOR_LOG	0x20	/* Enable IO for log		     */
+#define EEH_EARLY_DUMP_LOG	0x40	/* Dump log immediately		     */
+#define EEH_POSTPONED_PROBE	0x80    /* Powernv may postpone device probe */
 
 /*
  * Delay for PE reset, all in ms
diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
index 2b9df00..179ca84 100644
--- a/arch/powerpc/kernel/eeh.c
+++ b/arch/powerpc/kernel/eeh.c
@@ -1092,7 +1092,7 @@ static int eeh_init(void)
 
 	if (eeh_enabled())
 		pr_info("EEH: PCI Enhanced I/O Error Handling Enabled\n");
-	else
+	else if (!eeh_has_flag(EEH_POSTPONED_PROBE))
 		pr_info("EEH: No capable adapters found\n");
 
 	return ret;
diff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c b/arch/powerpc/platforms/powernv/eeh-powernv.c
index 33c86c1..9845460 100644
--- a/arch/powerpc/platforms/powernv/eeh-powernv.c
+++ b/arch/powerpc/platforms/powernv/eeh-powernv.c
@@ -223,6 +223,14 @@ int pnv_eeh_post_init(void)
 	eeh_probe_devices();
 	eeh_addr_cache_build();
 
+	if (eeh_has_flag(EEH_POSTPONED_PROBE)) {
+		eeh_clear_flag(EEH_POSTPONED_PROBE);
+		if (eeh_enabled())
+			pr_info("EEH: PCI Enhanced I/O Error Handling Enabled\n");
+		else
+			pr_info("EEH: No capable adapters found\n");
+	}
+
 	/* Register OPAL event notifier */
 	eeh_event_irq = opal_event_request(ilog2(OPAL_EVENT_PCI_ERROR));
 	if (eeh_event_irq < 0) {
@@ -384,8 +392,10 @@ static void *pnv_eeh_probe(struct pci_dn *pdn, void *data)
 		return NULL;
 
 	/* Skip if we haven't probed yet */
-	if (phb->ioda.pe_rmap[config_addr] == IODA_INVALID_PE)
+	if (phb->ioda.pe_rmap[config_addr] == IODA_INVALID_PE) {
+		eeh_add_flag(EEH_POSTPONED_PROBE);
 		return NULL;
+	}
 
 	/* Initialize eeh device */
 	edev->class_code = pdn->class_code;
-- 
1.8.3.1

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

* Re: [PATCH] powerpc/eeh: Avoid misleading message "EEH: no capable adapters found"
  2018-03-23  2:10 [PATCH] powerpc/eeh: Avoid misleading message "EEH: no capable adapters found" Mauro S. M. Rodrigues
@ 2018-04-27  0:34 ` Russell Currey
  2018-06-18  7:17   ` Venkat Rao B
  2018-07-11 13:24 ` Michael Ellerman
  1 sibling, 1 reply; 4+ messages in thread
From: Russell Currey @ 2018-04-27  0:34 UTC (permalink / raw)
  To: Mauro S. M. Rodrigues, linuxppc-dev, benh, paulus, mpe; +Cc: kernel

On Thu, 2018-03-22 at 23:10 -0300, Mauro S. M. Rodrigues wrote:
> Due to recent refactoring in EEH in:
> commit b9fde58db7e5 ("powerpc/powernv: Rework EEH initialization on
> powernv")
> a misleading message was seen in the kernel message buffer:
> 
> [    0.108431] EEH: PowerNV platform initialized
> [    0.589979] EEH: No capable adapters found
> 
> This happened due to the removal of the initialization delay for
> powernv
> platform.
> 
> Even though the EEH infrastructure for the devices is eventually
> initialized and still works just fine the eeh device probe step is
> postponed in order to assure the PEs are created. Later
> pnv_eeh_post_init does the probe devices job but at that point the
> message was already shown right after eeh_init flow.
> 
> This patch introduces a new flag EEH_POSTPONED_PROBE to represent
> that
> temporary state and avoid the message mentioned above and showing the
> follow one instead:
> 
> [    0.107724] EEH: PowerNV platform initialized
> [    4.844825] EEH: PCI Enhanced I/O Error Handling Enabled
> 
> Signed-off-by: Mauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com>

Good idea, thanks for the patch.

Acked-by: Russell Currey <ruscur@russell.cc>

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

* Re: [PATCH] powerpc/eeh: Avoid misleading message "EEH: no capable adapters found"
  2018-04-27  0:34 ` Russell Currey
@ 2018-06-18  7:17   ` Venkat Rao B
  0 siblings, 0 replies; 4+ messages in thread
From: Venkat Rao B @ 2018-06-18  7:17 UTC (permalink / raw)
  To: Russell Currey, Mauro S. M. Rodrigues, linuxppc-dev, benh, paulus,
	mpe
  Cc: kernel



On Friday 27 April 2018 06:04 AM, Russell Currey wrote:
> On Thu, 2018-03-22 at 23:10 -0300, Mauro S. M. Rodrigues wrote:
>> Due to recent refactoring in EEH in:
>> commit b9fde58db7e5 ("powerpc/powernv: Rework EEH initialization on
>> powernv")
>> a misleading message was seen in the kernel message buffer:
>>
>> [    0.108431] EEH: PowerNV platform initialized
>> [    0.589979] EEH: No capable adapters found
>>
>> This happened due to the removal of the initialization delay for
>> powernv
>> platform.
>>
>> Even though the EEH infrastructure for the devices is eventually
>> initialized and still works just fine the eeh device probe step is
>> postponed in order to assure the PEs are created. Later
>> pnv_eeh_post_init does the probe devices job but at that point the
>> message was already shown right after eeh_init flow.
>>
>> This patch introduces a new flag EEH_POSTPONED_PROBE to represent
>> that
>> temporary state and avoid the message mentioned above and showing the
>> follow one instead:
>>
>> [    0.107724] EEH: PowerNV platform initialized
>> [    4.844825] EEH: PCI Enhanced I/O Error Handling Enabled
>>
>> Signed-off-by: Mauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com>
> 
> Good idea, thanks for the patch.
> 
> Acked-by: Russell Currey <ruscur@russell.cc>
>


Hi Mauro,

I got a chance to test your patch, I applied your patch on top of 
mainline kernel commit:8efcf34a263965e471e3999904f94d1f6799d42a and 
booted and I don't see the message "No capable adapters found" instead I 
see "EEH: PCI Enhanced I/O Error Handling Enabled" as desired. But I 
have not injected any EEH.Hope this should qualify your patch.

Tested-by:Venkat Rao B <vrbagal1@linux.vnet.ibm.com>

Regards,
Venkat.

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

* Re: powerpc/eeh: Avoid misleading message "EEH: no capable adapters found"
  2018-03-23  2:10 [PATCH] powerpc/eeh: Avoid misleading message "EEH: no capable adapters found" Mauro S. M. Rodrigues
  2018-04-27  0:34 ` Russell Currey
@ 2018-07-11 13:24 ` Michael Ellerman
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2018-07-11 13:24 UTC (permalink / raw)
  To: Mauro S. M. Rodrigues, linuxppc-dev, ruscur, benh, paulus; +Cc: kernel

On Fri, 2018-03-23 at 02:10:52 UTC, "Mauro S. M. Rodrigues" wrote:
> Due to recent refactoring in EEH in:
> commit b9fde58db7e5 ("powerpc/powernv: Rework EEH initialization on
> powernv")
> a misleading message was seen in the kernel message buffer:
> 
> [    0.108431] EEH: PowerNV platform initialized
> [    0.589979] EEH: No capable adapters found
> 
> This happened due to the removal of the initialization delay for powernv
> platform.
> 
> Even though the EEH infrastructure for the devices is eventually
> initialized and still works just fine the eeh device probe step is
> postponed in order to assure the PEs are created. Later
> pnv_eeh_post_init does the probe devices job but at that point the
> message was already shown right after eeh_init flow.
> 
> This patch introduces a new flag EEH_POSTPONED_PROBE to represent that
> temporary state and avoid the message mentioned above and showing the
> follow one instead:
> 
> [    0.107724] EEH: PowerNV platform initialized
> [    4.844825] EEH: PCI Enhanced I/O Error Handling Enabled
> 
> Signed-off-by: Mauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com>
> Acked-by: Russell Currey <ruscur@russell.cc>
> Tested-by:Venkat Rao B <vrbagal1@linux.vnet.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/ee8c446fed99ffdc29dedf7d2a8854

cheers

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

end of thread, other threads:[~2018-07-11 13:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-23  2:10 [PATCH] powerpc/eeh: Avoid misleading message "EEH: no capable adapters found" Mauro S. M. Rodrigues
2018-04-27  0:34 ` Russell Currey
2018-06-18  7:17   ` Venkat Rao B
2018-07-11 13:24 ` Michael Ellerman

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).