From: Gavin Shan <gwshan@linux.vnet.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: mpe@ellerman.id.au, Gavin Shan <gwshan@linux.vnet.ibm.com>
Subject: [PATCH 3/3] powerpc/eeh: Synchronize recovery in host/guest
Date: Fri, 26 Feb 2016 11:04:52 +1100 [thread overview]
Message-ID: <1456445092-18337-4-git-send-email-gwshan@linux.vnet.ibm.com> (raw)
In-Reply-To: <1456445092-18337-1-git-send-email-gwshan@linux.vnet.ibm.com>
When passing through SRIOV VFs to guest, we possibly encounter EEH
error on PF. In this case, the VF PEs are put into frozen state.
The error could be reported to guest before it's captured by the
host. That means the guest could attempt to recover errors on VFs
before host gets chance to recover errors on PFs. The VFs won't be
recovered successfully.
This enforces the recovery order for above case: the recovery on
child PE in guest is hold until the recovery on parent PE in host
is completed.
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
---
arch/powerpc/kernel/eeh.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
index fd9c782..42bd546 100644
--- a/arch/powerpc/kernel/eeh.c
+++ b/arch/powerpc/kernel/eeh.c
@@ -1541,6 +1541,17 @@ int eeh_pe_get_state(struct eeh_pe *pe)
if (!eeh_ops || !eeh_ops->get_state)
return -ENOENT;
+ /*
+ * If the parent PE, which is owned by host kernel, is experiencing
+ * error recovery. We should return temporarily unavailable PE state
+ * so that the recovery on guest side is suspended until the error
+ * recovery is completed on host side.
+ */
+ if (pe->parent &&
+ !(pe->state & EEH_PE_REMOVED) &&
+ (pe->parent->state & (EEH_PE_ISOLATED | EEH_PE_RECOVERING)))
+ return EEH_PE_STATE_UNAVAIL;
+
result = eeh_ops->get_state(pe, NULL);
rst_active = !!(result & EEH_STATE_RESET_ACTIVE);
dma_en = !!(result & EEH_STATE_DMA_ENABLED);
--
2.1.0
next prev parent reply other threads:[~2016-02-26 0:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-26 0:04 [PATCH 0/3] powerpc/eeh: Enhancement to EEH for VF Gavin Shan
2016-02-26 0:04 ` [PATCH 1/3] powerpc/eeh: Don't propagate error to guest Gavin Shan
2016-02-26 0:04 ` [PATCH 2/3] powerpc/eeh: Don't remove passed VFs Gavin Shan
2016-02-26 0:04 ` Gavin Shan [this message]
2016-03-02 1:03 ` [PATCH 3/3] powerpc/eeh: Synchronize recovery in host/guest Russell Currey
2016-03-02 2:13 ` Gavin Shan
2016-03-02 1:04 ` [PATCH 0/3] powerpc/eeh: Enhancement to EEH for VF Russell Currey
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=1456445092-18337-4-git-send-email-gwshan@linux.vnet.ibm.com \
--to=gwshan@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
/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).