Skip to content

WORKAROUND: PCI/pwrctrl: Skip power on/off for nodes without compatib…#480

Open
ziyuezhang-123 wants to merge 1 commit intoqualcomm-linux:qcom-6.18.yfrom
ziyuezhang-123:wa_qcs8300
Open

WORKAROUND: PCI/pwrctrl: Skip power on/off for nodes without compatib…#480
ziyuezhang-123 wants to merge 1 commit intoqualcomm-linux:qcom-6.18.yfrom
ziyuezhang-123:wa_qcs8300

Conversation

@ziyuezhang-123
Copy link
Copy Markdown

…le or supply

The pci_pwrctrl_create_device() already guards against creating pwrctrl platform devices for DT nodes that lack a "compatible" property or have no power-supply defined. However, pci_pwrctrl_power_off_device() and pci_pwrctrl_power_on_device() do not apply the same checks, so they attempt to look up a platform device for every child node regardless of whether one was ever created.

Add the same two early-return guards to both power-on and power-off paths:

  1. Skip nodes that have no "compatible" property, since no platform device will have been registered for them.
  2. Skip nodes for which of_pci_supply_present() returns false, since pci_pwrctrl_create_device() would have skipped those nodes too.

This mirrors the logic already present in pci_pwrctrl_create_device() and avoids spurious of_find_device_by_node() lookups for nodes that were never registered as pwrctrl devices.

CRs-Fixed:

…le or supply

The pci_pwrctrl_create_device() already guards against creating pwrctrl
platform devices for DT nodes that lack a "compatible" property or have
no power-supply defined. However, pci_pwrctrl_power_off_device() and
pci_pwrctrl_power_on_device() do not apply the same checks, so they
attempt to look up a platform device for every child node regardless of
whether one was ever created.

Add the same two early-return guards to both power-on and power-off
paths:

  1. Skip nodes that have no "compatible" property, since no platform
     device will have been registered for them.
  2. Skip nodes for which of_pci_supply_present() returns false, since
     pci_pwrctrl_create_device() would have skipped those nodes too.

This mirrors the logic already present in pci_pwrctrl_create_device()
and avoids spurious of_find_device_by_node() lookups for nodes that
were never registered as pwrctrl devices.

Signed-off-by: mokkprad <mokkprad@qti.qualcomm.com>
Signed-off-by: Ziyue Zhang <ziyue.zhang@oss.qualcomm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant