From: Alexander Stein <alexander.stein@ew.tq-group.com>
To: Mark Brown <broonie@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J . Wysocki" <rafael@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] regmap: cache: Do not panic for REGCACHE_NONE regmap
Date: Fri, 10 Mar 2023 14:35:13 +0100 [thread overview]
Message-ID: <2399331.NgBsaNRSFp@steina-w> (raw)
In-Reply-To: <ZAsqVf8/C3lHOF8W@sirena.org.uk>
Hi Mark,
Am Freitag, 10. März 2023, 14:02:13 CET schrieb Mark Brown:
> * PGP Signed by an unknown key
>
> On Fri, Mar 10, 2023 at 08:39:10AM +0100, Alexander Stein wrote:
> > Most regcache operations do check for REGCACHE_NONE, before ensuring
> > doing BUG_ON(!map->cache_ops). The missing regcache_sync* functions
> > panic on REGCACHE_NONE regmaps instead. Add an early return for non-cached
> > ones.
>
> Why would we be trying to do a regcache_sync() on a device with
> no cache?
Indeed, that makes no sense. That's indicating a bug in a driver, but why do
we need to panic the kernel in this case?
On the other hand the same question applies to other regcache related
functions currently checking for non-cached maps. There is no common
behaviour:
panic:
* regcache_sync
* regcache_sync_region
returning -EINVAL:
* regcache_drop_region
returning -ENOSYS:
* regcache_read
returning success (0):
* regcache_write
early return (void return value):
* regcache_exit
Given all these possibilities I have no idea what's the right thing to do.
Best regards,
Alexander
--
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/
next prev parent reply other threads:[~2023-03-10 13:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-10 7:39 [PATCH 1/2] regmap: cache: Do not panic for REGCACHE_NONE regmap Alexander Stein
2023-03-10 7:39 ` [PATCH 2/2] regmap: cache: Fix return value Alexander Stein
2023-03-10 13:02 ` [PATCH 1/2] regmap: cache: Do not panic for REGCACHE_NONE regmap Mark Brown
2023-03-10 13:35 ` Alexander Stein [this message]
2023-03-10 14:21 ` 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=2399331.NgBsaNRSFp@steina-w \
--to=alexander.stein@ew.tq-group.com \
--cc=broonie@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.