linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Keith Busch <keith.busch@intel.com>
Cc: linux-pci@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>,
	Lukas Wunner <lukas@wunner.de>
Subject: Re: [PATCHv4] pcie: Add driver for Downstream Port Containment
Date: Wed, 11 May 2016 11:08:17 -0500	[thread overview]
Message-ID: <20160511160817.GA24089@localhost> (raw)
In-Reply-To: <1461882288-31506-1-git-send-email-keith.busch@intel.com>

Hi Keith,

On Thu, Apr 28, 2016 at 04:24:48PM -0600, Keith Busch wrote:
> This adds driver support for root and downstream ports that implement
> the PCI-Express Downstream Port Containment extended capability. DPC is
> an optional capability to contain uncorrectable errors below a port.
> 
> For more information on DPC, please see PCI Express Base Specification
> Revision 4, section 7.31, or view the PCI-SIG DPC ECN here:
> 
>   https://pcisig.com/sites/default/files/specification_documents/ECN_DPC_2012-02-09_finalized.pdf
> 
> When a DPC event is triggered, the h/w disables downstream links, so
> the DPC driver schedules removal for all devices below this port. This
> may happen concurrently with a PCI-e hotplug driver if enabled. When all
> downstream devices are removed and the link state transitions to disabled,
> the DPC driver clears the DPC status and interrupt bits so the link may
> retrain for a newly connected device.
> 
> The pcie device naming is updated to accomodate the additional service
> driver. From Lukas Wunner <lukas@wunner.de>:
> 
> The names of port service devices previously used one nibble to encode
> the port type and another nibble to encode the service type. Since this
> commit introduces a fifth service type, it changes device names to use
> one *byte* to encode the service type. E.g. a hotplug port service on a
> downstream bridge was previously called pcie24 and is now called pcie204.

I know I already merged this, but I just thought of a more
philosophical question.  Why is this a "port service driver" as
opposed to being simply part of the PCI core like ARI, ACS, etc.?

I guess you did make DPC tristate, so from that point of view, it
probably has to use the driver structure to make it convenient to load
after boot.  Does that add value?  Do we expect people to make a
decision about whether to load pcie-dpc?  Or maybe we plan to autoload
it if the DPC capability is present?  Does your patch enable that,
i.e., does it expose something udev can use to autoload it?

I've been wondering whether the portdrv service driver concept was a
mistake.  With the exception of DPC, I think all the portdrv service
drivers are bool, so there's no question of having to load a module.
I think using portdrv means we delay initialization of some things
that we should do earlier.  For example, I think we should setup
pciehp much earlier, when we enumerate the bridge.  And the service
driver registration and capability discovery code adds a fair amount
of complication that I'm not sure is necessary.

So I guess the question is: why did you make DPC a portdrv service
driver, and what bad things would happen if we integrated it into the
PCI core without exposing it as a separate service.

Bjorn

  parent reply	other threads:[~2016-05-11 16:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-28 22:24 [PATCHv4] pcie: Add driver for Downstream Port Containment Keith Busch
2016-05-02 20:25 ` Bjorn Helgaas
2016-05-06 16:20   ` Bjorn Helgaas
2016-05-06 17:06     ` Keith Busch
2016-05-11 16:08 ` Bjorn Helgaas [this message]
2016-05-11 17:06   ` Keith Busch
2016-05-11 18:28     ` Bjorn Helgaas
2016-05-11 19:55       ` Lukas Wunner

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=20160511160817.GA24089@localhost \
    --to=helgaas@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=keith.busch@intel.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=lukas@wunner.de \
    /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).