From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A051C433E0 for ; Wed, 24 Jun 2020 02:21:56 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 077AA20836 for ; Wed, 24 Jun 2020 02:21:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jfGMGUbl"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="gN0a+k9a" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 077AA20836 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=faGvOJvPWfmGkOshkS4hA8eyEvePYu19FNNIYBAtsB4=; b=jfGMGUbl/0//jIMQki3k0hNvz jWnxK3QxZU/9XDnAVd6+iSb1cxd9htVtHUbBaLYqzgYiG50JfDB9jI6ltwyfufPL1ra3hdG1aSB43 hC0dl6RdlBUqTWTac35NNaX/9Og09EKHEGKuYY+4ltuBH9bpmz9oM2mabUnzGsXTVbcsS4MvQ2O2F FNrwpgMXXrI8EQV9qvS0m4dzDcAqDtKNeeErsWMfJ07f1cuvEwLez5ef0GuWjhUj4b76qolHNvaUI cbxorzZGWuuejBcfEupwVnlerFnjN0/iX1gjgpBmyVPA9iM3cpLofwmseeFlhxLneJ7D6w5qkT4I8 dAQ8Y/jlg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnv16-0007ja-Dy; Wed, 24 Jun 2020 02:20:01 +0000 Received: from mail-am6eur05on2087.outbound.protection.outlook.com ([40.107.22.87] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnv12-0007i1-PS for linux-arm-kernel@lists.infradead.org; Wed, 24 Jun 2020 02:19:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QMTYTc6ZuCnHg5wKpkyM2kyzyaucpLG4s3G6JWCgd5hvN01CxIivy9vZFxMMl98UQ+Mka288MTgGDZK3jHrCdYexZnrYga2CA1p0SkoE7bm5KtOXp3qf3QYipNKnKp+9t5mqXcUAPuXHNPUCM2GXjRLlYJGwCiPXbyzIZn+s9b426Pck74wp0eVV5TLinvWP/Z1iWes2YlDoiMcy+a077xAHhcA91pEy6kd7+RFlcKTE8CceY9qMsoCm8YU6XSQw84u64/N69rjVqGaax0uc2XEij9m/op3sN+jODnk13jt9Avkg2HfBfFugYunrl/qjCP6SHBOi4goWObU9cM1XSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=b+l83VyL3VZ/BhA8XymDwRpNGEUOJE16kw3dq/PVe/E=; b=YZGUk2IQKfb0yYapaHkxcq/6uu/5ico77Fnc3AN/F2TFoff4tFbvex/KKLz6cMo8a4Rlptl0CkON2OXKYlROxaFuW1+3g0P4Nf9YsOIMfcKVXDiNyKXaDoYZ4pKbIUUSeeVolQeE2ClQOMopDDnWAiu1l/IoUv7Y6s/V5OI2/oUkvsGPl0x63lcL8P4/hgedwZ16MeMasWrF+zcvkKwdwfbPp3NnujMgJtatCV8A0CQWdo83TxLYZNi7Ubh/C1JnP3V7GfFpiDDJVQtFCEi9zWUDvrXU+hJvqhLWzD+prWu50EoXmGjYdhTlPIFIa34sYe4nSro1b7LltcLedzyzCg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=b+l83VyL3VZ/BhA8XymDwRpNGEUOJE16kw3dq/PVe/E=; b=gN0a+k9a2LPJbxxs5OldmFoALdGWk4ViDsFxXiRR7wTNjH0JPhe4ZGGSpmW69NpQ2aCsY9xftu7wQ6Gc36y7v8iiotziV3bwPkIs4FtmF8SO4w+TTogfWSRiHZFlAqG1bEOVHtVDgQvZmLnfbsTCCLX014FGMyyacxqfUIjjxKU= Received: from AM6PR04MB4966.eurprd04.prod.outlook.com (2603:10a6:20b:2::14) by AM6PR04MB5349.eurprd04.prod.outlook.com (2603:10a6:20b:9b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.20; Wed, 24 Jun 2020 02:19:51 +0000 Received: from AM6PR04MB4966.eurprd04.prod.outlook.com ([fe80::3c6c:a0e9:9a4e:c51d]) by AM6PR04MB4966.eurprd04.prod.outlook.com ([fe80::3c6c:a0e9:9a4e:c51d%7]) with mapi id 15.20.3109.027; Wed, 24 Jun 2020 02:19:51 +0000 From: Aisheng Dong To: Stephen Boyd , Abel Vesa , Andy Duan , Anson Huang , Daniel Baluta , Leonard Crestez , Peng Fan , Stefan Agner , "allison@lohutok.net" , "arnd@arndb.de" , "festevam@gmail.com" , "gregkh@linuxfoundation.org" , "info@metux.net" , "kernel@pengutronix.de" , "linux-arm-kernel@lists.infradead.org" , "linux-clk@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux@armlinux.org.uk" , "mturquette@baylibre.com" , "oleksandr.suvorov@toradex.com" , "s.hauer@pengutronix.de" , "sfr@canb.auug.org.au" , "shawnguo@kernel.org" , "tglx@linutronix.de" , "yuehaibing@huawei.com" Subject: RE: [PATCH V2 3/9] clk: imx: Support building SCU clock driver as module Thread-Topic: [PATCH V2 3/9] clk: imx: Support building SCU clock driver as module Thread-Index: AQHWPjGl8KdpudYoFUWSs6/zaZS5vqjcqcVQgAAe9YCAAOIhAIADPk4AgASxvPCAAFrbAIAAAT6wgAERl4CAABTeEA== Date: Wed, 24 Jun 2020 02:19:51 +0000 Message-ID: References: <1591687933-19495-1-git-send-email-Anson.Huang@nxp.com> <1591687933-19495-4-git-send-email-Anson.Huang@nxp.com> <159262367025.62212.11651547971712516448@swboyd.mtv.corp.google.com> <159290125202.62212.13172213909023205615@swboyd.mtv.corp.google.com> <159296027133.62212.18074403520585879907@swboyd.mtv.corp.google.com> In-Reply-To: <159296027133.62212.18074403520585879907@swboyd.mtv.corp.google.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=nxp.com; x-originating-ip: [119.31.174.67] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 4e33d1d0-87d3-4542-eedf-08d817e51379 x-ms-traffictypediagnostic: AM6PR04MB5349: x-ld-processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-forefront-prvs: 0444EB1997 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 2Pnc6XOMGF9HiDKrFhKEQ0btde7jRlbnDJ7HxvanDILoA499lGKsfiSjYTargHhat0NrAtxU//hWYpvCfETS3v3O9eDKJgqqxc4xh15iSC8KmmEhpGQfiu47QfYu6rga5Pbw8XgZJFcJQdw1lIgWnlAMc3i5oOFpvrYnm0uK4O1FGWQljrgQaPjBPYigtLrFHsie1Q5hoQzosQ4O4m9U954oW2nH0Ewez/45rv+8RTcnDxaDXfD4ry+gHGBRFd0H0jmtekuUyUr/aplyMrKKaTyyX1k0hUxH3RcRx0bY4xefC5sXc2Bd5F90qSdU/i6O8Ez4JkgPTv56AtkGAN58sBTzVdxOgQxCedEGNMn/6XnwrAjG/hm/FH4ed5TBspP4ObWEgsplDjgS9vEnx13jPQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB4966.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(396003)(346002)(39860400002)(366004)(136003)(376002)(52536014)(7696005)(53546011)(5660300002)(71200400001)(316002)(86362001)(9686003)(110136005)(7416002)(6506007)(478600001)(4326008)(8936002)(76116006)(66446008)(64756008)(33656002)(66946007)(66476007)(8676002)(66556008)(44832011)(26005)(83380400001)(186003)(2906002)(55016002)(921003)(21314003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: YAFm7iVWPKLuvYSadUGd9fwD6n6hxDU3BIy9c7P/MZI07id5m7sSn3cRNvYSBcOG3mBxCHzHPxBFXVR5cqb6e5uEpBDYNFsDimBsz5GNZsReYRb4QB+V1Np1TOpwI41ikpPkodC6z9K36d8tlx2wwwJVs5SywPyUxKCyCt2EH3ngc2daFopHo7T7zbEsFr7wJV0j+hnUbtls97+3VLA9HEFcP/NdEZIpYoePkc6fiG4GHfrsaMlMvUSZkL+D0HWjpfLobKsfhquPbOJV61ZbP17SKGtrQcvhoOnljydN1P80kW991QbqClP1QI+cVDZ1k2V7EfmI4Yq+dhrIZYPIw3gwR/MGzz9c2+KpcB5vnal0EP8RaEsy7qR80NmuJs3xQu9aoR9j/6yUsZTdK9UaXMiAGrlXi5Jf4hYFEbc9BLmR3bhbiQSv7U04OJttQqbEl3ThCURsC+nwwewZjCSMbHgW70SVVrUe42ZaahAW0uQ= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4966.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4e33d1d0-87d3-4542-eedf-08d817e51379 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jun 2020 02:19:51.3903 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: W8UD1U73WDTpNCfLyzIbXjel9UCLCvBSZsZFYkD8038tiGpkN1wK1JkypWRwuUUXKRmbhxod64B3jS60QXklAA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB5349 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dl-linux-imx Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org > From: Stephen Boyd > Sent: Wednesday, June 24, 2020 8:58 AM > Subject: RE: [PATCH V2 3/9] clk: imx: Support building SCU clock driver as > module > > Quoting Aisheng Dong (2020-06-23 02:00:47) > > > From: Stephen Boyd > > > Sent: Tuesday, June 23, 2020 4:34 PM > > > Subject: RE: [PATCH V2 3/9] clk: imx: Support building SCU clock > > > driver as module > > > > > > Quoting Aisheng Dong (2020-06-22 20:42:19) > > > > > From: Stephen Boyd > > > > > Sent: Saturday, June 20, 2020 11:28 AM > > > > > Subject: RE: [PATCH V2 3/9] clk: imx: Support building SCU clock > > > > > driver as module > > > > > > > > > > Quoting Aisheng Dong (2020-06-17 18:58:51) > > > > > > > From: Anson Huang > > > > > > > > > +obj-$(CONFIG_MXC_CLK_SCU) += mxc-clk-scu.o > > > > > > > > > > > > > > > > Like i.MX pinctrl, I'm not sure if it's really necessary > > > > > > > > to build core libraries as modules. Probably the simplest > > > > > > > > way is only building platform drivers part as module. And > > > > > > > > leave those core libraries > > > > > built in kernel. > > > > > > > > This may make the code a bit cleaner. > > > > > > > > > > > > > > > > > > > > > > Will discuss this with Linaro guys about it, previous > > > > > > > requirement I received is all SoC specific modules need to > > > > > > > be built as > > > module. > > > > > > > > > > > > > > > > > > > Okay. AFAIK it's not conflict. > > > > > > You still make drivers into modules. > > > > > > Only difference is for those common libraries part, we don't > > > > > > convert them into module Which is less meaningless. > > > > > > > > > > > > > > > > What is the benefit of making the core part of the SoC driver not a > module? > > > > > > > > Usually we could try to build it as module if it's not hard. > > > > > > > > One question is sometimes those core part are shared with some > > > > platforms > > > which can't built as module. > > > > For i.MX case, it's mainly patch 4: > > > > [V2,4/9] clk: imx: Support building i.MX common clock driver as > > > > module > > > > > > > > > > > > Those libraries are also used by i.MX6&7 which can't build as module. > > > > So we need an extra workaround patch to forcely 'select' it under > > > > arch/arm/mach-imx/Kconfig [V2,2/9] ARM: imx: Select MXC_CLK for > > > > ARCH_MXC Then the users can't configure it as module in order to > > > > not break build. > > > > > > > > If build-in those common libraries, the implementation could be a > > > > bit easier > > > and cleaner. > > > > So I'm not sure if we still have to build them as module. > > > > How would you suggest for such case? > > > > > > Stop using 'select MXC_CLK' when requiring the core library code? > > > Instead, make it a 'depends' and then that will make depending > > > modules (i.e. the SoC files) that want to be builtin force the core > > > module to be builtin too. Other modular configs that depend on the core will > still be modular. > > > > > > > It seems not work. > > Patch 4 already changes it to depend on ARCH_MXC which can only be 'Y'. > > [V2,4/9] clk: imx: Support building i.MX common clock driver as module > > diff --git a/drivers/clk/imx/Kconfig b/drivers/clk/imx/Kconfig index > > ded0643..678113b 100644 > > --- a/drivers/clk/imx/Kconfig > > +++ b/drivers/clk/imx/Kconfig > > @@ -1,8 +1,8 @@ > > # SPDX-License-Identifier: GPL-2.0 > > # common clock support for NXP i.MX SoC family. > > config MXC_CLK > > - bool > > - def_bool ARCH_MXC > > + tristate "IMX clock" > > + depends on ARCH_MXC > > > > But user can still set MXC_CLK to be m, either via make menuconfig or > defconfig. > > Isn't that what we want? No, if user set MXC_CLK to m, the build will break for i.MX6&7. > Why does ARCH_MXC being enabled mandate that it is > builtin? Is some architecture level code calling into the clk driver? It's mainly because there's no Kconfig options for i.MX6 &7 clock drivers. It just reuses ARCH config CONFIG_SOC_XXX which can only be y. e.g. obj-$(CONFIG_SOC_IMX6Q) += clk-imx6q.o obj-$(CONFIG_SOC_IMX6SL) += clk-imx6sl.o obj-$(CONFIG_SOC_IMX7ULP) += clk-imx7ulp.o obj-$(CONFIG_SOC_VF610) += clk-vf610.o .. If setting MXC_CLK to m, the platform clock drivers will fail to build due to miss to find symbols defined in the common clock library by CONFIG_MXC_CLK. So we have to avoid users to be able to config MXC_CLK to m for i.MX6&7. Only depends on ARCH_MXC mean user still can set it to m. Regards Aisheng _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel