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=-1.0 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 151D0C433E0 for ; Tue, 30 Jun 2020 04:11:29 +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 D17B3206A5 for ; Tue, 30 Jun 2020 04:11:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="VpuTM+p3"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="vN7H2Ca8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D17B3206A5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=qar1OJhkomGSii4ghFYSGd5N2kZyAyofu/1Z28xCwC4=; b=VpuTM+p3FWb0v6B0WeytFexBI pBxlngmvTIQID/FpsXFy2q9ieC2AyhyuxqoodCpkL83YW4tRYZF+RaFh3apFtcLprawWIhjTCzy9o U6IQv59jvSdOcZSyOc2JrUCrMJsgsRkqN3p4ANmTYUJVr9DtyjdrXBSvbRZSftE8SZ49wbRiT5oV2 CvUmFU2zCOihlopciZLaVj/dVEZU4unOD5+T6AIMOiLxUDGQqN7tBNFVWwKqfiTd+kvFiosdqJ/T6 SX2OaLzUdXPdDnRKFmOWAh1B/3A1CaXi9K0rNlVhQEykKSmT6r2mytgAQbEokGPWjBYUWk5UxiAHY OSYSlEMMQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jq7ai-0000ug-Br; Tue, 30 Jun 2020 04:09:52 +0000 Received: from mail-ej1-x644.google.com ([2a00:1450:4864:20::644]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jq7ag-0000uT-6i for linux-arm-kernel@lists.infradead.org; Tue, 30 Jun 2020 04:09:51 +0000 Received: by mail-ej1-x644.google.com with SMTP id dp18so19045620ejc.8 for ; Mon, 29 Jun 2020 21:09:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Hey9HbRw/dVBfXOWAz6aoDUkLgkP19V6zpTJ8WVJch0=; b=vN7H2Ca8sOkOTtvwl3v6foRnaRBZiWn6uKrH2xydPPm7Zed43DfmUIi0f2YjMw6+/x uJOGmUrutRMHbnddJOwujquc0X1kJ7fov7nKK7fiFCRDhJzvBJPhxdNj4KGDM+3fBwl0 qJfUzy8859dmVn9XcRNwo+N1/SJi6tVscANDiThp63DeRsB6xa4lR5KE7C+s2f7lhsIl Jbc73GQIE2gYjLF0FMw+1d+apsSfFH16H0RPP2esr545hwkrDhLGoGoyQEuKhmNS1h5N YTmZT+KRz0oqQkDD8Fk+AdBfj0OKY3oZ+u5etDDMrKWWMGZ82sh8DfAMGfpdUyvP0jHc fClQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Hey9HbRw/dVBfXOWAz6aoDUkLgkP19V6zpTJ8WVJch0=; b=U5gZJyxsDifPwLVlr4SjEJbg0/DB5gf/Ni7ugDd9lEZUNXkmmtf/lxcGVs5ZlIdJZo jtLpcyGvklrxOuXawGBJRJlJ361fxXFGt/2bHiHBgX4Bwm1pGDptaCfmyO2x2HL5F5PK l1JnaEHiEUzxaemWt7t9LiPtAYaICUg3A2Uogf+PoasA9x/tgHmZfE6XFjIh/agf5UlQ 3c+VpcM53s9CfXvj2sY4Nr8rH3M+tVB+r+Gq/YTxNlTQgGHLfQVTUQxRWlHsrNk067TX dhSebmUq0S0Q2+Ls8zgZoxOyYtk/J94K6gK16wZmW6F32yBDkBhr1O4QJJuBWzhuLyKN ALYA== X-Gm-Message-State: AOAM5324B/SK3DGjIcX+LRpg1MKbyf+ZYLJdWSa4JSANkrIye8924Ip5 G6b3puQT2XmapAuv9gPAvyXiOCi+NDikTwmJrFM= X-Google-Smtp-Source: ABdhPJx0k3kHhhcmfRuwSQBAljpirUv4qs2fybiJfDd0o4Bl0x6GWFRJs4MEYUmcn6ESvQyn5fmZWG0OPMsgIoQQ0pM= X-Received: by 2002:a17:906:6d56:: with SMTP id a22mr17289015ejt.440.1593490188847; Mon, 29 Jun 2020 21:09:48 -0700 (PDT) MIME-Version: 1.0 References: <1593410042-10598-1-git-send-email-Anson.Huang@nxp.com> <1593410042-10598-5-git-send-email-Anson.Huang@nxp.com> In-Reply-To: From: Dong Aisheng Date: Tue, 30 Jun 2020 11:55:50 +0800 Message-ID: Subject: Re: [PATCH V3 04/10] clk: imx: Support building SCU clock driver as module To: Anson Huang 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: Peng Fan , Michael Turquette , "oleksandr.suvorov@toradex.com" , Fabio Estevam , linux-clk , Stephen Rothwell , Arnd Bergmann , YueHaibing , Russell King - ARM Linux , dl-linux-imx , Stefan Agner , Sascha Hauer , Al Viro , Daniel Baluta , Linux ARM , Abel Vesa , Aisheng Dong , Andy Duan , Stephen Boyd , "linux-kernel@vger.kernel.org" , Sascha Hauer , Shawn Guo 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 On Tue, Jun 30, 2020 at 5:16 AM Anson Huang wrote: > > Hi, Arnd > > > > Subject: Re: [PATCH V3 04/10] clk: imx: Support building SCU clock driver as > > module > > > > On Mon, Jun 29, 2020 at 4:52 PM Anson Huang > > wrote: > > > > Subject: Re: [PATCH V3 04/10] clk: imx: Support building SCU clock > > > > driver as module On Mon, Jun 29, 2020 at 2:53 PM Anson Huang > > wrote: > > > > > > > > Sorry, I misread the patch in multiple ways. First of all, you > > > > already put clk-scu.o and clk-lpcg-scu.o files into a combined > > > > loadable module, and I had only looked at clk-scu.c. > > > > > > > > What I actually meant here was to link clk-scu.o together with > > > > clk-imx8qxp.o (and possibly future chip-specific files) into a > > > > loadable module and drop the export. > > > > > > Sorry, could you please advise more details about how to do it in Makefile? > > > I tried below but it looks like NOT working. multiple definition of > > module_init() error reported. > > > > > > obj-$(CONFIG_MXC_CLK_SCU) := clk-imx.o clk-imx-y += clk-scu.o > > > clk-lpcg-scu.o > > > clk-imx-$(CONFIG_CLK_IMX8QXP) += clk-imx8qxp.o clk-imx8qxp-lpcg.o > > > > Right, you can't have multiple module_init() in a module, so what I suggested > > earlier won't work any more as soon as you add a second chip that uses the > > clk-scu driver, and then you have to use separate modules, or some hack that > > calls the init functions one at a time, which is probably worse. > > > > If it's only imx8qxp, you can do it like this: > > > > obj-$(CONFIG_MXC_CLK_SCU) := clk-imx-scu.o clk-imx-lpcg.o > > clk-imx-scu-y += clk-scu.o clk-imx8qxp.o > > clk-imx-lpcq-scu-y += clk-lpcg-scu.o clk-imx8qxp-lpcg.o > > > > If you already know that the scu driver is going to be used in future chips, then > > just stay with what you have now, using a separate module per file, exporting > > the symbols as needed. > > > > Thanks, and yes, I know that scu clk driver will be used for future i.MX8X chips with > SCU inside, the current i.MX8QXP clock driver can NOT cover all i.MX8X chips, so > I will stay with the exporting symbols. > SCU clock driver is a common driver for all SCU based platforms. Current i.MX8QXP SCU clock driver will be extended to support all future SCU based platforms. So theoretically clk-scu.o and clk-imx8qxp.o can be combined. LPCG is similar. Maybe you can give a try as Arnd suggested. Regards Aisheng > Thanks, > Anson _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel