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: <c11194fb-0449-4b36-adf1-c15d7a66344d@blaize.com>
Date: Wed, 24 Apr 2024 17:14:18 +0100
From: Nikolaos Pasaloukos <nikolaos.pasaloukos@...ize.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
        "linux-arm-kernel@...ts.infradead.org"
 <linux-arm-kernel@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Cc: James Cowgill <james.cowgill@...ize.com>,
        Matt Redfearn <matthew.redfearn@...ize.com>,
        Neil Jones <neil.jones@...ize.com>,
        Michael Turquette <mturquette@...libre.com>,
        Stephen Boyd
 <sboyd@...nel.org>, Rob Herring <robh@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Conor Dooley <conor+dt@...nel.org>,
        "linux-clk@...r.kernel.org" <linux-clk@...r.kernel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>
Subject: Re: [PATCH v2 4/7] dt-bindings: clock: Add binding constants for
 BLZP1600

On 24/04/2024 15:13, Krzysztof Kozlowski wrote:
> On 24/04/2024 15:32, Niko Pasaloukos wrote:
>> Add SCMI clock numbers according to the Blaize BLZP1600
>> SoC hardware specifications.
>>
>> Reviewed-by: James Cowgill <james.cowgill@...ize.com>
>> Reviewed-by: Matt Redfearn <matt.redfearn@...ize.com>
>> Reviewed-by: Neil Jones <neil.jones@...ize.com>
>> Signed-off-by: Nikolaos Pasaloukos <nikolaos.pasaloukos@...ize.com>
> This goes to the patch introducing binding doc.

Apologies for the broken threading.

>
>> ---
>>  .../dt-bindings/clock/blaize,blzp1600-clk.h   | 77 +++++++++++++++++++
>>  1 file changed, 77 insertions(+)
>>  create mode 100644 include/dt-bindings/clock/blaize,blzp1600-clk.h
>>
>> diff --git a/include/dt-bindings/clock/blaize,blzp1600-clk.h b/include/dt-bindings/clock/blaize,blzp1600-clk.h
>> new file mode 100644
>> index 000000000000..f1d59849a6e5
>> --- /dev/null
>> +++ b/include/dt-bindings/clock/blaize,blzp1600-clk.h
>> @@ -0,0 +1,77 @@
>> +/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
>> +/*
>> + * Copyright (C) 2023, Blaize, Inc.
>> + */
>> +
>> +#ifndef DT_BINDING_CLK_BLZP1600_H
>> +#define DT_BINDING_CLK_BLZP1600_H
>> +
>> +/* ARM SCMI clocks */
>> +
>> +/* BLZP1600 clock-gate numbers as defined in the hardware architecture */
>> +
>> +#define BLZP1600_CPU_CLK 0
>> +/* clock-gates 1-6 invalid */
> No, they cannot be invalid. IDs start from 0 and are incremented by one.
> If you have holes, it is not a binding.
>
> Drop the header or use it properly, so as virtual IDs.
>
> Best regards,
> Krzysztof
>
My intention was to avoid using magic numbers on the DeviceTree. That's why I added them here.
Also, we have some custom drivers which we plan to upload and their schemas need those files.
The alternative would be to use magic numbers for our clocks and resets.

In the commit message and on the header file I have mentioned that these are numbers matching
the hardware specification (1 to 1) of the chip not just enums.
Some IDs are invalid because of a hardware gap, some others are invalid because the SCMI
service will return an error that the number is invalid.

Is there another way to prevent the magic numbers in the schemas and device-tree.

Thank you very much for your fast and detailed review.

Best regards,
Niko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