- 05 12月, 2018 3 次提交
-
-
由 Lucas Stach 提交于
The dmaengine documentation states that device_terminate_all may be asynchronous and need not wait for the active transfers to stop. This allows us to move most of the functionality currently implemented in the sdma channel termination function to run in a worker, outside of any atomic context. Moving this out of atomic context has two benefits: we can now sleep while waiting for the channel to terminate, instead of busy waiting and the freeing of the dma descriptors happens with IRQs enabled, getting rid of a warning in the dma mapping code. As the termination is now async, we need to implement the device_synchronize dma engine function which simply waits for the worker to finish its execution. Signed-off-by: NLucas Stach <l.stach@pengutronix.de> Signed-off-by: NRobin Gong <yibin.gong@nxp.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Lucas Stach 提交于
This reverts commit fe5b85c6. The SDMA engine needs the descriptors to be contiguous in memory. As the dma pool API is only able to provide a single descriptor per alloc invocation there is no guarantee that multiple descriptors satisfy this requirement. Also the code in question is broken as it only allocates memory for a single descriptor, without looking at the number of descriptors required for the transfer, leading to out-of-bounds accesses when the descriptors are written. Signed-off-by: NLucas Stach <l.stach@pengutronix.de> Signed-off-by: NRobin Gong <yibin.gong@nxp.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Lucas Stach 提交于
This reverts commit c1199875, as this depends on another commit that is going to be reverted. Signed-off-by: NLucas Stach <l.stach@pengutronix.de> Signed-off-by: NRobin Gong <yibin.gong@nxp.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
- 29 11月, 2018 2 次提交
-
-
由 Richard Genoud 提交于
of_dma_controller_free() was not called on module onloading. This lead to a soft lockup: watchdog: BUG: soft lockup - CPU#0 stuck for 23s! Modules linked in: at_hdmac [last unloaded: at_hdmac] when of_dma_request_slave_channel() tried to call ofdma->of_dma_xlate(). Cc: stable@vger.kernel.org Fixes: bbe89c8e ("at_hdmac: move to generic DMA binding") Acked-by: NLudovic Desroches <ludovic.desroches@microchip.com> Signed-off-by: NRichard Genoud <richard.genoud@gmail.com> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Richard Genoud 提交于
The leak was found when opening/closing a serial port a great number of time, increasing kmalloc-32 in slabinfo. Each time the port was opened, dma_request_slave_channel() was called. Then, in at_dma_xlate(), atslave was allocated with devm_kzalloc() and never freed. (Well, it was free at module unload, but that's not what we want). So, here, kzalloc is more suited for the job since it has to be freed in atc_free_chan_resources(). Cc: stable@vger.kernel.org Fixes: bbe89c8e ("at_hdmac: move to generic DMA binding") Reported-by: NMario Forner <m.forner@be4energy.com> Suggested-by: NAlexandre Belloni <alexandre.belloni@bootlin.com> Acked-by: NAlexandre Belloni <alexandre.belloni@bootlin.com> Acked-by: NLudovic Desroches <ludovic.desroches@microchip.com> Signed-off-by: NRichard Genoud <richard.genoud@gmail.com> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
- 16 10月, 2018 2 次提交
-
-
由 Christian Lamparter 提交于
There are two poly_store, but one should have been poly_show. |adma.c:4382:16: error: conflicting types for 'poly_store' | static ssize_t poly_store(struct device_driver *dev, const char *buf, | ^~~~~~~~~~ |adma.c:4363:16: note: previous definition of 'poly_store' was here | static ssize_t poly_store(struct device_driver *dev, char *buf) | ^~~~~~~~~~ CC: stable@vger.kernel.org Fixes: 13efe1a0 ("dmaengine: ppc4xx: remove DRIVER_ATTR() usage") Signed-off-by: NChristian Lamparter <chunkeey@gmail.com> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Manivannan Sadhasivam 提交于
Following warnings are generated when compiled with W=1, drivers/dma/owl-dma.c:170: warning: Function parameter or member 'cyclic' not described in 'owl_dma_txd' drivers/dma/owl-dma.c:198: warning: Function parameter or member 'cfg' not described in 'owl_dma_vchan' drivers/dma/owl-dma.c:198: warning: Function parameter or member 'drq' not described in 'owl_dma_vchan' drivers/dma/owl-dma.c:225: warning: Function parameter or member 'irq' not described in 'owl_dma' Fix this by adding comments for relevant struct members to appear in kernel-doc. Fixes: d64e1b3f ("dmaengine: owl: Add Slave and Cyclic mode support for Actions Semi Owl S900 SoC") Reported-by: NVinod Koul <vinod.koul@linaro.org> Signed-off-by: NManivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Reviewed-by: NAndreas Färber <afaerber@suse.de> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
- 09 10月, 2018 1 次提交
-
-
由 Vinod Koul 提交于
dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Tested-by: NKrzysztof Kozlowski <krzk@kernel.org> Tested-by: NAngelo Dureghello <angelo@sysam.it> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
- 07 10月, 2018 13 次提交
-
-
由 Wolfram Sang 提交于
Fix warning when running with CONFIG_DMA_API_DEBUG_SG=y by allocating a device_dma_parameters structure and filling in the max segment size. Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Vinod Koul 提交于
dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Vinod Koul 提交于
dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Vinod Koul 提交于
dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Tested-by: NJohn Stultz <john.stultz@linaro.org> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Vinod Koul 提交于
Memcpy has no direction (copy from memory to memory) so remove the check in prep_memcpy() Tested-by: NJohn Stultz <john.stultz@linaro.org> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Vinod Koul 提交于
dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Vinod Koul 提交于
dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Acked-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Vinod Koul 提交于
dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Acked-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Vinod Koul 提交于
dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Acked-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Vinod Koul 提交于
dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Vinod Koul 提交于
dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Acked-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Vinod Koul 提交于
dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Acked-by: NScott Branden <scott.branden@broadcom.com> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Vinod Koul 提交于
dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Acked-by: NLudovic Desroches <ludovic.desroches@microchip.com> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
- 05 10月, 2018 2 次提交
-
-
由 Manivannan Sadhasivam 提交于
Add Slave and Cyclic mode support for Actions Semi Owl S900 SoC. The slave mode supports bus width of 4 bytes common for all peripherals and 1 byte specific for UART. The cyclic mode supports only block mode transfer. Signed-off-by: NManivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Rami Rosen 提交于
Signed-off-by: NRami Rosen <ramirose@gmail.com> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
- 03 10月, 2018 1 次提交
-
-
由 Oza Pawandeep 提交于
After bfcb79fc ("PCI/ERR: Run error recovery callbacks for all affected devices"), AER errors are always cleared by the PCI core and drivers don't need to do it themselves. Remove calls to pci_cleanup_aer_uncorrect_error_status() from device driver error recovery functions. Signed-off-by: NOza Pawandeep <poza@codeaurora.org> [bhelgaas: changelog, remove PCI core changes, remove unused variables] Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
-
- 02 10月, 2018 2 次提交
-
-
由 Pierre-Yves MORDRET 提交于
When a period length is not multiple of FIFO some data may be stuck within FIFO. Burst/FIFO Threshold/Period or buffer length check has to be hardened In any case DMA will grant any request from client but will degraded any parameters whether awkward. Signed-off-by: NPierre-Yves MORDRET <pierre-yves.mordret@st.com> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Nathan Chancellor 提交于
Clang warns when implicitly converting from one enumerated type to another. Avoid this by using the equivalent value from the expected type. drivers/dma/timb_dma.c:548:27: warning: implicit conversion from enumeration type 'enum dma_transfer_direction' to different enumeration type 'enum dma_data_direction' [-Wenum-conversion] td_desc->desc_list_len, DMA_MEM_TO_DEV); ^~~~~~~~~~~~~~ 1 warning generated. Reported-by: NNick Desaulniers <ndesaulniers@google.com> Signed-off-by: NNathan Chancellor <natechancellor@gmail.com> Reviewed-by: NNick Desaulniers <ndesaulniers@google.com> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
- 19 9月, 2018 2 次提交
-
-
由 Waiman Long 提交于
The following lockdep splat was observed: [ 1222.241750] ====================================================== [ 1222.271301] WARNING: possible circular locking dependency detected [ 1222.301060] 4.16.0-10.el8+5.x86_64+debug #1 Not tainted [ 1222.326659] ------------------------------------------------------ [ 1222.356565] systemd-shutdow/1 is trying to acquire lock: [ 1222.382660] ((&ioat_chan->timer)){+.-.}, at: [<00000000f71e1a28>] del_timer_sync+0x5/0xf0 [ 1222.422928] [ 1222.422928] but task is already holding lock: [ 1222.451743] (&(&ioat_chan->prep_lock)->rlock){+.-.}, at: [<000000008ea98b12>] ioat_shutdown+0x86/0x100 [ioatdma] : [ 1223.524987] Chain exists of: [ 1223.524987] (&ioat_chan->timer) --> &(&ioat_chan->cleanup_lock)->rlock --> &(&ioat_chan->prep_lock)->rlock [ 1223.524987] [ 1223.594082] Possible unsafe locking scenario: [ 1223.594082] [ 1223.622630] CPU0 CPU1 [ 1223.645080] ---- ---- [ 1223.667404] lock(&(&ioat_chan->prep_lock)->rlock); [ 1223.691535] lock(&(&ioat_chan->cleanup_lock)->rlock); [ 1223.728657] lock(&(&ioat_chan->prep_lock)->rlock); [ 1223.765122] lock((&ioat_chan->timer)); [ 1223.784095] [ 1223.784095] *** DEADLOCK *** [ 1223.784095] [ 1223.813492] 4 locks held by systemd-shutdow/1: [ 1223.834677] #0: (reboot_mutex){+.+.}, at: [<0000000056d33456>] SYSC_reboot+0x10f/0x300 [ 1223.873310] #1: (&dev->mutex){....}, at: [<00000000258dfdd7>] device_shutdown+0x1c8/0x660 [ 1223.913604] #2: (&dev->mutex){....}, at: [<0000000068331147>] device_shutdown+0x1d6/0x660 [ 1223.954000] #3: (&(&ioat_chan->prep_lock)->rlock){+.-.}, at: [<000000008ea98b12>] ioat_shutdown+0x86/0x100 [ioatdma] In the ioat_shutdown() function: spin_lock_bh(&ioat_chan->prep_lock); set_bit(IOAT_CHAN_DOWN, &ioat_chan->state); del_timer_sync(&ioat_chan->timer); spin_unlock_bh(&ioat_chan->prep_lock); According to the synchronization rule for the del_timer_sync() function, the caller must not hold locks which would prevent completion of the timer's handler. The timer structure has its own lock that manages its synchronization. Setting the IOAT_CHAN_DOWN bit should prevent other CPUs from trying to use that device anyway, there is probably no need to call del_timer_sync() while holding the prep_lock. So the del_timer_sync() call is now moved outside of the prep_lock critical section to prevent the circular lock dependency. Signed-off-by: NWaiman Long <longman@redhat.com> Reviewed-by: NDave Jiang <dave.jiang@intel.com> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Angelo Dureghello 提交于
This patch fixes the following compilation warning reported during x86_64 allmodconfig build: drivers/dma/mcf-edma.c: In function 'mcf_edma_filter_fn': drivers/dma/mcf-edma.c:296:33: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] return (mcf_chan->slave_id == (u32)param); Reported-by: NStephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: NAngelo Dureghello <angelo@sysam.it> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
- 11 9月, 2018 12 次提交
-
-
由 Zhaoxiong Yuan 提交于
idma64_chan_irq() is invoked in hardirq handle function, it is unnecessary to call spin_lock_irqsave. Signed-off-by: NZhaoxiong Yuan <yuanzhx326@gmail.com> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Daniel Silsby 提交于
This is the standard method provided by dmaengine header. Signed-off-by: NDaniel Silsby <dansilsby@gmail.com> Signed-off-by: NPaul Cercueil <paul@crapouillou.net> Tested-by: NMathieu Malaterre <malat@debian.org> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Daniel Silsby 提交于
Func jz4780_dma_desc_residue() expects the index to the next hw descriptor as its last parameter. Caller func jz4780_dma_tx_status(), however, applied modulus before passing it. When the current hw descriptor was last in the list, the index passed became zero. The resulting excess of reported residue especially caused problems with cyclic DMA transfer clients, i.e. ALSA AIC audio output, which rely on this for determining current DMA location within buffer. Combined with the recent and related residue-reporting fixes, spurious ALSA audio underruns on jz4770 hardware are now fixed. Signed-off-by: NDaniel Silsby <dansilsby@gmail.com> Signed-off-by: NPaul Cercueil <paul@crapouillou.net> Tested-by: NMathieu Malaterre <malat@debian.org> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Daniel Silsby 提交于
Normally, we wouldn't set the channel transfer count register directly when using descriptor-driven transfers. However, there is no harm in doing so, and it allows jz4780_dma_desc_residue() to report the correct residue of an ongoing transfer, no matter when it is called. Signed-off-by: NDaniel Silsby <dansilsby@gmail.com> Signed-off-by: NPaul Cercueil <paul@crapouillou.net> Tested-by: NMathieu Malaterre <malat@debian.org> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Daniel Silsby 提交于
Simple cleanup, no changes to actual logic here. Signed-off-by: NDaniel Silsby <dansilsby@gmail.com> Signed-off-by: NPaul Cercueil <paul@crapouillou.net> Tested-by: NMathieu Malaterre <malat@debian.org> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Daniel Silsby 提交于
The 'dtc' word in jz DMA descriptors contains two fields: The lowest 24 bits are the transfer count, and upper 8 bits are the DOA offset to next descriptor. The upper 8 bits are now correctly masked off when computing residue in jz4780_dma_desc_residue(). Note that reads of the DTCn hardware reg are automatically masked this way. Signed-off-by: NDaniel Silsby <dansilsby@gmail.com> Signed-off-by: NPaul Cercueil <paul@crapouillou.net> Tested-by: NMathieu Malaterre <malat@debian.org> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Paul Cercueil 提交于
With the fast DMA bit set, the DMA will transfer twice as much data per clock period to the AIC, so there is little point not to set it. Signed-off-by: NPaul Cercueil <paul@crapouillou.net> Tested-by: NMathieu Malaterre <malat@debian.org> Reviewed-by: NPrasannaKumar Muralidharan <prasannatsmkumar@gmail.com> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Paul Cercueil 提交于
The JZ4725B has one DMA core starring six DMA channels. As for the JZ4770, each DMA channel's clock can be enabled with a register write, the difference here being that once started, it is not possible to turn it off. Signed-off-by: NPaul Cercueil <paul@crapouillou.net> Tested-by: NMathieu Malaterre <malat@debian.org> Reviewed-by: NPrasannaKumar Muralidharan <prasannatsmkumar@gmail.com> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Paul Cercueil 提交于
The JZ4740 SoC has a single DMA core starring six DMA channels. Signed-off-by: NPaul Cercueil <paul@crapouillou.net> Tested-by: NMathieu Malaterre <malat@debian.org> Reviewed-by: NPrasannaKumar Muralidharan <prasannatsmkumar@gmail.com> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Paul Cercueil 提交于
The JZ4770 SoC has two DMA cores, each one featuring six DMA channels. The major change is that each channel's clock can be enabled or disabled through register writes. Signed-off-by: NPaul Cercueil <paul@crapouillou.net> Tested-by: NMathieu Malaterre <malat@debian.org> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Paul Cercueil 提交于
If we make this driver depend on MACH_JZ4780, that means it can be enabled only if we're building a kernel specially crafted for a JZ4780-based board, while most GNU/Linux distributions will want one generic MIPS kernel that works on multiple boards. Signed-off-by: NPaul Cercueil <paul@crapouillou.net> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Paul Cercueil 提交于
The only information we use in the 8-word version of the hardware DMA descriptor that is not present in the 4-word version is the transfer type, aka. the ID of the source or recipient device. Since the transfer type will never change for a DMA channel in use, we can just set it once for all in the corresponding DMA register before starting any transfer. This has several benefits: * the driver will handle twice as many hardware DMA descriptors; * the driver is closer to support the JZ4740, which only supports 4-word hardware DMA descriptors; * the JZ4770 SoC needs the transfer type to be set in the corresponding DMA register anyway, even if 8-word descriptors are in use. Signed-off-by: NPaul Cercueil <paul@crapouillou.net> Tested-by: NMathieu Malaterre <malat@debian.org> Reviewed-by: NPrasannaKumar Muralidharan <prasannatsmkumar@gmail.com> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-