RE: [PATCH v4 0/7] add virt-dma support for imx-sdma

From: Robin Gong
Date: Thu Jun 14 2018 - 09:12:33 EST


Hi Lucas,
I didn't met your unstable console issue before, anyway, I'll do more test and look into Audio issue.

-----Original Message-----
From: Lucas Stach [mailto:l.stach@xxxxxxxxxxxxxx]
Sent: 2018å6æ14æ 18:22
To: Robin Gong <yibin.gong@xxxxxxx>; s.hauer@xxxxxxxxxxxxxx; vkoul@xxxxxxxxxx; dan.j.williams@xxxxxxxxx; gregkh@xxxxxxxxxxxxxxxxxxx; jslaby@xxxxxxxx
Cc: dmaengine@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; linux-arm-kernel@xxxxxxxxxxxxxxxxxxx; dl-linux-imx <linux-imx@xxxxxxx>; linux-serial@xxxxxxxxxxxxxxx
Subject: Re: [PATCH v4 0/7] add virt-dma support for imx-sdma

Am Donnerstag, den 14.06.2018, 10:09 +0000 schrieb Robin Gong:
> Hi Lucas,
> Could you double check again? Still can reproduce lockdep warning on
> UART if change spin_lock_lockirqsave/spinlock_unlock_irqrestore to
> spin_lock/spin_unlock in sdma_int_handler as you said without
> patch7/7.

Yes, I can reproduce the lockdep issue with _irqsave variants in the IRQ handler and 7/7 reverted. It fixes the pcm issue though.

> Would you please ask below two more questions?
> 1. Does your uart case pass now with my v4 patchset?

It seems to work, but the change seems to impact the non-DMA serial somehow. On several boots the system was unable to present a login prompt, so patch 7/7 seems to break other stuff and it's a pretty invasive change to the serial driver, which is known to be non-trivial.

I don't have the bandwidth to dig through this patch currently, but I wonder if it couldn't be simplified with the spinlock stuff in the sdma driver fixed.

