Re: [PATCH] powerpc/eeh: Add conditional check on notify_resume

2018-02-20 Thread Michael Neuling
On Thu, 2018-02-15 at 12:49 -0600, Bryant G. Ly wrote:
> From: "Juan J. Alvarez" 
> 
> 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.
> 
> Signed-off-by: Juan J. Alvarez 
> Reviewed-by: Bryant G. Ly 
> Tested-by: Carol L. Soto 

Acked-by: Michael Neuling 

> ---
>  arch/powerpc/kernel/eeh_driver.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/kernel/eeh_driver.c
> b/arch/powerpc/kernel/eeh_driver.c
> index beea218..0c0b66f 100644
> --- a/arch/powerpc/kernel/eeh_driver.c
> +++ b/arch/powerpc/kernel/eeh_driver.c
> @@ -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;
>  }


Re: [PATCH] powerpc/eeh: Add conditional check on notify_resume

2018-02-16 Thread Mauro Rodrigues
On Thu, Feb 15, 2018 at 12:49:51PM -0600, Bryant G. Ly wrote:
> From: "Juan J. Alvarez" 
> 
> 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.
> 
> Signed-off-by: Juan J. Alvarez 
> Reviewed-by: Bryant G. Ly 
> Tested-by: Carol L. Soto 

Tested-by: Mauro S. M. Rodrigues 

Thanks! I was debugging it and I'm glad you proposed a fix already.
> ---
>  arch/powerpc/kernel/eeh_driver.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/kernel/eeh_driver.c 
> b/arch/powerpc/kernel/eeh_driver.c
> index beea218..0c0b66f 100644
> --- a/arch/powerpc/kernel/eeh_driver.c
> +++ b/arch/powerpc/kernel/eeh_driver.c
> @@ -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;
>  }
> -- 
> 2.7.2
> 



Re: [PATCH] powerpc/eeh: Add conditional check on notify_resume

2018-02-15 Thread Andrew Donnellan

On 16/02/18 05:49, Bryant G. Ly wrote:

From: "Juan J. Alvarez" 

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"?


systems that don't add function notify_resume.

Signed-off-by: Juan J. Alvarez 
Reviewed-by: Bryant G. Ly 
Tested-by: Carol L. Soto 


Reviewed-by: Andrew Donnellan 


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

diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c
index beea218..0c0b66f 100644
--- a/arch/powerpc/kernel/eeh_driver.c
+++ b/arch/powerpc/kernel/eeh_driver.c
@@ -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;
  }



--
Andrew Donnellan  OzLabs, ADL Canberra
andrew.donnel...@au1.ibm.com  IBM Australia Limited



[PATCH] powerpc/eeh: Add conditional check on notify_resume

2018-02-15 Thread Bryant G. Ly
From: "Juan J. Alvarez" 

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.

Signed-off-by: Juan J. Alvarez 
Reviewed-by: Bryant G. Ly 
Tested-by: Carol L. Soto 
---
 arch/powerpc/kernel/eeh_driver.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c
index beea218..0c0b66f 100644
--- a/arch/powerpc/kernel/eeh_driver.c
+++ b/arch/powerpc/kernel/eeh_driver.c
@@ -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;
 }
-- 
2.7.2