From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) (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 06C2D3161BF for ; Thu, 11 Jun 2026 20:03:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781208235; cv=none; b=kccdn31XsI7t6dYmi+F58q028GjZS6H5QXxHHjekC5ULD4D9E6tzBKWcftxtj2kRkTPAE9qgbPR4qFYaQooYH0JhtaSJXUbp4ZurDgaCHariwa+ZE6kTspN37cTnIQyuWoE/c8r0F8IlbJ0W3v1XkchIY19q3zl9ySOPgI8O0+c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781208235; c=relaxed/simple; bh=TFTAot1IKWMOYgZRmrw+FhVwE6dd6IS9bop8XrNJ0Bw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Q5Qy8af72sqxiJ3DGt3sWxin1SRa6Uvl+SbegMqbBMU91GDNCXwkitTW9qdFjJyWQyVC5T55zHFDqCo8lCXYOrodOMNht0s4YjAAY9Pm95vMTFLMQ56Nt3clYIOcgC9+eR589NKlM2F3Ud8fDf+QNXRmPI66ddKDZvfJ9oxcD1A= 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=kI8rakMp; arc=none smtp.client-ip=209.85.222.178 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="kI8rakMp" Received: by mail-qk1-f178.google.com with SMTP id af79cd13be357-9155183b42cso39525185a.0 for ; Thu, 11 Jun 2026 13:03:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781208233; x=1781813033; 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=2OIfDLIkJhbaUkdh0HltZEozEAObCZ7mgl0RsbHOTNY=; b=kI8rakMp2FwOePWW0jXoMdXYSkwLWGtjFHeU3SfX2KdD0knUU1c879EbuAHrDc5M6Q 73A2eWooA5rg9P3FpS5Bx2XBNP8fy8MHqwvZCJowvVxhPSjiTVHJYDX59q6h0f0dvDep 3+oIMk8yvUYafWOkDqvLCRkdx7fl76UzSjIrMJDuuOSxF8OCfC4kOn0pTZptJOku0iCL RJbulWj9nzCriEArD5dAkxUkXQWgOb5EQruC4o9K7zsNGkSe+IGcj3NpaQKfeAbK3vEi e8/4ExnVsIN3aU30X60qDPr2dB6DVbuy+a5kU57PJo0YJz4xqrRzqXfgdBVR1GOtzQop qlcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781208233; x=1781813033; 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=2OIfDLIkJhbaUkdh0HltZEozEAObCZ7mgl0RsbHOTNY=; b=Bk9a9BVtpui5HQu8iqAUBKO2kWEYhFbzU1FWV7yAzowUoSfCw992V+WRm5/lw/7P7Y ZIL6hy56nLj8NFPhx6jLlTtV+Bz3cfpTXJyCIhpQ6RH7bqDaxRQ8lDv2i5rkF4xIuTMx icyKiuoVj8pn/b7CRBQpOwGrIeD9vhxzVLO6lyIxVGAGZ3no2DLVudvyyXw/3BWsD4IL vqqOAx9pnl1Bpuf07MWRxWuEQZJpRQ2RhBvufYiPSbFohG2JVB9CQQHiG255DARdJVc+ gNZQlSy1MRKdd7l0OGH5ya5HOHy9exDZzQm4Izm/qvrf18OjXv3Y9RK5opnc2VvM97vw VnEw== X-Forwarded-Encrypted: i=1; AFNElJ8Pin/WunJUz4pFmbDNwcp8FLzoF8Sg0EJWzmANYQyQ3bg7p24Nr3lvM+QTK9nD+NpwFzODEt1lsYKlEoQ=@vger.kernel.org X-Gm-Message-State: AOJu0YzzAJSSq/FoFvZpgYF1qOs9K26xUtENenzhgMUgW8FZPkLJ6WuQ /uhqaG0FfV+8a3wZ08o7fIuLAXXrhNXq45oq9rXfaIvCIHFAU8nP//tZ X-Gm-Gg: Acq92OG2eqBc21vfUzGrVRYyO1O0XXvRuQ5NBfa762wwyrcYj1aA7C56Un7vBPkkTva NBqr4z4Vzdbdn6dsmKRsPpr+qGigieE7NgO+YJAUZnVv2861J/ZQCHnzYeitsFF7hQ0RMSjeXk4 lCA852dhbdKHGR6MBDh3EDzq7khSIl1Cr+U7l8ZXF6zd21zWtZXiZc2xch1hQYwi5lQTUhUBlaE UKJrFYwyWsIKdwuEt7cJUr+chnOnuiktjc5R6bWBSMmcFg2hZYbU6oSYOBP0Sdb3wFUpMt94dmZ VcFhhiunSv205LaQNFnJgbYd0y//47nLNJp2V/YvhOVAKIZ86EublCWrnA1iTdu+ZR8glRdeZ8u XLwBWK9/GKQiUE9xbXCKfv8JpSh0FfY8iFwgDedJ5jNLjypQ+3kvHmsbrnVid9D+yj2D7ObCiTV 12A1vV0QSs X-Received: by 2002:a05:620a:288d:b0:916:5f5:de22 with SMTP id af79cd13be357-91619dfb646mr39598985a.12.1781208232857; Thu, 11 Jun 2026 13:03:52 -0700 (PDT) Received: from geday ([2804:7f2:800b:f09::dead:c001]) by smtp.gmail.com with ESMTPSA id af79cd13be357-91619ed7215sm11571185a.7.2026.06.11.13.03.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jun 2026 13:03:52 -0700 (PDT) Date: Thu, 11 Jun 2026 17:03:46 -0300 From: Geraldo Nascimento To: Shawn Lin , Dragan Simic Cc: linux-rockchip@lists.infradead.org, Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Geraldo Nascimento Subject: [PATCH v6 2/3] PCI: rockchip-host: 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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/controller/pcie-rockchip-host.c index ee1822ca01db3..1374a2c92b563 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 rockchip_pcie *rockchip) goto err_power_off_phy; } - if (rockchip->link_gen == 2) { - /* - * Enable retrain for gen2. This should be configured only after - * gen1 finished. - */ - status = rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_CR + PCI_EXP_LNKCTL2); - status &= ~PCI_EXP_LNKCTL2_TLS; - status |= PCI_EXP_LNKCTL2_TLS_5_0GT; - rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_CR + PCI_EXP_LNKCTL2); - status = rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_CR + PCI_EXP_LNKCTL); - status |= PCI_EXP_LNKCTL_RL; - rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_CR + PCI_EXP_LNKCTL); - - err = 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 = rockchip_pcie_read(rockchip, PCIE_CORE_CTRL); status = 0x1 << ((status & PCIE_CORE_PL_CONF_LANE_MASK) >> -- 2.54.0