Skip to content

DMA: 2 cosmetic patches - #1508

Merged
tlauda merged 2 commits into
thesofproject:masterfrom
lyakh:dma-channel
Jun 10, 2019
Merged

tlauda merged 2 commits into
thesofproject:masterfrom
lyakh:dma-channel

Conversation

@lyakh

@lyakh lyakh commented Jun 3, 2019

Copy link
Copy Markdown
Collaborator

The first one is really just a cosmetic improvement. The second one actually "fixes" a panic, documented in #1485 but it certainly doesn't improve the situation. Instead of a panic the IPC request fails "gracefully," but that still doesn't fix the problem, maybe a panic is a better or at least also a valid reaction to the problem.

@lyakh
lyakh requested a review from lgirdwood June 3, 2019 09:21
@tlauda

tlauda commented Jun 3, 2019

Copy link
Copy Markdown
Contributor

@lyakh IMX build failure.

@jajanusz

jajanusz commented Jun 3, 2019 •

Copy link
Copy Markdown
Contributor

@lyakh please update changed ops for imx also

@tlauda

tlauda commented Jun 5, 2019

Copy link
Copy Markdown
Contributor

@lyakh Ping.

Fix indentation in hda_link_dma_ops and hda_host_dma_ops.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The DMA "channel" parameter, used in many DMA API functions, is
currently only checked for "< HDA_DMA_MAX_CHANS" except for one case,
where it's also checked for ">= 0." But if a configuration step is
missed, the channel can stay at its initial value of DMA_CHAN_INVALID
which is equal to (32-bit) -1, or it can contain a negative error
code, returned by dma_channel_get(). Therefore a comparison to
HDA_DMA_MAX_CHANS doesn't catch such cases. This leads to a panic
like in issue thesofproject#1485 To
avoid such crashes make "channel" unsigned everywhere and make checks
more consistent.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
@tlauda
tlauda merged commit 7347f87 into thesofproject:master Jun 10, 2019
@lyakh
lyakh deleted the dma-channel branch June 17, 2019 06:11
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