Re: [PATCH v3] soc: qcom: ubwc: Fix link error when QCOM_SMEM=n

[email protected]
Newsgroups dev.linux.lists.imx
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] The patch adds `depends on QCOM_SMEM` to `QCOM_UBWC_CONFIG` but fails to update `VIDEO_QCOM_IRIS` which unconditionally selects it, leading to a Kconfig unmet dependency warning and a link error when `QCOM_SMEM=n`.
- [High] When `DRM_MSM` is built-in (`y`) and `QCOM_SMEM` is a module (`m`), the new conditional select forces `QCOM_UBWC_CONFIG` to `m`, resulting in undefined references to `qcom_ubwc_config_get_data` during vmlinux linkage.
--

--- Patch [1]: [PATCH v3] soc: qcom: ubwc: Fix link error when QCOM_SMEM=n ---
commit dd72552ce5111faee423365870490e3e7c98c8db
Author: Daniel Baluta <[email protected]>

soc: qcom: ubwc: Fix link error when QCOM_SMEM=n

DRM_MSM unconditionally selects QCOM_UBWC_CONFIG, which calls SMEM APIs,
causing a link error on non-Qcom platforms. Make QCOM_UBWC_CONFIG depend
on QCOM_SMEM to make the requirement explicit, and guard the select in
DRM_MSM with ARCH_QCOM && QCOM_SMEM.

Link: https://lore.kernel.org/imx/20260811223622.GA934543@ax162/T/#t
Link: https://lore.kernel.org/imx/sy2ulk536ryakhy6fdnqr4asvzvufqk3dlo2awdrfomulyf4n4@qtp4qoazqmhj/T/#t

> diff --git a/drivers/gpu/drm/msm/Kconfig b/drivers/gpu/drm/msm/Kconfig
> index 09469d56513b0..1670dbc9464c6 100644
> --- a/drivers/gpu/drm/msm/Kconfig
> +++ b/drivers/gpu/drm/msm/Kconfig
[ ... ]
> @@ -22,7 +22,7 @@ config DRM_MSM
>  	select TMPFS
>  	select QCOM_SCM
>  	select QCOM_PAS
> -	select QCOM_UBWC_CONFIG
> +	select QCOM_UBWC_CONFIG if ARCH_QCOM && QCOM_SMEM

[Severity: High]
If DRM_MSM is built-in (=y) and QCOM_SMEM is a module (=m), this conditional
select expression evaluates to 'm'. This leaves QCOM_UBWC_CONFIG configured as
a module (=m) while DRM_MSM is built-in.

Because include/linux/soc/qcom/ubwc.h uses IS_ENABLED(CONFIG_QCOM_UBWC_CONFIG),
which evaluates to true for both built-in and modules:

#if IS_ENABLED(CONFIG_QCOM_UBWC_CONFIG)
const struct qcom_ubwc_cfg_data *qcom_ubwc_config_get_data(void);
#else
static inline const struct qcom_ubwc_cfg_data *qcom_ubwc_config_get_data(void)
...

Doesn't this result in an undefined reference to qcom_ubwc_config_get_data
when linking vmlinux, since the static inline stub is not provided? Should
IS_REACHABLE() be used in the header instead, or should the dependency be
adjusted?

>  	select WANT_DEV_COREDUMP
>  	select SND_SOC_HDMI_CODEC if SND_SOC
>  	select SYNC_FILE
> diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
> index fd4d4ecd2df0f..e0629e9328c87 100644
> --- a/drivers/soc/qcom/Kconfig
> +++ b/drivers/soc/qcom/Kconfig
[ ... ]
> @@ -321,6 +321,7 @@ config QCOM_QMI_HELPERS
>  
>  config QCOM_UBWC_CONFIG
>  	tristate
> +	depends on QCOM_SMEM

[Severity: High]
By adding this dependency, doesn't this create an unmet dependency for
VIDEO_QCOM_IRIS which also selects QCOM_UBWC_CONFIG?

In drivers/media/platform/qcom/iris/Kconfig:

config VIDEO_QCOM_IRIS
    ...
    select QCOM_UBWC_CONFIG

When a config symbol uses select, it must have dependencies at least as
restrictive as the selected symbol. Since VIDEO_QCOM_IRIS unconditionally
selects QCOM_UBWC_CONFIG, if it is enabled while QCOM_SMEM=n, it bypasses
this new dependency.

Will this cause Kconfig to force QCOM_UBWC_CONFIG to be built, generating
an unmet dependency warning, and failing with the exact same undefined
reference to qcom_smem_is_available that this patch intends to fix?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.