All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Zhu Qiyu" <qiyuzhu2@amd.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v2] PCI: pciehp: Avoid dropping hotplug interrupts due to stale HPIE
Date: Fri, 25 Sep 2026 11:54:41 +0000	[thread overview]
Message-ID: <20260925115442.63D461F00898@smtp.kernel.org> (raw)
In-Reply-To: <20260925114635.192878-1-qiyuzhu2@amd.com>

> pciehp_isr() uses the Hot-Plug Interrupt Enable (HPIE) bit in
> ctrl->slot_ctrl to reject interrupts when hotplug interrupts are
> disabled.  This check is needed because hotplug can share an interrupt
> with other sources, including native PME.
> 
> However, ctrl->slot_ctrl is updated from hardware on every Slot Control
> Register read-modify-write.  A firmware change to HPIE can race with an
> unrelated driver operation, such as an LED indicator update:
> 
>   1. The driver enables hotplug interrupts, setting both hardware HPIE
> 	  and the cached HPIE bit to 1.
>   2. Firmware temporarily clears hardware HPIE; the cached bit remains 1.
>   3. pcie_do_write_cmd() reads Slot Control for an indicator update and
> 	  observes HPIE=0.  Since the command's mask excludes HPIE, it
> 	  preserves the value read from hardware.
> [ ... ]
> This prevents stale-cache rejection of delivered interrupts, but does
> not restore hardware interrupt delivery.  If firmware restores HPIE
> before the driver's write, that write may clear it again.
> 
> Signed-off-by: Zhu Qiyu <qiyuzhu2@amd.com>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260925114635.192878-1-qiyuzhu2@amd.com?part=1


  reply	other threads:[~2026-09-25 11:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24 10:19 [PATCH] PCI: pciehp: Re-read Slot Control when cached HPIE is clear Zhu Qiyu
2026-09-24 10:30 ` sashiko-bot
2026-09-25 11:46 ` [PATCH v2] PCI: pciehp: Avoid dropping hotplug interrupts due to stale HPIE Zhu Qiyu
2026-09-25 11:54   ` sashiko-bot [this message]
2026-09-25 18:49   ` Lukas Wunner
2026-09-25 19:11     ` Lukas Wunner
2026-09-26 14:09     ` Zhu Qiyu

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=20260925115442.63D461F00898@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=qiyuzhu2@amd.com \
    --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.