Skip to content

Add DMA enablement tests - #296

Open
vnarapar wants to merge 3 commits into
qualcomm-linux:mainfrom
vnarapar:dmabuf
Open

Add DMA enablement tests#296
vnarapar wants to merge 3 commits into
qualcomm-linux:mainfrom
vnarapar:dmabuf

Conversation

@vnarapar

Copy link
Copy Markdown
Contributor

Added the tests to check DMA configs, Device Tree Validation and upstream kselftests

Comment thread Runner/suites/Kernel/Baseport/dmabuf/dmabuf.yaml Outdated
Comment thread Runner/suites/Kernel/Baseport/dmabuf/README.md Outdated
Comment thread Runner/suites/Kernel/Baseport/dmabuf/run.sh Outdated
Comment thread Runner/suites/Kernel/Baseport/dmabuf/run.sh Outdated
Comment thread Runner/suites/Kernel/Baseport/dmabuf/run.sh Outdated
Comment thread Runner/suites/Kernel/Baseport/dmabuf/run.sh
Comment thread Runner/suites/Kernel/Baseport/dmabuf_heap_kselftest/run.sh
@vnarapar
vnarapar force-pushed the dmabuf branch 4 times, most recently from 90efb69 to 6b50d76 Compare March 23, 2026 12:47
@smuppand

Srikanth Muppandam (smuppand) commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

This one should be split into 3 commits, unlike the simple one commit and one-testcase PR. It currently combines:

  1. library/helper addition
  2. presence-style dmabuf testcase
  3. functional dmabuf heap kselftest runner

Comment thread Runner/utils/functestlib.sh
Comment thread Runner/suites/Kernel/Baseport/dmabuf/dmabuf.yaml
Comment thread Runner/suites/Kernel/Baseport/dmabuf/run.sh Outdated
Comment thread Runner/suites/Kernel/Baseport/dmabuf/run.sh Outdated
Comment thread Runner/suites/Kernel/Baseport/dmabuf/run.sh
Comment thread Runner/suites/Kernel/Baseport/dmabuf_heap_kselftest/run.sh
Comment thread Runner/suites/Kernel/Baseport/dmabuf_heap_kselftest/run.sh Outdated
Comment thread Runner/suites/Kernel/Baseport/dmabuf_heap_kselftest/run.sh
Comment thread Runner/suites/Kernel/Baseport/dmabuf_heap_kselftest/README.md
Comment thread Runner/suites/Kernel/Baseport/dmabuf_heap_kselftest/README.md Outdated
@smuppand

Copy link
Copy Markdown
Contributor

This one should be split into 3 commits, unlike the simple one commit and one-testcase PR. It currently combines:

  1. library/helper addition
  2. presence-style dmabuf testcase
  3. functional dmabuf heap kselftest runner

This should still be split into 3 commits. Also address the structural commensts. The PR is 1 commit / 7 files / 3 logical chunks

@vnarapar vnarapar changed the title Added tests for dmabuf validations Add DMA enablement tests Apr 5, 2026

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.

Kindly close the comments that have been addressed with the updated patches.

Comment thread Runner/suites/Kernel/Baseport/dmabuf/run.sh
Comment thread Runner/suites/Kernel/Baseport/dmabuf/run.sh Outdated
Comment thread Runner/suites/Kernel/Baseport/dmabuf/run.sh Outdated
Comment thread Runner/suites/Kernel/Baseport/dmabuf_heap_kselftest/run.sh Outdated
Comment thread Runner/suites/Kernel/Baseport/dmabuf_heap_kselftest/run.sh
Comment thread Runner/suites/Kernel/Baseport/dmabuf_heap_kselftest/README.md Outdated
Comment thread Runner/suites/Kernel/Baseport/dmabuf_heap_kselftest/README.md
Comment thread Runner/suites/Kernel/Baseport/dmabuf/run.sh Outdated
Comment thread Runner/suites/Kernel/Baseport/dmabuf/run.sh Outdated
@vnarapar
vnarapar force-pushed the dmabuf branch 2 times, most recently from 963bc70 to a9ffc22 Compare May 7, 2026 11:45
Comment thread Runner/suites/Kernel/Baseport/dmabuf_heap_kselftest/dmabuf_heap_kselftest.yaml Outdated
Comment thread Runner/suites/Kernel/Baseport/dmabuf_heap_kselftest/dmabuf_heap_kselftest.yaml Outdated
Comment thread Runner/suites/Kernel/Baseport/dmabuf_heap_kselftest/run.sh Outdated
Comment thread Runner/suites/Kernel/Baseport/dmabuf_heap_kselftest/run.sh Outdated
@vnarapar
vnarapar force-pushed the dmabuf branch 2 times, most recently from 9876cee to 9e46c25 Compare May 18, 2026 09:25
Comment thread Runner/suites/Kernel/Baseport/dmabuf_heap_kselftest/run.sh Outdated
Comment thread Runner/suites/Kernel/Baseport/dmabuf/run.sh Outdated
Comment thread Runner/suites/Kernel/Baseport/dmabuf/run.sh Outdated
Comment thread Runner/utils/functestlib.sh
Comment thread Runner/suites/Kernel/Baseport/dmabuf_heap_kselftest/run.sh Outdated
Comment thread Runner/suites/Kernel/Baseport/dmabuf_heap_kselftest/run.sh Outdated
Comment thread Runner/suites/Kernel/Baseport/dmabuf_heap_kselftest/run.sh Outdated
Comment thread Runner/suites/Kernel/Baseport/dmabuf/dmabuf.yaml Outdated
Comment thread Runner/suites/Kernel/Baseport/dmabuf/run.sh Outdated
@vnarapar
vnarapar force-pushed the dmabuf branch 3 times, most recently from 677cb77 to 3641787 Compare May 22, 2026 10:52
@smuppand

