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: <47733364-82b5-4052-9bb9-7631668c98a0@roeck-us.net>
Date:   Fri, 10 Nov 2023 07:13:01 -0800
From:   Guenter Roeck <linux@...ck-us.net>
To:     AngeloGioacchino Del Regno 
        <angelogioacchino.delregno@...labora.com>,
        Daniel Golle <daniel@...rotopia.org>,
        Wim Van Sebroeck <wim@...ux-watchdog.org>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Conor Dooley <conor+dt@...nel.org>,
        Matthias Brugger <matthias.bgg@...il.com>,
        Philipp Zabel <p.zabel@...gutronix.de>,
        linux-watchdog@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH 2/2] watchdog: mediatek: mt7988: add wdt support

On 11/10/23 03:55, AngeloGioacchino Del Regno wrote:
> Il 10/11/23 01:30, Daniel Golle ha scritto:
>> Add support for watchdog and reset generator unit of the MediaTek
>> MT7988 SoC.
>>
>> Signed-off-by: Daniel Golle <daniel@...rotopia.org>
>> ---
>>   drivers/watchdog/mtk_wdt.c | 56 +++++++++++++++++++++++++++++++++++++-
>>   1 file changed, 55 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/watchdog/mtk_wdt.c b/drivers/watchdog/mtk_wdt.c
>> index b2330b16b497a..b98b8c29735aa 100644
>> --- a/drivers/watchdog/mtk_wdt.c
>> +++ b/drivers/watchdog/mtk_wdt.c
>> @@ -12,6 +12,7 @@
>>   #include <dt-bindings/reset/mt2712-resets.h>
>>   #include <dt-bindings/reset/mediatek,mt6795-resets.h>
>>   #include <dt-bindings/reset/mt7986-resets.h>
>> +#include <dt-bindings/reset/mediatek,mt7988-resets.h>
>>   #include <dt-bindings/reset/mt8183-resets.h>
>>   #include <dt-bindings/reset/mt8186-resets.h>
>>   #include <dt-bindings/reset/mt8188-resets.h>
>> @@ -58,6 +59,8 @@
>>   #define WDT_SWSYSRST        0x18U
>>   #define WDT_SWSYS_RST_KEY    0x88000000
>> +#define WDT_SWSYSRST_EN        0xfc
>> +
>>   #define DRV_NAME        "mtk-wdt"
>>   #define DRV_VERSION        "1.0"
>> @@ -71,44 +74,85 @@ struct mtk_wdt_dev {
>>       struct reset_controller_dev rcdev;
>>       bool disable_wdt_extrst;
>>       bool reset_by_toprgu;
>> +    bool has_swsysrst_en;
> 
> mtk_wdt_data is always a const and this has_swsysrst_en member is never supposed
> to change during runtime.
> 
> At this point, just add a pointer to struct mtk_wdt_data in mtk_wdt_dev, then
> instead of mtk_wdt->has_swsysrst_en you check mtk_wdt->pdata->has_swsysrst_en.
> 

Oh, I don't know. Personally I dislike having to execute double dereferences
at runtime. I tend to accept it because people seem to like it, but I really
don't see the point.

Guenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