Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3270410ybt; Mon, 29 Jun 2020 21:11:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygtxnP34kBDviDBnmvhHVmKMv02E8dDIo30mIyoIhRuuMQBA1qX2nUjw0BBcRjFCh1nlq2 X-Received: by 2002:aa7:dd10:: with SMTP id i16mr18651442edv.227.1593490271485; Mon, 29 Jun 2020 21:11:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593490271; cv=none; d=google.com; s=arc-20160816; b=Mg5e/EFxLyHWiaaN6HHSy268FXM7OLovWC8pkw/kuaB9if7i6IM0rWX9rJ30Z3Ny4Q MBcpoCT19wyxZNy5GG/Vxg3wwSKGKgKl/OvS49Nlhwx7xotO3FuPqLv88VrqA1HNSTKW FlcxxDXaTVhib0LcACW+BNEe+lHp2an+Wh351LRfojzROlSyd8jMP0MskrPQ0GAwfhhC eTQaCZl2l4VDNPPl+N4kOr0twlmiLo9ta+/aW+xe3iaj5pcO74WDmAgdVEnaW5xerZR3 imC0kMsfkI570jPdCDLXfkDNOo0Vne5pmoQFLkl4PII0OfMQcrJoZsFzwI+HEjsQASLc 9pqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Hey9HbRw/dVBfXOWAz6aoDUkLgkP19V6zpTJ8WVJch0=; b=xuRbwXCzg9yBeoZzyL1MO34vB1iRLG8QtAvFv0IIg3MatoI0kYYivsOJYPEYSvcDtY nsgJsyI17rqp5/iEYX6oPBqiCmeJym/Qa8/2uqwte/4o99wp36BPDInrMj06nWdkUJRk gGMSBHFuKaEeQVRgpzw/05n7AsrNi7uuHrIu8BnQdmPYROjcI3FrE27fF+QpB3pGRbCm KovjYG/7YTyhoSJFNxhlNfogAz5hyeRqURT+dPQuZ8nC6oBRp4QvUxkXVfBaNiAh/6rF lG/JHO5q4UrNSZcsXJ5+ZTaDJFFGx0zcFz4rzU9ROKpD2TxzhDrwom/FcQ2H5tk2Pszx EcOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vN7H2Ca8; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o6si1132029edz.406.2020.06.29.21.10.48; Mon, 29 Jun 2020 21:11:11 -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=@gmail.com header.s=20161025 header.b=vN7H2Ca8; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726281AbgF3EJv (ORCPT + 99 others); Tue, 30 Jun 2020 00:09:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725809AbgF3EJu (ORCPT ); Tue, 30 Jun 2020 00:09:50 -0400 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29F7EC061755; Mon, 29 Jun 2020 21:09:50 -0700 (PDT) Received: by mail-ej1-x641.google.com with SMTP id rk21so19059849ejb.2; Mon, 29 Jun 2020 21:09:50 -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=pD08qfLTzgif2v5UZMH4FGerpHLbtr1LbOb0yoPsbIhd/Eip3K/JJ76T8gEbB/PDb9 kbEVMtj0coNdHnlOpSMSbEAHchdtLa+FuPQfRi1P/x0uZ6zcPkuQ8Y+N2TYI3Pu+DpHq r04Fb4fQRCgT/YQ/2IrZJzJAMzCuV7If3Hzy8xn1746DDVbVUr+AN1Wr6Kr/uhpklNUF ZVN/3RKg1KjFjjNfc2oBSMx2gDRik4yjqekSMK8bMuRU5Ks1wNVMi/KAxTbNPYPsLwtd cUO916NRbnzsp1pJAyix/xXIXPxCGkkRYSPk4lJYNUOVBQZKATQJffKUixnIu3niElpy zWRA== X-Gm-Message-State: AOAM531Yhm5k6PmfOEtVuTlahIr7llI1WZK/fh3KcsndeRX6v65hczoS daRf5MWj6wMSNfRF1RSjaknZKsCgbhe3z1jfjss= 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 Cc: Arnd Bergmann , Russell King - ARM Linux , Shawn Guo , Sascha Hauer , Sascha Hauer , Fabio Estevam , Michael Turquette , Stephen Boyd , "oleksandr.suvorov@toradex.com" , Stefan Agner , Peng Fan , Abel Vesa , Aisheng Dong , Andy Duan , Daniel Baluta , YueHaibing , Stephen Rothwell , Al Viro , Linux ARM , "linux-kernel@vger.kernel.org" , linux-clk , dl-linux-imx Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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