From nobody Tue Apr 7 17:12:30 2026 Received: from mail-vk1-f170.google.com (mail-vk1-f170.google.com [209.85.221.170]) (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 7B8BF23ABBD for ; Sat, 28 Feb 2026 00:55:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772240112; cv=none; b=lf4qkIW4T4ax6nObrSPlnJOruh69ClXzPmZyhHqx7VxUKH/ziGUvbjC7MN2XXjhklPWb9Xu2rnVlXL4ySMiOVWMcOhWadi3gotp6f3PQ2piEG2q8eTyn7i3zE/521Z+JNGnzBSYck0n2FKmUdY50uW3ga3Mz4RX+TMesSgO/Kr8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772240112; c=relaxed/simple; bh=dEE6VGsTSOYeekVC/927JnJzPCZGdsA6+ByrSiQA0sQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=eZ+edfb4mE4lTsNMxYsLARXAkODuXVHgK88eQnpa+3oUIfQc8Hs0mMM+rRHSnfySNAV4ZDyNG6GewUxeBpodT9lu9m6M18b7DUfNsvRr348w5OlyZWVfL8Ne8Qp/X6R5er3jmSgjhTIRaOGdi/C3h1WyHLyLCwUZ1vl3NYI4zJk= 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=S07OIAxk; arc=none smtp.client-ip=209.85.221.170 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="S07OIAxk" Received: by mail-vk1-f170.google.com with SMTP id 71dfb90a1353d-56a8a20e6e6so1194223e0c.0 for ; Fri, 27 Feb 2026 16:55:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772240110; x=1772844910; 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=tR8qs9++9EnY6kiO3ZkloT5P8dh9BxfptB2pOEQ7BLA=; b=S07OIAxkMHNDqywrWCgshv+EXJ38goGfzcBwtTCam5CFFaTXCYQ4Dj4YpMJnVtuIRR GpCfX1qqssXXlxZXxoVjdzTk9anhHJcZ8Xd6bFSTbi8B3cv95KInjjOnoJg1Q3da1G19 jsgU/Z6w66tGR22844MIGL4qlZqZQDuueKGzUnMJgOoXDUBniUIEIxd3AePp5GH949aI 1wMwTuwY+HqBxTOx9ITRaikET7PNKisMrXemCN3+SfkHRVjsev/kP/gRHVjZdi9i7zYR tVH3heC5jXK7GZOV/9gI6+esx2rnnL6ikGFtoHOuEyZiWPweH8QDsth7B1RtDTjU0Eug /V0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772240110; x=1772844910; 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=tR8qs9++9EnY6kiO3ZkloT5P8dh9BxfptB2pOEQ7BLA=; b=wdex7SM6X/aApm4VhygMBBGh7YMOMyasW00OgWyMndMEdknCjMIkjdzDBP0IJ4c7nl KzrMTL4riamLRZYXUDm62TxzPuKJL8p3lTHHoUmYmBOp9Z5aNPfsvaMl5NkxW1xmL4vU 0NlrmEOd2djoCPZquX+uflXvLE7whCl3BRlgICYfvvaQKpUM14f5McuLz14s4EZgz+UF YTZFkZBj8RtO3bO7Mzr6tOyAlzdctbqQo/3FlOk0F82oTC7EFc9pYwfTRAvsgnIIjZ0G NO1D0reB0ua5LEdMPH7d8Z4XJmbmmemSj4Ot3McXj/UkgNhwz09JPhhQw0mGeg58S+tl 1QAA== X-Forwarded-Encrypted: i=1; AJvYcCUXXQp/H+dx3Bgk/Km9+QXaJ0r27W/mbTMWXmN2Tgy7tOCP7p1jQrY9kNJz71SHiW+tdf/SUMDnQkpu9uE=@vger.kernel.org X-Gm-Message-State: AOJu0Ywbg0iiah9WiT0R+RplJYunEY7VVIjeCbIv6GpmiWRJnrGjUJKY PYVnm0MDJfdxrIMLOWchtDlrYtt14AWY/I8OqV4qLBfh3VO+0uVTsKII X-Gm-Gg: ATEYQzxxP6nAu9IiW8eh9pjSx3ywrefZBwsa+kg9+TyKCpshBvY4abfHFpZmqlt8MSk hytc41/HtGxf0KHj9YyPwHkxpMxtail1yOCNiAvEnxa9koXPLnOCTWCE9kJt1d18PUC5Jjk/t1v EAfgKqLgMvWansLMwqabnME2aTmlnjaXmlPP+FaGMKw5+vREo9taaNLT+rxSq6tqQIceoeEkE7j cFJcQoT3lxvMaUOm3g/Iq+SfZBSDAT4zsd0YNpa64dPCy6ZgZJniO2aBwAj50yYJSuDbU9cg3s2 fobu2GcWOp40m09f+BfD4jYwTHMApxJm3AI+Ad808172wyKMZH1Z0eXlVoF9yw7Txgc2mzDTSFf rGdLu+3OH2zPFJ9cHMB84MkTROqRMleyb7LEiX8sXdRKzXtGTF0vKN+BwP+0UtUwTjxIVzZvAZV YdbAEOsQRJgw== X-Received: by 2002:a05:6122:319c:b0:56a:995d:8a55 with SMTP id 71dfb90a1353d-56aa0aafaa0mr2391700e0c.12.1772240110383; Fri, 27 Feb 2026 16:55:10 -0800 (PST) Received: from geday ([2804:7f2:800b:feb1::dead:c001]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-56a91bb4fbesm8366399e0c.5.2026.02.27.16.55.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Feb 2026 16:55:09 -0800 (PST) Date: Fri, 27 Feb 2026 21:55:03 -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 v5 1/4] PCI: rockchip-ep: do not attempt 5.0 GT/s retraining Message-ID: <3391ff1386aafbee1754ca114d77961f23e2c09c.1772239598.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 code block from Rockchip PCIe EP 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-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 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 7590424503B for ; Sat, 28 Feb 2026 00:55:26 +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=1772240128; cv=none; b=ZZMISoZ/3mLd0ux7eCOPc7FYNkq7rXtHBxuRW3Qi4lm2KuQKGRxwucsXhpdrgeVWS+Zh0UZJKKj6lM4W7Su1gBfKf6T2mjUXZmOyCtdyy1eCS4fMien42OQEBUn00QPGHYZmo+KuqcFJ07LneRmfH/C2au6R8AyjtnxoIN14n/w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772240128; c=relaxed/simple; bh=GFndJvD0S3ipzYYAdq+4KgS0M9aqAQasboqVroQdCZU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VdE+V/wpkp1iyhvrmYXAkztd3/ghO+enLeVy4xjZpSXN6a6mJ17kSQXwho9UYFIYE0MDzVsSnE+XEc9J6VkOEcvlH5Lcn7VIW2YsG3K21iCyJHsDT9A7//VJB6x22tYnO3313W7mwgOgnySsCNVzb0JpNoZaUxYsrJdDDXMt7To= 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=celMQwMr; 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="celMQwMr" Received: by mail-ua1-f45.google.com with SMTP id a1e0cc1a2514c-94ac3958788so1397124241.0 for ; Fri, 27 Feb 2026 16:55:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772240125; x=1772844925; 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=3by8dItpKgMsvPGS2Pus1C94W5lhtexananCbnyqhcM=; b=celMQwMr94Le3hC7Qy5ifsVgt77NHUcTs8kA+3ASHkQxfrAjCZbJhEqONbPPRQX8oH jYlwSTOmfvNIXD98YEFRUVnW5Z/iNSWl/va00oHp2UmkIrKprmV237ZzfTmZLHZ0iKq/ ZNaNgv4Z0Zr+kcu9aebvLEXrZek05FNTdLomqGlQFKXKqfW8EI+IMZWo55lYzus5t2e4 Z0byeAAzl4ei4u1U0u0rUEhSdjGJSP4ONdWwRodPvrceJmAMk8BLke5SHtNzvaNDkGba LIVVI9pPs3DeAPNe6gv7BXiZAjRzsvRA9g4VoBBrTZT5+KKBCG7DGA9ifJ8V0Q/xlDId xDQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772240125; x=1772844925; 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=3by8dItpKgMsvPGS2Pus1C94W5lhtexananCbnyqhcM=; b=QxaQpUFALOL0iMn7h/2vQIModfAzsl6knF9gi7ijhMAgZ1seua0dArAkFxUE3dMpaB iQa6CmyCaoTv68enQT8FkrzL2VXZR/g+DlJTNnW8D6zCC5N8qTxSW7Z+GA42T5cseiOL GKLOs9R5i51qcF/GOyiQoudQRzJ3MSc6cS+ypU5zd2Kbi97JGkFYguK7Qw/eUriaQGax fd9tSBn6setLm7k/YdzG5pwtLAmLqvPlNNU8W/OAIkSI6qiV0iJ0PiZRaGt77R5fHsrk unxAN+lYWIqfO+WTL7nDWsbjNO0oDbc506KS/sE8hsxzUX7P1Ss3QFnO8gv68ycv5Mpf emmQ== X-Forwarded-Encrypted: i=1; AJvYcCX+cPSYHG7G/p+AiZALX8eGa6/0kHIqyfFb0+KUnOtXWJ8h/OPxSGdMtutTTrH+fqVab1jZ0SWp1mB8KC0=@vger.kernel.org X-Gm-Message-State: AOJu0YzmlG+ipL3C9pAyt46S3d22X8FZAV8RlFhKuGdHpCSJ9B57Y9ax rVRKfVcqbfuUQYhMDM7QTPLy9BsgTVX8eHPqOiVh0Rn3t8lftZY3J8Oa X-Gm-Gg: ATEYQzx2WptQAE1Qoa9LOO116SHa36xC6jdJDbtqqINKQ04WQxH10QJYeRFMnxbmg/x yi6ve1jQpgzSq60+6n5SOLDNSUIMWOlOirLbSTQZbv3CJo4irw7hY9Gc9AhDOfUu8k4azgFXCWg I8DY8scKV0yKAk1nOQ+nUVhXpECJeLplQ/ysA3tw5R5VvT4Z+SQqFeK4o80ngfc2EckBgNARNha aBKmCqqpCUOJ5FuSsOQcjJmgRoF3voFRSkkl+ncRNkvX83W0vq6zhfLIx71WJ6r9eaNz0S3U8Y8 VEZkGRFUtKFwDkfSonZbEBC+4tWswq7xjoXP/2lDW+6TUXt8W9IunNounsJH5F22/sxWgvWQAfB kbpex9rjb0BCB9vIX0dpJU27FTK84tNRMGSL75f9e90BARJhMrudwOcVwmBeQM4Mfvf1aEc5Gip GAIoF9a0kxaA== X-Received: by 2002:a05:6102:3047:b0:5fe:f592:1626 with SMTP id ada2fe7eead31-5ff1cda9994mr5177242137.3.1772240125413; Fri, 27 Feb 2026 16:55:25 -0800 (PST) Received: from geday ([2804:7f2:800b:feb1::dead:c001]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-94df63d6695sm6182090241.1.2026.02.27.16.55.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Feb 2026 16:55:25 -0800 (PST) Date: Fri, 27 Feb 2026 21:55:19 -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 v5 2/4] PCI: rockchip-host: do not attempt 5.0 GT/s retraining Message-ID: <4fa2c439482725bb191a225a3966300cea253db1.1772239598.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.0GT/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-vk1-f177.google.com (mail-vk1-f177.google.com [209.85.221.177]) (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 86A8925A354 for ; Sat, 28 Feb 2026 00:55:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772240141; cv=none; b=bcdKD+UEjIDwPq0QZ65jMNeaSWDug1o8oXslr8mQrpXRXN15P58EyfQ+I8JTYKkffMNzbaUxeFMvolrxYNmrEvvVZSAj+h+wBLJJBTXWzib2utz2CNPgGZZRwDClGpsItEbe31hDwXqO+5GbZklnl/dv4uxxeIgH616a8rvyYMo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772240141; c=relaxed/simple; bh=hsxOxdrEY1PMfZN/TdsLyyMTLKH0THeR1ALrpzgaJVw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VocPLOyx6qc/ollgs7tQ+npAJzW4GwDfLqwdjFL8wdO1QbixSEPYzEk7RjlyZteqHxbHn8HEyn0BXOvClkZbaRM7NdFp21LB/zaKmYjPvLyDZjBry6olxW0TOF67KhpWCGhC7sHMnxNWL8u8SoRUD3dg3nNqjsV8uax2FgHCGCc= 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=mzeli0dB; arc=none smtp.client-ip=209.85.221.177 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="mzeli0dB" Received: by mail-vk1-f177.google.com with SMTP id 71dfb90a1353d-56a973a7bdfso2476866e0c.3 for ; Fri, 27 Feb 2026 16:55:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772240139; x=1772844939; 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=0Cy6OANas5Ke7+g7WCbIZUx6sasEupi+10uNQ6dOOFA=; b=mzeli0dBp/aoHl9aabai19dq9wQ1TEE3dDi8aCgIIiZxLEk+rWGQ4Pe4vm1iffxih9 BH6YQ22Cv6WoviPvsfReYADe/dT4/OXXas2F26jQ88PY13MMYcQr/8cLjwFphn6ZxYic fQ4DBtu88g+/xt4W0HkmEIHvzj9ahrHfjFCmSxJ502jnfevGIBJew1+t7D1tpCNyaism USxrgiZ1S1fPrTbhsLkoLlzMDh2KgdVlnPD9+2/VRLK/9tow+aa7EX7NsdGm8h+pkNfP Dzlcb6PBUrWaeC8AlY0i4546E7DXJ1gTeqVfoc5RyXAia4C9Vs6pqOpiMSp1V6jDYDAv s7sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772240139; x=1772844939; 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=0Cy6OANas5Ke7+g7WCbIZUx6sasEupi+10uNQ6dOOFA=; b=WarN7AOSYZin75UnUUP49/2irqs4ZIqKgkKdfnDPG9ca+EnLEb77IWT2UuMOWMTS3/ 6SeF6gXD6IJAR78W84jgxO/GnUpCfaWPsINVJeKT9dIOwh0bXF9pv54jDLhcaNAtIiBx voAkKJRE7qrfgocNkEncXROdAllkX3JBCHUlUdn2vxAvUAJ0O+zqP2WinD6AzRNWGBAz wHz7Re63mXEIoFDW8S0AvxW5DGEWDXZNUqJHYz9HM18L6yUelufXotjIu6/KHKFy3EmO RMJTwnQWhAUpwVO0FuL5kKGOzA98LPWJvPL3AuPwUS6MM9KA63xUQGCYM1ZE+5Zw3eRe Eeeg== X-Forwarded-Encrypted: i=1; AJvYcCWK2zBHHW97yIoesxN7W7MRlD7ljDjd2urM4GRL/qFXHH/Ki2XU0U8sdHy+kdGXt3rOrMGpkMGwDi2kTzs=@vger.kernel.org X-Gm-Message-State: AOJu0YyU0dVXEdEfhqh+iURGgS9NxXpVQfqbI+SAPxYXtUbfDDSv09xd 86AIQ54VxM+SGqukF+LFat6cZrDc8X0p+3UP4bLuO0Mvp1u7gbR2KwX2 X-Gm-Gg: ATEYQzzo8Kel0/Vc0xt7mtz62qa4OjCw1RdAcwPgUk+9q1rd7YOq+ajKoQhRIrUSeOX r+lY9gwjj0iFw0fd1KzX2rkCGgcYkO8CRvteOB8Gewjj5U1LH+BxZx1LkfuO8iPOM83TGioIWVa YE7VUhSe86nVlHdgiyDP2CDyrXy1IlvXVWzDBypwjYm9r71sUQhbYXnM8f+dRlOW9EAAmYcZLr8 bQZC9sKaPVhCVDykEyXfUMfi5AxDslGZlhYxBRjwZGt5oxezmdabtZhW0U2TyUCLsYIYiSzqpdI lkrnGyFLPmBmfsEqjHDy98bk9GSrj+n26VIpbyrkBnAUjxkfBdUF/CuO/5X5DKGfz4wGG3JbuuD OwOEU2X61utzZi/PCnnrpFwL8+vnk+UVuV4p65CS/waq4e/EGlteTT7kCgYD1pdVAvXNK4Ftxi0 kn3mwDP0tjaQ== X-Received: by 2002:a05:6122:6992:b0:557:c6d3:5c0f with SMTP id 71dfb90a1353d-56aa0a941c7mr3144441e0c.13.1772240139485; Fri, 27 Feb 2026 16:55:39 -0800 (PST) Received: from geday ([2804:7f2:800b:feb1::dead:c001]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-56a9228d776sm8234832e0c.18.2026.02.27.16.55.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Feb 2026 16:55:39 -0800 (PST) Date: Fri, 27 Feb 2026 21:55:33 -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 v5 3/4] PCI: rockchip: drive at 2.5 GT/s, error other speeds Message-ID: <2a0a4aa97bb8b0cb511cb651c5d66c9ec8bab97a.1772239598.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 ignore any other speed with a warning. 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 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/pci/controller/pcie-rockchip.c b/drivers/pci/controlle= r/pcie-rockchip.c index 0f88da378805..2f211d1f4c7c 100644 --- a/drivers/pci/controller/pcie-rockchip.c +++ b/drivers/pci/controller/pcie-rockchip.c @@ -66,8 +66,10 @@ int rockchip_pcie_parse_dt(struct rockchip_pcie *rockchi= p) } =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) { + rockchip->link_gen =3D 1; + dev_warn(dev, "invalid max-link-speed, fix your DT\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 +149,13 @@ int rockchip_pcie_init_port(struct rockchip_pcie *roc= kchip) 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 + if (rockchip->link_gen =3D=3D 2) { + /* 5.0 GT/s may cause catastrophic failure for this core */ + dev_warn(dev, "5.0 GT/s may cause data loss or worse\n"); + } else { 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-f181.google.com (mail-vk1-f181.google.com [209.85.221.181]) (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 91CF726C3BE for ; Sat, 28 Feb 2026 00:55:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772240157; cv=none; b=to74kg9wVqYsCrKdYye5Eb1x8XT/J+2ZxAI29ny6Hlc+uzuH7n/PED4p0g0o2COnjrTPVuIVk4UyFPpO4eSRfIfDrMqVlBWxt3y51RbPiKm4bcgceY31ntUdmaC1b6QWJ+TjeTy+t7c+8E9TFxKalAEfpL+D3gy5rtvp6tqDHbM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772240157; c=relaxed/simple; bh=UtSvzYAQcA41IBGRV3oYLTiVcRrKHBSoX3j1aPJPYH8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gBSQDRBaJ4K4C4FUl79aDb5X5ak5aRBty/bqPI2kElsxEoyhbY7CRREZhFdApYKWhgLthzy7agI4XOXQLhnstjpBCe9ghcLe1++6ohG6ekgWXu7yL2FOycuVbUO8vu3GjoMGlD9lmU1aLox1cky6iwe9OckE34h3ZRuCZfrr0mU= 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=Ts/0iq4B; arc=none smtp.client-ip=209.85.221.181 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="Ts/0iq4B" Received: by mail-vk1-f181.google.com with SMTP id 71dfb90a1353d-56a88bfd470so1992557e0c.0 for ; Fri, 27 Feb 2026 16:55:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772240154; x=1772844954; 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=Vjfco02/smFUClEsqTheeyjpW86+y48auZFweZaaMU4=; b=Ts/0iq4BvTOPkmtyhlN0uNxEzyU3XvNoPdllIji1On19OYWrzuz8JIwGpplSzmwgvL yrqGSNAt5s2pU1Tng9mtJVsKKDVInH3/qmFjhhg6uEzN6EWJt1DTF1RmbxvQaVIrLoSx Dmh1zfOKucIfWfyLOPxck0md5m+/KFfQ/WLmDcTIn1MyzwESq9DqObqf02WMqwQepthi 9Tz+jykQIEeldLURlu+0uH/rly8fyesV7nfSxc2mdITYJzRRErSunt4j1F8l82v9/T2a dcWczcUGmT8zjBpsqtoM40BNx20bcxMprlq4GK5K0/cldmj44DUs+14LOxWnYwUjoKmP +2+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772240154; x=1772844954; 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=Vjfco02/smFUClEsqTheeyjpW86+y48auZFweZaaMU4=; b=WXnCWW53czS11fymcR3KJEqWq6mrii5hC0VUJ8BACUrETiQgLq9j6SvTfP7deq5259 KWzuNcDJteO1VnuaajfpC8J0XV/i+ZF5Az156SLmUqBWDJoRnNzbxy2eEBQt1O1LnuE/ Mj8bOQ+Tv15g7UDjwGAs8O5TGUZyqQAVpKLIuMAVRAp5gj5se1dRgk4ayPPOw/9iiwpG ferytSxAsLQ3cO4UwKhhh2pxM8Ocb7I732NBQ6j9whGDty+og0OIM3p1iTMgnWEpWZvz 4ILuzqkMLhdzSS5e5LcpHBtQwoWI1W+CCzLmSVIjScLrzLS8xdzCr4proQOvkiw3zWN2 bDag== X-Forwarded-Encrypted: i=1; AJvYcCWgMq690vkQTsHN0JEqQBrB6tByMN8CnRrJ8gvvNVRqdQ19HoYwioeBw/9B3Ci9LCJJwxoIn1nOyuYpTmY=@vger.kernel.org X-Gm-Message-State: AOJu0YzoqiCcOZkqqW6Zj3QBIY9HTorhh2xonT8qkK88U66sxLUAkZPQ ZiZXqlNmVcSsL6bA8rrywkhj7wOIpOMrcIcaB6hNiargSLeWGI6uREhf X-Gm-Gg: ATEYQzy0mEXbxNvzxVjjZX269rEf2+/KSJKgodOdAE9/2CGkfvRPsv1I6Q7ZfAXoNxV F7pI7WDd2+2oQZ2GxYv3JtkiGNwecqX9lyCLxA2Tnwbqmylg6r8JK/IAOvKBO7EB47NH4IihrVi gomUFjWZegq7nf6tkkqKVsjzDfJNxuS+CA5QAv5doy2RWx0W6TvJU8QacZWDmXnKgEZiQ580G2F K6FIFldmfQVw6Y6VjfBcApWi1wZ+HNixUpvUGZoFs72EW3V2pap//0xr+eZQf+F1OsRSKQEtvTc oHcpchh3Yweckxhr62KoZ4jQ5IKbbWWacQyYJdqqDxIcisu9jip87SdeLWMLZy54z7PWW19qbXM FR/DVzP0rDIzmCLvrmv1EoZbJsiSZLs6YR39LhJB7w+hZvnFnP/W5n1lmoL0B9xgs2cZ1YV3h+E Gszz1lAEl0yw== X-Received: by 2002:a05:6122:1da0:b0:567:4838:8e4c with SMTP id 71dfb90a1353d-56aa10046d4mr2709747e0c.8.1772240154391; Fri, 27 Feb 2026 16:55:54 -0800 (PST) Received: from geday ([2804:7f2:800b:feb1::dead:c001]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-56a91bb4fbesm8368019e0c.5.2026.02.27.16.55.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Feb 2026 16:55:54 -0800 (PST) Date: Fri, 27 Feb 2026 21:55:47 -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 v5 4/4] PCI: rockchip: drop 5.0 GT/s defines 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 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") 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