Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp227548yba; Thu, 25 Apr 2019 22:02:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqxPUUsSD3LsLfKXrCfE8xeF/vaaDbXW+ArGDfX2U1nuOvrHWkp5jxKHnFlupYEGiFx9TpbT X-Received: by 2002:aa7:9214:: with SMTP id 20mr643819pfo.202.1556254921120; Thu, 25 Apr 2019 22:02:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556254921; cv=none; d=google.com; s=arc-20160816; b=Cl/nwmkwd5EM7hayIOEe1I/KN0xDlCdveHg8tP4XP4A6ayoTUIzbUGl5ugKDnWpL5p 1uOVun11+gJG+v4fM9CxfT+Gx6r6PqkSVxZHdEYG81DVoyfX7jHrh1NXXxIwzt7X6Y2Y SeAhRvo6CGGPSru82T75XEMr8AEKK7QBtGcEBeta6pMxONW7EXoas0XyeVcruA+8sdCH mAW/H2oaCNU68e2QVm3rA4774EY1DuHmy2BhF4Zic097aGJXwgTt0O3fi8D95cRLcv5/ pBVMcl0IRlS+989/gBL23I/wHg+Dk11kEZRjw4TAPyvJh2wpXORiGhPSEZnnnzhyZRCF zyYw== 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:mime-version :user-agent:date:message-id:subject:from:to; bh=vEtsLvIGNLOSD2WSu5i+uFTM+PwtI8G4ib4XelZm+rY=; b=VpWIwm0Tp4WhURYOli73LBrqJxnDZVoxWrOxVtnNvsKJmUcCoqlZk1n1Ahh9wX2eu0 QgZmYsSUllaxIuGzQZV7h33fIqSXyICPS5DMCrQvm1EiPX9H/wkVWIRmy2DpfB3JR49A /R7Eczk7N4nym4+Bw556423NzCWfF1ec2+6hN0bS7On30QdYc2HCUecB2CkLxDQMrzlv QQW4c3IjaNogcoJ4dfhzpwac1H14Gp59/YH/w2aRh0HCCXkk0BcWzNtNyIGI9gr9HtSG 5QFtLXz/IncVAnHd5JQ8PSup0PRjPJm9SlR7EC3naW2pWQXPkxVWpQuNF9Ag0tpFA47Q /VJQ== 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 q80si705239pfq.160.2019.04.25.22.01.45; Thu, 25 Apr 2019 22:02:01 -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 S1727461AbfDZDHV (ORCPT + 99 others); Thu, 25 Apr 2019 23:07:21 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:7691 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726315AbfDZDHU (ORCPT ); Thu, 25 Apr 2019 23:07:20 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 54C66792D86FAE738FF5; Fri, 26 Apr 2019 11:07:18 +0800 (CST) Received: from [127.0.0.1] (10.67.78.74) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.439.0; Fri, 26 Apr 2019 11:07:10 +0800 To: , , , , From: "Tangnianyao (ICT)" Subject: [RFC] Question about reset order for xhci controller and pci Message-ID: <4ae9963b-cfc1-7667-6082-a979725af0eb@huawei.com> Date: Fri, 26 Apr 2019 11:07:10 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 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 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