From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 318FECA9EAB for ; Fri, 18 Oct 2019 17:28:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 16E1821D7C for ; Fri, 18 Oct 2019 17:28:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405725AbfJRR2s (ORCPT ); Fri, 18 Oct 2019 13:28:48 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:49566 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727068AbfJRR2s (ORCPT ); Fri, 18 Oct 2019 13:28:48 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 08F5F801BA; Fri, 18 Oct 2019 19:28:28 +0200 (CEST) Date: Fri, 18 Oct 2019 19:28:43 +0200 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Rick Tseng , Mathias Nyman Subject: Re: [PATCH 4.19 12/81] usb: xhci: wait for CNR controller not ready bit in xhci resume Message-ID: <20191018172843.GA27290@amd> References: <20191016214805.727399379@linuxfoundation.org> <20191016214817.920493885@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="x+6KMIRAuhnl3hBn" Content-Disposition: inline In-Reply-To: <20191016214817.920493885@linuxfoundation.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org --x+6KMIRAuhnl3hBn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > From: Rick Tseng >=20 > commit a70bcbc322837eda1ab5994d12db941dc9733a7d upstream. >=20 > 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. =2E.. > @@ -1098,6 +1098,18 @@ int xhci_resume(struct xhci_hcd *xhci, b > hibernated =3D true; > =20 > if (!hibernated) { > + /* > + * Some controllers might lose power during suspend, so wait > + * for controller not ready bit to clear, just as in xHC init. > + */ > + retval =3D 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 --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --x+6KMIRAuhnl3hBn Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl2p9ksACgkQMOfwapXb+vIROQCfbk2WVtdNEPiz6/BKaDQVHeXV bw4An1H3wpoXtFpJoeBe1fvi3bGBj06A =7BhU -----END PGP SIGNATURE----- --x+6KMIRAuhnl3hBn--