Skip to content

Commit b5a5fab

Browse files
chenhuacaijfvogel
authored andcommitted
USB: pci-quirks: Fix HCCPARAMS register error for LS7A EHCI
commit e71f7f4 upstream. LS7A EHCI controller doesn't have extended capabilities, so the EECP (EHCI Extended Capabilities Pointer) field of HCCPARAMS register should be 0x0, but it reads as 0xa0 now. This is a hardware flaw and will be fixed in future, now just clear the EECP field to avoid error messages on boot: ...... [ 0.581675] pci 0000:00:04.1: EHCI: unrecognized capability ff [ 0.581699] pci 0000:00:04.1: EHCI: unrecognized capability ff [ 0.581716] pci 0000:00:04.1: EHCI: unrecognized capability ff [ 0.581851] pci 0000:00:04.1: EHCI: unrecognized capability ff ...... [ 0.581916] pci 0000:00:05.1: EHCI: unrecognized capability ff [ 0.581951] pci 0000:00:05.1: EHCI: unrecognized capability ff [ 0.582704] pci 0000:00:05.1: EHCI: unrecognized capability ff [ 0.582799] pci 0000:00:05.1: EHCI: unrecognized capability ff ...... Cc: stable <stable@kernel.org> Signed-off-by: Baoqi Zhang <zhangbaoqi@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Link: https://lore.kernel.org/r/20250202124935.480500-1-chenhuacai@loongson.cn Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 9c91296e2dc69e8a38016ddf2bbd474cd6d6acc0) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
1 parent 121d57f commit b5a5fab

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/usb/host/pci-quirks.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,15 @@ static void quirk_usb_disable_ehci(struct pci_dev *pdev)
958958
* booting from USB disk or using a usb keyboard
959959
*/
960960
hcc_params = readl(base + EHCI_HCC_PARAMS);
961+
962+
/* LS7A EHCI controller doesn't have extended capabilities, the
963+
* EECP (EHCI Extended Capabilities Pointer) field of HCCPARAMS
964+
* register should be 0x0 but it reads as 0xa0. So clear it to
965+
* avoid error messages on boot.
966+
*/
967+
if (pdev->vendor == PCI_VENDOR_ID_LOONGSON && pdev->device == 0x7a14)
968+
hcc_params &= ~(0xffL << 8);
969+
961970
offset = (hcc_params >> 8) & 0xff;
962971
while (offset && --count) {
963972
pci_read_config_dword(pdev, offset, &cap);

0 commit comments

Comments
 (0)