From: Michael Walle <michael@walle.cc>
To: Mark Brown <broonie@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J . Wysocki" <rafael@kernel.org>,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <bgolaszewski@baylibre.com>,
Andy Shevchenko <andy.shevchenko@gmail.com>
Subject: Re: [PATCH 1/2] regmap: add regmap_might_sleep()
Date: Fri, 30 Apr 2021 18:01:49 +0200 [thread overview]
Message-ID: <df27a6508e9edcd8b56058ac4834fd56@walle.cc> (raw)
In-Reply-To: <20210430151908.GC5981@sirena.org.uk>
Am 2021-04-30 17:19, schrieb Mark Brown:
> On Fri, Apr 30, 2021 at 03:06:44PM +0200, Michael Walle wrote:
>
>> Sometimes a driver needs to know if the underlying regmap could sleep.
>> For example, consider the gpio-regmap driver which needs to fill the
>> gpiochip->can_sleep property.
>
> Whatever is creating the regmap really ought to know what device it's
> dealing with...
But creating and using the regmap are two seperate things, no? Consider
the gpio-sl28cpld. It will just use whatever regmap the parent has
created.
How would it know what type of regmap it is?
>> It might be possible to pass this information via the
>> gpio_regmap_config, but this has the following drawbacks. First, that
>> property is redundant and both places might contratict each other. And
>> secondly, the driver might not even know the type of the regmap
>> because
>> it just gets an opaque pointer by querying the device tree.
>
> If it's a generic GPIO driver from a code correctness point of view
> it's
> always got a risk of sleeping...
I can't follow you here.
-michael
next prev parent reply other threads:[~2021-04-30 16:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-30 13:06 [PATCH 1/2] regmap: add regmap_might_sleep() Michael Walle
2021-04-30 13:06 ` [PATCH 2/2] gpio: regmap: use new regmap_might_sleep() Michael Walle
2021-04-30 15:19 ` [PATCH 1/2] regmap: add regmap_might_sleep() Mark Brown
2021-04-30 16:01 ` Michael Walle [this message]
2021-04-30 17:26 ` Mark Brown
2021-04-30 22:10 ` Michael Walle
2021-05-06 12:43 ` Mark Brown
2021-05-06 13:35 ` Michael Walle
2021-05-06 15:53 ` Mark Brown
-- strict thread matches above, loose matches on Subject: below --
2022-11-21 15:08 Michael Walle
2022-11-22 19:43 ` 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=df27a6508e9edcd8b56058ac4834fd56@walle.cc \
--to=michael@walle.cc \
--cc=andy.shevchenko@gmail.com \
--cc=bgolaszewski@baylibre.com \
--cc=broonie@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox