aboutsummaryrefslogtreecommitdiff
path: root/core/pci-opal.c
diff options
context:
space:
mode:
authorGavin Shan <gwshan@linux.vnet.ibm.com>2014-07-21 14:35:27 +1000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-07-21 14:48:45 +1000
commita4202bc19821a024e460592159507a059f993d3b (patch)
tree9385e51a6fe4e3ef4b5bf905e2a0188b91935aa6 /core/pci-opal.c
parent1b5220b4b7a337463cfe77e36d8988039f6facca (diff)
downloadskiboot-a4202bc19821a024e460592159507a059f993d3b.zip
skiboot-a4202bc19821a024e460592159507a059f993d3b.tar.gz
skiboot-a4202bc19821a024e460592159507a059f993d3b.tar.bz2
PCI: Allow to set frozen state
The patch introduces a new OPAL API opal_pci_eeh_freeze_set(), which allows to set frozen state for the specified PE, so that we can support "compound" PE in kernel. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'core/pci-opal.c')
-rw-r--r--core/pci-opal.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/core/pci-opal.c b/core/pci-opal.c
index 59f4d5c..2048d7f 100644
--- a/core/pci-opal.c
+++ b/core/pci-opal.c
@@ -93,6 +93,25 @@ static int64_t opal_pci_eeh_freeze_clear(uint64_t phb_id, uint64_t pe_number,
}
opal_call(OPAL_PCI_EEH_FREEZE_CLEAR, opal_pci_eeh_freeze_clear, 3);
+static int64_t opal_pci_eeh_freeze_set(uint64_t phb_id, uint64_t pe_number,
+ uint64_t eeh_action_token)
+{
+ struct phb *phb = pci_get_phb(phb_id);
+ int64_t rc;
+
+ if (!phb)
+ return OPAL_PARAMETER;
+ if (!phb->ops->eeh_freeze_set)
+ return OPAL_UNSUPPORTED;
+ phb->ops->lock(phb);
+ rc = phb->ops->eeh_freeze_set(phb, pe_number, eeh_action_token);
+ phb->ops->unlock(phb);
+ pci_put_phb(phb);
+
+ return rc;
+}
+opal_call(OPAL_PCI_EEH_FREEZE_SET, opal_pci_eeh_freeze_set, 3);
+
static int64_t opal_pci_err_injct(uint64_t phb_id, uint32_t pe_no,
uint32_t type, uint32_t function,
uint64_t addr, uint64_t mask)