[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <df27a6508e9edcd8b56058ac4834fd56@walle.cc>
Date: Fri, 30 Apr 2021 18:01:49 +0200
From: Michael Walle <michael@...le.cc>
To: Mark Brown <broonie@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J . Wysocki" <rafael@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
Andy Shevchenko <andy.shevchenko@...il.com>
Subject: Re: [PATCH 1/2] regmap: add regmap_might_sleep()
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
Powered by blists - more mailing lists