Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751182AbdHXE2d (ORCPT ); Thu, 24 Aug 2017 00:28:33 -0400 Received: from mail-by2nam01on0088.outbound.protection.outlook.com ([104.47.34.88]:27743 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750806AbdHXE2a (ORCPT ); Thu, 24 Aug 2017 00:28:30 -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 , Nehal Shah , stable@vger.kernel.org, Sandeep Singh , Shyam Sundar S K Subject: [PATCH] usb:xhci:Fix regression when ATI chipsets detected Date: Thu, 24 Aug 2017 09:57:15 +0530 Message-Id: <1503548835-27057-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: PN1PR01CA0077.INDPRD01.PROD.OUTLOOK.COM (10.174.144.145) To CY4PR1201MB0053.namprd12.prod.outlook.com (10.172.77.140) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b15b1b0f-d7c0-4c9a-4f85-08d4eaa89214 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CY4PR1201MB0053; X-Microsoft-Exchange-Diagnostics: 1;CY4PR1201MB0053;3:nk79pXJtwow9E5HWhQGJwaQRkGWnTkQcOCKpw7HVINb5fg0vMeZEEM+c0UDVvHPpMO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7NDxtl5wxotABKVVkgCBCaXbHl1ktBI25LJ8BHJUa9u878Mw9cd2fxVdKgKV38kdNN88rtvV/LkuCk9wBingpPFQtLJBy8soVyI9/oEQecoZWORYaTNVUnOCNtDuPUTWZ6B/hwdFI7SpXjamQu993e7cA7pMyaAqwmFpdQOTHKxbCpga+6pHTijuYJXK/jR4TFr1lYnP3jxmZSPctd6cyZH4riFVFqIKBLw8t6j2zxsJIG0Obct5jMa52q6Q7vSRPG+hl6O7cMIc0rZRPlMTBpvmVs9maDdnNTg63tEl;4:yaaDGSvbm5xEa4+tIV7fYUjDOIq+FuhjVdJl1NDHvbvtNpTF9Rv+HgliOwogtPeX/lxc1WtkxFeINe9ADtTkOo2mJ56OqzfvR5I8PSWjxf/SQG1NDjuc0VqFrR0j+hByfDp2i0X0dFwXMiS8PIV3ainwRbxYgbQepDOT2baPPsMShLC50drasnqrPKJgMDTKa3MKVGCUvTTfhojgQm3N52AtrBZWVccqDgPd1b2epdnS5AUQGnkPx9vGyAEGI1zlIYKfVucbjh0c0PVswslMXOXWPVEQrV2Qygect4XDWqv7EnM1ol5xSTBs0H0orv5wwxF9GXttpFuSNP89plonJQ== X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(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)(10201501046)(3002001)(93006095)(93001095)(100000703101)(100105400095)(6055026)(6041248)(20161123558100)(20161123560025)(20161123564025)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY4PR1201MB0053;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY4PR1201MB0053; X-Forefront-PRVS: 04097B7F7F X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(7370300001)(6009001)(39860400002)(189002)(199003)(7350300001)(72206003)(101416001)(50986999)(81166006)(6116002)(66066001)(81156014)(50466002)(110136004)(68736007)(48376002)(3846002)(5003940100001)(7736002)(4326008)(36756003)(25786009)(305945005)(5660300001)(106356001)(189998001)(86362001)(97736004)(50226002)(6666003)(478600001)(47776003)(42186005)(54906002)(6486002)(53936002)(105586002)(2906002)(8676002)(53416004);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR1201MB0053;H:andbang2.amd.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY4PR1201MB0053;23:RHjxnjYgfpXK5Tbn3HNiPIV4erdPulSOJ2ThhE+?= =?us-ascii?Q?sDAfKmMP4CJYkJpW25LN17U2OICZ0cX1LEhAhW2SNX6fZ6iuXZbPbdiu1tk7?= =?us-ascii?Q?2chgGaXG05lKp9yR2dsYQ0b9VjR6Ej1IA81JtHW95Y+iQE5/rJDpwXtsuyZd?= =?us-ascii?Q?XpvGXMwDlflPsYn2KOM/UWBTQ58DyzlnGd1c4qGKG2RWmvPhugsBeS4PDjQy?= =?us-ascii?Q?dXYfMzcdKPciO2qCqZn5qjxx8eGfXOm2cEixigIUWRYrQ5ku436H4kEys/Th?= =?us-ascii?Q?kAwx6/fdQExND022CN0UWqF/KUbtYTgUW7GZq/CDxA3Pby7tP4JNuhp5YRog?= =?us-ascii?Q?U7sVSGCtTwXk552DJ9leWU790mhaGjv1S+mdcik3yjaGJBd3DYo1O3+gt8fz?= =?us-ascii?Q?stZgUmtbVQzgV185ysHOyrwy39AcQQ8/nyLr3ptjHtLkaxIEZfK92PhnCPre?= =?us-ascii?Q?oadQFLlSaMwCw+z8GlMicB3Tl4f/PQ/Xbg6fTgaGs1DUb2P8GUbxontobTIu?= =?us-ascii?Q?QdELKfPvqqfSABmB8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+AYgc7UUUJdKPzajQe1J+9hviRbxfSpPaPi8kDopZIh6rIbh+1/+uM24Nf5TUo3T8fOFM/b+K4H1NqaaYTgFcUIu7vlJfIN2CxGl1yo93NxQYk9dN/8o01+g==;24:invHJ5zWj4XCqVOgZAjBFBqLiidVmVB+Hj0LjKgPXVducJgUpwIiRenZTsOV7uLemU/AAHRh6gsuIuvCtSrnTF2sZerCv9Jh6Ad4xiZvQPY=;7:s2PH42jdvO4G6k6a31XFBUgver83Y0G1wZPEXqfNsLNqqL0Dm+ljCCOPC4ct2473ppMA8vrq4wjO/hQjpBnFd/HZwiljzjgxTV7NTHzRa/sgUBZShOSjrOEj/ynCe6oXc1SnTSUREWFnO1zgu6UQpR8gbguHEyLm1fQw2VDXy3nREQpsqg8evr/YimNmAmoQPYNZDpEuv+UHDAIfJN65s+po4UPHRqb1Wze73u7oWfc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY4PR1201MB0053;20:2WLvaAIIQkCLIx7UENMR6cUTIOh6kWPodiRps2wcyuC/dM3D+4QMgNSNC6m9IKcG6zm3tUncR6+rEAWjvLcYIEiZgrrW1bWG1aY+tm9XQZqyJqGbe3TeaP42WUFET9j37eRs7ZsGvwV57IOzYLJynSRmnG/Tq3Q1qvs7/EA5vcOKbM3JLkMk/ZFqAJbC/DT072PbXyHtZ68hZ8cl6K2lDCS9pMXadvPWE4s8VYCqpr7e3RMgtB8q01bSAP9t0Xjz X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2017 04:28:20.8698 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0053 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2585 Lines: 77 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 Fixes: e788787ef4f9 ("usb:xhci:Add quirk for Certain failing HP keyboard on reset after resume") cc: Nehal Shah cc: Signed-off-by: Sandeep Singh Signed-off-by: Shyam Sundar S K --- 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