All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jon Hunter <jonathanh@nvidia.com>
To: Guenter Roeck <linux@roeck-us.net>,
	Dmitry Osipenko <digetx@gmail.com>,
	Jean Delvare <jdelvare@suse.com>
Cc: linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org,
	linux-tegra@vger.kernel.org
Subject: Re: [PATCH v3 2/4] hwmon: (lm90) Use hwmon_notify_event()
Date: Mon, 21 Feb 2022 15:49:16 +0000	[thread overview]
Message-ID: <84ddad27-eb22-0ba6-594f-2fc6d098dc2a@nvidia.com> (raw)
In-Reply-To: <2aae3bac-c9b3-ab47-aae4-a3c7b6fb4bb5@roeck-us.net>


On 21/02/2022 15:43, Guenter Roeck wrote:

...

>> We observed a random null pointer deference crash somewhere in the
>> thermal core (crash log below is not very helpful) when calling
>> mutex_lock(). It looks like we get an interrupt when this crash
>> happens.
>>
>> Looking at the lm90 driver, per the above, I now see we are calling
>> hwmon_notify_event() from the lm90 interrupt handler. Looking at
>> hwmon_notify_event() I see that ...
>>
>> hwmon_notify_event()
>>    --> hwmon_thermal_notify()
>>      --> thermal_zone_device_update()
>>        --> update_temperature()
>>          --> mutex_lock()
>>
>> So although I don't completely understand the crash, it does seem
>> that we should not be calling hwmon_notify_event() from the
>> interrupt handler.
>>
> As mentioned separately, this is not the problem.

Yes I can see that now.

> I think the problem may be that this is not a devicetree system
> (or the lm90 devide does not have a devicetree node), but thermal
> notification currently only works in such systems because the hwmon
> subsystem uses the devicetree registration method. At the same time,
> CONFIG_THERMAL_OF is obviously enabled. Unfortunately, the hwmon code
> does not bail out in that situation due to another bug.

The platform I see this on does use device-tree and it does have a node 
for the ti,tmp451 device which uses the lm90 device. This platform uses 
the device-tree source 
arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts and the tmp451 node 
is in arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi.

Cheers
Jon

-- 
nvpublic

  reply	other threads:[~2022-02-21 15:49 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-18 21:54 [PATCH v3 0/4] HWMON LM90 interrupt fixes and improvements Dmitry Osipenko
2021-06-18 21:54 ` [PATCH v3 1/4] hwmon: (lm90) Don't override interrupt trigger type Dmitry Osipenko
2021-06-18 21:54 ` [PATCH v3 2/4] hwmon: (lm90) Use hwmon_notify_event() Dmitry Osipenko
2022-02-21 12:01   ` Jon Hunter
2022-02-21 12:36     ` Dmitry Osipenko
2022-02-21 12:56       ` Jon Hunter
2022-02-21 12:59         ` Dmitry Osipenko
2022-02-21 13:50           ` Jon Hunter
2022-02-21 13:59             ` Dmitry Osipenko
2022-02-21 15:25           ` Guenter Roeck
2022-02-21 15:43     ` Guenter Roeck
2022-02-21 15:49       ` Jon Hunter [this message]
2022-02-21 16:02         ` Guenter Roeck
2022-02-21 16:13           ` Dmitry Osipenko
2022-02-21 16:16           ` Jon Hunter
2022-02-21 16:20             ` Dmitry Osipenko
2022-02-21 16:42               ` Guenter Roeck
2022-02-21 16:22             ` Jon Hunter
2022-02-21 18:38               ` Guenter Roeck
2022-02-21 16:23             ` Guenter Roeck
2021-06-18 21:54 ` [PATCH v3 3/4] hwmon: (lm90) Unmask hardware interrupt Dmitry Osipenko
2021-06-18 21:54 ` [PATCH v3 4/4] hwmon: (lm90) Disable interrupt on suspend Dmitry Osipenko
2021-06-19 11:10 ` [PATCH v3 0/4] HWMON LM90 interrupt fixes and improvements Guenter Roeck

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=84ddad27-eb22-0ba6-594f-2fc6d098dc2a@nvidia.com \
    --to=jonathanh@nvidia.com \
    --cc=digetx@gmail.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.