Skip to content

fix: update shmbridge testcase#446

Open
vnarapar wants to merge 1 commit into
qualcomm-linux:mainfrom
vnarapar:shmbridge
Open

fix: update shmbridge testcase#446
vnarapar wants to merge 1 commit into
qualcomm-linux:mainfrom
vnarapar:shmbridge

Conversation

@vnarapar
Copy link
Copy Markdown
Contributor

@vnarapar vnarapar commented May 8, 2026

This test validates the presence, registration, and correct runtime state of the qcom_scm driver on the target device

Copy link
Copy Markdown
Contributor

@smuppand smuppand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The direction is good: this expands shmbridge from a simple qcom_scm presence/log check into stronger runtime validation for sysfs, DT, platform driver registration, binding, attributes, and uevent information.

A few changes are needed

Comment thread Runner/suites/Kernel/Baseport/shmbridge/run.sh Outdated
Comment thread Runner/suites/Kernel/Baseport/shmbridge/run.sh
Comment thread Runner/suites/Kernel/Baseport/shmbridge/run.sh
Comment thread Runner/suites/Kernel/Baseport/shmbridge/run.sh
scm_uevent_found=0
for dev_link in /sys/bus/platform/drivers/qcom_scm/*; do
[ -L "$dev_link" ] || continue
dev_path=$(readlink -f "$dev_link" 2>/dev/null)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

readlink is used but not checked. Also, readlink -f can vary on minimal BusyBox systems. The uevent/modalias check can silently degrade.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added check for readlink

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added check for readlink

If readlink -f fails, dev_path becomes empty and the script silently checks /uevent.

Comment thread Runner/suites/Kernel/Baseport/shmbridge/run.sh
Comment thread Runner/suites/Kernel/Baseport/shmbridge/run.sh
Comment thread Runner/suites/Kernel/Baseport/shmbridge/README.md Outdated
Comment thread Runner/suites/Kernel/Baseport/shmbridge/run.sh Outdated
Comment thread Runner/suites/Kernel/Baseport/shmbridge/run.sh Outdated
Comment thread Runner/suites/Kernel/Baseport/shmbridge/run.sh
Comment thread Runner/suites/Kernel/Baseport/shmbridge/run.sh
Comment thread Runner/suites/Kernel/Baseport/shmbridge/README.md Outdated
Comment thread Runner/suites/Kernel/Baseport/shmbridge/README.md Outdated
Comment thread Runner/suites/Kernel/Baseport/shmbridge/README.md
This test validates the presence, registration, and correct runtime state of the
qcom_scm driver on the target device

Signed-off-by: Vamsee Narapareddi <vnarapar@qti.qualcomm.com>

# shellcheck disable=SC1090
. "$INIT_ENV"
if [ "${__INIT_ENV_LOADED:-}" ]; then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The guard is inverted. This sources init_env only when __INIT_ENV_LOADED is already set. On a normal first-time run, init_env will not be sourced, but the script still immediately sources "$TOOLS/functestlib.sh"

should be

if [ -z "${__INIT_ENV_LOADED:-}" ]; then
    # shellcheck disable=SC1090
    . "$INIT_ENV"
fi

if ! check_kernel_config "CONFIG_QCOM_SCM"; then
log_skip "$TESTNAME : CONFIG_QCOM_SCM not enabled, test Skipped"
echo "$TESTNAME SKIP" > "$res_file"
log_fail "$TESTNAME : CONFIG_QCOM_SCM not enabled, test Skipped"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The log says “Skipped”, but the result file writes FAIL.

scm_uevent_found=0
for dev_link in /sys/bus/platform/drivers/qcom_scm/*; do
[ -L "$dev_link" ] || continue
dev_path=$(readlink -f "$dev_link" 2>/dev/null)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added check for readlink

If readlink -f fails, dev_path becomes empty and the script silently checks /uevent.

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.

2 participants