Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3353883pxb; Mon, 17 Jan 2022 18:23:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJxY9/sBCw0NzHz9IlzlN0UOZ3RMhRWvKH7j6jOv+1lHKEv9XA4iH4ASbQcBPecCwQW7UYdQ X-Received: by 2002:a17:902:6841:b0:149:6791:5a4f with SMTP id f1-20020a170902684100b0014967915a4fmr25162571pln.123.1642472639739; Mon, 17 Jan 2022 18:23:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642472639; cv=none; d=google.com; s=arc-20160816; b=scauoEakRePsmlSotBy0Z5D9YQk7qx82ytGpxju9frw3QeFMYxICIkz8tl4gVMyWBZ dFXJJkjOhvA8wjm45NhS7a4QkPaMMKwPUezGxriUDrP5QGKRYTmRRKcqD/9DORTgwlCU yrs8QsULI0kpopBCoa4tJp0IuNpTcPV4SXiCXgC/0Xt5NkPPPjO7SjKeVOsdXTnOfp6R 5JVfWMa27+lr8nz4mTd2VZUBw8Lb+Rpcap8fLF/r25R+eVbGNDI8pRr4YHwAmhJthd3o nrq5LxRIsryItou2CHxJ30PZlKamcPKuILabEclzg3s/DrlMx7CjjqBkigvOaNnt+Oid h3XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=qasTN3jDoXVbJHcg2XL6N8HSDqp1KWR7Mf2YIKyAvhM=; b=CSqTFBPoJPDtEOyF0s+d2/l2EhvG8LxAcHRr3ICJ8lIIbRwvSZai4RAXXqsVV/9PNo x/iSgoY/UiS3Up0S77loaT6qpM7mknue9EmQmUJn0sr26KbzZ9PVPd2JjNAYxB5gtvkq ll0ULnbaT4BuIK8w731vRqAp7VpHdDDseJsJEtc7TIuCZ6XWgyGt/BAzYWuJp8jDu85E x7oHCY0y5YezwbZE1hmBUW2XQ79f8utGgzlXg9InXJbz/jZzF3rq2dtk0hBnJJPuYF4E 2xsganRL5a6FLEgpaGHR29Ura9lROC8if/Ry+OrLG3AW63gTzVRLIbX5ctfTg9emRs8d V2Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Efc9uyYP; 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=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b11si4988943pgi.208.2022.01.17.18.23.47; Mon, 17 Jan 2022 18:23:59 -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=@intel.com header.s=Intel header.b=Efc9uyYP; 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=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239852AbiAQMXa (ORCPT + 99 others); Mon, 17 Jan 2022 07:23:30 -0500 Received: from mga12.intel.com ([192.55.52.136]:27708 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239588AbiAQMX3 (ORCPT ); Mon, 17 Jan 2022 07:23:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642422209; x=1673958209; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=7qgtDhFYqtyV75FVvzgVQnoln6aCvcYogDhoI1pjh38=; b=Efc9uyYPULax0S2Jbs/xm4suxL/ND0mToRKvbLob+4cfmn7QUM8EJLsn 0rfRVvVnuRkAdH1gzL8kYptL8qc8CzS82bxX/s6LIVU7Xayn9IUs3uhQ4 YEd6FqsWVIV6s0rCFkKRctiOw7GpmsHOLHUZkEHRgNN8JdqwcZ9GYaKRe pnpf9JmDJ+ihNm4y7bODBeo/lVGmz9jBT2nnN0RmLuRfu/tt4f1jrXivw P8RvK7cRhpw7J7EiHl3OGQM3/kM6Px68Q01VsmmpFCUYaeZp8jnGC//Zo wIdhfoAs+YZE5SA6is+u+4fWgV9vADUh3PnqmrMXcF4ydo816tXcqWLqH g==; X-IronPort-AV: E=McAfee;i="6200,9189,10229"; a="224592813" X-IronPort-AV: E=Sophos;i="5.88,295,1635231600"; d="scan'208";a="224592813" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2022 04:23:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,295,1635231600"; d="scan'208";a="625176278" Received: from mattu-haswell.fi.intel.com (HELO [10.237.72.199]) ([10.237.72.199]) by orsmga004.jf.intel.com with ESMTP; 17 Jan 2022 04:23:26 -0800 Subject: Re: [PATCH v4] xhci: re-initialize the HC during resume if HCE was set To: Puma Hsu , 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, stable@vger.kernel.org References: <20220117053918.671399-1-pumahsu@google.com> From: Mathias Nyman Message-ID: Date: Mon, 17 Jan 2022 14:24:54 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20220117053918.671399-1-pumahsu@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17.1.2022 7.39, 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. > > 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) { Add a debug message in case we reset due to HCE -Mathias