Commit 8b7a5521 authored by Uma Krishnan's avatar Uma Krishnan Committed by Martin K. Petersen

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: default avatarUma Krishnan <ukrishn@linux.vnet.ibm.com>
Acked-by: default avatarMatthew R. Ochs <mrochs@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent b18718c6
...@@ -251,6 +251,18 @@ static int ocxlflash_release_context(void *ctx_cookie) ...@@ -251,6 +251,18 @@ static int ocxlflash_release_context(void *ctx_cookie)
return rc; return rc;
} }
/**
* 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 * ocxlflash_destroy_afu() - destroy the AFU structure
* @afu_cookie: AFU to be freed. * @afu_cookie: AFU to be freed.
...@@ -501,6 +513,7 @@ const struct cxlflash_backend_ops cxlflash_ocxl_ops = { ...@@ -501,6 +513,7 @@ const struct cxlflash_backend_ops cxlflash_ocxl_ops = {
.get_context = ocxlflash_get_context, .get_context = ocxlflash_get_context,
.dev_context_init = ocxlflash_dev_context_init, .dev_context_init = ocxlflash_dev_context_init,
.release_context = ocxlflash_release_context, .release_context = ocxlflash_release_context,
.perst_reloads_same_image = ocxlflash_perst_reloads_same_image,
.create_afu = ocxlflash_create_afu, .create_afu = ocxlflash_create_afu,
.destroy_afu = ocxlflash_destroy_afu, .destroy_afu = ocxlflash_destroy_afu,
.get_fd = ocxlflash_get_fd, .get_fd = ocxlflash_get_fd,
......
...@@ -17,6 +17,7 @@ struct ocxl_hw_afu { ...@@ -17,6 +17,7 @@ struct ocxl_hw_afu {
struct ocxlflash_context *ocxl_ctx; /* Host context */ struct ocxlflash_context *ocxl_ctx; /* Host context */
struct pci_dev *pdev; /* PCI device */ struct pci_dev *pdev; /* PCI device */
struct device *dev; /* Generic device */ struct device *dev; /* Generic device */
bool perst_same_image; /* Same image loaded on perst */
struct ocxl_fn_config fcfg; /* DVSEC config of the function */ struct ocxl_fn_config fcfg; /* DVSEC config of the function */
struct ocxl_afu_config acfg; /* AFU configuration data */ struct ocxl_afu_config acfg; /* AFU configuration data */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment