From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f45.google.com (mail-dl1-f45.google.com [74.125.82.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 BAAC330F94B for ; Mon, 15 Jun 2026 19:30:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781551856; cv=none; b=Wvx4qFBuhkdC76FUvpTQwqDOmCvlxMDjR/uqGlZ8k5raO9F354PBf1TrjziN2r+TL8OB8VR2K9NVKm00iPUyiXWp2pupl7sI7d3oVxrncl8miwf6wdk/7/QBX6FVq0aFovxnVS1UcG2Fq44Xk3jU8XW2nyoAUjTg8EovGu2ABQo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781551856; c=relaxed/simple; bh=wc7FCP8WORYw2lNoc35F37YWJ7YSmYOF+dnbTHTVOS4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lNBwnPdc7B8enxvB557OREel36SDbk1p1UaluTEo33+eb2l0pa5TZWoPWeIEtR2lN1rBX5B3k0yMrVV0r7Z3l7YN0/pluoxHs0uLjnpYJQEBRe6IBuiD9hKLMAVSkSWEvVUuMeeLA9rsQyXw+S9r7bWWMnFG6ZI2K6M3y92z62g= 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=hRNtOC/Y; arc=none smtp.client-ip=74.125.82.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="hRNtOC/Y" Received: by mail-dl1-f45.google.com with SMTP id a92af1059eb24-137ec563a95so3993058c88.0 for ; Mon, 15 Jun 2026 12:30:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781551854; x=1782156654; 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=w4IpH5LEDaSFvAvPiFPbj5ZjEkRtPbLsUPqVa2w6YN4=; b=hRNtOC/YYaAi+8E8S61K3rjmSiWqJlAWvx7YxNE4ZCJuiArnmTMQlGPC9293sUNSM4 I1uqbAhD7UfAnLTlDKzvNy33EQJQ2Z7kwIjNDzCY8sYHd92EzMs48NiK77tix+T6/lcl vsh+VjBw0c5kmFmvwSOQURvf1EAR1Box1T7xTy6utiE4T/QE4YQFS5nCfOIAL1vEbn5G fk8eAadN/y58nTv1tGKbq+8rZwddh8qz9eODRJgnH23lmcB6kqNFOUIeSy6utqwqrnCY 8nDc3pwg9RrwP5rPhLkAP+Gt0PdAacO5jKGWik6l1Nf7OzQtSseK9MaMmsmsTGa239L5 BfFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781551854; x=1782156654; 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=w4IpH5LEDaSFvAvPiFPbj5ZjEkRtPbLsUPqVa2w6YN4=; b=nwmgXj8+910uko+wogYqATEfcu1UsI2I4zBRT9lubED6LLNVimdxIzaqIGCJy+9PVi gPRgtbDAIL9XnRe+wBkpN1d8AXFDfnZHUkUiumgnorZPyIisSKFKjIvXSeQpsYoNX2Ac Ld/+sAF2TjOAknU5Y9PWPTqF1OhEO2f0ydTyABPLZS4o/S95jEgoI0NJfg97gHwlQbJr NM2vVei0ENv0TM8H9+HT/y8XZigb7WVgTLjyAvJimoNtwrO9xSM+nlthaxbQWJ299uTN kf3aTypXq9Op8b3kjjpGoK7wAXYg+WJuxfyOhC9/ZnfHMhgWhYvt5Wk4Dmb3GOoASeiz Um2Q== X-Forwarded-Encrypted: i=1; AFNElJ8fKsHjH3F1bBrJK8h+OP6wLVUVu2kYtRO8he3hxwKtqILk+o/biUf/iXWW8SiBsZDWwzqd63MpTLrgFUA=@vger.kernel.org X-Gm-Message-State: AOJu0YykeF2Tsy+eephpYD2UHFoEcSodHuG8RXt8mf3b1d19DAcqpSUs HfWoAjQ6GuHRdjaXAqqYgBfTFwWXTbW8UjuIjQaccePVDOag2z0hpD+4 X-Gm-Gg: Acq92OHjY/HrCbF64GSJqIMqXPp41jXkiEsDvrlg0XuwwmJ5FU2lVBWOxkYjfPxjZ98 jSIpp6fVlod2+LGQs2rBDFKebjDCrAfSvXCEAq352nXrMndehWKrX4NeQtVcHR3Tv5thOWQkui0 QBN9M2ebhoPNwfLLUXsaXa95MpE18i+TDNZnlIV/p/xJbjjhyBhmLD5EFMpfimiHdncYlfKk0Hl NcHwLzYEfT4i5+vIr8pT8RSYNl00qh7m6Jjgizye1ZKwWxLYoxe6sU6eLxkKEWqyRJ/BUmlsdHx f68pAzBTB28TSq4RJpPY57XR+frvqbghEZAJ7ewFFfyjMmghTUOr/hsuUjkQs2HJfU6suDmU8NC fSKbajkf28TA/gwwzOawTrOXda6E7yL6PRbu360MUqGcVudHku9aySPc2jUbWY9NplFyvl7LH0j vSNZ32mXRLtPq5jYwRsM+i X-Received: by 2002:a05:7022:60e:b0:136:e639:9c22 with SMTP id a92af1059eb24-1386f39567dmr5125138c88.21.1781551853685; Mon, 15 Jun 2026 12:30:53 -0700 (PDT) Received: from geday ([189.115.92.220]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1384b97570asm10735958c88.12.2026.06.15.12.30.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2026 12:30:53 -0700 (PDT) Date: Mon, 15 Jun 2026 16:30:38 -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 Subject: Re: [PATCH v6 3/3] PCI: rockchip: drive at 2.5 GT/s, error other speeds Message-ID: References: <4ac5cd7d2271df375ed6307f5c394247721395d9.1781207474.git.geraldogabriel@gmail.com> 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: <4ac5cd7d2271df375ed6307f5c394247721395d9.1781207474.git.geraldogabriel@gmail.com> Hi, On Thu, Jun 11, 2026 at 05:04:22PM -0300, Geraldo Nascimento wrote: > 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") > 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 | 16 +++++++++------- > drivers/pci/controller/pcie-rockchip.h | 3 --- > 2 files changed, 9 insertions(+), 10 deletions(-) > > diff --git a/drivers/pci/controller/pcie-rockchip.c b/drivers/pci/controller/pcie-rockchip.c > index 0f88da3788054..5a2876d7c8547 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 *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"); > + } > > for (i = 0; i < ROCKCHIP_NUM_PM_RSTS; i++) > rockchip->pm_rsts[i].id = rockchip_pci_pm_rsts[i]; > @@ -147,12 +149,12 @@ int rockchip_pcie_init_port(struct rockchip_pcie *rockchip) > goto err_exit_phy; > } > > + /* 5.0 GT/s may cause catastrophic failure for this core */ > if (rockchip->link_gen == 2) > - rockchip_pcie_write(rockchip, PCIE_CLIENT_GEN_SEL_2, Sashiko caught unreachable dead code rightfully here. It looks like I had got it right in v4 and then the fix regressed. Will address this for v7 after I get more comments. Thanks, Geraldo Nascimento