From: Dmitry Osipenko <digetx@gmail.com>
To: Mark Brown <broonie@kernel.org>, Sebastian Reichel <sre@kernel.org>
Cc: linux-pm@vger.kernel.org
Subject: Re: [PATCH] power: supply: Use an rbtree rather than flat register cache
Date: Thu, 24 Feb 2022 14:07:58 +0300 [thread overview]
Message-ID: <951baa84-1613-7567-4426-ffc6412994da@gmail.com> (raw)
In-Reply-To: <20220222214331.1557723-1-broonie@kernel.org>
23.02.2022 00:43, Mark Brown пишет:
> The smb347 has a very sparse register map (the maximum register is 0x3f but
> less than 10% of the possible registers appear to be defined) and doesn't
> have any hardware defaults specified so the sparser data structure of an
> rbtree is a better fit for it's needs than a flat cache. Since it uses I2C
> for the control interface there is no performance concern with the slightly
> more involved code so let's convert it.
>
> This will mean we avoid any issues created by assuming that any previously
> unaccessed registers hold a value that doesn't match what's in the hardware
> (eg, an _update_bits() suppressing a write).
>
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
> drivers/power/supply/smb347-charger.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/power/supply/smb347-charger.c b/drivers/power/supply/smb347-charger.c
> index d56e469043bb..1511f71f937c 100644
> --- a/drivers/power/supply/smb347-charger.c
> +++ b/drivers/power/supply/smb347-charger.c
> @@ -1488,8 +1488,7 @@ static const struct regmap_config smb347_regmap = {
> .max_register = SMB347_MAX_REGISTER,
> .volatile_reg = smb347_volatile_reg,
> .readable_reg = smb347_readable_reg,
> - .cache_type = REGCACHE_FLAT,
> - .num_reg_defaults_raw = SMB347_MAX_REGISTER,
> + .cache_type = REGCACHE_RBTREE,
Why you removed the num_reg_defaults_raw? It was needed in order to
populate the default values on the regcache init, is it somehow
different for the REGCACHE_RBTREE? Otherwise this patch is incorrect.
next prev parent reply other threads:[~2022-02-24 11:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-22 21:43 [PATCH] power: supply: Use an rbtree rather than flat register cache Mark Brown
2022-02-24 10:54 ` Sebastian Reichel
2022-02-24 11:07 ` Dmitry Osipenko [this message]
2022-02-24 11:35 ` Dmitry Osipenko
2022-02-24 12:08 ` Mark Brown
2022-02-24 14:10 ` Dmitry Osipenko
2022-02-24 11:45 ` Mark Brown
2022-02-24 14:58 ` Dmitry Osipenko
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=951baa84-1613-7567-4426-ffc6412994da@gmail.com \
--to=digetx@gmail.com \
--cc=broonie@kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=sre@kernel.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