Re: [PATCH 5/5] PCI: rzg3s-host: Add support for RZ/V2H(P) SoC
From: Claudiu Beznea
Date: Thu Mar 26 2026 - 08:57:35 EST
Hi, Prabhakar,
On 3/25/26 13:53, Lad, Prabhakar wrote:
from [1]:The other alternative would be the below, where we wouldn't need to
"For example, if rzg3s_pcie_resets_prepare_and_get() returns -EPROBE_DEFER,
the static variable is never decremented. On subsequent probe retries,
the variable will be artificially inflated, eventually causing the bounds
check to fail and returning a permanent -EINVAL. This would also prevent
driver unbind and rebind from working correctly."
use the num-lanes property but would need a comparison with the DT
compatible,
Or move rzv2h_num_total_lanes outside of rzv2h_pcie_setup_lanes() and reset it on failure path.
+ for_each_compatible_node(np, NULL, "renesas,r9a09g057-pcie") {
If it's possible I would avoid spreading compatibles though the file but instead use driver data where possible.
Thank you,
Claudiu
+ if (of_device_is_available(np))
+ count++;
+ }
+ if (!count)
+ return 0;
+
+ /* If both PCIe channels are enabled configure the LINK_MASTER
in x2 lane mode.
+ * If only one channel is enabled check the port index and if
port1 is enabled
+ * configure the LINK_MASTER in x2 lane mode, otherwise keep
it in x4 lane mode.
+ */
+ if (count == RZV2H_MAX_PCIE_PORTS ||
+ (count == 1 && host->channel == 1))
+ host->link_mode = RZV2H_PCIE_MODE_DUAL_X2;
+ else
+ host->link_mode = RZV2H_PCIE_MODE_SINGLE_X4;