<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/dma, branch v4.1.41</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>dmaengine: ep93xx: Don't drain the transfers in terminate_all()</title>
<updated>2017-06-08T10:12:47+00:00</updated>
<author>
<name>Alexander Sverdlin</name>
<email>alexander.sverdlin@gmail.com</email>
</author>
<published>2017-05-22T14:05:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=81402e4033a7d10c6f841bff364ae0bf0f2fa505'/>
<id>81402e4033a7d10c6f841bff364ae0bf0f2fa505</id>
<content type='text'>
[ Upstream commit 98f9de366fccee7572c646af226b2d4b4841e3b5 ]

Draining the transfers in terminate_all callback happens with IRQs disabled,
therefore induces huge latency:

 irqsoff latency trace v1.1.5 on 4.11.0
 --------------------------------------------------------------------
 latency: 39770 us, #57/57, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0)
    -----------------
    | task: process-129 (uid:0 nice:0 policy:2 rt_prio:50)
    -----------------
  =&gt; started at: _snd_pcm_stream_lock_irqsave
  =&gt; ended at:   snd_pcm_stream_unlock_irqrestore

                  _------=&gt; CPU#
                 / _-----=&gt; irqs-off
                | / _----=&gt; need-resched
                || / _---=&gt; hardirq/softirq
                ||| / _--=&gt; preempt-depth
                |||| /     delay
  cmd     pid   ||||| time  |   caller
     \   /      |||||  \    |   /
process-129     0d.s.    3us : _snd_pcm_stream_lock_irqsave
process-129     0d.s1    9us : snd_pcm_stream_lock &lt;-_snd_pcm_stream_lock_irqsave
process-129     0d.s1   15us : preempt_count_add &lt;-snd_pcm_stream_lock
process-129     0d.s2   22us : preempt_count_add &lt;-snd_pcm_stream_lock
process-129     0d.s3   32us : snd_pcm_update_hw_ptr0 &lt;-snd_pcm_period_elapsed
process-129     0d.s3   41us : soc_pcm_pointer &lt;-snd_pcm_update_hw_ptr0
process-129     0d.s3   50us : dmaengine_pcm_pointer &lt;-soc_pcm_pointer
process-129     0d.s3   58us+: snd_dmaengine_pcm_pointer_no_residue &lt;-dmaengine_pcm_pointer
process-129     0d.s3   96us : update_audio_tstamp &lt;-snd_pcm_update_hw_ptr0
process-129     0d.s3  103us : snd_pcm_update_state &lt;-snd_pcm_update_hw_ptr0
process-129     0d.s3  112us : xrun &lt;-snd_pcm_update_state
process-129     0d.s3  119us : snd_pcm_stop &lt;-xrun
process-129     0d.s3  126us : snd_pcm_action &lt;-snd_pcm_stop
process-129     0d.s3  134us : snd_pcm_action_single &lt;-snd_pcm_action
process-129     0d.s3  141us : snd_pcm_pre_stop &lt;-snd_pcm_action_single
process-129     0d.s3  150us : snd_pcm_do_stop &lt;-snd_pcm_action_single
process-129     0d.s3  157us : soc_pcm_trigger &lt;-snd_pcm_do_stop
process-129     0d.s3  166us : snd_dmaengine_pcm_trigger &lt;-soc_pcm_trigger
process-129     0d.s3  175us : ep93xx_dma_terminate_all &lt;-snd_dmaengine_pcm_trigger
process-129     0d.s3  182us : preempt_count_add &lt;-ep93xx_dma_terminate_all
process-129     0d.s4  189us*: m2p_hw_shutdown &lt;-ep93xx_dma_terminate_all
process-129     0d.s4 39472us : m2p_hw_setup &lt;-ep93xx_dma_terminate_all

 ... rest skipped...

process-129     0d.s. 40080us : &lt;stack trace&gt;
 =&gt; ep93xx_dma_tasklet
 =&gt; tasklet_action
 =&gt; __do_softirq
 =&gt; irq_exit
 =&gt; __handle_domain_irq
 =&gt; vic_handle_irq
 =&gt; __irq_usr
 =&gt; 0xb66c6668

Just abort the transfers and warn if the HW state is not what we expect.
Move draining into device_synchronize callback.

Signed-off-by: Alexander Sverdlin &lt;alexander.sverdlin@gmail.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 98f9de366fccee7572c646af226b2d4b4841e3b5 ]

Draining the transfers in terminate_all callback happens with IRQs disabled,
therefore induces huge latency:

 irqsoff latency trace v1.1.5 on 4.11.0
 --------------------------------------------------------------------
 latency: 39770 us, #57/57, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0)
    -----------------
    | task: process-129 (uid:0 nice:0 policy:2 rt_prio:50)
    -----------------
  =&gt; started at: _snd_pcm_stream_lock_irqsave
  =&gt; ended at:   snd_pcm_stream_unlock_irqrestore

                  _------=&gt; CPU#
                 / _-----=&gt; irqs-off
                | / _----=&gt; need-resched
                || / _---=&gt; hardirq/softirq
                ||| / _--=&gt; preempt-depth
                |||| /     delay
  cmd     pid   ||||| time  |   caller
     \   /      |||||  \    |   /
process-129     0d.s.    3us : _snd_pcm_stream_lock_irqsave
process-129     0d.s1    9us : snd_pcm_stream_lock &lt;-_snd_pcm_stream_lock_irqsave
process-129     0d.s1   15us : preempt_count_add &lt;-snd_pcm_stream_lock
process-129     0d.s2   22us : preempt_count_add &lt;-snd_pcm_stream_lock
process-129     0d.s3   32us : snd_pcm_update_hw_ptr0 &lt;-snd_pcm_period_elapsed
process-129     0d.s3   41us : soc_pcm_pointer &lt;-snd_pcm_update_hw_ptr0
process-129     0d.s3   50us : dmaengine_pcm_pointer &lt;-soc_pcm_pointer
process-129     0d.s3   58us+: snd_dmaengine_pcm_pointer_no_residue &lt;-dmaengine_pcm_pointer
process-129     0d.s3   96us : update_audio_tstamp &lt;-snd_pcm_update_hw_ptr0
process-129     0d.s3  103us : snd_pcm_update_state &lt;-snd_pcm_update_hw_ptr0
process-129     0d.s3  112us : xrun &lt;-snd_pcm_update_state
process-129     0d.s3  119us : snd_pcm_stop &lt;-xrun
process-129     0d.s3  126us : snd_pcm_action &lt;-snd_pcm_stop
process-129     0d.s3  134us : snd_pcm_action_single &lt;-snd_pcm_action
process-129     0d.s3  141us : snd_pcm_pre_stop &lt;-snd_pcm_action_single
process-129     0d.s3  150us : snd_pcm_do_stop &lt;-snd_pcm_action_single
process-129     0d.s3  157us : soc_pcm_trigger &lt;-snd_pcm_do_stop
process-129     0d.s3  166us : snd_dmaengine_pcm_trigger &lt;-soc_pcm_trigger
process-129     0d.s3  175us : ep93xx_dma_terminate_all &lt;-snd_dmaengine_pcm_trigger
process-129     0d.s3  182us : preempt_count_add &lt;-ep93xx_dma_terminate_all
process-129     0d.s4  189us*: m2p_hw_shutdown &lt;-ep93xx_dma_terminate_all
process-129     0d.s4 39472us : m2p_hw_setup &lt;-ep93xx_dma_terminate_all

 ... rest skipped...

process-129     0d.s. 40080us : &lt;stack trace&gt;
 =&gt; ep93xx_dma_tasklet
 =&gt; tasklet_action
 =&gt; __do_softirq
 =&gt; irq_exit
 =&gt; __handle_domain_irq
 =&gt; vic_handle_irq
 =&gt; __irq_usr
 =&gt; 0xb66c6668

Just abort the transfers and warn if the HW state is not what we expect.
Move draining into device_synchronize callback.

Signed-off-by: Alexander Sverdlin &lt;alexander.sverdlin@gmail.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dmaengine: ep93xx: Always start from BASE0</title>
<updated>2017-06-08T10:12:47+00:00</updated>
<author>
<name>Alexander Sverdlin</name>
<email>alexander.sverdlin@gmail.com</email>
</author>
<published>2017-05-22T14:05:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=1a45b842de712b9645951f66ca3c0e455c811268'/>
<id>1a45b842de712b9645951f66ca3c0e455c811268</id>
<content type='text'>
[ Upstream commit 0037ae47812b1f431cc602100d1d51f37d77b61e ]

