Re: [PATCH v5 2/4] pwm: make it possible to apply pwm changes in atomic context

From: Sean Young
Date: Wed Nov 29 2023 - 04:07:47 EST


On Fri, Nov 24, 2023 at 02:36:51PM +0100, Thierry Reding wrote:
> On Sat, Nov 18, 2023 at 04:16:18PM +0000, Sean Young wrote:
> [...]
> > diff --git a/include/linux/pwm.h b/include/linux/pwm.h
> > index c4b066f7c5097..495aba06c64c3 100644
> > --- a/include/linux/pwm.h
> > +++ b/include/linux/pwm.h
> > @@ -286,6 +286,7 @@ struct pwm_ops {
> > * @npwm: number of PWMs controlled by this chip
> > * @of_xlate: request a PWM device given a device tree PWM specifier
> > * @of_pwm_n_cells: number of cells expected in the device tree PWM specifier
> > + * @atomic: can the driver execute pwm_apply_cansleep in atomic context
>
> I'm a little reluctant to suggest that we rename this to might_sleep as
> well because it would require that we audit each and every driver to set
> this properly, since by default all devices have so far been defaulting
> to "might_sleep". But then again, I think that's something that we're
> going to need to do at some point anyway.
>
> In the interim, I think we could keep it like this and address this as a
> follow-up.

Yes, I agree that the name atomic is not ideal. However, calling it
might_sleep means we have to touch every driver. That's not impossible,
but not ideal either.

For now, I'll leave it as is.


Sean