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>
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);
}
__func__, rc);
goto out;
}
+
+ /* Enable the AFU */
+ ocxl_config_set_afu_state(pdev, acfg->dvsec_afu_control_pos, 1);
out:
return rc;
}