mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Abhin Parekadan Jose <abhinjoses@gmail.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: bhelgaas@google.com, lukas@wunner.de, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org, ilpo.jarvinen@linux.intel.com,
	kees@kernel.org, xueshuai@linux.alibaba.com
Subject: Re: [PATCH RFC 2/3] PCI: pciehp: Report surprise removal from pciehp_isr()
Date: Sun, 20 Sep 2026 19:27:29 +0200	[thread overview]
Message-ID: <arAXgbTgz3YINvxn@home-desktop> (raw)
In-Reply-To: <20260912115420-mutt-send-email-mst@kernel.org>

On Sat, Sep 12, 2026 at 11:57:38AM -0400, Michael S. Tsirkin wrote:
> On Sat, Sep 05, 2026 at 06:38:59PM +0000, Abhin Parekadan Jose wrote:
> >  
> > diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
> > index 23b1605e783a..4e17878edeab 100644
> > --- a/drivers/pci/pci.h
> > +++ b/drivers/pci/pci.h
> > @@ -805,6 +805,12 @@ static inline int pci_dev_set_disconnected(struct pci_dev *dev, void *unused)
> >  	pci_dev_set_io_state(dev, pci_channel_io_perm_failure);
> >  	pci_doe_disconnected(dev);
> >  
> > +	return 0;
> > +}
> > +
> > +static inline int schedule_notification_work(struct pci_dev *dev, void *unused)
> > +{
> > +	pci_dev_set_disconnected(dev, NULL);
> 
> 
> Does this not break what patch 1 was trying to do,
> for everyone who does not call schedule_notification_work,
> that is, everyone except pciehp?
> 
> I'd say do the reverse: make schedule_notification_work
> schedule the work, and have both pcieh and 
> pci_dev_set_disconnected call that.
> 

Thanks for the review.

Yes - I've already done that locally. It'll be in the next version.

I've also been working through the races Sashiko flagged and looking for
other race conditions.

One is left: pciehp_is_spurious_link_change() ends up consuming the
one-shot flags PCI_DPC_RECOVERED and PCI_LINK_CHANGED, so whichever of
pciehp_ist() and pciehp_disconnect_work() calls it first consumes the
flag. I have a crude fix but it's untested; I'll get to it next weekend.

> 
> >  	if (READ_ONCE(dev->disconnect_work_enable)) {
> >  		/* Make sure work is up to date. */
> >  		smp_rmb();
> > -- 
> > 2.51.1
> > 
> 

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

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-05 18:38 [PATCH RFC 0/3] PCI: pciehp: Report surprise removal during safe removal Abhin Parekadan Jose
2026-09-05 18:38 ` [PATCH RFC 1/3] PCI: Report surprise removal event Abhin Parekadan Jose
2026-09-05 18:38 ` [PATCH RFC 2/3] PCI: pciehp: Report surprise removal from pciehp_isr() Abhin Parekadan Jose
2026-09-12 15:57   ` Michael S. Tsirkin
2026-09-20 17:27     ` Abhin Parekadan Jose [this message]
2026-09-05 18:39 ` [PATCH RFC 3/3] misc: Add edu_srpoc surprise removal POC driver Abhin Parekadan Jose

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=arAXgbTgz3YINvxn@home-desktop \
    --to=abhinjoses@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=mst@redhat.com \
    --cc=xueshuai@linux.alibaba.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®