Age | Commit message (Collapse) | Author |
|
toradex_imx_4.1.15_1.0.0_ga-next
|
|
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
The 'pm_runtime_get_sync()' and 'pm_runtime_put_sync_suspend()'
may be called not pairs. And this will cause the 'usage_count'
to be negative.
Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 10135c736dfc1b3d5c449adb78118e3642b99276)
|
|
Add 'ipg' and 'axi' clocks for pxp which should
be used to control runtime power managments.
Signed-off-by: Fancy Fang <chen.fang@nxp.com>
|
|
The head list may be corrupted when two requests from
the same 'pxp_chan' are issued sequentially. So change
the issue_pending function to strictly serialized the
requests to avoid this kind of issue.
Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 3ed71dcdd8ceeb3725399053f31c1930d2e7a08d)
|
|
Coverity
There may be potential memory leak when the 'desc' allocation failed.
The previous allocated descriptors should be freed when the allocation
failed.
Signed-off-by: Fancy Fang <chen.fang@nxp.com>
|
|
Add fsl_chan->edesc NULL when calling .fsl_edma_desc_residue() to avoid
NULL pointer access.
Signed-off-by: Fugang Duan <B38611@freescale.com>
|
|
Fix two code issues, but not function break or potential bug:
--Unsigned compared against 0 (NO_EFFECT)
--Wrong size argument (SIZEOF_MISMATCH)
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
|
|
Add imx6ul device type to enable the ERR008517 workaround or not by dts.
Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit 17d6a090b7a39bfd7836a3685d20201dcb0fa25e)
|
|
The code slice in the pxp_probe() function:
"
if (!res || irq < 0) {
err = -ENODEV;
goto exit;
}
"
appears twice closely. And the second code slice will become
dead code which is never executed. So remove the second one.
Signed-off-by: Fancy Fang <chen.fang@freescale.com>
|
|
The 'sg' buffer should be allocated dynamically, since its
size is dependent on the 'sg_len' which is calculated
according to the functions required.
Signed-off-by: Fancy Fang <chen.fang@freescale.com>
(cherry picked from commit 57f08c108fc4f4721449b4b94be9820c7443978a)
|
|
The commit '39c6663 MLK-11848-2 dma: imx-sdma: add __init for probe()' is
not correct, fix it totally.
Signed-off-by: Robin Gong <b38343@freescale.com>
|
|
Fix buiding error with GCC 4.6.2:
WARNING: drivers/dma/built-in.o(.text+0xefac): Section mismatch in reference from the function sdma_probe() to the function .init.text:sdma_event_remap.isra.21()
The function sdma_probe() references
the function __init sdma_event_remap.isra.21().
This is often because sdma_probe lacks a __init
annotation or the annotation of sdma_event_remap.isra.21 is wrong.
Signed-off-by: Robin Gong <b38343@freescale.com>
|
|
The 'CONFIG_PM_RUNTIME' has been eliminated and all the users
should use 'CONFIG_PM' directly. So do this change for pxp-v2
and pxp-v3.
Signed-off-by: Fancy Fang <chen.fang@freescale.com>
|
|
Commit:872ee3f9d4c1 introduce build error.
The patch just fix the build error.
Signed-off-by: Gao Pan <b54642@freescale.com>
|
|
Before, checking SDMA_H_C0PTR register to know whether sdma controller turned
off in DSM, if yes restore channel context back. Unfortunatly, this checking
is wrong, because SDMA_H_C0PTR has been initialized as non-zero value in
sdma_resume, which means channel context will never be restored back if mega/
fast off on i.mx6sx or i.mx7d. Using 'suspend_off' flag to keep this 'restore
needed' requirement.
Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit 565d4c45926a03029d7750a57f3e3f2404de7301)
|
|
Enable MSX_DMA for all i.MX6 SOCs.
Signed-off-by: Anson Huang <b20788@freescale.com>
(cherry picked from commit 70e7d05ca89fff0d4c8515cd3933b23082bb2eaf)
|
|
No need to alloc bd for hdmi audio, and the period len of hdmi audio is
0, so add constraint for it.
And correct per_address and per_address2 for hdmi audio.
Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
|
|
After running asrc p2p, then asrc m2m can't work. It is caused by the
sdmac->flags isn't reset after running. then sdma_int_handler go to
wrong branch.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
|
|
fix sdma driver resume back failed if SDMA clock disabled before suspend:
PM: noirq resume of devices complete after 0.802 msecs
imx-sdma 30bd0000.sdma: Timeout waiting for CH0 ready
imx-sdma 30bd0000.sdma: loaded firmware 4.1
imx-sdma 30bd0000.sdma: restore context error!
dpm_run_callback(): sdma_resume+0x0/0x1c8 returns -110
PM: Device 30bd0000.sdma failed to resume early: error -110
Signed-off-by: Robin Gong <b38343@freescale.com>
|
|
Some driver may call dmaengine_terminate_all firstly, and then start next by
calling dmaengine_prep_* without dmaengine_slave_config. In this case sdma
transfer failed since no context loaded, take this case in this patch.
Signed-off-by: Robin Gong <b38343@freescale.com>
|
|
In some high loading case, some BDs done interrupt may not be handled timely
because of high loading, for example:
1).No.1 BD done interrupt pending.
2).No.2 BD done interrupt trigged, and be handled in time.
3).found No.1 and No.2 bds finished, set BD_DONE to prepare for next time.
4).call vchan_cyclic_callback twice to tasklet_schedule(). But unfortunately,
only one tasklet can be scheduled one time. And SDMA interrupt will never be
trigged again for No.2 or No.1 BD. That means one callback loss.
To fix the above case, extend override callback in virt dma framework, so that
sdma driver can do some specific job before every callback:
1).No.1 BD done interrupt pending.
2).No.2 BD done interrupt trigged, and be handled in time.
3).call vchan_cyclic_callback to tasklet_schedule().
4) vchan_complete() call overide_callback
5) found No.1 BD done, set BD_DONE and call desc->vd.tx.callback
6) found No.2 BD done, set BD_DONE and call desc->vd.tx.callback, no callback
missed here.
Signed-off-by: Robin Gong <b38343@freescale.com>
|
|
Because load context code has been removed in prepare DMA transfer everytime.
Need restore them back once mega/fast powered off.
Signed-off-by: Robin Gong <b38343@freescale.com>
|
|
Old sdma can't support multi instances, because next transfer will return
error if the last transfer not done(sdmac->status == DMA_IN_PROGRESS). virt
dma is a common framework for versus dma drivers, and it's support multi
instances, driver can dynamicly alloc description and add it to list which
will be handled in the last sdma transfer done later.
Another advantage of this patch is to clean up the constrain of max bd numer:
--#define NUM_BD (int)(PAGE_SIZE / sizeof(struct sdma_buffer_descriptor))
in other words, now sdma driver can support any length data now.
Meanwhile, remove sdma_load_context() in prep_* everytime, since it can do
only once in config channel.
Signed-off-by: Robin Gong <b38343@freescale.com>
|
|
dmatest is a common dma test module for dma driver which support mem_2_mem copy
.Since SDMA driver has the mem_2_mem interface, make little code change to
support this feature rather than our internal mxc_sdma_memcopy_test test
module.
Signed-off-by: Robin Gong <b38343@freescale.com>
|
|
Currently, the dma engine driver don't support runtime pm,
and it is not necessary to support the feature since it support
slave sg and cyclic mode, and clock enable/disable during dma
chans allocate and release.
The patch remove the runtime pm dummy code.
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: 2c8f8e3e6a21184e6cf8b8e5ba3ec8e76794c951)
|
|
After dma init by calling .mxs_dma_init(), disable dma_io and
dma_bch clocks. When dma chans are requested by devices, clocks
are enabled in .device_alloc_chan_resources(). The patch is to
fix clock enable count mismatch issue.
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: 4868cf5e39a0aeb1ad12c5c1a453d233c0f472ce)
|
|
* iMX7D dma-apbh support add additional clock dependency
* Add clock for mxs-dma support dma_apbh_bch dma_apbh_io
Signed-off-by: Adrian Alonso <aalonso@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: aea75669daac9101592de2cfbadc7aaacbc7d887)
|
|
this patch adds power management support for mxs-dma driver.
Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Allen Xu <b45815@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit 7a59828eeda36457e6e60383705a0bc5831ffbf7)
|
|
There is occasion that dma callback come late after the substream is released.
Then there will be kernel dump.
[<805866b0>] (imx_pcm_dma_complete) from [<802fad9c>] (sdma_handle_channel_loop.isra.25+0x48/0x54)
[<802fad9c>] (sdma_handle_channel_loop.isra.25) from [<802fae48>] (sdma_tasklet+0xa0/0x1d4)
[<802fae48>] (sdma_tasklet) from [<800356e0>] (tasklet_action+0x64/0xf8)
[<800356e0>] (tasklet_action) from [<80034ea0>] (__do_softirq+0x104/0x218)
[<80034ea0>] (__do_softirq) from [<80035220>] (irq_exit+0xa8/0xec)
[<80035220>] (irq_exit) from [<8000ed44>] (handle_IRQ+0x3c/0x90)
[<8000ed44>] (handle_IRQ) from [<80008578>] (gic_handle_irq+0x28/0x5c)
[<80008578>] (gic_handle_irq) from [<80012100>] (__irq_svc+0x40/0x70)
The reason is the sdma tasklet is async with audio substream release. ALSA
think when terminate dma, the dma should be stopped and no callback be called.
This patch is to add new api dma_sync_wait_tasklet(), which is called in
snd_dmaengine_pcm_close(). It will make sure the callback not be called
after this funtion. Tasklet_kill is to wait scheduled tasklet end.
Tasklet_kill can't be added to terminate dma function, because terminate dma
function may be called in interrupt, but tasklet_kill can't be called in
interrupt context.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
(cherry picked from commit 9815881b6acaa72a705e1fa3c26a852fc81bfce5)
|
|
As SSI has dual fifo, add src_dualfifo and dst_dualfifo in imx_dma_data
to support dual fifo in DMA_DEV_TO_DEV.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
(cherry picked from commit cfde1308f170166a0099ca39ee8733895f9626f0)
|
|
Use SET_LATE_SYSTEM_SLEEP_PM_OPS rather than the common sleep pm ops to ensure
sdma has resumed back before all other module drivers which use sdma resume
back.
Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit a7f8725509b494c3073b1bcca63252d5c61bb80d)
|
|
The commit(84bb134229f724f20c0696f3f87631c7a518b47e) move the code about BD
updating from tasklet to ISR to make sdma harder to stop in cyclic in case of
heavy system loading so that tasklet can't be handled in time, since ISR
handled more quickly than tasklet, but it only make things nicer, not totally
fix. The side effect of this patch is chn_real_count may be updated by new BD
interrupt while uart rx dma callback still check the last BD, thus the residue
also be broken and that may cause uart driver get the wrong rx count. This
patch just take them back and align with v3.10 kernel.
Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit 4d26ef3c73b5c32828da7de78832d54ce5106357)
|
|
Enable Mega/Fast support for i.mx7d. Need save and restore SDMA registers.
Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit 4e1ea64c5d360ebc4f8168c1fcdee314b547bd13)
|
|
The SDMA driver not consider the case of event_id0 is 0. That make uart6 rx
not working.
Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit dbcacbcb3a885d7569e9e415035b1dd06c4a117b)
(cherry picked from commit 6dfdbe41a7d6ab7e6fae5d6fb4d73435839beff3)
|
|
Add new chip i.mx7d support,both ROM script and RAM script changed.
Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit 99b19e2f2a5f0450ab30794a3dd170129640c2c1)
(cherry picked from commit 45deef4f3d27f0fcc1fd92781dadfe659ada7f70)
|
|
Current ecspi rom script didn't take care of rxfifo overflow risk. Add new
ecspi tx script to check the rxfifo status, if it is near to full(>=48 bytes),
do not copy data to txfifo which will trigger data push into rxfifo. Because
rx script may not read rxfifo in time, we have to consider it.
Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit 17f472aa698aba0af5da4566df447e23306f4289)
(cherry picked from commit 90c929d7d1a3f8e196641b5ed7a33d2ee03bd63c)
(cherry picked from commit 6d76bdcf2097e4198217edf27363cf6ba2e6542a)
|
|
Caused by cherry-pick 260fe87c1d744d8386057d03013e002352f8b181, current
sdma driver remove 'sdmac->mode'.
Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit 0d45a4e18f469535b890399907e32c26abe4ef1c)
|
|
cherry-pick below patch from v3.14.y:
ENGR00313512 dma: imx-sdma: A bungle of work around for
BUG ON issue
The BUG ON issue could be triggered by such scenarios:
A)
issue_pending(1) ->
<- SDMA irq(1)
<- SDMA tasklet(1) //Normal case
issue_pending(2) ->
terminate_all(2) ->
... system suspend/resume
issue_pending(3) ->
<- SDMA irq(2)
<- SDMA irq(3) //might also happen after tasklet(2)
<- SDMA tasklet(2)
<- SDMA tasklet(3) //BUG ON
B)
issue_pending(1) ->
<- SDMA irq(1)
<- SDMA tasklet(1) //Normal case
issue_pending(2) ->
<- SDMA irq(2) //might also happen after terminate_all(2)
terminate_all(2) ->
... system suspend/resume
issue_pending(3) ->
<- SDMA irq(3) //might also happen after tasklet(2)
<- SDMA tasklet(2)
<- SDMA tasklet(3) //BUG ON
The best fix for this issue is to eradicate irq(2) or tasklet(2).
However, currently we couldn't find an effective fix for both cases above.
Thus this fix could be treated as a work around. It fixes this issue by Reduce
the possiblity of irq(2) and tasklet(3).
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit 1880fc41df51450825c2b17bae5be9536e26b73f)
(cherry picked from commit a744dfb31122b8393e717e8a6911b221d1d49052)
|
|
status
cherry-pick below patch from v3.14.y:
ENGR00319473: dma: imx-sdma: support sdma restore from
mega/fast power down status
Support sdma suspend and resume interface to restore from mega/fast power down.
Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit 682fd1f47ab9cb69382fa0e8d20a830ae99c26fc)
(cherry picked from commit dd17fa18b9a0c11f8bce3b87f792775d96e461c1)
|
|
This patch is just created by so many confilict while cherry-pick
from v3.10 a6a6cf911f85a3a09f763195478d422c571b9565.
Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit c070364148de0331152700850f5cb5577dbb504e)
|
|
cherry-pick below patch from v3.14.y:
ENGR00329948-3: dma: imx-sdma: Add hdmi audio support
in sdma
There's a missing script for hdmi audio support in current sdma driver,
thus add it.
This HDMI script doesn't use bd to copy memory like a normal one does
but only to update the memory address for HDMI internal AHB DMA and
then trigger its procedure automatically.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit dafddac916a03ae4477e2de7c1b7ad291f956f68)
|
|
ENGR00286273-1 dma: imx-sdma: allocate memory from iram
We try to allocate memory from SoC internal SRAM so that we can turn off
voltage of external DDR to save power. Surely, if we failed to get the
iram DT node or allocate memory due to no enough SRAM space, we would
allow SDMA driver to allocate memory in a traditional way.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit f6924fbdb90d1f01266fc018caff953457e04d34)
(cherry picked from commit 7b643e5c9119ac43b937816fd1b785d2b859b05f)
|
|
For UART, we need use old chn_real_count to know the real rx count even in
cylic dma mode, because UART driver use cyclic mode to increase performance
without any data loss.
Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit 398cee2ad110c4f183e553af0564fbdcbe8548cb)
|
|
cherry-pick below patch from v3.14.y:
ENGR00329822-01 dmaengine: imx: fix loop mode issue
Fix loop mode issue that calling dmaengine_tx_status() can get
right state.residue value.
Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit 37e17f10b35c34317def08704e4b4edf5aa23894)
(cherry picked from commit 00cc7021317ac6efb460eb1b9bc3bd8aa6ad73c2)
|
|
cherry-pick below patch from v3.14.y
ENGR00331635-1: dma: imx-sdma: Add imx6sx platform
support
The new Solo X has more requirements for SDMA events. So it creates a event mux
to remap most of event numbers in GPR (General Purpose Register). If we want to
use SDMA support for those module who do not get the even number as default, we
need to configure GPR first.
Thus this patch adds this support of GPR event remapping configuration to the
SDMA driver.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
(cherry picked from commit 82a606e594f2b6e00e94af0c03bdf040d796d560)
|
|
This patch adds DEV_TO_DEV support for i.MX SDMA driver to support data
transfer between two peripheral FIFOs.
The per_2_per script requires two peripheral addresses and two DMA
requests, and it need to check the src addr and dst addr is in the SPBA
bus space or in the AIPS bus space.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
(cherry picked from commit 8391ecf465ec5c8ccef547267df6d40beb8999a4)
|
|
The platform_device_id is not modified by the driver and core uses it as
const.
Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
(cherry picked from commit afe7cded998fff62759c214cda8785cd874b6114)
|
|
Porting pxp dma drivers v2 and v3 to imx_4.1.y branch.
Signed-off-by: Fancy Fang <chen.fang@freescale.com>
|
|
commit 6bea0f6d1c47b07be88dfd93f013ae05fcb3d8bf upstream.
In case we have less than maximum allowed channels (8) and autoconfiguration is
enabled the DWC_PARAMS read is wrong because it uses different arithmetic to
what is needed for channel priority setup.
Re-do the caclulations properly. This now works on AVR32 board well.
Fixes: fed2574b3c9f (dw_dmac: introduce software emulation of LLP transfers)
Cc: yitian.bu@tangramtek.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|