linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Loic Poulain <loic.poulain@linaro.org>
Cc: hemantk@codeaurora.org, linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH] bus: mhi: pci_generic: Implement PCI shutdown callback
Date: Wed, 7 Apr 2021 13:44:23 +0530	[thread overview]
Message-ID: <20210407081423.GN8675@work> (raw)
In-Reply-To: <1616169037-7969-1-git-send-email-loic.poulain@linaro.org>

On Fri, Mar 19, 2021 at 04:50:37PM +0100, Loic Poulain wrote:
> Deinit the device on shutdown to halt MHI/PCI operation on device
> side. This change fixes floating device state with some hosts that
> do not fully shutdown PCIe device when rebooting.
> 
> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>

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

Thanks,
Mani

> ---
>  drivers/bus/mhi/pci_generic.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/bus/mhi/pci_generic.c b/drivers/bus/mhi/pci_generic.c
> index cbd2224..b104ab8 100644
> --- a/drivers/bus/mhi/pci_generic.c
> +++ b/drivers/bus/mhi/pci_generic.c
> @@ -532,6 +532,12 @@ static void mhi_pci_remove(struct pci_dev *pdev)
>  	mhi_unregister_controller(mhi_cntrl);
>  }
>  
> +static void mhi_pci_shutdown(struct pci_dev *pdev)
> +{
> +	mhi_pci_remove(pdev);
> +	pci_set_power_state(pdev, PCI_D3hot);
> +}
> +
>  static void mhi_pci_reset_prepare(struct pci_dev *pdev)
>  {
>  	struct mhi_pci_device *mhi_pdev = pci_get_drvdata(pdev);
> @@ -704,6 +710,7 @@ static struct pci_driver mhi_pci_driver = {
>  	.id_table	= mhi_pci_id_table,
>  	.probe		= mhi_pci_probe,
>  	.remove		= mhi_pci_remove,
> +	.shutdown	= mhi_pci_shutdown,
>  	.err_handler	= &mhi_pci_err_handler,
>  	.driver.pm	= &mhi_pci_pm_ops
>  };
> -- 
> 2.7.4
> 

  parent reply	other threads:[~2021-04-07  8:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-19 15:50 [PATCH] bus: mhi: pci_generic: Implement PCI shutdown callback Loic Poulain
2021-04-07  7:23 ` Loic Poulain
2021-04-07  8:14 ` Manivannan Sadhasivam [this message]
2021-04-07  8:16 ` Manivannan Sadhasivam
2021-05-26 19:03 ` patchwork-bot+linux-arm-msm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210407081423.GN8675@work \
    --to=manivannan.sadhasivam@linaro.org \
    --cc=hemantk@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=loic.poulain@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).