From: Lukas Wunner <lukas@wunner.de>
To: Smita Koralahalli <Smita.KoralahalliChannabasappa@amd.com>
Cc: Sathyanarayanan Kuppuswamy
<sathyanarayanan.kuppuswamy@linux.intel.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
Bjorn Helgaas <bhelgaas@google.com>,
oohall@gmail.com, Mahesh J Salgaonkar <mahesh@linux.ibm.com>,
Yazen Ghannam <yazen.ghannam@amd.com>,
Fontenot Nathan <Nathan.Fontenot@amd.com>
Subject: Re: [PATCH v2 1/2] PCI: pciehp: Add support for async hotplug with native AER and DPC/EDR
Date: Thu, 11 May 2023 08:56:36 +0200 [thread overview]
Message-ID: <20230511065636.GA2478@wunner.de> (raw)
In-Reply-To: <5efcb6a9-5878-1e26-dd43-2e4bd01bc8a1@amd.com>
On Wed, May 10, 2023 at 02:42:13PM -0700, Smita Koralahalli wrote:
> As far as I can see, async removal solely with DPC is not handled properly
> in Linux.
The dpc driver can react to a DPC event, attempt reset recovery.
But it doesn't do de-enumeration or re-enumeration of subordinate devices.
It also doesn't do slot handling (enable/disable Power Controller etc).
That's only implemented in the hotplug driver.
PCIe r6.0.1 contains appendix I.2 which basically suggests to "use DPC"
for async hot-plug but that doesn't really seem to make sense.
> On AMD systems, PDSC is triggered along with DPC on a async remove. And this
> PDSC event (hotplug handler) will unconfigure and uninitialize the driver
> and device.
> This is one thing which I wanted clarity on as per my question in v1.
> Whether all systems
> trigger PDSC on a async remove along with DPC?
In principle, yes. Actually the hotplug driver will see both a DLLSC
*and* a PDC event and will react to whichever comes first. Experience
has shown that the two events may occur in arbitrary order and with
significant delays in-between.
There are systems which erroneously hardwire Presence Detect to zero.
The hotplug driver works even with those. It solely relies on the
DLLSC event then, see commit 80696f991424 ("PCI: pciehp: Tolerate
Presence Detect hardwired to zero").
> I feel there are two approaches going forward. Since, hotplug handler is
> also
> triggered with PDSC, rely on it to bring down the device and prevent calling
> the
> error_recovery process in dpc handler as its not a true error event. I have
> taken this
> approach.
>
> Or, don't call the hotplug handler at all and rely on DPC solely to bring
> down the device
> but here, there should be additional callbacks to unconfigure and
> uninitialize the pcie
> driver and currently I only see report_slot_reset() being called from
> error_recovery()
> and I don't think it unconfigures the driver/device.
The latter approach doesn't really make sense to me because we'd have to
duplicate all the slot handling and device de-/re-enumeration in the dpc
driver.
Let's try masking Surprise Down Errors first and see how that goes.
Thanks,
Lukas
next prev parent reply other threads:[~2023-05-11 6:57 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-18 21:05 [PATCH v2 0/2] PCI: pciehp: Add support for native AER and DPC handling on async remove Smita Koralahalli
2023-04-18 21:05 ` [PATCH v2 1/2] PCI: pciehp: Add support for async hotplug with native AER and DPC/EDR Smita Koralahalli
2023-05-09 21:10 ` Sathyanarayanan Kuppuswamy
[not found] ` <5efcb6a9-5878-1e26-dd43-2e4bd01bc8a1@amd.com>
2023-05-11 6:56 ` Lukas Wunner [this message]
2023-05-16 10:10 ` Lukas Wunner
2023-05-22 22:23 ` Smita Koralahalli
2023-06-16 17:31 ` Lukas Wunner
2023-06-16 23:30 ` Smita Koralahalli
2023-06-17 7:59 ` Lukas Wunner
2023-04-18 21:05 ` [PATCH v2 2/2] PCI: pciehp: Clear the optional capabilities in DEVCTL2 on a hot-plug Smita Koralahalli
2023-05-11 11:19 ` Lukas Wunner
2023-05-22 22:23 ` Smita Koralahalli
2023-06-16 18:24 ` Lukas Wunner
2023-06-16 23:34 ` Smita Koralahalli
2023-06-21 7:12 ` Lukas Wunner
2023-06-21 18:55 ` Smita Koralahalli
2023-05-09 20:58 ` [PATCH v2 0/2] PCI: pciehp: Add support for native AER and DPC handling on async remove Smita Koralahalli
2023-06-12 17:54 ` Bjorn Helgaas
2023-06-12 19:31 ` Smita Koralahalli
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=20230511065636.GA2478@wunner.de \
--to=lukas@wunner.de \
--cc=Nathan.Fontenot@amd.com \
--cc=Smita.KoralahalliChannabasappa@amd.com \
--cc=bhelgaas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mahesh@linux.ibm.com \
--cc=oohall@gmail.com \
--cc=sathyanarayanan.kuppuswamy@linux.intel.com \
--cc=yazen.ghannam@amd.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.