Linux-PCI Archive on
 help / color / Atom feed
From: "Kuppuswamy, Sathyanarayanan"  <>
To: Sinan Kaya <>, Bjorn Helgaas <>
	Jay Vosburgh <>
Subject: Re: [PATCH v3 1/1] PCI/ERR: Fix reset logic in pcie_do_recovery() call
Date: Wed, 23 Sep 2020 21:06:01 -0700
Message-ID: <> (raw)
In-Reply-To: <>

On 9/23/20 8:13 PM, Sinan Kaya wrote:
> On 9/23/2020 10:51 PM, Kuppuswamy, Sathyanarayanan wrote:
>>> I see. Can I assume that your system supports DPC?
>>> DPC is supposed to recover the link via dpc_reset_link().
>> Yes. But the affected device/drivers cleanup during error recovery
>> is handled by hotplug handler. So we are facing issue when dealing
>> with non hotplug capable ports.
> This is confusing.
> Why would hotplug driver be involved unless port supports hotplug and
> the link goes down? You said that DLLSC is only supported on hotplug
> capable ports.
hotplug driver is *only* involved when dealing with recovery of hotplug
capable ports. For hotplug capable ports, when DPC is triggered and link
goes down, DLLSC handler in pciehp driver will remove the affected
devices/drivers. Once the link comes back it will re-attach them.

> Need a better description of symptoms and what triggers hotplug driver
> to activate.
For problem description, please check the following details

Current pcie_do_recovery() implementation has following two issues:

1. Fatal (DPC) error recovery is currently broken for non-hotplug
capable devices. Current fatal error recovery implementation relies
on PCIe hotplug (pciehp) handler for detaching and re-enumerating
the affected devices/drivers. pciehp handler listens for DLLSC state
changes and handles device/driver detachment on DLLSC_LINK_DOWN event
and re-enumeration on DLLSC_LINK_UP event. So when dealing with
non-hotplug capable devices, recovery code does not restore the state
of the affected devices correctly. Correct implementation should
restore the device state and call report_slot_reset() function after
resetting the link to restore the state of the device/driver.

You can find fatal non-hotplug related issues reported in following links:

2. For non-fatal errors if report_error_detected() or
report_mmio_enabled() functions requests PCI_ERS_RESULT_NEED_RESET then
current pcie_do_recovery() implementation does not do the requested
explicit device reset, instead just calls the report_slot_reset() on all
affected devices. Notifying about the reset via report_slot_reset()
without doing the actual device reset is incorrect.

To fix above issues, use PCI_ERS_RESULT_NEED_RESET as error state after
successful reset_link() operation. This will ensure ->slot_reset() be
called after reset_link() operation for fatal errors. Also call
pci_bus_reset() to do slot/bus reset() before triggering device specific
->slot_reset() callback. Also, using pci_bus_reset() will restore the state
of the devices after performing the reset operation.

Even though using pci_bus_reset() will do redundant reset operation after
->reset_link() for fatal errors, it should should affect the functional

> Can you expand this a little bit?

Sathyanarayanan Kuppuswamy
Linux Kernel Developer

  reply index

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <>
2020-09-22 23:33 ` Bjorn Helgaas
2020-09-22 23:44   ` Kuppuswamy, Sathyanarayanan
2020-09-24  1:15     ` Sinan Kaya
2020-09-24  2:04       ` Kuppuswamy, Sathyanarayanan
2020-09-24  2:16         ` Sinan Kaya
2020-09-24  2:51           ` Kuppuswamy, Sathyanarayanan
2020-09-24  3:13             ` Sinan Kaya
2020-09-24  4:06               ` Kuppuswamy, Sathyanarayanan [this message]
2020-09-24 20:52                 ` Sinan Kaya
2020-09-25  5:11                   ` Kuppuswamy, Sathyanarayanan
2020-09-25 16:55                     ` Sinan Kaya
2020-09-25 17:11                       ` Kuppuswamy, Sathyanarayanan
2020-09-25 17:47                         ` Sinan Kaya
2020-09-25 18:16                           ` Kuppuswamy, Sathyanarayanan
2020-09-25 18:30                             ` Sinan Kaya
2020-09-28  2:43                               ` Kuppuswamy, Sathyanarayanan
2020-09-28  8:41                                 ` Ethan Zhao
2020-09-28 11:17                                 ` Sinan Kaya
2020-09-28 12:16                                   ` Sinan Kaya
2020-09-28 17:15                                   ` Kuppuswamy, Sathyanarayanan
2020-09-28 18:02                                     ` Sinan Kaya
2020-09-28 18:25                                       ` Sinan Kaya
2020-09-28 18:32                                         ` Kuppuswamy, Sathyanarayanan
2020-10-12  5:13                                           ` Kuppuswamy, Sathyanarayanan
2020-10-12 14:51                                             ` Sinan Kaya
2020-09-28 12:11                                 ` Sinan Kaya
2020-09-25 23:50                             ` Sinan Kaya
2020-07-24 19:07 sathyanarayanan.kuppuswamy
2020-09-01  5:41 ` Kuppuswamy, Sathyanarayanan
2020-09-22 18:52 ` 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-PCI Archive on

Archives are clonable:
	git clone --mirror linux-pci/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-pci linux-pci/ \
	public-inbox-index linux-pci

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone