Skip to content

Conversation

kilograham
Copy link
Contributor

See raspberrypi/pico-feedback#224

Note this is a documentation only fix, as dma_channel_abort does not have enough information to efficiently workaround the issue on the callers behalf.

@kilograham kilograham requested a review from Wren6991 May 9, 2022 20:36
@kilograham kilograham added this to the 1.3.1 milestone May 9, 2022
@kilograham kilograham requested a review from lurch May 9, 2022 20:38
* not require any additional work, as aborting a channel which may be about to complete, when you have a completion
* IRQ handler registered, is inherently race-prone, and so code is likely needed to disambiguate the two occurrences.
*
* If that is not the case, but you do have an channel completion IRQ handler registered, you can simply
Copy link
Contributor

Choose a reason for hiding this comment

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

"an channel completion" -> "a channel completion"

@Wren6991
Copy link
Contributor

I fixed the typo pointed out by @lurch. I also made another change, which might be more contentious, so feel free to back out: poll BUSY rather than ABORT to check for ABORT completion, to guarantee the channel is returned to a quiescent state before the function exits. ABORT clears prematurely due to the erratum (in fact this is the erratum).

The difference in timing is the time taken for the in-flight transfers to drain from the bus FIFOs, which should be a few cycles.

Wren6991
Wren6991 previously approved these changes May 10, 2022
Copy link
Contributor

@Wren6991 Wren6991 left a comment

Choose a reason for hiding this comment

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

Approval for the docs updates, @kilograham please merge if you are happy with the ABORT -> BUSY polling change

@kilograham
Copy link
Contributor Author

Does the ABORT->BUSY change have an effect on what happens if the channel is disabled?

@Wren6991
Copy link
Contributor

Wren6991 commented May 11, 2022

No. BUSY clears once the in-flight and not-yet-issued transfer counts both reach 0. The not-yet-issued count is cleared by the ABORT, and EN=0 does not prevent in-flight transfers from completing.

*
* Function will only return once the DMA has stopped.
*
* Note that due to to errata RP2040-E13, aborting a channel which has transfers
Copy link
Contributor

Choose a reason for hiding this comment

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

Another typo: "to" is twice.

@kilograham kilograham merged commit 4e62c26 into develop May 12, 2022
@kilograham kilograham deleted the dma_abort_docs branch May 12, 2022 00:24
@kilograham
Copy link
Contributor Author

Note I force merged this as the only change after approval was a type in a comment

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.

4 participants