Commit 06fefe5
dmaengine: at_xdmac: Fix wrongfull report of a channel as in use
atchan->status variable is used to store two different information:
- pass channel interrupts status from interrupt handler to tasklet;
- channel information like whether it is cyclic or paused;
This causes a bug when device_terminate_all() is called,
(AT_XDMAC_CHAN_IS_CYCLIC cleared on atchan->status) and then a late End
of Block interrupt arrives (AT_XDMAC_CIS_BIS), which sets bit 0 of
atchan->status. Bit 0 is also used for AT_XDMAC_CHAN_IS_CYCLIC, so when
a new descriptor for a cyclic transfer is created, the driver reports
the channel as in use:
if (test_and_set_bit(AT_XDMAC_CHAN_IS_CYCLIC, &atchan->status)) {
dev_err(chan2dev(chan), "channel currently used\n");
return NULL;
}
This patch fixes the bug by adding a different struct member to keep
the interrupts status separated from the channel status bits.
Fixes: e1f7c9e ("dmaengine: at_xdmac: creation of the atmel eXtended DMA Controller driver")
Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>1 parent a16134b commit 06fefe5
1 file changed
Lines changed: 10 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| 206 | + | |
206 | 207 | | |
207 | 208 | | |
208 | 209 | | |
| |||
1580 | 1581 | | |
1581 | 1582 | | |
1582 | 1583 | | |
1583 | | - | |
1584 | | - | |
| 1584 | + | |
| 1585 | + | |
1585 | 1586 | | |
1586 | 1587 | | |
1587 | 1588 | | |
1588 | 1589 | | |
1589 | 1590 | | |
1590 | 1591 | | |
1591 | 1592 | | |
1592 | | - | |
1593 | | - | |
| 1593 | + | |
| 1594 | + | |
1594 | 1595 | | |
1595 | 1596 | | |
1596 | | - | |
| 1597 | + | |
1597 | 1598 | | |
1598 | | - | |
| 1599 | + | |
1599 | 1600 | | |
1600 | | - | |
| 1601 | + | |
1601 | 1602 | | |
1602 | 1603 | | |
1603 | 1604 | | |
| |||
1652 | 1653 | | |
1653 | 1654 | | |
1654 | 1655 | | |
1655 | | - | |
| 1656 | + | |
1656 | 1657 | | |
1657 | 1658 | | |
1658 | 1659 | | |
| |||
1666 | 1667 | | |
1667 | 1668 | | |
1668 | 1669 | | |
1669 | | - | |
| 1670 | + | |
1670 | 1671 | | |
1671 | 1672 | | |
1672 | 1673 | | |
| |||
0 commit comments