From: Lukas Wunner <lukas@wunner.de>
To: "Alex G." <mr.nuke.me@gmail.com>
Cc: Keith Busch <keith.busch@intel.com>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
"Bolen, Austin" <austin_bolen@dell.com>,
"alex_gagniuc@dellteam.com" <Alex_Gagniuc@Dellteam.com>
Subject: Re: Should a PCIe Link Down event set the PCI_DEV_DISCONNECTED bit?
Date: Fri, 27 Jul 2018 09:18:13 +0200 [thread overview]
Message-ID: <20180727071813.GA6128@wunner.de> (raw)
In-Reply-To: <47727551-86ce-040a-2516-efa47ee3a76e@gmail.com>
On Thu, Jul 26, 2018 at 05:38:50PM -0500, Alex G. wrote:
> I was under the impression that a DLLSC or PDSC would trigger the
> PCI_DEV_DISCONNECTED bit to be set, blocking any further config access.
Only if the Presence Detect State bit in the Slot Status register is
not set.
I think the idea was that if the card is still in the slot, its driver can
be unbound orderly because the device is still accessible. So there's no
need to set PCI_DEV_DISCONNECTED.
However if there is a already a new card in the slot, PCI_DEV_DISCONNECTED
will erroneously not be set. Also, if card removal was triggered by the
link going down but the card is still in the slot, PCI_DEV_DISCONNECTED
will also erroneously not be set even though it's inaccessible.
The only situations when PCI_DEV_DISCONNECTED should not be set is if the
card is being removed by sysfs or by the user pressing the Attention Button.
Anything else is a surprise removal. What we need to do is pass down a
flag to pciehp_unconfigure_device() to indicate whether one of those two
situations is at hand or not, and PCI_DEV_DISCONNECTED should be set
depending on that flag.
Are you testing Bjorn's pci/hotplug branch or something based on 4.18 or
earlier? There is a major event handling rework queued on that branch,
so you may want to test with that.
> In the latter case, does it not make sense to have a separate bit to say
> "Don't touch this device"?
Hm, what would you need it for?
Thanks,
Lukas
next prev parent reply other threads:[~2018-07-27 8:38 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-26 22:38 Should a PCIe Link Down event set the PCI_DEV_DISCONNECTED bit? Alex G.
2018-07-26 23:00 ` Rajat Jain
2018-07-27 0:04 ` Alex_Gagniuc
2018-07-27 7:18 ` Lukas Wunner [this message]
2018-07-27 15:52 ` Alex_Gagniuc
2018-07-27 17:05 ` Lukas Wunner
2018-07-27 17:51 ` Alex_Gagniuc
2018-07-27 18:17 ` Sinan Kaya
2018-07-27 18:23 ` Alex_Gagniuc
2018-07-27 18:34 ` Sinan Kaya
2018-07-28 18:31 ` Lukas Wunner
2018-07-29 0:26 ` Sinan Kaya
2018-07-29 12:09 ` Lukas Wunner
2018-07-29 16:59 ` Sinan Kaya
2018-07-30 13:28 ` David Laight
2018-07-30 13:54 ` Lukas Wunner
2018-07-30 16:06 ` David Laight
2018-07-30 21:38 ` Alex_Gagniuc
2018-07-31 9:28 ` Lukas Wunner
2018-07-31 16:35 ` Alex_Gagniuc
2018-08-01 8:58 ` David Laight
2018-08-01 19:06 ` Alex_Gagniuc
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=20180727071813.GA6128@wunner.de \
--to=lukas@wunner.de \
--cc=Alex_Gagniuc@Dellteam.com \
--cc=austin_bolen@dell.com \
--cc=keith.busch@intel.com \
--cc=linux-pci@vger.kernel.org \
--cc=mr.nuke.me@gmail.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;
as well as URLs for NNTP newsgroup(s).