Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp194641ybc; Mon, 11 Nov 2019 23:21:58 -0800 (PST) X-Google-Smtp-Source: APXvYqysb1pFfLIWgcOyPXJ2f6Lhs21pUSgDI/3p+LtHjYkdwgT/BtWL1TJd2K82rnAgWe+qfOkH X-Received: by 2002:a50:bb48:: with SMTP id y66mr31322288ede.66.1573543318312; Mon, 11 Nov 2019 23:21:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573543318; cv=none; d=google.com; s=arc-20160816; b=j5G7BBW5T0fMpfOkH8r1m/M9LlfAnubbMam+oxTTrsuUJK8PaptXatZYFe1jcTz2Js 6slxmsdKiME36+jsxzJunVDKBHA7VYxZzApxTxXCiq7acex54+iB3DB67pLUn5DRuI36 3240zvKHqs2/v/6H3sAxyZKBg5RfKo48Tg5Xyb57HfgxZJ7XMS5x3fyh5tI+7H6cv5/O 4wwELXXWSn03mrpC9vkAAKKMjlnTcm16QHrYQWprJfLQR+3SFbluMx9n+kGOPtjKm4fv SMeKfftw0Jya5fI0dinVjPwHpZ7TSK8NnHXWtWbU529pWUoawEYijzJgbCcoVPFm8nnN dsBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:dkim-signature:mime-version:message-id :date:subject:cc:from; bh=4YFauzFeS28mrBW+m+MC3Yqh22yBwd8ppo8M7Jb0IoM=; b=MEWTCe24KsTYzzhg66vNdRnEHtXwIxVj027u28ynWUIy7D3iUfIZqOGk/n0Dcf/iqa migA+Z1wwRLrUpF+5Favm2S2NzvHxP3W5E1YbxSR2zBuOP69M9fvO8LsDXBV6NroB7gy rRdZtTzicwKhslIs+axuXhspEBqQdB3uBj8V12p01WwByaXpxFZHtzTYYF4q50fHS1yq RJKVA2ghjp9QTkuPNdumsryGasxrOQuerwlF+/Un4F1kuRs2NQturm2gb/AVCvkD1ZrP 1QEHaI/2VmdYw02jyoplXKz4XiEBTqS0uNq79UM6qHyrttjgObzO7XwjrxBmDc7G9tfq rAZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nvidia.com header.s=n1 header.b=jbcsYfuI; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c11si11187699edb.425.2019.11.11.23.21.33; Mon, 11 Nov 2019 23:21:58 -0800 (PST) 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; dkim=fail header.i=@nvidia.com header.s=n1 header.b=jbcsYfuI; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727133AbfKLHSg (ORCPT + 99 others); Tue, 12 Nov 2019 02:18:36 -0500 Received: from hqemgate15.nvidia.com ([216.228.121.64]:1792 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725283AbfKLHSf (ORCPT ); Tue, 12 Nov 2019 02:18:35 -0500 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 11 Nov 2019 23:18:35 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Mon, 11 Nov 2019 23:18:35 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Mon, 11 Nov 2019 23:18:35 -0800 Received: from HQMAIL105.nvidia.com (172.20.187.12) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 12 Nov 2019 07:18:35 +0000 Received: from hqnvemgw03.nvidia.com (10.124.88.68) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Tue, 12 Nov 2019 07:18:35 +0000 Received: from henryl-tu10x.nvidia.com (Not Verified[10.19.109.97]) by hqnvemgw03.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Mon, 11 Nov 2019 23:18:35 -0800 From: Henry Lin CC: Henry Lin , Mathias Nyman , Greg Kroah-Hartman , , Subject: [PATCH] usb: xhci: only set D3hot for pci device Date: Tue, 12 Nov 2019 15:18:30 +0800 Message-ID: <20191112071831.1043-1-henryl@nvidia.com> X-Mailer: git-send-email 2.17.1 X-NVConfidentiality: public MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1573543115; bh=4YFauzFeS28mrBW+m+MC3Yqh22yBwd8ppo8M7Jb0IoM=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: X-NVConfidentiality:MIME-Version:Content-Type; b=jbcsYfuI3mMwc+sOkFX07SgWsd0RiP5BkXjVdQenq4401f7/TKGL3Vjb+7n/kiv0O whU2dAwalTi3JTsOdvJrV4GP2WHhKSQuXfbwzoonpMLEbz9dx7HA4u4aqDHiECIaw1 5O/MVJJKrFcYgozq2NT6gXaoZ5yEmyVUj03BKbnq/h/fl74zseNyls5XbDjbQ3y7Cj BzrOA1BZ3n276CNg2++p81ZkPP/PF8ERPUsgqtEThE3JgRgAh2TYV9JC4GblFVVIK3 1e/h4fi3wH5HXVMW4ToxQ//bp1juyKNvK5Nsry8pQgsI0Ur8Jfr7rVeXkNonX8Tc9J svbPg00+zdsWQ== To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org xhci driver cannot call pci_set_power_state() on non-pci xhci host controllers. Signed-off-by: Henry Lin --- drivers/usb/host/xhci.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 6c17e3fe181a..1fc16763dcda 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -761,6 +761,8 @@ static void xhci_stop(struct usb_hcd *hcd) mutex_unlock(&xhci->mutex); } +extern struct device_type pci_dev_type; + /* * Shutdown HC (not bus-specific) * @@ -791,8 +793,12 @@ static void xhci_shutdown(struct usb_hcd *hcd) readl(&xhci->op_regs->status)); /* Yet another workaround for spurious wakeups at shutdown with HSW */ - if (xhci->quirks & XHCI_SPURIOUS_WAKEUP) - pci_set_power_state(to_pci_dev(hcd->self.sysdev), PCI_D3hot); + if (xhci->quirks & XHCI_SPURIOUS_WAKEUP) { + struct device *dev = hcd->self.sysdev; + + if (dev->type == &pci_dev_type) + pci_set_power_state(to_pci_dev(dev), PCI_D3hot); + } } #ifdef CONFIG_PM -- 2.17.1