Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
* [PATCH v5 0/3] soc: qcom: ubwc: Fix link error when QCOM_SMEM=n
@ 2026-08-14 14:17 Daniel Baluta
  2026-08-14 14:17 ` [PATCH v5 1/3] drm/msm: Guard the QCOM_UBWC_CONFIG select with QCOM_SMEM Daniel Baluta
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Daniel Baluta @ 2026-08-14 14:17 UTC (permalink / raw)
  To: andersson, konradybcio
  Cc: dmitry.baryshkov, linux-arm-msm, linux-kernel, nathan, imx,
	Daniel Baluta

DRM_MSM and VIDEO_QCOM_IRIS select QCOM_UBWC_CONFIG, whose
ubwc_config.c calls QCOM_SMEM APIs unconditionally. On configs without
QCOM_SMEM this fails to link, e.g. on SOC_IMX5:

  arm-linux-gnueabihf-ld: ubwc_config.c:(.text+0x2c): undefined
      reference to 'qcom_smem_is_available'

Fix it by making the QCOM_SMEM requirement explicit in Kconfig.

Changes since v4: (fixed coments from sashiko bot)
- Dropped the IS_REACHABLE() patch. As pointed out in review, it did not
  fix the case where DRM_MSM=y and QCOM_SMEM=m. it only masked the mismatch
  at build time and turned it into a guaranteed runtime probe failure,
  since all callers abort when qcom_ubwc_config_get_data() returns an
  error. Instead the mismatch is now made unconfigurable with
  'depends on QCOM_SMEM || QCOM_SMEM=n' on both drivers, so the header
  keeps the plain IS_ENABLED() test.
- Reordered so the selects are guarded first and the QCOM_SMEM
  dependency is added to QCOM_UBWC_CONFIG last so that we dont break
  bisection as pointed by Nathan

Link to v4:
  - https://lore.kernel.org/imx/20260812151934.709198-1-daniel.baluta@nxp.com/

Daniel Baluta (3):
  drm/msm: Guard the QCOM_UBWC_CONFIG select with QCOM_SMEM
  media: iris: Guard the QCOM_UBWC_CONFIG select with QCOM_SMEM
  soc: qcom: ubwc: Fix link error when QCOM_SMEM=n

 drivers/gpu/drm/msm/Kconfig              | 3 ++-
 drivers/media/platform/qcom/iris/Kconfig | 3 ++-
 drivers/soc/qcom/Kconfig                 | 1 +
 3 files changed, 5 insertions(+), 2 deletions(-)

-- 
2.45.2


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v5 1/3] drm/msm: Guard the QCOM_UBWC_CONFIG select with QCOM_SMEM
  2026-08-14 14:17 [PATCH v5 0/3] soc: qcom: ubwc: Fix link error when QCOM_SMEM=n Daniel Baluta
@ 2026-08-14 14:17 ` Daniel Baluta
  2026-08-14 14:23   ` sashiko-bot
                     ` (2 more replies)
  2026-08-14 14:17 ` [PATCH v5 2/3] media: iris: " Daniel Baluta
  2026-08-14 14:17 ` [PATCH v5 3/3] soc: qcom: ubwc: Fix link error when QCOM_SMEM=n Daniel Baluta
  2 siblings, 3 replies; 7+ messages in thread
From: Daniel Baluta @ 2026-08-14 14:17 UTC (permalink / raw)
  To: andersson, konradybcio
  Cc: dmitry.baryshkov, linux-arm-msm, linux-kernel, nathan, imx,
	Daniel Baluta

QCOM_UBWC_CONFIG is about to depend on QCOM_SMEM. Guard the DRM_MSM
select with 'if ARCH_QCOM && QCOM_SMEM', and add
'depends on QCOM_SMEM || QCOM_SMEM=n' so a built-in driver is never
selected against a missing or modular SMEM.

Fixes: 1b445022d1d0 ("soc: qcom: ubwc: Get HBB from SMEM")
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
---
 drivers/gpu/drm/msm/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/Kconfig b/drivers/gpu/drm/msm/Kconfig
index 09469d56513b0..ed1c4775d1e92 100644
--- a/drivers/gpu/drm/msm/Kconfig
+++ b/drivers/gpu/drm/msm/Kconfig
@@ -11,6 +11,7 @@ config DRM_MSM
 	depends on QCOM_OCMEM || QCOM_OCMEM=n
 	depends on QCOM_LLCC || QCOM_LLCC=n
 	depends on QCOM_COMMAND_DB || QCOM_COMMAND_DB=n
+	depends on QCOM_SMEM || QCOM_SMEM=n
 	depends on PM
 	select IOMMU_IO_PGTABLE
 	select QCOM_MDT_LOADER if ARCH_QCOM
@@ -22,7 +23,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
 	select WANT_DEV_COREDUMP
 	select SND_SOC_HDMI_CODEC if SND_SOC
 	select SYNC_FILE
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v5 2/3] media: iris: Guard the QCOM_UBWC_CONFIG select with QCOM_SMEM
  2026-08-14 14:17 [PATCH v5 0/3] soc: qcom: ubwc: Fix link error when QCOM_SMEM=n Daniel Baluta
  2026-08-14 14:17 ` [PATCH v5 1/3] drm/msm: Guard the QCOM_UBWC_CONFIG select with QCOM_SMEM Daniel Baluta
@ 2026-08-14 14:17 ` Daniel Baluta
  2026-08-14 14:17 ` [PATCH v5 3/3] soc: qcom: ubwc: Fix link error when QCOM_SMEM=n Daniel Baluta
  2 siblings, 0 replies; 7+ messages in thread
From: Daniel Baluta @ 2026-08-14 14:17 UTC (permalink / raw)
  To: andersson, konradybcio
  Cc: dmitry.baryshkov, linux-arm-msm, linux-kernel, nathan, imx,
	Daniel Baluta

QCOM_UBWC_CONFIG is about to depend on QCOM_SMEM. Guard the
VIDEO_QCOM_IRIS select with 'if ARCH_QCOM && QCOM_SMEM', and add
'depends on QCOM_SMEM || QCOM_SMEM=n' so a built-in driver is never
selected against a missing or modular SMEM.

Fixes: c43207553867 ("media: iris: retrieve UBWC platform configuration")
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
---
 drivers/media/platform/qcom/iris/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/qcom/iris/Kconfig b/drivers/media/platform/qcom/iris/Kconfig
index 388c9bbc81365..0996213e71e7a 100644
--- a/drivers/media/platform/qcom/iris/Kconfig
+++ b/drivers/media/platform/qcom/iris/Kconfig
@@ -2,11 +2,12 @@ config VIDEO_QCOM_IRIS
 	tristate "Qualcomm iris V4L2 decoder driver"
 	depends on VIDEO_DEV
 	depends on ARCH_QCOM || COMPILE_TEST
+	depends on QCOM_SMEM || QCOM_SMEM=n
 	select V4L2_MEM2MEM_DEV
 	select QCOM_MDT_LOADER
 	select QCOM_SCM
 	select QCOM_PAS
-	select QCOM_UBWC_CONFIG
+	select QCOM_UBWC_CONFIG if ARCH_QCOM && QCOM_SMEM
 	select VIDEOBUF2_DMA_CONTIG
 	help
 	  This is a V4L2 driver for Qualcomm iris video accelerator
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v5 3/3] soc: qcom: ubwc: Fix link error when QCOM_SMEM=n
  2026-08-14 14:17 [PATCH v5 0/3] soc: qcom: ubwc: Fix link error when QCOM_SMEM=n Daniel Baluta
  2026-08-14 14:17 ` [PATCH v5 1/3] drm/msm: Guard the QCOM_UBWC_CONFIG select with QCOM_SMEM Daniel Baluta
  2026-08-14 14:17 ` [PATCH v5 2/3] media: iris: " Daniel Baluta
@ 2026-08-14 14:17 ` Daniel Baluta
  2 siblings, 0 replies; 7+ messages in thread
From: Daniel Baluta @ 2026-08-14 14:17 UTC (permalink / raw)
  To: andersson, konradybcio
  Cc: dmitry.baryshkov, linux-arm-msm, linux-kernel, nathan, imx,
	Daniel Baluta

ubwc_config.c calls qcom_smem_is_available() and qcom_smem_dram_get_hbb()
unconditionally, so QCOM_UBWC_CONFIG=y with QCOM_SMEM=n fails to link:

  arm-linux-gnueabihf-ld: ubwc_config.c:(.text+0x2c): undefined
      reference to 'qcom_smem_is_available'

Add the missing 'depends on QCOM_SMEM'.

Fixes: 1b445022d1d0 ("soc: qcom: ubwc: Get HBB from SMEM")
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
---
 drivers/soc/qcom/Kconfig | 1 +
 1 file changed, 1 insertion(+)

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
 	help
 	  Most Qualcomm SoCs feature a number of Universal Bandwidth Compression
 	  (UBWC) engines across various IP blocks, which need to be initialized
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v5 1/3] drm/msm: Guard the QCOM_UBWC_CONFIG select with QCOM_SMEM
  2026-08-14 14:17 ` [PATCH v5 1/3] drm/msm: Guard the QCOM_UBWC_CONFIG select with QCOM_SMEM Daniel Baluta
@ 2026-08-14 14:23   ` sashiko-bot
  2026-08-14 14:36   ` Dmitry Baryshkov
  2026-08-14 14:47   ` Dmitry Baryshkov
  2 siblings, 0 replies; 7+ messages in thread
From: sashiko-bot @ 2026-08-14 14:23 UTC (permalink / raw)
  To: Daniel Baluta; +Cc: Frank.Li, imx

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Incomplete Kconfig dependency preparation: VIDEO_QCOM_IRIS also selects QCOM_UBWC_CONFIG without a QCOM_SMEM guard.
--

--- Patch [1]: [PATCH v5 1/3] drm/msm: Guard the QCOM_UBWC_CONFIG select with QCOM_SMEM ---
commit 720508af65c7d5604eab7fac5015d0cc98c646e0
Author: Daniel Baluta <daniel.baluta@nxp.com>

