Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp132084pxb; Mon, 31 Jan 2022 17:19:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJz4LR4xb3OzGeRc+scITwKjHUztnCMJ5iDXvpPbFHFlN0IFV1o0doRqDv28MO0VpOaAkZqt X-Received: by 2002:a17:907:170f:: with SMTP id le15mr19582637ejc.481.1643678348469; Mon, 31 Jan 2022 17:19:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643678348; cv=none; d=google.com; s=arc-20160816; b=PSXc8vcgpYcjaRnRWJJMT2fC4HEzqJoioSYQUqAspceYligYe6mcl0T2jx0XofE030 llekT3+LsQXMCxiYvGHas52ug2/iubVrglH8RlZnUYzjEsK7/ZJjbmdQoXvXOwARtTMQ yWb7sHsrlrLk1rG8ENlcaYDP3FE1N1DwL3UGcp97KYtHdK1fxBrAImCFPs0h41o2zNDU 2oQppJt1VlGUQj9mzVOXdBhGFUx44nDzmbVnGADvVALbfI3qietXTLBduoMH6EhPJwwv +tJMrb6P2b4m47bVpWIuGSQN6oxKUg76PwQAj74X+gteGFc2qraPpKqgqlnt/ctoQi/y Ua+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=bqzBoRkDi8kVZLIMHecE3nTUwM1cKHwe7YhWSOKzDP4=; b=vVArjIOa2Q74UvBf9Gk4f2xRMTR6RQz9owqTTtvMIvtiw+IteWXxDeOg90Hmp+YAHN 2TvT06p37roAA00sg6UvT5EqJZA+nFaI2SxTy+7ttHYgleaf3JriKgQtWnSLaEHd0r0I T1FY8AGcwYeZP+sK6+1RRMlzdhjvJPm/oFNz8uCvfsk53Qk1XBZX5vDFBg0sCsERUsGs NHbT/VuzTkFHAgl9i2hB+bCqw74Wq8w5MZMWjClNjPlCA+Bv5A4xQFFjfnh5A80/7GhP iWxc4jwuD4IcNwgEKfPzTJ5F5CA97NHqdtAc9h85cnF7Tuu0Mb6Fob3cOeb/mi0V8oxF AM4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=s97mGS9t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r20si9192757edd.7.2022.01.31.17.18.43; Mon, 31 Jan 2022 17:19:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=s97mGS9t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232571AbiA2JXu (ORCPT + 99 others); Sat, 29 Jan 2022 04:23:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232426AbiA2JXt (ORCPT ); Sat, 29 Jan 2022 04:23:49 -0500 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AFE3C061714 for ; Sat, 29 Jan 2022 01:23:49 -0800 (PST) Received: by mail-pj1-x1029.google.com with SMTP id my12-20020a17090b4c8c00b001b528ba1cd7so8701128pjb.1 for ; Sat, 29 Jan 2022 01:23:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=bqzBoRkDi8kVZLIMHecE3nTUwM1cKHwe7YhWSOKzDP4=; b=s97mGS9tiPyBqXIXKy3aSh/N4MQ9p3JSjfDa3iVBO/Yre+GETk8gTsrVUntRjvG8/m rQrNRXjXcrI0pnn6CapBI1VN2KoFgEQfUybFE0qXREGW7/Ct7OPgPDUzdb0iFQbg5Lok GPiSGiEUkxt5e7FpuZofX6lubQiidNESe0CzO+sgmdijG9oXNeQT3Wh2eIlRUgiBEcNS G1JfC8l3U2YHhQuvDFlTkIcZQskxd0h9YRiuPXbnanlukqx+0Bt105wGtXQkOAA5SpkV pTFHnmpt6XZHRqqG6WQoU6w09u/PM1eStPysheNrb67/4Oj9WUDoVpjQSOb1oF95rTIr zcWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=bqzBoRkDi8kVZLIMHecE3nTUwM1cKHwe7YhWSOKzDP4=; b=PUSj7iDfu7n3dxubBEmIqW41c8Kbo6/o1HhDrJw9Y2mOSrAAWIAcUYczRv2g0TwFyf mUVUEON/eWT44x9f6XKEcAlbacu7Kz8rYzevLnHcmS/h9OULWPaMHPpEflJ7zIfNOnNx ZffP71ZmsPcIm5bNlk7XO0Re1wINxgLGlS2pnFTI7oqONq+NqBR/8xSPaQJHZaGtoh8I M9lfX73zDybZj2X0MJuif4OnVPCStB32TFwR6K7j48ddt2ykwCtN/7j3PvEeZUUp7uAp aSSVnRKdTbmthJV5fK5VWM3TPMipkWSEAWHCdu+XWjPkwmY5sny5OUoox/XGY9Lyc9Lv nK3g== X-Gm-Message-State: AOAM531jOfD5FyP/y6Bio7vG0dhcfeQn3nJM836He7ke9yyhfPtDuWD4 l5a8yP7Wci8edRpAhk6qIFJH20hI4Wf4u2oAQIeBdQ== X-Received: by 2002:a17:90b:1881:: with SMTP id mn1mr23751902pjb.236.1643448228173; Sat, 29 Jan 2022 01:23:48 -0800 (PST) MIME-Version: 1.0 References: <20220119064013.1381172-1-pumahsu@google.com> In-Reply-To: From: Puma Hsu Date: Sat, 29 Jan 2022 17:23:12 +0800 Message-ID: Subject: Re: [PATCH v5] xhci: re-initialize the HC during resume if HCE was set To: Mathias Nyman Cc: mathias.nyman@intel.com, Greg KH , Sergey Shtylyov , Albert Wang , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 27, 2022 at 9:43 PM Mathias Nyman wrote: > > On 19.1.2022 8.40, Puma Hsu wrote: > > When HCE(Host Controller Error) is set, it means an internal > > error condition has been detected. Software needs to re-initialize > > the HC, so add this check in xhci resume. > > > > Cc: stable@vger.kernel.org > > Signed-off-by: Puma Hsu > > --- > > v2: Follow Sergey Shtylyov 's comment. > > v3: Add stable@vger.kernel.org for stable release. > > v4: Refine the commit message. > > v5: Add a debug log. Follow Mathias Nyman 's comment. > > > > drivers/usb/host/xhci.c | 6 ++++-- > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c > > index dc357cabb265..41f594f0f73f 100644 > > --- a/drivers/usb/host/xhci.c > > +++ b/drivers/usb/host/xhci.c > > @@ -1146,8 +1146,10 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibe= rnated) > > temp =3D readl(&xhci->op_regs->status); > > } > > > > - /* If restore operation fails, re-initialize the HC during resume= */ > > - if ((temp & STS_SRE) || hibernated) { > > + /* If restore operation fails or HC error is detected, re-initial= ize the HC during resume */ > > + if ((temp & (STS_SRE | STS_HCE)) || hibernated) { > > + xhci_warn(xhci, "re-initialize HC during resume, USBSTS:%= s\n", > > + xhci_decode_usbsts(str, temp)); > > > > if ((xhci->quirks & XHCI_COMP_MODE_QUIRK) && > > !(xhci_all_ports_seen_u0(xhci))) { > > > > Tried to compile, something is missing in this patch: > > drivers/usb/host/xhci.c:1152:25: error: =E2=80=98str=E2=80=99 undeclared = (first use in this function); did you mean =E2=80=98qstr=E2=80=99? Sorry for missing the declaration, I will fix it. > -Mathias