aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/pl330.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2012-05-18 12:13:33 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-05-18 12:13:33 -0400
commit16ee6576e25b83806d26eb771138249fcfb5eddc (patch)
tree7c717b80f28b5c59ba673dc00f2ca9bd0fc068d4 /drivers/dma/pl330.c
parent16fa7e8200fb9066b77a3f27cbed8e4a9fc71998 (diff)
parent9b63776fa3ca96c4ecda76f6fa947b7b0add66ac (diff)
Merge remote-tracking branch 'tip/perf/urgent' into perf/core
Merge reason: We are going to queue up a dependent patch: "perf tools: Move parse event automated tests to separated object" That depends on: commit e7c72d8 perf tools: Add 'G' and 'H' modifiers to event parsing Conflicts: tools/perf/builtin-stat.c Conflicted with the recent 'perf_target' patches when checking the result of perf_evsel open routines to see if a retry is needed to cope with older kernels where the exclude guest/host perf_event_attr bits were not used. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'drivers/dma/pl330.c')
-rw-r--r--drivers/dma/pl330.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 282caf118be8..2ee6e23930ad 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -2225,12 +2225,9 @@ static inline void free_desc_list(struct list_head *list)
2225{ 2225{
2226 struct dma_pl330_dmac *pdmac; 2226 struct dma_pl330_dmac *pdmac;
2227 struct dma_pl330_desc *desc; 2227 struct dma_pl330_desc *desc;
2228 struct dma_pl330_chan *pch; 2228 struct dma_pl330_chan *pch = NULL;
2229 unsigned long flags; 2229 unsigned long flags;
2230 2230
2231 if (list_empty(list))
2232 return;
2233
2234 /* Finish off the work list */ 2231 /* Finish off the work list */
2235 list_for_each_entry(desc, list, node) { 2232 list_for_each_entry(desc, list, node) {
2236 dma_async_tx_callback callback; 2233 dma_async_tx_callback callback;
@@ -2247,6 +2244,10 @@ static inline void free_desc_list(struct list_head *list)
2247 desc->pchan = NULL; 2244 desc->pchan = NULL;
2248 } 2245 }
2249 2246
2247 /* pch will be unset if list was empty */
2248 if (!pch)
2249 return;
2250
2250 pdmac = pch->dmac; 2251 pdmac = pch->dmac;
2251 2252
2252 spin_lock_irqsave(&pdmac->pool_lock, flags); 2253 spin_lock_irqsave(&pdmac->pool_lock, flags);
@@ -2257,12 +2258,9 @@ static inline void free_desc_list(struct list_head *list)
2257static inline void handle_cyclic_desc_list(struct list_head *list) 2258static inline void handle_cyclic_desc_list(struct list_head *list)
2258{ 2259{
2259 struct dma_pl330_desc *desc; 2260 struct dma_pl330_desc *desc;
2260 struct dma_pl330_chan *pch; 2261 struct dma_pl330_chan *pch = NULL;
2261 unsigned long flags; 2262 unsigned long flags;
2262 2263
2263 if (list_empty(list))
2264 return;
2265
2266 list_for_each_entry(desc, list, node) { 2264 list_for_each_entry(desc, list, node) {
2267 dma_async_tx_callback callback; 2265 dma_async_tx_callback callback;
2268 2266
@@ -2274,6 +2272,10 @@ static inline void handle_cyclic_desc_list(struct list_head *list)
2274 callback(desc->txd.callback_param); 2272 callback(desc->txd.callback_param);
2275 } 2273 }
2276 2274
2275 /* pch will be unset if list was empty */
2276 if (!pch)
2277 return;
2278
2277 spin_lock_irqsave(&pch->lock, flags); 2279 spin_lock_irqsave(&pch->lock, flags);
2278 list_splice_tail_init(list, &pch->work_list); 2280 list_splice_tail_init(list, &pch->work_list);
2279 spin_unlock_irqrestore(&pch->lock, flags); 2281 spin_unlock_irqrestore(&pch->lock, flags);
@@ -2926,8 +2928,11 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
2926 INIT_LIST_HEAD(&pd->channels); 2928 INIT_LIST_HEAD(&pd->channels);
2927 2929
2928 /* Initialize channel parameters */ 2930 /* Initialize channel parameters */
2929 num_chan = max(pdat ? pdat->nr_valid_peri : (u8)pi->pcfg.num_peri, 2931 if (pdat)
2930 (u8)pi->pcfg.num_chan); 2932 num_chan = max_t(int, pdat->nr_valid_peri, pi->pcfg.num_chan);
2933 else
2934 num_chan = max_t(int, pi->pcfg.num_peri, pi->pcfg.num_chan);
2935
2931 pdmac->peripherals = kzalloc(num_chan * sizeof(*pch), GFP_KERNEL); 2936 pdmac->peripherals = kzalloc(num_chan * sizeof(*pch), GFP_KERNEL);
2932 2937
2933 for (i = 0; i < num_chan; i++) { 2938 for (i = 0; i < num_chan; i++) {