<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/dma/at_hdmac.c, branch linux-4.2.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.2.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.2.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2015-07-31T15:03:42Z</updated>
<entry>
<title>dmaengine: at_hdmac: fix residue computation</title>
<updated>2015-07-31T15:03:42Z</updated>
<author>
<name>Cyrille Pitchen</name>
</author>
<published>2015-06-18T11:25:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=93dce3a6434f632dbd684ec1d9c3dc66a14e27e1'/>
<id>urn:sha1:93dce3a6434f632dbd684ec1d9c3dc66a14e27e1</id>
<content type='text'>
As claimed by the programmer datasheet and confirmed by the IP designer,
the Block Transfer Size (BTSIZE) bitfield of the Channel x Control A
Register (CTRLAx) always refers to a number of Source Width (SRC_WIDTH)
transfers.

Both the SRC_WIDTH and BTSIZE bitfields can be extacted from the CTRLAx
register to compute the DMA residue. So the 'tx_width' field is useless
and can be removed from the struct at_desc.

Before this patch, atc_prep_slave_sg() was not consistent: BTSIZE was
correctly initialized according to the SRC_WIDTH but 'tx_width' was always
set to reg_width, which was incorrect for MEM_TO_DEV transfers. It led to
bad DMA residue when 'tx_width' != SRC_WIDTH.

Also the 'tx_width' field was mostly set only in the first and last
descriptors. Depending on the kind of DMA transfer, this field remained
uninitialized for intermediate descriptors. The accurate DMA residue was
computed only when the currently processed descriptor was the first or the
last of the chain. This algorithm was a little bit odd. An accurate DMA
residue can always be computed using the SRC_WIDTH and BTSIZE bitfields
in the CTRLAx register.

Finally, the test to check whether the currently processed descriptor is
the last of the chain was wrong: for cyclic transfer, last_desc-&gt;lli.dscr
is NOT equal to zero, since set_desc_eol() is never called, but logically
equal to first_desc-&gt;txd.phys. This bug has a side effect on the
drivers/tty/serial/atmel_serial.c driver, which uses cyclic DMA transfer
to receive data. Since the DMA residue was wrong each time the DMA
transfer reaches the second (and last) period of the transfer, no more
data were received by the USART driver till the cyclic DMA transfer loops
back to the first period.

Signed-off-by: Cyrille Pitchen &lt;cyrille.pitchen@atmel.com&gt;
Acked-by: Torsten Fleischer &lt;torfl6749@gmail.com&gt;
Tested-by: Jirí Prchal &lt;jiri.prchal@aksignal.cz&gt;
Acked-by: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</content>
</entry>
<entry>
<title>dmaengine: hdmac: Implement interleaved transfers</title>
<updated>2015-06-12T12:43:36Z</updated>
<author>
<name>Maxime Ripard</name>
</author>
<published>2015-05-27T14:01:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5abecfa5e969722ab85a173168cae9e0f4cedbfc'/>
<id>urn:sha1:5abecfa5e969722ab85a173168cae9e0f4cedbfc</id>
<content type='text'>
The AT91 HDMAC controller supports interleaved transfers through what's
called the Picture-in-Picture mode, which allows to transfer a squared
portion of a framebuffer.

This means that this interleaved transfer only supports interleaved
transfers which have a transfer size and ICGs that are fixed across all the
chunks.

While this is a quite drastic restriction of the interleaved transfers
compared to what the dmaengine API allows, this is still useful, and our
driver will only reject transfers that do not conform to this.

Signed-off-by: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
Acked-by: Ludovic Desroches &lt;ludovic.desroches@atmel.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma</title>
<updated>2015-04-24T16:49:37Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2015-04-24T16:49:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d6a4c0e5d3d433ef296f8f417e835329a834a256'/>
<id>urn:sha1:d6a4c0e5d3d433ef296f8f417e835329a834a256</id>
<content type='text'>
Pull slave-dmaengine updates from Vinod Koul:

 - new drivers for:
        - Ingenic JZ4780 controller
        - APM X-Gene controller
        - Freescale RaidEngine device
        - Renesas USB Controller

  - remove device_alloc_chan_resources dummy handlers

  - sh driver cleanups for peri peri and related emmc and asoc patches
    as well

  - fixes and enhancements spread over the drivers

