Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5137443pxb; Wed, 19 Jan 2022 11:50:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJxPaWIKJs9xl4hiTSIZh3A7xIWlQeO1/jtGhMuk5Gx6FXKPDE04bb8tEBdQsBlb2oANILZh X-Received: by 2002:a65:6a97:: with SMTP id q23mr29231971pgu.464.1642621851565; Wed, 19 Jan 2022 11:50:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642621851; cv=none; d=google.com; s=arc-20160816; b=NyYUhioTfkBEn13cGI5Hb+3FCM6wRNMUxjxSwHPkEe6cpMiCv28ojV0ee7J9cJMhRv sG5FWJa70CdV2ZOAckqavaUibf9EmhMw6alhCI1DCebVCtxelbd1HSGAcVmN7SKQIEm6 xbpR4fCEa3TQPV6cmMJSzRhJJ/iUuvd5M1ZEC5Nc0jtP3rkKFHZxhAiLyyci5K9e0fwn FYl7bLfB2Xoa0yIi6ffCjoF960cKFGzqTcgzRmqd+Q1oMuMHY1fGK3C09EIt1DT9MKP0 ocOYPGD0+WvmQ4UstF6RoyqIBSDS1OOd+vMgNWBlR9QvU9zmBfpoVgwYOlsUbfDWvfPi mR7w== 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=werjgtfLJkCP6XvKlLZntqYlamvXmge4L1VauqJtNeY=; b=fNqkKak4/3zCSy7p0WxDH4pNIfSk2DEBNQVdEKmj4aPZfFj9ZiJjlSqTZZdEVTLyF2 RbmJGWRpEO0pTeZcw98yHoLP1gKndCI9wkgPSFzhH9SPx/zD2PvBwoYnErQQkoXrHREf timMfhMWb1CiRuATXwW6GnqT6jKi0lWellNJcwHyQDbiq/W8z5awiO9UMxiwnBadKCVY bQDGxVVoRSeoZWszpnSxXda6h2Uj5hFF3Rx8P/oBTEwHf0C+Wi4gonie+tf1XB0uKyok 8iQMg16wunNzTGeWjzgqCMjMW7OFTpgbTbunnKhI8MmA+LKmUpgHawabAKWNfj6KV8yo 75Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=HagPAQv1; 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 k26si816623pgm.319.2022.01.19.11.50.39; Wed, 19 Jan 2022 11:50:51 -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=HagPAQv1; 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 S240075AbiARGvV (ORCPT + 99 others); Tue, 18 Jan 2022 01:51:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229486AbiARGvU (ORCPT ); Tue, 18 Jan 2022 01:51:20 -0500 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77892C06173E for ; Mon, 17 Jan 2022 22:51:20 -0800 (PST) Received: by mail-pj1-x102f.google.com with SMTP id n16-20020a17090a091000b001b46196d572so1905120pjn.5 for ; Mon, 17 Jan 2022 22:51:20 -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=werjgtfLJkCP6XvKlLZntqYlamvXmge4L1VauqJtNeY=; b=HagPAQv1Ulr0Q1aSVtQ+foapRIoRkSmyUk8RzGOS12R7ORrBCZqyr2Eju+pun2M/Hy pROOjIXbfjcJSJgJfoCevcoM237fiSrl0rDX+wNPtoECDCA/19JL7xF5di4a2pPy4Hp+ DcheRu/b7G7ED2VnFJBP6yENS35azMfzs30oFltv7G6Kfs/9pycaQGwoQ6bSRfybsKPB 0PDRoF8mFXZzlgo9B6MsEqYOw+IWmFr7mnL3dOw40b9HYbobDhfVxjo9z+vUaAn4hjJQ lcxcdgvcF042RhSjhFtW/Z0Y0h4qOZyZ+KuPMQ5ne1+Ivra0D+e/x7MG1EhdwrMcFCkl 7dgw== 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=werjgtfLJkCP6XvKlLZntqYlamvXmge4L1VauqJtNeY=; b=8FYnPP7h3QNhJ+Hy46VUu4JSRY0yczvOhuNG5lBzbtjFzChX9YztWkHn6zxFe/DG0V 0+Rueg1lSuIIZ6YUfDzUhsuUGXEJMebGYm4bhyHl7ddZucpmonhCAzqqAcrVHuiEezXD 3SmQShz0ZkgOfJ/XTnD7Vdl2FMWtSFhDXRkxP36r7J+7ET+q0Om97wIMwdTYepQTIuer nLuP7hMlc7IdC5a9rPX55YBpkV3ecuMEdSIscZj4dNZ0Pl/UaBa6DlO46JqTtKo1U44p +gWol/zKW++OH7OytfmOfb7iIo4pibR7dBCmxc6d0Nm5W0qr+ubJNovwgIkdrBpqFVaw JyPw== X-Gm-Message-State: AOAM533mGPtNnNmEubgnh66/5WIDcIoLRClOS07gryJKIo2RItWqebh+ PRY7bzlVimicLD5lDxjOFkGl9KRDFsYaM2P3+biqtw== X-Received: by 2002:a17:90b:1095:: with SMTP id gj21mr33900113pjb.121.1642488679407; Mon, 17 Jan 2022 22:51:19 -0800 (PST) MIME-Version: 1.0 References: <20211229112551.3483931-1-pumahsu@google.com> In-Reply-To: From: Puma Hsu Date: Tue, 18 Jan 2022 14:50:43 +0800 Message-ID: Subject: Re: [PATCH v3] xhci: re-initialize the HC during resume if HCE was set To: Mathias Nyman Cc: Greg KH , mathias.nyman@intel.com, 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 Mon, Jan 17, 2022 at 8:20 PM Mathias Nyman wrote: > > > >>> This seems like a big hammer for when the host controller throws an > >>>> error. Why is this the only place that it should be checked for? W= hat > >>>> caused the error that can now allow it to be fixed? > >>> > >>> I believe this is not the only place that the host controller may set > >>> HCE, the host controller may set HCE anytime it sees an error in my > >>> opinion, not only in suspend or resume. > >> > >> Then where else should it be checked? Where else will your silicon se= t > >> this bit as part of the normal operating process? > > > > We observed this flag while resume in our silicon so far. According to = the XHCI > > specification 4.24.1, =E2=80=9CSoftware should implement an algorithm f= or checking the > > HCE flag if the xHC is not responding.=E2=80=9D, so maybe it would be b= etter > > to implement > > a new API to recover host controller whenever the driver side finds no = response > > from host controller in the future. > > > > As all the code to reset the host during resume already exists, and is we= ll tried > due to issues in resume being so common, I think it makes sense to add th= e HCE case > here as well. It's a simple fix that makes the life of users better. > > That said we shouldn't hide the reason for reset like this. > Print a debug message telling about the HCE so that everybody working wit= h xHCI > can see it and start fixing the rootcause. I will print a debug message in next patch version. > Another HCE check could be added to command timeout code, but just to sho= w a > warning for now. > Reset might not always clear HCE, and we don't want to be stuck in a rese= t loop. > This check could be a separate patch Maybe I can try to make this in the future. Thank you for advising. > -Mathias