lkml.org 
[lkml]   [2019]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4.19 12/81] usb: xhci: wait for CNR controller not ready bit in xhci resume
Hi!

> From: Rick Tseng <rtseng@nvidia.com>
>
> commit a70bcbc322837eda1ab5994d12db941dc9733a7d upstream.
>
> NVIDIA 3.1 xHCI card would lose power when moving power state into D3Cold.
> Thus we need to wait for CNR bit to clear in xhci resume, just as in
> xhci init.
...

> @@ -1098,6 +1098,18 @@ int xhci_resume(struct xhci_hcd *xhci, b
> hibernated = true;
>
> if (!hibernated) {
> + /*
> + * Some controllers might lose power during suspend, so wait
> + * for controller not ready bit to clear, just as in xHC init.
> + */
> + retval = xhci_handshake(&xhci->op_regs->status,
> + STS_CNR, 0, 10 * 1000 * 1000);
> + if (retval) {
> + xhci_warn(xhci, "Controller not ready at resume %d\n",
> + retval);
> + spin_unlock_irq(&xhci->lock);
> + return retval;
> + }

AFAICT if this error happens, xhci will be unusable. So maybe print
should be at higher level that warning... that's clearly an error.

Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2019-10-18 19:29    [W:0.432 / U:3.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site