* 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma: (59 commits)
  dmaengine: dw: don't prompt for DW_DMAC_CORE
  dmaengine: shdmac: avoid unused variable warnings
  dmaengine: fix platform_no_drv_owner.cocci warnings
  dmaengine: pch_dma: fix memory leak on failure path in pch_dma_probe()
  dmaengine: at_xdmac: unlock spin lock before return
  dmaengine: xgene: devm_ioremap() returns NULL on error
  dmaengine: xgene: buffer overflow in xgene_dma_init_channels()
  dmaengine: usb-dmac: Fix dereferencing freed memory 'desc'
  dmaengine: sa11x0: report slave capabilities to upper layers
  dmaengine: vdma: Fix compilation warnings
  dmaengine: fsl_raid: statify fsl_re_chan_probe
  dmaengine: Driver support for FSL RaidEngine device.
  dmaengine: xgene_dma_init_ring_mngr() can be static
  Documentation: dma: Add documentation for the APM X-Gene SoC DMA device DTS binding
  arm64: dts: Add APM X-Gene SoC DMA device and DMA clock DTS nodes
  dmaengine: Add support for APM X-Gene SoC DMA engine driver
  dmaengine: usb-dmac: Add Renesas USB DMA Controller (USB-DMAC) driver
  dmaengine: renesas,usb-dmac: Add device tree bindings documentation
  dmaengine: edma: fixed wrongly initialized data parameter to the edma callback
  dmaengine: ste_dma40: fix implicit conversion
  ...
</content>
</entry>
<entry>
<title>dmaengine: at_hdmac: Fix calculation of the residual bytes</title>
<updated>2015-03-13T09:28:31Z</updated>
<author>
<name>Torsten Fleischer</name>
</author>
<published>2015-02-23T16:54:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bdf6c79278b3fb6caf1811ae877078c5f424bcb1'/>
<id>urn:sha1:bdf6c79278b3fb6caf1811ae877078c5f424bcb1</id>
<content type='text'>
This patch fixes the following issues regarding to the calculation of the
residue:

1. The residue is always calculated for the current transfer even if the
cookie is associated to a pending transfer.

2. For scatter/gather DMA the calculation of the residue for the current
transfer doesn't include the bytes of the child descriptors that are already
transferred.
It only calculates the difference between the transfer's total length minus
the number of bytes that are already transferred for the current child
descriptor.
For example: There is a scatter/gather DMA transfer with a total length of
1 MByte. Getting the residue several times while the transfer is running shows
something like that:

1: residue = 975584
2: residue = 1002766
3: residue = 992627
4: residue = 983767
5: residue = 985694
6: residue = 1008094
7: residue = 1009741
8: residue = 1011195

3. The driver stores the residue but never resets it when starting a new
transfer.
For example: If there are two subsequent DMA transfers. The first one with
a total length of 1 MByte and the second one with a total length of 1 kByte.
Getting the residue for both transfers shows something like that:

transfer 1: residue = 975584
transfer 2: residue = 1048380

Changes from V1:
   * Fixed coding style of the multi-line comments.
   * Improved accuracy of the residue calculation when the transfer for the
     first descriptor is active.

Changes from V2:
   * Member 'tx_width' of 'struct at_desc' restored, because the transfer width
     can't be derived from the source width when using "slave_sg".
     The transfer width is needed for the calculation of the residue if either
     the transfer of the first or the last descriptor is in progress.
     In the case of a "memory_to_memory_sg" transfer (part of this patch
     series) the transfer width of both descriptors may differ. Thus it is
     required to additionally set 'tx_width' of the last descriptor.
   * Added functions for multiply used calculations.

Signed-off-by: Torsten Fleischer &lt;torfl6749@gmail.com&gt;
Acked-by: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</content>
</entry>
<entry>
<title>dmaengine: at_hdmac: Add support for memory to memory sg transfers</title>
<updated>2015-03-13T09:27:54Z</updated>
<author>
<name>Torsten Fleischer</name>
</author>
<published>2015-02-23T16:54:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=265567fbca7136f1cf45cb49a630cf7109a2308a'/>
<id>urn:sha1:265567fbca7136f1cf45cb49a630cf7109a2308a</id>
<content type='text'>
This patch adds support for memory to memory scatter-gather transfers.

