* [PATCH] firmware: ti_sci: Fix compilation failure when CONFIG_TI_SCI_PROTOCOL=m
@ 2024-10-16 1:39 Zeng Heng
2024-10-16 16:03 ` Mathieu Poirier
0 siblings, 1 reply; 2+ messages in thread
From: Zeng Heng @ 2024-10-16 1:39 UTC (permalink / raw)
To: nm, kristo, ssantosh; +Cc: linux-kernel, linux-arm-kernel, bobo.shaobowang
When build with CONFIG_TI_SCI_PROTOCOL=m && CONFIG_TI_K3_M4_REMOTEPROC=y,
compilation tool chain would throw the following error message:
arm-linux-gnueabi-ld: drivers/remoteproc/ti_k3_m4_remoteproc.o:
in function `k3_m4_rproc_probe':
ti_k3_m4_remoteproc.c:(.text+0xc24):
undefined reference to `devm_ti_sci_get_by_phandle'
This is because devm_ti_sci_get_by_phandle() is compiled into the driver
module rather than compiled into kernel, it causes compilation couldn't
find the reference of devm_ti_sci_get_by_phandle() when tool chain tries
to link ti_k3_m4_remoteproc.o into kernel image.
Replace IS_ENABLED with IS_REACHABLE to fix the problem.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/all/202410150837.FOGlkGvW-lkp@intel.com/
Fixes: aa276781a64a ("firmware: Add basic support for TI System Control Interface (TI-SCI) protocol")
Signed-off-by: Zeng Heng <zengheng4@huawei.com>
---
include/linux/soc/ti/ti_sci_protocol.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/soc/ti/ti_sci_protocol.h b/include/linux/soc/ti/ti_sci_protocol.h
index bd0d11af76c5..cd44ee7f294b 100644
--- a/include/linux/soc/ti/ti_sci_protocol.h
+++ b/include/linux/soc/ti/ti_sci_protocol.h
@@ -572,7 +572,7 @@ struct ti_sci_resource {
struct ti_sci_resource_desc *desc;
};
-#if IS_ENABLED(CONFIG_TI_SCI_PROTOCOL)
+#if IS_REACHABLE(CONFIG_TI_SCI_PROTOCOL)
const struct ti_sci_handle *ti_sci_get_handle(struct device *dev);
int ti_sci_put_handle(const struct ti_sci_handle *handle);
const struct ti_sci_handle *devm_ti_sci_get_handle(struct device *dev);
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] firmware: ti_sci: Fix compilation failure when CONFIG_TI_SCI_PROTOCOL=m
2024-10-16 1:39 [PATCH] firmware: ti_sci: Fix compilation failure when CONFIG_TI_SCI_PROTOCOL=m Zeng Heng
@ 2024-10-16 16:03 ` Mathieu Poirier
0 siblings, 0 replies; 2+ messages in thread
From: Mathieu Poirier @ 2024-10-16 16:03 UTC (permalink / raw)
To: Zeng Heng
Cc: nm, kristo, ssantosh, linux-kernel, linux-arm-kernel,
bobo.shaobowang
On Wed, Oct 16, 2024 at 09:39:22AM +0800, Zeng Heng wrote:
> When build with CONFIG_TI_SCI_PROTOCOL=m && CONFIG_TI_K3_M4_REMOTEPROC=y,
> compilation tool chain would throw the following error message:
>
> arm-linux-gnueabi-ld: drivers/remoteproc/ti_k3_m4_remoteproc.o:
> in function `k3_m4_rproc_probe':
> ti_k3_m4_remoteproc.c:(.text+0xc24):
> undefined reference to `devm_ti_sci_get_by_phandle'
>
> This is because devm_ti_sci_get_by_phandle() is compiled into the driver
> module rather than compiled into kernel, it causes compilation couldn't
> find the reference of devm_ti_sci_get_by_phandle() when tool chain tries
> to link ti_k3_m4_remoteproc.o into kernel image.
>
> Replace IS_ENABLED with IS_REACHABLE to fix the problem.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/all/202410150837.FOGlkGvW-lkp@intel.com/
> Fixes: aa276781a64a ("firmware: Add basic support for TI System Control Interface (TI-SCI) protocol")
> Signed-off-by: Zeng Heng <zengheng4@huawei.com>
> ---
> include/linux/soc/ti/ti_sci_protocol.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/soc/ti/ti_sci_protocol.h b/include/linux/soc/ti/ti_sci_protocol.h
> index bd0d11af76c5..cd44ee7f294b 100644
> --- a/include/linux/soc/ti/ti_sci_protocol.h
> +++ b/include/linux/soc/ti/ti_sci_protocol.h
> @@ -572,7 +572,7 @@ struct ti_sci_resource {
> struct ti_sci_resource_desc *desc;
> };
>
> -#if IS_ENABLED(CONFIG_TI_SCI_PROTOCOL)
> +#if IS_REACHABLE(CONFIG_TI_SCI_PROTOCOL)
I have applied Arnd's patch [1] to fix this problem.
Thanks,
Mathieu
[1]. https://lore.kernel.org/lkml/e6c84b91-20ce-474a-87f8-9faeb64f3724@app.fastmail.com/T/
> const struct ti_sci_handle *ti_sci_get_handle(struct device *dev);
> int ti_sci_put_handle(const struct ti_sci_handle *handle);
> const struct ti_sci_handle *devm_ti_sci_get_handle(struct device *dev);
> --
> 2.25.1
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-10-16 16:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-16 1:39 [PATCH] firmware: ti_sci: Fix compilation failure when CONFIG_TI_SCI_PROTOCOL=m Zeng Heng
2024-10-16 16:03 ` Mathieu Poirier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).