- 12 4月, 2021 1 次提交
-
-
由 Dinghao Liu 提交于
pm_runtime_get_sync() will increase the runtime PM counter even it returns an error. Thus a pairing decrement is needed to prevent refcount leak. Fix this by replacing this API with pm_runtime_resume_and_get(), which will not change the runtime PM counter on error. Signed-off-by: NDinghao Liu <dinghao.liu@zju.edu.cn> Acked-by: NThierry Reding <treding@nvidia.com> Link: https://lore.kernel.org/r/20210409082805.23643-1-dinghao.liu@zju.edu.cnSigned-off-by: NVinod Koul <vkoul@kernel.org>
-
- 18 9月, 2020 1 次提交
-
-
由 Allen Pais 提交于
In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: NRomain Perier <romain.perier@gmail.com> Signed-off-by: NAllen Pais <allen.lkml@gmail.com> Link: https://lore.kernel.org/r/20200831103542.305571-28-allen.lkml@gmail.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
-
- 16 6月, 2020 1 次提交
-
-
由 Gustavo A. R. Silva 提交于
There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://github.com/KSPP/linux/issues/21Signed-off-by: NGustavo A. R. Silva <gustavoars@kernel.org>
-
- 28 4月, 2020 1 次提交
-
-
由 Dmitry Osipenko 提交于
DMA synchronization hook checks whether interrupt is raised by testing corresponding bit in a hardware status register, and thus, clock should be enabled in this case, otherwise CPU may hang if synchronization is invoked while Runtime PM is in suspended state. This patch resumes the RPM during of the DMA synchronization process in order to avoid potential problems. It is a minor clean up of a previous commit, no real problem is fixed by this patch because currently RPM is always in a resumed state while DMA is synchronized, although this may change in the future. Fixes: 6697255f ("dmaengine: tegra-apb: Improve DMA synchronization") Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20200426190835.21950-1-digetx@gmail.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
-
- 11 4月, 2020 1 次提交
-
-
由 kbuild test robot 提交于
Remove dev_err() messages after platform_get_irq*() failures. platform_get_irq() already prints an error. Generated by: scripts/coccinelle/api/platform_get_irq.cocci Fixes: 6c41ac96 ("dmaengine: tegra-apb: Support COMPILE_TEST") Signed-off-by: Nkbuild test robot <lkp@intel.com> Signed-off-by: NJulia Lawall <julia.lawall@inria.fr> Signed-off-by: NAndrew Morton <akpm@linux-foundation.org> Reviewed-by: NDmitry Osipenko <digetx@gmail.com> Acked-by: NThierry Reding <treding@nvidia.com> Cc: Laxman Dewangan <ldewangan@nvidia.com> Cc: Vinod Koul <vinod.koul@linux.intel.com> Cc: Stephen Warren <swarren@wwwdotorg.org> Cc: Jon Hunter <jonathanh@nvidia.com> Link: http://lkml.kernel.org/r/alpine.DEB.2.21.2002271133450.2973@hadrienSigned-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
-
- 23 3月, 2020 3 次提交
-
-
由 Dmitry Osipenko 提交于
Boot CPU0 always handles DMA interrupts and under some rare circumstances it could stuck in uninterruptible state for a significant time (like in a case of KASAN + NFS root). In this case sibling CPU, which waits for DMA transfer completion, will get a DMA transfer timeout. In order to handle this rare condition, interrupt status needs to be polled until interrupt is handled. Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20200319212321.3297-2-digetx@gmail.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Dmitry Osipenko 提交于
The interrupt is already disabled while interrupt handler is running, and thus, there is no need to save/restore the IRQ flags within the spinlock. Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20200319212321.3297-1-digetx@gmail.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
-
由 YueHaibing 提交于
When CONFIG_PM is disabled, gcc warning this: drivers/dma/tegra20-apb-dma.c:1587:12: warning: 'tegra_dma_runtime_resume' defined but not used [-Wunused-function] drivers/dma/tegra20-apb-dma.c:1578:12: warning: 'tegra_dma_runtime_suspend' defined but not used [-Wunused-function] Make it as __maybe_unused to fix the warnings, also remove unneeded function declarations. Fixes: ec8a1586 ("dma: tegra: add dmaengine based dma driver") Signed-off-by: NYueHaibing <yuehaibing@huawei.com> Reviewed-by: NDmitry Osipenko <digetx@gmail.com> Acked-by: NThierry Reding <treding@nvidia.com> Link: https://lore.kernel.org/r/20200320071337.59756-1-yuehaibing@huawei.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
-
- 25 2月, 2020 17 次提交
-
-
由 Dmitry Osipenko 提交于
Technically it is possible that DMA could be misconfigured in a way that cyclic DMA transfer is processed slower than it takes to complete the cycle and in this case the DMA is getting aborted with a not very informative message about the problem, let's improve it. Suggested-by: NJon Hunter <jonathanh@nvidia.com> Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Acked-by: NJon Hunter <jonathanh@nvidia.com> Link: https://lore.kernel.org/r/20200209163356.6439-20-digetx@gmail.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Dmitry Osipenko 提交于
Remove unused function argument from handle_continuous_head_request(). Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Acked-by: NJon Hunter <jonathanh@nvidia.com> Link: https://lore.kernel.org/r/20200209163356.6439-19-digetx@gmail.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Dmitry Osipenko 提交于
Tegra APB DMA driver is an Open Firmware driver, so it uses OF alias naming scheme which overrides MODULE_ALIAS, meaning that MODULE_ALIAS does nothing and could be removed safely. Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Acked-by: NJon Hunter <jonathanh@nvidia.com> Link: https://lore.kernel.org/r/20200209163356.6439-17-digetx@gmail.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Dmitry Osipenko 提交于
The DMA controller shall be released on driver's removal. Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Acked-by: NJon Hunter <jonathanh@nvidia.com> Link: https://lore.kernel.org/r/20200209163356.6439-15-digetx@gmail.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Dmitry Osipenko 提交于
It is enough to check whether hardware is busy on suspend and to reset it across of suspend-resume because: 1. Channel's configuration is fully re-programmed on each DMA transfer anyways. 2. Context save-restore of an active channel won't end up well without pausing transfer prior to the context's saving, but note that every channel shall be idling at the time of suspend, so save-restore is not needed at all. 3. The only case where context save-restore may be useful is when channel is in a paused state during suspend. But channel's pausing could be supported only on Tegra114+ and this functionality wasn't implemented by the driver for years now because there is no need for it in upstream kernel. Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Acked-by: NJon Hunter <jonathanh@nvidia.com> Link: https://lore.kernel.org/r/20200209163356.6439-14-digetx@gmail.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Dmitry Osipenko 提交于
It's a bit impractical to enable hardware's clock at the time of DMA channel's allocation because most of DMA client drivers allocate DMA channel at the time of the driver's probing, and thus, DMA clock is kept always-enabled in practice, defeating the whole purpose of runtime PM. Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Acked-by: NJon Hunter <jonathanh@nvidia.com> Link: https://lore.kernel.org/r/20200209163356.6439-13-digetx@gmail.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Dmitry Osipenko 提交于
There are few place in the code which check whether pending_sg_req list is empty despite of the check already being done. Let's remove the duplicated checks to keep code clean. Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Acked-by: NJon Hunter <jonathanh@nvidia.com> Link: https://lore.kernel.org/r/20200209163356.6439-12-digetx@gmail.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Dmitry Osipenko 提交于
The runtime PM is always available on all Tegra SoCs since the commit 40b2bb1b ("ARM: tegra: enforce PM requirement"), so there is no need to handle the case of unavailable RPM in the code anymore. Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Acked-by: NJon Hunter <jonathanh@nvidia.com> Link: https://lore.kernel.org/r/20200209163356.6439-11-digetx@gmail.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Dmitry Osipenko 提交于
There is no need to re-initialize the already initialized variables. The tdc->config_init=false after driver's probe and after channel's freeing, so there is no need to re-initialize it on the channel's allocation. Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Acked-by: NJon Hunter <jonathanh@nvidia.com> Link: https://lore.kernel.org/r/20200209163356.6439-10-digetx@gmail.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Dmitry Osipenko 提交于
This patch fixes few dozens of coding style problems reported by checkpatch and prettifies code where makes sense. Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Acked-by: NJon Hunter <jonathanh@nvidia.com> Link: https://lore.kernel.org/r/20200209163356.6439-9-digetx@gmail.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Dmitry Osipenko 提交于
Use resource-managed variant of request_irq for brevity. Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Acked-by: NJon Hunter <jonathanh@nvidia.com> Link: https://lore.kernel.org/r/20200209163356.6439-8-digetx@gmail.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Dmitry Osipenko 提交于
Use devm_platform_ioremap_resource to keep code cleaner a tad. Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Acked-by: NJon Hunter <jonathanh@nvidia.com> Link: https://lore.kernel.org/r/20200209163356.6439-7-digetx@gmail.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Dmitry Osipenko 提交于
There is no need to kill tasklet when driver's probe fails because tasklet can't be scheduled at this time. It is also cleaner to kill tasklet on channel's freeing rather than to kill it on driver's removal, otherwise tasklet could perform a dummy execution after channel's releasing, which isn't very nice. Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Acked-by: NJon Hunter <jonathanh@nvidia.com> Link: https://lore.kernel.org/r/20200209163356.6439-6-digetx@gmail.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Dmitry Osipenko 提交于
It's incorrect to check the channel's "busy" state without taking a lock. That shouldn't cause any real troubles, nevertheless it's always better not to have any race conditions in the code. Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Acked-by: NJon Hunter <jonathanh@nvidia.com> Link: https://lore.kernel.org/r/20200209163356.6439-5-digetx@gmail.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Dmitry Osipenko 提交于
The ISR tasklet could be kept scheduled after DMA transfer termination, let's add synchronization hook which blocks until tasklet is finished. Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Acked-by: NJon Hunter <jonathanh@nvidia.com> Link: https://lore.kernel.org/r/20200209163356.6439-4-digetx@gmail.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Dmitry Osipenko 提交于
The interrupt handler puts a half-completed DMA descriptor on a free list and then schedules tasklet to process bottom half of the descriptor that executes client's callback, this creates possibility to pick up the busy descriptor from the free list. Thus, let's disallow descriptor's re-use until it is fully processed. Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Acked-by: NJon Hunter <jonathanh@nvidia.com> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20200209163356.6439-3-digetx@gmail.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Dmitry Osipenko 提交于
I was doing some experiments with I2C and noticed that Tegra APB DMA driver crashes sometime after I2C DMA transfer termination. The crash happens because tegra_dma_terminate_all() bails out immediately if pending list is empty, and thus, it doesn't release the half-completed descriptors which are getting re-used before ISR tasklet kicks-in. tegra-i2c 7000c400.i2c: DMA transfer timeout elants_i2c 0-0010: elants_i2c_irq: failed to read data: -110 ------------[ cut here ]------------ WARNING: CPU: 0 PID: 142 at lib/list_debug.c:45 __list_del_entry_valid+0x45/0xac list_del corruption, ddbaac44->next is LIST_POISON1 (00000100) Modules linked in: CPU: 0 PID: 142 Comm: kworker/0:2 Not tainted 5.5.0-rc2-next-20191220-00175-gc3605715758d-dirty #538 Hardware name: NVIDIA Tegra SoC (Flattened Device Tree) Workqueue: events_freezable_power_ thermal_zone_device_check [<c010e5c5>] (unwind_backtrace) from [<c010a1c5>] (show_stack+0x11/0x14) [<c010a1c5>] (show_stack) from [<c0973925>] (dump_stack+0x85/0x94) [<c0973925>] (dump_stack) from [<c011f529>] (__warn+0xc1/0xc4) [<c011f529>] (__warn) from [<c011f7e9>] (warn_slowpath_fmt+0x61/0x78) [<c011f7e9>] (warn_slowpath_fmt) from [<c042497d>] (__list_del_entry_valid+0x45/0xac) [<c042497d>] (__list_del_entry_valid) from [<c047a87f>] (tegra_dma_tasklet+0x5b/0x154) [<c047a87f>] (tegra_dma_tasklet) from [<c0124799>] (tasklet_action_common.constprop.0+0x41/0x7c) [<c0124799>] (tasklet_action_common.constprop.0) from [<c01022ab>] (__do_softirq+0xd3/0x2a8) [<c01022ab>] (__do_softirq) from [<c0124683>] (irq_exit+0x7b/0x98) [<c0124683>] (irq_exit) from [<c0168c19>] (__handle_domain_irq+0x45/0x80) [<c0168c19>] (__handle_domain_irq) from [<c043e429>] (gic_handle_irq+0x45/0x7c) [<c043e429>] (gic_handle_irq) from [<c0101aa5>] (__irq_svc+0x65/0x94) Exception stack(0xde2ebb90 to 0xde2ebbd8) Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Acked-by: NJon Hunter <jonathanh@nvidia.com> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20200209163356.6439-2-digetx@gmail.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
-
- 25 7月, 2019 1 次提交
-
-
由 Dmitry Osipenko 提交于
Tegra's APB DMA engine updates words counter after each transferred burst of data, hence it can report transfer's residual with more fidelity which may be required in cases like audio playback. In particular this fixes audio stuttering during playback in a chromium web browser. The patch is based on the original work that was made by Ben Dooks and a patch from downstream kernel. It was tested on Tegra20 and Tegra30 devices. Link: https://lore.kernel.org/lkml/20190424162348.23692-1-ben.dooks@codethink.co.uk/ Link: https://nv-tegra.nvidia.com/gitweb/?p=linux-4.4.git;a=commit;h=c7bba40c6846fbf3eaad35c4472dcc7d8bbc02e5Inspired-by: NBen Dooks <ben.dooks@codethink.co.uk> Reviewed-by: NJon Hunter <jonathanh@nvidia.com> Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20190705150519.18171-1-digetx@gmail.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
-
- 04 6月, 2019 1 次提交
-
-
由 Dmitry Osipenko 提交于
Apparently driver was never tested with DMA_PREP_INTERRUPT flag being unset since it completely disables interrupt handling instead of skipping the callbacks invocations, hence putting channel into unusable state. The flag is always set by all of kernel drivers that use APB DMA, so let's error out in otherwise case for consistency. It won't be difficult to support that case properly if ever will be needed. Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Acked-by: NJon Hunter <jonathanh@nvidia.com> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
- 31 5月, 2019 1 次提交
-
-
由 Thomas Gleixner 提交于
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms and conditions of the gnu general public license version 2 as published by the free software foundation this program is distributed in the hope it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not see http www gnu org licenses extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 228 file(s). Signed-off-by: NThomas Gleixner <tglx@linutronix.de> Reviewed-by: NAllison Randal <allison@lohutok.net> Reviewed-by: NSteve Winslow <swinslow@gmail.com> Reviewed-by: NRichard Fontana <rfontana@redhat.com> Reviewed-by: NAlexios Zavras <alexios.zavras@intel.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190528171438.107155473@linutronix.deSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 07 1月, 2019 6 次提交
-
-
由 Gustavo A. R. Silva 提交于
One of the more common cases of allocation size calculations is finding the size of a structure that has a zero-sized array at the end, along with memory for some number of elements for that array. For example: struct foo { int stuff; void *entry[]; }; instance = devm_kzalloc(dev, sizeof(struct foo) + sizeof(void *) * count, GFP_KERNEL); Instead of leaving these open-coded and prone to type mistakes, we can now use the new struct_size() helper: instance = devm_kzalloc(dev, struct_size(instance, entry, count), GFP_KERNEL); This code was detected with the help of Coccinelle. Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Ben Dooks 提交于
Add some trace-points to the driver to allow for debuging via the trace pipe. Signed-off-by: NBen Dooks <ben.dooks@codethink.co.uk> Reviewed-by: NSteven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Ben Dooks 提交于
The name field is used for "apbdma.%d" which is rarely going to be more than 10 bytes, so reduce the size from 30 to 12. This is only being used by the interrupt registration, so is not critical to the operation of the driver either. Signed-off-by: NBen Dooks <ben.dooks@codethink.co.uk> Acked-by: NJon Hunter <jonathanh@nvidia.com> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Ben Dooks 提交于
The use of Dma is annoying, since it is an acronym so should be all upper case. Fix this throughout the driver. Reviewed-by: NDmitry Osipenko <digetx@gmail.com> Signed-off-by: NBen Dooks <ben.dooks@codethink.co.uk> Acked-by: NJon Hunter <jonathanh@nvidia.com> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Ben Dooks 提交于
The buffer byte request length and counter are declared as signed integers but the values should never be below zero, so make these unsigned integers instead. Reviewed-by: NDmitry Osipenko <digetx@gmail.com> Signed-off-by: NBen Dooks <ben.dooks@codethink.co.uk> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Ben Dooks 提交于
The dma_desc->bytes_transferred counter tracks the number of bytes moved by the DMA channel. This is then used to calculate the information passed back in the in the tegra_dma_tx_status callback, which is usually fine. When the DMA channel is configured as continous, then the bytes_transferred counter will increase over time and eventually overflow to become negative so the residue count will become invalid and the ALSA sound-dma code will report invalid hardware pointer values to the application. This results in some users becoming confused about the playout position and putting audio data in the wrong place. To fix this issue, always ensure the bytes_transferred field is modulo the size of the request. We only do this for the case of the cyclic transfer done ISR as anyone attempting to move 2GiB of DMA data in one transfer is unlikely. Note, we don't fix the issue that we should /never/ transfer a negative number of bytes so we could make those fields unsigned. Reviewed-by: NDmitry Osipenko <digetx@gmail.com> Signed-off-by: NBen Dooks <ben.dooks@codethink.co.uk> Acked-by: NJon Hunter <jonathanh@nvidia.com> Signed-off-by: NVinod Koul <vkoul@kernel.org>
-
- 29 11月, 2017 1 次提交
-
-
由 Dmitry Osipenko 提交于
This allows DMA client to issue a non-flow controlled TX. In particular it is needed for the fuse driver that reads fuse registers using APBDMA to workaround a HW bug that results in hang when CPU and DMA perform simultaneous access to fuse peripheral. Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Reviewed-by: NJon Hunter <jonathanh@nvidia.com> Signed-off-by: NVinod Koul <vinod.koul@intel.com>
-
- 30 6月, 2017 1 次提交
-
-
由 Jon Hunter 提交于
Commit edd3bdbe ("dmaengine: tegra-apb: Correct runtime-pm usage") added pm_runtime_get/put() calls to the tegra-apb DMA system suspend callbacks. Runtime PM is disabled during system suspend and so these APIs cannot be used. Fix the suspend handling for the tegra-apb DMA by moving the save and restore of the DMA register context into the runtime PM suspend and resume callbacks, and then use the pm_runtime_force_suspend/resume() APIs to invoke the runtime PM callbacks during system suspend. Fixes: edd3bdbe ("dmaengine: tegra-apb: Correct runtime-pm usage") Signed-off-by: NJon Hunter <jonathanh@nvidia.com> Signed-off-by: NVinod Koul <vinod.koul@intel.com>
-
- 08 8月, 2016 1 次提交
-
-
由 Dave Jiang 提交于
This is in preperation of moving to a callback that provides results to the callback for the transaction. The conversion will maintain current behavior and the driver must convert to new callback mechanism at a later time in order to receive results. Signed-off-by: NDave Jiang <dave.jiang@intel.com> Reviewed-by: NLars-Peter Clausen <lars@metafoo.de> Cc: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: NVinod Koul <vinod.koul@intel.com>
-
- 30 6月, 2016 3 次提交
-
-
由 Jon Hunter 提交于
Commit 71f7e6cc ('dmaengine: tegra20-apb-dma: Only calculate residue if txstate exists') changed the tegra_dma_tx_status() function to only calculate the residue if there is a valid 'txstate' pointer for storing the residue. Although this makes sense, this changed the behaviour of the function tegra_dma_tx_status() such that if the pointer 'txstate' is not valid, then we will return whatever state is returned by dma_cookie_status() and no longer return the state by looking up the DMA descriptor and returning it's state. Please note that dma_cookie_status() will either return DMA_COMPLETE or DMA_IN_PROGRESS. However, if dma_cookie_status() returns DMA_IN_PROGRESS the actual status could be DMA_ERROR which will only be seen from checking the descriptor status. Therefore, even if 'txstate' is not valid, still check to see if there is a valid descriptor for the cookie in question and if so return the descriptor state. Finally, ensure the residue is still not calculated if the 'txstate' is not valid. Signed-off-by: NJon Hunter <jonathanh@nvidia.com> Signed-off-by: NVinod Koul <vinod.koul@intel.com>
-
由 Jon Hunter 提交于
The calculation of the DMA residue for the Tegra APB DMA is duplicated in two places in the tegra_dma_tx_status() function. Remove this duplicated code by moving calculation to the end of the function and only calculating if we found a valid descriptor. Signed-off-by: NJon Hunter <jonathanh@nvidia.com> Signed-off-by: NVinod Koul <vinod.koul@intel.com>
-
由 Jon Hunter 提交于
Correct the grammar in the debug message when no descriptor is found. Signed-off-by: NJon Hunter <jonathanh@nvidia.com> Signed-off-by: NVinod Koul <vinod.koul@intel.com>
-