All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: xianhutan@asrmicro.com, linux-pci@vger.kernel.org
Subject: Re: [PATCH v2] PCI/PM: Reject invalid PMCSR when checking PME status
Date: Wed, 02 Dec 2026 06:34:47 +0000	[thread overview]
Message-ID: <sashiko-outbox-244983@kernel.org> (raw)
In-Reply-To: <20261202062959.3519241-1-xianhutan@asrmicro.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] PCI/PM: missing Fixes: trailer on pci_check_pme_status() bug fix
--

commit dcca1782a229a418387489996a407e0fb1b337cf
Author: Xianhu Tan <xianhutan@asrmicro.com>

> PCI/PM: Reject invalid PMCSR when checking PME status
>
> pci_check_pme_status() reads the PMCSR and checks the PME_STATUS
> bit without validating the value read from the device.
>
> If the device or its upstream bridge is inaccessible, a
> configuration read may return all ones. Since bit 15 of 0xffff
> is set, the PCI core incorrectly interprets the value as an
> asserted PME_STATUS bit and reports a spurious PME event.
>
> This can cause an unnecessary runtime resume of a suspended
> device.
>
> The issue occurs in pci_pme_list_scan(), which scans devices
> on the PME list and calls pci_check_pme_status() to check
> their PME status.
>
> On the affected platform, reading the PMCSR after the device
> enters D3hot with the PCIe link in L1 returns 0xffff, causing
> the PME scan to trigger a false PME event.
>
> Use PCI_POSSIBLE_ERROR() to reject an invalid PMCSR value
> before checking PME_STATUS.
>
> This also prevents writing the invalid PMCSR value back to
> the device when clearing the PME status.
>
> Tested on:
> - ARM32 platform with PCIe endpoint.
>
> Test cases:
> - PMCSR read returns 0xffff: no false PME event is reported.
> - Normal PME status handling remains unchanged.
>
> Signed-off-by: Xianhu Tan <xianhutan@asrmicro.com>

[Severity: Low]
This fixes a bug in pci_check_pme_status() present since the function
was introduced.  Should this include:

  Fixes: 58ff463396ad ("PCI PM: Add function for checking PME status of devices")

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261202062959.3519241-1-xianhutan@asrmicro.com?part=1

      reply	other threads:[~2026-12-02  6:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01  7:25 [PATCH] PCI/PM: Reject invalid PMCSR when checking PME status xianhutan
2026-12-01  7:32 ` sashiko-bot
2026-12-01 10:20 ` Lukas Wunner
2026-12-02  6:08   ` Xianhu Tan
2026-12-02  6:29   ` [PATCH v2] " xianhutan
2026-12-02  6:34     ` sashiko-bot [this message]

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-244983@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=xianhutan@asrmicro.com \
    /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.