Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1759540ybg; Sat, 19 Oct 2019 01:56:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxm6/1S9coRifKac1qxc66xpfj76ujqYXpP44WoC5toYmqSxaYeG7H8s6b1CPfMb/Ikc4po X-Received: by 2002:a17:906:3016:: with SMTP id 22mr12159837ejz.227.1571475378326; Sat, 19 Oct 2019 01:56:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571475378; cv=none; d=google.com; s=arc-20160816; b=wyeqF5VbjMw0syfSVfqoWb+4OznIxaQAUZ3X+Mf3xCUfGXS+O/g6rKMqP1BCswrzCA HCn6y3k5yDUDTIdPYmi+FxMYXctp3FxdbVYOt94covacO7CydSO5Y4Lek3HfMRgDXTHn kHTUFF78gfYfSnC00oSVpfm+Zz7kXhY0Db9F/fD0OpDpeNyXX6NVfSivVKunhbssCqNY 27/6TPYYInnZGjeuyjJf/waSiD+Y0eRtOA2wym6k7psRzuntskuaAraX5DAcS2HmNKME UJd8Oj3aKF8SvGWCj62KJIdZa5Pm2eFWw0qoAP7ZQ4q+DcUYzJLyimjvgQ94JujRrV+G Xqqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=I3G8Hu0Zs3/vWUEt7XfFBodR0EoN/nYrQy/8SpS0PDY=; b=nChcOIuSBwJAT5m8UGNvi2Sq8KGtOT0G+SwGCdNBCYsCMSw5IatH2Sim0JK0YlfGYL TcrwpLRBflv0/Kiwep2JNygM44iZetCXgbCU/7doS4IWA/Gs85XC+yjAVv4pKMtUwBDQ Ok0Ybi/NhYpvdEbRWira5GnPkrpHVhqkSRuhlbRACKCPWcztswLxk4PNveIRqv4ZLlKT 2PX1GoOFZxpI7uZRgqTpoBnst5PO0SBIHxsf52TsrUcgwwnNNm6gTl9oNGpijNdcP0iu UW02T6BVFB2J/v97w6T+RcKrJPkT377ruS6Q91je9IJ6oKNA2JJsAaIIuqW9+dKdvRlq NKuw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b9si5401812eda.129.2019.10.19.01.55.55; Sat, 19 Oct 2019 01:56:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2502311AbfJRR2s (ORCPT + 99 others); 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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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--