Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1204360ybt; Wed, 1 Jul 2020 22:43:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTmCQ6XjBnfOi4qMCjHAKPYnPPf3aJV1U+JFLF9dlnQipFdNNTNOhBoyJNGbfvTTVb2BPQ X-Received: by 2002:aa7:d043:: with SMTP id n3mr34185874edo.102.1593668628538; Wed, 01 Jul 2020 22:43:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593668628; cv=none; d=google.com; s=arc-20160816; b=xt9jtKrAjVFNhsfnmulAbzNB8uBlSLPUEoF/yuVvbAA6Upjr4Qvbq2wx1XLOFqlp7I CtXvHejMw5jiTfXB9Bgdu+17oD+3w3EFM1wSmWFg3783wikExLM2j6MVbY35umIY9+kg VFaTIzYN2JEvBw06IkN0hFRteLtfCPg65hbmjpEMYAnSjWgvNy8fc9RwOXmWqezLtztX BFDFiIqPfmiaFMeAd5721DIZdn6kQ1eVe4wR/BIQQtUNuZJkQUFSPepRt5/uDX7SOPYv xTD483QD0FJy9TWR8TJ2+qBwnzMIc9owNLV+17hWsMjB8m+/1RWNOgluI8tFKQRnuVbY 3XcA== 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=Mtjw6ui/18TL1nfopaGxavsYfqOS3W2EnIEUiFfp6xw=; b=azzd7FYGqrC1Vi6wsslUonjrfJ3ctPUmKPoyDgUjZRGwyOjSBzy3OX8YQUcFLIyVEr hpLEUeNmDxr+1Lrxtn8fXa0r5AnGUTZhQIYkQ2o25IucNeVO84i4TgSOruZFel0U+rp8 evAjcYwXpUjUjHLIq6GJNs9gliwuS/xgsFanLUEyq2O5KXYI+dULm3TqMMsL1canyFm2 P4T+zUXBQc4droBFZa8Zlf4FjV1JGuHeRiEgc16epBJakJjA58XwBmLgl+OZGJErqJjT idH0NqkKBHA27ydRyd/o0WoTaMOlb+adq6Un4bEj/SAdRQy61DL1LpikG0AYFfffhijd WCTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mg2X3xJL; 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 h23si4908078ejj.573.2020.07.01.22.43.25; Wed, 01 Jul 2020 22:43:48 -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=mg2X3xJL; 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 S1726117AbgGBFnQ (ORCPT + 99 others); Thu, 2 Jul 2020 01:43:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726010AbgGBFnP (ORCPT ); Thu, 2 Jul 2020 01:43:15 -0400 Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F79BC08C5C1; Wed, 1 Jul 2020 22:43:15 -0700 (PDT) Received: by mail-ed1-x541.google.com with SMTP id n2so13260485edr.5; Wed, 01 Jul 2020 22:43:15 -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=Mtjw6ui/18TL1nfopaGxavsYfqOS3W2EnIEUiFfp6xw=; b=mg2X3xJLj6ZYbXlN/J/8VDmx5fZmXiFAvQ2DK1MvHv+BTDx6X4UhPUWjziUEO43UBM s6LFeprRxelk5RRbu+tGnKJuhgwJbZsZPp6BBQalAuijr2VOITxZ5iuhZrcs7q6U4PXT zXGyVfHlUOjFXGjBr324/b3ZsDMLonyUXD+lHFeBDXAk3gPkN0nipBLOpOi3bwVpnHJ4 jz9uzOWfMAw1XDDBHUwL/RCdPxdKaqe+Qbpu+Lu7PS1yj9ojoTx2JHch1Ke/9q5XETku ABmve3gTyQoxgBHNjW45447bqXKZ2MFreIrgz726G+e4FEX0EVP1zOYYcgf+FlRYjwxg WX0g== 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=Mtjw6ui/18TL1nfopaGxavsYfqOS3W2EnIEUiFfp6xw=; b=hVPzjpePRvWcaUZ4q9NQy44OStdTwPXoSmUiq2VKWz5EdZ0GmeWoBTg0Iths0Z1lg4 LNU3rkQ/H/1rDYphT3ZSf6ire8ziKVpTX09Koz6HcNNzNXyyqzmobk2wXmhUIznpcOZ+ 1+K1ibVkojVwtb1KKdk0ZdlWrN1N3uKI7dq/OVV1yRRaph/uHY3HBO3dQNn5fZavN/69 ezt6h9uYZe4kcR959b1N+Wqhg0APPW4gyPEgyH9kkNNoFqErCAJNnh/t8YXopL1ecCeI VlgRDRk6da/sWDJnN57Psvlw0KHKiPu0qUvWh80ThSpPakIGbvrcOqoK/Nih7w5So/yD 5GFg== X-Gm-Message-State: AOAM533RHAZUNu0E/t6cvOnF8kEpSPc9erTw89Obd8fGE80QzosFF3XE cuesQLSkepl6XmD4cV8Hmb5VAtrEiuV436Kbzsw= X-Received: by 2002:a50:f08c:: with SMTP id v12mr32253507edl.119.1593668594000; Wed, 01 Jul 2020 22:43:14 -0700 (PDT) MIME-Version: 1.0 References: <1593656074-10092-1-git-send-email-Anson.Huang@nxp.com> <1593656074-10092-6-git-send-email-Anson.Huang@nxp.com> In-Reply-To: From: Dong Aisheng Date: Thu, 2 Jul 2020 13:29:12 +0800 Message-ID: Subject: Re: [PATCH V4 5/5] clk: imx8qxp: Support building i.MX8QXP clock driver as module To: Anson Huang Cc: Michael Turquette , Stephen Boyd , Shawn Guo , Sascha Hauer , Sascha Hauer , Fabio Estevam , Peng Fan , Arnd Bergmann , Abel Vesa , Aisheng Dong , Andy Duan , Daniel Baluta , YueHaibing , Stephen Rothwell , linux-clk , open list , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , 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 Thu, Jul 2, 2020 at 11:55 AM Anson Huang wrote: [...] > > > +{ > > > + return platform_driver_register(&imx8qxp_lpcg_clk_driver); > > > +} > > > +device_initcall(imx8qxp_lpcg_clk_init); > > > > Any reason to change to device_initcall which looks a bit strange? > > Is it because the following line? > > +obj-$(CONFIG_MXC_CLK_SCU) += clk-imx-scu.o clk-imx-lpcg-scu.o > > But it looks to me they're still two modules. Aren't they? > > It is suggested by Arnd to NOT use builtin_platform_driver(), in order to support module > unload, although the clock driver normally does NOT support remove, but it is better to > follow the right way. > By expanding builtin_platform_driver() marcro, you will find your patch is exactly doing the same thing as buildin_platform_driver() which obivously is unneccesary. #define builtin_platform_driver(__platform_driver) \ builtin_driver(__platform_driver, platform_driver_register) #define builtin_driver(__driver, __register, ...) \ static int __init __driver##_init(void) \ { \ return __register(&(__driver) , ##__VA_ARGS__); \ } \ device_initcall(__driver##_init); If we want to support unload, we need a .remove() callback as current clocks are not allocated by devm_(). If don't support, we probably can use builtin_platform_driver() first and switch to module_platform_driver() in the future once the driver supports release resource properly. Regards Aisheng > The change in Makefile is just to link scu/lpcg library to i.MX8QXP clk driver, so that we can > get rid of exports and below 2 .ko are needed for all i.MX SoCs with SCU inside as per your > saying of i.MX8QXP clock driver can be extended for future SoCs with SCU. > > clk-imx-lpcg-scu.ko > clk-imx-scu.ko > > Thanks, > Anson