drm/msm: Guard the QCOM_UBWC_CONFIG select with QCOM_SMEM

This commit prepares DRM_MSM for an upcoming change where QCOM_UBWC_CONFIG
will depend on QCOM_SMEM. It guards the select statement and adds a dependency
to prevent a built-in DRM_MSM from selecting against a modular SMEM.

Fixes: 1b445022d1d0 ("soc: qcom: ubwc: Get HBB from SMEM")

> diff --git a/drivers/gpu/drm/msm/Kconfig b/drivers/gpu/drm/msm/Kconfig
> index 09469d56513b0..ed1c4775d1e92 100644
> --- a/drivers/gpu/drm/msm/Kconfig
> +++ b/drivers/gpu/drm/msm/Kconfig
[ ... ]
> @@ -22,7 +23,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: Low]
Will the upcoming change to make QCOM_UBWC_CONFIG depend on QCOM_SMEM
trigger Kconfig unmet direct dependency warnings elsewhere?

It looks like VIDEO_QCOM_IRIS also unconditionally selects QCOM_UBWC_CONFIG:

drivers/media/platform/qcom/iris/Kconfig:
config VIDEO_QCOM_IRIS
	...
	select QCOM_UBWC_CONFIG

If the SMEM dependency lands before the iris driver is updated, could this
cause a build breakage when compiling with VIDEO_QCOM_IRIS=y and QCOM_SMEM=n?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260814141724.1006382-1-daniel.baluta@nxp.com?part=1

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v5 1/3] drm/msm: Guard the QCOM_UBWC_CONFIG select with QCOM_SMEM
  2026-08-14 14:17 ` [PATCH v5 1/3] drm/msm: Guard the QCOM_UBWC_CONFIG select with QCOM_SMEM Daniel Baluta
  2026-08-14 14:23   ` sashiko-bot
@ 2026-08-14 14:36   ` Dmitry Baryshkov
  2026-08-14 14:47   ` Dmitry Baryshkov
  2 siblings, 0 replies; 7+ messages in thread
From: Dmitry Baryshkov @ 2026-08-14 14:36 UTC (permalink / raw)
  To: Daniel Baluta
  Cc: andersson, konradybcio, linux-arm-msm, linux-kernel, nathan, imx

On Fri, Aug 14, 2026 at 05:17:22PM +0300, Daniel Baluta wrote:
> QCOM_UBWC_CONFIG is about to depend on QCOM_SMEM. Guard the DRM_MSM
> select with 'if ARCH_QCOM && QCOM_SMEM', and add
> 'depends on QCOM_SMEM || QCOM_SMEM=n' so a built-in driver is never
> selected against a missing or modular SMEM.
> 
> Fixes: 1b445022d1d0 ("soc: qcom: ubwc: Get HBB from SMEM")
> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
> ---
>  drivers/gpu/drm/msm/Kconfig | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v5 1/3] drm/msm: Guard the QCOM_UBWC_CONFIG select with QCOM_SMEM
  2026-08-14 14:17 ` [PATCH v5 1/3] drm/msm: Guard the QCOM_UBWC_CONFIG select with QCOM_SMEM Daniel Baluta
  2026-08-14 14:23   ` sashiko-bot
  2026-08-14 14:36   ` Dmitry Baryshkov
@ 2026-08-14 14:47   ` Dmitry Baryshkov
  2 siblings, 0 replies; 7+ messages in thread
From: Dmitry Baryshkov @ 2026-08-14 14:47 UTC (permalink / raw)
  To: Daniel Baluta
  Cc: andersson, konradybcio, linux-arm-msm, linux-kernel, nathan, imx

On Fri, Aug 14, 2026 at 05:17:22PM +0300, Daniel Baluta wrote:
> QCOM_UBWC_CONFIG is about to depend on QCOM_SMEM. Guard the DRM_MSM
> select with 'if ARCH_QCOM && QCOM_SMEM', and add
> 'depends on QCOM_SMEM || QCOM_SMEM=n' so a built-in driver is never
> selected against a missing or modular SMEM.
> 
> Fixes: 1b445022d1d0 ("soc: qcom: ubwc: Get HBB from SMEM")
> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
> ---
>  drivers/gpu/drm/msm/Kconfig | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 

FWIW, for taking it through soc tree:


Acked-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

(Rob was also fine with that in private communication)

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-08-14 14:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-14 14:17 [PATCH v5 0/3] soc: qcom: ubwc: Fix link error when QCOM_SMEM=n Daniel Baluta
2026-08-14 14:17 ` [PATCH v5 1/3] drm/msm: Guard the QCOM_UBWC_CONFIG select with QCOM_SMEM Daniel Baluta
2026-08-14 14:23   ` sashiko-bot
2026-08-14 14:36   ` Dmitry Baryshkov
2026-08-14 14:47   ` Dmitry Baryshkov
2026-08-14 14:17 ` [PATCH v5 2/3] media: iris: " Daniel Baluta
2026-08-14 14:17 ` [PATCH v5 3/3] soc: qcom: ubwc: Fix link error when QCOM_SMEM=n Daniel Baluta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox