From: sashiko-bot@kernel.org
To: "Habil Eren Türker" <habilerenturker@hotmail.com>
Cc: "linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: Re: [PATCH] PCI: Convert pci.c to pci_power_t helpers
Date: Sat, 21 Nov 2026 13:06:56 +0000 [thread overview]
Message-ID: <sashiko-outbox-227039@kernel.org> (raw)
In-Reply-To: <20261121125811.50315-3-habilerenturker@hotmail.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] PCI: calls to undeclared pci_power_t helpers in
drivers/pci/pci.c break build
- [Low] PCI: redundant pci_power_t_eq() calls in pci_power_up() instead
of using state
--
commit fce5ad9abe7af15ce366f015c47398276c333e5f
Author: Habil Eren Türker <habilerenturker@hotmail.com>
PCI: Convert pci.c to pci_power_t helpers
This commit converts Power Management Control/Status register accesses in
drivers/pci/pci.c to use pci_power_t_get(), pci_power_t_set(), and
pci_power_t_eq() helpers.
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 8a0d9d4c71ed4..f947458391a83 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -1328,7 +1328,7 @@ void pci_update_current_state(struct pci_dev *dev, pci_power_t state)
> dev->current_state = PCI_D3cold;
> return;
> }
> - dev->current_state = pmcsr & PCI_PM_CTRL_STATE_MASK;
> + dev->current_state = pci_power_t_get(pmcsr);
> } else {
> dev->current_state = state;
> }
[Severity: High]
Are pci_power_t_get(), pci_power_t_set(), and pci_power_t_eq() missing a
prerequisite patch? None of these helpers are declared in the tree, so
drivers/pci/pci.c fails to compile.
> @@ -1525,12 +1525,11 @@ int pci_power_up(struct pci_dev *dev)
> return -EIO;
> }
>
> - state = pmcsr & PCI_PM_CTRL_STATE_MASK;
> + need_restore = !(pmcsr & PCI_PM_CTRL_NO_SOFT_RESET) &&
> + (pci_power_t_eq(pci_power_t_get(pmcsr), PCI_D3hot) ||
> + dev->current_state >= PCI_D3hot);
>
> - need_restore = (state == PCI_D3hot || dev->current_state >= PCI_D3hot) &&
> - !(pmcsr & PCI_PM_CTRL_NO_SOFT_RESET);
> -
> - if (state == PCI_D0)
> + if (pci_power_t_eq(pci_power_t_get(pmcsr), PCI_D0))
> goto end;
>
> /*
> @@ -1540,7 +1539,7 @@ int pci_power_up(struct pci_dev *dev)
> pci_write_config_word(dev, dev->pm_cap + PCI_PM_CTRL, 0);
>
> /* Mandatory transition delays; see PCI PM 1.2. */
> - if (state == PCI_D3hot) {
> + if (pci_power_t_eq(pci_power_t_get(pmcsr), PCI_D3hot)) {
> pci_dev_d3_sleep(dev);
> if (!(pmcsr & PCI_PM_CTRL_NO_SOFT_RESET)) {
> ret = pci_dev_wait(dev, "power up D3hot->D0uninitialized",
> @@ -1550,7 +1549,7 @@ int pci_power_up(struct pci_dev *dev)
> return -EIO;
> }
> }
> - } else if (state == PCI_D2) {
> + } else if (pci_power_t_eq(pci_power_t_get(pmcsr), PCI_D2)) {
> udelay(PCI_PM_D2_DELAY);
> }
[Severity: Low]
This isn't a bug, but local variable state in pci_power_up() is already
declared as pci_power_t. Assigning state = pci_power_t_get(pmcsr) would
keep the existing state == PCI_D* checks instead of repeating
pci_power_t_eq(pci_power_t_get(pmcsr), ...) four times, matching the
commit message note about keeping direct comparisons on pci_power_t
values.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261121125811.50315-3-habilerenturker@hotmail.com?part=1
next prev parent reply other threads:[~2026-11-21 13:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-21 12:59 [PATCH v3 0/4] PCI: Add pci_power_t helper functions Habil Eren Türker
2026-11-21 12:59 ` [PATCH v3 1/4] " Habil Eren Türker
2026-11-21 12:59 ` [PATCH] PCI: Convert pci.c to pci_power_t helpers Habil Eren Türker
2026-11-21 13:06 ` sashiko-bot [this message]
2026-11-21 12:59 ` [PATCH v3 3/4] PCI: Convert quirks.c " Habil Eren Türker
2026-11-21 12:59 ` [PATCH v3 4/4] x86/quirks: Use pci_power_t_eq() in apple_airport_reset() Habil Eren Türker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-227039@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=habilerenturker@hotmail.com \
--cc=linux-pci@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.