Skip to content

Conversation

smuppand
Copy link
Contributor

@smuppand smuppand commented Jul 22, 2025

This PR refactors and toughens the remoteproc test scripts for ADSP, CDSP (multi-instance), and WPSS while keeping backward compatibility with existing functestlib helpers.

SoC-aware discovery & skips

  • Use find_remoteproc_by_firmware() instead of hardcoded indices.
  • Clean SKIP when a core isn’t present (no more false FAILs on RB1/Agatti etc.).

Robust stop/start sequencing

  • wait_remoteproc_state() (or wait_for_state()) with timeouts/polling.
  • Surround each transition with dump_rproc_logs() → before-* / after-* logs for CI triage.

Generic RPMsg exercise (optional)

  • Map rpmsg_ctrl* to a given rproc.
  • Reuse or create endpoints and attempt a simple echo.
  • Result recorded as PASS/FAIL/SKIPPED per instance.

CDSP/GPDSP multi-instance reporting

  • Enumerate cdsp0/cdsp1…/gpdsp0/gpdsp1.... and print per-instance boot/stop/start/ping status.

WPSS driver fallback kept & improved

  • If no remoteproc: validate via ath11k/ath11xx driver.
  • Firmware presence checked in /lib/firmware/ath11k/**/amss.bin, dmesg fw_version, and wlan*/ath* netdevs (POSIX glob).
  • RPMsg attempted if a channel exists; otherwise skipped.

Concurrency safety

  • acquire_test_lock / release_test_lock to avoid parallel stomp.

@smuppand smuppand requested a review from vnarapar July 22, 2025 08:20
acquire_test_lock "$TESTNAME"
log_info "Starting $TESTNAME Testcase"

#Discover

Choose a reason for hiding this comment

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

I don't think we should define the test plan / test cases to run by dynamically discover what's available on the platform. We are hiding a class of issues by doing that, especially all issues that lead to the device not being functional on a booted system.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think we should define the test plan / test cases to run by dynamically discover what's available on the platform. We are hiding a class of issues by doing that, especially all issues that lead to the device not being functional on a booted system.

I’ve pushed the latest updates to read the DT-populated entries and then check for probing, as you recommended.

@smuppand smuppand requested review from ndechesne and vnarapar July 23, 2025 18:03
@smuppand smuppand changed the title baseport/remoteproc: Make ADSP/CDSP/WPSS tests SoC-aware, add RPMsg probe, harden logs & shellcheck baseport/remoteproc: Make ADSP/CDSP/GPDSP/WPSS tests SoC-aware, add RPMsg probe, harden logs & shellcheck Jul 24, 2025

[ -n "$fw" ] || return 3

found=0
Copy link
Contributor

Choose a reason for hiding this comment

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

AFAIK found is not required anywhere

Copy link
Contributor Author

Choose a reason for hiding this comment

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

AFAIK found is not required anywhere

the found variable was used as a simple flag to record whether any of the directory‐based “fast-path” checks succeeded
found=0 for d in ...; do [ -d "$d" ] && found=1 && break done [ "$found" -eq 1 ] && return 0

  1. Initializes found=0.

  2. Loops over potential DT directories (e.g. /proc/device-tree/smp2p-*).

  3. If any directory exists, sets found=1 and breaks out of the loop.

  4. After the loop, checks found to decide whether to return success.

@smuppand smuppand force-pushed the rproc branch 2 times, most recently from 195a598 to d268dc4 Compare July 25, 2025 13:33
@smuppand smuppand requested a review from vnarapar July 25, 2025 13:39
…Msg probe, shellcheck fixes

- Discover RProc nodes via find_remoteproc_by_firmware() instead of hardcoded IDs.
- Skip cleanly when a core isn’t present on the SoC (no more false FAILs).
- Stop/Start paths now wait_for_state()/wait_remoteproc_state() with timeouts & polling.
- Dump rproc logs around each transition (before/after stop/start) for easier CI debug.
- Add generic RPMsg exercise:
  * Map rpmsg_ctrl* to the owning remoteproc.
  * Reuse/create endpoints and try an echo; mark PASS/FAIL/SKIPPED accordingly.
- CDSP: handle multi-instance (cdsp0/cdsp1…/gpdsp0/gpdsp1...) and print per-instance boot/stop/start/ping results.
- WPSS: keep driver fallback (ath11k/ath11xx) if remoteproc is absent:
  * Validate firmware via /lib/firmware/ath11k blobs, dmesg strings, and wlan*/ath* netdev presence.
  * POSIX-safe globbing instead of grep-regex for interface detection.
- Ensure .res contains only “TESTNAME <RESULT>”; everything else goes to log.
- ShellCheck cleanup: SC2143, SC2181, SC3037, SC2034, etc. (no unused vars, no `$?` chains, printf over echo -e).
- Added/updated helpers in functestlib.sh (rpmsg_* helpers, dump_rproc_logs, wait_remoteproc_state, etc.).
- Protect concurrent runs with acquire_test_lock()/release_test_lock().
- Added DT check for each adsp/cdsp/wpss tests
- Added dt_has_remoteproc_fw to read the /proc/device-tree for the given fw.

Signed-off-by: Srikanth Muppandam <[email protected]>
Copy link
Contributor

@vnarapar vnarapar left a comment

Choose a reason for hiding this comment

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

LGTM

@vnarapar vnarapar merged commit 578e1b3 into qualcomm-linux:main Jul 28, 2025
7 checks passed
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.

3 participants