aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2017-06-06 08:59:18 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-06-06 20:49:05 +1000
commit97357c7d26793133e9e76eb954c505a4ffa16949 (patch)
treea9af492a948f4fe1633805da6878eb27b124b2f0 /core
parentacd94a9c7c589e36db013c026b5910d24af26bab (diff)
downloadskiboot-97357c7d26793133e9e76eb954c505a4ffa16949.zip
skiboot-97357c7d26793133e9e76eb954c505a4ffa16949.tar.gz
skiboot-97357c7d26793133e9e76eb954c505a4ffa16949.tar.bz2
phb3+iov: Fixup support for config space filters
The filter should be called before the HW access and its return value control whether to perform the access or not Also fix the pci-iov.c return values to match accordingly otherwise this breaks SR-IOV Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core')
-rw-r--r--core/pci-iov.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/core/pci-iov.c b/core/pci-iov.c
index 6abb85a..9d75b37 100644
--- a/core/pci-iov.c
+++ b/core/pci-iov.c
@@ -33,9 +33,8 @@ static int64_t pci_iov_vf_devctl(void *dev, struct pci_cfg_reg_filter *pcrf,
uint32_t pos = pci_cap(vf, PCI_CFG_CAP_ID_EXP, false);
uint8_t *pcache;
- if (offset != pcrf->start ||
- offset != (pos + PCICAP_EXP_DEVCTL))
- return OPAL_SUCCESS;
+ if (offset != (pos + PCICAP_EXP_DEVCTL))
+ return OPAL_PARTIAL;
pcache = &pcrf->data[0];
if (write) {
@@ -130,13 +129,13 @@ static int64_t pci_iov_change(void *dev __unused,
/* Update SRIOV variable parameters */
changed = pci_iov_update_parameters(iov);
if (!changed)
- return OPAL_SUCCESS;
+ return OPAL_PARTIAL;
/* Remove all VFs that have been attached to the parent */
if (!iov->enabled) {
list_for_each_safe(&pd->children, vf, tmp, link)
list_del(&vf->link);
- return OPAL_SUCCESS;
+ return OPAL_PARTIAL;
}
/* Initialize the VFs and attach them to parent */
@@ -165,7 +164,7 @@ static int64_t pci_iov_change(void *dev __unused,
phb->ops->device_init(phb, pd, NULL);
}
- return OPAL_SUCCESS;
+ return OPAL_PARTIAL;
}
/*