The current buffer is being reset to zero on device_free_chan_resources()
but not on device_terminate_all(). It could happen that HW is restarted and
expects BASE0 to be used, but the driver is not synchronized and will start
from BASE1. One solution is to reset the buffer explicitly in
m2p_hw_setup().

Signed-off-by: Alexander Sverdlin &lt;alexander.sverdlin@gmail.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 0037ae47812b1f431cc602100d1d51f37d77b61e ]

The current buffer is being reset to zero on device_free_chan_resources()
but not on device_terminate_all(). It could happen that HW is restarted and
expects BASE0 to be used, but the driver is not synchronized and will start
from BASE1. One solution is to reset the buffer explicitly in
m2p_hw_setup().

Signed-off-by: Alexander Sverdlin &lt;alexander.sverdlin@gmail.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dmaengine: usb-dmac: Fix DMAOR AE bit definition</title>
<updated>2017-06-08T10:12:19+00:00</updated>
<author>
<name>Hiroyuki Yokoyama</name>
<email>hiroyuki.yokoyama.vx@renesas.com</email>
</author>
<published>2017-05-15T08:49:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=0bef2bd6fa64c5dac54a3b41f58bc7068af85333'/>
<id>0bef2bd6fa64c5dac54a3b41f58bc7068af85333</id>
<content type='text'>
[ Upstream commit 9a445bbb1607d9f14556a532453dd86d1b7e381e ]

This patch fixes the register definition of AE (Address Error flag) bit.

Fixes: 0c1c8ff32fa2 ("dmaengine: usb-dmac: Add Renesas USB DMA Controller (USB-DMAC) driver")
Cc: &lt;stable@vger.kernel.org&gt; # v4.1+
Signed-off-by: Hiroyuki Yokoyama &lt;hiroyuki.yokoyama.vx@renesas.com&gt;
[Shimoda: add Fixes and Cc tags in the commit log]
Signed-off-by: Yoshihiro Shimoda &lt;yoshihiro.shimoda.uh@renesas.com&gt;
Reviewed-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;

Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 9a445bbb1607d9f14556a532453dd86d1b7e381e ]

This patch fixes the register definition of AE (Address Error flag) bit.

Fixes: 0c1c8ff32fa2 ("dmaengine: usb-dmac: Add Renesas USB DMA Controller (USB-DMAC) driver")
Cc: &lt;stable@vger.kernel.org&gt; # v4.1+
Signed-off-by: Hiroyuki Yokoyama &lt;hiroyuki.yokoyama.vx@renesas.com&gt;
[Shimoda: add Fixes and Cc tags in the commit log]
Signed-off-by: Yoshihiro Shimoda &lt;yoshihiro.shimoda.uh@renesas.com&gt;
Reviewed-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;

Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dmaengine: usb-dmac: check CHCR.DE bit in usb_dmac_isr_channel()</title>
<updated>2016-09-12T13:28:54+00:00</updated>
<author>
<name>Yoshihiro Shimoda</name>
<email>yoshihiro.shimoda.uh@renesas.com</email>
</author>
<published>2016-08-04T10:59:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b9ee45d273cae7f7aa7dd82f7346f51812d4887e'/>
<id>b9ee45d273cae7f7aa7dd82f7346f51812d4887e</id>
<content type='text'>
[ Upstream commit 626d2f07de89bf6be3d7301524d0ab3375b81b9c ]

The USB-DMAC's interruption happens even if the CHCR.DE is not set to 1
because CHCR.NULLE is set to 1. So, this driver should call
usb_dmac_isr_transfer_end() if the DE bit is set to 1 only. Otherwise,
the desc is possible to be NULL in the usb_dmac_isr_transfer_end().

