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: <bc3e3595-fe10-c7ae-9560-0c7676facba2@gmail.com>
Date:   Thu, 17 Jun 2021 17:46:33 +0300
From:   Dmitry Osipenko <digetx@...il.com>
To:     Guenter Roeck <linux@...ck-us.net>
Cc:     Jean Delvare <jdelvare@...e.com>, linux-kernel@...r.kernel.org,
        linux-hwmon@...r.kernel.org
Subject: Re: [PATCH v1] hwmon: (lm90) Use edge-triggered interrupt

17.06.2021 17:13, Guenter Roeck пишет:
...
>> This is a device-tree based system, in particular it's NVIDIA Tegra30
>> Nexus 7. The interrupt support was originally added to the lm90 driver
>> by Wei Ni who works at NVIDIA and did it for the Tegra boards. The Tegra
>> device-trees are specifying the trigger mask and apparently they all are
>> cargo-culted and wrong because they use IRQ_TYPE_LEVEL_HIGH, while it
> 
> Be fair, no one is perfect.

This is a very minor problem, so no wonder that nobody noticed or
bothered to fix it yet. I'm just clarifying the status here.

>> should be IRQ_TYPE_EDGE_FALLING.
> 
> It should probably be both IRQ_TYPE_EDGE_FALLING and IRQ_TYPE_EDGE_RISING,

For now I see that the rising edge isn't needed, the TEMP_ALERT goes
HIGH by itself when temperature backs to normal. But I will try to
double check.

> and the interrupt handler should call hwmon_notify_event() instead of
> clogging the kernel log, but that should be done in a separate patch.

Thank you for suggestion, I will take a look.

> Anyway, the tegra30 dts files in the upstream kernel either use
> IRQ_TYPE_LEVEL_LOW or no interrupts for nct1008. The Nexus 7 dts file
> in the upstream kernel has no interrupt configured (and coincidentally
> it was you who added that entry). Where do you see IRQ_TYPE_LEVEL_HIGH ?

I have a patch that will add the interrupt property, it's stashed
locally for the next kernel release.

IIUC, it's not only the Tegra30 dts, but all the TegraXXX boards that
use IRQ_TYPE_LEVEL_LOW are in the same position.

>> The IRQF flag in devm_request_threaded_irq() overrides the trigger mask
>> specified in a device-tree. IIUC, the interrupt is used only by OF-based
>> devices, hence I think we could simply remove the IRQF flag from the
>> code and fix the device-trees. Does it sound good to you?
> 
> Yes, that is a better approach.

Thank you for reviewing this patch. I'll prepare v2.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