linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Niklas Schnelle <schnelle@linux.ibm.com>
To: Lukas Wunner <lukas@wunner.de>,
	Bjorn Helgaas <helgaas@kernel.org>,
	Jonathan Corbet <corbet@lwn.net>
Cc: Terry Bowman <terry.bowman@amd.com>,
	Ilpo Jarvinen	 <ilpo.jarvinen@linux.intel.com>,
	Sathyanarayanan Kuppuswamy	
	<sathyanarayanan.kuppuswamy@linux.intel.com>,
	Linas Vepstas	 <linasvepstas@gmail.com>,
	Mahesh J Salgaonkar <mahesh@linux.ibm.com>,
	Oliver OHalloran <oohall@gmail.com>,
	linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org,
	linux-doc@vger.kernel.org,
	Brian Norris <briannorris@chromium.org>
Subject: Re: [PATCH v2 2/4] Documentation: PCI: Sync error recovery doc with code
Date: Mon, 15 Sep 2025 17:51:08 +0200	[thread overview]
Message-ID: <2e2c882be991caf440596ffafa106c3fb345adc3.camel@linux.ibm.com> (raw)
In-Reply-To: <ed3c3385499775fcc25f1ee66f395e212919f94a.1757942121.git.lukas@wunner.de>

On Mon, 2025-09-15 at 15:50 +0200, Lukas Wunner wrote:
> Amend the documentation on PCI error recovery to fix minor inaccuracies
> vis-à-vis the actual code:
> 
> * The documentation claims that a missing ->resume() or ->mmio_enabled()
>   callback always leads to recovery through reset.  But none of the
>   implementations do this (pcie_do_recovery(), eeh_handle_normal_event(),
>   zpci_event_do_error_state_clear()).
> 
>   Drop the claim to align the documentation with the code.
> 
> * The documentation does not list PCI_ERS_RESULT_RECOVERED as a valid
>   return value from ->error_detected().  But none of the implementations
>   forbid this and some drivers are returning it, e.g.:
>   drivers/bus/mhi/host/pci_generic.c
>   drivers/infiniband/hw/hfi1/pcie.c
> 
>   Further down in the documentation it is implied that the return value is
>   in fact allowed:
>   "The platform will call the resume() callback on all affected device
>   drivers if all drivers on the segment have returned
>   PCI_ERS_RESULT_RECOVERED from one of the 3 previous callbacks."
> 
>   The "3 previous callbacks" being ->error_detected(), ->mmio_enabled()
>   and ->slot_reset().
> 
>   Add it to the valid return values for consistency.
> 
> Signed-off-by: Lukas Wunner <lukas@wunner.de>
> Reviewed-by: Brian Norris <briannorris@chromium.org>
> ---
>  Documentation/PCI/pci-error-recovery.rst | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/PCI/pci-error-recovery.rst b/Documentation/PCI/pci-error-recovery.rst
> index 42e1e78353f3..d5c661baa87f 100644
> --- a/Documentation/PCI/pci-error-recovery.rst
> +++ b/Documentation/PCI/pci-error-recovery.rst
> @@ -108,8 +108,8 @@ A driver does not have to implement all of these callbacks; however,
>  if it implements any, it must implement error_detected(). If a callback
>  is not implemented, the corresponding feature is considered unsupported.
>  For example, if mmio_enabled() and resume() aren't there, then it
> -is assumed that the driver is not doing any direct recovery and requires
> -a slot reset.  Typically a driver will want to know about
> +is assumed that the driver does not need these callbacks
> +for recovery.  Typically a driver will want to know about
>  a slot_reset().
>  
>  The actual steps taken by a platform to recover from a PCI error
> @@ -141,6 +141,9 @@ shouldn't do any new IOs. Called in task context. This is sort of a
>  All drivers participating in this system must implement this call.
>  The driver must return one of the following result codes:
>  
> +  - PCI_ERS_RESULT_RECOVERED
> +      Driver returns this if it thinks the device is usable despite
> +      the error and does not need further intervention.
>    - PCI_ERS_RESULT_CAN_RECOVER
>        Driver returns this if it thinks it might be able to recover
>        the HW by just banging IOs or if it wants to be given

Thanks and good catch on these inaccuracies.

Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com>


  reply	other threads:[~2025-09-15 15:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-15 13:50 [PATCH v2 0/4] Documentation: PCI: Update error recovery docs Lukas Wunner
2025-09-15 13:50 ` [PATCH v2 1/4] Documentation: PCI: Sync AER doc with code Lukas Wunner
2025-09-15 13:50 ` [PATCH v2 2/4] Documentation: PCI: Sync error recovery " Lukas Wunner
2025-09-15 15:51   ` Niklas Schnelle [this message]
2025-09-15 13:50 ` [PATCH v2 3/4] Documentation: PCI: Amend error recovery doc with DPC/AER specifics Lukas Wunner
2025-09-15 15:43   ` Niklas Schnelle
2025-09-15 13:50 ` [PATCH v2 4/4] Documentation: PCI: Tidy error recovery doc's PCIe nomenclature Lukas Wunner
2025-09-15 15:46   ` Niklas Schnelle
2025-09-15 15:25 ` [PATCH v2 0/4] Documentation: PCI: Update error recovery docs Sathyanarayanan Kuppuswamy
2025-09-16 15:55 ` Bjorn Helgaas

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=2e2c882be991caf440596ffafa106c3fb345adc3.camel@linux.ibm.com \
    --to=schnelle@linux.ibm.com \
    --cc=briannorris@chromium.org \
    --cc=corbet@lwn.net \
    --cc=helgaas@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linasvepstas@gmail.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lukas@wunner.de \
    --cc=mahesh@linux.ibm.com \
    --cc=oohall@gmail.com \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=terry.bowman@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 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).