From patchwork Wed Jan 3 22:54:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uma Krishnan X-Patchwork-Id: 10143631 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 788C8601A1 for ; Wed, 3 Jan 2018 22:55:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62B1D29408 for ; Wed, 3 Jan 2018 22:55:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 578172940D; Wed, 3 Jan 2018 22:55:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE51629408 for ; Wed, 3 Jan 2018 22:55:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751192AbeACWzB (ORCPT ); Wed, 3 Jan 2018 17:55:01 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:49586 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750928AbeACWzA (ORCPT ); Wed, 3 Jan 2018 17:55:00 -0500 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w03MsFmD003091 for ; Wed, 3 Jan 2018 17:55:00 -0500 Received: from e37.co.us.ibm.com (e37.co.us.ibm.com [32.97.110.158]) by mx0a-001b2d01.pphosted.com with ESMTP id 2f94et93dn-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 03 Jan 2018 17:55:00 -0500 Received: from localhost by e37.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 3 Jan 2018 15:54:58 -0700 Received: from b03cxnp07029.gho.boulder.ibm.com (9.17.130.16) by e37.co.us.ibm.com (192.168.1.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 3 Jan 2018 15:54:55 -0700 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w03Mss4l12321062; Wed, 3 Jan 2018 15:54:54 -0700 Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D47A778041; Wed, 3 Jan 2018 15:54:54 -0700 (MST) Received: from p8tul1-build.aus.stglabs.ibm.com (unknown [9.3.141.206]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP id 647F67803F; Wed, 3 Jan 2018 15:54:54 -0700 (MST) From: Uma Krishnan To: linux-scsi@vger.kernel.org, James Bottomley , "Martin K. Petersen" , "Matthew R. Ochs" , "Manoj N. Kumar" Cc: linuxppc-dev@lists.ozlabs.org, Andrew Donnellan , Frederic Barrat , Christophe Lombard Subject: [PATCH 4/6] cxlflash: Remove embedded CXL work structures Date: Wed, 3 Jan 2018 16:54:50 -0600 X-Mailer: git-send-email 2.1.0 In-Reply-To: <1515020002-43551-1-git-send-email-ukrishn@linux.vnet.ibm.com> References: <1515020002-43551-1-git-send-email-ukrishn@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18010322-0024-0000-0000-000017BDEE18 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008313; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000244; SDB=6.00969834; UDB=6.00491135; IPR=6.00749810; BA=6.00005765; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00018855; XFM=3.00000015; UTC=2018-01-03 22:54:57 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18010322-0025-0000-0000-00004E22884C Message-Id: <1515020090-43721-1-git-send-email-ukrishn@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-01-03_14:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801030307 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "Matthew R. Ochs" The CXL-specific work structure used to request the number of interrupts currently resides as a nested member of both the context information and hardware queue structures. It is used to cache values (specifically the number of interrupts) required by the CXL layer when starting a context. To facilitate staging that will ultimately allow the cxlflash core to become agnostic of the underlying accelerator transport, remove these embedded work structures. Signed-off-by: Matthew R. Ochs Signed-off-by: Uma Krishnan --- drivers/scsi/cxlflash/common.h | 1 - drivers/scsi/cxlflash/main.c | 4 +--- drivers/scsi/cxlflash/superpipe.c | 15 +++++++++------ drivers/scsi/cxlflash/superpipe.h | 1 - 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/cxlflash/common.h b/drivers/scsi/cxlflash/common.h index d2a180d..48df89f 100644 --- a/drivers/scsi/cxlflash/common.h +++ b/drivers/scsi/cxlflash/common.h @@ -204,7 +204,6 @@ struct hwq { */ struct afu *afu; void *ctx_cookie; - struct cxl_ioctl_start_work work; struct sisl_host_map __iomem *host_map; /* MC host map */ struct sisl_ctrl_map __iomem *ctrl_map; /* MC control map */ ctx_hndl_t ctx_hndl; /* master's context handle */ diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c index 3880d52..b6cadeb 100644 --- a/drivers/scsi/cxlflash/main.c +++ b/drivers/scsi/cxlflash/main.c @@ -1611,9 +1611,7 @@ static int start_context(struct cxlflash_cfg *cfg, u32 index) struct hwq *hwq = get_hwq(cfg->afu, index); int rc = 0; - rc = cxl_start_context(hwq->ctx_cookie, - hwq->work.work_element_descriptor, - NULL); + rc = cxl_start_context(hwq->ctx_cookie, 0, NULL); dev_dbg(dev, "%s: returning rc=%d\n", __func__, rc); return rc; diff --git a/drivers/scsi/cxlflash/superpipe.c b/drivers/scsi/cxlflash/superpipe.c index ecfa553..51f67dc 100644 --- a/drivers/scsi/cxlflash/superpipe.c +++ b/drivers/scsi/cxlflash/superpipe.c @@ -1309,7 +1309,7 @@ static int cxlflash_disk_attach(struct scsi_device *sdev, struct afu *afu = cfg->afu; struct llun_info *lli = sdev->hostdata; struct glun_info *gli = lli->parent; - struct cxl_ioctl_start_work *work; + struct cxl_ioctl_start_work work = { 0 }; struct ctx_info *ctxi = NULL; struct lun_access *lun_access = NULL; int rc = 0; @@ -1405,11 +1405,10 @@ static int cxlflash_disk_attach(struct scsi_device *sdev, goto err; } - work = &ctxi->work; - work->num_interrupts = irqs; - work->flags = CXL_START_WORK_NUM_IRQS; + work.num_interrupts = irqs; + work.flags = CXL_START_WORK_NUM_IRQS; - rc = cxl_start_work(ctx, work); + rc = cxl_start_work(ctx, &work); if (unlikely(rc)) { dev_dbg(dev, "%s: Could not start context rc=%d\n", __func__, rc); @@ -1534,6 +1533,7 @@ static int recover_context(struct cxlflash_cfg *cfg, struct file *file; void *ctx; struct afu *afu = cfg->afu; + struct cxl_ioctl_start_work work = { 0 }; ctx = cxl_dev_context_init(cfg->dev); if (IS_ERR_OR_NULL(ctx)) { @@ -1543,7 +1543,10 @@ static int recover_context(struct cxlflash_cfg *cfg, goto out; } - rc = cxl_start_work(ctx, &ctxi->work); + work.num_interrupts = ctxi->irqs; + work.flags = CXL_START_WORK_NUM_IRQS; + + rc = cxl_start_work(ctx, &work); if (unlikely(rc)) { dev_dbg(dev, "%s: Could not start context rc=%d\n", __func__, rc); diff --git a/drivers/scsi/cxlflash/superpipe.h b/drivers/scsi/cxlflash/superpipe.h index b761293..35c3cbf 100644 --- a/drivers/scsi/cxlflash/superpipe.h +++ b/drivers/scsi/cxlflash/superpipe.h @@ -96,7 +96,6 @@ struct ctx_info { struct llun_info **rht_lun; /* Mapping of RHT entries to LUNs */ u8 *rht_needs_ws; /* User-desired write-same function per RHTE */ - struct cxl_ioctl_start_work work; u64 ctxid; u64 irqs; /* Number of interrupts requested for context */ pid_t pid;