From patchwork Fri May 11 19:06:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uma Krishnan X-Patchwork-Id: 10394829 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 592DC60348 for ; Fri, 11 May 2018 19:06:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3EF0C28F91 for ; Fri, 11 May 2018 19:06:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 32C6928FA6; Fri, 11 May 2018 19:06:29 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, 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 6A56228F91 for ; Fri, 11 May 2018 19:06:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751381AbeEKTG2 (ORCPT ); Fri, 11 May 2018 15:06:28 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:59010 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751159AbeEKTG1 (ORCPT ); Fri, 11 May 2018 15:06:27 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4BIx05B028838 for ; Fri, 11 May 2018 15:06:27 -0400 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0a-001b2d01.pphosted.com with ESMTP id 2hwdr9gj2x-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 11 May 2018 15:06:26 -0400 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 11 May 2018 13:06:25 -0600 Received: from b03cxnp08025.gho.boulder.ibm.com (9.17.130.17) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 11 May 2018 13:06:24 -0600 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4BJ6NH120971808; Fri, 11 May 2018 12:06:23 -0700 Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C07CB6E03F; Fri, 11 May 2018 13:06:23 -0600 (MDT) Received: from p8tul1-build.aus.stglabs.ibm.com (unknown [9.3.141.206]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP id E38D56E038; Fri, 11 May 2018 13:06:22 -0600 (MDT) 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 7/7] cxlflash: Isolate external module dependencies Date: Fri, 11 May 2018 14:06:19 -0500 X-Mailer: git-send-email 2.1.0 In-Reply-To: <1526065440-38806-1-git-send-email-ukrishn@linux.vnet.ibm.com> References: <1526065440-38806-1-git-send-email-ukrishn@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18051119-0012-0000-0000-000016351E70 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009007; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000260; SDB=6.01030854; UDB=6.00526868; IPR=6.00809986; MB=3.00021053; MTD=3.00000008; XFM=3.00000015; UTC=2018-05-11 19:06:25 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18051119-0013-0000-0000-000052B42C6C Message-Id: <1526065579-39079-1-git-send-email-ukrishn@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-11_08:, , 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-1805110175 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 Depending on the underlying transport, cxlflash has a dependency on either the CXL or OCXL drivers, which are enabled via their Kconfig option. Instead of having a module wide dependency on these config options, it is better to isolate the object modules that are dependent on the CXL and OCXL drivers and adjust the module dependencies accordingly. This commit isolates the object files that are dependent on CXL and/or OCXL. The cxl/ocxl fops used in the core driver are tucked under an ifdef to avoid compilation errors. Signed-off-by: Uma Krishnan Acked-by: Matthew R. Ochs --- drivers/scsi/cxlflash/Kconfig | 2 +- drivers/scsi/cxlflash/Makefile | 4 +++- drivers/scsi/cxlflash/lunmgt.c | 4 +++- drivers/scsi/cxlflash/main.c | 2 -- drivers/scsi/cxlflash/main.h | 5 +++++ drivers/scsi/cxlflash/superpipe.c | 3 ++- drivers/scsi/cxlflash/vlun.c | 3 ++- 7 files changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/cxlflash/Kconfig b/drivers/scsi/cxlflash/Kconfig index e2a3a1b..f1b17e3 100644 --- a/drivers/scsi/cxlflash/Kconfig +++ b/drivers/scsi/cxlflash/Kconfig @@ -4,7 +4,7 @@ config CXLFLASH tristate "Support for IBM CAPI Flash" - depends on PCI && SCSI && CXL && OCXL && EEH + depends on PCI && SCSI && (CXL || OCXL) && EEH select IRQ_POLL default m help diff --git a/drivers/scsi/cxlflash/Makefile b/drivers/scsi/cxlflash/Makefile index 5124c68..283377d 100644 --- a/drivers/scsi/cxlflash/Makefile +++ b/drivers/scsi/cxlflash/Makefile @@ -1,2 +1,4 @@ obj-$(CONFIG_CXLFLASH) += cxlflash.o -cxlflash-y += main.o superpipe.o lunmgt.o vlun.o cxl_hw.o ocxl_hw.o +cxlflash-y += main.o superpipe.o lunmgt.o vlun.o +cxlflash-$(CONFIG_CXL) += cxl_hw.o +cxlflash-$(CONFIG_OCXL) += ocxl_hw.o diff --git a/drivers/scsi/cxlflash/lunmgt.c b/drivers/scsi/cxlflash/lunmgt.c index 4d232e2..edea125 100644 --- a/drivers/scsi/cxlflash/lunmgt.c +++ b/drivers/scsi/cxlflash/lunmgt.c @@ -12,9 +12,11 @@ * 2 of the License, or (at your option) any later version. */ -#include #include +#include +#include + #include #include diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c index cd7dcc5..6637116 100644 --- a/drivers/scsi/cxlflash/main.c +++ b/drivers/scsi/cxlflash/main.c @@ -19,8 +19,6 @@ #include -#include - #include #include #include diff --git a/drivers/scsi/cxlflash/main.h b/drivers/scsi/cxlflash/main.h index ed4908e..2a39778 100644 --- a/drivers/scsi/cxlflash/main.h +++ b/drivers/scsi/cxlflash/main.h @@ -107,10 +107,15 @@ cxlflash_assign_ops(struct dev_dependent_vals *ddv) { const struct cxlflash_backend_ops *ops = NULL; +#ifdef CONFIG_OCXL if (ddv->flags & CXLFLASH_OCXL_DEV) ops = &cxlflash_ocxl_ops; +#endif + +#ifdef CONFIG_CXL if (!(ddv->flags & CXLFLASH_OCXL_DEV)) ops = &cxlflash_cxl_ops; +#endif return ops; } diff --git a/drivers/scsi/cxlflash/superpipe.c b/drivers/scsi/cxlflash/superpipe.c index 5ba6e62..e489d89 100644 --- a/drivers/scsi/cxlflash/superpipe.c +++ b/drivers/scsi/cxlflash/superpipe.c @@ -14,8 +14,9 @@ #include #include +#include +#include #include -#include #include #include diff --git a/drivers/scsi/cxlflash/vlun.c b/drivers/scsi/cxlflash/vlun.c index 5deef57..66e445a 100644 --- a/drivers/scsi/cxlflash/vlun.c +++ b/drivers/scsi/cxlflash/vlun.c @@ -12,8 +12,9 @@ * 2 of the License, or (at your option) any later version. */ +#include +#include #include -#include #include #include