Commit a25d144f authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Greg Kroah-Hartman

bus: mhi: pci-generic: Add missing 'pci_disable_pcie_error_reporting()' calls

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.

Cc: <stable@vger.kernel.org>
Fixes: b012ee6b ("mhi: pci_generic: Add PCI error handlers")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: default avatarManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/f70c14701f4922d67e717633c91b6c481b59f298.1623445348.git.christophe.jaillet@wanadoo.frSigned-off-by: default avatarManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20210621161616.77524-6-manivannan.sadhasivam@linaro.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 02b49cd1
...@@ -665,7 +665,7 @@ static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -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); err = mhi_register_controller(mhi_cntrl, mhi_cntrl_config);
if (err) if (err)
return err; goto err_disable_reporting;
/* MHI bus does not power up the controller by default */ /* MHI bus does not power up the controller by default */
err = mhi_prepare_for_power_up(mhi_cntrl); 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) ...@@ -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); mhi_unprepare_after_power_down(mhi_cntrl);
err_unregister: err_unregister:
mhi_unregister_controller(mhi_cntrl); mhi_unregister_controller(mhi_cntrl);
err_disable_reporting:
pci_disable_pcie_error_reporting(pdev);
return err; return err;
} }
...@@ -721,6 +723,7 @@ static void mhi_pci_remove(struct pci_dev *pdev) ...@@ -721,6 +723,7 @@ static void mhi_pci_remove(struct pci_dev *pdev)
pm_runtime_get_noresume(&pdev->dev); pm_runtime_get_noresume(&pdev->dev);
mhi_unregister_controller(mhi_cntrl); mhi_unregister_controller(mhi_cntrl);
pci_disable_pcie_error_reporting(pdev);
} }
static void mhi_pci_shutdown(struct pci_dev *pdev) static void mhi_pci_shutdown(struct pci_dev *pdev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment