From patchwork Sun Jan 11 15:52:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 5606431 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AB665C058D for ; Sun, 11 Jan 2015 15:52:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D076A2063D for ; Sun, 11 Jan 2015 15:52:35 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 9E55F2051D for ; Sun, 11 Jan 2015 15:52:34 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id E6BB02603A5; Sun, 11 Jan 2015 16:52:32 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id E85892603A5; Sun, 11 Jan 2015 16:52:24 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 97C9726040D; Sun, 11 Jan 2015 16:52:23 +0100 (CET) Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id A4A14260320 for ; Sun, 11 Jan 2015 16:52:16 +0100 (CET) Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 40E1BAB46; Sun, 11 Jan 2015 15:52:16 +0000 (UTC) Date: Sun, 11 Jan 2015 16:52:16 +0100 Message-ID: From: Takashi Iwai To: Pavel Hofman In-Reply-To: <54B28174.7060008@ivitera.com> References: <54B28174.7060008@ivitera.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.4 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Cc: alsa-devel Subject: Re: [alsa-devel] ESI Juli@ crash with external clock switch - patch X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP At Sun, 11 Jan 2015 14:58:12 +0100, Pavel Hofman wrote: > > Hi, > > I have investigated a crash/kernel thread lockup when Juli@ is switched > to external SPDIF clock and the incoming SPDIF stream changes > samplerate. The problem appears to occur in the timed thread in charge > of reading incoming samplerate and acting upon its change. > > The problem disappears with the following patch: > > diff --git a/sound/i2c/other/ak4114.c b/sound/i2c/other/ak4114.c > index c7f5633..68bb326 100644 > --- a/sound/i2c/other/ak4114.c > +++ b/sound/i2c/other/ak4114.c > @@ -154,7 +154,7 @@ void snd_ak4114_reinit(struct ak4114 *chip) > { > chip->init = 1; > mb(); > - flush_delayed_work(&chip->work); > + //flush_delayed_work(&chip->work); > ak4114_init_regs(chip); > /* bring up statistics / event queing */ > chip->init = 0; > > I am afraid I do not know enough about kernel workqueues to determine > whether this "fix" is OK. > > Interestingly, the almost identical driver ak4113.c for a very similar > card Infrasonic Quartet (ice1724/quartet.c) does not suffer from this > problem (tested now). Does the patch below work instead? The reason it appears only on Juli@ is that juli@ is the only board using this function. thanks, Takashi diff --git a/sound/i2c/other/ak4114.c b/sound/i2c/other/ak4114.c index c7f56339415d..fd7ed9b42e48 100644 --- a/sound/i2c/other/ak4114.c +++ b/sound/i2c/other/ak4114.c @@ -612,10 +612,10 @@ static void ak4114_stats(struct work_struct *work) { struct ak4114 *chip = container_of(work, struct ak4114, work.work); - if (!chip->init) + if (!chip->init) { snd_ak4114_check_rate_and_errors(chip, chip->check_flags); - - schedule_delayed_work(&chip->work, HZ / 10); + schedule_delayed_work(&chip->work, HZ / 10); + } } EXPORT_SYMBOL(snd_ak4114_create);