mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Justin Yeh <justin.yeh@mediatek.com>,
	Matthias Brugger <matthias.bgg@gmail.com>
Cc: Project_Global_Chrome_Upstream_Group@mediatek.com,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH 2/2] soc: mediatek: mtk-infracfg: Export symbols for DDK modules
Date: Tue, 23 Jun 2026 10:06:38 +0200	[thread overview]
Message-ID: <719d4716-8123-43cd-a646-118684565c6e@collabora.com> (raw)
In-Reply-To: <20260529101613.55697-3-justin.yeh@mediatek.com>

On 5/29/26 12:16, Justin Yeh wrote:
> Export mtk_infracfg functions to allow other DDK modules (like
> mtk-scpsys) to use bus protection APIs.
> 
> Changes:
> - Add EXPORT_SYMBOL_GPL for set/clear bus_protection and init functions
> - Remove static and __init qualifiers from mtk_infracfg_init
> - Add mtk_infracfg_init() declaration to header
> - Remove postcore_initcall, let dependent modules call init explicitly
> - Add #include <linux/module.h> for export macros
> - Add MODULE_LICENSE("GPL") metadata
> 
> This allows mtk-infracfg to be built as a DDK module (.ko) and its
> functions to be used by other modules like mtk-scpsys for power domain
> management.
> 
> Signed-off-by: Justin Yeh <justin.yeh@mediatek.com>
> ---
>   drivers/soc/mediatek/mtk-infracfg.c   | 9 +++++++--
>   include/linux/soc/mediatek/infracfg.h | 1 +
>   2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/soc/mediatek/mtk-infracfg.c b/drivers/soc/mediatek/mtk-infracfg.c
> index 2acf19676af2..8a88805468cc 100644
> --- a/drivers/soc/mediatek/mtk-infracfg.c
> +++ b/drivers/soc/mediatek/mtk-infracfg.c
> @@ -7,6 +7,7 @@
>   #include <linux/jiffies.h>
>   #include <linux/regmap.h>
>   #include <linux/mfd/syscon.h>
> +#include <linux/module.h>
>   #include <linux/soc/mediatek/infracfg.h>
>   #include <asm/processor.h>
>   
> @@ -43,6 +44,7 @@ int mtk_infracfg_set_bus_protection(struct regmap *infracfg, u32 mask,
>   
>   	return ret;
>   }
> +EXPORT_SYMBOL_GPL(mtk_infracfg_set_bus_protection);
>   
>   /**
>    * mtk_infracfg_clear_bus_protection - disable bus protection
> @@ -73,8 +75,9 @@ int mtk_infracfg_clear_bus_protection(struct regmap *infracfg, u32 mask,
>   
>   	return ret;
>   }
> +EXPORT_SYMBOL_GPL(mtk_infracfg_clear_bus_protection);

Those two are ok, but I'd prefer to use namespaces (EXPORT_SYMBOL_NS_GPL) and to
import the namespace in the relevant drivers.

>   
> -static int __init mtk_infracfg_init(void)
> +int mtk_infracfg_init(void)
>   {
>   	struct regmap *infracfg;
>   
> @@ -90,4 +93,6 @@ static int __init mtk_infracfg_init(void)
>   				MT8192_INFRA_CTRL_DISABLE_MFG2ACP);
>   	return 0;
>   }
> -postcore_initcall(mtk_infracfg_init);
> +EXPORT_SYMBOL_GPL(mtk_infracfg_init);

Sorry, but that makes little sense.

Check the mtk_infracfg_init() function: if you avoid the postcore_initcall() there,
what's going to happen with MT8192?! :-)

Cheers,
Angelo

> +
> +MODULE_LICENSE("GPL");
> diff --git a/include/linux/soc/mediatek/infracfg.h b/include/linux/soc/mediatek/infracfg.h
> index 9956e18c5ffa..847431a7b967 100644
> --- a/include/linux/soc/mediatek/infracfg.h
> +++ b/include/linux/soc/mediatek/infracfg.h
> @@ -454,4 +454,5 @@ int mtk_infracfg_set_bus_protection(struct regmap *infracfg, u32 mask,
>   		bool reg_update);
>   int mtk_infracfg_clear_bus_protection(struct regmap *infracfg, u32 mask,
>   		bool reg_update);
> +int mtk_infracfg_init(void);
>   #endif /* __SOC_MEDIATEK_INFRACFG_H */


      reply	other threads:[~2026-06-23  8:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-29 10:16 [PATCH 0/2] soc: mediatek: Make mtk-infracfg modular Justin Yeh
2026-05-29 10:16 ` [PATCH 1/2] soc: mediatek: Allow MTK_INFRACFG to be built as module Justin Yeh
2026-05-29 10:16 ` [PATCH 2/2] soc: mediatek: mtk-infracfg: Export symbols for DDK modules Justin Yeh
2026-06-23  8:06   ` AngeloGioacchino Del Regno [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=719d4716-8123-43cd-a646-118684565c6e@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=justin.yeh@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®