Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH] PCI: rcar-gen4: Configure bifurcation only on R-Car Gen4 SoC PCIe controller
@ 2026-12-02  3:02 Marek Vasut
  2026-12-02 13:46 ` Koichiro Den
  0 siblings, 1 reply; 2+ messages in thread
From: Marek Vasut @ 2026-12-02  3:02 UTC (permalink / raw)
  To: linux-pci
  Cc: Marek Vasut, stable, Koichiro Den, Krzysztof Wilczyński,
	Bjorn Helgaas, Geert Uytterhoeven, Lorenzo Pieralisi, Magnus Damm,
	Manivannan Sadhasivam, Rob Herring, Yoshihiro Shimoda,
	linux-renesas-soc

The R-Car Gen5 SoC PCIe4 controller documentation describes the PCIEMSR0
bits 0 and 1 as reserved. The R-Car Gen4 SoC PCIe controller documentation
describes the PCIEMSR0 bits 0 and 1 as BFRCTNST, bifurcation mode setting.
Set the BFRCTNST bits only on R-Car Gen4 SoC PCIe controllers, and do not
configure those bits on R-Car Gen5 SoC PCIe4 controller.

Fixes: 3283c4db6009 ("PCI: rcar-gen4: Add support for R-Car X5H PCIe4")
Cc: stable@vger.kernel.org
Suggested-by: Koichiro Den <den@valinux.co.jp>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
---
Cc: "Krzysztof Wilczyński" <kwilczynski@kernel.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Koichiro Den <den@valinux.co.jp>
Cc: Lorenzo Pieralisi <lpieralisi@kernel.org>
Cc: Magnus Damm <magnus.damm@gmail.com>
Cc: Manivannan Sadhasivam <mani@kernel.org>
Cc: Rob Herring <robh@kernel.org>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: linux-pci@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org
---
 drivers/pci/controller/dwc/pcie-rcar-gen4.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/controller/dwc/pcie-rcar-gen4.c b/drivers/pci/controller/dwc/pcie-rcar-gen4.c
index 2e640110e3910..ebc2957f6d322 100644
--- a/drivers/pci/controller/dwc/pcie-rcar-gen4.c
+++ b/drivers/pci/controller/dwc/pcie-rcar-gen4.c
@@ -100,6 +100,7 @@ struct rcar_gen4_pcie_drvdata {
 	int (*speed_control)(struct rcar_gen4_pcie *rcar);
 	enum dw_pcie_device_mode mode;
 	bool mrrs_256b_limit;
+	bool bifurcation_supported;
 };
 
 struct rcar_gen4_pcie {
@@ -262,7 +263,7 @@ static int rcar_gen4_pcie_common_init(struct rcar_gen4_pcie *rcar)
 		goto err_unprepare;
 	}
 
-	if (dw->num_lanes < 4)
+	if (rcar->drvdata->bifurcation_supported && dw->num_lanes < 4)
 		val |= BIFUR_MOD_SET_ON;
 
 	writel(val, rcar->base + PCIEMSR0);
@@ -1139,6 +1140,7 @@ static struct rcar_gen4_pcie_drvdata drvdata_r8a779f0_pcie = {
 	.speed_control = rcar_gen4_pcie_speed_control,
 	.mode = DW_PCIE_RC_TYPE,
 	.mrrs_256b_limit = true,
+	.bifurcation_supported = true,
 };
 
 static struct rcar_gen4_pcie_drvdata drvdata_r8a779f0_pcie_ep = {
@@ -1148,6 +1150,7 @@ static struct rcar_gen4_pcie_drvdata drvdata_r8a779f0_pcie_ep = {
 	.speed_control = rcar_gen4_pcie_speed_control,
 	.mode = DW_PCIE_EP_TYPE,
 	.mrrs_256b_limit = true,
+	.bifurcation_supported = true,
 };
 
 static struct rcar_gen4_pcie_drvdata drvdata_rcar_gen4_pcie = {
@@ -1157,6 +1160,7 @@ static struct rcar_gen4_pcie_drvdata drvdata_rcar_gen4_pcie = {
 	.speed_control = rcar_gen4_pcie_speed_control,
 	.mode = DW_PCIE_RC_TYPE,
 	.mrrs_256b_limit = true,
+	.bifurcation_supported = true,
 };
 
 static struct rcar_gen4_pcie_drvdata drvdata_rcar_gen4_pcie_ep = {
@@ -1166,6 +1170,7 @@ static struct rcar_gen4_pcie_drvdata drvdata_rcar_gen4_pcie_ep = {
 	.speed_control = rcar_gen4_pcie_speed_control,
 	.mode = DW_PCIE_EP_TYPE,
 	.mrrs_256b_limit = true,
+	.bifurcation_supported = true,
 };
 
 static struct rcar_gen4_pcie_drvdata drvdata_rcar_gen5_pcie = {
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-12-02 13:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02  3:02 [PATCH] PCI: rcar-gen4: Configure bifurcation only on R-Car Gen4 SoC PCIe controller Marek Vasut
2026-12-02 13:46 ` Koichiro Den

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox