All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bus: mhi: pci-generic: Add missing 'pci_disable_pcie_error_reporting()' calls
@ 2021-06-11 21:03 Christophe JAILLET
  2021-06-12  7:06 ` Manivannan Sadhasivam
  2021-06-12  7:09 ` Manivannan Sadhasivam
  0 siblings, 2 replies; 3+ messages in thread
From: Christophe JAILLET @ 2021-06-11 21:03 UTC (permalink / raw)
  To: mani, hemantk, loic.poulain
  Cc: linux-arm-msm, linux-kernel, kernel-janitors, Christophe JAILLET

If an error occurs after a 'pci_enable_pcie_error_reporting()' call, it
must be undone by a corresponding 'pci_disable_pcie_error_reporting()'
call

Add the missing call in the error handling path of the probe and in the
remove function.

Fixes: b012ee6bfe2a ("mhi: pci_generic: Add PCI error handlers")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/bus/mhi/pci_generic.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/bus/mhi/pci_generic.c b/drivers/bus/mhi/pci_generic.c
index 7c810f02a2ef..d84b74396c6a 100644
--- a/drivers/bus/mhi/pci_generic.c
+++ b/drivers/bus/mhi/pci_generic.c
@@ -665,7 +665,7 @@ static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
 	err = mhi_register_controller(mhi_cntrl, mhi_cntrl_config);
 	if (err)
-		return err;
+		goto err_disable_reporting;
 
 	/* MHI bus does not power up the controller by default */
 	err = mhi_prepare_for_power_up(mhi_cntrl);
@@ -699,6 +699,8 @@ static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	mhi_unprepare_after_power_down(mhi_cntrl);
 err_unregister:
 	mhi_unregister_controller(mhi_cntrl);
+err_disable_reporting:
+	pci_disable_pcie_error_reporting(pdev);
 
 	return err;
 }
@@ -721,6 +723,7 @@ static void mhi_pci_remove(struct pci_dev *pdev)
 		pm_runtime_get_noresume(&pdev->dev);
 
 	mhi_unregister_controller(mhi_cntrl);
+	pci_disable_pcie_error_reporting(pdev);
 }
 
 static void mhi_pci_shutdown(struct pci_dev *pdev)
-- 
2.30.2


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

* Re: [PATCH] bus: mhi: pci-generic: Add missing 'pci_disable_pcie_error_reporting()' calls
  2021-06-11 21:03 [PATCH] bus: mhi: pci-generic: Add missing 'pci_disable_pcie_error_reporting()' calls Christophe JAILLET
@ 2021-06-12  7:06 ` Manivannan Sadhasivam
  2021-06-12  7:09 ` Manivannan Sadhasivam
  1 sibling, 0 replies; 3+ messages in thread
From: Manivannan Sadhasivam @ 2021-06-12  7:06 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: hemantk, loic.poulain, linux-arm-msm, linux-kernel, kernel-janitors

On Fri, Jun 11, 2021 at 11:03:50PM +0200, Christophe JAILLET wrote:
> If an error occurs after a 'pci_enable_pcie_error_reporting()' call, it
> must be undone by a corresponding 'pci_disable_pcie_error_reporting()'
> call
> 
> Add the missing call in the error handling path of the probe and in the
> remove function.
> 
> Fixes: b012ee6bfe2a ("mhi: pci_generic: Add PCI error handlers")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

Thanks,
Mani

