Skip to contentSkip to conversation

powerpc/eeh: Add conditional check on notify_resume

PATCH Applied Bryant G. Ly 5 participants 5 messages Feb 15, 2018 – Feb 21, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/eeh: Add conditional check on notify_resume

From: "Juan J. Alvarez" <[email protected]>

EEH structure is not populated with function notify resume when running on systems that do not support it, i.e: BMC. Hence adding a conditional check for NULL for systems that don't add function notify_resume.

---
 arch/powerpc/kernel/eeh_driver.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/kernel/eeh_driver.c +2 -1
index beea218..0c0b66f 100644
@@ -384,7 +384,8 @@ static void *eeh_report_resume(void *data, void *userdata)
 	eeh_pcid_put(dev);
 	pci_uevent_ers(dev, PCI_ERS_RESULT_RECOVERED);
 #ifdef CONFIG_PCI_IOV
-	eeh_ops->notify_resume(eeh_dev_to_pdn(edev));
+	if (eeh_ops->notify_resume && eeh_dev_to_pdn(edev))
+		eeh_ops->notify_resume(eeh_dev_to_pdn(edev));
 #endif
 	return NULL;
 }
Signature · 1 line
2.7.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Bryant G. Ly

From: "Juan J. Alvarez" <[email protected]>

EEH structure is not populated with function notify resume when running on systems that do not support it, i.e: BMC. Hence adding a conditional check for NULL for

Seems to me that by "BMC" you really mean "powernv platform"?

Quoted 5 lines

systems that don't add function notify_resume.

Quoted 19 lines
---
  arch/powerpc/kernel/eeh_driver.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/kernel/eeh_driver.c +2 -1
index beea218..0c0b66f 100644
@@ -384,7 +384,8 @@ static void *eeh_report_resume(void *data, void *userdata)
  	eeh_pcid_put(dev);
  	pci_uevent_ers(dev, PCI_ERS_RESULT_RECOVERED);
  #ifdef CONFIG_PCI_IOV
-	eeh_ops->notify_resume(eeh_dev_to_pdn(edev));
+	if (eeh_ops->notify_resume && eeh_dev_to_pdn(edev))
+		eeh_ops->notify_resume(eeh_dev_to_pdn(edev));
  #endif
  	return NULL;
  }
Signature · 2 lines
Andrew Donnellan              OzLabs, ADL Canberra
[email protected]  IBM Australia Limited
Tested-by on v1 1/1
#2 lore raw
In reply to Bryant G. Ly
Quoted 10 lines · Bryant G. Ly

From: "Juan J. Alvarez" <[email protected]>

EEH structure is not populated with function notify resume when running on systems that do not support it, i.e: BMC. Hence adding a conditional check for NULL for systems that don't add function notify_resume.

Thanks! I was debugging it and I'm glad you proposed a fix already.

Quoted 21 lines
---
 arch/powerpc/kernel/eeh_driver.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/kernel/eeh_driver.c +2 -1
index beea218..0c0b66f 100644
@@ -384,7 +384,8 @@ static void *eeh_report_resume(void *data, void *userdata)
 	eeh_pcid_put(dev);
 	pci_uevent_ers(dev, PCI_ERS_RESULT_RECOVERED);
 #ifdef CONFIG_PCI_IOV
-	eeh_ops->notify_resume(eeh_dev_to_pdn(edev));
+	if (eeh_ops->notify_resume && eeh_dev_to_pdn(edev))
+		eeh_ops->notify_resume(eeh_dev_to_pdn(edev));
 #endif
 	return NULL;
 }
Signature · 1 line
2.7.2
Acked-by on v1 1/1
#3 lore raw
In reply to Bryant G. Ly
Quoted 10 lines · Bryant G. Ly

From: "Juan J. Alvarez" <[email protected]> =20
EEH structure is not populated with function notify resume when running on systems that do not support it, i.e: BMC. Hence adding a conditional check for NULL for systems that don't add function notify_resume.
=20

arch/powerpc/kernel/eeh_driver.c static void *eeh_report_resume(void *data, void *user=

Quoted 10 lines
---
 arch/powerpc/kernel/eeh_driver.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

=20

arch/powerpc/kernel/eeh_driver.c +0 -0
index beea218..0c0b66f 100644
@@ -384,7 +384,8 @@ static void *eeh_report_resume(void *data, void *user=

data)

Quoted 9 lines
arch/powerpc/kernel/eeh_driver.c +2 -1
 	eeh_pcid_put(dev);
 	pci_uevent_ers(dev, PCI_ERS_RESULT_RECOVERED);
 #ifdef CONFIG_PCI_IOV
-	eeh_ops->notify_resume(eeh_dev_to_pdn(edev));
+	if (eeh_ops->notify_resume && eeh_dev_to_pdn(edev))
+		eeh_ops->notify_resume(eeh_dev_to_pdn(edev));
 #endif
 	return NULL;
 }
#4 lore raw
In reply to Bryant G. Ly
Quoted 7 lines · Bryant G. Ly

From: "Juan J. Alvarez" <[email protected]>

EEH structure is not populated with function notify resume when running on systems that do not support it, i.e: BMC. Hence adding a conditional check for NULL for systems that don't add function notify_resume.

Quoted 6 lines

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/521ca5a9859a870e354d1a6b84a6ff

cheers