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: <05e3ff33-ad4e-d2fb-dfd5-7b5265881b74@linaro.org>
Date:   Sat, 17 Jun 2023 16:43:10 +0200
From:   Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To:     Sergio Paracuellos <sergio.paracuellos@...il.com>
Cc:     Shiji Yang <yangshiji66@...look.com>, arinc.unal@...nc9.com,
        devicetree@...r.kernel.org, john@...ozen.org,
        krzysztof.kozlowski+dt@...aro.org, linux-clk@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-mips@...r.kernel.org,
        matthias.bgg@...il.com, mturquette@...libre.com,
        p.zabel@...gutronix.de, robh+dt@...nel.org, sboyd@...nel.org,
        tsbogend@...ha.franken.de
Subject: Re: [PATCH v3 2/9] clk: ralink: add clock and reset driver for MTMIPS
 SoCs

On 17/06/2023 15:31, Sergio Paracuellos wrote:
> Hi Krzysztof,
> 
> On Sat, Jun 17, 2023 at 3:07 PM Krzysztof Kozlowski
> <krzysztof.kozlowski@...aro.org> wrote:
>>
>> On 17/06/2023 14:54, Shiji Yang wrote:
>>>> void __init plat_time_init(void)
>>>> {
>>>> +    struct of_phandle_args clkspec;
>>>>      struct clk *clk;
>>>> +    int cpu_clk_idx;
>>>>
>>>>      ralink_of_remap();
>>>>
>>>> -    ralink_clk_init();
>>>> -    clk = clk_get_sys("cpu", NULL);
>>>> +    cpu_clk_idx = clk_cpu_index();
>>>> +    if (cpu_clk_idx == -1)
>>>> +            panic("unable to get CPU clock index");
>>>> +
>>>> +    of_clk_init(NULL);
>>>> +    clkspec.np = of_find_node_by_name(NULL, "sysc");
>>>
>>> The node name should be "syscon" as the example node name in the
>>> dt-bindings document is "syscon".
>>
>> NAK for both.
>>
>> Node names must not be an ABI, unless you talk about child of some
>> device node. I don't think this is the case here. Look by phandle (for a
>> device context) or by compatible (looks the case here).
> 
> We need to get the cpu clock to set the initial cpu clock here. Search
> by 'sysc' is the only  shared in all the dtsi files since it is the
> clock provider node. Why is this not correct?

Because device node name can change anytime and your entire Linux driver
gets broken. Node name is not an ABI.

> I don't understand what
> you mean with look by phandle for a device context. 

Your device node should contain phandle to the other node.

> The case of
> searching for compatible is a mess since as you can see in the
> bindings there are tons of compatibles to search for, then (this code
> is common to all ralink platforms).

Compatible is one of the ways using ABI.

Best regards,
Krzysztof

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