Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2767894pxb; Mon, 17 Jan 2022 05:28:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJwCCcOi0fyT2SNFwXmZcVCPocEaCscw2cjgnRrpZ1UKOdr22FODU+QxOEsZr8LMV34Fjfg4 X-Received: by 2002:a17:90a:380b:: with SMTP id w11mr25032155pjb.113.1642426104202; Mon, 17 Jan 2022 05:28:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642426104; cv=none; d=google.com; s=arc-20160816; b=rsEefULEdFNwdszW2skXODV49O2vcgRbVRzsE/N40j4juHJY6GJdBRZQz8RCSNXfjw pDnbNAgyt8Vv53Hzx9pAJNy3CTDrxevfa0Z4FvN+UjmMgNgt5bi0W1Ow9LTpcFAcfvB1 4vt+u9hl8KPePWoXqsnw4WEMkNDf5BH3JX6aYyUlG6RKggatojF5alg7hYtrYbejg2+s 0yi3ocM71nvFB2NTG0kg/9SI53vRAxy4qBSutr37G6WcYt4HUBjkGUttxeqoJlDTMuYw Oioj6zID+5GfLxtXDBBx9JeLEYVFyQOoeFChqLs0sE+il+JSRwpVPEkhlGuCTPERWhmR mGxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=kHrC0ZNtdAjmUJmpQtal/sFEceDq2usB7n488HtzJyU=; b=brXnqztNAcaup8fcaIuulXULMFeg9OpI+N01djH8tRxLXoHjBnBkb0njzwl+Pee9dQ JdpmfTB5BKkG5WC5hnNqGoaqL9WcDRFyagHbF8tzpGp2717JiBz5XEFawWbahN+Nv0I/ cdSKWQ4kYcp7sR9HYVx/G1/dPGp7O2IT9WPvDD/BWRWED+e+Tc8zxTYX8WBZR5PFFSqp fZ1I22UH/gcJgHanQakZQ+1AhobmMfQLmpJe9mgN1sI/NG4MtmUUfk+9DTET+zU1oylv tXyLLtSRXQu1iQ4rc3KQg640gETKOm9TUllE4VV6hb+smtyCz6715LKeQ9maMcLYmJfZ TVsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=FoZScfXD; 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 d66si14204253pgc.209.2022.01.17.05.28.11; Mon, 17 Jan 2022 05:28:24 -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=FoZScfXD; 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 S232854AbiAQFkJ (ORCPT + 99 others); Mon, 17 Jan 2022 00:40:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232449AbiAQFkI (ORCPT ); Mon, 17 Jan 2022 00:40:08 -0500 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 365A9C06161C for ; Sun, 16 Jan 2022 21:40:08 -0800 (PST) Received: by mail-yb1-xb49.google.com with SMTP id f12-20020a056902038c00b006116df1190aso30876903ybs.20 for ; Sun, 16 Jan 2022 21:40:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=kHrC0ZNtdAjmUJmpQtal/sFEceDq2usB7n488HtzJyU=; b=FoZScfXDQtIvSINxhwpNPqr2wc4+9o3tgZ/tO5pDjpWmrSWp42+eeYjppN+aSiNv9U kCNvac2PojYKLVlQ1j1aS/lUX8C5R9b2T0ah9mMXlRWXPGSdSO4TNa8FTmHcf6L4cVVN XZQ5/rzLIfYHk0Y8I8peVe9yjflucydPmjMa5wZefbcbq+IBZAEShCoMTlgXiLhTKBzH UtNREaEyhOIYCzRBZOdrrMM/6qB9uUNxYik69csUd01f6LYUmYTbooF6CUm/gQ/h/fj2 9jEs5Oox3RLtIjxK1/Pbn3Ax3MROwHid70HBjtaWPwgHuSZstOGrLjdFdhzXuHezne7b fehw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=kHrC0ZNtdAjmUJmpQtal/sFEceDq2usB7n488HtzJyU=; b=06zEYS73TGTm5KgqiHtwmNLMQhFZYSKmj7b8kLApXBAkrMwm0Z1FmyS/z+Ko2sPf7V +uyhFaX6pMFVQj4ud0qpWWSXkoumkAYOltMhMaXxfACBR4pnJvKw5OhFNaA9fMmEargC 2+qOGh1dvZotePe6bp52ENOT9LSG0IcubCHKgTuietjla9oMLKNZsK4XeKCK4QDv9Z/L vdMYcGc81KNmA2qUDJRksx6xAJdTws1SzTgoPZjslRrvUYfFKZY1rdO/vszJ5Ugj0H9f h4zqpXVLXTe4ShLVeDvn/1WdhIbBYZD570NsT68h8zVoD92GMDbROmE8gs1zb282QjxE 5/MA== X-Gm-Message-State: AOAM530BavWuBrT1IUC4/xXUke2UEVROewwZBTMFVwbwCCFAfACpU9N3 uPOETlE2X3nyK5QRC3gzr8xxLnYVaUFz X-Received: from pumahsu.ntc.corp.google.com ([2401:fa00:fc:202:e7:3de8:f33d:ca1c]) (user=pumahsu job=sendgmr) by 2002:a25:6d06:: with SMTP id i6mr24525004ybc.216.1642398007387; Sun, 16 Jan 2022 21:40:07 -0800 (PST) Date: Mon, 17 Jan 2022 13:39:18 +0800 Message-Id: <20220117053918.671399-1-pumahsu@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.34.1.703.g22d0c6ccf7-goog Subject: [PATCH v4] xhci: re-initialize the HC during resume if HCE was set From: Puma Hsu To: mathias.nyman@intel.com, gregkh@linuxfoundation.org Cc: s.shtylyov@omp.ru, albertccwang@google.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Puma Hsu , stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. drivers/usb/host/xhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index dc357cabb265..ab440ce8420f 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -1146,8 +1146,8 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) temp = 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-initialize the HC during resume */ + if ((temp & (STS_SRE | STS_HCE)) || hibernated) { if ((xhci->quirks & XHCI_COMP_MODE_QUIRK) && !(xhci_all_ports_seen_u0(xhci))) { -- 2.34.1.703.g22d0c6ccf7-goog