]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
UBUNTU: SAUCE: cxlflash: Setup function acTag range
authorUma Krishnan <ukrishn@linux.vnet.ibm.com>
Tue, 7 Nov 2017 17:05:40 +0000 (11:05 -0600)
committerSeth Forshee <seth.forshee@canonical.com>
Tue, 27 Mar 2018 19:10:07 +0000 (14:10 -0500)
BugLink: http://bugs.launchpad.net/bugs/1752672
The OCXL specification supports distributing acTags amongst different
AFUs and functions on the link. The platform-specific acTag range for the
link is obtained using the OCXL provider services and then assigned to the
host function based on implementation. For cxlflash devices only a single
function per host is expected and thus the entire range is assigned.

Signed-off-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
Acked-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/scsi/cxlflash/ocxl_hw.c
drivers/scsi/cxlflash/ocxl_hw.h

index dc32a739ce036a0e3e2474664664b53eb65da65d..39cccb78e542fc345aa129c282b8e803d0820feb 100644 (file)
@@ -42,6 +42,7 @@ static int ocxlflash_config_fn(struct pci_dev *pdev, struct ocxl_hw_afu *afu)
 {
        struct ocxl_fn_config *fcfg = &afu->fcfg;
        struct device *dev = &pdev->dev;
+       u16 base, enabled, supported;
        int rc = 0;
 
        /* Read DVSEC config of the function */
@@ -56,6 +57,20 @@ static int ocxlflash_config_fn(struct pci_dev *pdev, struct ocxl_hw_afu *afu)
        if (fcfg->max_afu_index != 0)
                dev_warn(dev, "%s: Unexpected AFU index value %d\n",
                         __func__, fcfg->max_afu_index);
+
+       rc = ocxl_config_get_actag_info(pdev, &base, &enabled, &supported);
+       if (unlikely(rc)) {
+               dev_err(dev, "%s: ocxl_config_get_actag_info failed rc=%d\n",
+                       __func__, rc);
+               goto out;
+       }
+
+       afu->fn_actag_base = base;
+       afu->fn_actag_enabled = enabled;
+
+       ocxl_config_set_actag(pdev, fcfg->dvsec_function_pos, base, enabled);
+       dev_dbg(dev, "%s: Function acTag range base=%u enabled=%u\n",
+               __func__, base, enabled);
 out:
        return rc;
 }
index 658f4207e7de3fe8ddfcc98000d1a4904036d9a3..190d71a3ac2eeddf30dcb8e2e8f76ffe8e77ec5c 100644 (file)
@@ -18,4 +18,7 @@ struct ocxl_hw_afu {
        struct device *dev;             /* Generic device */
 
        struct ocxl_fn_config fcfg;     /* DVSEC config of the function */
+
+       int fn_actag_base;              /* Function acTag base */
+       int fn_actag_enabled;           /* Function acTag number enabled */
 };