> 2. Do you make some code change in your local('I just gave this series
> a spin')to reproduce your below issue? If yes, could you post your
> change?

The lockdep splat below was without any changes to your series.

Regards,
Lucas

> On å, 2018-06-14 at 10:53 +0200, Lucas Stach wrote:
> > Hi Robin,
> >
> > I just gave this series a spin and it seems there is even more
> > locking fun, see the lockdep output below. After taking a short look
> > it seems this is caused by using the wrong spinlock variants in
> > sdma_int_handler(), those should also use the _irqsave ones. When
> > fixing this you might want to reconsider patch 7/7, as it's probably
> > not needed at all.
> >
> > Regards,
> > Lucas
> >
> > [ÂÂÂ20.479401]
> > ========================================================
> > [ÂÂÂ20.485769] WARNING: possible irq lock inversion dependency
> > detected [ÂÂÂ20.492140] 4.17.0+ #1538 Not tainted [ÂÂÂ20.495814]
> > ----------------------------------------------------
> > --
> > --
> > [ÂÂÂ20.502181] systemd/1 just changed the state of lock:
> > [ÂÂÂ20.507247] c0abdafc (&(&substream->self_group.lock)->rlock){-
> > ...}, at: snd_pcm_stream_lock+0x54/0x60 [ÂÂÂ20.516523] but this lock
> > took another, HARDIRQ-unsafe lock in the
> > past:
> > [ÂÂÂ20.523234]ÂÂ(fs_reclaim){+.+.}
> > [ÂÂÂ20.523253]
> > [ÂÂÂ20.523253]
> > [ÂÂÂ20.523253] and interrupts could create inverse lock ordering
> > between them.
> > [ÂÂÂ20.523253]
> > [ÂÂÂ20.537804]
> > [ÂÂÂ20.537804] other info that might help us debug this:
> > [ÂÂÂ20.544344]ÂÂPossible interrupt unsafe locking scenario:
> > [ÂÂÂ20.544344]
> > [ÂÂÂ20.551144]ÂÂÂÂÂÂÂÂCPU0ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂCPU1 [ÂÂÂ20.555686]ÂÂÂÂÂÂÂÂ
> > ----ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ---- [ÂÂÂ20.560224]ÂÂÂlock(fs_reclaim); [ÂÂÂ
> > 20.563386]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂlocal_irq_disable(); [ÂÂÂ
> > 20.569315]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂlock(&(&substream-
> > > self_group.lock)->rlock);
> >
> > [ÂÂÂ20.577337]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂlock(fs_reclaim); [ÂÂÂ
> > 20.583014]ÂÂÂ<Interrupt> [ÂÂÂ20.585643]ÂÂÂÂÂ
> > lock(&(&substream->self_group.lock)->rlock);
> > [ÂÂÂ20.591322]
> > [ÂÂÂ20.591322]ÂÂ*** DEADLOCK ***
> > [ÂÂÂ20.591322]
> > [ÂÂÂ20.597260] 1 lock held by systemd/1:
> > [ÂÂÂ20.607806]ÂÂ#0: ab23d11c (snd_pcm_link_rwlock){.-..}, at:
> > snd_pcm_stream_lock+0x4c/0x60
> > [ÂÂÂ20.615951]
> > [ÂÂÂ20.615951] the shortest dependencies between 2nd lock and 1st
> > lock:
> > [ÂÂÂ20.623799]ÂÂ-> (fs_reclaim){+.+.} ops: 248474 { [ÂÂÂ20.628456]ÂÂÂÂÂ
> > HARDIRQ-ON-W at:
> > [ÂÂÂ20.631716]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂlock_acquire+0x260/0x29c [ÂÂÂ
> > 20.637223]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂfs_reclaim_acquire+0x48/0x58 [ÂÂÂ
> > 20.643075]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂkmem_cache_alloc_trace+0x3c/0x
> > 36
> > 4
> > [ÂÂÂ20.649366]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂalloc_worker.constprop.15+0x28
> > /0
> > x64
> > [ÂÂÂ20.655824]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂinit_rescuer.part.5+0x20/0xa4 [ÂÂÂ
> > 20.661764]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂworkqueue_init+0x124/0x1f8 [ÂÂÂ
> > 20.667446]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂkernel_init_freeable+0x60/0x55
> > 0
> > [ÂÂÂ20.673561]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂkernel_init+0x18/0x120 [ÂÂÂ
> > 20.678890]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂret_from_fork+0x14/0x20 [ÂÂÂ
> > 20.684299]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ(null) [ÂÂÂ20.688408]ÂÂÂÂÂ
> > SOFTIRQ-ON-W at:
> > [ÂÂÂ20.691659]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂlock_acquire+0x260/0x29c [ÂÂÂ
> > 20.697158]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂfs_reclaim_acquire+0x48/0x58 [ÂÂÂ
> > 20.703006]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂkmem_cache_alloc_trace+0x3c/0x
> > 36
> > 4
> > [ÂÂÂ20.709288]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂalloc_worker.constprop.15+0x28
> > /0
> > x64
> > [ÂÂÂ20.709301]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂinit_rescuer.part.5+0x20/0xa4 [ÂÂÂ
> > 20.720717]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂworkqueue_init+0x124/0x1f8 [ÂÂÂ
> > 20.720729]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂkernel_init_freeable+0x60/0x55
> > 0
> > [ÂÂÂ20.720738]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂkernel_init+0x18/0x120 [ÂÂÂ
> > 20.720746]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂret_from_fork+0x14/0x20 [ÂÂÂ
> > 20.720751]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ(null) [ÂÂÂ20.720756]ÂÂÂÂÂINITIAL
> > USE at:
> > [ÂÂÂ20.720770]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂlock_acquire+0x260/0x29c [ÂÂÂ
> > 20.720782]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂfs_reclaim_acquire+0x48/0x58 [ÂÂÂ
> > 20.774374]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂkmem_cache_alloc_trace+0x3c/0x3
> > 64
> > [ÂÂÂ20.780574]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂalloc_worker.constprop.15+0x28/
> > 0x
> > 64
> > [ÂÂÂ20.786945]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂinit_rescuer.part.5+0x20/0xa4 [ÂÂÂ
> > 20.792794]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂworkqueue_init+0x124/0x1f8 [ÂÂÂ
> > 20.798384]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂkernel_init_freeable+0x60/0x550 [ÂÂÂ
> > 20.804406]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂkernel_init+0x18/0x120 [ÂÂÂ
> > 20.809648]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂret_from_fork+0x14/0x20 [ÂÂÂ
> > 20.814971]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ(null) [ÂÂÂ20.818992]ÂÂÂ} [ÂÂÂ
> > 20.820768]ÂÂÂ... keyÂÂÂÂÂÂat: [<80e22074>]
> > __fs_reclaim_map+0x0/0x10
> > [ÂÂÂ20.827220]ÂÂÂ... acquired at:
> > [ÂÂÂ20.830289]ÂÂÂÂfs_reclaim_acquire+0x48/0x58 [ÂÂÂ20.834487]ÂÂÂÂ
> > kmem_cache_alloc_trace+0x3c/0x364 [ÂÂÂ20.839123]ÂÂÂÂ
> > sdma_transfer_init+0x44/0x130 [ÂÂÂ20.843409]ÂÂÂÂ
> > sdma_prep_dma_cyclic+0x78/0x21c [ÂÂÂ20.847869]ÂÂÂÂ
> > snd_dmaengine_pcm_trigger+0xdc/0x184
> > [ÂÂÂ20.852764]ÂÂÂÂsoc_pcm_trigger+0x164/0x190 [ÂÂÂ20.856876]ÂÂÂÂ
> > snd_pcm_do_start+0x34/0x40 [ÂÂÂ20.860902]ÂÂÂÂ
> > snd_pcm_action_single+0x48/0x74 [ÂÂÂ20.865360]ÂÂÂÂ
> > snd_pcm_action+0x34/0xfc [ÂÂÂ20.869213]ÂÂÂÂ
> > snd_pcm_ioctl+0x910/0x10ec [ÂÂÂ20.873241]ÂÂÂÂvfs_ioctl+0x30/0x44 [ÂÂÂ
> > 20.876657]ÂÂÂÂdo_vfs_ioctl+0xac/0x974 [ÂÂÂ20.880421]ÂÂÂÂ
> > ksys_ioctl+0x48/0x64 [ÂÂÂ20.883923]ÂÂÂÂsys_ioctl+0x18/0x1c [ÂÂÂ
> > 20.887340]ÂÂÂÂret_fast_syscall+0x0/0x28 [ÂÂÂ20.891277]ÂÂÂÂ0x7289bcbc
> > [ÂÂÂ20.893909] [ÂÂÂ20.895410] ->
> > (&(&substream->self_group.lock)->rlock){-...}
> > ops:
> > 59 {
> > [ÂÂÂ20.901977]ÂÂÂÂIN-HARDIRQ-W at:
> > [ÂÂÂ20.905143]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂlock_acquire+0x260/0x29c [ÂÂÂ
> > 20.910473]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ_raw_spin_lock+0x48/0x58 [ÂÂÂ
> > 20.915801]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂsnd_pcm_stream_lock+0x54/0x60 [ÂÂÂ
> > 20.921561]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ_snd_pcm_stream_lock_irqsave+0x4 0/
> > 0x48
> > [ÂÂÂ20.928107]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂsnd_pcm_period_elapsed+0x2c/0xa4
> > [ÂÂÂ20.934127]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂdmaengine_pcm_dma_complete+0x54/
> > 0x
> > 58
> > [ÂÂÂ20.940498]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂsdma_int_handler+0x1dc/0x2a8 [ÂÂÂ
> > 20.946179]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ__handle_irq_event_percpu+0x1fc/ 0x
> > 498
> > [ÂÂÂ20.952635]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂhandle_irq_event_percpu+0x38/0x8
> > c [ÂÂÂ20.958742]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂhandle_irq_event+0x48/0x6c [ÂÂÂ
> > 20.964242]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂhandle_fasteoi_irq+0xc4/0x138 [ÂÂÂ
> > 20.970006]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂgeneric_handle_irq+0x28/0x38 [ÂÂÂ
> > 20.975681]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ__handle_domain_irq+0xb0/0xc4 [ÂÂÂ
> > 20.981443]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂgic_handle_irq+0x68/0xa0 [ÂÂÂ
> > 20.986769]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ__irq_svc+0x70/0xb0 [ÂÂÂ20.991662]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ
> > _raw_spin_unlock_irq+0x38/0x6c [ÂÂÂ20.997511]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ
> > task_work_run+0x90/0xb8 [ÂÂÂ21.002751]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ
> > do_work_pending+0xc8/0xd0 [ÂÂÂ21.008164]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ
> > slow_work_pending+0xc/0x20 [ÂÂÂ21.013661]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ
> > 0x76c77e86 [ÂÂÂ21.017768]ÂÂÂÂINITIAL USE at:
> > [ÂÂÂ21.020844]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂlock_acquire+0x260/0x29c [ÂÂÂ
> > 21.026086]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ_raw_spin_lock+0x48/0x58 [ÂÂÂ
> > 21.031328]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂsnd_pcm_stream_lock+0x54/0x60 [ÂÂÂ
> > 21.037002]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂsnd_pcm_stream_lock_irq+0x38/0x3c [ÂÂÂ
> > 21.043023]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂsnd_pcm_sync_ptr+0x214/0x260 [ÂÂÂ
> > 21.048609]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂsnd_pcm_ioctl+0xbe0/0x10ec [ÂÂÂ
> > 21.054027]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂvfs_ioctl+0x30/0x44 [ÂÂÂ21.058832]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ
> > do_vfs_ioctl+0xac/0x974 [ÂÂÂ21.063984]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ
> > ksys_ioctl+0x48/0x64 [ÂÂÂ21.068875]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ
> > sys_ioctl+0x18/0x1c [ÂÂÂ21.073679]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ
> > ret_fast_syscall+0x0/0x28 [ÂÂÂ21.079004]ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ
> > 0x7e9026dc [ÂÂÂ21.083023]ÂÂ} [ÂÂÂ21.084710]ÂÂ... keyÂÂÂÂÂÂat:
> > [<8162a6e4>] __key.31798+0x0/0x8 [ÂÂÂ21.090552]ÂÂ... acquired at:
> > [ÂÂÂ21.093537]ÂÂÂÂmark_lock+0x3a4/0x69c [ÂÂÂ21.097128]ÂÂÂÂ
> > __lock_acquire+0x420/0x16d4 [ÂÂÂ21.101239]ÂÂÂÂ
> > lock_acquire+0x260/0x29c [ÂÂÂ21.105091]ÂÂÂÂ_raw_spin_lock+0x48/0x58
> > [ÂÂÂ21.108940]ÂÂÂÂsnd_pcm_stream_lock+0x54/0x60 [ÂÂÂ21.113226]ÂÂÂÂ
> > _snd_pcm_stream_lock_irqsave+0x40/0x48
> > [ÂÂÂ21.118296]ÂÂÂÂsnd_pcm_period_elapsed+0x2c/0xa4 [ÂÂÂ21.122841]ÂÂÂÂ
> > dmaengine_pcm_dma_complete+0x54/0x58
> > [ÂÂÂ21.127735]ÂÂÂÂsdma_int_handler+0x1dc/0x2a8 [ÂÂÂ21.131937]ÂÂÂÂ
> > __handle_irq_event_percpu+0x1fc/0x498
> > [ÂÂÂ21.136915]ÂÂÂÂhandle_irq_event_percpu+0x38/0x8c [ÂÂÂ21.141547]ÂÂÂÂ
> > handle_irq_event+0x48/0x6c [ÂÂÂ21.145570]ÂÂÂÂ
> > handle_fasteoi_irq+0xc4/0x138 [ÂÂÂ21.149854]ÂÂÂÂ
> > generic_handle_irq+0x28/0x38 [ÂÂÂ21.154052]ÂÂÂÂ
> > __handle_domain_irq+0xb0/0xc4 [ÂÂÂ21.158335]ÂÂÂÂ
> > gic_handle_irq+0x68/0xa0 [ÂÂÂ21.162184]ÂÂÂÂ__irq_svc+0x70/0xb0 [ÂÂÂ
> > 21.165601]ÂÂÂÂ_raw_spin_unlock_irq+0x38/0x6c [ÂÂÂ21.169973]ÂÂÂÂ
> > task_work_run+0x90/0xb8 [ÂÂÂ21.173735]ÂÂÂÂdo_work_pending+0xc8/0xd0
> > [ÂÂÂ21.177670]ÂÂÂÂslow_work_pending+0xc/0x20 [ÂÂÂ21.181691]ÂÂÂÂ
> > 0x76c77e86 [ÂÂÂ21.184320] [ÂÂÂ21.185821] [ÂÂÂ21.185821] stack
> > backtrace:
> > [ÂÂÂ21.190198] CPU: 0 PID: 1 Comm: systemd Not tainted 4.17.0+
> > #1538
> > [ÂÂÂ21.196303] Hardware name: Freescale i.MX6 Quad/DualLite (Device
> > Tree)
> > [ÂÂÂ21.202841] Backtrace:
> > [ÂÂÂ21.205314] [<8010e318>] (dump_backtrace) from [<8010e604>]
> > (show_stack+0x20/0x24)
> > [ÂÂÂ21.212900]ÂÂr7:80e9f3d0 r6:00000000 r5:60070193 r4:80e9f3d0 [ÂÂÂ
> > 21.218581] [<8010e5e4>] (show_stack) from [<8099b660>]
> > (dump_stack+0xa4/0xd8)
> > [ÂÂÂ21.225825] [<8099b5bc>] (dump_stack) from [<8017b52c>]
> > (print_irq_inversion_bug+0x15c/0x1fc)
> > [ÂÂÂ21.234368]ÂÂr9:814da818 r8:00000001 r7:ee926c00 r6:00000000
> > r5:ee915bb0 r4:814da818
> > [ÂÂÂ21.242133] [<8017b3d0>] (print_irq_inversion_bug) from
> > [<8017b6dc>] (check_usage_forwards+0x110/0x13c)
> > [ÂÂÂ21.251544]ÂÂr9:00000002 r8:80bfd3e2 r7:ee926c00 r6:ee927148
> > r5:80e08488 r4:00000001
> > [ÂÂÂ21.259306] [<8017b5cc>] (check_usage_forwards) from [<8017c2a4>]
> > (mark_lock+0x3a4/0x69c)
> > [ÂÂÂ21.267500]ÂÂr9:ee926c00 r8:80a03cd8 r7:00000101 r6:00000002
> > r5:00000000 r4:ee927148
> > [ÂÂÂ21.275263] [<8017bf00>] (mark_lock) from [<8017cf68>]
> > (__lock_acquire+0x420/0x16d4)
> > [ÂÂÂ21.283023]ÂÂr10:ee927148 r9:ed4620e4 r8:ee926c00 r7:00000000
> > r6:00000001 r5:00000001
> > [ÂÂÂ21.290863]ÂÂr4:00000490
> > [ÂÂÂ21.293416] [<8017cb48>] (__lock_acquire) from [<8017ed58>]
> > (lock_acquire+0x260/0x29c)
> > [ÂÂÂ21.301350]ÂÂr10:00000001 r9:80e084a4 r8:00000000 r7:00000000
> > r6:00000000 r5:ed4620e4
> > [ÂÂÂ21.309189]ÂÂr4:00000000
> > [ÂÂÂ21.311746] [<8017eaf8>] (lock_acquire) from [<809b74f0>]
> > (_raw_spin_lock+0x48/0x58)
> > [ÂÂÂ21.319506]ÂÂr10:ee0a4714 r9:ed457100 r8:ee0a46c8 r7:ee0a4714
> > r6:ee0a4010 r5:807847b0
> > [ÂÂÂ21.327346]ÂÂr4:ed4620d4
> > [ÂÂÂ21.329902] [<809b74a8>] (_raw_spin_lock) from [<807847b0>]
> > (snd_pcm_stream_lock+0x54/0x60)
> > [ÂÂÂ21.338265]ÂÂr5:ed462000 r4:ed462000 [ÂÂÂ21.341863] [<8078475c>]
> > (snd_pcm_stream_lock) from [<80784838>]
> > (_snd_pcm_stream_lock_irqsave+0x40/0x48)
> > [ÂÂÂ21.351440]ÂÂr5:ed462000 r4:60070193 [ÂÂÂ21.355042] [<807847f8>]
> > (_snd_pcm_stream_lock_irqsave) from [<8078b044>]
> > (snd_pcm_period_elapsed+0x2c/0xa4)
> > [ÂÂÂ21.364881]ÂÂr5:ee3ef000 r4:ed462000 [ÂÂÂ21.368478] [<8078b018>]
> > (snd_pcm_period_elapsed) from [<8078d7b4>]
> > (dmaengine_pcm_dma_complete+0x54/0x58)
> > [ÂÂÂ21.378148]ÂÂr7:ee0a4714 r6:ee0a4010 r5:00000007 r4:ee0a46bc [ÂÂÂ
> > 21.383827] [<8078d760>] (dmaengine_pcm_dma_complete) from
> > [<80504c0c>] (sdma_int_handler+0x1dc/0x2a8) [ÂÂÂ21.393157]
> > [<80504a30>] (sdma_int_handler) from [<8018cd28>]
> > (__handle_irq_event_percpu+0x1fc/0x498)
> > [ÂÂÂ21.402393]ÂÂr10:00000000 r9:eeafd400 r8:80e084a4 r7:00000038
> > r6:00000038 r5:80ea3c12
> > [ÂÂÂ21.410233]ÂÂr4:ee2b5d40
> > [ÂÂÂ21.412787] [<8018cb2c>] (__handle_irq_event_percpu) from
> > [<8018cffc>] (handle_irq_event_percpu+0x38/0x8c)
> > [ÂÂÂ21.422457]ÂÂr10:00000000 r9:ee914000 r8:ee81d400 r7:00000038
> > r6:eeafd400 r5:eeafd464
> > [ÂÂÂ21.430296]ÂÂr4:80e08488
> > [ÂÂÂ21.432852] [<8018cfc4>] (handle_irq_event_percpu) from
> > [<8018d098>] (handle_irq_event+0x48/0x6c) [ÂÂÂ21.441736]ÂÂ
> > r6:eeafd464 r5:eeafd464 r4:eeafd400 [ÂÂÂ21.446374] [<8018d050>]
> > (handle_irq_event) from [<8019146c>]
> > (handle_fasteoi_irq+0xc4/0x138)
> > [ÂÂÂ21.454912]ÂÂr7:00000038 r6:eeafd464 r5:80e10a60 r4:eeafd400 [ÂÂÂ
> > 21.460589] [<801913a8>] (handle_fasteoi_irq) from [<8018bd9c>]
> > (generic_handle_irq+0x28/0x38)
> > [ÂÂÂ21.469214]ÂÂr7:00000038 r6:80d92ae4 r5:00000000 r4:00000000 [ÂÂÂ
> > 21.474893] [<8018bd74>] (generic_handle_irq) from [<8018c48c>]
> > (__handle_domain_irq+0xb0/0xc4)
> > [ÂÂÂ21.483611] [<8018c3dc>] (__handle_domain_irq) from [<80102330>]
> > (gic_handle_irq+0x68/0xa0)
> > [ÂÂÂ21.491978]ÂÂr9:ee914000 r8:f4001100 r7:80e5c6bc r6:ee915f00
> > r5:80e08c3c r4:f4000100 [ÂÂÂ21.499738] [<801022c8>] (gic_handle_irq)
> > from [<801019f0>]
> > (__irq_svc+0x70/0xb0)
> > [ÂÂÂ21.507233] Exception stack(0xee915f00 to 0xee915f48) [ÂÂÂ
> > 21.512303] 5f00: 00000001 00000004 00000000 ee926c00 ee9270a8
> > ee926c00 ecc45e00 ee9270a8
> > [ÂÂÂ21.520498] 5f20: 80ec23b0 ee914000 00000000 ee915f64 ee915f20
> > ee915f50 8017c7c0 809b78ac
> > [ÂÂÂ21.528687] 5f40: 20070013 ffffffff [ÂÂÂ21.532193]ÂÂr9:ee914000
> > r8:80ec23b0 r7:ee915f34 r6:ffffffff
> > r5:20070013 r4:809b78ac
> > [ÂÂÂ21.539959] [<809b7874>] (_raw_spin_unlock_irq) from [<8014e98c>]
> > (task_work_run+0x90/0xb8)
> > [ÂÂÂ21.548321]ÂÂr5:ee926c00 r4:ecc45e00 [ÂÂÂ21.551913] [<8014e8fc>]
> > (task_work_run) from [<8010da3c>]
> > (do_work_pending+0xc8/0xd0)
> > [ÂÂÂ21.559848]ÂÂr9:ee914000 r8:801011c4 r7:ee915fb0 r6:ffffe000
> > r5:00000004 r4:801011c4
> > [ÂÂÂ21.567608] [<8010d974>] (do_work_pending) from [<80101034>]
> > (slow_work_pending+0xc/0x20)
> > [ÂÂÂ21.575797] Exception stack(0xee915fb0 to 0xee915ff8) [ÂÂÂ
> > 21.580864] 5fa0:ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ00000000
> > 020c34e8 46059f00 00000000
> > [ÂÂÂ21.589059] 5fc0: 00000002 76f133a4 020df680 00000006 76e6e168
> > 00000035 7ef81778 00000035
> > [ÂÂÂ21.597253] 5fe0: 00000006 7ef816a0 76c75d67 76c77e86 20070030
> > 00000039
> > [ÂÂÂ21.603883]ÂÂr7:00000006 r6:020df680 r5:76f133a4 r4:00000002
> >
> > Am Donnerstag, den 14.06.2018, 22:02 +0800 schrieb Robin Gong:
> > >
> > > The legacy sdma driver has below limitations or drawbacks:
> > > Â 1. Hardcode the max BDs number as "PAGE_SIZE / sizeof(*)", and
> > > alloc
> > > ÂÂÂÂÂone page size for one channel regardless of only few BDs
> > > needed
> > > ÂÂÂÂÂmost time. But in few cases, the max PAGE_SIZE maybe not
> > > enough.
> > > Â 2. One SDMA channel can't stop immediatley once channel disabled
> > > which
> > > ÂÂÂÂÂmeans SDMA interrupt may come in after this channel
> > > terminated.There
> > > ÂÂÂÂÂare some patches for this corner case such as commit
> > > "2746e2c389f9",
> > > ÂÂÂÂÂbut not cover non-cyclic.
> > >
> > > The common virt-dma overcomes the above limitations. It can alloc
> > > bd dynamically and free bd once this tx transfer done. No memory
> > > wasted or maximum limititation here, only depends on how many
> > > memory can be requested from kernel. For No.2, such issue can be
> > > workaround by checking if there is available
> > > descript("sdmac->desc") now once the unwanted interrupt coming. At
> > > last the common virt-dma is easier for sdma driver maintain.
> > >
> > > Change from v3:
> > > Â 1. add two uart patches which impacted by this patchset.
> > > Â 2. unlock 'vc.lock' before cyclic dma callback and lock again
> > > after
> > > ÂÂÂÂÂit because some driver such as uart will call
> > > dmaengine_tx_status
> > > ÂÂÂÂÂwhich will acquire 'vc.lock' again and dead lock comes out.
> > > Â 3. remove 'Revert commit' stuff since that patch is not wrong
> > > and
> > > ÂÂÂÂÂcombine two patch into one patch as Sascha's comment.
> > >
> > > Change from v2:
> > > Â 1. include Sascha's patch to make the main patch easier to
> > > review.
> > > ÂÂÂÂÂThanks Sacha.
> > > Â 2. remove useless 'desc'/'chan' in struct sdma_channe.
> > >
> > > Change from v1:
> > > Â 1. split v1 patch into 5 patches.
> > > Â 2. remove some unnecessary condition check.
> > > Â 3. remove unnecessary 'pending' list.
> > >
> > > Robin Gong (6):
> > > Â tty: serial: imx: correct dma cookie status
> > > Â dmaengine: imx-sdma: add virt-dma support
> > > Â dmaengine: imx-sdma: remove useless 'lock' and 'enabled' in
> > > 'struct
> > > ÂÂÂÂsdma_channel'
> > > Â dmaengine: imx-sdma: remove the maximum limitation for bd
> > > numbers
> > > Â dmaengine: imx-sdma: add sdma_transfer_init to decrease code
> > > overlap
> > > Â tty: serial: imx: split all dma setup operations out of
> > > 'port.lock'
> > > ÂÂÂÂprotector
> > >
> > > Sascha Hauer (1):
> > > Â dmaengine: imx-sdma: factor out a struct sdma_desc from struct
> > > ÂÂÂÂsdma_channel
> > >
> > > Âdrivers/dma/KconfigÂÂÂÂÂÂ|ÂÂÂ1 +
> > > Âdrivers/dma/imx-sdma.cÂÂÂ| 394 +++++++++++++++++++++++++++------
> > > --------------
> > > Âdrivers/tty/serial/imx.c |ÂÂ99 ++++++------
> > > Â3 files changed, 282 insertions(+), 212 deletions(-)