Fixes: 0c1c8ff32fa2 ("dmaengine: usb-dmac: Add Renesas USB DMA Controller (USB-DMAC) driver)
Cc: &lt;stable@vger.kernel.org&gt; # v4.1+
Signed-off-by: Yoshihiro Shimoda &lt;yoshihiro.shimoda.uh@renesas.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 626d2f07de89bf6be3d7301524d0ab3375b81b9c ]

The USB-DMAC's interruption happens even if the CHCR.DE is not set to 1
because CHCR.NULLE is set to 1. So, this driver should call
usb_dmac_isr_transfer_end() if the DE bit is set to 1 only. Otherwise,
the desc is possible to be NULL in the usb_dmac_isr_transfer_end().

Fixes: 0c1c8ff32fa2 ("dmaengine: usb-dmac: Add Renesas USB DMA Controller (USB-DMAC) driver)
Cc: &lt;stable@vger.kernel.org&gt; # v4.1+
Signed-off-by: Yoshihiro Shimoda &lt;yoshihiro.shimoda.uh@renesas.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dmaengine: at_xdmac: double FIFO flush needed to compute residue</title>
<updated>2016-07-11T00:19:51+00:00</updated>
<author>
<name>Ludovic Desroches</name>
<email>ludovic.desroches@atmel.com</email>
</author>
<published>2016-05-12T14:54:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=039f59796079951d6e0ffb40d7882b5597e5e16c'/>
<id>039f59796079951d6e0ffb40d7882b5597e5e16c</id>
<content type='text'>
[ Upstream commit 9295c41d77ca93aac79cfca6fa09fa1ca5cab66f ]

Due to the way CUBC register is updated, a double flush is needed to
compute an accurate residue. First flush aim is to get data from the DMA
FIFO and second one ensures that we won't report data which are not in
memory.

Signed-off-by: Ludovic Desroches &lt;ludovic.desroches@atmel.com&gt;
Fixes: e1f7c9eee707 ("dmaengine: at_xdmac: creation of the atmel
eXtended DMA Controller driver")
Cc: stable@vger.kernel.org #v4.1 and later
Reviewed-by: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;

Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 9295c41d77ca93aac79cfca6fa09fa1ca5cab66f ]

Due to the way CUBC register is updated, a double flush is needed to
compute an accurate residue. First flush aim is to get data from the DMA
FIFO and second one ensures that we won't report data which are not in
memory.

Signed-off-by: Ludovic Desroches &lt;ludovic.desroches@atmel.com&gt;
Fixes: e1f7c9eee707 ("dmaengine: at_xdmac: creation of the atmel
eXtended DMA Controller driver")
Cc: stable@vger.kernel.org #v4.1 and later
Reviewed-by: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;

Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dmaengine: at_xdmac: fix residue corruption</title>
<updated>2016-07-11T00:19:51+00:00</updated>
<author>
<name>Ludovic Desroches</name>
<email>ludovic.desroches@atmel.com</email>
</author>
<published>2016-05-12T14:54:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6d8fde793d0efbf1e48bca89ee261c18ddafea84'/>
<id>6d8fde793d0efbf1e48bca89ee261c18ddafea84</id>
<content type='text'>
[ Upstream commit 53398f488821c2b5b15291e3debec6ad33f75d3d ]

An unexpected value of CUBC can lead to a corrupted residue. A more
complex sequence is needed to detect an inaccurate value for NCA or CUBC.

Signed-off-by: Ludovic Desroches &lt;ludovic.desroches@atmel.com&gt;
Fixes: e1f7c9eee707 ("dmaengine: at_xdmac: creation of the atmel
eXtended DMA Controller driver")
Cc: stable@vger.kernel.org #v4.1 and later
Reviewed-by: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;

Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 53398f488821c2b5b15291e3debec6ad33f75d3d ]

An unexpected value of CUBC can lead to a corrupted residue. A more
complex sequence is needed to detect an inaccurate value for NCA or CUBC.

Signed-off-by: Ludovic Desroches &lt;ludovic.desroches@atmel.com&gt;
Fixes: e1f7c9eee707 ("dmaengine: at_xdmac: creation of the atmel
eXtended DMA Controller driver")
Cc: stable@vger.kernel.org #v4.1 and later
Reviewed-by: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;

Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dmaengine: at_xdmac: align descriptors on 64 bits</title>
<updated>2016-07-11T00:19:51+00:00</updated>
<author>
<name>Ludovic Desroches</name>
<email>ludovic.desroches@atmel.com</email>
</author>
<published>2016-05-12T14:54:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=c6ec15d8965d03a604bdcfde28a5c506b9de7043'/>
<id>c6ec15d8965d03a604bdcfde28a5c506b9de7043</id>
<content type='text'>
[ Upstream commit 4a9723e8df68cfce4048517ee32e37f78854b6fb ]

Having descriptors aligned on 64 bits allows update CNDA and CUBC in an
atomic way.

Signed-off-by: Ludovic Desroches &lt;ludovic.desroches@atmel.com&gt;
Fixes: e1f7c9eee707 ("dmaengine: at_xdmac: creation of the atmel
eXtended DMA Controller driver")
Cc: stable@vger.kernel.org #v4.1 and later
Reviewed-by: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;

Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 4a9723e8df68cfce4048517ee32e37f78854b6fb ]

Having descriptors aligned on 64 bits allows update CNDA and CUBC in an
atomic way.

Signed-off-by: Ludovic Desroches &lt;ludovic.desroches@atmel.com&gt;
Fixes: e1f7c9eee707 ("dmaengine: at_xdmac: creation of the atmel
eXtended DMA Controller driver")
Cc: stable@vger.kernel.org #v4.1 and later
Reviewed-by: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;

Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dmaengine: dw: fix master selection</title>
<updated>2016-04-20T05:08:56+00:00</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2016-04-08T13:22:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=bd58e66e02c6d59997121936d755f2e39cb10653'/>
<id>bd58e66e02c6d59997121936d755f2e39cb10653</id>
<content type='text'>
[ Upstream commit 3fe6409c23e2bee4b2b1b6d671d2da8daa15271c ]

The commit 895005202987 ("dmaengine: dw: apply both HS interfaces and remove
slave_id usage") cleaned up the code to avoid usage of depricated slave_id
member of generic slave configuration.

Meanwhile it broke the master selection by removing important call to
dwc_set_masters() in -&gt;device_alloc_chan_resources() which copied masters from
custom slave configuration to the internal channel structure.

Everything works until now since there is no customized connection of
DesignWare DMA IP to the bus, i.e. one bus and one or more masters are in use.
The configurations where 2 masters are connected to the different masters are
not working anymore. We are expecting one user of such configuration and need
to select masters properly. Besides that it is obviously a performance
regression since only one master is in use in multi-master configuration.

Select masters in accordance with what user asked for. Keep this patch in a form
more suitable for back porting.

We are safe to take necessary data in -&gt;device_alloc_chan_resources() because
we don't support generic slave configuration embedded into custom one, and thus
the only way to provide such is to use the parameter to a filter function which
is called exactly before channel resource allocation.

While here, replase BUG_ON to less noisy dev_warn() and prevent channel
allocation in case of error.

Fixes: 895005202987 ("dmaengine: dw: apply both HS interfaces and remove slave_id usage")
Cc: stable@vger.kernel.org
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 3fe6409c23e2bee4b2b1b6d671d2da8daa15271c ]

The commit 895005202987 ("dmaengine: dw: apply both HS interfaces and remove
slave_id usage") cleaned up the code to avoid usage of depricated slave_id
member of generic slave configuration.

Meanwhile it broke the master selection by removing important call to
dwc_set_masters() in -&gt;device_alloc_chan_resources() which copied masters from
custom slave configuration to the internal channel structure.

Everything works until now since there is no customized connection of
DesignWare DMA IP to the bus, i.e. one bus and one or more masters are in use.
The configurations where 2 masters are connected to the different masters are
not working anymore. We are expecting one user of such configuration and need
to select masters properly. Besides that it is obviously a performance
regression since only one master is in use in multi-master configuration.

Select masters in accordance with what user asked for. Keep this patch in a form
more suitable for back porting.

We are safe to take necessary data in -&gt;device_alloc_chan_resources() because
we don't support generic slave configuration embedded into custom one, and thus
the only way to provide such is to use the parameter to a filter function which
is called exactly before channel resource allocation.

While here, replase BUG_ON to less noisy dev_warn() and prevent channel
allocation in case of error.

Fixes: 895005202987 ("dmaengine: dw: apply both HS interfaces and remove slave_id usage")
Cc: stable@vger.kernel.org
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dmaengine: hsu: correct use of channel status register</title>
<updated>2016-04-20T05:03:44+00:00</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2016-03-18T12:26:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2d6e4631986ca03cde760acd1c76181559ddc997'/>
<id>2d6e4631986ca03cde760acd1c76181559ddc997</id>
<content type='text'>
[ Upstream commit 4f4bc0abff79dc9d7ccbd3143adbf8ad1f4fe6ab ]

There is a typo in documentation regarding to descriptor empty bit (DESCE)
which is set to 1 when descriptor is empty. Thus, status register at the end of
a transfer usually returns all DESCE bits set and thus it will never be zero.

Moreover, there are 2 bits (CDESC) that encode current descriptor, on which
interrupt has been asserted. In case when we have few descriptors programmed we
might have non-zero value.

Remove DESCE and CDESC bits from DMA channel status register (HSU_CH_SR) when
reading it.

Fixes: 2b49e0c56741 ("dmaengine: append hsu DMA driver")
Cc: stable@vger.kernel.org
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 4f4bc0abff79dc9d7ccbd3143adbf8ad1f4fe6ab ]

There is a typo in documentation regarding to descriptor empty bit (DESCE)
which is set to 1 when descriptor is empty. Thus, status register at the end of
a transfer usually returns all DESCE bits set and thus it will never be zero.

Moreover, there are 2 bits (CDESC) that encode current descriptor, on which
interrupt has been asserted. In case when we have few descriptors programmed we
might have non-zero value.

Remove DESCE and CDESC bits from DMA channel status register (HSU_CH_SR) when
reading it.

Fixes: 2b49e0c56741 ("dmaengine: append hsu DMA driver")
Cc: stable@vger.kernel.org
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dmaengine: at_xdmac: fix residue computation</title>
<updated>2016-03-22T15:10:35+00:00</updated>
<author>
<name>Ludovic Desroches</name>
<email>ludovic.desroches@atmel.com</email>
</author>
<published>2016-03-10T09:17:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=c7d4bd1d975e3fa1dd4ecf557ada0e792d551a6c'/>
<id>c7d4bd1d975e3fa1dd4ecf557ada0e792d551a6c</id>
<content type='text'>
[ Upstream commit 25c5e9626ca4d40928dc9c44f009ce2ed0a739e7 ]

When computing the residue we need two pieces of information: the current
descriptor and the remaining data of the current descriptor. To get
that information, we need to read consecutively two registers but we
can't do it in an atomic way. For that reason, we have to check manually
that current descriptor has not changed.

Signed-off-by: Ludovic Desroches &lt;ludovic.desroches@atmel.com&gt;
Suggested-by: Cyrille Pitchen &lt;cyrille.pitchen@atmel.com&gt;
Reported-by: David Engraf &lt;david.engraf@sysgo.com&gt;
Tested-by: David Engraf &lt;david.engraf@sysgo.com&gt;
Fixes: e1f7c9eee707 ("dmaengine: at_xdmac: creation of the atmel
eXtended DMA Controller driver")
Cc: stable@vger.kernel.org #4.1 and later
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;

Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 25c5e9626ca4d40928dc9c44f009ce2ed0a739e7 ]

When computing the residue we need two pieces of information: the current
descriptor and the remaining data of the current descriptor. To get
that information, we need to read consecutively two registers but we
can't do it in an atomic way. For that reason, we have to check manually
that current descriptor has not changed.

Signed-off-by: Ludovic Desroches &lt;ludovic.desroches@atmel.com&gt;
Suggested-by: Cyrille Pitchen &lt;cyrille.pitchen@atmel.com&gt;
Reported-by: David Engraf &lt;david.engraf@sysgo.com&gt;
Tested-by: David Engraf &lt;david.engraf@sysgo.com&gt;
Fixes: e1f7c9eee707 ("dmaengine: at_xdmac: creation of the atmel
eXtended DMA Controller driver")
Cc: stable@vger.kernel.org #4.1 and later
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;

Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
