diff options
author | Daniel Axtens <dja@axtens.net> | 2015-08-14 17:41:25 +1000 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2015-08-14 21:32:07 +1000 |
commit | 13e68d8bd05c998cae452a4f3400af1e8edd852e (patch) | |
tree | d17ff97c9f46a663b5cb4916fc333703b2cdfea4 /drivers/misc/cxl/pci.c | |
parent | 4e1efb403c1c016ae831bd9988a7d2e5e0af41a0 (diff) | |
download | linux-13e68d8bd05c998cae452a4f3400af1e8edd852e.tar.gz linux-13e68d8bd05c998cae452a4f3400af1e8edd852e.tar.xz |
cxl: Allow the kernel to trust that an image won't change on PERST.
Provide a kernel API and a sysfs entry which allow a user to specify
that when a card is PERSTed, it's image will stay the same, allowing
it to participate in EEH.
cxl_reset is used to reflash the card. In that case, we cannot safely
assert that the image will not change. Therefore, disallow cxl_reset
if the flag is set.
Signed-off-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'drivers/misc/cxl/pci.c')
-rw-r--r-- | drivers/misc/cxl/pci.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c index 2b61cb1ee62c..bfbd6478c0c5 100644 --- a/drivers/misc/cxl/pci.c +++ b/drivers/misc/cxl/pci.c @@ -878,6 +878,12 @@ int cxl_reset(struct cxl *adapter) int i; u32 val; + if (adapter->perst_same_image) { + dev_warn(&dev->dev, + "cxl: refusing to reset/reflash when perst_reloads_same_image is set.\n"); + return -EINVAL; + } + dev_info(&dev->dev, "CXL reset\n"); /* pcie_warm_reset requests a fundamental pci reset which includes a @@ -1151,6 +1157,7 @@ static struct cxl *cxl_init_adapter(struct pci_dev *dev) * configure/reconfigure */ adapter->perst_loads_image = true; + adapter->perst_same_image = false; rc = cxl_configure_adapter(adapter, dev); if (rc) { |