All of lore.kernel.org
 help / color / mirror / Atom feed
From: sathyanarayanan.kuppuswamy@linux.intel.com
To: bhelgaas@google.com
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	ashok.raj@intel.com, sathyanarayanan.kuppuswamy@linux.intel.com
Subject: [PATCH v2 2/2] PCI/ERR: Add reset support for non fatal errors
Date: Thu,  4 Jun 2020 14:50:02 -0700	[thread overview]
Message-ID: <18ab6cc7b34dab7630978195248ea031540ba9f1.1591307288.git.sathyanarayanan.kuppuswamy@linux.intel.com> (raw)
In-Reply-To: <ce417fbf81a8a46a89535f44b9224ee9fbb55a29.1591307288.git.sathyanarayanan.kuppuswamy@linux.intel.com>

From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

PCI_ERS_RESULT_NEED_RESET error status implies the device is
requesting a slot reset and a notification about slot reset
completion via ->slot_reset() callback.

But in non-fatal errors case, 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 slot reset, instead just calls the ->slot_reset()
callback on all affected devices. Notifying about the slot reset
completion without resetting it incorrect. So add this support.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
---
 drivers/pci/pcie/err.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c
index 5fe8561c7185..94d1c2ff7b40 100644
--- a/drivers/pci/pcie/err.c
+++ b/drivers/pci/pcie/err.c
@@ -206,6 +206,9 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev,
 		 * functions to reset slot before calling
 		 * drivers' slot_reset callbacks?
 		 */
+		if (state != pci_channel_io_frozen)
+			pci_reset_bus(dev);
+
 		status = PCI_ERS_RESULT_RECOVERED;
 		pci_dbg(dev, "broadcast slot_reset message\n");
 		pci_walk_bus(bus, report_slot_reset, &status);
-- 
2.17.1


  reply	other threads:[~2020-06-04 21:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-04 21:50 [PATCH v2 1/2] PCI/ERR: Fix fatal error recovery for non-hotplug capable devices sathyanarayanan.kuppuswamy
2020-06-04 21:50 ` sathyanarayanan.kuppuswamy [this message]
2020-06-28 12:57   ` [PATCH v2 2/2] PCI/ERR: Add reset support for non fatal errors Yicong Yang
2020-06-05  4:47 ` [PATCH v2 1/2] PCI/ERR: Fix fatal error recovery for non-hotplug capable devices Jay Vosburgh
2020-06-24 18:52   ` Jay Vosburgh
2020-06-28 12:59     ` Yicong Yang
2020-07-14 23:08 ` Bjorn Helgaas
2020-07-16  1:54   ` Kuppuswamy, Sathyanarayanan

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=18ab6cc7b34dab7630978195248ea031540ba9f1.1591307288.git.sathyanarayanan.kuppuswamy@linux.intel.com \
    --to=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=ashok.raj@intel.com \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.