diff options
author | Jonas Aaberg <jonas.aberg@stericsson.com> | 2010-08-09 08:08:10 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2010-09-22 17:53:45 -0400 |
commit | 0246e77b4d374bb37aa08c3fcadad20012e85ea0 (patch) | |
tree | 62b59fda3aca474abdec3c2385dc3fd00278ef34 /drivers | |
parent | b55912c66a317d9aaf4749488ca43d510c8a8a87 (diff) |
DMAENGINE: ste_dma40: fix bug related to callback handling
The callback got called even when it was not supposed to. Also
removed some not needed interrupt trigger on/off code.
Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dma/ste_dma40.c | 17 | ||||
-rw-r--r-- | drivers/dma/ste_dma40_ll.c | 13 | ||||
-rw-r--r-- | drivers/dma/ste_dma40_ll.h | 7 |
3 files changed, 14 insertions, 23 deletions
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 1adaebf49774..a6a7d66df77a 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c | |||
@@ -878,7 +878,7 @@ static void dma_tasklet(unsigned long data) | |||
878 | 878 | ||
879 | spin_unlock_irqrestore(&d40c->lock, flags); | 879 | spin_unlock_irqrestore(&d40c->lock, flags); |
880 | 880 | ||
881 | if (callback) | 881 | if (callback && (d40d_fin->txd.flags & DMA_PREP_INTERRUPT)) |
882 | callback(callback_param); | 882 | callback(callback_param); |
883 | 883 | ||
884 | return; | 884 | return; |
@@ -1583,7 +1583,6 @@ struct dma_async_tx_descriptor *stedma40_memcpy_sg(struct dma_chan *chan, | |||
1583 | d40d->lli_log.src, | 1583 | d40d->lli_log.src, |
1584 | d40c->log_def.lcsp1, | 1584 | d40c->log_def.lcsp1, |
1585 | d40c->dma_cfg.src_info.data_width, | 1585 | d40c->dma_cfg.src_info.data_width, |
1586 | dma_flags & DMA_PREP_INTERRUPT, | ||
1587 | d40d->lli_tx_len, | 1586 | d40d->lli_tx_len, |
1588 | d40c->base->plat_data->llis_per_log); | 1587 | d40c->base->plat_data->llis_per_log); |
1589 | 1588 | ||
@@ -1593,7 +1592,6 @@ struct dma_async_tx_descriptor *stedma40_memcpy_sg(struct dma_chan *chan, | |||
1593 | d40d->lli_log.dst, | 1592 | d40d->lli_log.dst, |
1594 | d40c->log_def.lcsp3, | 1593 | d40c->log_def.lcsp3, |
1595 | d40c->dma_cfg.dst_info.data_width, | 1594 | d40c->dma_cfg.dst_info.data_width, |
1596 | dma_flags & DMA_PREP_INTERRUPT, | ||
1597 | d40d->lli_tx_len, | 1595 | d40d->lli_tx_len, |
1598 | d40c->base->plat_data->llis_per_log); | 1596 | d40c->base->plat_data->llis_per_log); |
1599 | 1597 | ||
@@ -1612,8 +1610,7 @@ struct dma_async_tx_descriptor *stedma40_memcpy_sg(struct dma_chan *chan, | |||
1612 | d40d->lli_phy.src_addr, | 1610 | d40d->lli_phy.src_addr, |
1613 | d40c->src_def_cfg, | 1611 | d40c->src_def_cfg, |
1614 | d40c->dma_cfg.src_info.data_width, | 1612 | d40c->dma_cfg.src_info.data_width, |
1615 | d40c->dma_cfg.src_info.psize, | 1613 | d40c->dma_cfg.src_info.psize); |
1616 | true); | ||
1617 | 1614 | ||
1618 | if (res < 0) | 1615 | if (res < 0) |
1619 | goto err; | 1616 | goto err; |
@@ -1625,8 +1622,7 @@ struct dma_async_tx_descriptor *stedma40_memcpy_sg(struct dma_chan *chan, | |||
1625 | d40d->lli_phy.dst_addr, | 1622 | d40d->lli_phy.dst_addr, |
1626 | d40c->dst_def_cfg, | 1623 | d40c->dst_def_cfg, |
1627 | d40c->dma_cfg.dst_info.data_width, | 1624 | d40c->dma_cfg.dst_info.data_width, |
1628 | d40c->dma_cfg.dst_info.psize, | 1625 | d40c->dma_cfg.dst_info.psize); |
1629 | true); | ||
1630 | 1626 | ||
1631 | if (res < 0) | 1627 | if (res < 0) |
1632 | goto err; | 1628 | goto err; |
@@ -1913,7 +1909,6 @@ static int d40_prep_slave_sg_log(struct d40_desc *d40d, | |||
1913 | d40c->dma_cfg.src_info.data_width, | 1909 | d40c->dma_cfg.src_info.data_width, |
1914 | d40c->dma_cfg.dst_info.data_width, | 1910 | d40c->dma_cfg.dst_info.data_width, |
1915 | direction, | 1911 | direction, |
1916 | dma_flags & DMA_PREP_INTERRUPT, | ||
1917 | dev_addr, d40d->lli_tx_len, | 1912 | dev_addr, d40d->lli_tx_len, |
1918 | d40c->base->plat_data->llis_per_log); | 1913 | d40c->base->plat_data->llis_per_log); |
1919 | 1914 | ||
@@ -1965,8 +1960,7 @@ static int d40_prep_slave_sg_phy(struct d40_desc *d40d, | |||
1965 | d40d->lli_phy.src_addr, | 1960 | d40d->lli_phy.src_addr, |
1966 | d40c->src_def_cfg, | 1961 | d40c->src_def_cfg, |
1967 | d40c->dma_cfg.src_info.data_width, | 1962 | d40c->dma_cfg.src_info.data_width, |
1968 | d40c->dma_cfg.src_info.psize, | 1963 | d40c->dma_cfg.src_info.psize); |
1969 | true); | ||
1970 | if (res < 0) | 1964 | if (res < 0) |
1971 | return res; | 1965 | return res; |
1972 | 1966 | ||
@@ -1977,8 +1971,7 @@ static int d40_prep_slave_sg_phy(struct d40_desc *d40d, | |||
1977 | d40d->lli_phy.dst_addr, | 1971 | d40d->lli_phy.dst_addr, |
1978 | d40c->dst_def_cfg, | 1972 | d40c->dst_def_cfg, |
1979 | d40c->dma_cfg.dst_info.data_width, | 1973 | d40c->dma_cfg.dst_info.data_width, |
1980 | d40c->dma_cfg.dst_info.psize, | 1974 | d40c->dma_cfg.dst_info.psize); |
1981 | true); | ||
1982 | if (res < 0) | 1975 | if (res < 0) |
1983 | return res; | 1976 | return res; |
1984 | 1977 | ||
diff --git a/drivers/dma/ste_dma40_ll.c b/drivers/dma/ste_dma40_ll.c index d937f76d6e2e..67076726b874 100644 --- a/drivers/dma/ste_dma40_ll.c +++ b/drivers/dma/ste_dma40_ll.c | |||
@@ -197,8 +197,7 @@ int d40_phy_sg_to_lli(struct scatterlist *sg, | |||
197 | dma_addr_t lli_phys, | 197 | dma_addr_t lli_phys, |
198 | u32 reg_cfg, | 198 | u32 reg_cfg, |
199 | u32 data_width, | 199 | u32 data_width, |
200 | int psize, | 200 | int psize) |
201 | bool term_int) | ||
202 | { | 201 | { |
203 | int total_size = 0; | 202 | int total_size = 0; |
204 | int i; | 203 | int i; |
@@ -309,7 +308,7 @@ int d40_log_sg_to_dev(struct d40_lcla_elem *lcla, | |||
309 | u32 src_data_width, | 308 | u32 src_data_width, |
310 | u32 dst_data_width, | 309 | u32 dst_data_width, |
311 | enum dma_data_direction direction, | 310 | enum dma_data_direction direction, |
312 | bool term_int, dma_addr_t dev_addr, int max_len, | 311 | dma_addr_t dev_addr, int max_len, |
313 | int llis_per_log) | 312 | int llis_per_log) |
314 | { | 313 | { |
315 | int total_size = 0; | 314 | int total_size = 0; |
@@ -356,7 +355,7 @@ int d40_log_sg_to_dev(struct d40_lcla_elem *lcla, | |||
356 | next_lli_off_dst, | 355 | next_lli_off_dst, |
357 | lcsp->lcsp3, dst_data_width, | 356 | lcsp->lcsp3, dst_data_width, |
358 | /* No next == terminal interrupt */ | 357 | /* No next == terminal interrupt */ |
359 | term_int && !next_lli_off_dst, | 358 | !next_lli_off_dst, |
360 | false); | 359 | false); |
361 | } else { | 360 | } else { |
362 | d40_log_fill_lli(&lli->dst[i], | 361 | d40_log_fill_lli(&lli->dst[i], |
@@ -365,7 +364,7 @@ int d40_log_sg_to_dev(struct d40_lcla_elem *lcla, | |||
365 | next_lli_off_dst, | 364 | next_lli_off_dst, |
366 | lcsp->lcsp3, dst_data_width, | 365 | lcsp->lcsp3, dst_data_width, |
367 | /* No next == terminal interrupt */ | 366 | /* No next == terminal interrupt */ |
368 | term_int && !next_lli_off_dst, | 367 | !next_lli_off_dst, |
369 | true); | 368 | true); |
370 | d40_log_fill_lli(&lli->src[i], | 369 | d40_log_fill_lli(&lli->src[i], |
371 | dev_addr, | 370 | dev_addr, |
@@ -385,7 +384,7 @@ int d40_log_sg_to_lli(int lcla_id, | |||
385 | struct d40_log_lli *lli_sg, | 384 | struct d40_log_lli *lli_sg, |
386 | u32 lcsp13, /* src or dst*/ | 385 | u32 lcsp13, /* src or dst*/ |
387 | u32 data_width, | 386 | u32 data_width, |
388 | bool term_int, int max_len, int llis_per_log) | 387 | int max_len, int llis_per_log) |
389 | { | 388 | { |
390 | int total_size = 0; | 389 | int total_size = 0; |
391 | struct scatterlist *current_sg = sg; | 390 | struct scatterlist *current_sg = sg; |
@@ -414,7 +413,7 @@ int d40_log_sg_to_lli(int lcla_id, | |||
414 | sg_dma_len(current_sg), | 413 | sg_dma_len(current_sg), |
415 | next_lli_off, | 414 | next_lli_off, |
416 | lcsp13, data_width, | 415 | lcsp13, data_width, |
417 | term_int && !next_lli_off, | 416 | !next_lli_off, |
418 | true); | 417 | true); |
419 | } | 418 | } |
420 | return total_size; | 419 | return total_size; |
diff --git a/drivers/dma/ste_dma40_ll.h b/drivers/dma/ste_dma40_ll.h index 9c0fa2f5fe57..0c468c310c18 100644 --- a/drivers/dma/ste_dma40_ll.h +++ b/drivers/dma/ste_dma40_ll.h | |||
@@ -302,8 +302,7 @@ int d40_phy_sg_to_lli(struct scatterlist *sg, | |||
302 | dma_addr_t lli_phys, | 302 | dma_addr_t lli_phys, |
303 | u32 reg_cfg, | 303 | u32 reg_cfg, |
304 | u32 data_width, | 304 | u32 data_width, |
305 | int psize, | 305 | int psize); |
306 | bool term_int); | ||
307 | 306 | ||
308 | int d40_phy_fill_lli(struct d40_phy_lli *lli, | 307 | int d40_phy_fill_lli(struct d40_phy_lli *lli, |
309 | dma_addr_t data, | 308 | dma_addr_t data, |
@@ -336,7 +335,7 @@ int d40_log_sg_to_dev(struct d40_lcla_elem *lcla, | |||
336 | u32 src_data_width, | 335 | u32 src_data_width, |
337 | u32 dst_data_width, | 336 | u32 dst_data_width, |
338 | enum dma_data_direction direction, | 337 | enum dma_data_direction direction, |
339 | bool term_int, dma_addr_t dev_addr, int max_len, | 338 | dma_addr_t dev_addr, int max_len, |
340 | int llis_per_log); | 339 | int llis_per_log); |
341 | 340 | ||
342 | int d40_log_lli_write(struct d40_log_lli_full *lcpa, | 341 | int d40_log_lli_write(struct d40_log_lli_full *lcpa, |
@@ -352,6 +351,6 @@ int d40_log_sg_to_lli(int lcla_id, | |||
352 | struct d40_log_lli *lli_sg, | 351 | struct d40_log_lli *lli_sg, |
353 | u32 lcsp13, /* src or dst*/ | 352 | u32 lcsp13, /* src or dst*/ |
354 | u32 data_width, | 353 | u32 data_width, |
355 | bool term_int, int max_len, int llis_per_log); | 354 | int max_len, int llis_per_log); |
356 | 355 | ||
357 | #endif /* STE_DMA40_LLI_H */ | 356 | #endif /* STE_DMA40_LLI_H */ |