All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Bobroff <sbobroff@linux.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: aik@ozlabs.ru, oohall@gmail.com, tyreld@linux.vnet.ibm.com
Subject: [PATCH v5 02/12] powerpc/eeh: Clear stale EEH_DEV_NO_HANDLER flag
Date: Fri, 16 Aug 2019 14:48:06 +1000	[thread overview]
Message-ID: <b8ca5629d27de74c957d4f4b250177d1b6fc4bbd.1565930772.git.sbobroff@linux.ibm.com> (raw)
In-Reply-To: <cover.1565930772.git.sbobroff@linux.ibm.com>

The EEH_DEV_NO_HANDLER flag is used by the EEH system to prevent the
use of driver callbacks in drivers that have been bound part way
through the recovery process. This is necessary to prevent later stage
handlers from being called when the earlier stage handlers haven't,
which can be confusing for drivers.

However, the flag is set for all devices that are added after boot
time and only cleared at the end of the EEH recovery process. This
results in hot plugged devices erroneously having the flag set during
the first recovery after they are added (causing their driver's
handlers to be incorrectly ignored).

To remedy this, clear the flag at the beginning of recovery
processing. The flag is still cleared at the end of recovery
processing, although it is no longer really necessary.

Also clear the flag during eeh_handle_special_event(), for the same
reasons.

Signed-off-by: Sam Bobroff <sbobroff@linux.ibm.com>
---
 arch/powerpc/kernel/eeh_driver.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c
index 6f3ee30565dd..d6f54840a3a9 100644
--- a/arch/powerpc/kernel/eeh_driver.c
+++ b/arch/powerpc/kernel/eeh_driver.c
@@ -819,6 +819,10 @@ void eeh_handle_normal_event(struct eeh_pe *pe)
 		result = PCI_ERS_RESULT_DISCONNECT;
 	}
 
+	eeh_for_each_pe(pe, tmp_pe)
+		eeh_pe_for_each_dev(tmp_pe, edev, tmp)
+			edev->mode &= ~EEH_DEV_NO_HANDLER;
+
 	/* Walk the various device drivers attached to this slot through
 	 * a reset sequence, giving each an opportunity to do what it needs
 	 * to accomplish the reset.  Each child gets a report of the
@@ -1009,7 +1013,8 @@ void eeh_handle_normal_event(struct eeh_pe *pe)
  */
 void eeh_handle_special_event(void)
 {
-	struct eeh_pe *pe, *phb_pe;
+	struct eeh_pe *pe, *phb_pe, *tmp_pe;
+	struct eeh_dev *edev, *tmp_edev;
 	struct pci_bus *bus;
 	struct pci_controller *hose;
 	unsigned long flags;
@@ -1078,6 +1083,10 @@ void eeh_handle_special_event(void)
 				    (phb_pe->state & EEH_PE_RECOVERING))
 					continue;
 
+				eeh_for_each_pe(pe, tmp_pe)
+					eeh_pe_for_each_dev(tmp_pe, edev, tmp_edev)
+						edev->mode &= ~EEH_DEV_NO_HANDLER;
+
 				/* Notify all devices to be down */
 				eeh_pe_state_clear(pe, EEH_PE_PRI_BUS, true);
 				eeh_set_channel_state(pe, pci_channel_io_perm_failure);
-- 
2.22.0.216.g00a2a96fc9


  parent reply	other threads:[~2019-08-16  4:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-16  4:48 [PATCH v5 00/12] Sam Bobroff
2019-08-16  4:48 ` [PATCH v5 01/12] powerpc/64: Adjust order in pcibios_init() Sam Bobroff
2019-08-28  4:24   ` Michael Ellerman
2019-08-16  4:48 ` Sam Bobroff [this message]
2019-08-16  4:48 ` [PATCH v5 03/12] powerpc/eeh: Improve debug messages around device addition Sam Bobroff
2019-08-16  4:48 ` [PATCH v5 04/12] powerpc/eeh: Initialize EEH address cache earlier Sam Bobroff
2019-08-16  4:48 ` [PATCH v5 05/12] powerpc/eeh: EEH for pSeries hot plug Sam Bobroff
2019-08-21  3:28   ` Michael Ellerman
2019-08-22  6:17     ` [PATCH] powerpc/eeh: Fixup EEH for pSeries hotplug Sam Bobroff
2019-09-19 20:28   ` [PATCH v5 05/12] powerpc/eeh: EEH for pSeries hot plug Nathan Lynch
2019-09-19 23:27     ` Oliver O'Halloran
2019-09-19 23:44       ` Nathan Lynch
2019-09-23  5:00     ` Sam Bobroff
2019-09-23 18:01       ` Nathan Lynch
2019-08-16  4:48 ` [PATCH v5 06/12] powerpc/eeh: Refactor around eeh_probe_devices() Sam Bobroff
2019-08-16  4:48 ` [PATCH v5 07/12] powerpc/eeh: Add bdfn field to eeh_dev Sam Bobroff
2019-08-16  4:48 ` [PATCH v5 08/12] powerpc/eeh: Introduce EEH edev logging macros Sam Bobroff
2019-08-16  4:48 ` [PATCH v5 09/12] powerpc/eeh: Convert log messages to eeh_edev_* macros Sam Bobroff
2019-08-16  4:48 ` [PATCH v5 10/12] powerpc/eeh: Fix crash when edev->pdev changes Sam Bobroff
2019-08-16  4:48 ` [PATCH v5 11/12] powerpc/eeh: Remove unused return path from eeh_pe_dev_traverse() Sam Bobroff
2019-08-16  4:48 ` [PATCH v5 12/12] powerpc/eeh: Slightly simplify eeh_add_to_parent_pe() Sam Bobroff

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=b8ca5629d27de74c957d4f4b250177d1b6fc4bbd.1565930772.git.sbobroff@linux.ibm.com \
    --to=sbobroff@linux.ibm.com \
    --cc=aik@ozlabs.ru \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=oohall@gmail.com \
    --cc=tyreld@linux.vnet.ibm.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 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.