linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: poza@codeaurora.org
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Thomas Tai <thomas.tai@oracle.com>,
	bhelgaas@google.com, keith.busch@intel.com,
	linux-pci@vger.kernel.org, linux-pci-owner@vger.kernel.org,
	Sam Bobroff <sam.bobroff@au1.ibm.com>
Subject: Re: PATCH] Partial revert of "PCI/AER: Handle ERR_FATAL with removal and re-enumeration of devices"
Date: Wed, 22 Aug 2018 10:05:56 +0530	[thread overview]
Message-ID: <5b7b16598ecd480de32e5a5b2e673910@codeaurora.org> (raw)
In-Reply-To: <20180821195023.GD154536@bhelgaas-glaptop.roam.corp.google.com>

On 2018-08-22 01:20, Bjorn Helgaas wrote:
> On Mon, Aug 20, 2018 at 02:39:04PM +1000, Benjamin Herrenschmidt wrote:
>> This partially reverts commit 
>> 7e9084b36740b2ec263ea35efb203001f755e1d8.
>> 
>> This only reverts the Documentation/PCI/pci-error-recovery.txt changes
>> 
>> Those changes are incorrect, they change the documentation to adapt
>> to the (imho incorrect) AER implementation, and as a result making
>> it no longer match the EEH implementation.
>> 
>> I believe the policy described originally in this document is what
>> should be implemented by everybody and the changes done by that commit
>> would compromise, among others, the ability to recover from errors 
>> with
>> storage devices.
> 
> I think we should align EEH, AER, and DPC as much as possible,
> including making this documentation match the code.
> 
> Because of its name, this file *looks* like it should match the code
> in the PCI core, i.e., drivers/pci/...  So I think it would be
> confusing to simply apply this revert without making a more direct
> connection between this documentation and the powerpc-specific EEH
> code.
> 
> If we can change AER & DPC to correspond to EEH, then I think it would
> make sense to apply this revert along with those AER & DPC changes so
> the documentation stays in step with the code.

I agree with you Bjorn, but it looks like we are far from holding some 
consensus on the behavior.
the other mail-chain [PCI/AER: prevent pcie_do_fatal_recovery from using 
device after it is removed]
has gone long enough, and touched lot of things all together. hence I 
would like to just use this mail-chain just to discuss
about AER, DPC behaviour.

let me put forward the proposal here to this mail-chain.

1) Right now AER and DPC both calls pcie_do_fatal_recovery(), I majorly 
see DPC as error handling and recovery agent rather than being used for 
hotplug.
    so in my opinion, both AER and DPC should have same error handling 
and recovery mechanism

    so if there is a way to figure out that in absence of pcihp, if DPC 
is being used to support hotplug then we fall back to original DPC 
mechanism (which
    is remove devices)
    otherwise, we fall back to drivers callbacks.

    Spec 6.7.5 Async Removal
    "
    The Surprise Down error resulting from async removal may trigger 
Downstream Port Containment (See Section 6.2.10).
    Downstream Port Containment following an async removal may be 
utilized to hold the Link of a
    Downstream Port in the Disabled LTSSM state while host software 
recovers from the side effects of an async removal.
    "
    pcie_do_fatal_recovery should take care of above. so that we support 
both error handling and async removal from DPC point of view.


2) pci_channel_io_frozen is the one which should be used from framework 
to communicate driver that this is ERR_FATAL, the it is left to the 
driver(s) to see if they want reset of the link (SBR).

3) pcie_do_nonfatal_recovery; we sould actually reset the link e.g. SBR 
if driver requests the reset of link.  (there is already TDO note 
anyway).
    if (status == PCI_ERS_RESULT_NEED_RESET) {
         /*
          * TODO: Should call platform-specific
          * functions to reset slot before calling
          * drivers' slot_reset callbacks?
          */
         status = broadcast_error_message(dev,
                 state,
                 "slot_reset",
                 report_slot_reset);
     }


Regards,
Oza.


