diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-05-26 11:33:39 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-07-01 09:16:08 -0400 |
commit | 70f3ff434d7fc9a3cea5ebbb8a8d7aaa4c906125 (patch) | |
tree | a8d04cf96ac8a3a61c7c9b712cebb7881bffed6f /drivers | |
parent | aa4afb754d42be064ae649b74a599b9d9d04ac57 (diff) |
dmaengine: PL08x: get rid of write only pool_ctr and free_txd locking
The free function says the pl08x lock should be taken before calling
it. However, the DMA pool allocation/freeing is already properly
locked. The only thing that would need this is pool_ctr, which
happens to be a write-only variable.
Let's get rid of this, and eliminate any need for additional locking
here.
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dma/amba-pl08x.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index 9297240cae3a..a5d85b101b89 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c | |||
@@ -247,7 +247,6 @@ struct pl08x_dma_chan { | |||
247 | * @pd: platform data passed in from the platform/machine | 247 | * @pd: platform data passed in from the platform/machine |
248 | * @phy_chans: array of data for the physical channels | 248 | * @phy_chans: array of data for the physical channels |
249 | * @pool: a pool for the LLI descriptors | 249 | * @pool: a pool for the LLI descriptors |
250 | * @pool_ctr: counter of LLIs in the pool | ||
251 | * @lli_buses: bitmask to or in to LLI pointer selecting AHB port for LLI | 250 | * @lli_buses: bitmask to or in to LLI pointer selecting AHB port for LLI |
252 | * fetches | 251 | * fetches |
253 | * @mem_buses: set to indicate memory transfers on AHB2. | 252 | * @mem_buses: set to indicate memory transfers on AHB2. |
@@ -262,7 +261,6 @@ struct pl08x_driver_data { | |||
262 | struct pl08x_platform_data *pd; | 261 | struct pl08x_platform_data *pd; |
263 | struct pl08x_phy_chan *phy_chans; | 262 | struct pl08x_phy_chan *phy_chans; |
264 | struct dma_pool *pool; | 263 | struct dma_pool *pool; |
265 | int pool_ctr; | ||
266 | u8 lli_buses; | 264 | u8 lli_buses; |
267 | u8 mem_buses; | 265 | u8 mem_buses; |
268 | }; | 266 | }; |
@@ -821,8 +819,6 @@ static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x, | |||
821 | return 0; | 819 | return 0; |
822 | } | 820 | } |
823 | 821 | ||
824 | pl08x->pool_ctr++; | ||
825 | |||
826 | bd.txd = txd; | 822 | bd.txd = txd; |
827 | bd.lli_bus = (pl08x->lli_buses & PL08X_AHB2) ? PL080_LLI_LM_AHB2 : 0; | 823 | bd.lli_bus = (pl08x->lli_buses & PL08X_AHB2) ? PL080_LLI_LM_AHB2 : 0; |
828 | cctl = txd->cctl; | 824 | cctl = txd->cctl; |
@@ -1038,18 +1034,14 @@ static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x, | |||
1038 | return num_llis; | 1034 | return num_llis; |
1039 | } | 1035 | } |
1040 | 1036 | ||
1041 | /* You should call this with the struct pl08x lock held */ | ||
1042 | static void pl08x_free_txd(struct pl08x_driver_data *pl08x, | 1037 | static void pl08x_free_txd(struct pl08x_driver_data *pl08x, |
1043 | struct pl08x_txd *txd) | 1038 | struct pl08x_txd *txd) |
1044 | { | 1039 | { |
1045 | struct pl08x_sg *dsg, *_dsg; | 1040 | struct pl08x_sg *dsg, *_dsg; |
1046 | 1041 | ||
1047 | /* Free the LLI */ | ||
1048 | if (txd->llis_va) | 1042 | if (txd->llis_va) |
1049 | dma_pool_free(pl08x->pool, txd->llis_va, txd->llis_bus); | 1043 | dma_pool_free(pl08x->pool, txd->llis_va, txd->llis_bus); |
1050 | 1044 | ||
1051 | pl08x->pool_ctr--; | ||
1052 | |||
1053 | list_for_each_entry_safe(dsg, _dsg, &txd->dsg_list, node) { | 1045 | list_for_each_entry_safe(dsg, _dsg, &txd->dsg_list, node) { |
1054 | list_del(&dsg->node); | 1046 | list_del(&dsg->node); |
1055 | kfree(dsg); | 1047 | kfree(dsg); |
@@ -1090,8 +1082,6 @@ static void pl08x_desc_free(struct virt_dma_desc *vd) | |||
1090 | { | 1082 | { |
1091 | struct pl08x_txd *txd = to_pl08x_txd(&vd->tx); | 1083 | struct pl08x_txd *txd = to_pl08x_txd(&vd->tx); |
1092 | struct pl08x_dma_chan *plchan = to_pl08x_chan(vd->tx.chan); | 1084 | struct pl08x_dma_chan *plchan = to_pl08x_chan(vd->tx.chan); |
1093 | struct pl08x_driver_data *pl08x = plchan->host; | ||
1094 | unsigned long flags; | ||
1095 | 1085 | ||
1096 | if (!plchan->slave) | 1086 | if (!plchan->slave) |
1097 | pl08x_unmap_buffers(txd); | 1087 | pl08x_unmap_buffers(txd); |
@@ -1099,9 +1089,7 @@ static void pl08x_desc_free(struct virt_dma_desc *vd) | |||
1099 | if (!txd->done) | 1089 | if (!txd->done) |
1100 | pl08x_release_mux(plchan); | 1090 | pl08x_release_mux(plchan); |
1101 | 1091 | ||
1102 | spin_lock_irqsave(&pl08x->lock, flags); | ||
1103 | pl08x_free_txd(plchan->host, txd); | 1092 | pl08x_free_txd(plchan->host, txd); |
1104 | spin_unlock_irqrestore(&pl08x->lock, flags); | ||
1105 | } | 1093 | } |
1106 | 1094 | ||
1107 | static void pl08x_free_txd_list(struct pl08x_driver_data *pl08x, | 1095 | static void pl08x_free_txd_list(struct pl08x_driver_data *pl08x, |