lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOMZO5Cn993y9VeFN6hPO3-cfNnUKiuFd_rqAZ8htz=dO6t6ig@mail.gmail.com>
Date:   Tue, 3 Dec 2019 09:04:58 -0300
From:   Fabio Estevam <festevam@...il.com>
To:     Marco Felsch <m.felsch@...gutronix.de>
Cc:     Igor Plyatov <plyatov@...il.com>, Zhang Rui <rui.zhang@...el.com>,
        Eduardo Valentin <edubezval@...il.com>,
        Daniel Lezcano <daniel.lezcano@...aro.org>,
        Amit Kucheria <amit.kucheria@...durent.com>,
        Shawn Guo <shawnguo@...nel.org>,
        Sascha Hauer <s.hauer@...gutronix.de>,
        Pengutronix Kernel Team <kernel@...gutronix.de>,
        NXP Linux Team <linux-imx@....com>, linux-pm@...r.kernel.org,
        "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" 
        <linux-arm-kernel@...ts.infradead.org>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: Issue with imx_get_temp()

Hi Marco,

On Tue, Dec 3, 2019 at 7:15 AM Marco Felsch <m.felsch@...gutronix.de> 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()?

--- a/drivers/thermal/imx_thermal.c
+++ b/drivers/thermal/imx_thermal.c
@@ -803,6 +803,7 @@ static int imx_thermal_probe(struct platform_device *pdev)
                goto legacy_cleanup;
        }

+       data->irq_enabled = true;
        data->tz = thermal_zone_device_register("imx_thermal_zone",
                                                IMX_TRIP_NUM,
                                                BIT(IMX_TRIP_PASSIVE), data,
@@ -837,7 +838,6 @@ static int imx_thermal_probe(struct platform_device *pdev)
        regmap_write(map, data->socdata->sensor_ctrl + REG_SET,
                     data->socdata->measure_temp_mask);

-       data->irq_enabled = true;
        data->mode = THERMAL_DEVICE_ENABLED;

        ret = devm_request_threaded_irq(&pdev->dev, data->irq,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