[PATCH v3 3/4] thermal: qoriq: workaround unexpected temperature readings from tmu

Jacky Bai ping.bai at nxp.com
Mon Aug 18 19:01:52 PDT 2025


> Subject: Re: [PATCH v3 3/4] thermal: qoriq: workaround unexpected
> temperature readings from tmu
> 

...

> >
> > +	/*ERR052243: If a raising or falling edge happens, try later */
> > +	if (CHECK_ERRATA_FLAG(qdata->drvdata, TMU_ERR052243)) {
> > +		regmap_read(qdata->regmap, REGS_TIDR, &tidr);
> > +		if (tidr & GENMASK(25, 24)) {
> 
> you use GENMASK(25, 24) twice, define it as macro.

OK.

> 
> > +			regmap_write(qdata->regmap, REGS_TIDR, GENMASK(25, 24));
> > +			return -EAGAIN;
> > +		}
> > +	}
> > +
> >  	if (qdata->ver == TMU_VER1) {
> >  		*temp = (val & GENMASK(7, 0)) * MILLIDEGREE_PER_DEGREE;
> >  	} else {
> > @@ -238,7 +268,6 @@ static void qoriq_tmu_init_device(struct
> qoriq_tmu_data *data)
> >  	regmap_write(data->regmap, REGS_TIER, TIER_DISABLE);
> >
> >  	/* Set update_interval */
> > -
> 
> uncessary change.

OK.

> 
> >  	if (data->ver == TMU_VER1) {
> >  		regmap_write(data->regmap, REGS_TMTMIR, TMTMIR_DEFAULT);
> >  	} else {
> > @@ -246,6 +275,14 @@ static void qoriq_tmu_init_device(struct
> qoriq_tmu_data *data)
> >  		regmap_write(data->regmap, REGS_V2_TEUMR(0),
> GET_TEUMR0(data->drvdata));
> >  	}
> >
> > +	/* ERR052243: Set the raising & falling edge monitor */
> > +	if (CHECK_ERRATA_FLAG(data->drvdata, TMU_ERR052243)) {
> > +		regmap_write(data->regmap, TMRTRCTR, TMRTRCTR_EN |
> > +			     FIELD_PREP(TMRTRCTR_TEMP_MASK, 0x7));
> > +		regmap_write(data->regmap, TMFTRCTR, TMFTRCTR_EN |
> > +			     FIELD_PREP(TMFTRCTR_TEMP_MASK, 0x7));
> 
> the same here for 0x7
> 

OK, will define it as a macro.

BR
> Frank
> > +
> > +	}
> >  	/* Disable monitoring */
> >  	regmap_write(data->regmap, REGS_TMR, TMR_DISABLE);  } @@
> -389,6
> > +426,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(qoriq_tmu_pm_ops,
> >
> >  static const struct tmu_drvdata imx93_data = {
> >  	.teumr0 = TEUMR0_V21,
> > +	.tmu_errata = TMU_ERR052243,
> >  };
> >
> >  static const struct of_device_id qoriq_tmu_match[] = {
> >
> > --
> > 2.34.1
> >



More information about the linux-arm-kernel mailing list