Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3418450ybt; Tue, 23 Jun 2020 01:36:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4uHgWZF83hvWRL/yy1q+G761B7Cx/caPwPoXx/GIZKoEJGKASTN/8/wCfQ97pG/F4boUA X-Received: by 2002:a17:906:3e0c:: with SMTP id k12mr18519621eji.441.1592901417754; Tue, 23 Jun 2020 01:36:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592901417; cv=none; d=google.com; s=arc-20160816; b=bmnGJvzgWe2MWsBjuBhCKgvX+pxSRTSARYNs//Ynkn5T+SCCA2PtITTgv2Dowhee3i LWXg8555Xx3WKAfSlzq0PFHuIqjuo+YhbMmkIkKmEZY0jyw5//aahjdtKxqgDWKVMd5U zEReLIEe1AxX4UxDrAgLhK3+4Gx99ruWBhkqsRlTXZFfMNGNTZBLfWCT4XDK3iYezBHY jHfFOWoY2FsGR7asjAXEovxl3WFp59OTpksqAACkFork2vQH7BHWTyADkLZFDHpP9Rhw aCkONdw81YkuyhvLrqBcsOla97DQl1MHb7qrtZsU9hKhPs6mb+xjNZ7IzYtqzTV97yNI Wf4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:date:to:cc:from :subject:references:in-reply-to:content-transfer-encoding :mime-version:dkim-signature; bh=xhJyNgexKUtQqsTRLYLgxO9uWTnpO1SU0yUZ5LR0Wo4=; b=OKYP43Lgsihi0AnCBHeiDmEtXEm+PaETVHlWdpRJ1apQaARjrQlPOjzyBeLuWaAOCU ZsrfCbl/tNHXkZWi94WJqSxgIVbusYvoymkWiu4NNwZWfzm2/nkeUowk6zdscuKGah9n ON9ryQEmrfIVM1OZYdxvAUlfC2WIpl1/5Tz38i5FE8F2HZnChqKEQJhmW15zRgjaGoty Xoad5U0TQ65AA7oFdeyvKtOZXhfzUx4YNQ4rSSG2CS9PeGjB2ELK070lqg/RWrUbcXx6 1LpNoA1CscmIbjzIwm14UhFzzN+V75sySTSnp+flVceHPR/o2zjASz7mPtuOfZUOiOza gyoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ks2iMxwj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b27si3868734ejb.308.2020.06.23.01.36.35; Tue, 23 Jun 2020 01:36:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ks2iMxwj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1731853AbgFWIeO (ORCPT + 99 others); Tue, 23 Jun 2020 04:34:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:56342 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731724AbgFWIeN (ORCPT ); Tue, 23 Jun 2020 04:34:13 -0400 Received: from kernel.org (unknown [104.132.0.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C17032072E; Tue, 23 Jun 2020 08:34:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592901252; bh=xhJyNgexKUtQqsTRLYLgxO9uWTnpO1SU0yUZ5LR0Wo4=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=Ks2iMxwjVDQaF6CrIGCOP56jLcSr3LgtnkdgSdDDO3INAZiCMtFiB9G+H2pjdqVM9 ne5m50sMrW5MA+Hy1L3pWaNWHCebIUoPgDYXFJsd1dKm4PAPsjsOEJ6Al8b4Fmv4jG qiApvojFQ5MSp+dEZ3JOBZcz0UBhYVjP0s6GNScY= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: 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> Subject: RE: [PATCH V2 3/9] clk: imx: Support building SCU clock driver as module From: Stephen Boyd Cc: dl-linux-imx To: Abel Vesa , Aisheng Dong , 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 Date: Tue, 23 Jun 2020 01:34:12 -0700 Message-ID: <159290125202.62212.13172213909023205615@swboyd.mtv.corp.google.com> User-Agent: alot/0.9 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > >=20 > > Quoting Aisheng Dong (2020-06-17 18:58:51) > > > > From: Anson Huang > > > > > > +obj-$(CONFIG_MXC_CLK_SCU) +=3D 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 li= braries > > 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. > > > > >=20 > > What is the benefit of making the core part of the SoC driver not a mod= ule? >=20 > Usually we could try to build it as module if it's not hard. >=20 > 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 > https://patchwork.kernel.org/patch/11594801/ >=20 > 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/ar= m/mach-imx/Kconfig > [V2,2/9] ARM: imx: Select MXC_CLK for ARCH_MXC > https://patchwork.kernel.org/patch/11594793/ > Then the users can't configure it as module in order to not break build. >=20 > If build-in those common libraries, the implementation could be a bit eas= ier 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.=20 I don't know why an architecture is selecting the clk code at all to be honest. That can be moved to the defconfig instead of in the architecture Kconfig and then you don't get a working system unless you select the MXC_CLK config from the configurator tool (menuconfig, nconfig, etc.) So ARCH_MXC shouldn't be in this discussion and the core module should be selectable by the configurator and that should be tristate and all SoC modules should depend on that core library module and be selectable too and those Kconfigs can be tristate or bool.