Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753887AbdHWK5B (ORCPT ); Wed, 23 Aug 2017 06:57:01 -0400 Received: from mail-dm3nam03on0061.outbound.protection.outlook.com ([104.47.41.61]:52434 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753750AbdHWK46 (ORCPT ); Wed, 23 Aug 2017 06:56:58 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Sandeep.Singh@amd.com; From: Sandeep Singh To: gregkh@linuxfoundation.org, mathias.nyman@intel.com, ben@decadent.org.uk Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Sandeep Singh , Sandeep Singh , Shyam Sundar S K , Nehal Shah Subject: [PATCH] usb:xhci:Fix regression when ATI chipsets detected Date: Wed, 23 Aug 2017 16:26:00 +0530 Message-Id: <1503485760-15146-1-git-send-email-Sandeep.Singh@amd.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [202.56.249.162] X-ClientProxiedBy: BMXPR01CA0014.INDPRD01.PROD.OUTLOOK.COM (10.174.214.152) To MWHPR1201MB0063.namprd12.prod.outlook.com (10.174.98.14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 89f0f586-f420-4eef-64cf-08d4ea15abb0 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(48565401081)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:MWHPR1201MB0063; X-Microsoft-Exchange-Diagnostics: 1;MWHPR1201MB0063;3:Msp2BSDbkbtjJE7ijotNMLhYsxbDavaW30hy4tAIxn12VP7lYKA8qGU5TPmCBWLsGVnRg7JGO9C3OFLuw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mmuqQ33o86xM6OdTAvHTRFEKhIMzD4VodPNKRLr48kTOpIyb0wwsjGp8NRCiFFCeLM6FdN1coGQKRQLi1avkA3cZlEC+dyoDXi1EDhnsb2Wb0W3+IcK8On9UO6MX0bJEjV6Tt982SjbE4Y+MACwWKwtytS8o/2KIQnFe7QbuIlkMdjXkCncYAEpS12nq2pd1R4D8YHBqnssDJBHQr8HlyoSlCMXgogUfLEJ90nwHowyE/J32WSKxGqe8BPr9/47mf5YYfX0I0j;4:4p3RWk8I4lrnPpLEbKQTYkzUB+94tlVgGfMKASHaJ5hmwJECbi804IcX+IEWqrm/fx4mRKrfIMKJkHs7eOo8fUDrVOx7Kv//juMx8ZZC3HFx6Gy2qa5oe48bJMZS/udHoQO0w3HwZUWH4hcHzgNbfgfyKWnKXQx0HjUrU+AYM4OjrNZOi1GaWeCQFw/U2DgWgQVfg4MXfsg5TH45iwld4GgQH/iymNguRYes8KF/YC5v/W8VLJAnrGyCV0M1Fdrok3cbJd7/t7PNwCdV6xK0ku9a+tYlnwZ6beJezv1gj8Y= X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(6055026)(6041248)(20161123564025)(20161123558100)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:MWHPR1201MB0063;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:MWHPR1201MB0063; X-Forefront-PRVS: 040866B734 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(7370300001)(4630300001)(6009001)(39860400002)(189002)(199003)(106356001)(305945005)(53416004)(66066001)(50226002)(81166006)(42186005)(25786009)(4326008)(47776003)(50466002)(189998001)(48376002)(7736002)(6666003)(6486002)(97736004)(8676002)(86362001)(81156014)(53936002)(6116002)(101416001)(110136004)(54906002)(68736007)(7350300001)(478600001)(3846002)(2906002)(105586002)(5003940100001)(5660300001)(72206003)(36756003)(50986999);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR1201MB0063;H:andbang2.amd.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;MWHPR1201MB0063;23:wFyVRtNE7obGapwDk9AMh/NSxVeBSKWpvqGv1zx?= =?us-ascii?Q?PKoKWHHE/jxilQy0oZ0YI58zcHqJx8+qKqZuYOz9QZq3CKXIAdWAqjKLvVPS?= =?us-ascii?Q?DLxKqz1uqZ4ZnmW79XFMRW9UR5O6iwcGOCPNTY/khC0nY8hBssXFgNuK/qzx?= =?us-ascii?Q?GePRQbPCXv+b1BuXtDoIp8ZvBatVwXd3pxhwbck5iyjurWRA4PlF0rWmZOO0?= =?us-ascii?Q?lqvtqQmJ8kKYH+T4Ll7gK59BnDq9OuqqyTy5oz9yEr8tibmEeKuF3pDSK8HU?= =?us-ascii?Q?N9JIm8vna28oR+koQjbwfeo6s8Qnf06v6qaSIZuEIVgQiR3C4dTpE6OLtIjJ?= =?us-ascii?Q?K6nBnwgyybKtyssRzoiERLpxuXg/7vGm6I9sE62t6yuxmoziAicDJPGNbVS1?= =?us-ascii?Q?XcQz26mevBbxY9T+OhOg7lzEa/iDnowPTHZfOxAimLA3q37jtBYmHM2/LWNm?= =?us-ascii?Q?6DG/4bsGg5pHSZlCpFEpcS9OkkG1S02oK67p43TddDhoG5qoTqTeXgTEQUeD?= =?us-ascii?Q?/0L8XZ3pa1O0SJ8oNTYdDyCaU2c3f/s6YbYr7tPGJoNIZmbs8BQkxrGIaqn2?= =?us-ascii?Q?Am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jsITVXGU4CIzcQ2h0wacIJ9wW9U+RrZsHGpx9HpxQsNpGENzADT5g==;24:71Eyy/VCs7m3/r9XcI1nU1onsYup7eIJvwCGpY7RUTSp0jbRqmsjqgHzWvfnTwbpJ+iHmFXYFfxEcwXcGWpjwxFYltRblabBSFYX0vZCnls=;7:OMvj9VkKuq+sO/TB6DZk2j/Vcs10K3+wQOWXkX8qtPiwBk3yuvUdTAiCyC5yoJeJCHcYXE2vYskMeSRwnTrYSRc5euUTfY6LrtoFn1tL1VkRYeGAiHHkVOxELhDtE0WpNtZW06oFJQUFJYkM2YlDSqNnpBxm/MpPFlhH94hZZA0iJPyswwywKF8QO60v1bxO5ny9U5Yh3j6ivg5CaerNMo4/re/FyQC5UODB7ya7NXI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;MWHPR1201MB0063;20:rIFPU/flXafwC8zxJxofk1EnaOwnvl7/My64YOO+huyeNn7aLs1i5+6QAOdkYHjcRq6qyE+a2E4JSIulWBwLBJe6JvLrdq9az5akf6UnFlL0ZnHlPKFSpOLl0zF/gTCTQHTNKt3eM7P3s2bSBe9KxkWgH6EigpiLpmWZbjHx6N+6Hwk4feRwO79rrq4kf8Lh3Rp3PyKQL8kqn/c04ulvO7v8GWmyZB81caDkbmHBqYGWZw/kjbSbXNatKmEUyLWJ X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2017 10:56:48.3323 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB0063 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2459 Lines: 74 From: Sandeep Singh The following commit cause a regression on ATI chipsets. 'commit e788787ef4f9 ("usb:xhci:Add quirk for Certain failing HP keyboard on reset after resume")' This causes pinfo->smbus_dev to be wrongly set to NULL on systems with the ATI chipset that this function checks for first. Added conditional check for AMD chipsets to avoid the overwriting pinfo->smbus_dev. Reported-by: Ben Hutchings Signed-off-by: Sandeep Singh Signed-off-by: Shyam Sundar S K cc: Nehal Shah --- drivers/usb/host/pci-quirks.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c index 5f4ca78..58b9685 100644 --- a/drivers/usb/host/pci-quirks.c +++ b/drivers/usb/host/pci-quirks.c @@ -142,29 +142,30 @@ static int amd_chipset_sb_type_init(struct amd_chipset_info *pinfo) pinfo->sb_type.gen = AMD_CHIPSET_SB700; else if (rev >= 0x40 && rev <= 0x4f) pinfo->sb_type.gen = AMD_CHIPSET_SB800; - } - pinfo->smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD, - 0x145c, NULL); - if (pinfo->smbus_dev) { - pinfo->sb_type.gen = AMD_CHIPSET_TAISHAN; } else { pinfo->smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_HUDSON2_SMBUS, NULL); - if (!pinfo->smbus_dev) { - pinfo->sb_type.gen = NOT_AMD_CHIPSET; - return 0; + if (pinfo->smbus_dev) { + rev = pinfo->smbus_dev->revision; + if (rev >= 0x11 && rev <= 0x14) + pinfo->sb_type.gen = AMD_CHIPSET_HUDSON2; + else if (rev >= 0x15 && rev <= 0x18) + pinfo->sb_type.gen = AMD_CHIPSET_BOLTON; + else if (rev >= 0x39 && rev <= 0x3a) + pinfo->sb_type.gen = AMD_CHIPSET_YANGTZE; + } else { + pinfo->smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD, + 0x145c, NULL); + if (pinfo->smbus_dev) { + rev = pinfo->smbus_dev->revision; + pinfo->sb_type.gen = AMD_CHIPSET_TAISHAN; + } else { + pinfo->sb_type.gen = NOT_AMD_CHIPSET; + return 0; + } } - - rev = pinfo->smbus_dev->revision; - if (rev >= 0x11 && rev <= 0x14) - pinfo->sb_type.gen = AMD_CHIPSET_HUDSON2; - else if (rev >= 0x15 && rev <= 0x18) - pinfo->sb_type.gen = AMD_CHIPSET_BOLTON; - else if (rev >= 0x39 && rev <= 0x3a) - pinfo->sb_type.gen = AMD_CHIPSET_YANGTZE; } - pinfo->sb_type.rev = rev; return 1; } -- 2.7.4