From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 24ED917A2E8; Mon, 10 Mar 2025 18:00:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741629635; cv=none; b=HyJ8TDzw8Dm/vQa+w78IqsMHeDsNZjTLoY5mOSCtiIAhkYPLJoUuW/raXlYySh4Gl3ydD+opSyCGcCpHIMTBZtEdsfYe2+ysmmWyGOKCLPB/CjLGWBQ1SQQ2xMd4gOo55lhoaxkcwgL6IiyYvnnV8tWCzVy8vG/0dr4MaA1OGPg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741629635; c=relaxed/simple; bh=DVkLuYr7CtoM0ahBD7oF3cLDzIzRc16Sa7Tj82Bq/YY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Fron5oUyIoYcZFn5n58D4tdu6SSARnQZbcyKO0dROxa/hlOkfrrIivHARuTM4p74dhvAV1/OcRp74mU/btBQXvnQX4++Q7rw9RTExGUyjXv6BAgpRa/TquZwWCFU1rr1EfxzYXYDMJ+Mfly78IxURyVuhg3X8JHOtVjhp/2e6wU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=esxG+xyM; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="esxG+xyM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1476C4CEE5; Mon, 10 Mar 2025 18:00:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1741629635; bh=DVkLuYr7CtoM0ahBD7oF3cLDzIzRc16Sa7Tj82Bq/YY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=esxG+xyMnjp2Zg4XsU26GS23CnlO4/n6Rg1c4vvY1dsg66f5s5905rkz+LNA0Aeud hopgfjNB+0U03DPmW0ORczokexO5+dQYjsQPVfKfLkIzoDbb90M8efopGyj3HXqq2R pi9GUDfBkHcFj2FoBpZzWUKLYwgyM64rn+wv5mbE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable , Baoqi Zhang , Huacai Chen Subject: [PATCH 5.15 363/620] USB: pci-quirks: Fix HCCPARAMS register error for LS7A EHCI Date: Mon, 10 Mar 2025 18:03:29 +0100 Message-ID: <20250310170559.936071683@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250310170545.553361750@linuxfoundation.org> References: <20250310170545.553361750@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Huacai Chen commit e71f7f42e3c874ac3314b8f250e8416a706165af 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 Signed-off-by: Baoqi Zhang Signed-off-by: Huacai Chen Link: https://lore.kernel.org/r/20250202124935.480500-1-chenhuacai@loongson.cn Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/pci-quirks.c | 9 +++++++++ 1 file changed, 9 insertions(+) --- a/drivers/usb/host/pci-quirks.c +++ b/drivers/usb/host/pci-quirks.c @@ -948,6 +948,15 @@ static void quirk_usb_disable_ehci(struc * booting from USB disk or using a usb keyboard */ hcc_params = readl(base + EHCI_HCC_PARAMS); + + /* LS7A EHCI controller doesn't have extended capabilities, the + * EECP (EHCI Extended Capabilities Pointer) field of HCCPARAMS + * register should be 0x0 but it reads as 0xa0. So clear it to + * avoid error messages on boot. + */ + if (pdev->vendor == PCI_VENDOR_ID_LOONGSON && pdev->device == 0x7a14) + hcc_params &= ~(0xffL << 8); + offset = (hcc_params >> 8) & 0xff; while (offset && --count) { pci_read_config_dword(pdev, offset, &cap);