Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp848440rdg; Fri, 13 Oct 2023 03:06:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEoG6oyE7Pwa8bNIcUstzA+d+xW6HtoEauLc8kX/C5j6OJAZJCf7klkLku545fY0OshRyut X-Received: by 2002:a17:90a:d3c8:b0:274:77b3:64d0 with SMTP id d8-20020a17090ad3c800b0027477b364d0mr34291429pjw.17.1697191592561; Fri, 13 Oct 2023 03:06:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697191592; cv=none; d=google.com; s=arc-20160816; b=rCR3ULOr5Kruo+ruCySJDojZfv/UKk3Hq2yL77qRvsBIUCuAjTilc9zGW4Hk7JSzbg xurZ9vmF91JCT2U8x1AbNJzk4cP/wWtP1wQjP80NRxGFSnEfNCxVfW8GCEWfILdaJX97 bO9Ytbaf6Rr1PD0lWUeez1cGgocucAX7PNafvg77x4qFS19yZ1zlM7YsvckRcJm5XOif fGUgD8HCTkbZKBmO28Pfp7PYKKLWeV/QhE5lFjupHJ542EY+vY6nfUA01oaBuFw5gNFL NfmZLP8YkfFmSxgJt9H+fJWPoP4+0+hzWOi/ssEBtQT+tFFKzbX/FEwPVeIARfOu89xO nMcg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=afm5I4zNUAuNxC8GzJdXHOSHi6pcLExp9ZdF1yWwCUQ=; fh=NAZPQCmIsGlVvVvRa87iSv/NvT0xAyRO327hvkwmfWc=; b=DrB7x5Q26sBmGOXacWF5lcufLam6pXgsXhrVFFdVcjmLjveML6v1eVQKjVpwVPB6XV mABh2VsoTAH6Eo6TRxxspFbVXN7CTB+NngGrdGpHg9goOylXv5eYhdtlGC0tCVNjqaCZ juntfBtqnpj3t19q1LKDNQUsz4kv1ew9oqd2GTOtmrmZMbLP1s+SqyE/5iWArSI3/CXO 5VDmvpgrIWArjF1CmPiVmpEruzohnMB8KXOauyN5WXbYfKf89AgdZ+FsIQmqCCnfTqhq JtPNRD0ZeuUKGSbpetIdiMkdYR1437CxsBz+SwVmhUNpV9G3jEWeLTr3rykovSgZat+r 0jZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=CQ0eK1bX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id om9-20020a17090b3a8900b0027d22d5aa7esi3512968pjb.46.2023.10.13.03.06.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 03:06:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=CQ0eK1bX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 0015D829EA2F; Fri, 13 Oct 2023 03:06:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230523AbjJMKGY (ORCPT + 99 others); Fri, 13 Oct 2023 06:06:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230179AbjJMKGX (ORCPT ); Fri, 13 Oct 2023 06:06:23 -0400 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFCAAAD; Fri, 13 Oct 2023 03:06:20 -0700 (PDT) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 39DA5vQB089050; Fri, 13 Oct 2023 05:05:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1697191558; bh=afm5I4zNUAuNxC8GzJdXHOSHi6pcLExp9ZdF1yWwCUQ=; h=From:To:CC:Subject:Date; b=CQ0eK1bXU7jTJa6ntX1Xpc7aWO/5mUpdmR+zkOVpl4p/fG/CSrsduxclIA1djicVV tJEgOFonTX5Ei/QUoSvGVpS4piUk8ETvX+BIqDRMo2Kl7gAZWCX9GzWR7CDIRVbOut S4qM3gcaNpb/yamM+dppZ1Ml4aI2zL0ASR3owiG8= Received: from DLEE106.ent.ti.com (dlee106.ent.ti.com [157.170.170.36]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 39DA5v47007810 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 13 Oct 2023 05:05:57 -0500 Received: from DLEE115.ent.ti.com (157.170.170.26) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Fri, 13 Oct 2023 05:05:57 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Fri, 13 Oct 2023 05:05:57 -0500 Received: from lelv0854.itg.ti.com (lelv0854.itg.ti.com [10.181.64.140]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 39DA5vJC124553; Fri, 13 Oct 2023 05:05:57 -0500 Received: from localhost (dhcp-10-24-69-31.dhcp.ti.com [10.24.69.31]) by lelv0854.itg.ti.com (8.14.7/8.14.7) with ESMTP id 39DA5uUH007169; Fri, 13 Oct 2023 05:05:56 -0500 From: MD Danish Anwar To: Andrew Lunn , Arnd Bergmann , Wolfram Sang , Simon Horman , Roger Quadros , Vignesh Raghavendra , MD Danish Anwar , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" CC: , , , , Roger Quadros Subject: [PATCH net] net: ethernet: ti: Fix mixed module-builtin object Date: Fri, 13 Oct 2023 15:35:49 +0530 Message-ID: <20231013100549.3198564-1-danishanwar@ti.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 13 Oct 2023 03:06:30 -0700 (PDT) With CONFIG_TI_K3_AM65_CPSW_NUSS=y and CONFIG_TI_ICSSG_PRUETH=m, k3-cppi-desc-pool.o is linked to a module and also to vmlinux even though the expected CFLAGS are different between builtins and modules. The build system is complaining about the following: k3-cppi-desc-pool.o is added to multiple modules: icssg-prueth ti-am65-cpsw-nuss Introduce the new module, k3-cppi-desc-pool, to provide the common functions to ti-am65-cpsw-nuss and icssg-prueth. Signed-off-by: MD Danish Anwar --- drivers/net/ethernet/ti/Kconfig | 5 +++++ drivers/net/ethernet/ti/Makefile | 7 ++++--- drivers/net/ethernet/ti/k3-cppi-desc-pool.c | 7 +++++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/ti/Kconfig b/drivers/net/ethernet/ti/Kconfig index 0784a3d0bbff..e60b557d59b9 100644 --- a/drivers/net/ethernet/ti/Kconfig +++ b/drivers/net/ethernet/ti/Kconfig @@ -90,12 +90,16 @@ config TI_CPTS The unit can time stamp PTP UDP/IPv4 and Layer 2 packets, and the driver offers a PTP Hardware Clock. +config TI_K3_CPPI_DESC_POOL + tristate + config TI_K3_AM65_CPSW_NUSS tristate "TI K3 AM654x/J721E CPSW Ethernet driver" depends on ARCH_K3 && OF && TI_K3_UDMA_GLUE_LAYER select NET_DEVLINK select TI_DAVINCI_MDIO select PHYLINK + select TI_K3_CPPI_DESC_POOL imply PHY_TI_GMII_SEL depends on TI_K3_AM65_CPTS || !TI_K3_AM65_CPTS help @@ -180,6 +184,7 @@ config TI_ICSSG_PRUETH tristate "TI Gigabit PRU Ethernet driver" select PHYLIB select TI_ICSS_IEP + select TI_K3_CPPI_DESC_POOL depends on PRU_REMOTEPROC depends on ARCH_K3 && OF && TI_K3_UDMA_GLUE_LAYER help diff --git a/drivers/net/ethernet/ti/Makefile b/drivers/net/ethernet/ti/Makefile index e38ec9d6c99b..27de1d697134 100644 --- a/drivers/net/ethernet/ti/Makefile +++ b/drivers/net/ethernet/ti/Makefile @@ -23,14 +23,15 @@ keystone_netcp-y := netcp_core.o cpsw_ale.o obj-$(CONFIG_TI_KEYSTONE_NETCP_ETHSS) += keystone_netcp_ethss.o keystone_netcp_ethss-y := netcp_ethss.o netcp_sgmii.o netcp_xgbepcsr.o cpsw_ale.o +obj-$(CONFIG_TI_K3_CPPI_DESC_POOL) += k3-cppi-desc-pool.o + obj-$(CONFIG_TI_K3_AM65_CPSW_NUSS) += ti-am65-cpsw-nuss.o -ti-am65-cpsw-nuss-y := am65-cpsw-nuss.o cpsw_sl.o am65-cpsw-ethtool.o cpsw_ale.o k3-cppi-desc-pool.o am65-cpsw-qos.o +ti-am65-cpsw-nuss-y := am65-cpsw-nuss.o cpsw_sl.o am65-cpsw-ethtool.o cpsw_ale.o am65-cpsw-qos.o ti-am65-cpsw-nuss-$(CONFIG_TI_K3_AM65_CPSW_SWITCHDEV) += am65-cpsw-switchdev.o obj-$(CONFIG_TI_K3_AM65_CPTS) += am65-cpts.o obj-$(CONFIG_TI_ICSSG_PRUETH) += icssg-prueth.o -icssg-prueth-y := k3-cppi-desc-pool.o \ - icssg/icssg_prueth.o \ +icssg-prueth-y := icssg/icssg_prueth.o \ icssg/icssg_classifier.o \ icssg/icssg_queues.o \ icssg/icssg_config.o \ diff --git a/drivers/net/ethernet/ti/k3-cppi-desc-pool.c b/drivers/net/ethernet/ti/k3-cppi-desc-pool.c index 38cc12f9f133..1d9b456edff4 100644 --- a/drivers/net/ethernet/ti/k3-cppi-desc-pool.c +++ b/drivers/net/ethernet/ti/k3-cppi-desc-pool.c @@ -39,6 +39,7 @@ void k3_cppi_desc_pool_destroy(struct k3_cppi_desc_pool *pool) gen_pool_destroy(pool->gen_pool); /* frees pool->name */ } +EXPORT_SYMBOL_GPL(k3_cppi_desc_pool_destroy); struct k3_cppi_desc_pool * k3_cppi_desc_pool_create_name(struct device *dev, size_t size, @@ -98,29 +99,35 @@ k3_cppi_desc_pool_create_name(struct device *dev, size_t size, devm_kfree(pool->dev, pool); return ERR_PTR(ret); } +EXPORT_SYMBOL_GPL(k3_cppi_desc_pool_create_name); dma_addr_t k3_cppi_desc_pool_virt2dma(struct k3_cppi_desc_pool *pool, void *addr) { return addr ? pool->dma_addr + (addr - pool->cpumem) : 0; } +EXPORT_SYMBOL_GPL(k3_cppi_desc_pool_virt2dma); void *k3_cppi_desc_pool_dma2virt(struct k3_cppi_desc_pool *pool, dma_addr_t dma) { return dma ? pool->cpumem + (dma - pool->dma_addr) : NULL; } +EXPORT_SYMBOL_GPL(k3_cppi_desc_pool_dma2virt); void *k3_cppi_desc_pool_alloc(struct k3_cppi_desc_pool *pool) { return (void *)gen_pool_alloc(pool->gen_pool, pool->desc_size); } +EXPORT_SYMBOL_GPL(k3_cppi_desc_pool_alloc); void k3_cppi_desc_pool_free(struct k3_cppi_desc_pool *pool, void *addr) { gen_pool_free(pool->gen_pool, (unsigned long)addr, pool->desc_size); } +EXPORT_SYMBOL_GPL(k3_cppi_desc_pool_free); size_t k3_cppi_desc_pool_avail(struct k3_cppi_desc_pool *pool) { return gen_pool_avail(pool->gen_pool) / pool->desc_size; } +EXPORT_SYMBOL_GPL(k3_cppi_desc_pool_avail); base-commit: e8c127b0576660da9195504fe8393fe9da3de9ce -- 2.34.1