> 
>> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>> ---
>>  Documentation/PCI/pci-error-recovery.txt | 35 
>> +++++++-----------------
>>  1 file changed, 10 insertions(+), 25 deletions(-)
>> 
>> diff --git a/Documentation/PCI/pci-error-recovery.txt 
>> b/Documentation/PCI/pci-error-recovery.txt
>> index 688b69121e82..0b6bb3ef449e 100644
>> --- a/Documentation/PCI/pci-error-recovery.txt
>> +++ b/Documentation/PCI/pci-error-recovery.txt
>> @@ -110,7 +110,7 @@ The actual steps taken by a platform to recover 
>> from a PCI error
>>  event will be platform-dependent, but will follow the general
>>  sequence described below.
>> 
>> -STEP 0: Error Event: ERR_NONFATAL
>> +STEP 0: Error Event
>>  -------------------
>>  A PCI bus error is detected by the PCI hardware.  On powerpc, the 
>> slot
>>  is isolated, in that all I/O is blocked: all reads return 0xffffffff,
>> @@ -228,7 +228,13 @@ proceeds to either STEP3 (Link Reset) or to STEP 
>> 5 (Resume Operations).
>>  If any driver returned PCI_ERS_RESULT_NEED_RESET, then the platform
>>  proceeds to STEP 4 (Slot Reset)
>> 
>> -STEP 3: Slot Reset
>> +STEP 3: Link Reset
>> +------------------
>> +The platform resets the link.  This is a PCI-Express specific step
>> +and is done whenever a fatal error has been detected that can be
>> +"solved" by resetting the link.
>> +
>> +STEP 4: Slot Reset
>>  ------------------
>> 
>>  In response to a return value of PCI_ERS_RESULT_NEED_RESET, the
>> @@ -314,7 +320,7 @@ Failure).
>>  >>> However, it probably should.
>> 
>> 
>> -STEP 4: Resume Operations
>> +STEP 5: Resume Operations
>>  -------------------------
>>  The platform will call the resume() callback on all affected device
>>  drivers if all drivers on the segment have returned
>> @@ -326,7 +332,7 @@ a result code.
>>  At this point, if a new error happens, the platform will restart
>>  a new error recovery sequence.
>> 
>> -STEP 5: Permanent Failure
>> +STEP 6: Permanent Failure
>>  -------------------------
>>  A "permanent failure" has occurred, and the platform cannot recover
>>  the device.  The platform will call error_detected() with a
>> @@ -349,27 +355,6 @@ errors. See the discussion in 
>> powerpc/eeh-pci-error-recovery.txt
>>  for additional detail on real-life experience of the causes of
>>  software errors.
>> 
>> -STEP 0: Error Event: ERR_FATAL
>> --------------------
>> -PCI bus error is detected by the PCI hardware. On powerpc, the slot 
>> is
>> -isolated, in that all I/O is blocked: all reads return 0xffffffff, 
>> all
>> -writes are ignored.
>> -
>> -STEP 1: Remove devices
>> ---------------------
>> -Platform removes the devices depending on the error agent, it could 
>> be
>> -this port for all subordinates or upstream component (likely 
>> downstream
>> -port)
>> -
>> -STEP 2: Reset link
>> ---------------------
>> -The platform resets the link.  This is a PCI-Express specific step 
>> and is
>> -done whenever a fatal error has been detected that can be "solved" by
>> -resetting the link.
>> -
>> -STEP 3: Re-enumerate the devices
>> ---------------------
>> -Initiates the re-enumeration.
>> 
>>  Conclusion; General Remarks
>>  ---------------------------
>> 
>> 

      reply	other threads:[~2018-08-22  4:35 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-13 16:51 [PATCH 0/1] PCI/AER: prevent pcie_do_fatal_recovery from using device after it is removed Thomas Tai
2018-08-13 16:51 ` [PATCH 1/1] " Thomas Tai
2018-08-14  9:16   ` poza
2018-08-14  9:22     ` poza
2018-08-14 13:51       ` Thomas Tai
2018-08-15 14:57         ` poza
2018-08-15 15:02           ` Thomas Tai
2018-08-15 15:26             ` poza
2018-08-15 15:43               ` Thomas Tai
2018-08-15 15:59                 ` poza
2018-08-15 16:04                   ` Thomas Tai
2018-08-15 21:55       ` Benjamin Herrenschmidt
2018-08-15 21:56       ` Benjamin Herrenschmidt
2018-08-16  6:36         ` poza
2018-08-16  6:51           ` Benjamin Herrenschmidt
2018-08-16  6:59             ` Benjamin Herrenschmidt
2018-08-16  8:07               ` poza
2018-08-16  8:12                 ` Benjamin Herrenschmidt
2018-08-16  9:03                   ` poza
2018-08-16 10:07                     ` Benjamin Herrenschmidt
2018-08-16 14:11                       ` poza
2018-08-16 23:30                         ` Benjamin Herrenschmidt
2018-08-17 10:29                           ` poza
2018-08-17 10:44                             ` poza
2018-08-18  7:38                             ` Benjamin Herrenschmidt
2018-08-16  7:05             ` Benjamin Herrenschmidt
2018-08-16  7:15               ` Benjamin Herrenschmidt
2018-08-16  7:56                 ` poza
2018-08-16  8:10                   ` Benjamin Herrenschmidt
2018-08-16  8:05               ` poza
2018-08-16  8:15                 ` Benjamin Herrenschmidt
2018-08-16  8:22                   ` poza
2018-08-16  8:28                     ` Benjamin Herrenschmidt
2018-08-16 13:30                       ` Thomas Tai
2018-08-16 13:46                     ` Sinan Kaya
2018-08-16 23:27                       ` Benjamin Herrenschmidt
2018-08-17  6:35                         ` poza
2018-08-19  2:24                         ` Bjorn Helgaas
2018-08-20  5:09                           ` poza
2018-08-20  5:15                             ` Benjamin Herrenschmidt
2018-08-20 13:02                               ` Thomas Tai
2018-08-20 13:27                                 ` Benjamin Herrenschmidt
2018-08-19  2:19               ` Bjorn Helgaas
2018-08-19 21:41                 ` Sinan Kaya
2018-08-20  2:03                   ` Benjamin Herrenschmidt
2018-08-20  5:19                     ` poza
2018-08-20  5:33                       ` Benjamin Herrenschmidt
2018-08-20  7:56                         ` poza
2018-08-20 11:22                           ` Benjamin Herrenschmidt
2018-08-20 13:26                             ` poza
2018-08-20 21:02                               ` Benjamin Herrenschmidt
2018-08-21  5:14                                 ` poza
2018-08-21  6:06                                   ` Benjamin Herrenschmidt
2018-08-21 14:37                                     ` Keith Busch
2018-08-21 15:07                                       ` Sinan Kaya
2018-08-21 15:29                                         ` Keith Busch
2018-08-21 15:50                                           ` Sinan Kaya
2018-08-21 15:55                                             ` Sinan Kaya
2018-08-21 16:44                                             ` Keith Busch
2018-08-21 15:30                                       ` poza
2018-08-21 21:14                                       ` Benjamin Herrenschmidt
2018-08-21 22:04                                         ` Keith Busch
2018-08-21 22:33                                           ` Keith Busch
2018-08-21 23:06                                           ` Benjamin Herrenschmidt
2018-08-21 23:13                                             ` Keith Busch
2018-08-22  0:36                                               ` Benjamin Herrenschmidt
2018-08-30  0:01                                             ` Keith Busch
2018-08-30  0:10                                               ` Sinan Kaya
2018-08-30  0:46                                                 ` Keith Busch
2018-08-30  4:26                                               ` Benjamin Herrenschmidt
2018-08-20 15:53                             ` Keith Busch
2018-08-20 16:13                               ` poza
2018-08-20 16:32                                 ` Keith Busch
2018-08-20 21:05                               ` Benjamin Herrenschmidt
2018-08-20 21:21                                 ` Sinan Kaya
2018-08-20 21:35                                   ` Keith Busch
2018-08-20 21:53                                     ` Benjamin Herrenschmidt
2018-08-20 22:02                                       ` Sinan Kaya
2018-08-20 22:04                                         ` Benjamin Herrenschmidt
2018-08-20 22:13                                           ` Sinan Kaya
2018-08-20 22:19                                             ` Benjamin Herrenschmidt
2018-08-22  9:13                                             ` Lukas Wunner
2018-08-22 14:38                                               ` Keith Busch
2018-08-22 14:51                                                 ` Sinan Kaya
2018-08-20 22:13                                           ` Keith Busch
2018-08-20 22:19                                             ` Benjamin Herrenschmidt
2018-08-21  1:30                                               ` Keith Busch
2018-08-20  4:37                 ` Benjamin Herrenschmidt
2018-08-20  4:39                 ` PATCH] Partial revert of "PCI/AER: Handle ERR_FATAL with removal and re-enumeration of devices" Benjamin Herrenschmidt
2018-08-21 19:50                   ` Bjorn Helgaas
2018-08-22  4:35                     ` poza [this message]

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=5b7b16598ecd480de32e5a5b2e673910@codeaurora.org \
    --to=poza@codeaurora.org \
    --cc=benh@kernel.crashing.org \
    --cc=bhelgaas@google.com \
    --cc=helgaas@kernel.org \
    --cc=keith.busch@intel.com \
    --cc=linux-pci-owner@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=sam.bobroff@au1.ibm.com \
    --cc=thomas.tai@oracle.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).