Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp1232221rwb; Fri, 13 Jan 2023 09:28:58 -0800 (PST) X-Google-Smtp-Source: AMrXdXuF0xL7SgxbshQe+8X+PRNnCEXQZj80fuvwqzWofON8eXGIDiATxmRcNftsxYvIDuPHhkvT X-Received: by 2002:a05:6402:f04:b0:46d:ca42:2e59 with SMTP id i4-20020a0564020f0400b0046dca422e59mr78281431eda.11.1673630938459; Fri, 13 Jan 2023 09:28:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673630938; cv=none; d=google.com; s=arc-20160816; b=GWcIghHN8Hc/JkNZD4fbqVu7jnQWf3V4UEN36PKCt/8wJN4DSAJ1fh/SBC5YzcU2gu grXngkLaEmZWNvr5KhDiHWMzw/Upqze5QAXRdJ8nM9BHOyvEEvR8HS+tGlELSJA8H990 JgQv1QJDpJfc+AJ2Wvfke73tDgCBKjVITuLoYayVcJ2YhDNPJqgLFqlW4/d0/SnFzpGs pFRpHSsHhC7r3zwn6kNYLr2SZ6992gFShko1So6HQAtdMzz5qiwBmqksA0e2zMUvK0vM QxlI+XukrBQf+RDr19ei1sgNX2/KUjQ7GYD+IfRCcKEnCUeZrz/3XbvuN13M4jDpeGVJ 1Uag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ShlLyppeLQtb7T6fwIeGywjfZSVNMRyBEPj0UpV2Cxk=; b=pMJq4gg9yq3oC1m2sWGJvmC27eM3Lc1jq1niUwRi6DFefy5PAGDeEifXHakGIIbAOF L3ve/WOp1UWi9FGzzA3TaOMYu2Fzg2LRv3izpbjhZPLUDZ6WQjvxPzjo1KpVwZiLqLOa W4/f0L/zaImi93HiMOc3xYhtMAHOrvlzoXN8sMt3QlUU/6Qg9pJ/WWgwY0s4w5i1UG+B FqB3CISK14AsRg8ZzgELUbTgyCaDDFM17sk0DtD10Q8IJxQUZsGGyrPM+/1AvtXktRf+ 0iBvMcAz5dGqw+K++xssWamwiZ76wX3rqX2njrvm57VUg6Fpk3NlU2yFAfBhtrls54Mc 98jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baikalelectronics.ru header.s=post header.b=g4NndmnT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=baikalelectronics.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y2-20020a50e602000000b0048bd3a68aa1si20155797edm.171.2023.01.13.09.28.45; Fri, 13 Jan 2023 09:28:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@baikalelectronics.ru header.s=post header.b=g4NndmnT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=baikalelectronics.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229686AbjAMR01 (ORCPT + 51 others); Fri, 13 Jan 2023 12:26:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231264AbjAMRX7 (ORCPT ); Fri, 13 Jan 2023 12:23:59 -0500 Received: from post.baikalelectronics.com (post.baikalelectronics.com [213.79.110.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B7291A4C75; Fri, 13 Jan 2023 09:14:45 -0800 (PST) Received: from post.baikalelectronics.com (localhost.localdomain [127.0.0.1]) by post.baikalelectronics.com (Proxmox) with ESMTP id E04AEE0F2F; Fri, 13 Jan 2023 20:14:37 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= baikalelectronics.ru; h=cc:cc:content-transfer-encoding :content-type:content-type:date:from:from:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=post; bh=ShlLyppeLQtb7T6fwIeGywjfZSVNMRyBEPj0UpV2Cxk=; b=g4NndmnTbR/O 9TPYxPWkt8bjsKL2cUpaTSFzBjyGph5YVhUTPWVvImlqa/wdrpnHGsQGY4LXK+Sb emUZmj41YkhZonumS6dQJfHW1epKP9+XL24b8S3/oXMGZq+zblHkFSBAJTstcwSl +9ITOKRhhSCy9buXOfaGhT56kAIdtaY= Received: from mail.baikal.int (mail.baikal.int [192.168.51.25]) by post.baikalelectronics.com (Proxmox) with ESMTP id C508DE0F13; Fri, 13 Jan 2023 20:14:37 +0300 (MSK) Received: from localhost (10.8.30.26) by mail (192.168.51.25) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 13 Jan 2023 20:14:37 +0300 From: Serge Semin To: Gustavo Pimentel , Vinod Koul , Rob Herring , Bjorn Helgaas , Lorenzo Pieralisi , Cai Huoqing , Robin Murphy , Jingoo Han , Frank Li , Manivannan Sadhasivam CC: Serge Semin , Serge Semin , Alexey Malahov , Pavel Parkhomenko , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , caihuoqing , Yoshihiro Shimoda , , , Subject: [PATCH v9 24/27] dmaengine: dw-edma: Relax driver config settings Date: Fri, 13 Jan 2023 20:14:06 +0300 Message-ID: <20230113171409.30470-25-Sergey.Semin@baikalelectronics.ru> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113171409.30470-1-Sergey.Semin@baikalelectronics.ru> References: <20230113171409.30470-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.8.30.26] X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since the DW PCIe RP/EP driver is about to be updated to register the DW eDMA-based DMA-engine the drivers build modes must be synchronized. Currently the DW PCIe RP/EP driver is always built as a builtin module. Meanwhile the DW eDMA driver can be built as a loadable module. Thus in the later case the kernel with DW PCIe controllers support will fail to be linked due to lacking the DW eDMA probe/remove symbols. At the same time forcibly selecting the DW eDMA driver from the DW PCIe RP/EP kconfig will effectively eliminate the tristate type of the former driver fixing it to just the builtin kernel module. Seeing the DW eDMA engine isn't that often met built into the DW PCIe Root-ports and End-points let's convert the DW eDMA driver config to being more flexible instead of just forcibly selecting the DW eDMA kconfig. In order to do that first the DW eDMA PCIe driver config should be converted to being depended from the DW eDMA core config instead of selecting the one. Second the DW eDMA probe and remove symbols should be referenced only if they are reachable by the caller. Thus the user will be able to build the DW eDMA core driver with any type, meanwhile the dependent code will be either restricted to the same build type (e.g. DW eDMA PCIe driver if DW eDMA driver is built as a loadable module) or just won't be able to use the eDMA engine registration/de-registration functionality (e.g. DW PCIe RP/EP driver if DW eDMA driver is built as a loadable module). Signed-off-by: Serge Semin --- Changelog v8: - This is a new patch added on v8 stage of the series in order to fix the tbot-reported build issues. (@tbot) --- drivers/dma/dw-edma/Kconfig | 5 ++++- include/linux/dma/edma.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/dma/dw-edma/Kconfig b/drivers/dma/dw-edma/Kconfig index 7ff17b2db6a1..2b6f2679508d 100644 --- a/drivers/dma/dw-edma/Kconfig +++ b/drivers/dma/dw-edma/Kconfig @@ -9,11 +9,14 @@ config DW_EDMA Support the Synopsys DesignWare eDMA controller, normally implemented on endpoints SoCs. +if DW_EDMA + config DW_EDMA_PCIE tristate "Synopsys DesignWare eDMA PCIe driver" depends on PCI && PCI_MSI - select DW_EDMA help Provides a glue-logic between the Synopsys DesignWare eDMA controller and an endpoint PCIe device. This also serves as a reference design to whom desires to use this IP. + +endif # DW_EDMA diff --git a/include/linux/dma/edma.h b/include/linux/dma/edma.h index 08833f12b386..c062c8db472c 100644 --- a/include/linux/dma/edma.h +++ b/include/linux/dma/edma.h @@ -101,7 +101,7 @@ struct dw_edma_chip { }; /* Export to the platform drivers */ -#if IS_ENABLED(CONFIG_DW_EDMA) +#if IS_REACHABLE(CONFIG_DW_EDMA) int dw_edma_probe(struct dw_edma_chip *chip); int dw_edma_remove(struct dw_edma_chip *chip); #else -- 2.39.0