From: Oliver Neukum <oneukum@suse.com>
To: Haotien Hsu <haotienh@nvidia.com>,
Mathias Nyman <mathias.nyman@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Thierry Reding <thierry.reding@gmail.com>,
Jonathan Hunter <jonathanh@nvidia.com>,
linux-usb@vger.kernel.org, linux-tegra@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: Wayne Chang <waynec@nvidia.com>, JC Kuo <jckuo@nvidia.com>,
WK Tsai <wtsai@nvidia.com>, Henry Lin <henryl@nvidia.com>
Subject: Re: [PATCH v2] usb: xhci: tegra: Add shutdown callback for Tegra XUSB
Date: Tue, 18 Jul 2023 11:18:25 +0200 [thread overview]
Message-ID: <525bc794-b797-9a53-7f59-debcfca9edd8@suse.com> (raw)
In-Reply-To: <20230718091425.307589-1-haotienh@nvidia.com>
On 18.07.23 11:14, Haotien Hsu wrote:
> From: Henry Lin <henryl@nvidia.com>
>
> If memory accesses by the Tegra XUSB controller are translated through
> the SMMU (System MMU), the hardware may continue accessing memory even
> after the SMMU translations have been disabled during the shutdown
> process and this can in turn cause unpredictable crashes.
> Fix this by adding a shutdown implementation that ensures the hardware
> is turned off during system reboot or shutdown.
>
> Signed-off-by: Henry Lin <henryl@nvidia.com>
> Signed-off-by: Haotien Hsu <haotienh@nvidia.com>
> Acked-by: Thierry Reding <treding@nvidia.com>
>
> ---
> V1 -> V2: Resend for the typo in the mailing list
> ---
> drivers/usb/host/xhci-tegra.c | 28 +++++++++++++++++++++-------
> 1 file changed, 21 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
> index a56cc81b9404..6ef2eac9835d 100644
> --- a/drivers/usb/host/xhci-tegra.c
> +++ b/drivers/usb/host/xhci-tegra.c
> @@ -1925,6 +1925,15 @@ static int tegra_xusb_probe(struct platform_device *pdev)
> return err;
> }
>
> +static void tegra_xusb_disable(struct tegra_xusb *tegra)
> +{
> + tegra_xusb_powergate_partitions(tegra);
> + tegra_xusb_powerdomain_remove(tegra->dev, tegra);
> + tegra_xusb_phy_disable(tegra);
> + tegra_xusb_clk_disable(tegra);
> + regulator_bulk_disable(tegra->soc->num_supplies, tegra->supplies);
> +}
> +
> static int tegra_xusb_remove(struct platform_device *pdev)
> {
> struct tegra_xusb *tegra = platform_get_drvdata(pdev);
> @@ -1947,18 +1956,22 @@ static int tegra_xusb_remove(struct platform_device *pdev)
>
> pm_runtime_put(&pdev->dev);
>
> - tegra_xusb_powergate_partitions(tegra);
> -
> - tegra_xusb_powerdomain_remove(&pdev->dev, tegra);
> -
> - tegra_xusb_phy_disable(tegra);
> - tegra_xusb_clk_disable(tegra);
> - regulator_bulk_disable(tegra->soc->num_supplies, tegra->supplies);
> + tegra_xusb_disable(tegra);
> tegra_xusb_padctl_put(tegra->padctl);
>
> return 0;
> }
>
> +static void tegra_xusb_shutdown(struct platform_device *pdev)
> +{
> + struct tegra_xusb *tegra = platform_get_drvdata(pdev);
> +
> + pm_runtime_get_sync(&pdev->dev);
Where is this balanced?
Regards
Oliver
next prev parent reply other threads:[~2023-07-18 9:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-18 9:14 Haotien Hsu
2023-07-18 9:18 ` Oliver Neukum [this message]
2023-07-18 11:35 ` Thierry Reding
2023-07-25 16:19 ` Greg Kroah-Hartman
2023-07-27 8:08 ` Haotien Hsu
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=525bc794-b797-9a53-7f59-debcfca9edd8@suse.com \
--to=oneukum@suse.com \
--cc=gregkh@linuxfoundation.org \
--cc=haotienh@nvidia.com \
--cc=henryl@nvidia.com \
--cc=jckuo@nvidia.com \
--cc=jonathanh@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
--cc=thierry.reding@gmail.com \
--cc=waynec@nvidia.com \
--cc=wtsai@nvidia.com \
/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
all inboxes | Powered by JetHome®