All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Sean Young <sean@mess.org>
Cc: "Daniel Thompson" <daniel.thompson@linaro.org>,
	"Hans de Goede" <hdegoede@redhat.com>,
	linux-media@vger.kernel.org, linux-pwm@vger.kernel.org,
	"Ivaylo Dimitrov" <ivo.g.dimitrov.75@gmail.com>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Jani Nikula" <jani.nikula@linux.intel.com>,
	"Joonas Lahtinen" <joonas.lahtinen@linux.intel.com>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"Tvrtko Ursulin" <tvrtko.ursulin@linux.intel.com>,
	"David Airlie" <airlied@gmail.com>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Javier Martinez Canillas" <javierm@redhat.com>,
	"Jean Delvare" <jdelvare@suse.com>,
	"Guenter Roeck" <linux@roeck-us.net>,
	"Support Opensource" <support.opensource@diasemi.com>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	"Pavel Machek" <pavel@ucw.cz>, "Lee Jones" <lee@kernel.org>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Mark Gross" <markgross@kernel.org>,
	"Liam Girdwood" <lgirdwood@gmail.com>,
	"Mark Brown" <broonie@kernel.org>,
	"Jingoo Han" <jingoohan1@gmail.com>,
	"Helge Deller" <deller@gmx.de>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-hwmon@vger.kernel.org, linux-input@vger.kernel.org,
	linux-leds@vger.kernel.org, platform-driver-x86@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-fbdev@vger.kernel.org
Subject: Re: [PATCH v3 1/3] pwm: make it possible to apply pwm changes in atomic context
Date: Wed, 25 Oct 2023 12:47:43 +0200	[thread overview]
Message-ID: <20231025104743.56elaloj3jmojz2v@pengutronix.de> (raw)
In-Reply-To: <ZTjll7oTNVWqygbD@gofer.mess.org>

[-- Attachment #1: Type: text/plain, Size: 3932 bytes --]

Hello,

On Wed, Oct 25, 2023 at 10:53:27AM +0100, Sean Young wrote:
> On Mon, Oct 23, 2023 at 02:34:17PM +0100, Daniel Thompson wrote:
> > On Sun, Oct 22, 2023 at 11:46:22AM +0100, Sean Young wrote:
> > > On Sat, Oct 21, 2023 at 11:08:22AM +0200, Hans de Goede wrote:
> > > > On 10/19/23 12:51, Uwe Kleine-König wrote:
> > > > > On Wed, Oct 18, 2023 at 03:57:48PM +0200, Hans de Goede wrote:
> > > > >> On 10/17/23 11:17, Sean Young wrote:
> > > > > I think it's very subjective if you consider this
> > > > > churn or not.
> > > >
> > > > I consider it churn because I don't think adding a postfix
> > > > for what is the default/expected behavior is a good idea
> > > > (with GPIOs not sleeping is the expected behavior).
> > > >
> > > > I agree that this is very subjective and very much goes
> > > > into the territory of bikeshedding. So please consider
> > > > the above my 2 cents on this and lets leave it at that.
> > >
> > > You have a valid point. Let's focus on having descriptive function names.
> > 
> > For a couple of days I've been trying to resist the bikeshedding (esp.
> > given the changes to backlight are tiny) so I'll try to keep it as
> > brief as I can:
> > 
> > 1. I dislike the do_it() and do_it_cansleep() pairing. It is
> >    difficult to detect when a client driver calls do_it() by mistake.
> >    In fact a latent bug of this nature can only be detected by runtime
> >    testing with the small number of PWMs that do not support
> >    configuration from an atomic context.
> > 
> >    In contrast do_it() and do_it_atomic()[*] means that although
> >    incorrectly calling do_it() from an atomic context can be pretty
> >    catastrophic it is also trivially detected (with any PWM driver)
> >    simply by running with CONFIG_DEBUG_ATOMIC_SLEEP.

