-
Notifications
You must be signed in to change notification settings - Fork 35
fix: update shmbridge testcase #446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
vnarapar
wants to merge
1
commit into
qualcomm-linux:main
Choose a base branch
from
vnarapar:shmbridge
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+241
−66
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,56 +1,143 @@ | ||
| Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. | ||
| SPDX-License-Identifier: BSD-3-Clause | ||
| # shmbridge Validation test | ||
| # Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. | ||
| # SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| # shmbridge Validation Test | ||
|
|
||
| ## Overview | ||
|
|
||
| This test case validates the presence and initialization of the Qualcomm Secure Channel Manager (QCOM_SCM) interface on the device. It ensures that: | ||
| This test validates the presence, registration, and correct runtime state of the | ||
| Qualcomm Secure Channel Manager (`qcom_scm`) driver on the target device. The | ||
| `qcom_scm` driver is the kernel-side interface to TrustZone / Secure World and is | ||
| a hard dependency for shared-memory bridge (shmbridge), SMMU, Crypto, and many | ||
| other Qualcomm subsystem drivers. | ||
|
|
||
| --- | ||
|
|
||
| - The kernel is configured with QCOM_SCM support | ||
| - The dmesg logs contain expected `qcom_scm` entries | ||
| - There are no "probe failure" messages in the logs | ||
| ## Checks Performed | ||
|
|
||
| ## Usage | ||
| | # | Check | Path / Interface | Mandatory | | ||
| |---|-------|-----------------|-----------| | ||
| | 1 | **sysfs module presence** | `/sys/module/qcom_scm` | Yes | | ||
| | 2 | **Device Tree firmware/scm node** | `/sys/firmware/devicetree/base/firmware/scm` | Yes | | ||
| | 3 | **Platform driver registration** | `/sys/bus/platform/drivers/qcom_scm` | Yes | | ||
| | 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 | | ||
|
|
||
| > **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. | ||
|
|
||
| ### Check details | ||
|
|
||
| 1. **sysfs module presence** — Confirms the `qcom_scm` driver was compiled into | ||
| the kernel (or loaded as a module) and is visible under `/sys/module`. | ||
|
|
||
| 2. **Device Tree firmware/scm node** — The `qcom_scm` driver requires a | ||
| `firmware/scm` node in the Device Tree to probe successfully. Uses the | ||
| `check_dt_nodes()` helper from `functestlib.sh`. | ||
|
|
||
| Instructions: | ||
| 3. **Platform driver registration** — Confirms the driver called | ||
| `platform_driver_register()` successfully and is listed on the platform bus. | ||
|
|
||
| 4. **Driver-to-device binding** — Confirms `probe()` completed without error by | ||
| checking that at least one symlink (bound device) exists under the driver | ||
| directory. | ||
|
|
||
| 5. **sysfs attribute readability** — Iterates all files under | ||
| `/sys/module/qcom_scm/parameters/` and verifies each can be read without an | ||
| I/O error. Logs the name and current value of each parameter (e.g. | ||
| `download_mode`). | ||
|
|
||
| 6. **Device uevent / modalias** — Reads the `uevent` file of the bound device and | ||
| validates that a `MODALIAS` entry is present, confirming correct udev/hotplug | ||
| registration. | ||
|
|
||
| 7. **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 and `qcom_scm` has successfully initialised the TrustZone interface. | ||
|
|
||
| --- | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| 1. **Copy repo to Target Device**: Use `scp` to transfer the scripts from the host to the target device. The scripts should be copied to any directory on the target device. | ||
| 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 | | ||
| |-------------|-------| | ||
| | `CONFIG_QCOM_SCM=y` or `CONFIG_QCOM_SCM=m` | Test is **failed** if this config is absent | | ||
| | `grep`, `find` | Test is **skipped** if these utilities are missing | | ||
| | `/proc/config.gz` readable | Required by `check_kernel_config()` | | ||
| | Root access | Required to read some sysfs power and uevent paths | | ||
|
|
||
| Run the SHM Bridge test using: | ||
| --- | ||
| #### Quick Example | ||
|
|
||
| ## Usage | ||
|
|
||
| ### Quick start | ||
|
|
||
| ```sh | ||
| git clone <this-repo> | ||
| cd <this-repo> | ||
| scp -r common Runner user@target_device_ip:<Path in device> | ||
| ssh user@target_device_ip | ||
| cd <Path in device>/Runner && ./run-test.sh shmbridge | ||
| scp -r Runner user@<target_ip>:<path_on_device> | ||
| ssh user@<target_ip> | ||
| cd <path_on_device>/Runner && ./run-test.sh shmbridge | ||
| ``` | ||
|
|
||
| ### Run directly on the device | ||
|
|
||
| ```sh | ||
| cd Runner | ||
| ./run-test.sh shmbridge | ||
| ``` | ||
|
|
||
| --- | ||
| ## Prerequisites | ||
| 1. zcat, grep, and dmesg must be available. | ||
| 2. Root access may be required to write to read kernel logs. | ||
| --- | ||
| ## Result Format | ||
| Test result will be saved in `shmbridge.res` as: | ||
| ## Output | ||
| A .res file is generated in the same directory: | ||
|
|
||
| `shmbridge PASS` OR `shmbridge FAIL` | ||
|
|
||
| ## Sample Log | ||
|
|
||
| ### PASS output | ||
| ``` | ||
| Output | ||
|
|
||
| [INFO] 1970-01-01 01:10:01 - ----------------------------------------------------------------------------------------- | ||
| [INFO] 1970-01-01 01:10:01 - -------------------Starting shmbridge Testcase---------------------------- | ||
| [INFO] 1970-01-01 01:10:01 - ==== Test Initialization ==== | ||
| [INFO] 1970-01-01 01:10:01 - Checking if required tools are available | ||
| [INFO] 1970-01-01 01:10:01 - Checking kernel config for QCOM_SCM support... | ||
| [PASS] 1970-01-01 01:10:01 - Kernel config CONFIG_QCOM_SCM is enabled | ||
| [INFO] 1970-01-01 01:10:01 - Scanning dmesg logs for qcom_scm initialization | ||
| [PASS] 1970-01-01 01:10:01 - shmbridge : Test Passed (qcom_scm present and no probe failures) | ||
| [INFO] 1970-01-01 01:10:01 - -------------------Completed shmbridge Testcase---------------------------- | ||
| [INFO] 2026-05-08 05:07:27 - ----------------------------------------------------------------------------------------- | ||
| [INFO] 2026-05-08 05:07:27 - -------------------Starting shmbridge Testcase---------------------------- | ||
| [INFO] 2026-05-08 05:07:27 - ==== Test Initialization ==== | ||
| [INFO] 2026-05-08 05:07:27 - Checking if required tools are available... | ||
| [INFO] 2026-05-08 05:07:27 - Checking kernel config for CONFIG_QCOM_SCM support... | ||
| [PASS] 2026-05-08 05:07:27 - Kernel config CONFIG_QCOM_SCM is enabled | ||
| [INFO] 2026-05-08 05:07:27 - --- qcom_scm sysfs module presence --- | ||
| [PASS] 2026-05-08 05:07:27 - qcom_scm module directory exists under /sys/module. | ||
| [INFO] 2026-05-08 05:07:27 - --- Device Tree firmware/scm node --- | ||
| [INFO] 2026-05-08 05:07:27 - /sys/firmware/devicetree/base/firmware/scm | ||
| [INFO] 2026-05-08 05:07:27 - /sys/firmware/devicetree/base/firmware/scm | ||
| [PASS] 2026-05-08 05:07:27 - Device tree node exists: /sys/firmware/devicetree/base/firmware/scm | ||
| [PASS] 2026-05-08 05:07:27 - Device Tree firmware/scm node is present. | ||
| [INFO] 2026-05-08 05:07:27 - --- qcom_scm platform driver registration --- | ||
| [PASS] 2026-05-08 05:07:27 - qcom_scm platform driver is registered on the platform bus. | ||
| [INFO] 2026-05-08 05:07:27 - --- qcom_scm driver-to-device binding --- | ||
| [PASS] 2026-05-08 05:07:27 - qcom_scm driver is bound to device: firmware:scm | ||
| [INFO] 2026-05-08 05:07:28 - --- qcom_scm sysfs attribute readability --- | ||
| [PASS] 2026-05-08 05:07:28 - qcom_scm sysfs attribute readable: download_mode = full | ||
| [INFO] 2026-05-08 05:07:28 - --- qcom_scm device uevent/modalias --- | ||
| [PASS] 2026-05-08 05:07:28 - qcom_scm device uevent is valid: MODALIAS=of:NscmT(null)Cqcom,scm-sa8775pCqcom,scm | ||
| [INFO] 2026-05-08 05:07:28 - --- TEE/TrustZone device node presence --- | ||
| [PASS] 2026-05-08 05:07:28 - TEE device node is present: /dev/tee0 | ||
| [INFO] 2026-05-08 05:07:28 - ----------------------------------------------------------------------------------------- | ||
| [PASS] 2026-05-08 05:07:28 - shmbridge : PASS - qcom_scm driver validated successfully across all checks. | ||
| [INFO] 2026-05-08 05:07:28 - -------------------Completed shmbridge Testcase---------------------------- | ||
| [PASS] 2026-05-08 05:07:28 - shmbridge passed | ||
|
|
||
| [INFO] 2026-05-08 05:07:28 - ========== Test Summary ========== | ||
| PASSED: | ||
| shmbridge | ||
|
|
||
| FAILED: | ||
| None | ||
|
|
||
| SKIPPED: | ||
| None | ||
| [INFO] 2026-05-08 05:07:28 - ================================== | ||
| ``` | ||
|
|
||
| ## License | ||
|
|
||
| SPDX-License-Identifier: BSD-3-Clause | ||
| Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.