From: Jon Hunter <jonathanh@nvidia.com>
To: Thierry Reding <thierry.reding@gmail.com>,
Felipe Balbi <balbi@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Nagarjuna Kristam <nkristam@nvidia.com>,
<linux-usb@vger.kernel.org>, <linux-tegra@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] usb: gadget: tegra-xudc: Fix idle suspend/resume
Date: Mon, 20 Apr 2020 15:32:41 +0100 [thread overview]
Message-ID: <60250b1f-f721-0631-59bf-513576473f44@nvidia.com> (raw)
In-Reply-To: <20200417170537.2540914-1-thierry.reding@gmail.com>
On 17/04/2020 18:05, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> When the XUDC device is idle (i.e. powergated), care must be taken not
> to access any registers because that would lead to a crash.
>
> Move the call to tegra_xudc_device_mode_off() into the same conditional
> as the tegra_xudc_powergate() call to make sure we only force device
> mode off if the XUDC is actually powered up.
>
> Fixes: 49db427232fe ("usb: gadget: Add UDC driver for tegra XUSB device mode controller")
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
> drivers/usb/gadget/udc/tegra-xudc.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/usb/gadget/udc/tegra-xudc.c b/drivers/usb/gadget/udc/tegra-xudc.c
> index 52a6add961f4..dfabc54cdc27 100644
> --- a/drivers/usb/gadget/udc/tegra-xudc.c
> +++ b/drivers/usb/gadget/udc/tegra-xudc.c
> @@ -3840,11 +3840,11 @@ static int __maybe_unused tegra_xudc_suspend(struct device *dev)
>
> flush_work(&xudc->usb_role_sw_work);
>
> - /* Forcibly disconnect before powergating. */
> - tegra_xudc_device_mode_off(xudc);
> -
> - if (!pm_runtime_status_suspended(dev))
> + if (!pm_runtime_status_suspended(dev)) {
> + /* Forcibly disconnect before powergating. */
> + tegra_xudc_device_mode_off(xudc);
> tegra_xudc_powergate(xudc);
> + }
>
> pm_runtime_disable(dev);
Acked-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Cheers
Jon
--
nvpublic
next prev parent reply other threads:[~2020-04-20 14:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-17 17:05 Thierry Reding
2020-04-20 14:32 ` Jon Hunter [this message]
2020-05-06 17:13 ` Thierry Reding
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=60250b1f-f721-0631-59bf-513576473f44@nvidia.com \
--to=jonathanh@nvidia.com \
--cc=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=nkristam@nvidia.com \
--cc=thierry.reding@gmail.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®