linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Issue with imx_get_temp()
@ 2019-12-02 13:45 Igor Plyatov
  2019-12-03 10:15 ` Marco Felsch
  0 siblings, 1 reply; 9+ messages in thread
From: Igor Plyatov @ 2019-12-02 13:45 UTC (permalink / raw)
  To: Zhang Rui, Eduardo Valentin, Daniel Lezcano, Amit Kucheria,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, linux-pm, linux-arm-kernel, linux-kernel

Dear all,

please  look at back-trace below. It happens on Freescale i.MX6 Quad.

Found a few of those during power on/off stress test in the climate chamber:

[    0.657596] ------------[ cut here ]------------
[    0.657626] WARNING: CPU: 3 PID: 150 at /home/geosig/development/oe-core-toradex-cr7/build/tmp-glibc/work-shared/cr7/kernel-source/kernel/irq/chip.c:242 __irq_startup+0x94/0xa8
[    0.657630] Modules linked in:
[    0.657643] CPU: 3 PID: 150 Comm: kworker/3:1 Not tainted 5.1.1 #1
[    0.657648] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[    0.657660] Workqueue: events deferred_probe_work_func
[    0.657691] [<8011005c>] (unwind_backtrace) from [<8010b8c8>] (show_stack+0x10/0x14)
[    0.657709] [<8010b8c8>] (show_stack) from [<80857b04>] (dump_stack+0x88/0x9c)
[    0.657727] [<80857b04>] (dump_stack) from [<8011f308>] (__warn+0xdc/0xf4)
[    0.657741] [<8011f308>] (__warn) from [<8011f438>] (warn_slowpath_null+0x40/0x48)
[    0.657752] [<8011f438>] (warn_slowpath_null) from [<8016d1a8>] (__irq_startup+0x94/0xa8)
[    0.657762] [<8016d1a8>] (__irq_startup) from [<8016d208>] (irq_startup+0x4c/0x130)
[    0.657772] [<8016d208>] (irq_startup) from [<8016a6dc>] (enable_irq+0x44/0x90)
[    0.657790] [<8016a6dc>] (enable_irq) from [<8066f05c>] (imx_get_temp+0x1bc/0x1fc)
[    0.657804] [<8066f05c>] (imx_get_temp) from [<8066cd78>] (thermal_zone_get_temp+0x48/0x68)
[    0.657816] [<8066cd78>] (thermal_zone_get_temp) from [<8066a3e4>] (thermal_zone_device_update.part.3+0x28/0xcc)
[    0.657827] [<8066a3e4>] (thermal_zone_device_update.part.3) from [<8066afc4>] (thermal_zone_device_register+0x4ac/0x5ec)
[    0.657837] [<8066afc4>] (thermal_zone_device_register) from [<8066f580>] (imx_thermal_probe+0x3a8/0x61c)
[    0.657853] [<8066f580>] (imx_thermal_probe) from [<8054ae90>] (platform_drv_probe+0x48/0x98)
[    0.657864] [<8054ae90>] (platform_drv_probe) from [<805492a4>] (really_probe+0x228/0x2d0)
[    0.657875] [<805492a4>] (really_probe) from [<805494ac>] (driver_probe_device+0x60/0x174)
[    0.657892] [<805494ac>] (driver_probe_device) from [<805476f4>] (bus_for_each_drv+0x58/0xb8)
[    0.657903] [<805476f4>] (bus_for_each_drv) from [<80549008>] (__device_attach+0xd0/0x13c)
[    0.657914] [<80549008>] (__device_attach) from [<80548404>] (bus_probe_device+0x84/0x8c)
[    0.657923] [<80548404>] (bus_probe_device) from [<8054889c>] (deferred_probe_work_func+0x64/0x90)
[    0.657938] [<8054889c>] (deferred_probe_work_func) from [<80136fd0>] (process_one_work+0x204/0x420)
[    0.657952] [<80136fd0>] (process_one_work) from [<80137ddc>] (worker_thread+0x44/0x5bc)
[    0.657966] [<80137ddc>] (worker_thread) from [<8013cab0>] (kthread+0x144/0x14c)
[    0.657978] [<8013cab0>] (kthread) from [<801010e8>] (ret_from_fork+0x14/0x2c)
[    0.657984] Exception stack(0xd0ae1fb0 to 0xd0ae1ff8)
[    0.657992] 1fa0:                                     00000000 00000000 00000000 00000000
[    0.658002] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    0.658010] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[    0.658016] ---[ end trace 6bb553a60c0886bd ]---

Can somebody recommend, how to debug/resolve this issue?

Best wishes.
--
Igor Plyatov


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Issue with imx_get_temp()
  2019-12-02 13:45 Issue with imx_get_temp() Igor Plyatov
@ 2019-12-03 10:15 ` Marco Felsch
  2019-12-03 12:04   ` Fabio Estevam
  0 siblings, 1 reply; 9+ messages in thread
From: Marco Felsch @ 2019-12-03 10:15 UTC (permalink / raw)
  To: Igor Plyatov
  Cc: Zhang Rui, Eduardo Valentin, Daniel Lezcano, Amit Kucheria,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, linux-pm, linux-arm-kernel, linux-kernel

Hi Igor,

On 19-12-02 16:45, Igor Plyatov wrote:
> Dear all,
> 
> please  look at back-trace below. It happens on Freescale i.MX6 Quad.
> 
> Found a few of those during power on/off stress test in the climate chamber:
> 
> [    0.657596] ------------[ cut here ]------------
> [    0.657626] WARNING: CPU: 3 PID: 150 at /home/geosig/development/oe-core-toradex-cr7/build/tmp-glibc/work-shared/cr7/kernel-source/kernel/irq/chip.c:242 __irq_startup+0x94/0xa8
> [    0.657630] Modules linked in:
> [    0.657643] CPU: 3 PID: 150 Comm: kworker/3:1 Not tainted 5.1.1 #1
> [    0.657648] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
> [    0.657660] Workqueue: events deferred_probe_work_func
> [    0.657691] [<8011005c>] (unwind_backtrace) from [<8010b8c8>] (show_stack+0x10/0x14)
> [    0.657709] [<8010b8c8>] (show_stack) from [<80857b04>] (dump_stack+0x88/0x9c)
> [    0.657727] [<80857b04>] (dump_stack) from [<8011f308>] (__warn+0xdc/0xf4)
> [    0.657741] [<8011f308>] (__warn) from [<8011f438>] (warn_slowpath_null+0x40/0x48)
> [    0.657752] [<8011f438>] (warn_slowpath_null) from [<8016d1a8>] (__irq_startup+0x94/0xa8)
> [    0.657762] [<8016d1a8>] (__irq_startup) from [<8016d208>] (irq_startup+0x4c/0x130)
> [    0.657772] [<8016d208>] (irq_startup) from [<8016a6dc>] (enable_irq+0x44/0x90)
> [    0.657790] [<8016a6dc>] (enable_irq) from [<8066f05c>] (imx_get_temp+0x1bc/0x1fc)
> [    0.657804] [<8066f05c>] (imx_get_temp) from [<8066cd78>] (thermal_zone_get_temp+0x48/0x68)
> [    0.657816] [<8066cd78>] (thermal_zone_get_temp) from [<8066a3e4>] (thermal_zone_device_update.part.3+0x28/0xcc)
> [    0.657827] [<8066a3e4>] (thermal_zone_device_update.part.3) from [<8066afc4>] (thermal_zone_device_register+0x4ac/0x5ec)
> [    0.657837] [<8066afc4>] (thermal_zone_device_register) from [<8066f580>] (imx_thermal_probe+0x3a8/0x61c)
> [    0.657853] [<8066f580>] (imx_thermal_probe) from [<8054ae90>] (platform_drv_probe+0x48/0x98)
> [    0.657864] [<8054ae90>] (platform_drv_probe) from [<805492a4>] (really_probe+0x228/0x2d0)
> [    0.657875] [<805492a4>] (really_probe) from [<805494ac>] (driver_probe_device+0x60/0x174)
> [    0.657892] [<805494ac>] (driver_probe_device) from [<805476f4>] (bus_for_each_drv+0x58/0xb8)
> [    0.657903] [<805476f4>] (bus_for_each_drv) from [<80549008>] (__device_attach+0xd0/0x13c)
> [    0.657914] [<80549008>] (__device_attach) from [<80548404>] (bus_probe_device+0x84/0x8c)
> [    0.657923] [<80548404>] (bus_probe_device) from [<8054889c>] (deferred_probe_work_func+0x64/0x90)
> [    0.657938] [<8054889c>] (deferred_probe_work_func) from [<80136fd0>] (process_one_work+0x204/0x420)
> [    0.657952] [<80136fd0>] (process_one_work) from [<80137ddc>] (worker_thread+0x44/0x5bc)
> [    0.657966] [<80137ddc>] (worker_thread) from [<8013cab0>] (kthread+0x144/0x14c)
> [    0.657978] [<8013cab0>] (kthread) from [<801010e8>] (ret_from_fork+0x14/0x2c)
> [    0.657984] Exception stack(0xd0ae1fb0 to 0xd0ae1ff8)
> [    0.657992] 1fa0:                                     00000000 00000000 00000000 00000000
> [    0.658002] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
> [    0.658010] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000
> [    0.658016] ---[ end trace 6bb553a60c0886bd ]---
> 
> Can somebody recommend, how to debug/resolve this issue?

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.

Regards,
  Marco 

> Best wishes.
> --
> Igor Plyatov
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Issue with imx_get_temp()
  2019-12-03 10:15 ` Marco Felsch
