Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795053880; b=R0D+gEEGyiqB0UH3fyNbhn7nA29HCpX4HlZU4e1oKE/Io7qAYWqn9wmujxfgZk/zf30O yFwxtT7w3MBpEmBKb5nKIEcpSwaNEaY5F8LO85djC8PKdTxaRgdi5NB3W0C8hTxyCGnYA 0libGnJRHVXvvUkGQPbXiqAg8V0LJ+pO+dxSgkpzRlFmgpl9bwZKpZFvDz07WiYnbQnmn XS1NqComoaDdGcHX6iqnHVFrUCQfET/fGuNwUt3e4JeUxDg36mrGcSwSDNRt9U5hebbLm vf/9ykPIAzWKY5qx4xjuWwNBAyl+RbKMabFEKgIoi3Mcc3yoZdd96WAFHFOGD5yXkZQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795053880; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=yprENL1pyH3UHFKOowjnbeLslEULgvqnhLIpJuK9Tt0=; b=ArkifiLrpu0S3d7uAY+1Sz0evxPZOeFp92L069SMs1Y7ayjrdJ8GKwdtrXRvzkbb7ggl ItSbW6KONfh652L4AsU9LKeXhz3G0P2ZWqAYKE0joZWEIFieaDUMqL8WkPpZT+T4mW4FN gsP/SRk7g55kUfroFO8QZKlK4wmBv6CGjEtEUNZoKyQ+yAlXArNUs8bQonlbuLfNTuyVQ mGcw8JP1gJIZlMopoVxyH5xEo38s2lgnFO4tltIUySKYR3bKZoBmS03gSWQ5OsIsVSRIy CdRuacJz3o2G42QXWnl7FHRu+A2Cc839tiG6U3SRKe+g9GS7Ted1b72LvUxafeF/a2A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=ebYCjncb; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F223606A31C; Thu, 19 Nov 2026 02:04:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=ebYCjncb Received: by smtp.kernel.org (Postfix) with ESMTPSA id B9E3A1F000C4; Thu, 19 Nov 2026 02:04:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795053880; bh=yprENL1pyH3UHFKOowjnbeLslEULgvqnhLIpJuK9Tt0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ebYCjncby0Ks3/lcOfp+0Tn6kF5mFUdiSQ3CtlTJi6U94dDAS6AfkS3dGYAfyQZfO U7f2bAdkd8VBBOYLrKt/8clJNQvLWGKwPfyVgypqBOm7pfNyXwwg/YNb3FIIn0540O EjIkfiY3PjjjNcCS0RdIV8+DMfD2qhVVTgxJsx8I= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dragan Simic , Shawn Lin , Geraldo Nascimento , Manivannan Sadhasivam , Bjorn Helgaas , Sasha Levin Subject: [PATCH 5.15 1077/2214] PCI: rockchip: Drive at 2.5 GT/s, error other speeds Date: Wed, 18 Nov 2026 15:45:53 +0100 Message-ID: <20261118150055.339243227@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150009.797899913@linuxfoundation.org> References: <20261118150009.797899913@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Geraldo Nascimento [ Upstream commit 84d08ff902f1ec01177fef1a21a38934927f5aee ] Configure the core to be driven at 2.5 GT/s Link Speed and ignore any other speed with a warning. Also drop the 5.0 GT/s Link Speed defines from Rockchip PCIe header. The reason is that Shawn Lin from Rockchip has reiterated that there may be danger of "catastrophic failure" in using their PCIe with 5.0 GT/s speeds. While Rockchip has done so informally without issuing a proper errata, and the particulars are thus unknown, this may cause data loss or worse. This change is corroborated by RK3399 official datasheet [1], which states maximum link speed for this platform is 2.5 GT/s. [1] https://opensource.rock-chips.com/images/d/d7/Rockchip_RK3399_Datasheet_V2.1-20200323.pdf Fixes: 956cd99b35a8 ("PCI: rockchip: Separate common code from RC driver") Reported-by: Dragan Simic Reported-by: Shawn Lin Link: https://lore.kernel.org/all/ffd05070-9879-4468-94e3-b88968b4c21b@rock-chips.com/ Signed-off-by: Geraldo Nascimento Signed-off-by: Manivannan Sadhasivam Signed-off-by: Bjorn Helgaas Reviewed-by: Dragan Simic Reviewed-by: Shawn Lin Cc: stable@vger.kernel.org Link: https://patch.msgid.link/7421df7a7b7778ee99363cccfdfabbfa8aa6ab5e.1781622998.git.geraldogabriel@gmail.com [ sashal: adapted header changes to existing HIWORD_UPDATE helpers while retaining PCIE_LINK_IS_GEN2 for the host driver ] Signed-off-by: Sasha Levin --- drivers/pci/controller/pcie-rockchip.c | 14 ++++++-------- drivers/pci/controller/pcie-rockchip.h | 1 - 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/pci/controller/pcie-rockchip.c b/drivers/pci/controller/pcie-rockchip.c index bdce1ba7c1bc0..c1567a2ef1890 100644 --- a/drivers/pci/controller/pcie-rockchip.c +++ b/drivers/pci/controller/pcie-rockchip.c @@ -65,8 +65,10 @@ int rockchip_pcie_parse_dt(struct rockchip_pcie *rockchip) } rockchip->link_gen = of_pci_get_max_link_speed(node); - if (rockchip->link_gen < 0 || rockchip->link_gen > 2) - rockchip->link_gen = 2; + if (rockchip->link_gen < 0 || rockchip->link_gen >= 2) { + rockchip->link_gen = 1; + dev_warn(dev, "invalid max-link-speed, limited to 2.5 GT/s\n"); + } rockchip->core_rst = devm_reset_control_get_exclusive(dev, "core"); if (IS_ERR(rockchip->core_rst)) { @@ -236,12 +238,8 @@ int rockchip_pcie_init_port(struct rockchip_pcie *rockchip) goto err_exit_phy; } - if (rockchip->link_gen == 2) - rockchip_pcie_write(rockchip, PCIE_CLIENT_GEN_SEL_2, - PCIE_CLIENT_CONFIG); - else - rockchip_pcie_write(rockchip, PCIE_CLIENT_GEN_SEL_1, - PCIE_CLIENT_CONFIG); + rockchip_pcie_write(rockchip, PCIE_CLIENT_GEN_SEL_1, + PCIE_CLIENT_CONFIG); regs = PCIE_CLIENT_LINK_TRAIN_ENABLE | PCIE_CLIENT_ARI_ENABLE | PCIE_CLIENT_CONF_LANE_NUM(rockchip->lanes); diff --git a/drivers/pci/controller/pcie-rockchip.h b/drivers/pci/controller/pcie-rockchip.h index 2dcf242d1c4c5..9f11b789cfad0 100644 --- a/drivers/pci/controller/pcie-rockchip.h +++ b/drivers/pci/controller/pcie-rockchip.h @@ -37,7 +37,6 @@ #define PCIE_CLIENT_MODE_RC HIWORD_UPDATE_BIT(0x0040) #define PCIE_CLIENT_MODE_EP HIWORD_UPDATE(0x0040, 0) #define PCIE_CLIENT_GEN_SEL_1 HIWORD_UPDATE(0x0080, 0) -#define PCIE_CLIENT_GEN_SEL_2 HIWORD_UPDATE_BIT(0x0080) #define PCIE_CLIENT_LEGACY_INT_CTRL (PCIE_CLIENT_BASE + 0x0c) #define PCIE_CLIENT_INT_IN_ASSERT HIWORD_UPDATE_BIT(0x0002) #define PCIE_CLIENT_INT_IN_DEASSERT HIWORD_UPDATE(0x0002, 0) -- 2.53.0