summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/cxlflash/ocxl_hw.c
diff options
context:
space:
mode:
authorUma Krishnan <ukrishn@linux.vnet.ibm.com>2018-03-26 18:32:29 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2018-04-19 01:32:48 +0200
commit8b7a55215000496a6284bc15a2cb47f46ae78a80 (patch)
treed31d7ac53e04ebfd8e11d65618e5de94e1717868 /drivers/scsi/cxlflash/ocxl_hw.c
parentscsi: cxlflash: Support adapter context discovery (diff)
downloadlinux-8b7a55215000496a6284bc15a2cb47f46ae78a80.tar.xz
linux-8b7a55215000496a6284bc15a2cb47f46ae78a80.zip
scsi: cxlflash: Support image reload policy modification
On a PERST, the AFU image can be reloaded or left intact. Provide means to set this image reload policy. Signed-off-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com> Acked-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/cxlflash/ocxl_hw.c')
-rw-r--r--drivers/scsi/cxlflash/ocxl_hw.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/scsi/cxlflash/ocxl_hw.c b/drivers/scsi/cxlflash/ocxl_hw.c
index 21915b726106..f26bbb793f4e 100644
--- a/drivers/scsi/cxlflash/ocxl_hw.c
+++ b/drivers/scsi/cxlflash/ocxl_hw.c
@@ -252,6 +252,18 @@ out:
}
/**
+ * ocxlflash_perst_reloads_same_image() - sets the image reload policy
+ * @afu_cookie: Hardware AFU associated with the host.
+ * @image: Whether to load the same image on PERST.
+ */
+static void ocxlflash_perst_reloads_same_image(void *afu_cookie, bool image)
+{
+ struct ocxl_hw_afu *afu = afu_cookie;
+
+ afu->perst_same_image = image;
+}
+
+/**
* ocxlflash_destroy_afu() - destroy the AFU structure
* @afu_cookie: AFU to be freed.
*/
@@ -501,6 +513,7 @@ const struct cxlflash_backend_ops cxlflash_ocxl_ops = {
.get_context = ocxlflash_get_context,
.dev_context_init = ocxlflash_dev_context_init,
.release_context = ocxlflash_release_context,
+ .perst_reloads_same_image = ocxlflash_perst_reloads_same_image,
.create_afu = ocxlflash_create_afu,
.destroy_afu = ocxlflash_destroy_afu,
.get_fd = ocxlflash_get_fd,