Copy link
Copy Markdown
Contributor

I noticed that previous comments haven't been marked as resolved. Please close the comments that have been addressed and take care of any outstanding ones.

@vnarapar
vnarapar force-pushed the dmabuf branch 3 times, most recently from f273c2b to efcf58a Compare June 1, 2026 06:59
@vnarapar

vnarapar commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

Srikanth Muppandam (@smuppand) all comments are addressed.
FYI, shellcheck errors are not from this PR.

@vnarapar
vnarapar force-pushed the dmabuf branch 3 times, most recently from 785c402 to 0cd4e08 Compare June 1, 2026 10:29
@smuppand

Copy link
Copy Markdown
Contributor

vnarapar, please rebase and apply the small fixes mentioned above.

@github-actions

Copy link
Copy Markdown

@ualcomm/qualcomm-linux-testing.triage This pull request has been marked as stale due to 30 days of inactivity and will automatically close after an additional 5 days.

@github-actions github-actions Bot added the Stale label Jul 12, 2026
@github-actions github-actions Bot closed this Jul 18, 2026
@vnarapar vnarapar reopened this Jul 20, 2026
@github-actions github-actions Bot removed the Stale label Jul 21, 2026
@github-actions

Copy link
Copy Markdown

@ualcomm/qualcomm-linux-testing.triage This pull request has been marked as stale due to 30 days of inactivity and will automatically close after an additional 5 days.

@github-actions github-actions Bot added the Stale label Aug 21, 2026
Add the helper function to check kernel optional config

Signed-off-by: Vamsee Narapareddi <vnarapar@qti.qualcomm.com>
This test validates the DMA-BUF subsystem configuration on Qualcomm
platforms, including kernel configuration, device tree setup, and system
interfaces

Signed-off-by: Vamsee Narapareddi <vnarapar@qti.qualcomm.com>
Runs the `dmabuf-heap` binary from the Linux kernel selftests
suite to validate DMA-BUF heap functionality

Signed-off-by: Vamsee Narapareddi <vnarapar@qti.qualcomm.com>
OPTIONAL_CONFIGS="CONFIG_TEE_DMABUF_HEAPS CONFIG_HAS_DMA CONFIG_DMA_HEAP CONFIG_DMA_CMA"

log_info "Checking optional DMA-BUF configurations..."
if ! check_optional_config "$OPTIONAL_CONFIGS"; 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.

optional configs still fail the testcase, Keep optional configuration checks warning-only. Log the missing optional symbols, but do not change the final verdict.

done
fi

if check_dt_nodes "/proc/device-tree/soc*/dma* /proc/device-tree/soc*/qcom,ion* /proc/device-tree/ion*"; 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.

generic DMA nodes are required as DMA-BUF proof. Make this informational, or validate only a clearly documented platform-specific heap binding. The functional requirement should remain the heap device and, when available, the upstream kselftest.

log_info " Skipped: $skip_count"
log_info " Errors: $error_count"

if [ "$pass_count" -eq 0 ] && [ "$skip_count" -eq 0 ]; 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.

all-skipped kselftest becomes PASS. Emit top-level SKIP when pass_count=0 and skip_count>0. Reserve PASS for at least one executed successful test and no failure or error.

log_info "DMA-BUF buffer information:"

# Count total buffers
total_bufs=$(grep -c "^Dma-buf" /sys/kernel/debug/dma_buf/bufinfo 2>/dev/null || echo 0)

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.

duplicated zero output from grep -c

Use grep -c ... || true, then normalize the captured result once.

### 2. Device Tree Validation
- Reserved memory nodes (`/proc/device-tree/reserved-memory`) - informational
- Platform-specific DMA heap nodes
- Memory region sizes and configurations

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.

documentation claims unimplemented DT detail

Narrow the README to informational region enumeration or implement the stated parsing.

@github-actions github-actions Bot removed the Stale label Aug 25, 2026
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