From: Gavin Shan <gwshan@linux.vnet.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: bhelgaas@google.com, mpe@ellerman.id.au,
Gavin Shan <gwshan@linux.vnet.ibm.com>
Subject: [PATCH v3 4/6] powerpc/powernv: Unfreeze PE on allocation
Date: Wed, 28 Sep 2016 14:34:56 +1000 [thread overview]
Message-ID: <1475037298-19188-5-git-send-email-gwshan@linux.vnet.ibm.com> (raw)
In-Reply-To: <1475037298-19188-1-git-send-email-gwshan@linux.vnet.ibm.com>
This unfreezes PE when it's initialized because the PE might be put
into frozen state in the last hot remove path. It's not harmful to
do so if the PE is already in unfrozen state.
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
---
arch/powerpc/platforms/powernv/pci-ioda.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 38a5c65..841395e 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -133,9 +133,21 @@ static inline bool pnv_pci_is_m64_flags(unsigned long resource_flags)
static struct pnv_ioda_pe *pnv_ioda_init_pe(struct pnv_phb *phb, int pe_no)
{
+ s64 rc;
+
phb->ioda.pe_array[pe_no].phb = phb;
phb->ioda.pe_array[pe_no].pe_number = pe_no;
+ /* Clear the PE frozen state as it might be put into frozen state
+ * in the last PCI remove path. It's not harmful to do so when the
+ * PE is already in unfrozen state.
+ */
+ rc = opal_pci_eeh_freeze_clear(phb->opal_id, pe_no,
+ OPAL_EEH_ACTION_CLEAR_FREEZE_ALL);
+ if (rc != OPAL_SUCCESS)
+ pr_warn("%s: Error %lld unfreezing PHB#%d-PE#%d\n",
+ __func__, rc, phb->hose->global_number, pe_no);
+
return &phb->ioda.pe_array[pe_no];
}
--
2.1.0
next prev parent reply other threads:[~2016-09-28 4:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-28 4:34 [PATCH v3 0/6] powerpc/powernv: PCI Surprise Hotplug Support Gavin Shan
2016-09-28 4:34 ` [PATCH v3 1/6] powerpc/eeh: Allow to freeze PE in eeh_pe_set_option() Gavin Shan
2016-09-29 13:13 ` [v3,1/6] " Michael Ellerman
2016-09-28 4:34 ` [PATCH v3 2/6] powerpc/eeh: Export confirm_error_lock Gavin Shan
2016-09-28 4:34 ` [PATCH v3 3/6] powerpc/eeh: Export eeh_pe_state_mark() Gavin Shan
2016-09-28 4:34 ` Gavin Shan [this message]
2016-09-28 4:34 ` [PATCH v3 5/6] drivers/pci/hotplug: Remove likely() and unlikely() in powernv driver Gavin Shan
2016-09-28 4:34 ` [PATCH v3 6/6] drivers/pci/hotplug: Support surprise hotplug " Gavin Shan
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=1475037298-19188-5-git-send-email-gwshan@linux.vnet.ibm.com \
--to=gwshan@linux.vnet.ibm.com \
--cc=bhelgaas@google.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).