Skip to contentSkip to conversation

dmaengine: dw: fix nollp issue

PATCH In review yitian 3 participants 3 messages Sep 28, 2015

Subsystems (2)
lore
Share & tools
lore

yitian

author
#0 lore raw

PATCH 1/1 dmaengine: dw: fix nollp issue

when channel number is less than maximum number, the register address of all channels is wrong, which causes the "nollp" flag is set for all channels even if HW supports llp.

---
 drivers/dma/dw/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/dw/core.c +0 -0
index cf1c87f..c2e9ac8 100644
@@ -1591,7 +1591,7 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct

dw_dma_platform_data *pdata)
INIT_LIST_HEAD(&dw->dma.channels);
for (i = 0; i < nr_channels; i++) {
struct dw_dma_chan *dwc = &dw->chan[i];
- int r = nr_channels - i - 1;
+ int r = DW_DMA_MAX_NR_CHANNELS - i - 1;

dwc->chan.device = &dw->dma;
dma_cookie_init(&dwc->chan);

Signature · 1 line
1.7.12.4
Acked-by on v1 1/1
#1 lore raw
Quoted 22 lines · yitian

when channel number is less than maximum number, the register address of all channels is wrong, which causes the "nollp" flag is set for all channels even if HW supports llp.

---
 drivers/dma/dw/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/dw/core.c +1 -1
index cf1c87f..c2e9ac8 100644
@@ -1591,7 +1591,7 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct
 dw_dma_platform_data *pdata)
        INIT_LIST_HEAD(&dw->dma.channels);
        for (i = 0; i < nr_channels; i++) {
                struct dw_dma_chan      *dwc = &dw->chan[i];
-               int                     r = nr_channels - i - 1;
+               int                     r = DW_DMA_MAX_NR_CHANNELS - i - 1;
 
                dwc->chan.device = &dw->dma;
Quoted 1 line
                dma_cookie_init(&dwc->chan);
#2 lore raw
In reply to yitian
Quoted 4 lines · yitian

when channel number is less than maximum number, the register address of all channels is wrong, which causes the "nollp" flag is set for all channels even if HW supports llp.

Thanks for the fix, though proper one is already under review here:
http://www.spinics.net/lists/dmaengine/msg06143.html

You might break a channel prioritization.

Quoted 29 lines
---
 drivers/dma/dw/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/dw/core.c +1 -1
index cf1c87f..c2e9ac8 100644
@@ -1591,7 +1591,7 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct
 dw_dma_platform_data *pdata)
        INIT_LIST_HEAD(&dw->dma.channels);
        for (i = 0; i < nr_channels; i++) {
                struct dw_dma_chan      *dwc = &dw->chan[i];
-               int                     r = nr_channels - i - 1;
+               int                     r = DW_DMA_MAX_NR_CHANNELS - i - 1;
 
                dwc->chan.device = &dw->dma;
                dma_cookie_init(&dwc->chan);

--
1.7.12.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Signature · 2 lines
With Best Regards,
Andy Shevchenko