Re: Issue with imx_get_temp()

From: Fabio Estevam
Date: Tue Dec 03 2019 - 08:13:03 EST


On Tue, Dec 3, 2019 at 9:04 AM Fabio Estevam <festevam@xxxxxxxxx> wrote:
>
> Hi Marco,
>
> On Tue, Dec 3, 2019 at 7:15 AM Marco Felsch <m.felsch@xxxxxxxxxxxxxx> wrote:
>
> > Mh.. it seems that the irq gets enabled before a irq-handler is
> > registered. As your backlog shows the thermal_zone_device_register()
> > triggers a imx_get_temp() and during boot the irq_enabled is false and
> > it seems that your temperature is below the alarm_temp. So in such a
> > case the enable_irq() is executed. I don't know what happens if we
> > enable a irq without a irq-handler.
>
> I think your analysis makes sense.
>
> Should we move the ' data->irq_enabled = true' just prior to calling
> thermal_zone_device_register()?

Or maybe we could call thermal_zone_device_register() later?

Igor,

Does the following patch help?
http://code.bulix.org/l3rz2e-982595