[PATCH 2/6] PCI/pwrctrl: tc9563: Fix parsing the integrated Ethernet MAC Endpoint node

From: Manivannan Sadhasivam via B4 Relay

Date: Sat Jul 25 2026 - 05:02:13 EST


From: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxxxxxxxx>

DSP3 has an integrated Ethernet MAC Endpoint which has its own set of
config registers for configuring settings such as ASPM. The Endpoint
device has 2 physical functions and those 2 functions share the same
settings.

Hence, parse the Endpoint node under DSP3 instead of parsing both the
functions. The existing parsing logic also has one OOB issue as parsing
both functions will result in accessing past the tc9563_pwrctrl->cfg array.

Fixes: 4c9c7be47310 ("PCI: pwrctrl: Add power control driver for TC9563")
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxxxxxxxx>
---
drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c b/drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c
index 488e1ec34a7f..482e82e433dd 100644
--- a/drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c
+++ b/drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c
@@ -596,12 +596,17 @@ static int tc9563_pwrctrl_probe(struct platform_device *pdev)
ret = tc9563_pwrctrl_parse_device_dt(tc9563, child, port);
if (ret)
break;
- /* Embedded ethernet device are under DSP3 */
+
+ /*
+ * The integrated Ethernet MAC Endpoint under DSP3 is a single
+ * device whose functions share the same config registers.
+ */
if (port == TC9563_DSP3) {
- for_each_child_of_node_scoped(child, child1) {
- port++;
+ struct device_node *eth __free(device_node) =
+ of_get_next_available_child(child, NULL);
+ if (eth) {
ret = tc9563_pwrctrl_parse_device_dt(tc9563,
- child1, port);
+ eth, TC9563_ETHERNET);
if (ret)
break;
}

--
2.43.0