Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752325AbdDNSEY (ORCPT ); Fri, 14 Apr 2017 14:04:24 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:34962 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751445AbdDNSEX (ORCPT ); Fri, 14 Apr 2017 14:04:23 -0400 Date: Fri, 14 Apr 2017 20:04:19 +0200 From: Krzysztof Kozlowski To: Alexander Kochetkov Cc: Dan Williams , Vinod Koul , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, hhb@rock-chips.com, shawn.lin@rock-chips.com, caesar.wang@rock-chips.com, sugar.zhang@rock-chips.com, ulysses.huang@rock-chips.com Subject: Re: [PATCH 1/2] dmaengine: pl330: make cyclic transfer free runnable Message-ID: <20170414180419.2xhjjokxessd7n3q@kozik-lap> References: <1492180531-1780-1-git-send-email-al.kochet@gmail.com> <1492180531-1780-2-git-send-email-al.kochet@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1492180531-1780-2-git-send-email-al.kochet@gmail.com> User-Agent: Mutt/1.6.2-neo (2016-08-21) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2134 Lines: 45 On Fri, Apr 14, 2017 at 05:35:29PM +0300, Alexander Kochetkov wrote: > The patch solve the I2S click problem on rk3188. Actually > all the devices using pl330 should have I2S click problem > due to pl330 cyclic transfer implementation. > > Current implementation depends on soft irq. If pl330 unable > to submit next transfer in time some samples could be lost. > The lost samples heard as sound click. In order to check > lost samples, I've installed I2S interrupt handler to signal > overflow/underflow conditions. Sometimes I saw overflow > or underflow events and heard clicks. > > The patch setup cyclic transfer such a way, that transfer can > run infinitely without CPU intervention. As a result, > lost samples and clicks gone. > > Signed-off-by: Alexander Kochetkov > --- > drivers/dma/pl330.c | 192 +++++++++++++++++++++++++-------------------------- > 1 file changed, 94 insertions(+), 98 deletions(-) > I didn't look at the code but testing fails. HW: Odroid U3 (Exynos4412), pl330 used for dma for i2s, max98090 audio codec SW: 4.11.0-rc6-next-20170413 Only first aplay workes fine. After it, the next sound stalls: [ 170.059271] INFO: rcu_preempt detected stalls on CPUs/tasks: [ 170.059441] 1-...: (1 GPs behind) idle=11e/140000000000000/0 softirq=2335/2335 fqs=1049 [ 170.067474] (detected by 3, t=2102 jiffies, g=459, c=458, q=194) [ 170.073555] Sending NMI from CPU 3 to CPUs 1: [ 180.083093] rcu_preempt kthread starved for 999 jiffies! g459 c458 f0x0 RCU_GP_DOING_FQS(4) ->state=0x0 [ 180.086848] rcu_preempt S 0 8 2 0x00000000 [ 180.092344] [] (__schedule) from [] (schedule+0x4c/0xac) [ 180.099353] [] (schedule) from [] (schedule_timeout+0x14c/0x23c) [ 180.107081] [] (schedule_timeout) from [] (rcu_gp_kthread+0x5dc/0x94c) [ 180.115330] [] (rcu_gp_kthread) from [] (kthread+0x124/0x154) [ 180.122793] [] (kthread) from [] (ret_from_fork+0x14/0x3c) Let me know if you need more data. I wonder why you haven't experience this? Best regards, Krzysztof