alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: "Maciej S. Szmigiero" <mail@maciej.szmigiero.name>
Cc: alsa-devel@alsa-project.org, Xiubo Li <Xiubo.Lee@gmail.com>,
	Timur Tabi <timur@tabi.org>, Liam Girdwood <lgirdwood@gmail.com>,
	Nicolin Chen <nicoleotsuka@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Fabio Estevam <fabio.estevam@nxp.com>
Subject: Re: [PATCH 4/5] ASoC: fsl_ssi: use flat regmap cache
Date: Wed, 21 Sep 2016 21:32:14 +0200	[thread overview]
Message-ID: <b54cd59a-97d0-e02d-16be-7aa6752bbb35@denx.de> (raw)
In-Reply-To: <57E2B53C.6080708@maciej.szmigiero.name>

On 09/21/2016 06:28 PM, Maciej S. Szmigiero wrote:
> Hi Marek,

Hi!

> On 19.09.2016 21:30, Marek Vasut wrote:
>> Same as commit ce492b3b8f99cf9d2f807ec22d8805c996a09503
>> Subject: drm/fsl-dcu: use flat regmap cache
>>
>> Using flat regmap cache instead of RB-tree to avoid the following
>> lockdep warning on driver load:
>> WARNING: CPU: 0 PID: 1 at kernel/locking/lockdep.c:2871 lockdep_trace_alloc+0x104/0x128
>> DEBUG_LOCKS_WARN_ON(irqs_disabled_flags(flags))
>>
>> The RB-tree regmap cache needs to allocate new space on first
>> writes.
> 
> That's why SSI driver had .num_reg_defaults_raw set in regmap config.
> With this set and .reg_defaults_raw unset regcache_hw_init() will read
> existing register content which then will be used to populate cache
> (and so allocate RB tree nodes) at regcache initialization time.

OK

> This means that allocation of new cache RB tree nodes should never happen
> during actual write.
> If you get a warning that it happened then maybe there is a write to
> some register not covered by .num_reg_defaults_raw - this should be
> fixed.

I might be blind, but I really don't see that. I just discussed it with
Mark and he thinks the same. I will revisit this one more time.

> The problem with flat cache is that it is zero-initialized, that is,
> all registers are assumed to contain zeros by default.
> This is generally not true in case of SSI so reads from and bit updates
> in non-volatile registers will corrupt their value.

This will let the driver init the hardware into a well-defined state.
Are there any bits in the SSI config registers which we must preserve?

> You can also refer to discussion when .num_reg_defaults_raw was first
> added here:
> http://www.gossamer-threads.com/lists/linux/kernel/2330573

Thanks!

> Maciej
> 


-- 
Best regards,
Marek Vasut

  reply	other threads:[~2016-09-21 19:32 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-19 19:30 [PATCH 1/5] ASoC: fsl_asrc: use flat regmap cache Marek Vasut
2016-09-19 19:30 ` [PATCH 2/5] ASoC: fsl_esai: " Marek Vasut
2016-09-21 12:56   ` Applied "ASoC: fsl_esai: use flat regmap cache" to the asoc tree Mark Brown
2016-09-19 19:30 ` [PATCH 3/5] ASoC: fsl_spdif: use flat regmap cache Marek Vasut
2016-09-21 12:56   ` Applied "ASoC: fsl_spdif: use flat regmap cache" to the asoc tree Mark Brown
2016-09-19 19:30 ` [PATCH 4/5] ASoC: fsl_ssi: use flat regmap cache Marek Vasut
2016-09-21 12:55   ` Applied "ASoC: fsl_ssi: use flat regmap cache" to the asoc tree Mark Brown
2016-09-21 16:28   ` [PATCH 4/5] ASoC: fsl_ssi: use flat regmap cache Maciej S. Szmigiero
2016-09-21 19:32     ` Marek Vasut [this message]
2016-09-21 22:18       ` Maciej S. Szmigiero
2016-09-21 22:45         ` Marek Vasut
2016-09-21 23:33           ` Maciej S. Szmigiero
2016-09-22 10:45             ` Mark Brown
2016-09-22 14:37               ` Maciej S. Szmigiero
2016-09-22 15:27                 ` Marek Vasut
2016-09-22 23:38                   ` Maciej S. Szmigiero
2016-09-26 19:13                   ` Mark Brown
2016-09-26 19:25                     ` Marek Vasut
2016-09-26 21:03                       ` Mark Brown
2016-09-27 23:23                       ` Maciej S. Szmigiero
2016-09-27 23:29                         ` Marek Vasut
2016-09-28  0:04                           ` Maciej S. Szmigiero
2016-09-28 19:09                             ` Marek Vasut
2016-09-22 15:23             ` Marek Vasut
2016-09-19 19:30 ` [PATCH 5/5] ASoC: fsl_ssi: Remove .num_reg_defaults_raw from regmap_config Marek Vasut
2016-09-20 17:56   ` Mark Brown
2016-09-20 18:23     ` Marek Vasut
2016-09-21 12:55   ` Applied "ASoC: fsl_ssi: Remove .num_reg_defaults_raw from regmap_config" to the asoc tree Mark Brown
2016-09-20  6:50 ` [PATCH 1/5] ASoC: fsl_asrc: use flat regmap cache Nicolin Chen
2016-09-20 18:07 ` Fabio Estevam
2016-09-21 12:56 ` Applied "ASoC: fsl_asrc: use flat regmap cache" to the asoc tree Mark Brown

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=b54cd59a-97d0-e02d-16be-7aa6752bbb35@denx.de \
    --to=marex@denx.de \
    --cc=Xiubo.Lee@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=fabio.estevam@nxp.com \
    --cc=lgirdwood@gmail.com \
    --cc=mail@maciej.szmigiero.name \
    --cc=nicoleotsuka@gmail.com \
    --cc=timur@tabi.org \
    /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;
as well as URLs for NNTP newsgroup(s).