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
Open
WORKAROUND: PCI/pwrctrl: Skip power on/off for nodes without compatib…#480ziyuezhang-123 wants to merge 1 commit intoqualcomm-linux:qcom-6.18.yfrom
ziyuezhang-123 wants to merge 1 commit intoqualcomm-linux:qcom-6.18.yfrom
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…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:
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: