<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/dma, branch v5.14</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.14</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.14'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2021-08-06T18:08:24Z</updated>
<entry>
<title>Merge tag 'dmaengine-fix-5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine</title>
<updated>2021-08-06T18:08:24Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2021-08-06T18:08:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4f1be39638a538f6495c0a29e648255fb8c54f8b'/>
<id>urn:sha1:4f1be39638a538f6495c0a29e648255fb8c54f8b</id>
<content type='text'>
Pull dmaengine fixes from Vinod Koul:
 "A bunch of driver fixes, notably:

   - idxd driver fixes for submission race, driver remove sequence,
     setup sequence for MSIXPERM, array index and updating descriptor
     vector

   - usb-dmac, pm reference leak fix

   - xilinx_dma, read-after-free fix

   - uniphier-xdmac fix for using atomic readl_poll_timeout_atomic()

   - of-dma, router_xlate to return

   - imx-dma, generic dma fix"

* tag 'dmaengine-fix-5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine:
  dmaengine: imx-dma: configure the generic DMA type to make it work
  dmaengine: of-dma: router_xlate to return -EPROBE_DEFER if controller is not yet available
  dmaengine: stm32-dmamux: Fix PM usage counter unbalance in stm32 dmamux ops
  dmaengine: stm32-dma: Fix PM usage counter imbalance in stm32 dma ops
  dmaengine: uniphier-xdmac: Use readl_poll_timeout_atomic() in atomic state
  dmaengine: idxd: fix submission race window
  dmaengine: idxd: fix sequence for pci driver remove() and shutdown()
  dmaengine: idxd: fix desc-&gt;vector that isn't being updated
  dmaengine: idxd: fix setup sequence for MSIXPERM table
  dmaengine: idxd: fix array index when int_handles are being used
  dmaengine: usb-dmac: Fix PM reference leak in usb_dmac_probe()
  dmaengine: xilinx_dma: Fix read-after-free bug when terminating transfers
</content>
</entry>
<entry>
<title>dmaengine: imx-dma: configure the generic DMA type to make it work</title>
<updated>2021-08-02T07:01:19Z</updated>
<author>
<name>Juergen Borleis</name>
<email>jbe@pengutronix.de</email>
</author>
<published>2021-07-29T07:18:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7199ddede9f0f2f68d41e6928e1c6c4bca9c39c0'/>
<id>urn:sha1:7199ddede9f0f2f68d41e6928e1c6c4bca9c39c0</id>
<content type='text'>
Commit dea7a9fbb009 ("dmaengine: imx-dma: remove dma_slave_config
direction usage") changes the method from a "configuration when called"
to an "configuration when used". Due to this, only the cyclic DMA type
gets configured correctly, while the generic DMA type is left
non-configured.

Without this additional call, the struct imxdma_channel::word_size member
is stuck at DMA_SLAVE_BUSWIDTH_UNDEFINED and imxdma_prep_slave_sg() always
returns NULL.

Signed-off-by: Juergen Borleis &lt;jbe@pengutronix.de&gt;
Fixes: dea7a9fbb009 ("dmaengine: imx-dma: remove dma_slave_config direction usage")
Link: https://lore.kernel.org/r/20210729071821.9857-1-jbe@pengutronix.de
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: of-dma: router_xlate to return -EPROBE_DEFER if controller is not yet available</title>
<updated>2021-07-28T07:24:50Z</updated>
<author>
<name>Peter Ujfalusi</name>
<email>peter.ujfalusi@gmail.com</email>
</author>
<published>2021-07-17T19:00:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=eda97cb095f2958bbad55684a6ca3e7d7af0176a'/>
<id>urn:sha1:eda97cb095f2958bbad55684a6ca3e7d7af0176a</id>
<content type='text'>
If the router_xlate can not find the controller in the available DMA
devices then it should return with -EPORBE_DEFER in a same way as the
of_dma_request_slave_channel() does.

The issue can be reproduced if the event router is registered before the
DMA controller itself and a driver would request for a channel before the
controller is registered.
In of_dma_request_slave_channel():
1. of_dma_find_controller() would find the dma_router
2. ofdma-&gt;of_dma_xlate() would fail and returned NULL
3. -ENODEV is returned as error code

with this patch we would return in this case the correct -EPROBE_DEFER and
the client can try to request the channel later.

Signed-off-by: Peter Ujfalusi &lt;peter.ujfalusi@gmail.com&gt;
Link: https://lore.kernel.org/r/20210717190021.21897-1-peter.ujfalusi@gmail.com
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: stm32-dmamux: Fix PM usage counter unbalance in stm32 dmamux ops</title>
<updated>2021-07-28T06:34:12Z</updated>
<author>
<name>Zhang Qilong</name>
<email>zhangqilong3@huawei.com</email>
</author>
<published>2021-06-07T06:46:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=baa16371c9525f24d508508e4d296c031e1de29c'/>
<id>urn:sha1:baa16371c9525f24d508508e4d296c031e1de29c</id>
<content type='text'>
pm_runtime_get_sync will increment pm usage counter
even it failed. Forgetting to putting operation will
result in reference leak here. We fix it by replacing
it with pm_runtime_resume_and_get to keep usage counter
balanced.

Fixes: 4f3ceca254e0f ("dmaengine: stm32-dmamux: Add PM Runtime support")
Signed-off-by: Zhang Qilong &lt;zhangqilong3@huawei.com&gt;
Link: https://lore.kernel.org/r/20210607064640.121394-3-zhangqilong3@huawei.com
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: stm32-dma: Fix PM usage counter imbalance in stm32 dma ops</title>
<updated>2021-07-28T06:34:12Z</updated>
<author>
<name>Zhang Qilong</name>
<email>zhangqilong3@huawei.com</email>
</author>
<published>2021-06-07T06:46:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d54db74ad6e0dea8c253fb68c689b836657ab914'/>
<id>urn:sha1:d54db74ad6e0dea8c253fb68c689b836657ab914</id>
<content type='text'>
pm_runtime_get_sync will increment pm usage counter
even it failed. Forgetting to putting operation will
result in reference leak here. We fix it by replacing
it with pm_runtime_resume_and_get to keep usage counter
balanced.

Fixes: 48bc73ba14bcd ("dmaengine: stm32-dma: Add PM Runtime support")
Fixes: 05f8740a0e6fc ("dmaengine: stm32-dma: add suspend/resume power management support")
Signed-off-by: Zhang Qilong &lt;zhangqilong3@huawei.com&gt;
Link: https://lore.kernel.org/r/20210607064640.121394-2-zhangqilong3@huawei.com
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: uniphier-xdmac: Use readl_poll_timeout_atomic() in atomic state</title>
<updated>2021-07-27T12:45:42Z</updated>
<author>
<name>Kunihiko Hayashi</name>
<email>hayashi.kunihiko@socionext.com</email>
</author>
<published>2021-07-27T05:47:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=55f24c27b6c1a840b62fe297616f1f9ea3576cb7'/>
<id>urn:sha1:55f24c27b6c1a840b62fe297616f1f9ea3576cb7</id>
<content type='text'>
The function uniphier_xdmac_chan_stop() is only called in atomic state.
Should use readl_poll_timeout_atomic() there instead of
readl_poll_timeout().

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Fixes: 667b9251440b ("dmaengine: uniphier-xdmac: Add UniPhier external DMA controller driver")
Signed-off-by: Kunihiko Hayashi &lt;hayashi.kunihiko@socionext.com&gt;
Link: https://lore.kernel.org/r/1627364852-28432-1-git-send-email-hayashi.kunihiko@socionext.com
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: idxd: fix submission race window</title>
<updated>2021-07-20T17:25:08Z</updated>
<author>
<name>Dave Jiang</name>
<email>dave.jiang@intel.com</email>
</author>
<published>2021-07-14T18:50:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6b4b87f2c31ac1af4f244990a7cbfb50d3f3e33f'/>
<id>urn:sha1:6b4b87f2c31ac1af4f244990a7cbfb50d3f3e33f</id>
<content type='text'>
Konstantin observed that when descriptors are submitted, the descriptor is
added to the pending list after the submission. This creates a race window
with the slight possibility that the descriptor can complete before it
gets added to the pending list and this window would cause the completion
handler to miss processing the descriptor.

To address the issue, the addition of the descriptor to the pending list
must be done before it gets submitted to the hardware. However, submitting
to swq with ENQCMDS instruction can cause a failure with the condition of
either wq is full or wq is not "active".

With the descriptor allocation being the gate to the wq capacity, it is not
possible to hit a retry with ENQCMDS submission to the swq. The only
possible failure can happen is when wq is no longer "active" due to hw
error and therefore we are moving towards taking down the portal. Given
this is a rare condition and there's no longer concern over I/O
performance, the driver can walk the completion lists in order to retrieve
and abort the descriptor.

The error path will set the descriptor to aborted status. It will take the
work list lock to prevent further processing of worklist. It will do a
delete_all on the pending llist to retrieve all descriptors on the pending
llist. The delete_all action does not require a lock. It will walk through
the acquired llist to find the aborted descriptor while add all remaining
descriptors to the work list since it holds the lock. If it does not find
the aborted descriptor on the llist, it will walk through the work
list. And if it still does not find the descriptor, then it means the
interrupt handler has removed the desc from the llist but is pending on
the work list lock and will process it once the error path releases the
lock.

Fixes: eb15e7154fbf ("dmaengine: idxd: add interrupt handle request and release support")
Reported-by: Konstantin Ananyev &lt;konstantin.ananyev@intel.com&gt;
Signed-off-by: Dave Jiang &lt;dave.jiang@intel.com&gt;
Link: https://lore.kernel.org/r/162628855747.360485.10101925573082466530.stgit@djiang5-desk3.ch.intel.com
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: idxd: fix sequence for pci driver remove() and shutdown()</title>
<updated>2021-07-20T17:24:20Z</updated>
<author>
<name>Dave Jiang</name>
<email>dave.jiang@intel.com</email>
</author>
<published>2021-07-14T21:57:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7eb25da161befbc9a80e94e1bd90d6c06aa645cf'/>
<id>urn:sha1:7eb25da161befbc9a80e94e1bd90d6c06aa645cf</id>
<content type='text'>
-&gt;shutdown() call should only be responsible for quiescing the device.
Currently it is doing PCI device tear down. This causes issue when things
like MMIO mapping is removed while idxd_unregister_devices() will trigger
removal of idxd device sub-driver and still initiates MMIO writes to the
device. Another issue is with the unregistering of idxd 'struct device',
the memory context gets freed. So the teardown calls are accessing freed
memory and can cause kernel oops. Move all the teardown bits that doesn't
belong in shutdown to -&gt;remove() call. Move unregistering of the idxd
conf_dev 'struct device' to after doing all the teardown to free all
the memory that's no longer needed.

Fixes: 47c16ac27d4c ("dmaengine: idxd: fix idxd conf_dev 'struct device' lifetime")
Signed-off-by: Dave Jiang &lt;dave.jiang@intel.com&gt;
Link: https://lore.kernel.org/r/162629983901.395844.17964803190905549615.stgit@djiang5-desk3.ch.intel.com
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: idxd: fix desc-&gt;vector that isn't being updated</title>
<updated>2021-07-20T17:23:56Z</updated>
<author>
<name>Dave Jiang</name>
<email>dave.jiang@intel.com</email>
</author>
<published>2021-07-14T18:38:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8ba89a3c7967808f33478a8573277cf6a7412c4c'/>
<id>urn:sha1:8ba89a3c7967808f33478a8573277cf6a7412c4c</id>
<content type='text'>
Missing update for desc-&gt;vector when the wq vector gets updated. This
causes the desc-&gt;vector to always be at 0.

Fixes: da435aedb00a ("dmaengine: idxd: fix array index when int_handles are being used")
Signed-off-by: Dave Jiang &lt;dave.jiang@intel.com&gt;
Link: https://lore.kernel.org/r/162628784374.353761.4736602409627820431.stgit@djiang5-desk3.ch.intel.com
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: mpc512x: Fix fall-through warning for Clang</title>
<updated>2021-07-14T16:05:55Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavoars@kernel.org</email>
</author>
<published>2021-07-14T16:05:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=afbd0d299289a0faaa605af74982f87ad75468fc'/>
<id>urn:sha1:afbd0d299289a0faaa605af74982f87ad75468fc</id>
<content type='text'>
Fix the following fallthrough warning (powerpc-randconfig):

drivers/dma/mpc512x_dma.c:816:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]

Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Link: https://lore.kernel.org/lkml/60ef0750.I8J+C6KAtb0xVOAa%25lkp@intel.com/
Signed-off-by: Gustavo A. R. Silva &lt;gustavoars@kernel.org&gt;
</content>
</entry>
</feed>