Wrongly calling the atomic variant (no matter how it's named) in a
context where sleeping is possible is only a minor issue. Being faster
than necessary is hardly a problem, so it only hurts by not being an
preemption point with PREEMPT_VOLUNTARY which might not even be relevant
because we're near to a system call anyhow.

For me the naming is only very loosely related to the possible bugs. I
think calling the wrong function happens mainly because the driver author
isn't aware in which context the call happens and not because of wrong
assumptions about the sleepiness of a certain function call.
If you consider this an argument however, do_it + do_it_cansleep is
better than do_it_atomic + do_it as wrongly assuming do_it would sleep
is less bad than wrongly assuming do_it wouldn't sleep. (The latter is
catched by CONFIG_DEBUG_ATOMIC_SLEEP, but only if it's enabled.)

Having said that while my subjective preference ordering is (with first
= best):

	do_it + do_it_cansleep
	do_it_atomic + do_it_cansleep
	do_it_atomic + do_it

wi(th a _might_sleep or _mightsleep suffix ranging below _cansleep)
I wouldn't get sleepless nights when I get overruled here
(uwe_cansleep :-).

> >    No objections (beyond churn) to fully spelt out pairings such as
> >    do_it_cansleep() and do_it_atomic()[*]!
> 
> I must say I do like the look of this. Uwe, how do you feel about:
> pwm_apply_cansleep() and pwm_apply_atomic()? I know we've talked about
> pwm_apply_atomic in the past, however I think this this the best 
> option I've seen so far.
> 
> > 2. If there is an API rename can we make sure the patch contains no
> >    other changes (e.g. don't introduce any new API in the same patch).
> >    Seperating renames makes the patches easier to review!
> >    It makes each one smaller and easier to review!
> 
> Yes, this should have been separated out. Will fix for next version.

+1

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Sean Young <sean@mess.org>
Cc: "Daniel Thompson" <daniel.thompson@linaro.org>,
	"Hans de Goede" <hdegoede@redhat.com>,
	linux-media@vger.kernel.org, linux-pwm@vger.kernel.org,
	"Ivaylo Dimitrov" <ivo.g.dimitrov.75@gmail.com>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Jani Nikula" <jani.nikula@linux.intel.com>,
	"Joonas Lahtinen" <joonas.lahtinen@linux.intel.com>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"Tvrtko Ursulin" <tvrtko.ursulin@linux.intel.com>,
	"David Airlie" <airlied@gmail.com>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Javier Martinez Canillas" <javierm@redhat.com>,
	"Jean Delvare" <jdelvare@suse.com>,
	"Guenter Roeck" <linux@roeck-us.net>,
	"Support Opensource" <support.opensource@diasemi.com>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	"Pavel Machek" <pavel@ucw.cz>, "Lee Jones" <lee@kernel.org>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Mark Gross" <markgross@kernel.org>,
	"Liam Girdwood" <lgirdwood@gmail.com>,
	"Mark Brown" <broonie@kernel.org>,
	"Jingoo Han" <jingoohan1@gmail.com>,
	"Helge Deller" <deller@gmx.de>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-hwmon@vger.kernel.org, linux-input@vger.kernel.org,
	linux-leds@vger.kernel.org, platform-driver-x86@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-fbdev@vger.kernel.org
Subject: Re: [PATCH v3 1/3] pwm: make it possible to apply pwm changes in atomic context
Date: Wed, 25 Oct 2023 12:47:43 +0200	[thread overview]
Message-ID: <20231025104743.56elaloj3jmojz2v@pengutronix.de> (raw)
In-Reply-To: <ZTjll7oTNVWqygbD@gofer.mess.org>


[-- Attachment #1.1: Type: text/plain, Size: 3932 bytes --]

Hello,

On Wed, Oct 25, 2023 at 10:53:27AM +0100, Sean Young wrote:
> On Mon, Oct 23, 2023 at 02:34:17PM +0100, Daniel Thompson wrote:
> > On Sun, Oct 22, 2023 at 11:46:22AM +0100, Sean Young wrote:
> > > On Sat, Oct 21, 2023 at 11:08:22AM +0200, Hans de Goede wrote:
> > > > On 10/19/23 12:51, Uwe Kleine-König wrote:
> > > > > On Wed, Oct 18, 2023 at 03:57:48PM +0200, Hans de Goede wrote:
> > > > >> On 10/17/23 11:17, Sean Young wrote:
> > > > > I think it's very subjective if you consider this
> > > > > churn or not.
> > > >
> > > > I consider it churn because I don't think adding a postfix
> > > > for what is the default/expected behavior is a good idea
> > > > (with GPIOs not sleeping is the expected behavior).
> > > >
> > > > I agree that this is very subjective and very much goes
> > > > into the territory of bikeshedding. So please consider
> > > > the above my 2 cents on this and lets leave it at that.
> > >
> > > You have a valid point. Let's focus on having descriptive function names.
> > 
> > For a couple of days I've been trying to resist the bikeshedding (esp.
> > given the changes to backlight are tiny) so I'll try to keep it as
> > brief as I can:
> > 
> > 1. I dislike the do_it() and do_it_cansleep() pairing. It is
> >    difficult to detect when a client driver calls do_it() by mistake.
> >    In fact a latent bug of this nature can only be detected by runtime
> >    testing with the small number of PWMs that do not support
> >    configuration from an atomic context.
> > 
> >    In contrast do_it() and do_it_atomic()[*] means that although
> >    incorrectly calling do_it() from an atomic context can be pretty
> >    catastrophic it is also trivially detected (with any PWM driver)
> >    simply by running with CONFIG_DEBUG_ATOMIC_SLEEP.

Wrongly calling the atomic variant (no matter how it's named) in a
context where sleeping is possible is only a minor issue. Being faster
than necessary is hardly a problem, so it only hurts by not being an
preemption point with PREEMPT_VOLUNTARY which might not even be relevant
because we're near to a system call anyhow.

For me the naming is only very loosely related to the possible bugs. I
think calling the wrong function happens mainly because the driver author
isn't aware in which context the call happens and not because of wrong
assumptions about the sleepiness of a certain function call.
If you consider this an argument however, do_it + do_it_cansleep is
better than do_it_atomic + do_it as wrongly assuming do_it would sleep
is less bad than wrongly assuming do_it wouldn't sleep. (The latter is
catched by CONFIG_DEBUG_ATOMIC_SLEEP, but only if it's enabled.)

Having said that while my subjective preference ordering is (with first
= best):

	do_it + do_it_cansleep
	do_it_atomic + do_it_cansleep
	do_it_atomic + do_it

wi(th a _might_sleep or _mightsleep suffix ranging below _cansleep)
I wouldn't get sleepless nights when I get overruled here
(uwe_cansleep :-).

> >    No objections (beyond churn) to fully spelt out pairings such as
> >    do_it_cansleep() and do_it_atomic()[*]!
> 
> I must say I do like the look of this. Uwe, how do you feel about:
> pwm_apply_cansleep() and pwm_apply_atomic()? I know we've talked about
> pwm_apply_atomic in the past, however I think this this the best 
> option I've seen so far.
> 
> > 2. If there is an API rename can we make sure the patch contains no
> >    other changes (e.g. don't introduce any new API in the same patch).
> >    Seperating renames makes the patches easier to review!
> >    It makes each one smaller and easier to review!
> 
> Yes, this should have been separated out. Will fix for next version.

+1

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Sean Young <sean@mess.org>
Cc: linux-fbdev@vger.kernel.org, linux-doc@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"Pavel Machek" <pavel@ucw.cz>,
	linux-leds@vger.kernel.org,
	"Daniel Thompson" <daniel.thompson@linaro.org>,
	"Ivaylo Dimitrov" <ivo.g.dimitrov.75@gmail.com>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Helge Deller" <deller@gmx.de>, "Lee Jones" <lee@kernel.org>,
	"Javier Martinez Canillas" <javierm@redhat.com>,
	linux-input@vger.kernel.org,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Guenter Roeck" <linux@roeck-us.net>,
	linux-media@vger.kernel.org, platform-driver-x86@vger.kernel.org,
	linux-pwm@vger.kernel.org, "Jean Delvare" <jdelvare@suse.com>,
	intel-gfx@lists.freedesktop.org,
	"Mark Gross" <markgross@kernel.org>,
	"Hans de Goede" <hdegoede@redhat.com>,
	"Mark Brown" <broonie@kernel.org>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-hwmon@vger.kernel.org,
	"Tvrtko Ursulin" <tvrtko.ursulin@linux.intel.com>,
	"Support Opensource" <support.opensource@diasemi.com>,
	"Jingoo Han" <jingoohan1@gmail.com>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	"Liam Girdwood" <lgirdwood@gmail.com>
Subject: Re: [PATCH v3 1/3] pwm: make it possible to apply pwm changes in atomic context
Date: Wed, 25 Oct 2023 12:47:43 +0200	[thread overview]
Message-ID: <20231025104743.56elaloj3jmojz2v@pengutronix.de> (raw)
In-Reply-To: <ZTjll7oTNVWqygbD@gofer.mess.org>

[-- Attachment #1: Type: text/plain, Size: 3932 bytes --]

Hello,

On Wed, Oct 25, 2023 at 10:53:27AM +0100, Sean Young wrote:
> On Mon, Oct 23, 2023 at 02:34:17PM +0100, Daniel Thompson wrote:
> > On Sun, Oct 22, 2023 at 11:46:22AM +0100, Sean Young wrote:
> > > On Sat, Oct 21, 2023 at 11:08:22AM +0200, Hans de Goede wrote:
> > > > On 10/19/23 12:51, Uwe Kleine-König wrote:
> > > > > On Wed, Oct 18, 2023 at 03:57:48PM +0200, Hans de Goede wrote:
> > > > >> On 10/17/23 11:17, Sean Young wrote:
> > > > > I think it's very subjective if you consider this
> > > > > churn or not.
> > > >
> > > > I consider it churn because I don't think adding a postfix
> > > > for what is the default/expected behavior is a good idea
> > > > (with GPIOs not sleeping is the expected behavior).
> > > >
> > > > I agree that this is very subjective and very much goes
> > > > into the territory of bikeshedding. So please consider
> > > > the above my 2 cents on this and lets leave it at that.
> > >
> > > You have a valid point. Let's focus on having descriptive function names.
> > 
> > For a couple of days I've been trying to resist the bikeshedding (esp.
> > given the changes to backlight are tiny) so I'll try to keep it as
> > brief as I can:
> > 
> > 1. I dislike the do_it() and do_it_cansleep() pairing. It is
> >    difficult to detect when a client driver calls do_it() by mistake.
> >    In fact a latent bug of this nature can only be detected by runtime
> >    testing with the small number of PWMs that do not support
> >    configuration from an atomic context.
> > 
> >    In contrast do_it() and do_it_atomic()[*] means that although
> >    incorrectly calling do_it() from an atomic context can be pretty
> >    catastrophic it is also trivially detected (with any PWM driver)
> >    simply by running with CONFIG_DEBUG_ATOMIC_SLEEP.

Wrongly calling the atomic variant (no matter how it's named) in a
context where sleeping is possible is only a minor issue. Being faster
than necessary is hardly a problem, so it only hurts by not being an
preemption point with PREEMPT_VOLUNTARY which might not even be relevant
because we're near to a system call anyhow.

For me the naming is only very loosely related to the possible bugs. I
think calling the wrong function happens mainly because the driver author
isn't aware in which context the call happens and not because of wrong
assumptions about the sleepiness of a certain function call.
If you consider this an argument however, do_it + do_it_cansleep is
better than do_it_atomic + do_it as wrongly assuming do_it would sleep
is less bad than wrongly assuming do_it wouldn't sleep. (The latter is
catched by CONFIG_DEBUG_ATOMIC_SLEEP, but only if it's enabled.)

Having said that while my subjective preference ordering is (with first
= best):

	do_it + do_it_cansleep
	do_it_atomic + do_it_cansleep
	do_it_atomic + do_it

wi(th a _might_sleep or _mightsleep suffix ranging below _cansleep)
I wouldn't get sleepless nights when I get overruled here
(uwe_cansleep :-).

> >    No objections (beyond churn) to fully spelt out pairings such as
> >    do_it_cansleep() and do_it_atomic()[*]!
> 
> I must say I do like the look of this. Uwe, how do you feel about:
> pwm_apply_cansleep() and pwm_apply_atomic()? I know we've talked about
> pwm_apply_atomic in the past, however I think this this the best 
> option I've seen so far.
> 
> > 2. If there is an API rename can we make sure the patch contains no
> >    other changes (e.g. don't introduce any new API in the same patch).
> >    Seperating renames makes the patches easier to review!
> >    It makes each one smaller and easier to review!
> 
> Yes, this should have been separated out. Will fix for next version.

+1

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Sean Young <sean@mess.org>
Cc: linux-fbdev@vger.kernel.org, linux-doc@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	"Pavel Machek" <pavel@ucw.cz>, "David Airlie" <airlied@gmail.com>,
	linux-leds@vger.kernel.org,
	"Daniel Thompson" <daniel.thompson@linaro.org>,
	"Ivaylo Dimitrov" <ivo.g.dimitrov.75@gmail.com>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Helge Deller" <deller@gmx.de>, "Lee Jones" <lee@kernel.org>,
	"Javier Martinez Canillas" <javierm@redhat.com>,
	linux-input@vger.kernel.org,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Guenter Roeck" <linux@roeck-us.net>,
	linux-media@vger.kernel.org, platform-driver-x86@vger.kernel.org,
	linux-pwm@vger.kernel.org, "Jean Delvare" <jdelvare@suse.com>,
	intel-gfx@lists.freedesktop.org,
	"Mark Gross" <markgross@kernel.org>,
	"Hans de Goede" <hdegoede@redhat.com>,
	"Mark Brown" <broonie@kernel.org>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-hwmon@vger.kernel.org,
	"Support Opensource" <support.opensource@diasemi.com>,
	"Jingoo Han" <jingoohan1@gmail.com>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	"Liam Girdwood" <lgirdwood@gmail.com>,
	"Daniel Vetter" <daniel@ffwll.ch>
Subject: Re: [Intel-gfx] [PATCH v3 1/3] pwm: make it possible to apply pwm changes in atomic context
Date: Wed, 25 Oct 2023 12:47:43 +0200	[thread overview]
Message-ID: <20231025104743.56elaloj3jmojz2v@pengutronix.de> (raw)
In-Reply-To: <ZTjll7oTNVWqygbD@gofer.mess.org>

[-- Attachment #1: Type: text/plain, Size: 3932 bytes --]

Hello,

On Wed, Oct 25, 2023 at 10:53:27AM +0100, Sean Young wrote:
> On Mon, Oct 23, 2023 at 02:34:17PM +0100, Daniel Thompson wrote:
> > On Sun, Oct 22, 2023 at 11:46:22AM +0100, Sean Young wrote:
> > > On Sat, Oct 21, 2023 at 11:08:22AM +0200, Hans de Goede wrote:
> > > > On 10/19/23 12:51, Uwe Kleine-König wrote:
> > > > > On Wed, Oct 18, 2023 at 03:57:48PM +0200, Hans de Goede wrote:
> > > > >> On 10/17/23 11:17, Sean Young wrote:
> > > > > I think it's very subjective if you consider this
> > > > > churn or not.
> > > >
> > > > I consider it churn because I don't think adding a postfix
> > > > for what is the default/expected behavior is a good idea
> > > > (with GPIOs not sleeping is the expected behavior).
> > > >
> > > > I agree that this is very subjective and very much goes
> > > > into the territory of bikeshedding. So please consider
> > > > the above my 2 cents on this and lets leave it at that.
> > >
> > > You have a valid point. Let's focus on having descriptive function names.
> > 
> > For a couple of days I've been trying to resist the bikeshedding (esp.
> > given the changes to backlight are tiny) so I'll try to keep it as
> > brief as I can:
> > 
> > 1. I dislike the do_it() and do_it_cansleep() pairing. It is
> >    difficult to detect when a client driver calls do_it() by mistake.
> >    In fact a latent bug of this nature can only be detected by runtime
> >    testing with the small number of PWMs that do not support
> >    configuration from an atomic context.
> > 
> >    In contrast do_it() and do_it_atomic()[*] means that although
> >    incorrectly calling do_it() from an atomic context can be pretty
> >    catastrophic it is also trivially detected (with any PWM driver)
> >    simply by running with CONFIG_DEBUG_ATOMIC_SLEEP.

Wrongly calling the atomic variant (no matter how it's named) in a
context where sleeping is possible is only a minor issue. Being faster
than necessary is hardly a problem, so it only hurts by not being an
preemption point with PREEMPT_VOLUNTARY which might not even be relevant
because we're near to a system call anyhow.

For me the naming is only very loosely related to the possible bugs. I
think calling the wrong function happens mainly because the driver author
isn't aware in which context the call happens and not because of wrong
assumptions about the sleepiness of a certain function call.
If you consider this an argument however, do_it + do_it_cansleep is
better than do_it_atomic + do_it as wrongly assuming do_it would sleep
is less bad than wrongly assuming do_it wouldn't sleep. (The latter is
catched by CONFIG_DEBUG_ATOMIC_SLEEP, but only if it's enabled.)

Having said that while my subjective preference ordering is (with first
= best):

	do_it + do_it_cansleep
	do_it_atomic + do_it_cansleep
	do_it_atomic + do_it

wi(th a _might_sleep or _mightsleep suffix ranging below _cansleep)
I wouldn't get sleepless nights when I get overruled here
(uwe_cansleep :-).

> >    No objections (beyond churn) to fully spelt out pairings such as
> >    do_it_cansleep() and do_it_atomic()[*]!
> 
> I must say I do like the look of this. Uwe, how do you feel about:
> pwm_apply_cansleep() and pwm_apply_atomic()? I know we've talked about
> pwm_apply_atomic in the past, however I think this this the best 
> option I've seen so far.
> 
> > 2. If there is an API rename can we make sure the patch contains no
> >    other changes (e.g. don't introduce any new API in the same patch).
> >    Seperating renames makes the patches easier to review!
> >    It makes each one smaller and easier to review!
> 
> Yes, this should have been separated out. Will fix for next version.

+1

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2023-10-25 10:49 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-17  9:17 [PATCH v3 0/3] Improve pwm-ir-tx precision Sean Young
2023-10-17  9:17 ` [PATCH v3 1/3] pwm: make it possible to apply pwm changes in atomic context Sean Young
2023-10-17  9:17   ` [Intel-gfx] " Sean Young
2023-10-17  9:17   ` Sean Young
2023-10-17  9:17   ` Sean Young
2023-10-18 13:57   ` Hans de Goede
2023-10-18 13:57     ` Hans de Goede
2023-10-18 13:57     ` [Intel-gfx] " Hans de Goede
2023-10-18 13:57     ` Hans de Goede
2023-10-19 10:51     ` Uwe Kleine-König
2023-10-19 10:51       ` Uwe Kleine-König
2023-10-19 10:51       ` [Intel-gfx] " Uwe Kleine-König
2023-10-19 10:51       ` Uwe Kleine-König
2023-10-21  9:08       ` Hans de Goede
2023-10-21  9:08         ` [Intel-gfx] " Hans de Goede
2023-10-21  9:08         ` Hans de Goede
2023-10-21  9:08         ` Hans de Goede
2023-10-22 10:46         ` Sean Young
2023-10-22 10:46           ` [Intel-gfx] " Sean Young
2023-10-22 10:46           ` Sean Young
2023-10-22 10:46           ` Sean Young
2023-10-23 13:17           ` Hans de Goede
2023-10-23 13:17             ` [Intel-gfx] " Hans de Goede
2023-10-23 13:17             ` Hans de Goede
2023-10-23 13:17             ` Hans de Goede
2023-10-23 13:34           ` Daniel Thompson
2023-10-23 13:34             ` Daniel Thompson
2023-10-23 13:34             ` [Intel-gfx] " Daniel Thompson
2023-10-23 13:34             ` Daniel Thompson
2023-10-25  9:53             ` Sean Young
2023-10-25  9:53               ` [Intel-gfx] " Sean Young
2023-10-25  9:53               ` Sean Young
2023-10-25  9:53               ` Sean Young
2023-10-25 10:47               ` Uwe Kleine-König [this message]
2023-10-25 10:47                 ` [Intel-gfx] " Uwe Kleine-König
2023-10-25 10:47                 ` Uwe Kleine-König
2023-10-25 10:47                 ` Uwe Kleine-König
2023-10-21 23:55   ` kernel test robot
2023-10-23 10:47   ` Jani Nikula
2023-10-23 10:47     ` Jani Nikula
2023-10-23 10:47     ` [Intel-gfx] " Jani Nikula
2023-10-23 10:47     ` Jani Nikula
2023-10-17  9:17 ` [PATCH v3 2/3] pwm: bcm2835: allow pwm driver to be used " Sean Young
2023-10-17  9:17   ` Sean Young
2023-10-18 15:00   ` Stefan Wahren
2023-10-18 15:00     ` Stefan Wahren
2023-10-19 11:19     ` Sean Young
2023-10-19 11:19       ` Sean Young
2023-10-17  9:17 ` [PATCH v3 3/3] media: pwm-ir-tx: trigger edges from hrtimer interrupt context Sean Young

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=20231025104743.56elaloj3jmojz2v@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=airlied@gmail.com \
    --cc=broonie@kernel.org \
    --cc=corbet@lwn.net \
    --cc=daniel.thompson@linaro.org \
    --cc=daniel@ffwll.ch \
    --cc=deller@gmx.de \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ivo.g.dimitrov.75@gmail.com \
    --cc=jani.nikula@linux.intel.com \
    --cc=javierm@redhat.com \
    --cc=jdelvare@suse.com \
    --cc=jingoohan1@gmail.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=lee@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=markgross@kernel.org \
    --cc=mchehab@kernel.org \
    --cc=pavel@ucw.cz \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=sean@mess.org \
    --cc=support.opensource@diasemi.com \
    --cc=thierry.reding@gmail.com \
    --cc=tvrtko.ursulin@linux.intel.com \
    /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.