PCI/pwrctrl: tc9563: Fix parsing the integrated Ethernet MAC Endpoint node

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 two physical functions and those two functions share the same settings.

Parse the Endpoint node under DSP3 instead of parsing both 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: 4c9c7be473 ("PCI: pwrctrl: Add power control driver for TC9563")
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Alex Elder <elder@riscstar.com>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Link: https://patch.msgid.link/20260725-tc9563-fix-v1-2-ec4286e31331@oss.qualcomm.com
This commit is contained in:
Manivannan Sadhasivam 2026-07-25 10:59:14 +02:00 committed by Bjorn Helgaas
parent 9a089144d0
commit 6e5e6c2194

View File

@ -596,12 +596,18 @@ 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;
}