summary refs log tree commit diff
path: root/drivers/scsi/cxlflash/superpipe.c
diff options
context:
space:
mode:
authorMatthew R. Ochs <mrochs@linux.vnet.ibm.com>2016-08-09 18:39:30 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2016-08-18 22:40:27 -0400
commit44ef38f9a2af8644c24ace6cbe1132dc70174c39 (patch)
tree74c34834186fe032ad96911d12b25a60de4d88ed /drivers/scsi/cxlflash/superpipe.c
parent41b99e1a30a6d04df7585905e5ffc7251099c6d3 (diff)
downloadlinux-44ef38f9a2af8644c24ace6cbe1132dc70174c39.tar.gz
scsi: cxlflash: Cache owning adapter within context
The context removal routine requires access to the owning adapter
structure to reset the context within the AFU as part of the tear down
sequence. In order to support kref adoption, the owning adapter must be
accessible from the release handler. As the kref framework only provides
the kref reference as the sole parameter, another means is needed to
derive the owning adapter.

As a remedy, the owning adapter reference is saved off within the
context during initialization.

Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Acked-by: Manoj N. Kumar <manoj@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/cxlflash/superpipe.c')
-rw-r--r--drivers/scsi/cxlflash/superpipe.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/scsi/cxlflash/superpipe.c b/drivers/scsi/cxlflash/superpipe.c
index ab5c8939928b..640c3a2641ef 100644
--- a/drivers/scsi/cxlflash/superpipe.c
+++ b/drivers/scsi/cxlflash/superpipe.c
@@ -804,6 +804,7 @@ static void init_context(struct ctx_info *ctxi, struct cxlflash_cfg *cfg,
 	ctxi->lfd = adap_fd;
 	ctxi->pid = current->tgid; /* tgid = pid */
 	ctxi->ctx = ctx;
+	ctxi->cfg = cfg;
 	ctxi->file = file;
 	ctxi->initialized = true;
 	mutex_init(&ctxi->mutex);