All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Abhin Parekadan Jose" <abhinjoses@gmail.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH RFC v2 4/5] PCI: pciehp: Report surprise removal from pciehp_isr()
Date: Sun, 27 Sep 2026 17:02:18 +0000	[thread overview]
Message-ID: <20260927170219.382041F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260927165459.829900-5-abhinjoses@gmail.com>

> A surprise removal during a safe removal cannot be reported: the
> removal blocks waiting on a device interrupt or status read, and the
> single-threaded IRQ thread is itself executing that removal, so it
> cannot report that the device is gone. The removal hangs.
> 
> The hardirq handler pciehp_isr() still runs while the IRQ thread is
> blocked, so it can report the disconnect. However, pciehp_ist()
> deliberately ignores link and presence changes caused by a Secondary
> Bus Reset or Downstream Port Containment, where the device is only
> temporarily inaccessible. Distinguishing those normally requires
> waiting for the SBR or DPC to conclude, which takes seconds and is not
> possible in hardirq context.
> 
> Schedule a work item from pciehp_isr() when a PDC or DLLSC event
> arrives and neither Presence Detect State nor Data Link Layer Link
> Active indicates that a card is present.
> This provides us a pathway to wait/block/sleep as we will not be
> in pciehp_isr().
> 
> In pciehp_disconnect_work(), wait for the DPC recovery or SBR to complete
> before checking presence and not consume the link change flags, so that
> pciehp_ist() can still see them and ignore the link change if it was
> caused by a DPC or SBR. Even after the DPC or SBR has completed, if the
> device is really gone then pciehp_disconnect_work() will see that and
> report the surprise removal. Like pciehp_ist(), it holds a runtime PM
> reference on the port and checks presence under reset_lock, since a
> slot reset may make Presence Detect State and Link Active flap.
> 
> Link: https://lore.kernel.org/all/aHlZE18kPuHuDtTT@wunner.de/
> Signed-off-by: Abhin Parekadan Jose <abhinjoses@gmail.com>

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

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260927165459.829900-1-abhinjoses@gmail.com?part=4


  reply	other threads:[~2026-09-27 17:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-27 16:54 [PATCH RFC v2 0/5] PCI: pciehp: Report surprise removal during safe removal Abhin Parekadan Jose
2026-09-27 16:54 ` [PATCH RFC v2 1/5] PCI: Report surprise removal event Abhin Parekadan Jose
2026-09-27 17:07   ` sashiko-bot
2026-09-27 16:54 ` [PATCH RFC v2 2/5] PCI: pciehp: Add pci_hp_wait_link_change() Abhin Parekadan Jose
2026-09-27 17:03   ` sashiko-bot
2026-09-27 16:54 ` [PATCH RFC v2 3/5] PCI/DPC: Add pci_dpc_wait_recovery() Abhin Parekadan Jose
2026-09-27 16:59   ` sashiko-bot
2026-09-27 16:54 ` [PATCH RFC v2 4/5] PCI: pciehp: Report surprise removal from pciehp_isr() Abhin Parekadan Jose
2026-09-27 17:02   ` sashiko-bot [this message]
2026-09-27 16:54 ` [PATCH RFC v2 5/5] misc: Add edu_srpoc surprise removal POC driver Abhin Parekadan Jose
2026-09-27 17:00   ` sashiko-bot

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=20260927170219.382041F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=abhinjoses@gmail.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.