Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7932641rwb; Wed, 23 Nov 2022 12:50:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf6O5CUTKUu03xwMCZKG/DRnWSFjr5nCzRuMhMjuWUGP+09qBB1ltBx47j0bDvjVdvBXfjHI X-Received: by 2002:a05:6402:b47:b0:469:7b55:df60 with SMTP id bx7-20020a0564020b4700b004697b55df60mr9524618edb.179.1669236609024; Wed, 23 Nov 2022 12:50:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669236609; cv=none; d=google.com; s=arc-20160816; b=FXP6QF7nqW0iCqH6iTWREFg9GF2dT5bsK/3gN3OZczYWpKwIHtxFcOUgCT413xwLl9 pufThlO+bL26VK7QiykHDEg7Qe+u++PdUaijthQrL9fPBpqm7gpFCozSIdn4bQqmlvqi Yf3JpGUsE6QUcTXngfZMvC1W1soTMxJvB0tYiTwwYUPmMvgq1Nq2srliDbgoJpFDQG9u eaGTVV3NjuRrGB5t1vw5H68j1FbcvOx9z+ldi5Ouz3nJ+G4gLlqfxF8jeiLZQ7JWIYM/ ZbNXnlD/RDLlFBIxiuYFWQbcZYc5yeZCk+WveqIPq14R7TRYJMZo7xYJu0+FVDSjliyS c1LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature:dkim-filter; bh=mVFr1xC2ioTgngdZFkHFtRlUINTf8FXweXN3/wsapu4=; b=HGPCHqYTTPovUxXbI92fjIlrdin/hQ59wlQvQoNCj410WQCE70bBM7abspj5MgGQG7 vILjb6KWXyEQmHcKQ1YrUUUJ/HfQV7oEIKTQeGQ4SL6GoG2ZuIVy2wJIu6E3L+tfGcGl TMWShbGLehnrtCaN/XiGRafHHewWzVX9Q5PIALySS8NaItB5uKf2VsowyDuT/YLRjOah APGHEQTCPmHUf4spraa3RTmt1Fu1kXh8qt3nt4B+wX/K8Rz2o/V6xtfQ3+4eOc7Xh32B +mY+81KkiUKJp8GJzjFdrdwv6++TJNkcqEdbFGb0jaLEnSRvwuqWqKLnaPUoT9ouM/9w mLdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=BkpqQaWq; 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 r2-20020aa7cb82000000b0046187ab5c1bsi598102edt.512.2022.11.23.12.49.47; Wed, 23 Nov 2022 12:50:09 -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=@nifty.com header.s=dec2015msa header.b=BkpqQaWq; 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 S237385AbiKWUjQ (ORCPT + 89 others); Wed, 23 Nov 2022 15:39:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240249AbiKWUiP (ORCPT ); Wed, 23 Nov 2022 15:38:15 -0500 Received: from conssluserg-05.nifty.com (conssluserg-05.nifty.com [210.131.2.90]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 562D326FB; Wed, 23 Nov 2022 12:38:14 -0800 (PST) Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com [209.85.210.42]) (authenticated) by conssluserg-05.nifty.com with ESMTP id 2ANKbqXm003059; Thu, 24 Nov 2022 05:37:52 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-05.nifty.com 2ANKbqXm003059 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1669235872; bh=mVFr1xC2ioTgngdZFkHFtRlUINTf8FXweXN3/wsapu4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=BkpqQaWqqluKEXuWSDULXhY96Qu/GVqi3/DNuaMSpIN0Ly5wolN7OUDQjIPErIzRL vAjbt4gheMINVwoP4W2ha8zD63CHrcJs9rgijnXBYyNsDHWMAv7nY/J5jeMYIGMpXV 4CT0rizpbhz6uRknujkF1czCt8i8UDht2oB8Jk3/Zs1AeXXyf02rcYmPW9SsyHpwEW 3ZNEApwuT5nzntHe3A9NZs42QjQEXD07pbeXCpMLpE8heYWcynSH1RUoKbL/NnpAQ5 5VGtHMx05iuUB8ysPSFsI6rIdcVbDJnUpjqNcAEZ3scosaD9Zp7KkZGhrZZiR9jkFQ Vo6cAC7DU703g== X-Nifty-SrcIP: [209.85.210.42] Received: by mail-ot1-f42.google.com with SMTP id p10-20020a9d76ca000000b0066d6c6bce58so11936404otl.7; Wed, 23 Nov 2022 12:37:52 -0800 (PST) X-Gm-Message-State: ANoB5plEzXPM/DuMbXpr2KcewdX0tecMXFVjFXJY7Cw/SNpYJsd98V9O f6GCJJw1qad80OuzF4LoRp+tlWVIDA0ECsAzuY0= X-Received: by 2002:a05:6830:1b67:b0:661:8d9e:1959 with SMTP id d7-20020a0568301b6700b006618d9e1959mr15509730ote.225.1669235871346; Wed, 23 Nov 2022 12:37:51 -0800 (PST) MIME-Version: 1.0 References: <20221119225650.1044591-1-alobakin@pm.me> <20221119225650.1044591-19-alobakin@pm.me> In-Reply-To: <20221119225650.1044591-19-alobakin@pm.me> From: Masahiro Yamada Date: Thu, 24 Nov 2022 05:37:15 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 18/18] net: cpsw: fix mixed module-builtin object To: Alexander Lobakin Cc: linux-kbuild@vger.kernel.org, Nicolas Schier , Jens Axboe , Boris Brezillon , Borislav Petkov , Tony Luck , Miquel Raynal , Vladimir Oltean , Alexandre Belloni , Derek Chickles , Ioana Ciornei , Salil Mehta , Sunil Goutham , Grygorii Strashko , Daniel Scally , Hans de Goede , Mark Brown , Andy Shevchenko , NXP Linux Team , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no 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 Sun, Nov 20, 2022 at 8:11 AM Alexander Lobakin wrote: > > Apart from cpdma, there are 4 object files shared in one way or > another by 5 modules: > > > scripts/Makefile.build:252: ./drivers/net/ethernet/ti/Makefile: > > cpsw_ale.o is added to multiple modules: keystone_netcp > > keystone_netcp_ethss ti_cpsw ti_cpsw_new > > scripts/Makefile.build:252: ./drivers/net/ethernet/ti/Makefile: > > cpsw_ethtool.o is added to multiple modules: ti_cpsw ti_cpsw_new > > scripts/Makefile.build:252: ./drivers/net/ethernet/ti/Makefile: > > cpsw_priv.o is added to multiple modules: ti_cpsw ti_cpsw_new > > scripts/Makefile.build:252: ./drivers/net/ethernet/ti/Makefile: > > cpsw_sl.o is added to multiple modules: ti_cpsw ti_cpsw_new > > All of those five are tristate, that means with some of the > corresponding Kconfig options set to `m` and some to `y`, the same > objects are linked to a module and also to vmlinux even though the > expected CFLAGS are different between builtins and modules. > This is the same situation as fixed by > commit 637a642f5ca5 ("zstd: Fixing mixed module-builtin objects"). > There's also no need to duplicate the same code 4 x 5 = roughly 20 > times. > > Introduce the new module, ti_cpsw_core, to provide the common > functions used by all those modules. > > Fixes: 16f54164828b ("net: ethernet: ti: cpsw: drop CONFIG_TI_CPSW_ALE config option") > Fixes: a8577e131266 ("net: ethernet: ti: netcp_ethss: fix build") > Fixes: ed3525eda4c4 ("net: ethernet: ti: introduce cpsw switchdev based driver part 1 - dual-emac") > Fixes: 93a76530316a ("net: ethernet: ti: introduce am65x/j721e gigabit eth subsystem driver") > Suggested-by: Masahiro Yamada > Signed-off-by: Alexander Lobakin > --- > drivers/net/ethernet/ti/Kconfig | 11 ++++++-- > drivers/net/ethernet/ti/Makefile | 12 ++++---- > drivers/net/ethernet/ti/am65-cpsw-nuss.c | 2 ++ > drivers/net/ethernet/ti/cpsw.c | 1 + > drivers/net/ethernet/ti/cpsw_ale.c | 20 +++++++++++++ > drivers/net/ethernet/ti/cpsw_ethtool.c | 24 ++++++++++++++++ > drivers/net/ethernet/ti/cpsw_new.c | 1 + > drivers/net/ethernet/ti/cpsw_priv.c | 36 ++++++++++++++++++++++++ > drivers/net/ethernet/ti/cpsw_sl.c | 8 ++++++ > drivers/net/ethernet/ti/netcp_core.c | 2 ++ > drivers/net/ethernet/ti/netcp_ethss.c | 2 ++ > 11 files changed, 112 insertions(+), 7 deletions(-) As I commented on 09/18, maybe 09/18 and 18/18 can be merged. -- Best Regards Masahiro Yamada