Skip to contentSkip to conversation

dmaengine: dw: clear LLP_[SD]_EN bits in last descriptor of a chain

PATCH In review Mans Rullgard 5 participants 5 messages Dec 21, 2015 – Jan 6, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dmaengine: dw: clear LLP_[SD]_EN bits in last descriptor of a chain

The datasheet requires that the LLP_[SD]_EN bits be cleared whenever LLP.LOC is zero, i.e. in the last descriptor of a multi-block chain. Make the driver do this.

---
 drivers/dma/dw/core.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/dma/dw/core.c +2 -0
index 7067b6ddc1db..ca7cafc82f6b 100644
@@ -751,6 +751,7 @@ dwc_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
 		prev->lli.ctllo |= DWC_CTLL_INT_EN;
 
 	prev->lli.llp = 0;
+	prev->lli.ctllo &= ~(DWC_CTLL_LLP_D_EN | DWC_CTLL_LLP_S_EN);
 	first->txd.flags = flags;
 	first->total_len = len;
 
@@ -912,6 +913,7 @@ slave_sg_fromdev_fill_desc:
 		prev->lli.ctllo |= DWC_CTLL_INT_EN;
 
 	prev->lli.llp = 0;
+	prev->lli.ctllo &= ~(DWC_CTLL_LLP_D_EN | DWC_CTLL_LLP_S_EN);
 	first->total_len = total_len;
 
 	return &first->txd;
Signature · 1 line
2.6.3
reviewer Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Mans Rullgard

The datasheet requires that the LLP_[SD]_EN bits be cleared whenever LLP.LOC is zero, i.e. in the last descriptor of a multi-block chain. Make the driver do this.

Quoted 27 lines

---
 drivers/dma/dw/core.c | 2 ++

 1 file changed, 2 insertions(+)
drivers/dma/dw/core.c +0 -0
index 7067b6ddc1db..ca7cafc82f6b 100644
@@ -751,6 +751,7 @@ dwc_prep_dma_memcpy(struct dma_chan *chan,
 dma_addr_t dest, dma_addr_t src,
  		prev->lli.ctllo |= DWC_CTLL_INT_EN;


  prev->lli.llp = 0;

drivers/dma/dw/core.c +1 -0
+	prev->lli.ctllo &= ~(DWC_CTLL_LLP_D_EN | DWC_CTLL_LLP_S_EN);

  first->txd.flags = flags;
  first->total_len = len;

drivers/dma/dw/core.c +0 -0
@@ -912,6 +913,7 @@ slave_sg_fromdev_fill_desc:
  		prev->lli.ctllo |= DWC_CTLL_INT_EN;


  prev->lli.llp = 0;

drivers/dma/dw/core.c +1 -0
+	prev->lli.ctllo &= ~(DWC_CTLL_LLP_D_EN | DWC_CTLL_LLP_S_EN);

  first->total_len = total_len;

  return &first->txd;

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
#2 lore raw
Quoted 8 lines · Andy Shevchenko
Quoted 5 lines · Mans Rullgard

The datasheet requires that the LLP_[SD]_EN bits be cleared whenever
LLP.LOC is zero, i.e. in the last descriptor of a multi-block chain.
Make the driver do this.

Vinod, I would like to postpone this patch for a while to make a bit easier back porting of other dw_dmac changes wrt fix SATA on 460EX (*).

I will send it later in a bunch. Hope Måns has no objections on this.

(*) Now I'm pretty sure that the main issues with SATA are a) wrong master settings for transfers and LLP, and b) endiannes issue with values in LLP. That's why I hope to have those patches coming first with a proper Fixes: tag.

Quoted 31 lines
Quoted 30 lines

---
 drivers/dma/dw/core.c | 2 ++

 1 file changed, 2 insertions(+)
drivers/dma/dw/core.c +0 -0
index 7067b6ddc1db..ca7cafc82f6b 100644
@@ -751,6 +751,7 @@ dwc_prep_dma_memcpy(struct dma_chan *chan,
 dma_addr_t dest, dma_addr_t src,
  		prev->lli.ctllo |= DWC_CTLL_INT_EN;


  prev->lli.llp = 0;

drivers/dma/dw/core.c +1 -0
+	prev->lli.ctllo &= ~(DWC_CTLL_LLP_D_EN |

DWC_CTLL_LLP_S_EN);
  first->txd.flags = flags;
  first->total_len = len;

drivers/dma/dw/core.c +0 -0
@@ -912,6 +913,7 @@ slave_sg_fromdev_fill_desc:
  		prev->lli.ctllo |= DWC_CTLL_INT_EN;


  prev->lli.llp = 0;

drivers/dma/dw/core.c +1 -0
+	prev->lli.ctllo &= ~(DWC_CTLL_LLP_D_EN |

DWC_CTLL_LLP_S_EN);
  first->total_len = total_len;

  return &first->txd;

Signature · 13 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
���{.n�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m����������?�I�
#3 lore raw
Quoted 8 lines · Andriy
Quoted 7 lines · Andy Shevchenko
Quoted 5 lines · Mans Rullgard

The datasheet requires that the LLP_[SD]_EN bits be cleared whenever
LLP.LOC is zero, i.e. in the last descriptor of a multi-block chain.
Make the driver do this.

Quoted 6 lines
Quoted 1 line

Vinod, I would like to postpone this patch for a while to make a bit easier back porting of other dw_dmac changes wrt fix SATA on 460EX (*).

I will send it later in a bunch. Hope Måns has no objections on this.

Okay by me as long as Måns is okay

Signature · 1 line
~Vinod