mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yaohan Li <shunsheng1218@gmail.com>
To: "Niklas Söderlund" <niklas.soderlund@ragnatech.se>
Cc: Rafael J. Wysocki <rafael@kernel.org>,
	Daniel Lezcano <daniel.lezcano@kernel.org>,
	Zhang Rui <rui.zhang@intel.com>,
	Lukasz Luba <lukasz.luba@arm.com>,
	Magnus Damm <magnus.damm@gmail.com>,
	linux-renesas-soc@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Eduardo Valentin <edubezval@gmail.com>
Subject: Re: [PATCH v3] thermal/drivers/rcar_thermal: disable the work before masking the interrupt
Date: Wed, 25 Nov 2026 11:03:17 +0800	[thread overview]
Message-ID: <179557579759.953320.4240333903133893045@gmail.com> (raw)
In-Reply-To: <20261124132521.GJ3898744@ragnatech.se>

Hi Niklas,

Thanks for reviewing this.

The devm_free_irq() calls are intended to protect the lifetime of the
sensor objects, rather than only to wait for an in-flight handler.

The driver requests its shared IRQs before allocating the individual
sensor priv objects.  Because devres releases resources in reverse
order, those objects can be freed before the managed IRQ handlers are
released.

Even after the thermal interrupt sources are masked, another device
sharing the IRQ line can trigger rcar_thermal_irq().  The handler still
walks common->head and calls rcar_thermal_had_changed() for each sensor,
even when the masked status is zero.

Therefore, synchronize_irq() would wait for the current handler, but
would not prevent a later invocation from accessing the freed sensor
objects.

devm_free_irq() removes this driver's handler before the sensor objects
can be freed, while leaving other users of the shared IRQ intact.

I agree that the commit message should distinguish this lifetime issue
from the delayed-work race more clearly.

Thanks,
Yaohan

      reply	other threads:[~2026-11-25  3:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18  7:23 [PATCH] thermal/drivers/rcar_thermal: wait for IRQs before cancelling work Yaohan Li
2026-11-18  9:00 ` Niklas Söderlund
2026-11-19  2:29 ` [PATCH v2] thermal/drivers/rcar_thermal: disable the work before masking the interrupt Yaohan Li
2026-11-19  6:22   ` Niklas Söderlund
2026-11-19 11:18     ` Yaohan Li
2026-11-19 16:25       ` Niklas Söderlund
2026-11-20  4:27         ` Yaohan Li
2026-11-20  7:30           ` Niklas Söderlund
2026-11-20  9:43             ` Yaohan Li
2026-11-22 14:09               ` Niklas Söderlund
2026-11-23  2:21                 ` Yaohan Li
2026-11-23  6:38                   ` Niklas Söderlund
2026-11-24  2:22   ` [PATCH v3] " Yaohan Li
2026-11-24 13:25     ` Niklas Söderlund
2026-11-25  3:03       ` Yaohan Li [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179557579759.953320.4240333903133893045@gmail.com \
    --to=shunsheng1218@gmail.com \
    --cc=daniel.lezcano@kernel.org \
    --cc=edubezval@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=magnus.damm@gmail.com \
    --cc=niklas.soderlund@ragnatech.se \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®