@ 2019-12-03 12:04   ` Fabio Estevam
  2019-12-03 13:13     ` Fabio Estevam
  0 siblings, 1 reply; 9+ messages in thread
From: Fabio Estevam @ 2019-12-03 12:04 UTC (permalink / raw)
  To: Marco Felsch
  Cc: Igor Plyatov, Zhang Rui, Eduardo Valentin, Daniel Lezcano,
	Amit Kucheria, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	NXP Linux Team, linux-pm,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	linux-kernel

Hi Marco,

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Issue with imx_get_temp()
  2019-12-03 12:04   ` Fabio Estevam
@ 2019-12-03 13:13     ` Fabio Estevam
  2019-12-03 14:36       ` Igor Plyatov
  0 siblings, 1 reply; 9+ messages in thread
From: Fabio Estevam @ 2019-12-03 13:13 UTC (permalink / raw)
  To: Marco Felsch
  Cc: Igor Plyatov, Zhang Rui, Eduardo Valentin, Daniel Lezcano,
	Amit Kucheria, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	NXP Linux Team, linux-pm,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	linux-kernel

On Tue, Dec 3, 2019 at 9:04 AM Fabio Estevam <festevam@gmail.com> wrote:
>
> Hi Marco,
>
> On Tue, Dec 3, 2019 at 7:15 AM Marco Felsch <m.felsch@pengutronix.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()?

Or maybe we could call thermal_zone_device_register() later?

Igor,

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Issue with imx_get_temp()
  2019-12-03 13:13     ` Fabio Estevam
@ 2019-12-03 14:36       ` Igor Plyatov
  2019-12-10 12:19         ` Fabio Estevam
  2020-01-09 12:17         ` Fabio Estevam
  0 siblings, 2 replies; 9+ messages in thread
From: Igor Plyatov @ 2019-12-03 14:36 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Marco Felsch, Zhang Rui, Eduardo Valentin, Daniel Lezcano,
	Amit Kucheria, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	NXP Linux Team, linux-pm,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	linux-kernel

Dear Fabio,

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

Thank you!

Patch applied and will be tested.

I will inform you about results.

Best wishes

--

Igor Plyatov


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Issue with imx_get_temp()
  2019-12-03 14:36       ` Igor Plyatov
@ 2019-12-10 12:19         ` Fabio Estevam
  2020-01-09 12:17         ` Fabio Estevam
  1 sibling, 0 replies; 9+ messages in thread
From: Fabio Estevam @ 2019-12-10 12:19 UTC (permalink / raw)
  To: Igor Plyatov
  Cc: Marco Felsch, Zhang Rui, Eduardo Valentin, Daniel Lezcano,
	Amit Kucheria, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	NXP Linux Team, linux-pm,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	linux-kernel

Hi Igor,

On Tue, Dec 3, 2019 at 11:36 AM Igor Plyatov <plyatov@gmail.com> wrote:
>
> Dear Fabio,
>
> > Does the following patch help?
> > http://code.bulix.org/l3rz2e-982595
>
> Thank you!
>
> Patch applied and will be tested.
>
> I will inform you about results.

