diff options
author | Russell King - ARM Linux <linux@arm.linux.org.uk> | 2011-01-03 17:31:04 -0500 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-01-04 22:16:10 -0500 |
commit | 91aa5fadb831e7b6ea473a526a6b49c6dc4819ce (patch) | |
tree | 4f96e2649b8725b6f58bace588e90c9f38c3dc80 /include/linux | |
parent | 4440aacf3a171a0ab498feda58d100a320c5d9ff (diff) |
ARM: PL08x: fix atomic_t usage and tx_submit() return value range
The last_issued variable uses an atomic type, which is only
incremented inside a protected region, and then read. Everywhere else
only reads the value, so it isn't using atomic_t correctly, and it
doesn't even need to. Moreover, the DMA engine code provides us with
a variable for this already - chan.cookie. Use chan.cookie instead.
Also, avoid negative dma_cookie_t values - negative returns from
tx_submit() mean failure, yet in reality we always succeed. Restart
from cookie 1, just like other DMA engine drivers do.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/amba/pl08x.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/include/linux/amba/pl08x.h b/include/linux/amba/pl08x.h index 521a0f8974ac..4ae62b4684f9 100644 --- a/include/linux/amba/pl08x.h +++ b/include/linux/amba/pl08x.h | |||
@@ -174,7 +174,6 @@ struct pl08x_dma_chan { | |||
174 | struct pl08x_channel_data *cd; | 174 | struct pl08x_channel_data *cd; |
175 | dma_addr_t runtime_addr; | 175 | dma_addr_t runtime_addr; |
176 | enum dma_data_direction runtime_direction; | 176 | enum dma_data_direction runtime_direction; |
177 | atomic_t last_issued; | ||
178 | dma_cookie_t lc; | 177 | dma_cookie_t lc; |
179 | struct list_head desc_list; | 178 | struct list_head desc_list; |
180 | struct pl08x_txd *at; | 179 | struct pl08x_txd *at; |