lowRISC / lowRISC/opentitan

[dma/rtl] control.abort sets status.aborted immediately

Open
#31,170 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

IP:dma
Dominant language
SystemVerilog
Stars
3.6k
Forks
1.1k
Avg merge
2d 22h
Merged PRs (30d)
141

Description

### Description

Firmware can cancel a DMA operation using control.abort. The documentation mentions that status.aborted is set once the aborted operation drains. However, in RTL (dma.sv line [1239-1240](https://github.com/lowRISC/opentitan/blob/b16f2be75d2f38c62d861208453ed5b81ccf41b0/hw/ip/dma/rtl/dma.sv#L1239-L1240)), status.aborted is immediately set once control.abort is registered. Hence, it could be that after an abort operation, which was flagged as completed by status.aborted, TLUL requests are still in flight. In RTL, we could fix this by using the outstanding requests counter from the TLUL adapter in dma.sv. Software can bypass this by using a busy-spin before the next DMA operation.

Thanks to Vishal Bhogade (@vishalbb-git) for reporting this!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in hw/ip/dma/rtl/dma.sv at lines 1239-1240, then inspect the TLUL adapter's outstanding requests counter and the surrounding abort handling. Confirm the documented drain behavior and ensure status.aborted is not reported until no TLUL requests from the aborted operation remain in flight.

Written by the indexing model from the issue text.

Assessment

Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.