How did your tests go?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Issue with imx_get_temp()
  2019-12-03 14:36       ` Igor Plyatov
  2019-12-10 12:19         ` Fabio Estevam
@ 2020-01-09 12:17         ` Fabio Estevam
  1 sibling, 0 replies; 9+ messages in thread
From: Fabio Estevam @ 2020-01-09 12:17 UTC (permalink / raw)
  To: Igor Plyatov
  Cc: Marco Felsch, Zhang Rui, Eduardo Valentin, Daniel Lezcano,
	Amit Kucheria, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	NXP Linux Team, linux-pm,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	linux-kernel

Hi Igor,

On Tue, Dec 3, 2019 at 11:36 AM Igor Plyatov <plyatov@gmail.com> wrote:
>
> Dear Fabio,
>
> > Does the following patch help?
> > http://code.bulix.org/l3rz2e-982595
>
> Thank you!
>
> Patch applied and will be tested.
>
> I will inform you about results.

Have you had a chance to test the patch?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Issue with imx_get_temp()
  2019-12-02 13:49 ` Fabio Estevam
@ 2019-12-03 14:34   ` Igor Plyatov
  0 siblings, 0 replies; 9+ messages in thread
From: Igor Plyatov @ 2019-12-03 14:34 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Zhang Rui, Eduardo Valentin, Daniel Lezcano, Amit Kucheria,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, NXP Linux Team,
	linux-pm,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	linux-kernel

Dear Fabio,

> Are you able to reproduce this issue with a 5.4.1 kernel? 

Sorry, I can test currently only with 5.1.1.

Best wishes.

--

Igor Plyatov


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Issue with imx_get_temp()
       [not found] <de442143-568d-5fbf-ed0c-d169e33e5d66@gmail.com>
@ 2019-12-02 13:49 ` Fabio Estevam
  2019-12-03 14:34   ` Igor Plyatov
  0 siblings, 1 reply; 9+ messages in thread
From: Fabio Estevam @ 2019-12-02 13:49 UTC (permalink / raw)
  To: Igor Plyatov
  Cc: Zhang Rui, Eduardo Valentin, Daniel Lezcano, Amit Kucheria,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, NXP Linux Team,
	linux-pm,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	linux-kernel

Hi Igor,

On Mon, Dec 2, 2019 at 10:44 AM Igor Plyatov <plyatov@gmail.com> wrote:
>
> Dear all,
>
> please  look at back-trace below. It happens on Freescale i.MX6 Quad.
>
> Found a few of those during power on/off stress test in the climate chamber:
>
> [    0.657596] ------------[ cut here ]------------
> [    0.657626] WARNING: CPU: 3 PID: 150 at /home/geosig/development/oe-core-toradex-cr7/build/tmp-glibc/work-shared/cr7/kernel-source/kernel/irq/chip.c:242 __irq_startup+0x94/0xa8
> [    0.657630] Modules linked in:
> [    0.657643] CPU: 3 PID: 150 Comm: kworker/3:1 Not tainted 5.1.1 #1

Are you able to reproduce this issue with a 5.4.1 kernel?

Thanks

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-01-09 12:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-02 13:45 Issue with imx_get_temp() Igor Plyatov
2019-12-03 10:15 ` Marco Felsch
2019-12-03 12:04   ` Fabio Estevam
2019-12-03 13:13     ` Fabio Estevam
2019-12-03 14:36       ` Igor Plyatov
2019-12-10 12:19         ` Fabio Estevam
2020-01-09 12:17         ` Fabio Estevam
     [not found] <de442143-568d-5fbf-ed0c-d169e33e5d66@gmail.com>
2019-12-02 13:49 ` Fabio Estevam
2019-12-03 14:34   ` Igor Plyatov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).