Skip to content
Snippets Groups Projects
Commit b7af62ae authored by Bin Meng's avatar Bin Meng Committed by Alistair Francis
Browse files

hw/dma: sifive_pdma: Fix Control.claim bit detection


At present the codes detect whether the DMA channel is claimed by:

  claimed = !!s->chan[ch].control & CONTROL_CLAIM;

As ! has higher precedence over & (bitwise and), this is essentially

  claimed = (!!s->chan[ch].control) & CONTROL_CLAIM;

which is wrong, as any non-zero bit set in the control register will
produce a result of a claimed channel.

Fixes: de7c7988 ("hw/dma: sifive_pdma: reset Next* registers when Control.claim is set")
Signed-off-by: default avatarBin Meng <bmeng.cn@gmail.com>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20210927072124.1564129-1-bmeng.cn@gmail.com
Signed-off-by: default avatarAlistair Francis <alistair.francis@wdc.com>
parent 31ca70b5
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment