scsi: cxlflash: Setup AFU PASID
authorUma Krishnan <ukrishn@linux.vnet.ibm.com>
Mon, 26 Mar 2018 16:31:44 +0000 (11:31 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 18 Apr 2018 23:32:48 +0000 (19:32 -0400)
Per the OCXL specification, the maximum PASID supported by the AFU is
indicated by a field within the configuration space. Similar to acTags,
implementations can choose to use any sub-range of PASID within their assigned
range. For cxlflash, the entire range is used.

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>
drivers/scsi/cxlflash/ocxl_hw.c
drivers/scsi/cxlflash/ocxl_hw.h

index 105712b29b2ec85357f954fbb6b189b2fd17ddcb..44688af7af3ac59f3e159bc08669c7e8ec6af343 100644 (file)
@@ -118,6 +118,9 @@ static int ocxlflash_config_afu(struct pci_dev *pdev, struct ocxl_hw_afu *afu)
        dev_dbg(dev, "%s: acTag base=%d enabled=%d\n", __func__, base, count);
        afu->afu_actag_base = base;
        afu->afu_actag_enabled = count;
+       afu->max_pasid = 1 << acfg->pasid_supported_log;
+
+       ocxl_config_set_afu_pasid(pdev, pos, 0, acfg->pasid_supported_log);
 out:
        return rc;
 }
index 21803b52e3becd5df173ed5d70448134b7e19d3e..46de75b59b1a70f8c0e779bbf3a56446f5132e3c 100644 (file)
@@ -25,5 +25,6 @@ struct ocxl_hw_afu {
        int afu_actag_base;             /* AFU acTag base */
        int afu_actag_enabled;          /* AFU acTag number enabled */
 
+       int max_pasid;                  /* Maximum number of contexts */
        bool is_present;                /* Function has AFUs defined */
 };