From nobody Tue Apr 7 17:12:30 2026 Received: from mail-ua1-f48.google.com (mail-ua1-f48.google.com [209.85.222.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB94D3921DD for ; Fri, 27 Feb 2026 05:36:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772170565; cv=none; b=BZjWiVFHt0L87yVHvfQyzA8KpOQPrclp5ee3IIo3ObTFpfzwWRABGYZixwijXyGaLs6kYZjRqe5A1CNSnCpCrR3QSzlTyCaD6hx8Wp2ZB70dl+SUKPkhq3I0Uu3vH8SlX9Op0tQFZ83P4+rXqoMCH+c8YsoFCMgO1oUhqMCvqx4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772170565; c=relaxed/simple; bh=7D+t6AZUYiHvvmGQ1ox/DgSRaKhS+kPTO4Semp3A/Go=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TCPy5uBGAkxLf32Py8wQmzMCxzTzxzwiq41BJGTZWYGlZB2EhsJzHshyaW8uXRUklH+okVQYWweBQhZvRUAsDwhv0bFZhOnLizhO5T9hBYfZO3WUisBc8tng0UxSVE1GYhXdsOP2hh+EbGIC+mP2eKkXcEugoDvJ++ecPRgS/kk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=mXjoXkYQ; arc=none smtp.client-ip=209.85.222.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mXjoXkYQ" Received: by mail-ua1-f48.google.com with SMTP id a1e0cc1a2514c-94ddffda372so1917705241.1 for ; Thu, 26 Feb 2026 21:36:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772170563; x=1772775363; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=MDesqVRO1Tim7+gISdrskbEX51kvM+tTCym0v98yq+w=; b=mXjoXkYQzf1kcddtfcCcIwhDd15HOtO3IT8DODrJDVZO6NxFIcquGsy3TlKfArOEkq v1i+FEPxOQBbtu8szf9FnyOIoVlToxbREcDYo7GSFYRaS/anitJPRy4leYnBcDZq4Nn3 Xru8hNNexcTZM+I7xePTNz7atj55Y9sZzq90jDgqvLoBHhI85DKSA5O0EdstAAtLL2n0 kUizhdiV6eMQoz+PVdIrsDNDWD6mdJOUm3OzUlEkFEZ6IghPhg8Su1ygrWWJrjIJp5xv Z6Yz47/S4P81ti7pNfkQOmcURUfzbHT4ceDsqNXwQsybIUHqIAoG56d7URDz1hWVYblk gr3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772170563; x=1772775363; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MDesqVRO1Tim7+gISdrskbEX51kvM+tTCym0v98yq+w=; b=WoMlfb6Oov79QCNEUSt8LPNTno+5+loLObHVuIjbIOYY6A0cclvS1BMiXQVjM33fpG Bn60XmclB8qRxwFG3+x9w5vGFOFbKScnjiGtRT7MU6DBwUWfjmAdtJFNLdvejPnSoluc rUdpPqPmqf8loBNSp34zzNwxjR1l14BQt+vxPgzVl8sETchbHP7lciTtMhEU9LFeKisR wHbn0dG9xVUzDcI6NHQJDMH0+FRt3//5mnhVR4B9JyyHFgXN/wEXpiyd17e53RhpdJj7 mSwA7Bz+fSxzCNkL7lOgVpmgYKs2xL+cDMsuL5/9W1eInib8QFV/ikfjHrGURMnPEcud YLPQ== X-Forwarded-Encrypted: i=1; AJvYcCUZ2gUHUwdaE8/cVZSHrMZ3A3hTMAwTzmBvizbHAywMjrGO6re43tLC4KDvl1aXcoUpr4ue33lbsWGWO+Y=@vger.kernel.org X-Gm-Message-State: AOJu0YzqTilSc31LO47JZKWQTo3a36ndGJgvIz3FpMPlIEX8eYA/yElX CI0e8sp2qVM0BLC5U8e3kuwJnJ43Dc+RJ0tuqW2KRqYJe2kubwqTJAjI X-Gm-Gg: ATEYQzzKXGupfhbiG0G/2x1PYk3i9rVjSHXYh5JM07vWgjN2LLLLcITvJ1ipzO1puPX nxvcANTfKAoWnHkZzeCij1hbaU3Kh27cRNYctLU3nO3GgiNPYP/DG881gTASkChN+B3/AWdTLIP +Au883nsN/Ity/4vBrsiEmk64H4kVnfdaywkiOljEP8KUNDtXtB7eaQ9euOsv3shru/wBlw6Jvf TcV5SboR5Ub6lyy4MxJviMaRuXpuKfxliDfIJcr6abBnIVkzmBd6f/ds0lCmFEApgBxViOAqmOr Zzt0fr46HzarPE71kz81Q/eGFbgunK96sNo9jnrL+lWkRR0Kf3Glhrp97YSlRSp7lJHr9yaoFCI YN0PxMn47JBfKuoWEJYSSiJ488vJ8WTr45AnT5W4hJFTl9WKq5MgPJVDequh4RwPoFfFEYtnLj5 AGXbRmPRs7zA== X-Received: by 2002:a05:6102:a48:b0:5ff:11dc:2ed7 with SMTP id ada2fe7eead31-5ff33712140mr755878137.16.1772170562643; Thu, 26 Feb 2026 21:36:02 -0800 (PST) Received: from geday ([2804:7f2:800b:feb1::dead:c001]) by smtp.gmail.com with ESMTPSA id ada2fe7eead31-5ff1ea1596asm4361324137.9.2026.02.26.21.35.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Feb 2026 21:36:01 -0800 (PST) Date: Fri, 27 Feb 2026 02:35:54 -0300 From: Geraldo Nascimento To: Shawn Lin , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Heiko Stuebner , Geraldo Nascimento , Dragan Simic Cc: linux-rockchip@lists.infradead.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 1/4] PCI: rockchip: drop 2.5 GT/s defines Message-ID: <5172389ba8d291fe05bc0887bc97fe73f110c5c0.1772169998.git.geraldogabriel@gmail.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Drop the 2.5 GT/s Link Speed defines from Rockchip PCIe header definitions. 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") Link: https://lore.kernel.org/all/ffd05070-9879-4468-94e3-b88968b4c21b@rock= -chips.com/ Cc: stable@vger.kernel.org Reported-by: Dragan Simic Reported-by: Shawn Lin Signed-off-by: Geraldo Nascimento --- drivers/pci/controller/pcie-rockchip.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/pci/controller/pcie-rockchip.h b/drivers/pci/controlle= r/pcie-rockchip.h index 3e82a69b9c00..b5da15601b58 100644 --- a/drivers/pci/controller/pcie-rockchip.h +++ b/drivers/pci/controller/pcie-rockchip.h @@ -42,7 +42,6 @@ #define PCIE_CLIENT_MODE_RC HWORD_SET_BIT(0x0040) #define PCIE_CLIENT_MODE_EP HWORD_CLR_BIT(0x0040) #define PCIE_CLIENT_GEN_SEL_1 HWORD_CLR_BIT(0x0080) -#define PCIE_CLIENT_GEN_SEL_2 HWORD_SET_BIT(0x0080) #define PCIE_CLIENT_LEGACY_INT_CTRL (PCIE_CLIENT_BASE + 0x0c) #define PCIE_CLIENT_INT_IN_ASSERT HWORD_SET_BIT(0x0002) #define PCIE_CLIENT_INT_IN_DEASSERT HWORD_CLR_BIT(0x0002) @@ -197,8 +196,6 @@ (((x) & PCIE_CORE_PL_CONF_LS_MASK) =3D=3D PCIE_CORE_PL_CONF_LS_READY) #define PCIE_LINK_UP(x) \ (((x) & PCIE_CLIENT_LINK_STATUS_MASK) =3D=3D PCIE_CLIENT_LINK_STATUS_UP) -#define PCIE_LINK_IS_GEN2(x) \ - (((x) & PCIE_CORE_PL_CONF_SPEED_MASK) =3D=3D PCIE_CORE_PL_CONF_SPEED_5G) =20 #define RC_REGION_0_ADDR_TRANS_H 0x00000000 #define RC_REGION_0_ADDR_TRANS_L 0x00000000 --=20 2.52.0 From nobody Tue Apr 7 17:12:30 2026 Received: from mail-vs1-f54.google.com (mail-vs1-f54.google.com [209.85.217.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 58E133921DD for ; Fri, 27 Feb 2026 05:36:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772170579; cv=none; b=RGVL8s6duh3VnO8oGboDFabkgErycv/ZYmmRPmMjJM99wpAnBylHMGQqxI0XLOGzrVDJP3pxeH/pT6D/xXrt0UYr3uUnsC4TmX4T0pgCK2reHqZsOjy+QcBYz1MuL/LlkVNix1eyy9Y1By8BzdxK/QmK/IJ5OwOLiiDvz67lvGA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772170579; c=relaxed/simple; bh=kPfTUrEw1DJYMp4hBuNTOxzjcE1/QMxV+oH3eKs6vQE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KBJDbQqIEPKc6arlA/RUvauT8YBkFXbpVshIfNZY8/E67xT9PR+XQ1ei5arGAhSESqc+8cniBKSSAsf0j29vsN54ZICe9IqTvj0g3RtscSNMchdvX4q5oiJOd2334FmQVjXZfHXwpD/O6XTybBh9H62zzKAT0Dkz2G3UV6AQn+4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=B2prSChC; arc=none smtp.client-ip=209.85.217.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="B2prSChC" Received: by mail-vs1-f54.google.com with SMTP id ada2fe7eead31-5ff07cb35f2so892063137.3 for ; Thu, 26 Feb 2026 21:36:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772170577; x=1772775377; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=mnj0Ip5rhMpZWME92U2V18suyVnTB8PfAkHzESqzgSg=; b=B2prSChCZxrbO+UmuAQpBDeDSlEV/2ka9gKSBZTrDv7JOfpGVlNfC+1a6rXnl0VO66 eCdgFthrDS/6G2a2v0+DhDGqCP/6A7N6lOSJZHpJmCqTmideww7j0mo3mO1L9O/GVSV6 8zUBG5kfJvA8id/lgYWmtN6ic4QrSPuDZXzcM7CdzIuqyipjdJ4WsEAIFN3TdwbJPfCA OXTCz0BWM/xuHzJqD57qRV49d6h9YFkPzzqdr4mX7BGckZvnr7Jyd7iu9Y4X4qvvxMyP Fa5Rfv1H0AhwBWhrbhsAinb09LeD9T+tDK60UY7KanM1Hf/uVAVfVTCXe0pKqStMc68E ELGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772170577; x=1772775377; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mnj0Ip5rhMpZWME92U2V18suyVnTB8PfAkHzESqzgSg=; b=doQf7aZspQY3uYCTbITZ6k/5eyvb54YqZ4RMkzwtL1tg8sUwiZVwrbr/cdXqnJSHWs Uo8YxYBUrOtvWUX1BmvBv6Qk38RKLMCuowup9sd4uydlVOV8HHWjxIMnV8b3UR/krEC7 nnQt6t6r1q8Qbdg6zselF+cWqaifDpVUNoKNh8raaJPxD59rFhAcqXcBOhoMOOYbqkMr AFeT/DoW/h2lXTssyKJCgnWBJ1kMRRGC+bEZl+KyAfKISUMUfDv5+J3bZTPvBYe6cm9/ zMeWOC///kMMe7RDyEKJA2ODWivZW1Ej03pOVa49J68FndrFR7LMIfWs3xw6NzCHayDW xaYw== X-Forwarded-Encrypted: i=1; AJvYcCXNdbNwnlqu6B200cHz1BNuizcBQ/7IofpA4DFqiTlDnSy/FXDgySf16di9tJ6YRtcla2GS7+ymKnT6xfQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yz6lmC6Erozr6qbbd8zThaonSDtsr/TksHo05rvu+0Ey63I0fY4 52lIpsOop8YrRr6gQdnmh2PxlfQngbhGr3qCvVqFHy/X1VXr4fc3bf3y X-Gm-Gg: ATEYQzyin7yhZBRuzhtFAb/4HI93gH/6pHJD/XFrs3+iEVb4zGBnYJJ0mJ20qsSPBG4 jBxyzHCPKj+RAbByKXaNagklf2L6pSx3Ob5lMy3Ld9awsYdbEtn6XS8pTLHgBJ3Nb205Zeu+w6u McsfCs+Kkf+LIHz/ptzzlQgG4W1KpTPFiiDI1T+JmDyJiF1Az+ZGYxOLPB4gCCX3YVmGwVoOeqn 8CoLsm9rkK5K7G80vrmpYlFrpj6NgywcriZBs7UwSiPxkfUebf2xN0/EJPY4kis/jQRTu2eMZBx L2SdL8K8JOks89QCzsUqYwqdts1hXZLrbVf8RIpE/uuOEYEtYa4swsvErd9IsAiFNZfEAiv4XDp RrAufN3ErGO6IJQKfRFQtdLZX6Vmc42eQ6N4D1kM7KIcgrKOeKogwpdnTgaZGjM8y4zsQQgxNJg T9Xd05ie9r0Q== X-Received: by 2002:a05:6102:c09:b0:5f7:2655:f2c1 with SMTP id ada2fe7eead31-5ff3235cdd6mr1120359137.13.1772170577277; Thu, 26 Feb 2026 21:36:17 -0800 (PST) Received: from geday ([2804:7f2:800b:feb1::dead:c001]) by smtp.gmail.com with ESMTPSA id ada2fe7eead31-5ff1ea15925sm4631041137.8.2026.02.26.21.36.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Feb 2026 21:36:16 -0800 (PST) Date: Fri, 27 Feb 2026 02:36:10 -0300 From: Geraldo Nascimento To: Shawn Lin , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Heiko Stuebner , Geraldo Nascimento , Dragan Simic Cc: linux-rockchip@lists.infradead.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 2/4] PCI: rockchip: drive at 2.5 GT/s only and error out other speeds Message-ID: <9e3754ee0d1f5bc8051e28e1a5b8c046440456f5.1772169998.git.geraldogabriel@gmail.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Configure the core to be driven at 2.5 GT/s Link Speed and error out on any other speed. 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") Link: https://lore.kernel.org/all/ffd05070-9879-4468-94e3-b88968b4c21b@rock= -chips.com/ Cc: stable@vger.kernel.org Reported-by: Dragan Simic Reported-by: Shawn Lin Signed-off-by: Geraldo Nascimento --- drivers/pci/controller/pcie-rockchip.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/pci/controller/pcie-rockchip.c b/drivers/pci/controlle= r/pcie-rockchip.c index 0f88da378805..26fc350a66c1 100644 --- a/drivers/pci/controller/pcie-rockchip.c +++ b/drivers/pci/controller/pcie-rockchip.c @@ -66,8 +66,9 @@ int rockchip_pcie_parse_dt(struct rockchip_pcie *rockchip) } =20 rockchip->link_gen =3D of_pci_get_max_link_speed(node); - if (rockchip->link_gen < 0 || rockchip->link_gen > 2) - rockchip->link_gen =3D 2; + if (rockchip->link_gen < 0 || rockchip->link_gen >=3D 2) + return dev_err_probe(dev, rockchip->link_gen, + "Invalid Link Speed\n"); =20 for (i =3D 0; i < ROCKCHIP_NUM_PM_RSTS; i++) rockchip->pm_rsts[i].id =3D rockchip_pci_pm_rsts[i]; @@ -147,12 +148,8 @@ int rockchip_pcie_init_port(struct rockchip_pcie *rock= chip) goto err_exit_phy; } =20 - if (rockchip->link_gen =3D=3D 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); =20 regs =3D PCIE_CLIENT_ARI_ENABLE | PCIE_CLIENT_CONF_LANE_NUM(rockchip->lanes); --=20 2.52.0 From nobody Tue Apr 7 17:12:30 2026 Received: from mail-vk1-f172.google.com (mail-vk1-f172.google.com [209.85.221.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EB33A36215F for ; Fri, 27 Feb 2026 05:36:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772170598; cv=none; b=bqldHUwUgv1pXC/kC+vz19Ht8nFkhq1UdFg3Go2Izt1PzYcP6aAl5T2R5s2qCXDcN23fJMRgvyNksha5ttNiP0P/TlL3is/yOF6CGPZaZKh04kYZz/AKJbgE1SP1ihY5M8acPKGvmtKZrwvxqK6op6WJBWfhAzu7EFnoaLI920U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772170598; c=relaxed/simple; bh=AJDezbdBSE4yYAAwHOt3MOZ3kgfMlnzZJDtkUSMJC2Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Wxm7bSmBkH8QfHD0Dp0q4hWxyy9KoJLWKoeoanXy0RKZ1V5/jyF9P8Ay2RDD+qyB1MNJaadjtfir3S0fkAih7pXaGf0PZlfz3aLLqDsy1nkC96m0Gudh3mhYNHEZ828kJZTxLpKNk1wliwBJmSd3tltqIcuSUbMDeI/KDK9+CtA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lCZu9AeE; arc=none smtp.client-ip=209.85.221.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lCZu9AeE" Received: by mail-vk1-f172.google.com with SMTP id 71dfb90a1353d-56a976305b3so980162e0c.1 for ; Thu, 26 Feb 2026 21:36:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772170596; x=1772775396; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=7ahdwK5YE/BVFVzjUz+/VzjFDN6Ot/+6hz0uB3cz4GE=; b=lCZu9AeEvwlnqyzvbQ+3w7MhcIU4VlCdRUy2sBiOTOlu2SyiQGEexznBbAHLZDj3cR 37JzHMiHF/uRPclSZXQBRhBC6GaoBGJkPixStAFJAl3BYJYCPqQDWS6g4UrXyCNPR1P0 eXfj4ecwu8y4mS8St0W3+BxQScT2je45Zt0D24fCc1i/UcgSCyE9Q+i1g8YzmOu4Psua bmyWp4PPxV0R2j8oHhyDPpF7o9WOYMMuSRoUmLuRsGJOv5lC77tNu9VI6ehdCOJmfbCh 04srIholeF8Z34wbxJfCQM1CuIdZbUi1VkfZYag5aWXY8aHz5q9X9yUGqwwiWwIvg3KG 3Ypw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772170596; x=1772775396; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7ahdwK5YE/BVFVzjUz+/VzjFDN6Ot/+6hz0uB3cz4GE=; b=V0eFhSyVzVf7bMvFt+1/piHS9rUq1zh8fASkAD3gfPjjLT2UUv5c/PShebQNspklEq +WqSYWAurdrzEF612qLx139le1T/GPGXtCaZk3NpxOiNhtmIh25brQlOl/ak5gbRNDA/ FZZZeuooGbQU7/0pyQMIbxbcHtH9aOoi1tNzWXF8PsNwJ5Phi1AGucpsLj8MopGBbzI9 qt+0M1iAhZ+ba0OQEsdn3+12JuQq36wMFJqfXIoR+6A0fzZUq4iaSS9SQzzIuUMyrGOI PRmrZ1iR09iqdgsYSOivfVlqwxbHccjMv/GuySulIxm5vJEHLrtVaFaKdNQCBz89N/RN G8Vg== X-Forwarded-Encrypted: i=1; AJvYcCWBn9rszheU+JIYjdEcyCZUUYyKtqcYtj6RW5H6rEouILTpK1tA2+owfrOT6i6uqrskkhdEVqsvPyPVt/M=@vger.kernel.org X-Gm-Message-State: AOJu0YyaNvKnkA6HWBC05ZPN3+6lDx/BwgPNxqkJYMGaodVUZLYWoEUg 0qAqXw7r/K3o/DtGTXJo6i9ProJAIKWYcOZgMa8iGkyiJqBlwzRGgETb X-Gm-Gg: ATEYQzyi5mIfUA3nN2W6Nn0PRVVoc/CRxKdgSgTr+igz3/24oDJ5BF/5j2Pn12GCqVa 8NvUdbPofyH2cQTDxwRpBGD2XCDNOGgJwZyim4PAIgxP5mubGO+ZcGWMQaMRYFlVAOIY59SaMOf e67mz4pcIvh9Te5gLttqPSRPAjURBA8JoZEXaD9ISKlFkacC8ovlXVDzUGLGsEQidHDph37PCZr Mm1vsMpz1n1JF0YN1u2qXVShGIQG8PMWVTDYQk7nKJWDX32cuibz16thjNeni9eNhLIcqwZ3a6W xMslCqaqftlv5+4PSrggfrdJKN5fZxDzOZ/FOQHn41xceMUr9lveld0HlpSjK6jpcZy/AhDR2b6 TLu8XO4LUHwWmTzll/KJpwyHV9mGito91FOaAPZmW960ZIYEyfnNcHM//DDvYFiHiyWvLBD2BlZ Fh/ARez2TOFg== X-Received: by 2002:a05:6102:a4c:b0:5f7:2430:5340 with SMTP id ada2fe7eead31-5ff324986b1mr1096585137.21.1772170595887; Thu, 26 Feb 2026 21:36:35 -0800 (PST) Received: from geday ([2804:7f2:800b:feb1::dead:c001]) by smtp.gmail.com with ESMTPSA id ada2fe7eead31-5ff1e8240d2sm4431027137.6.2026.02.26.21.36.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Feb 2026 21:36:34 -0800 (PST) Date: Fri, 27 Feb 2026 02:36:27 -0300 From: Geraldo Nascimento To: Shawn Lin , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Heiko Stuebner , Geraldo Nascimento , Dragan Simic Cc: linux-rockchip@lists.infradead.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 3/4] PCI: rockchip-host: do not attempt 5.0 GT/s retraining Message-ID: <92662fce5ebb28d21d0c68631a23ab8afb815a90.1772169998.git.geraldogabriel@gmail.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Drop the 5.0 GT/s Link Speed retraining from Rockchip PCIe Root Complex Mode Operation, so called host driver. 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 Link: https://lore.kernel.org/all/ffd05070-9879-4468-94e3-b88968b4c21b@rock= -chips.com/ Cc: stable@vger.kernel.org Reported-by: Dragan Simic Reported-by: Shawn Lin Signed-off-by: Geraldo Nascimento --- drivers/pci/controller/pcie-rockchip-host.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/drivers/pci/controller/pcie-rockchip-host.c b/drivers/pci/cont= roller/pcie-rockchip-host.c index ee1822ca01db..1374a2c92b56 100644 --- a/drivers/pci/controller/pcie-rockchip-host.c +++ b/drivers/pci/controller/pcie-rockchip-host.c @@ -328,26 +328,6 @@ static int rockchip_pcie_host_init_port(struct rockchi= p_pcie *rockchip) goto err_power_off_phy; } =20 - if (rockchip->link_gen =3D=3D 2) { - /* - * Enable retrain for gen2. This should be configured only after - * gen1 finished. - */ - status =3D rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_CR + PCI_EXP_LNKC= TL2); - status &=3D ~PCI_EXP_LNKCTL2_TLS; - status |=3D PCI_EXP_LNKCTL2_TLS_5_0GT; - rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_CR + PCI_EXP_LNKCTL= 2); - status =3D rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_CR + PCI_EXP_LNKC= TL); - status |=3D PCI_EXP_LNKCTL_RL; - rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_CR + PCI_EXP_LNKCTL= ); - - err =3D readl_poll_timeout(rockchip->apb_base + PCIE_CORE_CTRL, - status, PCIE_LINK_IS_GEN2(status), 20, - 500 * USEC_PER_MSEC); - if (err) - dev_dbg(dev, "PCIe link training gen2 timeout, fall back to gen1!\n"); - } - /* Check the final link width from negotiated lane counter from MGMT */ status =3D rockchip_pcie_read(rockchip, PCIE_CORE_CTRL); status =3D 0x1 << ((status & PCIE_CORE_PL_CONF_LANE_MASK) >> --=20 2.52.0 From nobody Tue Apr 7 17:12:30 2026 Received: from mail-ua1-f45.google.com (mail-ua1-f45.google.com [209.85.222.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 84D4A36215F for ; Fri, 27 Feb 2026 05:36:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772170613; cv=none; b=Dtribs5QJ8l8X85NIh7Z7x/37UHu4s3GNwC6J9tKx6x9Rz4ef8FV0GNqBU+T3y39Vex2+5mDS8nO5lNWl4naMP/uZgcT0E9XKDZ9uCmJs3xq/vNNN5OdtCkgKlD2gxCyvbhR9rwm5mo2QuYhJOS4W8MqlYwe9Luq/viXVO0+oGE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772170613; c=relaxed/simple; bh=jViPzIcft5VoLeQ9+SfcLyXaFyUHi5qvqa74q063aIw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fuO9/ihZa+tn7Uueqrye0icU1xOhlx3v1I+xW2kzAJq3dIYtbwStNM7D8WrcNokxk/7zmccMe8FP8waVvOFKBjZH/06J9VvZNHipYyFbJOXKt6IeUjQIz7levwHe5d0qK0isYhlUlIHpJVdMdJdIZFCdCcFKaFarKEUqGtPWLvE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KhE/3gA8; arc=none smtp.client-ip=209.85.222.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KhE/3gA8" Received: by mail-ua1-f45.google.com with SMTP id a1e0cc1a2514c-94b07fddecbso1050379241.1 for ; Thu, 26 Feb 2026 21:36:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772170611; x=1772775411; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=TmPKR2Yyu/CowlCAVgHjCUwCb1vpQWAYSrI2qG/n3xg=; b=KhE/3gA8o3muIt8b0k6iK0XVp4ZjeUbccy2hfBbpOD0A3y5PENT3altpYB29T8yLbF 0wYt4OrEbRvPbK3vcb9dNncRSVwrM6U1PS394SJk62lY6VWGOiW7Ba1yJsOx8WQjuzHP u7AjDAQdEO1USGW3lDoYqvj41pZ5qyrjeaU+6Q+fFgqiEV7AAgSRD5mHThzlprv1Mcul xzxU2QdFzyO5tSxRYCjB+5vqhny3oWktxKmMl2IqA6Ol6e1Hfbv8ggCKIFlRmHaVjy7S BjKc5ZjRZE3sxwBykpC3+ItQc57RU+vKzQpKGeHdHng2VnHV9hnQ1FCoyDyjpchJH8km Y8xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772170611; x=1772775411; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TmPKR2Yyu/CowlCAVgHjCUwCb1vpQWAYSrI2qG/n3xg=; b=MAY3eOEkPBBxwxTWbN7/A+/jBYH29FdCg2z2fhXqQRNbWXWMNc0inROemoC1Rme418 NqEQA53F5Ub7uLLAu0qZ1QYJ0YeuB4SYvwlbRKL62u6YVd5qXm0YVLkzAeHWxmK5vA5Z mBwsBx5XJK1wtLs5HgF80fS7MbYpsZZtiJZGHkxxtWBFt3eMXfuSL03VMu2xVG9RUZ62 UMyOxSPQ5zqXUcp0dnTlY325zNXhAFFc/C6OzY6QUCJ3kfRzDA9JcRAv8tM7aLIP4I96 6Lqqzq3Lpfe7+Rs5KrHyk+VJSBSNsOb1SEP7H92ksCPP18gnojGBIG+8tksGw/bDIrrd Vm3g== X-Forwarded-Encrypted: i=1; AJvYcCXiN9NzyXJNs7V8BnX9FldyHePhVBXuwFdk2qP8PfHEvJYsCAvzdn08Oqt9FqqY9Q6soxohXsPMZOmp00U=@vger.kernel.org X-Gm-Message-State: AOJu0YzjvYVAv9Huh4NosX4Fce/TveMd0sMC/eed9Khsn63LeJSC3KEM qEQ7CMsXC3AlYiWW10k+YGNnyZ68/5kXwoFG/bvF6s4FoSCpXBwkE285 X-Gm-Gg: ATEYQzzAWjY6ZYvD9a55XDXqJFaD643GKKsCpYhDw1jagc01ZWFWMoA5QDc8TFUUzK/ 7v7xmcL2Y/FvaiPnlxu0XU7f9rb5RjnrgunZfkmxGgvpmyPTTh6NUflQV3cELZLLtgyG1eQ0Qik VbwWFdTKhpxWSMYE+YLOZzhj/dEP8t0TKAspqwP7m3ONq61P17PdAXLPpRWMl2/eTTTaMG6J6ls CV5Zv+Br1JyJ80QhuZMZwizgmewfBpLlStvzQDDUxF0ZQolHH9gUedCIbqLDCkYwXEPfl8x1qYw S1WpuYYjHg0cYNCO+dDF7gUhBj1cOzRsdnTP4e5WrmtjLcaKMEV2XtIRd/iwdbgwDUlbh2q9H5E qr/X5/UK+Gqr6dg1P1OWBo9NOLO3UU4+RCCxFX44xNk0BefMl52r6UuqHIQ9iGeijOq3S7fxcdj Qhv3Uo40V8kJDmsyolpXuN X-Received: by 2002:a05:6102:32d1:b0:5ff:a1e:ee66 with SMTP id ada2fe7eead31-5ff32271334mr1111779137.2.1772170611497; Thu, 26 Feb 2026 21:36:51 -0800 (PST) Received: from geday ([2804:7f2:800b:feb1::dead:c001]) by smtp.gmail.com with ESMTPSA id ada2fe7eead31-5ff1e3e6013sm4496101137.0.2026.02.26.21.36.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Feb 2026 21:36:51 -0800 (PST) Date: Fri, 27 Feb 2026 02:36:44 -0300 From: Geraldo Nascimento To: Shawn Lin , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Heiko Stuebner , Geraldo Nascimento , Dragan Simic Cc: linux-rockchip@lists.infradead.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 4/4] PCI: rockchip-ep: do not attempt 5.0 GT/s retraining Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Drop the 5.0 GT/s Link Speed retraining code block from Rockchip PCIe header definitions. 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 Link: https://lore.kernel.org/all/ffd05070-9879-4468-94e3-b88968b4c21b@rock= -chips.com/ Cc: stable@vger.kernel.org Reported-by: Dragan Simic Reported-by: Shawn Lin Signed-off-by: Geraldo Nascimento --- drivers/pci/controller/pcie-rockchip-ep.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/drivers/pci/controller/pcie-rockchip-ep.c b/drivers/pci/contro= ller/pcie-rockchip-ep.c index 799461335762..9ebc227a1ef8 100644 --- a/drivers/pci/controller/pcie-rockchip-ep.c +++ b/drivers/pci/controller/pcie-rockchip-ep.c @@ -553,19 +553,6 @@ static void rockchip_pcie_ep_link_training(struct work= _struct *work) if (ret) goto again; =20 - /* - * Check the current speed: if gen2 speed was requested and we are not - * at gen2 speed yet, retrain again for gen2. - */ - val =3D rockchip_pcie_read(rockchip, PCIE_CORE_CTRL); - if (!PCIE_LINK_IS_GEN2(val) && rockchip->link_gen =3D=3D 2) { - /* Enable retrain for gen2 */ - rockchip_pcie_ep_retrain_link(rockchip); - readl_poll_timeout(rockchip->apb_base + PCIE_CORE_CTRL, - val, PCIE_LINK_IS_GEN2(val), 50, - LINK_TRAIN_TIMEOUT); - } - /* Check again that the link is up */ if (!rockchip_pcie_ep_link_up(rockchip)) goto again; --=20 2.52.0