Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3181194yba; Sun, 28 Apr 2019 19:34:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqwEedpyB8fqlOIByvchxZp1kEyWDmHdmJLzuEN+4hX/EMy4ehLFPAX6WCim7KFfKLgp9DE9 X-Received: by 2002:a17:902:29a7:: with SMTP id h36mr59897325plb.319.1556505258962; Sun, 28 Apr 2019 19:34:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556505258; cv=none; d=google.com; s=arc-20160816; b=KmQrKxYYkGZKCcVWE1Q8iI0DV02VCfUKxhRP6DrRLv0DdmNkFKWVhmo/T+GaUZ4guR JmTx8De6eVd+dS3Xt7d+FEc/cLlKpO88wau6/QeGxfV5w04tHtpgCpMbRmAYXOtRWwNc no0wD2q6X+7mNurhj3gpDDWy2IvGN5LXk2v1J71g/xuKqvl2/QR1eF6qlukhPhrhF1xA LqMdVwfEKLzghdwdeoBuh3Vsd4L3B30mUIgc0WgflsalNoEtw8IEXbf4QrtlKBUZn3TX jhmMeLXU5O0cZINfw3U+bfuqhbaW3JizDKmbiS4Q+w0ywCAXQe45fFOYZdn6k73tSuT/ hS5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:to:subject; bh=pQ6H/U7O2MF1iBMqa3+EQsVYE2OjKxtEnHqJXz+ZuKU=; b=Z+08xlS9ObqadT0V7LzqMXABm0sP0tBeQ77UMgxUO16z9neHbAUCni835rn8/uKU1P Me0DnceVfYXftAMBylAraKA36EknV6aJR8qzJRhqgvudCDVXwlkkkBWFiaz1jV3OHeS8 Fw8K83VTg9GlAG81hYTtzK1Jik+NUSoF7JVVgEYpjHCQxBu5UMl6KnX/oS6BIQ33opEr CxgjeVBPV5DeqIYZ+8ABNFdBYKWflR8XISL6SgX4xchRXWLp+dZ7s3t1XE57Z3bMNMWv 6fNXc8wXiIk6o7wwKGmCWBIHuON+0OVhaI/UVkmFBsuIXZB3j1rfMyh2dW4ENDHboj7w wqdA== 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 m6si29540851pgq.116.2019.04.28.19.34.03; Sun, 28 Apr 2019 19:34: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 S1727148AbfD2CdO (ORCPT + 99 others); Sun, 28 Apr 2019 22:33:14 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:53072 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726819AbfD2CdO (ORCPT ); Sun, 28 Apr 2019 22:33:14 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 7961D2ADFCC4B4BEFE0E; Mon, 29 Apr 2019 10:33:12 +0800 (CST) Received: from [127.0.0.1] (10.67.78.74) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.439.0; Mon, 29 Apr 2019 10:33:08 +0800 Subject: Re: [RFC] Question about reset order for xhci controller and pci To: , , , References: <4ae9963b-cfc1-7667-6082-a979725af0eb@huawei.com> From: "Tangnianyao (ICT)" Message-ID: <160fa1ea-2e82-343b-d5d6-2b9adde70cf4@huawei.com> Date: Mon, 29 Apr 2019 10:33:08 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <4ae9963b-cfc1-7667-6082-a979725af0eb@huawei.com> Content-Type: text/plain; charset="gbk" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.78.74] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Using command "echo 1 > /sys/bus/pci/devices/0000:7a:02.0/reset" on centos7.5 system to reset xhci. On 2019/4/26 11:07, Tangnianyao (ICT) wrote: > Hi,all > > I've meet a problem about reset xhci and it may be caused by the > reset order of pci and xhci. > Using xhci-pci, when users send reset command in os(centos or red-hat os), > it would first reset PCI device by pci_reset_function. During this > process, it would disable BME(Bus Master Enable) and set BME=0, and > then enable it and set BME=1. > And then it comes to xhci reset process. First, it would send an > endpoint stop command in xhci_urb_dequeue. However, this stop ep command > fails to finish. The reason is that BME is set to 0 in former process and > xhci RUN/STOP changes to 0, and when BME is set to 1 again, RUN/STOP doesn't > recover to 1. > I've checked BME behavior in xhci spec, it shows that "If the BME bit is set to 0 > when xHC is running, the xHC may treat this as a Host Controller Error, asserting > HCE(1) and immediately halt(R/S=0 and HCH=1). Recovery from this state will > require an HCRST." It seems that the stop ep command failure is reasonable. > Maybe I've missed something and please let me know. > > linux version:5.0.0-rc3 > > Thanks, > Nianyao Tang > > > . >