Skip to content

Commit 9f1d78c

Browse files
Sandeep Singhgregkh
authored andcommitted
usb:xhci:Fix regression when ATI chipsets detected
commit e6b422b88b46353cf596e0db6dc0e39d50d90d6e upstream. 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 <ben@decadent.org.uk> Fixes: e788787ef4f9 ("usb:xhci:Add quirk for Certain failing HP keyboard on reset after resume") cc: Nehal Shah <Nehal-bakulchandra.Shah@amd.com> Signed-off-by: Sandeep Singh <Sandeep.Singh@amd.com> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b3e92cd commit 9f1d78c

1 file changed

Lines changed: 18 additions & 17 deletions

File tree

drivers/usb/host/pci-quirks.c

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -133,29 +133,30 @@ static int amd_chipset_sb_type_init(struct amd_chipset_info *pinfo)
133133
pinfo->sb_type.gen = AMD_CHIPSET_SB700;
134134
else if (rev >= 0x40 && rev <= 0x4f)
135135
pinfo->sb_type.gen = AMD_CHIPSET_SB800;
136-
}
137-
pinfo->smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD,
138-
0x145c, NULL);
139-
if (pinfo->smbus_dev) {
140-
pinfo->sb_type.gen = AMD_CHIPSET_TAISHAN;
141136
} else {
142137
pinfo->smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD,
143138
PCI_DEVICE_ID_AMD_HUDSON2_SMBUS, NULL);
144139

145-
if (!pinfo->smbus_dev) {
146-
pinfo->sb_type.gen = NOT_AMD_CHIPSET;
147-
return 0;
140+
if (pinfo->smbus_dev) {
141+
rev = pinfo->smbus_dev->revision;
142+
if (rev >= 0x11 && rev <= 0x14)
143+
pinfo->sb_type.gen = AMD_CHIPSET_HUDSON2;
144+
else if (rev >= 0x15 && rev <= 0x18)
145+
pinfo->sb_type.gen = AMD_CHIPSET_BOLTON;
146+
else if (rev >= 0x39 && rev <= 0x3a)
147+
pinfo->sb_type.gen = AMD_CHIPSET_YANGTZE;
148+
} else {
149+
pinfo->smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD,
150+
0x145c, NULL);
151+
if (pinfo->smbus_dev) {
152+
rev = pinfo->smbus_dev->revision;
153+
pinfo->sb_type.gen = AMD_CHIPSET_TAISHAN;
154+
} else {
155+
pinfo->sb_type.gen = NOT_AMD_CHIPSET;
156+
return 0;
157+
}
148158
}
149-
150-
rev = pinfo->smbus_dev->revision;
151-
if (rev >= 0x11 && rev <= 0x14)
152-
pinfo->sb_type.gen = AMD_CHIPSET_HUDSON2;
153-
else if (rev >= 0x15 && rev <= 0x18)
154-
pinfo->sb_type.gen = AMD_CHIPSET_BOLTON;
155-
else if (rev >= 0x39 && rev <= 0x3a)
156-
pinfo->sb_type.gen = AMD_CHIPSET_YANGTZE;
157159
}
158-
159160
pinfo->sb_type.rev = rev;
160161
return 1;
161162
}

0 commit comments

Comments
 (0)