From: "Maciej S. Szmigiero" <mail@maciej.szmigiero.name>
To: Timur Tabi <timur@tabi.org>,
"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Cc: Nicolin Chen <nicoleotsuka@gmail.com>,
Xiubo Li <Xiubo.Lee@gmail.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Fabio Estevam <festevam@gmail.com>,
Zidan Wang <zidan.wang@freescale.com>
Subject: Re: [PATCH 1/3] ASoC: fsl_ssi: mark SACNT register volatile
Date: Mon, 11 Jan 2016 16:52:18 +0100 [thread overview]
Message-ID: <5693CFB2.3090301@maciej.szmigiero.name> (raw)
In-Reply-To: <5692CE43.20708@tabi.org>
Hi Timur,
Thanks for review.
On 10.01.2016 22:33, Timur Tabi wrote:
> Maciej S. Szmigiero wrote:
>> + regmap_write(regs, CCSR_SSI_SACNT,
>> + ssi_private->regcache_sacnt);
>
> So I'm not familiar with all of the regcache features, but I understand this patch.
> I was wondering if it makes sense to write the same exact value that was read previously.
> Isn't it possible for the WR or RD bits to change between fsl_ssi_suspend() and fsl_ssi_resume()?
These bits are only set in fsl_ssi_ac97_{read,write} which then wait 100usecs
before returning. This should be enough for SSI core to finish the relevant
operation and clear the bits again, so theoretically they shouldn't be set
outside these functions.
However, if AC'97 register access is done concurrently with suspend or resume
the read / written reg data might be corrupted.
It looks to me this is indeed possible since SSI PM callbacks are set in its
platform driver struct but ASoC core only calls PM callbacks in snd_soc_dai_driver
(which SSI driver don't set).
If I am correct with this reasoning then these callbacks need to be added to
snd_soc_dai_driver but platform driver ones should still be provided in case
the driver is loaded but the sound card is not yet registered.
I've CCed Zidan since he originally added PM support to this driver.
> That is, should we be doing this instead?
>
> u32 temp;
> regmap_read(regs, CCSR_SSI_SACNT, &temp);
> temp &= 0x18; // preserve WR and RD
> regmap_write(regs, CCSR_SSI_SACNT, (ssi_private->regcache_sacnt & ~0x18) | temp);
>
Maciej
prev parent reply other threads:[~2016-01-11 15:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-20 20:30 [PATCH 1/3] ASoC: fsl_ssi: mark SACNT register volatile Maciej S. Szmigiero
2015-12-23 13:12 ` Fabio Estevam
2015-12-24 16:12 ` [alsa-devel] " Timur Tabi
2016-01-05 14:57 ` Fabio Estevam
2016-01-10 21:33 ` Timur Tabi
2016-01-11 15:52 ` Maciej S. Szmigiero [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=5693CFB2.3090301@maciej.szmigiero.name \
--to=mail@maciej.szmigiero.name \
--cc=Xiubo.Lee@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=festevam@gmail.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=nicoleotsuka@gmail.com \
--cc=timur@tabi.org \
--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