public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
From: Nicolin Chen <nicoleotsuka@gmail.com>
To: Zidan Wang <zidan.wang@freescale.com>
Cc: alsa-devel@alsa-project.org, timur@tabi.org, lgirdwood@gmail.com,
	tiwai@suse.com, broonie@kernel.org
Subject: Re: [PATCH] ASoC: fsl_sai: fix no frame clk in master mode
Date: Fri, 23 Oct 2015 00:48:19 -0700	[thread overview]
Message-ID: <20151023074816.GA9024@Asurada-CZ80> (raw)
In-Reply-To: <20150821084018.GA11926@shlinux2>

Hi,
	Sorry for late reply.

On Fri, Aug 21, 2015 at 04:40:20PM +0800, Zidan Wang wrote:
> > > > > > > After several open/close sai test with ctrl+c, there will be I/O error.
> > > > > > > The SAI can't work anymore, can't recover. There will be no frame clock.
> > > > > > > With adding the software reset in trigger stop, the issue can be fixed.
> > 
> > > > > > It doesn't look like a decent fix to me. Is it the only fix that
> > > > > > IC team suggests? And why put this reset in the trigger function.
> > > > > > Your MEGA fast patch has already included a software reset in the
> > > > > > PM runtime functions. When dealing with CTRL+C test cases, that
> > > > > > software reset should have worked as well.
> > 
> > > > > The MEGA fast patch add the suspend/resume function, but CTRL+C will not
> > > > > trigger suspend/resume function.
> > > > > When CTRL+C, it will trigger stop and software reset SAI.
> > > > > IC team suggest us to rest it, but I don't know if it's the only fix.
> > 
> > > > You can try to add SET_RUNTIME_PM_OPS() and to see if the suspend
> > > > function is called right after pressing ctrl+c.
> > 
> > > The runtime suspend function will be call after the power down time. So if i
> > > playback again before the power down time, runtime suspend will not be called.
> > 
> > I see.. Can you provide me a test case to reproduce this issue?
> 
> 1. aplay -Dhw:0 /unit_tests/audio8k16S.wav
> 2. ctrl+c
> 
> Set SAI to master mode, then try it several times.

I've reproduced the issue and tried a few fixes but it turns out
putting a reset procedure in the trigger is seemly the only fix.
(Even using pm_runtime without power down delay does not cover
 all the test cases.)

So I suggest you first to double confirm with the IC team if the
problem is caused by defect of the internal bit clock generator
and reseting is the only option. After that, I'll accept the fix.

However, you may also need to refine your commit log and comments
in the driver for the following points:

1) This is a hardware bug/errata and reset is the only option.
2) According to the reference manual, the software reset doesn't
   reset any control register but only internal hardware logics
   such as bit clock generator, status flags, and FIFO pointers.
   (Our purpose is just to reset the clock generator while the
    software reset is the only way to do that.)
3) Since slave mode doesn't use the clock generator, only apply
   the reset procedure to the master mode.

Additionally, we may also need to take care of asynchronous mode
later as TX clock generator will not be reset when RX is still
running.

Nicolin

      reply	other threads:[~2015-10-23  7:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-12  2:25 [PATCH] ASoC: fsl_sai: fix no frame clk in master mode Zidan Wang
2015-08-12  3:53 ` Nicolin Chen
2015-08-12  7:59   ` Zidan Wang
2015-08-12  9:19     ` Nicolin Chen
2015-08-18  2:01       ` Zidan Wang
2015-08-21  7:47         ` Nicolin Chen
2015-08-21  8:40           ` Zidan Wang
2015-10-23  7:48             ` Nicolin Chen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151023074816.GA9024@Asurada-CZ80 \
    --to=nicoleotsuka@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=timur@tabi.org \
    --cc=tiwai@suse.com \
    --cc=zidan.wang@freescale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox