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] [day] [month] [year] [list]
Message-ID: <85a2e5a3-1872-d1db-5eb7-0f02265220a3@lucaceresoli.net>
Date:   Tue, 25 Feb 2020 17:44:22 +0100
From:   Luca Ceresoli <luca@...aceresoli.net>
To:     Geert Uytterhoeven <geert@...ux-m68k.org>
Cc:     "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
        <devicetree@...r.kernel.org>,
        Pantelis Antoniou <pantelis.antoniou@...sulko.com>,
        Frank Rowand <frowand.list@...il.com>,
        Rob Herring <robh+dt@...nel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [DT-OVERLAY PATCH] of: overlay: print the offending node name on
 fixup failure

Hi Geert,

thanks for the very prompt review!

On 25/02/20 12:10, Geert Uytterhoeven wrote:
> Hi Luca,
> 
> On Tue, Feb 25, 2020 at 11:42 AM Luca Ceresoli <luca@...aceresoli.net> wrote:
>> When a DT overlay has a fixup node that is not present in the base DT
>> __symbols__, this error is printed:
>>
>>   OF: resolver: overlay phandle fixup failed: -22
>>   create_overlay: Failed to create overlay (err=-22)
>>
>> which does not help much in finding the node that caused the problem.
>>
>> Add a debug print with the name of the fixup node that caused the
>> error. The new output is:
>>
>>   OF: resolver: node gpio9 not found in base DT, fixup failed
>>   OF: resolver: overlay phandle fixup failed: -22
>>   create_overlay: Failed to create overlay (err=-22)
>>
>> Signed-off-by: Luca Ceresoli <luca@...aceresoli.net>
> 
> Thanks for your patch!
> 
> Tested-by: Geert Uytterhoeven <geert+renesas@...der.be>
> 
>> NOTE: this patch is not for mainline!
> 
> Why not?

Because I'm dumb. As I'm using the non-mainlined configfs interface I
tend to consider the entire overlay code as non-mainlined too. Sending
v2 without this comment.

>> --- a/drivers/of/resolver.c
>> +++ b/drivers/of/resolver.c
>> @@ -321,8 +321,11 @@ int of_resolve_phandles(struct device_node *overlay)
>>
>>                 err = of_property_read_string(tree_symbols,
>>                                 prop->name, &refpath);
>> -               if (err)
>> +               if (err) {
>> +                       pr_err("node %s not found in base DT, fixup failed",
>> +                              prop->name);
>>                         goto out;
>> +               }
>>
>>                 refnode = of_find_node_by_path(refpath);
>>                 if (!refnode) {
> 
> Probably you want to print a helpful message here, too?

I'm doing even more. In v2 I added a specific error message for each
error path that does not have one yet, and removed the generic message
at the end.

-- 
Luca

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