[PATCH] pwm: imx-tpm: keep channel state instead of counting

Uwe Kleine-König ukleinek at kernel.org
Fri Jan 30 14:54:00 PST 2026


On Fri, Jan 30, 2026 at 12:41:22PM -0500, Frank Li wrote:
> On Fri, Jan 30, 2026 at 04:37:20PM +0200, Viorel Suman (OSS) wrote:
> > @@ -166,6 +166,10 @@ static int pwm_imx_tpm_get_state(struct pwm_chip *chip,
> >
> >  	/* get channel status */
> >  	state->enabled = FIELD_GET(PWM_IMX_TPM_CnSC_ELS, val) ? true : false;
> > +	if (state->enabled)
> > +		tpm->enabled_channels |= BIT(pwm->hwpwm);
> > +	else
> > +		tpm->enabled_channels &= ~BIT(pwm->hwpwm);
> 
> Do you have lock for RMW? or you should atomic_or() and atomic_and()

.get_state() is called under the chip lock, so the locking should be
fine.

Best regards
Uwe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20260130/8dff0c50/attachment.sig>


More information about the linux-arm-kernel mailing list