> ---
>  drivers/bus/mhi/pci_generic.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/bus/mhi/pci_generic.c b/drivers/bus/mhi/pci_generic.c
> index 7c810f02a2ef..d84b74396c6a 100644
> --- a/drivers/bus/mhi/pci_generic.c
> +++ b/drivers/bus/mhi/pci_generic.c
> @@ -665,7 +665,7 @@ static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  
>  	err = mhi_register_controller(mhi_cntrl, mhi_cntrl_config);
>  	if (err)
> -		return err;
> +		goto err_disable_reporting;
>  
>  	/* MHI bus does not power up the controller by default */
>  	err = mhi_prepare_for_power_up(mhi_cntrl);
> @@ -699,6 +699,8 @@ static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  	mhi_unprepare_after_power_down(mhi_cntrl);
>  err_unregister:
>  	mhi_unregister_controller(mhi_cntrl);
> +err_disable_reporting:
> +	pci_disable_pcie_error_reporting(pdev);
>  
>  	return err;
>  }
> @@ -721,6 +723,7 @@ static void mhi_pci_remove(struct pci_dev *pdev)
>  		pm_runtime_get_noresume(&pdev->dev);
>  
>  	mhi_unregister_controller(mhi_cntrl);
> +	pci_disable_pcie_error_reporting(pdev);
>  }
>  
>  static void mhi_pci_shutdown(struct pci_dev *pdev)
> -- 
> 2.30.2
> 

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

* Re: [PATCH] bus: mhi: pci-generic: Add missing 'pci_disable_pcie_error_reporting()' calls
  2021-06-11 21:03 [PATCH] bus: mhi: pci-generic: Add missing 'pci_disable_pcie_error_reporting()' calls Christophe JAILLET
  2021-06-12  7:06 ` Manivannan Sadhasivam
@ 2021-06-12  7:09 ` Manivannan Sadhasivam
  1 sibling, 0 replies; 3+ messages in thread
From: Manivannan Sadhasivam @ 2021-06-12  7:09 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: hemantk, loic.poulain, linux-arm-msm, linux-kernel, kernel-janitors

On Fri, Jun 11, 2021 at 11:03:50PM +0200, Christophe JAILLET wrote:
> If an error occurs after a 'pci_enable_pcie_error_reporting()' call, it
> must be undone by a corresponding 'pci_disable_pcie_error_reporting()'
> call
> 
> Add the missing call in the error handling path of the probe and in the
> remove function.
> 
> Fixes: b012ee6bfe2a ("mhi: pci_generic: Add PCI error handlers")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Cced stable and applied to mhi-next!

Thanks,
Mani

> ---
>  drivers/bus/mhi/pci_generic.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/bus/mhi/pci_generic.c b/drivers/bus/mhi/pci_generic.c
> index 7c810f02a2ef..d84b74396c6a 100644
> --- a/drivers/bus/mhi/pci_generic.c
> +++ b/drivers/bus/mhi/pci_generic.c
> @@ -665,7 +665,7 @@ static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  
>  	err = mhi_register_controller(mhi_cntrl, mhi_cntrl_config);
>  	if (err)
> -		return err;
> +		goto err_disable_reporting;
>  
>  	/* MHI bus does not power up the controller by default */
>  	err = mhi_prepare_for_power_up(mhi_cntrl);
> @@ -699,6 +699,8 @@ static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  	mhi_unprepare_after_power_down(mhi_cntrl);
>  err_unregister:
>  	mhi_unregister_controller(mhi_cntrl);
> +err_disable_reporting:
> +	pci_disable_pcie_error_reporting(pdev);
>  
>  	return err;
>  }
> @@ -721,6 +723,7 @@ static void mhi_pci_remove(struct pci_dev *pdev)
>  		pm_runtime_get_noresume(&pdev->dev);
>  
>  	mhi_unregister_controller(mhi_cntrl);
> +	pci_disable_pcie_error_reporting(pdev);
>  }
>  
>  static void mhi_pci_shutdown(struct pci_dev *pdev)
> -- 
> 2.30.2
> 

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

end of thread, other threads:[~2021-06-12  7:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-11 21:03 [PATCH] bus: mhi: pci-generic: Add missing 'pci_disable_pcie_error_reporting()' calls Christophe JAILLET
2021-06-12  7:06 ` Manivannan Sadhasivam
2021-06-12  7:09 ` Manivannan Sadhasivam

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.