Merge remote-tracking branch 'tty/tty-next'
authorStephen Rothwell <sfr@canb.auug.org.au>
Tue, 13 Sep 2016 02:39:35 +0000 (12:39 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 13 Sep 2016 02:39:35 +0000 (12:39 +1000)
1  2 
drivers/dma/dw/core.c
drivers/dma/imx-sdma.c
drivers/tty/serial/8250/8250_dw.c

Simple merge
index a6bffbc47ee2e6d7ca3649de7f37af38fb9d7e0d,3cb47386fbb9b33e618459a5ebfa69565f2f3467..b9629b2bfc050b3c6cd4db691da49f99c7d85232
@@@ -689,12 -664,36 +686,35 @@@ static void sdma_update_channel_loop(st
                if (bd->mode.status & BD_DONE)
                        break;
  
-               if (bd->mode.status & BD_RROR)
+               if (bd->mode.status & BD_RROR) {
+                       bd->mode.status &= ~BD_RROR;
                        sdmac->status = DMA_ERROR;
+                       error = -EIO;
+               }
  
+              /*
+               * We use bd->mode.count to calculate the residue, since contains
+               * the number of bytes present in the current buffer descriptor.
+               */
+               sdmac->chn_real_count = bd->mode.count;
                bd->mode.status |= BD_DONE;
 -              if (sdmac->desc.callback)
 -                      sdmac->desc.callback(sdmac->desc.callback_param);
+               bd->mode.count = sdmac->period_len;
+               /*
+                * The callback is called from the interrupt context in order
+                * to reduce latency and to avoid the risk of altering the
+                * SDMA transaction status by the time the client tasklet is
+                * executed.
+                */
++              dmaengine_desc_get_callback_invoke(&sdmac->desc, NULL);
                sdmac->buf_tail++;
                sdmac->buf_tail %= sdmac->num_bd;
+               if (error)
+                       sdmac->status = old_status;
        }
  }
  
@@@ -722,20 -722,10 +743,10 @@@ static void mxc_sdma_handle_channel_nor
                sdmac->status = DMA_COMPLETE;
  
        dma_cookie_complete(&sdmac->desc);
 -      if (sdmac->desc.callback)
 -              sdmac->desc.callback(sdmac->desc.callback_param);
 +
 +      dmaengine_desc_get_callback_invoke(&sdmac->desc, NULL);
  }
  
- static void sdma_tasklet(unsigned long data)
- {
-       struct sdma_channel *sdmac = (struct sdma_channel *) data;
-       if (sdmac->flags & IMX_DMA_SG_LOOP)
-               sdma_handle_channel_loop(sdmac);
-       else
-               mxc_sdma_handle_channel_normal(sdmac);
- }
  static irqreturn_t sdma_int_handler(int irq, void *dev_id)
  {
        struct sdma_engine *sdma = dev_id;
Simple merge
This page took 0.029446 seconds and 5 git commands to generate.