Message ID | 20230214134127.59273-37-angelogioacchino.delregno@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2991879wrn; Tue, 14 Feb 2023 06:06:48 -0800 (PST) X-Google-Smtp-Source: AK7set/b1z608lShry0ySUMFJIuvQCA1OJYuAq2qIWEOz/gRyLnS9SNUo/y0xTW5IAK9Eo7ZpKaY X-Received: by 2002:a17:90b:1808:b0:22c:932:2870 with SMTP id lw8-20020a17090b180800b0022c09322870mr2598211pjb.33.1676383608251; Tue, 14 Feb 2023 06:06:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676383608; cv=none; d=google.com; s=arc-20160816; b=ypbCFt0KOLe/BRoyHbzjK+UZtsO5ZI9UYEfUVlIrdDw/B3qGhK8StkXgmDjGOsT45I a5uga+xFTwnr0M+Kjw+zbRqDic7j5H0OYA9+iTL3hZ8MrLm1bTKRY+d4AcO4VtTAz6YD ph+CEBLB2T1m5DxXRGUaucJAieKixwzo3VtKsvorQfWr852G5Ge1e3TQZ+vdr0T4s++t 3kp1dq3We4iLE9HvBhwrWYZ4XdfevuMNWCgxeDN9sKVME1qAWKCWPY7P+KU/RAxrFeTh pomYxZlYRZD/5T2JnKROIxOEiffjimpzwKX+tQOKeAruJwMvyUmF21T7IzUUwmlgpXiz Z04g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=05RAL79z+pa7UCXHtqHJcj12SFukIForr9dkHiNbeLo=; b=L+d5Sy/ILnRtM2TvJilBikGSl9jKN9o3y5svvIxOkGzGlMerkA2/fIn/jtV6ubZI6N 2Sl6GZ1haseovG2xC/kJza6GiOOeuqLTCIHrjoh1sYqVTbb+ad2cyihxs1oeuxsjurfO 3oVslmp5m4DoDeEvDA8a4kah08/Ybu6lMPjNCdNJwGbmtKh88XbxoC01Ta0OLYweSwZ3 MNx6wHMlW7EOGjoyDRy3SaTBkz4C5HPB5v/wN0GR+UlBot/2r8VSe1Ufhyq3L/N0V4dj 90daXb74Gr5GFlqwYDqhNDdFkcvqyGh+4ea49/e5n/pEGAP76XzZ6Y7mi8uurVUOjL2p V6OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=BdF8OSlQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k5-20020a17090a3e8500b002342ac76773si2461884pjc.60.2023.02.14.06.06.35; Tue, 14 Feb 2023 06:06:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=BdF8OSlQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232965AbjBNNta (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Tue, 14 Feb 2023 08:49:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232588AbjBNNtW (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 14 Feb 2023 08:49:22 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F26B29E1A; Tue, 14 Feb 2023 05:48:59 -0800 (PST) Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 871C9660217E; Tue, 14 Feb 2023 13:42:28 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1676382149; bh=sNb4igxxWI/mSJ+IRuoMTOS7GxC6yqGEwaxMpEg3gFc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BdF8OSlQ3aUkEH7gw33RL/OYT4e4p/A2PYCNXB3BJ5HxH9E1I3jFgj0j8p0uDRu50 33U1fvA2mqIL3KrmgT1OMwzPz10GJhvRVrvcoJHn7yOh/0/jch//CcDiQxUB0MxT6v +Im34DJxfDNtqNWgJCxZ0m4uBXBTrSOGrY/1zCROGq2tlq+QRKt23UQJN7aR+A+4fM 4IaqCekWs9ODY/VU0vqp3ZCk24q/sfDlrHvGkR8tdQOXZQhf4mnlaUO9sWOlKfjc6u oXq4evcwNpCw9CAbrMNLWo6LNVxHIjvhlRk1UUc2JEl8eV8Sb0DLtEu40xIE0oYE0G o9V5kuReGOq4g== From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> To: mturquette@baylibre.com Cc: sboyd@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, wenst@chromium.org, johnson.wang@mediatek.com, miles.chen@mediatek.com, chun-jie.chen@mediatek.com, daniel@makrotopia.org, fparent@baylibre.com, msp@baylibre.com, nfraprado@collabora.com, rex-bc.chen@mediatek.com, zhaojh329@gmail.com, sam.shih@mediatek.com, edward-jw.yang@mediatek.com, yangyingliang@huawei.com, granquet@baylibre.com, pablo.sun@mediatek.com, sean.wang@mediatek.com, chen.zhong@mediatek.com, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@collabora.com Subject: [PATCH v2 36/47] clk: mediatek: mt2712: Change Kconfig options to allow module build Date: Tue, 14 Feb 2023 14:41:16 +0100 Message-Id: <20230214134127.59273-37-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214134127.59273-1-angelogioacchino.delregno@collabora.com> References: <20230214134127.59273-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757815618396425217?= X-GMAIL-MSGID: =?utf-8?q?1757815618396425217?= |
Series |
MediaTek clocks: full module build and cleanups
|
|
Commit Message
AngeloGioacchino Del Regno
Feb. 14, 2023, 1:41 p.m. UTC
All of the mt2712 drivers have been converted to platform drivers!
Change the Kconfig options for all MT2712 clocks to tristate to allow
building all clock drivers as modules.
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
drivers/clk/mediatek/Kconfig | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
Comments
On Tue, Feb 14, 2023 at 9:42 PM AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> wrote: > > All of the mt2712 drivers have been converted to platform drivers! > Change the Kconfig options for all MT2712 clocks to tristate to allow > building all clock drivers as modules. > > Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> > --- > drivers/clk/mediatek/Kconfig | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/drivers/clk/mediatek/Kconfig b/drivers/clk/mediatek/Kconfig > index b9c0a9e21cf1..45b7aea7648d 100644 > --- a/drivers/clk/mediatek/Kconfig > +++ b/drivers/clk/mediatek/Kconfig > @@ -75,7 +75,7 @@ config COMMON_CLK_MT2701_G3DSYS > This driver supports MediaTek MT2701 g3dsys clocks. > > config COMMON_CLK_MT2712 > - bool "Clock driver for MediaTek MT2712" > + tristate "Clock driver for MediaTek MT2712" Hmm... How does that work out if mt2712-apmixedsys is a builtin_platform_driver? ChenYu
On Fri, Feb 17, 2023 at 12:24 PM Chen-Yu Tsai <wenst@chromium.org> wrote: > > On Tue, Feb 14, 2023 at 9:42 PM AngeloGioacchino Del Regno > <angelogioacchino.delregno@collabora.com> wrote: > > > > All of the mt2712 drivers have been converted to platform drivers! > > Change the Kconfig options for all MT2712 clocks to tristate to allow > > building all clock drivers as modules. > > > > Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> > > --- > > drivers/clk/mediatek/Kconfig | 16 ++++++++-------- > > 1 file changed, 8 insertions(+), 8 deletions(-) > > > > diff --git a/drivers/clk/mediatek/Kconfig b/drivers/clk/mediatek/Kconfig > > index b9c0a9e21cf1..45b7aea7648d 100644 > > --- a/drivers/clk/mediatek/Kconfig > > +++ b/drivers/clk/mediatek/Kconfig > > @@ -75,7 +75,7 @@ config COMMON_CLK_MT2701_G3DSYS > > This driver supports MediaTek MT2701 g3dsys clocks. > > > > config COMMON_CLK_MT2712 > > - bool "Clock driver for MediaTek MT2712" > > + tristate "Clock driver for MediaTek MT2712" > > Hmm... How does that work out if mt2712-apmixedsys is a > builtin_platform_driver? Nevermind. I figured it out. Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Il 17/02/23 05:24, Chen-Yu Tsai ha scritto: > On Tue, Feb 14, 2023 at 9:42 PM AngeloGioacchino Del Regno > <angelogioacchino.delregno@collabora.com> wrote: >> >> All of the mt2712 drivers have been converted to platform drivers! >> Change the Kconfig options for all MT2712 clocks to tristate to allow >> building all clock drivers as modules. >> >> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> >> --- >> drivers/clk/mediatek/Kconfig | 16 ++++++++-------- >> 1 file changed, 8 insertions(+), 8 deletions(-) >> >> diff --git a/drivers/clk/mediatek/Kconfig b/drivers/clk/mediatek/Kconfig >> index b9c0a9e21cf1..45b7aea7648d 100644 >> --- a/drivers/clk/mediatek/Kconfig >> +++ b/drivers/clk/mediatek/Kconfig >> @@ -75,7 +75,7 @@ config COMMON_CLK_MT2701_G3DSYS >> This driver supports MediaTek MT2701 g3dsys clocks. >> >> config COMMON_CLK_MT2712 >> - bool "Clock driver for MediaTek MT2712" >> + tristate "Clock driver for MediaTek MT2712" > > Hmm... How does that work out if mt2712-apmixedsys is a > builtin_platform_driver? > > ChenYu That doesn't. Thanks for catching that, I've added a .remove() callback and changed it to module_platform_driver() for v3! Cheers, Angelo
On Fri, Feb 17, 2023 at 7:25 PM AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> wrote: > > Il 17/02/23 05:24, Chen-Yu Tsai ha scritto: > > On Tue, Feb 14, 2023 at 9:42 PM AngeloGioacchino Del Regno > > <angelogioacchino.delregno@collabora.com> wrote: > >> > >> All of the mt2712 drivers have been converted to platform drivers! > >> Change the Kconfig options for all MT2712 clocks to tristate to allow > >> building all clock drivers as modules. > >> > >> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> > >> --- > >> drivers/clk/mediatek/Kconfig | 16 ++++++++-------- > >> 1 file changed, 8 insertions(+), 8 deletions(-) > >> > >> diff --git a/drivers/clk/mediatek/Kconfig b/drivers/clk/mediatek/Kconfig > >> index b9c0a9e21cf1..45b7aea7648d 100644 > >> --- a/drivers/clk/mediatek/Kconfig > >> +++ b/drivers/clk/mediatek/Kconfig > >> @@ -75,7 +75,7 @@ config COMMON_CLK_MT2701_G3DSYS > >> This driver supports MediaTek MT2701 g3dsys clocks. > >> > >> config COMMON_CLK_MT2712 > >> - bool "Clock driver for MediaTek MT2712" > >> + tristate "Clock driver for MediaTek MT2712" > > > > Hmm... How does that work out if mt2712-apmixedsys is a > > builtin_platform_driver? > > > > ChenYu > > That doesn't. Thanks for catching that, I've added a .remove() callback > and changed it to module_platform_driver() for v3! Actually, I thought that if it were built as a module, then the builtin_platform_driver would then expand to a module_init() without module_exit(). So it would become a loadable module that cannot be unloaded. That was just looking at the header files, so I could be mistaken. Side note: IIRC a missing .remove() driver callback doesn't actually block driver removal or unbinding. ChenYu
Il 17/02/23 16:19, Chen-Yu Tsai ha scritto: > On Fri, Feb 17, 2023 at 7:25 PM AngeloGioacchino Del Regno > <angelogioacchino.delregno@collabora.com> wrote: >> >> Il 17/02/23 05:24, Chen-Yu Tsai ha scritto: >>> On Tue, Feb 14, 2023 at 9:42 PM AngeloGioacchino Del Regno >>> <angelogioacchino.delregno@collabora.com> wrote: >>>> >>>> All of the mt2712 drivers have been converted to platform drivers! >>>> Change the Kconfig options for all MT2712 clocks to tristate to allow >>>> building all clock drivers as modules. >>>> >>>> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> >>>> --- >>>> drivers/clk/mediatek/Kconfig | 16 ++++++++-------- >>>> 1 file changed, 8 insertions(+), 8 deletions(-) >>>> >>>> diff --git a/drivers/clk/mediatek/Kconfig b/drivers/clk/mediatek/Kconfig >>>> index b9c0a9e21cf1..45b7aea7648d 100644 >>>> --- a/drivers/clk/mediatek/Kconfig >>>> +++ b/drivers/clk/mediatek/Kconfig >>>> @@ -75,7 +75,7 @@ config COMMON_CLK_MT2701_G3DSYS >>>> This driver supports MediaTek MT2701 g3dsys clocks. >>>> >>>> config COMMON_CLK_MT2712 >>>> - bool "Clock driver for MediaTek MT2712" >>>> + tristate "Clock driver for MediaTek MT2712" >>> >>> Hmm... How does that work out if mt2712-apmixedsys is a >>> builtin_platform_driver? >>> >>> ChenYu >> >> That doesn't. Thanks for catching that, I've added a .remove() callback >> and changed it to module_platform_driver() for v3! > > Actually, I thought that if it were built as a module, then the > builtin_platform_driver would then expand to a module_init() without > module_exit(). So it would become a loadable module that cannot be > unloaded. > > That was just looking at the header files, so I could be mistaken. > > Side note: IIRC a missing .remove() driver callback doesn't actually > block driver removal or unbinding. > It doesn't, but we'd leak memory because of the kzalloc() that happened at the beginning of the probe function... so adding the .remove() callback was pretty much necessary :-) Thanks, Angelo > ChenYu >
diff --git a/drivers/clk/mediatek/Kconfig b/drivers/clk/mediatek/Kconfig index b9c0a9e21cf1..45b7aea7648d 100644 --- a/drivers/clk/mediatek/Kconfig +++ b/drivers/clk/mediatek/Kconfig @@ -75,7 +75,7 @@ config COMMON_CLK_MT2701_G3DSYS This driver supports MediaTek MT2701 g3dsys clocks. config COMMON_CLK_MT2712 - bool "Clock driver for MediaTek MT2712" + tristate "Clock driver for MediaTek MT2712" depends on (ARCH_MEDIATEK && ARM64) || COMPILE_TEST select COMMON_CLK_MEDIATEK default ARCH_MEDIATEK && ARM64 @@ -83,43 +83,43 @@ config COMMON_CLK_MT2712 This driver supports MediaTek MT2712 basic clocks. config COMMON_CLK_MT2712_BDPSYS - bool "Clock driver for MediaTek MT2712 bdpsys" + tristate "Clock driver for MediaTek MT2712 bdpsys" depends on COMMON_CLK_MT2712 help This driver supports MediaTek MT2712 bdpsys clocks. config COMMON_CLK_MT2712_IMGSYS - bool "Clock driver for MediaTek MT2712 imgsys" + tristate "Clock driver for MediaTek MT2712 imgsys" depends on COMMON_CLK_MT2712 help This driver supports MediaTek MT2712 imgsys clocks. config COMMON_CLK_MT2712_JPGDECSYS - bool "Clock driver for MediaTek MT2712 jpgdecsys" + tristate "Clock driver for MediaTek MT2712 jpgdecsys" depends on COMMON_CLK_MT2712 help This driver supports MediaTek MT2712 jpgdecsys clocks. config COMMON_CLK_MT2712_MFGCFG - bool "Clock driver for MediaTek MT2712 mfgcfg" + tristate "Clock driver for MediaTek MT2712 mfgcfg" depends on COMMON_CLK_MT2712 help This driver supports MediaTek MT2712 mfgcfg clocks. config COMMON_CLK_MT2712_MMSYS - bool "Clock driver for MediaTek MT2712 mmsys" + tristate "Clock driver for MediaTek MT2712 mmsys" depends on COMMON_CLK_MT2712 help This driver supports MediaTek MT2712 mmsys clocks. config COMMON_CLK_MT2712_VDECSYS - bool "Clock driver for MediaTek MT2712 vdecsys" + tristate "Clock driver for MediaTek MT2712 vdecsys" depends on COMMON_CLK_MT2712 help This driver supports MediaTek MT2712 vdecsys clocks. config COMMON_CLK_MT2712_VENCSYS - bool "Clock driver for MediaTek MT2712 vencsys" + tristate "Clock driver for MediaTek MT2712 vencsys" depends on COMMON_CLK_MT2712 help This driver supports MediaTek MT2712 vencsys clocks.