* Re: [PATCH 5.10 211/290] xhci: Fix repeated xhci wake after suspend due to uncleared internal wake state
[not found] <977d2868-e1cf-9b33-79b3-18e96b9a30c8@quicinc.com>
@ 2021-11-18 10:04 ` Pavan Kondeti
0 siblings, 0 replies; only message in thread
From: Pavan Kondeti @ 2021-11-18 10:04 UTC (permalink / raw)
To: Rohith Kollalsi
Cc: mathias.nyman, mika.westerberg, quic_ajaya, quic_pkondeti, linux-usb
+linux-usb
On Thu, Nov 18, 2021 at 03:21:54PM +0530, Rohith Kollalsi wrote:
> Hi Mathias,
>
> This mail is regarding your upstream change in xhci file. There is a
> potential issue with your change which can cause noc error due to unclocked
> access.
>
> Consider a case where a headset is connected to device and nothing is
> playing. As nothing is playing, usb bus wouldn't be active which leads to
> run time suspend ( i think this feature is not present upstream) as a part
> of which xhci_suspend will be called. Now all the clocks are also switched
> off. Now again when pm_suspend occurs due to disconnect, then again
> xhci_suspend occurs, but now registers can be accessed with clocks off
> leading to unclocked access. Can you please consider below change to prevent
> unclocked access.
>
>
> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
>
> index 2728027..aaf212d 100644
>
> --- a/drivers/usb/host/xhci.c
>
> +++ b/drivers/usb/host/xhci.c
>
> @@ -1013,13 +1013,13 @@ int xhci_suspend(struct xhci_hcd *xhci, bool
> do_wakeup)
>
> xhci->shared_hcd->state != HC_STATE_SUSPENDED)
>
> return -EINVAL;
>
> + if (!HCD_HW_ACCESSIBLE(hcd)) ---> this will prevent unclocked access
> when xhci_suspend occurs during second time during pm_suspend
>
> + return 0;
>
> +
>
> /* Clear root port wake on bits if wakeup not allowed. */
>
> xhci_disable_hub_port_wake(xhci, &xhci->usb3_rhub, do_wakeup);
>
> xhci_disable_hub_port_wake(xhci, &xhci->usb2_rhub, do_wakeup);
>
> - if (!HCD_HW_ACCESSIBLE(hcd))
>
> - return 0;
>
> -
>
> xhci_dbc_suspend(xhci);
>
>
> Thanks,
>
> Rohith
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-11-18 10:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <977d2868-e1cf-9b33-79b3-18e96b9a30c8@quicinc.com>
2021-11-18 10:04 ` [PATCH 5.10 211/290] xhci: Fix repeated xhci wake after suspend due to uncleared internal wake state Pavan Kondeti
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).