Skip to content

kgsl: build: Stub out governors skipped for simple_ondemand - #23

Closed
Ricardo Salveti (ricardosalveti) wants to merge 1 commit into
qualcomm-linux:gfx-kernel.le.0.0from
ricardosalveti:fix-simple-ondemand-governor-stubs
Closed

Ricardo Salveti (ricardosalveti) wants to merge 1 commit into
qualcomm-linux:gfx-kernel.le.0.0from
ricardosalveti:fix-simple-ondemand-governor-stubs

Conversation

@ricardosalveti

Copy link
Copy Markdown

Commits b47b4a8 ("kgsl: build: Skip governor files when simple_ondemand governor is selected") and e741eff ("kgsl: build: Fix governor name string comparison in Kbuild") stopped building governor_msm_adreno_tz.c and governor_gpubw_mon.c for simple_ondemand, but kgsl_pwrscale.h still declares their functions extern. msm_kgsl.ko then only links if the compiler inlines the static functions called once in kgsl_pwrscale.c and drops the msm-adreno-tz path, so kernels with
CONFIG_DEBUG_SECTION_MISMATCH=y (which adds
-fno-inline-functions-called-once) fail in modpost:

ERROR: modpost: msm_kgsl.ko: symbol 'msm_adreno_tz_init' undefined!
ERROR: modpost: msm_kgsl.ko: symbol 'devfreq_gpubw_exit' undefined!
ERROR: modpost: msm_kgsl.ko: symbol 'devfreq_gpubw_init' undefined!

Set CONFIG_QCOM_KGSL_SKIP_MSM_GOVERNORS in a single place when simple_ondemand is selected, use it to skip the governor objects, and make the governor API, including msm_adreno_tz_reinit(), fall back to inline stubs when it is set.

Commits b47b4a8 ("kgsl: build: Skip governor files when simple_ondemand
governor is selected") and e741eff ("kgsl: build: Fix governor name
string comparison in Kbuild") stopped building governor_msm_adreno_tz.c
and governor_gpubw_mon.c for simple_ondemand, but kgsl_pwrscale.h still
declares their functions extern. msm_kgsl.ko then only links if the
compiler inlines the static functions called once in kgsl_pwrscale.c and
drops the msm-adreno-tz path, so kernels with
CONFIG_DEBUG_SECTION_MISMATCH=y (which adds
-fno-inline-functions-called-once) fail in modpost:

  ERROR: modpost: msm_kgsl.ko: symbol 'msm_adreno_tz_init' undefined!
  ERROR: modpost: msm_kgsl.ko: symbol 'devfreq_gpubw_exit' undefined!
  ERROR: modpost: msm_kgsl.ko: symbol 'devfreq_gpubw_init' undefined!

Set CONFIG_QCOM_KGSL_SKIP_MSM_GOVERNORS in a single place when
simple_ondemand is selected, use it to skip the governor objects, and
make the governor API, including msm_adreno_tz_reinit(), fall back to
inline stubs when it is set.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
@qualcomm-ai-code-review-assistant

Copy link
Copy Markdown

Qualcomm AI Review

Click to expand Deep Code Review

Summary

Issues: 🔴0 🟠0 🟡0 🟢1 → Minor improvements suggested

Issues

🟢 [BUG] msm_adreno_tz_reinit stub keyed only on SKIP flag, inconsistent with other stubs

/apps/qgenie_code_agent/Github/qualcomm-linux/kgsl/fix-simple-ondemand-governor-stubs/73c490dd1abc240bee7bc6de579fa2fccc8b4504/repo/msm_adreno_devfreq.h:L82-L83 msm_adreno_tz_reinit() is stubbed to return 0 whenever CONFIG_QCOM_KGSL_SKIP_MSM_GOVERNORS is set, even if CONFIG_DEVFREQ_GOV_QCOM_ADRENO_TZ is provided externally. In that configuration, governor_reinit() in adreno.c would silently skip the real reinit for the runtime-selected msm-adreno-tz governor and report success.

Problematic Code:

#if IS_ENABLED(CONFIG_QCOM_KGSL_SKIP_MSM_GOVERNORS)
static inline int msm_adreno_tz_reinit(

Recommended Fix:

/*
 * Only stub out reinit when the governor is skipped and no external
 * msm-adreno-tz governor provides the real implementation.
 */
#if IS_ENABLED(CONFIG_QCOM_KGSL_SKIP_MSM_GOVERNORS) && \
	!IS_ENABLED(CONFIG_DEVFREQ_GOV_QCOM_ADRENO_TZ)
static inline int msm_adreno_tz_reinit(

⚠️ This review was generated using AI assistance. Please verify all suggestions before applying.

@ricardosalveti

Copy link
Copy Markdown
Author

quic-ksanadhy mind a review?

@ricardosalveti

Copy link
Copy Markdown
Author

Merged as df04fd1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant