From nobody Tue Dec 2 02:58:56 2025 Received: from mail-oi1-f176.google.com (mail-oi1-f176.google.com [209.85.167.176]) (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 4D113309F0F for ; Mon, 17 Nov 2025 21:47:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763416037; cv=none; b=ICUbIrReWdx4G0RymP4AM/TcfnixiCmYIY78/8oubNAW39yeJyFdys2z5NmwvKs1grD+Zceh/buJUxItxv/ojo1BgIg8M3zomKrw77u5DoluZyUIFYVNCdl0OqApUfYCihJNLssBVDa5XuvHu9cj09lNhlGZandZ+1tkgGeyouI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763416037; c=relaxed/simple; bh=rEEQFx4zgxN0BT5dnIQoDnQ/Vyz8VB9bqZUOn4U6KIE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UWVcEyo0rAF5/kZAqP1pxV9igezTPZWWj5Yq+5rDHc0XdC7LNBAdm3CvO/ZWIhFH7ykCca+NprSTWlXPjfwYavYsNvjhZFS2ujX2rIGBb6oZ0pZUT+oLks4bCPE5usuRno/qH3dMddSNiP8XQuGkySUE5OmvVn2/Xj2bqrzfxwM= 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=Yldp17kx; arc=none smtp.client-ip=209.85.167.176 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="Yldp17kx" Received: by mail-oi1-f176.google.com with SMTP id 5614622812f47-4507605e19aso2393910b6e.2 for ; Mon, 17 Nov 2025 13:47:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763416034; x=1764020834; 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=RLE4Tj3ESr9ube8E0SxlookVVEHtTNDbpqvD6AIIcXk=; b=Yldp17kxOXENtiHOMPg54sBBh71vVWgrneO+gBkTvUbZ382fkOq7UlL2DKWJbsj2XI DqZDKYmf3xi0CxYS9+1RAGQbKzXr8ZqNkxSyF9IDfgkNbICtibaEp5S+YVoqW3XHcgkZ WMosEigYAFq5FHFFeZIXQdTRVc7JQ/iE8DsSFKx/maahSnICce+0c+XCDx2KIrvrk+X2 uZu1oGeUjfl7YM/X+aaQQpE79l1T3Rrkw/QgKgiaOEjwmtK351hRZo6MS697dDRMw74s +iLEMdatCh4oUPoDpRSAbO47ZZJPBql86VkMIiJBWfvaXEDySKog71UbDFshlYixYWDS mgig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763416034; x=1764020834; 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=RLE4Tj3ESr9ube8E0SxlookVVEHtTNDbpqvD6AIIcXk=; b=h1Var52TWr8d4whobzeeDSH/E2n6dhSrDw845Yy97ENigq+7I5qxy9Qv0QoXtFvzta 9b8DLrpXaIqe1w5gP01WPJ6AiXzewYBjTcbXrX2KgKToWkP3eEwlCDSjKenA4QxPAZsA Jd9kaEEEwvL7LgNzs+o9w/AFYxEU7Sy4JNX/ANUUFFAEnMW2mJq6ZRP1uwQEy+bNV+oz oWPf5A0ogFCSn+9VphJF1h+Q3cYm+OzPrlhfl0SJgmrog0EfClgwgVbd1E9WAKIb0zKE SYMh0a0RcePeX0+5bRYm9OS6MgaZdwiF882i3jxx0P9PKAeDkZ3ORVvMtusTrWHnDJPb HpXg== X-Forwarded-Encrypted: i=1; AJvYcCVFk5RTdVQ57jTIvbkFpt1ditRkWoGthcmb0OtL6cMcGYQLD22/+OrPsM7laCGeZgn35GDhZmS1g3ZHCug=@vger.kernel.org X-Gm-Message-State: AOJu0YwDZMBNFM8LsmIHQ6glwudzZG95YxiPQ01s34CgLz3yOlkw1u4i b0z+zJ69yBHTilYbPXoXeQHoKZ/Hlx4BzRAtbFG6UUQSzWpCYvLFv/X/ X-Gm-Gg: ASbGnctAHwzq4JF3vs2JapSoEfSAtiLpeIyl5bf4qqlU/+dltSJ/neQTfIZVwusaVia s4l4uULjV/lQzieaUMs5GjeBL0fIzb0+GEWpCA+/jQRbrm07hCf5tY836qfBry+KMEbPtc2BtMK ++GO3fxcVAYwWgB7G0VCTtvzylCefSVkDElEK05Ln5p/Y2pko/9oFgfBq0f1gt5RGRZtUx8+dtI AQfJ594TLb1SuGDB3pWCQ62YwWJmgZamz7V6gAqpZhmJX7dX9na4zx1tAiPV/NhKEK3OxQcWVUZ dV2wihZo6UTbRTnNjn8iD1nBqwzmW5N6si2lQ+3ILE2dDhLkSMbowU8Z6SP9YIKz05UtE14FVpK 0FhUvCr0bkuOqLYXE5ZsY2X7aB+K/AlTZOMcV0zCnX/04tu/57h4p13InBgEHUohR6gBxfNpD63 enT7o25SGY X-Google-Smtp-Source: AGHT+IFArlQ2cA5dLvmMgTWWlBYjPL1Kt7bZiu5SvNfPraKVrXfO2Bo2fAnkStrr+f9d2tNIoobFUg== X-Received: by 2002:a05:6808:470b:b0:438:1c76:d40 with SMTP id 5614622812f47-450973e9467mr6858397b6e.4.1763416034208; Mon, 17 Nov 2025 13:47:14 -0800 (PST) Received: from geday ([2804:7f2:800b:a807::dead:c001]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-65724cfa332sm4779211eaf.7.2025.11.17.13.47.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Nov 2025 13:47:12 -0800 (PST) Date: Mon, 17 Nov 2025 18:47:05 -0300 From: Geraldo Nascimento To: Shawn Lin , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Heiko Stuebner , Krzysztof Kozlowski , Conor Dooley , Johan Jonker , 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, devicetree@vger.kernel.org Subject: [PATCH v2 1/4] PCI: rockchip: limit RK3399 to 2.5 GT/s to prevent damage 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" Shawn Lin from Rockchip has reiterated that there may be danger in using their PCIe with 5.0 GT/s speeds. Warn the user if they make a DT change from the default and drive at 2.5 GT/s only, even if the DT max-link-speed property is invalid or inexistent. This change is corroborated by RK3399 official datasheet [1], which says 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 Reviewed-by: Dragan Simic Signed-off-by: Geraldo Nascimento --- drivers/pci/controller/pcie-rockchip.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/pcie-rockchip.c b/drivers/pci/controlle= r/pcie-rockchip.c index 0f88da378805..992ccf4b139e 100644 --- a/drivers/pci/controller/pcie-rockchip.c +++ b/drivers/pci/controller/pcie-rockchip.c @@ -66,8 +66,14 @@ 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 > 2) { + rockchip->link_gen =3D 1; + dev_warn(dev, "invalid max-link-speed, set to 2.5 GT/s\n"); + } + else if (rockchip->link_gen =3D=3D 2) { + rockchip->link_gen =3D 1; + dev_warn(dev, "5.0 GT/s is dangerous, set to 2.5 GT/s\n"); + } =20 for (i =3D 0; i < ROCKCHIP_NUM_PM_RSTS; i++) rockchip->pm_rsts[i].id =3D rockchip_pci_pm_rsts[i]; --=20 2.49.0