public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Sathyanarayanan Kuppuswamy  <sathyanarayanan.kuppuswamy@linux.intel.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCH v2] PCI/EDR: Clear PCIe Device Status errors after EDR error recovery
Date: Fri, 31 Mar 2023 10:10:12 -0500	[thread overview]
Message-ID: <20230331151012.GA3225386@bhelgaas> (raw)
In-Reply-To: <17f5c023-910a-f88f-e7c4-c5a1c3c3ac0e@linux.intel.com>

On Thu, Mar 30, 2023 at 11:46:45PM -0700, Sathyanarayanan Kuppuswamy wrote:
> On 3/30/23 8:45 AM, Bjorn Helgaas wrote:

> > This sounds like a plausible assumption.  But is there actually spec
> > language that says EDR notification is not allowed in the AER native
> > case (when OS owns the AER Capability)?  I looked but didn't find
> > anything.
> 
> In the PCIe firmware specification v3.3, table "Table 4-6: Interpretation of
> the _OSC Control Field, Returned Value", field "PCI Express Downstream Port
> Containment configuration control", it explains that the firmware can use
> EDR notification only when OS DPC control is not requested or denied by
> firmware.

I'm sure that's the intent, but I don't see that restriction in the
spec.  Here's what I'm looking at, which doesn't directly restrict
generation of EDR notifications:

  If control of this feature was requested and denied, or was not
  requested, firmware is responsible for initializing Downstream Port
  Containment Extended Capability Structures per firmware policy.
  Further, [the OS is permitted to write several registers while
  processing an EDR notification]

> > Actually I do have one idea: in the firmware-first case, firmware
> > collects all the status information, clears it, and then passes the
> > status on to the OS.  In this case we don't need to clear the status
> > registers in handle_error_source(), pcie_do_recovery(), etc.
> 
> So the idea is to get the error info in a particular format using
> something like _DSM call?

No, that's not what I'm thinking at all.  I definitely would not want
to add a new _DSM, which would add yet another case the OS has to
handle.

In the firmware-first case, the firmware collects the error status and
clears it before handing the info off to the OS error handling path.

In the native case, the OS should be able to collect the error status
and clear it before starting the OS error handling path.  Same
register accesses, should be indistinguishable from the device point
of view, it's just that the register accesses would be done by the OS
instead of by firmware.

Bjorn

  reply	other threads:[~2023-03-31 15:10 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-15 23:54 [PATCH v2] PCI/EDR: Clear PCIe Device Status errors after EDR error recovery Kuppuswamy Sathyanarayanan
2023-03-24 17:53 ` Sathyanarayanan Kuppuswamy
2023-03-29 22:09 ` Bjorn Helgaas
2023-03-29 22:38   ` Sathyanarayanan Kuppuswamy
2023-03-30 15:45     ` Bjorn Helgaas
2023-03-31  6:46       ` Sathyanarayanan Kuppuswamy
2023-03-31 15:10         ` Bjorn Helgaas [this message]
2023-04-06 21:07 ` Bjorn Helgaas
2023-04-06 21:52   ` Sathyanarayanan Kuppuswamy
2023-04-06 22:21     ` Bjorn Helgaas
2023-04-06 22:46       ` Natu, Mahesh
2023-04-07  5:31       ` Sathyanarayanan Kuppuswamy
2023-04-07 16:46         ` Bjorn Helgaas
2023-04-07 22:19           ` Sathyanarayanan Kuppuswamy
2023-04-07 22:41             ` Bjorn Helgaas
2023-04-07 21:51 ` Bjorn Helgaas
2023-04-07 21:52   ` Bjorn Helgaas
2023-04-07 22:25     ` Sathyanarayanan Kuppuswamy
2023-04-07 22:21   ` Sathyanarayanan Kuppuswamy

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=20230331151012.GA3225386@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.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