Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3369219rwb; Fri, 20 Jan 2023 15:16:15 -0800 (PST) X-Google-Smtp-Source: AMrXdXsvi6J88rdm9e8Ea5ACwfAiJSrOejhIqnCmKKoDheY9JG3axthTxVCTRIeWAZnXVHlu0XWB X-Received: by 2002:a17:902:e5d2:b0:194:52ed:7a16 with SMTP id u18-20020a170902e5d200b0019452ed7a16mr19811448plf.24.1674256574880; Fri, 20 Jan 2023 15:16:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674256574; cv=none; d=google.com; s=arc-20160816; b=WzUxVH7BOxaJyFEaEyKuBjW0EwvjQ4JCr1F9ihSSaH8vDktktT/9vHqY9X1EjZgs9l jaaJLvjWu2WVWiRLnhwqmjM/iLINp85ucCe7RZ2iPd5ys4WgTCD9lLS8tps4AR738dOt W8XrNS1et9DaUHBED+0dFHhUioExkAG1hNUmuW6mFA3XSW+Z9Hike1CnGfrGiyAbAPHQ BSek0tTNv3emsjy8wxmo2JDTH1OVJs6p8yJv6VWtu5a5R/ltldarCgiTSgtnjk1cxbMd eilfGuy7QYKGWZFx4wUB884rpulJnpQvoNwWdCrv82ZNqr5jTthJYmv1EgMg61cGkEGL FgBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=dl+NuoTpYjTErndUPudMTbyxCGdoKZflTs2JKKl1wRM=; b=y+isYKsT6xZ/TczyKWaTHWN2VC82H0nuMqjp1zzaYevyaH0nwGQKu3cWcmPbejh0TY 1bOYzstVOBefWBn6C1y2u0CIpxfoSL/g1pMgvYme2lDQx/M+sRWOemy/eXPWZJi/OfIi xm9gobgXHN5Sh9LpaYl3K0+FcO3m8USR00z7D6yNQcAjQ8XoDEBFmcIUKa7CdvaojRi4 +JNq6JxBz8pMxl6MmgHJyz8Zv/wilZtq0aD7+qOCnLhAQyr5FNgWdU3pTtw+4Vo06gFU 491renyXoYblumf0uG4X7HfU3811+WOZRdomVLvsproyBP0sq8WsA6hzx8CJX+LNoL4i 3wpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Cri+LDWe; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b5-20020a170902e94500b001949ad4bd39si14344159pll.45.2023.01.20.15.16.08; Fri, 20 Jan 2023 15:16:14 -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=@kernel.org header.s=k20201202 header.b=Cri+LDWe; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230085AbjATXBD (ORCPT + 52 others); Fri, 20 Jan 2023 18:01:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229556AbjATXBC (ORCPT ); Fri, 20 Jan 2023 18:01:02 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A7DC138; Fri, 20 Jan 2023 15:01:01 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 288A4620DA; Fri, 20 Jan 2023 22:50:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13245C4339B; Fri, 20 Jan 2023 22:50:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674255039; bh=MEdkFA0CPMoJscWoRwMiBqN7i9caRkJzCfAwCleyJBM=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=Cri+LDWeo4rXCVffkOhl0j+sWK07Fp2yQcqaMuEawSDbifPcfQUJZuVEQWJLwa1HD c424ZkNCraz6HaYhRNELpNgqjlXO55voAttvTzJ3pUB3I8WZiB5QEl+YiqgHGMHRq7 tzbemNT+uETzFml8ak36pciA7JA1Arzq9ku0HJ5qlauwJ9q3rSe8VnLOq+dqXYneRR fNSEuNUopH8Py9GqYLW+crM1AboGkbO3eTrJDdrjPv6mb3QejrYQzOgaFNICoKwdXj kwmolb2aWC5kgblDsSfi1k4a3g2qMD1NYFGeauvNsp7tSGj/rp5CW2scUwxWvSvZh3 jv019LHBM3XTw== Date: Fri, 20 Jan 2023 16:50:36 -0600 From: Bjorn Helgaas To: Serge Semin Cc: Gustavo Pimentel , Vinod Koul , Rob Herring , Bjorn Helgaas , Lorenzo Pieralisi , Cai Huoqing , Robin Murphy , Jingoo Han , Frank Li , Manivannan Sadhasivam , Serge Semin , Alexey Malahov , Pavel Parkhomenko , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , caihuoqing , Yoshihiro Shimoda , linux-pci@vger.kernel.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v9 24/27] dmaengine: dw-edma: Relax driver config settings Message-ID: <20230120225036.GA675763@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230113171409.30470-25-Sergey.Semin@baikalelectronics.ru> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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 On Fri, Jan 13, 2023 at 08:14:06PM +0300, Serge Semin wrote: > 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). I'm trying to write the merge commit log, and I understand the linking issue, but I'm having a hard time figuring out what the user-visible scenarios are here. I assume there's something that works when CONFIG_PCIE_DW=y and CONFIG_DW_EDMA_PCIE=y but does *not* work when CONFIG_PCIE_DW=y and CONFIG_DW_EDMA_PCIE=m? If both scenarios worked the same, I would think the existing dw_edma_pcie_probe() would be enough, and you wouldn't need to call dw_pcie_edma_detect() from dw_pcie_host_init() and dw_pcie_ep_init(). > 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 > >