From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3sFTHg134WzDr5Q for ; Fri, 19 Aug 2016 00:38:54 +1000 (AEST) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u7IEaAki066732 for ; Thu, 18 Aug 2016 10:38:52 -0400 Received: from e36.co.us.ibm.com (e36.co.us.ibm.com [32.97.110.154]) by mx0a-001b2d01.pphosted.com with ESMTP id 24vkhu8jj2-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 18 Aug 2016 10:38:51 -0400 Received: from localhost by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 18 Aug 2016 08:38:50 -0600 Reply-To: manoj@linux.vnet.ibm.com Subject: Re: [PATCH 2/6] cxlflash: Cache owning adapter within context References: <1470785888-9112-1-git-send-email-mrochs@linux.vnet.ibm.com> <1470785970-9192-1-git-send-email-mrochs@linux.vnet.ibm.com> To: "Matthew R. Ochs" , linux-scsi@vger.kernel.org, James Bottomley , "Martin K. Petersen" , Uma Krishnan , Al Viro Cc: Brian King , linuxppc-dev@lists.ozlabs.org, Ian Munsie , Andrew Donnellan , Frederic Barrat , Christophe Lombard From: Manoj Kumar Date: Thu, 18 Aug 2016 09:38:46 -0500 MIME-Version: 1.0 In-Reply-To: <1470785970-9192-1-git-send-email-mrochs@linux.vnet.ibm.com> Content-Type: text/plain; charset=windows-1252; format=flowed Message-Id: List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Acked-by: Manoj N. Kumar On 8/9/2016 6:39 PM, Matthew R. Ochs wrote: > 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 > --- > drivers/scsi/cxlflash/superpipe.c | 1 + > drivers/scsi/cxlflash/superpipe.h | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/drivers/scsi/cxlflash/superpipe.c b/drivers/scsi/cxlflash/superpipe.c > index ab5c893..640c3a2 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); > diff --git a/drivers/scsi/cxlflash/superpipe.h b/drivers/scsi/cxlflash/superpipe.h > index 5f9a091..61404f2 100644 > --- a/drivers/scsi/cxlflash/superpipe.h > +++ b/drivers/scsi/cxlflash/superpipe.h > @@ -107,6 +107,7 @@ struct ctx_info { > bool err_recovery_active; > struct mutex mutex; /* Context protection */ > struct cxl_context *ctx; > + struct cxlflash_cfg *cfg; > struct list_head luns; /* LUNs attached to this context */ > const struct vm_operations_struct *cxl_mmap_vmops; > struct file *file; >