summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUma Krishnan <ukrishn@linux.vnet.ibm.com>2018-03-26 11:33:05 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2018-04-18 19:32:49 -0400
commit3351e4f025f772e76054b1b6dd7ad9afd49a9b99 (patch)
tree3907e36805434312a986b90b377b06c4152b4532
parent012f394cb81c61dd1207caecaaeed20caf0a8e36 (diff)
scsi: cxlflash: Support AFU state toggling
The AFU should be enabled following a successful configuration and disabled near the end of the cleanup path. Signed-off-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com> Acked-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Reviewed-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--drivers/scsi/cxlflash/ocxl_hw.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/scsi/cxlflash/ocxl_hw.c b/drivers/scsi/cxlflash/ocxl_hw.c
index 73b0b104439c..3042057c2680 100644
--- a/drivers/scsi/cxlflash/ocxl_hw.c
+++ b/drivers/scsi/cxlflash/ocxl_hw.c
@@ -342,12 +342,18 @@ static void ocxlflash_unconfig_afu(struct ocxl_hw_afu *afu)
static void ocxlflash_destroy_afu(void *afu_cookie)
{
struct ocxl_hw_afu *afu = afu_cookie;
+ int pos;
if (!afu)
return;
ocxlflash_release_context(afu->ocxl_ctx);
idr_destroy(&afu->idr);
+
+ /* Disable the AFU */
+ pos = afu->acfg.dvsec_afu_control_pos;
+ ocxl_config_set_afu_state(afu->pdev, pos, 0);
+
ocxlflash_unconfig_afu(afu);
kfree(afu);
}
@@ -499,6 +505,9 @@ static int ocxlflash_config_afu(struct pci_dev *pdev, struct ocxl_hw_afu *afu)
__func__, rc);
goto out;
}
+
+ /* Enable the AFU */
+ ocxl_config_set_afu_state(pdev, acfg->dvsec_afu_control_pos, 1);
out:
return rc;
}