diff options
author | Uma Krishnan <ukrishn@linux.vnet.ibm.com> | 2018-03-26 18:31:36 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-04-19 01:32:48 +0200 |
commit | d926519e8f9b39d307d97cd4b904e006c309e37e (patch) | |
tree | 7dc62e912420836d1a2251c4379e0ff97e6bb7d9 /drivers/scsi/cxlflash/ocxl_hw.c | |
parent | scsi: cxlflash: Read host AFU configuration (diff) | |
download | linux-d926519e8f9b39d307d97cd4b904e006c309e37e.tar.xz linux-d926519e8f9b39d307d97cd4b904e006c309e37e.zip |
scsi: cxlflash: Setup AFU acTag range
The OCXL specification supports distributing acTags amongst different AFUs and
functions on the link. As cxlflash devices are expected to only support a
single AFU per function, the entire range that was assigned to the function is
also assigned to the AFU.
Signed-off-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
Acked-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Reviewed-by: Frederic Barrat <fbarrat@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.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/scsi/cxlflash/ocxl_hw.c b/drivers/scsi/cxlflash/ocxl_hw.c index 11399cf12ebd..105712b29b2e 100644 --- a/drivers/scsi/cxlflash/ocxl_hw.c +++ b/drivers/scsi/cxlflash/ocxl_hw.c @@ -92,6 +92,9 @@ static int ocxlflash_config_afu(struct pci_dev *pdev, struct ocxl_hw_afu *afu) struct ocxl_afu_config *acfg = &afu->acfg; struct ocxl_fn_config *fcfg = &afu->fcfg; struct device *dev = &pdev->dev; + int count; + int base; + int pos; int rc = 0; /* This HW AFU function does not have any AFUs defined */ @@ -105,6 +108,16 @@ static int ocxlflash_config_afu(struct pci_dev *pdev, struct ocxl_hw_afu *afu) __func__, rc); goto out; } + + /* Only one AFU per function is supported, so actag_base is same */ + base = afu->fn_actag_base; + count = min_t(int, acfg->actag_supported, afu->fn_actag_enabled); + pos = acfg->dvsec_afu_control_pos; + + ocxl_config_set_afu_actag(pdev, pos, base, count); + dev_dbg(dev, "%s: acTag base=%d enabled=%d\n", __func__, base, count); + afu->afu_actag_base = base; + afu->afu_actag_enabled = count; out: return rc; } |