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-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdVCCrKTpNHng2_kKGViuEXf=O3MsfpjjzMusuUcKE6HiA@mail.gmail.com>
Date:   Mon, 23 May 2022 16:22:12 +0200
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Tomer Maimon <tmaimon77@...il.com>
Cc:     Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
        Avi Fishman <avifishman70@...il.com>,
        Tali Perry <tali.perry1@...il.com>,
        Joel Stanley <joel@....id.au>,
        Patrick Venture <venture@...gle.com>,
        Nancy Yuen <yuenn@...gle.com>,
        Benjamin Fair <benjaminfair@...gle.com>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Michael Turquette <mturquette@...libre.com>,
        Stephen Boyd <sboyd@...nel.org>,
        Philipp Zabel <p.zabel@...gutronix.de>,
        Greg KH <gregkh@...uxfoundation.org>,
        Daniel Lezcano <daniel.lezcano@...aro.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Wim Van Sebroeck <wim@...ux-watchdog.org>,
        Guenter Roeck <linux@...ck-us.net>,
        Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will@...nel.org>, Arnd Bergmann <arnd@...db.de>,
        Olof Johansson <olof@...om.net>,
        Jiri Slaby <jirislaby@...nel.org>,
        Shawn Guo <shawnguo@...nel.org>,
        Björn Andersson <bjorn.andersson@...aro.org>,
        Geert Uytterhoeven <geert+renesas@...der.be>,
        Marcel Ziswiler <marcel.ziswiler@...adex.com>,
        Vinod Koul <vkoul@...nel.org>,
        Biju Das <biju.das.jz@...renesas.com>,
        Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@...hiba.co.jp>,
        Robert Hancock <robert.hancock@...ian.com>,
        Jonathan Neuschäfer <j.neuschaefer@....net>,
        Lubomir Rintel <lkundrak@...sk>, arm-soc <soc@...nel.org>,
        devicetree <devicetree@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-clk <linux-clk@...r.kernel.org>,
        "open list:SERIAL DRIVERS" <linux-serial@...r.kernel.org>,
        Linux Watchdog Mailing List <linux-watchdog@...r.kernel.org>,
        Linux ARM <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH v1 11/19] dt-bindings: reset: npcm: Add support for NPCM8XX

Hi Tomer,

On Mon, May 23, 2022 at 4:03 PM Tomer Maimon <tmaimon77@...il.com> wrote:
> On Mon, 23 May 2022 at 12:01, Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org> wrote:
>> On 22/05/2022 17:50, Tomer Maimon wrote:
>> > Add binding document and device tree binding
>> > constants for Nuvoton BMC NPCM8XX reset controller.
>> >
>> > Signed-off-by: Tomer Maimon <tmaimon77@...il.com>

>> > --- /dev/null
>> > +++ b/include/dt-bindings/reset/nuvoton,npcm8xx-reset.h
>> > @@ -0,0 +1,124 @@
>> > +/* SPDX-License-Identifier: GPL-2.0 */
>> > +// Copyright (c) 2022 Nuvoton Technology corporation.
>> > +
>> > +#ifndef _DT_BINDINGS_NPCM8XX_RESET_H
>> > +#define _DT_BINDINGS_NPCM8XX_RESET_H
>> > +
>> > +#define NPCM8XX_RESET_IPSRST1                0x20
>> > +#define NPCM8XX_RESET_IPSRST2                0x24
>> > +#define NPCM8XX_RESET_IPSRST3                0x34
>> > +#define NPCM8XX_RESET_IPSRST4                0x74
>>
>> What are these? All IDs should be incremental, decimal and start from 0.
>
> Register offset, we use the same method in NPCM7xx. please refer
> https://elixir.bootlin.com/linux/v5.18/source/include/dt-bindings/reset/nuvoton,npcm7xx-reset.h
>
> and the driver asserts the reset according to the reset include definitions

So if they're easy to look up the values, you could do without the
definitions? Cfr. the interrupts properties in .dtsi files, where we
typically just use the hardcoded numbers.

If you do decide to keep them, a comment explaining their origins
would be useful.

>> > +
>> > +/* Reset lines on IP1 reset module (NPCM8XX_RESET_IPSRST1) */
>> > +#define NPCM8XX_RESET_GDMA0          3
>>
>> IDs start from 0 and do not have holes.
>
> This represents the reset BIT in the reset register.

Likewise, I think it's a good idea to document that in a comment, cfr.
https://elixir.bootlin.com/linux/v5.18/source/include/dt-bindings/power/r8a7795-sysc.h#L8

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