From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86DD63CAA3F for ; Tue, 23 Jun 2026 08:06:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782202002; cv=none; b=ECquNB7t2u8q6YB3FrkzSMCxaUnTVco0cwh1kalV8ISuSy3Jfwih+8gm7+qT08ujwAvW+cAfyeziX+kryAnMalkBFYXBkHzf9T95rVbeFoxk6T4EagaP2Hehxv4EloWLtcJHEDR4o/wrwBM33+pNBHKX7lMLO7GNdJpfyDmz2WY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782202002; c=relaxed/simple; bh=2ModYSRenKENVNmwQIj/emlMitTe1H/N34OtBHiupCw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=r+ucixFghLqKq7bBL8DfMr2GYDl6bPoaE0sugVM7wLsbutZAOwKH1zPNVLuowloDnFCmaaOrXZ8nqMOJ87MyiEw9E5Vw8wj33+AtSZSH2JjY6+BaqkpOFfQg0migJyrnj7ylhDdTUj3XwqtKKYCfwr9/Jimex6yib0v39Pud2R4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=DMNcKReb; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="DMNcKReb" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1782201998; bh=2ModYSRenKENVNmwQIj/emlMitTe1H/N34OtBHiupCw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=DMNcKRebgTvdvGNXIb4BUldrfwuq9bfEaX3+xBZ/8/IIdOXYhMgdriWi/BPF0EBym s/iFQsUsyLwkwPgjMSJPdcUYMNx/E+J/CNcPQopJvfqcn80J8fDBShN9U2xvvo33tK ACE3yMrIyZCopEKVkAEbjqAZ18EuKM45KLOZu7hxm+8B1o+GWDO/Ks57CM4TdopDdP tj24t/J6WdHg4Axc8i7b3HBjHEVZzTo7fqtHlzpS2m9qjDTc3ECR1LhQLGut3n/d11 Bn05pJt5IWODSUrNVQnh39TJV78cWXHUiIqCdE790xUoamf6z5ph0FJi4vydC1Sqsp iL9Oe1JTagVzQ== Received: from [100.64.1.21] (unknown [100.64.1.21]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by bali.collaboradmins.com (Postfix) with ESMTPSA id 8A3D317E0E64; Tue, 23 Jun 2026 10:06:38 +0200 (CEST) Message-ID: <719d4716-8123-43cd-a646-118684565c6e@collabora.com> Date: Tue, 23 Jun 2026 10:06:38 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] soc: mediatek: mtk-infracfg: Export symbols for DDK modules To: Justin Yeh , Matthias Brugger Cc: Project_Global_Chrome_Upstream_Group@mediatek.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org References: <20260529101613.55697-1-justin.yeh@mediatek.com> <20260529101613.55697-3-justin.yeh@mediatek.com> From: AngeloGioacchino Del Regno Content-Language: en-US In-Reply-To: <20260529101613.55697-3-justin.yeh@mediatek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 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 > --- > 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 > #include > #include > +#include > #include > #include > > @@ -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 */