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
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
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>
fi

# shellcheck disable=SC1090
. "$INIT_ENV"
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.

init_env is sourced unconditionally.

Not a functional blocker, but it is inconsistent with the current repo convention and can re-source init_env unnecessarily if launched through a wrapper that already loaded it.

Recommended fix:

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

echo "$TESTNAME SKIP" >"$res_file"
log_info "Checking if required tools are available..."
if ! check_dependencies grep find basename cat readlink head; then
log_skip "$TESTNAME SKIP - missing required grep/find utility"
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 dependency list is now fixed, but the log message still only says grep/find.

If basename, cat, readlink, or head is missing, the skip message will be misleading.

log_pass "qcom_scm platform driver is registered on the platform bus."
else
log_fail "qcom_scm platform driver is NOT registered on the platform bus."
fail_flag=1
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 hard check is fine, but if it fails, it still does not print available SCM-like platform drivers.

If the driver name/path changes across kernel versions, the failure will not show enough context.

log_info "--- TEE/TrustZone device node presence ---"
tee_found=0
for tee_node in /dev/tee0 /dev/teepriv0; do
if [ -c "$tee_node" ]; 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.

README still says TEE node presence is mandatory.

Impact: Script behavior and documentation disagree.

Recommended fix: Update README table and note. See README comment below.

| 4 | **Driver-to-device binding** | Symlinks under `/sys/bus/platform/drivers/qcom_scm/` | Yes |
| 5 | **sysfs attribute readability** | `/sys/module/qcom_scm/parameters/*` | Yes |
| 6 | **Device uevent / modalias** | `<bound_device>/uevent` | Informational |
| 7 | **TEE / TrustZone device node** | `/dev/tee0`, `/dev/teepriv0` | Yes |
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.

Current script treats missing TEE nodes as WARN, not FAIL.

Impact: Documentation gives the wrong test expectation.

Recommended fix:

| 7 | TEE / TrustZone device node | /dev/tee0, /dev/teepriv0 | Informational |

or:

| 7 | TEE / TrustZone device node | /dev/tee0, /dev/teepriv0 | Warning only |


> **Informational checks** log their findings but do not cause the test to WARN
> when the path is absent. This handles platforms where `CONFIG_TEE` or runtime
> PM exposure is optional.
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.

This sentence is confusing. Informational checks do not cause the test to fail, but they may log a warning. The current script logs log_warn for missing TEE nodes.

Impact: The README wording contradicts the script and is hard to understand.

Recommended fix:

Informational checks may log warnings, but they do not cause the test to
FAIL when the path is absent. This handles platforms where CONFIG_TEE or
related runtime exposure is optional.

2. **Verify Transfer**: Ensure that the repo has been successfully copied to the target device.
3. **Run Scripts**: Navigate to the directory where these files are copied on the target device and execute the scripts as needed.
| Requirement | Notes |
|-------------|-------|
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.

Issue: This describes the check but does not state that absence is warning-only.

Impact: Users may still assume missing TEE nodes fail the test.

Recommended fix:

  1. TEE / TrustZone device node — Checks for the character devices /dev/tee0
    and /dev/teepriv0. These are created by the TEE subsystem when CONFIG_TEE
    is enabled. Absence is logged as a warning only and does not fail the test.

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