From patchwork Fri Aug 30 04:35:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: WangYuli X-Patchwork-Id: 13784221 Received: from smtpbg151.qq.com (smtpbg151.qq.com [18.169.211.239]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA19D13A243; Fri, 30 Aug 2024 04:35:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=18.169.211.239 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724992546; cv=none; b=Cuh0qweVYnXpuSldhfHO4qnkKz+wcQoQWVGZXniwIGYw2qa+Tp+jCjs7SsiakRNOLsgKFRLJ41gDtCjEh39iPSerNuVWnGaGOcThrY8zK9HnmociP4+jEIdmVEP1IfD4M8DP4CV5f8+hUG7HpzmdEZtNI40TlGkgo809w37900Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724992546; c=relaxed/simple; bh=k8iZsNTtKJaY4KrPbao77OpWpCtkeDS9Qri6sWFV9K4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=q0Cm/2/O5B4BWkz7y9ju/aiqxahewBLYbNNsBIvHuFpAisX8rHrpJwDdRvKtz6IZ8p9k1HrYvFBl7QxQXA+U5E9cZzd9VRiF+gd0ZdrG1uVp5w/ZdbVAnZqLtDjCHqzfM3t86gjLg46EyMrD8iSm3I+jCLnQr3IYtcG6Gg1QZ/s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=uniontech.com; spf=pass smtp.mailfrom=uniontech.com; dkim=pass (1024-bit key) header.d=uniontech.com header.i=@uniontech.com header.b=NugCcmDI; arc=none smtp.client-ip=18.169.211.239 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=uniontech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=uniontech.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=uniontech.com header.i=@uniontech.com header.b="NugCcmDI" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uniontech.com; s=onoh2408; t=1724992536; bh=8qBzQwgYsY4ubs4l8prqTqP81cjjw7skeJAupAJWkFw=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=NugCcmDIrAj806984E15UHIbkFsI1BCyTXkegOJZw0BK6MXEjVwn+YwyR3BoTY6qe 4qwd25zxiG9MZ44aHTHcq9nK5kMEmhruLH7Lf5oFLJgA8e0ggbtoBaXZQiME4GyhLg nyX8jhaRWUyHgnR6eyV1bep09UXmNzsh1Q35sKw8= X-QQ-mid: bizesmtpsz8t1724992514t8rm70f X-QQ-Originating-IP: yMlasQ9nqXGI3gjPJJ82QDbogkgWixdYJ96Pp5PDQ4Y= Received: from localhost.localdomain ( [113.57.152.160]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 30 Aug 2024 12:35:12 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 1 X-BIZMAIL-ID: 12964494124644593964 From: WangYuli To: mathias.nyman@intel.com, gregkh@linuxfoundation.org, sergei.shtylyov@gmail.com, helgaas@kernel.org, yuzenghui@huawei.com Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, guanwentao@uniontech.com, WangYuli , Chen Baozi , Wang Zhimin , Chen Zhenhua , Wang Yinfeng , Jiakun Shuai Subject: [PATCH v3] usb: xHCI: add XHCI_RESET_ON_RESUME quirk for Phytium xHCI host Date: Fri, 30 Aug 2024 12:35:09 +0800 Message-ID: <51AD65BA61BA0881+20240830043509.31019-1-wangyuli@uniontech.com> X-Mailer: git-send-email 2.43.4 Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtpsz:uniontech.com:qybglogicsvrgz:qybglogicsvrgz8a-1 The resume operation of Phytium Px210 xHCI host would failed to restore state. Use the XHCI_RESET_ON_RESUME quirk to skip it and reset the controller after resume. Changlog: *v1 -> v2: Move the PCI_VENDOR_ID_PHYTIUM form pci_ids.h to xhci-pci.c v2 -> v3: Change "||" to "&&", that was a mistake. Co-developed-by: Chen Baozi Signed-off-by: Chen Baozi Co-developed-by: Wang Zhimin Signed-off-by: Wang Zhimin Co-developed-by: Chen Zhenhua Signed-off-by: Chen Zhenhua Co-developed-by: Wang Yinfeng Signed-off-by: Wang Yinfeng Co-developed-by: Jiakun Shuai Signed-off-by: Jiakun Shuai Signed-off-by: WangYuli --- drivers/usb/host/xhci-pci.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index b5705ed01d83..bfb8f0699475 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c @@ -55,6 +55,9 @@ #define PCI_DEVICE_ID_INTEL_ALDER_LAKE_PCH_XHCI 0x51ed #define PCI_DEVICE_ID_INTEL_ALDER_LAKE_N_PCH_XHCI 0x54ed +#define PCI_VENDOR_ID_PHYTIUM 0x1db7 +#define PCI_DEVICE_ID_PHYTIUM_XHCI 0xdc27 + /* Thunderbolt */ #define PCI_DEVICE_ID_INTEL_MAPLE_RIDGE_XHCI 0x1138 #define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_2C_XHCI 0x15b5 @@ -407,6 +410,10 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) if (pdev->vendor == PCI_VENDOR_ID_VIA) xhci->quirks |= XHCI_RESET_ON_RESUME; + if (pdev->vendor == PCI_VENDOR_ID_PHYTIUM && + pdev->device == PCI_DEVICE_ID_PHYTIUM_XHCI) + xhci->quirks |= XHCI_RESET_ON_RESUME; + /* See https://bugzilla.kernel.org/show_bug.cgi?id=79511 */ if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == 0x3432)