Changes from V1:
   * Fixed coding style of the multi-line comments.

Changes from V2:
   * Added setup of 'desc-&gt;tx_width' that is needed to calculate the
     residue.

Signed-off-by: Torsten Fleischer &lt;torfl6749@gmail.com&gt;
Acked-by: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</content>
</entry>
<entry>
<title>dmaengine: at_hdmac: declare slave capabilities</title>
<updated>2015-01-13T18:34:02Z</updated>
<author>
<name>Ludovic Desroches</name>
</author>
<published>2015-01-06T16:36:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=816070ede77003e033c76cd1f72127d9bb6c9a03'/>
<id>urn:sha1:816070ede77003e033c76cd1f72127d9bb6c9a03</id>
<content type='text'>
Declare slave capabilities to suppress "this driver doesn't support generic
slave capabilities reporting" warning.

Signed-off-by: Ludovic Desroches &lt;ludovic.desroches@atmel.com&gt;
Acked-by: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
Acked-by: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</content>
</entry>
<entry>
<title>dmaengine: hdmac: Split device_control</title>
<updated>2014-12-22T06:58:57Z</updated>
<author>
<name>Maxime Ripard</name>
</author>
<published>2014-11-17T13:42:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4facfe7f09f2b3f0799c924d9d6a0855a42c0833'/>
<id>urn:sha1:4facfe7f09f2b3f0799c924d9d6a0855a42c0833</id>
<content type='text'>
Split the device_control callback of the Atmel HDMAC driver to make use
of the newly introduced callbacks, that will eventually be used to retrieve
slave capabilities.

Signed-off-by: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
Acked-by: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</content>
</entry>
<entry>
<title>dma: at_hdmac: fix invalid remaining bytes detection</title>
<updated>2014-08-07T16:22:27Z</updated>
<author>
<name>Alexandre Belloni</name>
</author>
<published>2014-08-01T16:51:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6758ddafad55fc8e665bb03ff103d3e410483fe9'/>
<id>urn:sha1:6758ddafad55fc8e665bb03ff103d3e410483fe9</id>
<content type='text'>
Found using smatch:
drivers/dma/at_hdmac.c:299 atc_get_bytes_left() warn: unsigned
'atchan-&gt;remain_desc' is never less than zero.

Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</content>
</entry>
<entry>
<title>dmaengine: Remove the context argument to the prep_dma_cyclic operation</title>
<updated>2014-08-04T08:11:50Z</updated>
<author>
<name>Laurent Pinchart</name>
</author>
<published>2014-08-01T10:20:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=31c1e5a1350ae8d1bc2018f5de8264266d9773e1'/>
<id>urn:sha1:31c1e5a1350ae8d1bc2018f5de8264266d9773e1</id>
<content type='text'>
The argument is always set to NULL and never used. Remove it.

Signed-off-by: Laurent Pinchart &lt;laurent.pinchart+renesas@ideasonboard.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</content>
</entry>
<entry>
<title>dmaengine: at_hdmac: use tasklet_kill in teardown</title>
<updated>2014-03-17T13:03:43Z</updated>
<author>
<name>Vinod Koul</name>
</author>
<published>2014-03-06T06:54:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ccc7aad04c95c33407444b1387e42162925e5216'/>
<id>urn:sha1:ccc7aad04c95c33407444b1387e42162925e5216</id>
<content type='text'>
As discussed in [1] the tasklet_disable is not a proper function for teardown.
We need to ensure irq is disabled, followed by ensuring that don't schedule any
more tasklets and then its safe to use tasklet_kill().

Here in at_hdmac driver we use free_irq() before tasklet_kill(). The free_irq()
will ensure that the irq is disabled and also wait till all scheduled interrupts
are executed by invoking synchronize_irq(). So we need to only do tasklet_kill()
after invoking free_irq()

[1]: http://lwn.net/Articles/588457/

Reported-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
Reviewed-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</content>
</entry>
</feed>
