diff mbox

ESI Juli@ crash with external clock switch - patch

Message ID s5hwq4t2u33.wl-tiwai@suse.de (mailing list archive)
State New, archived
Headers show

Commit Message

Takashi Iwai Jan. 11, 2015, 3:52 p.m. UTC
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 mbox

Patch

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);