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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220407141254.3kpg75l4byytwfye@skbuf>
Date:   Thu, 7 Apr 2022 14:12:55 +0000
From:   Vladimir Oltean <vladimir.oltean@....com>
To:     Michael Walle <michael@...le.cc>
CC:     Claudiu Manoil <claudiu.manoil@....com>,
        Alexandre Belloni <alexandre.belloni@...tlin.com>,
        Andrew Lunn <andrew@...n.ch>,
        Vivien Didelot <vivien.didelot@...il.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        "UNGLinuxDriver@...rochip.com" <UNGLinuxDriver@...rochip.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next] net: dsa: felix: suppress -EPROBE_DEFER errors

On Thu, Apr 07, 2022 at 04:04:20PM +0200, Michael Walle wrote:
> Am 2022-04-07 15:56, schrieb Vladimir Oltean:
> > On Thu, Apr 07, 2022 at 03:06:25PM +0200, Michael Walle wrote:
> > > Due to missing prerequisites the probe of the felix switch might be
> > > deferred:
> > > [    4.435305] mscc_felix 0000:00:00.5: Failed to register DSA
> > > switch: -517
> > > 
> > > It's not an error. Use dev_err_probe() to demote the error to a debug
> > > message. While at it, replace all the dev_err()'s in the probe with
> > > dev_err_probe().
> > > 
> > > Signed-off-by: Michael Walle <michael@...le.cc>
> > > ---
> > 
> > Please limit the dev_err_probe() to dsa_register_switch(). The resource
> > that is missing is the DSA master, see of_find_net_device_by_node().
> > The others cannot possibly return -EPROBE_DEFER.
> 
> This was my rationale (from the function doc):
> 
>  * Note that it is deemed acceptable to use this function for error
>  * prints during probe even if the @err is known to never be -EPROBE_DEFER.
>  * The benefit compared to a normal dev_err() is the standardized format
>  * of the error code and the fact that the error code is returned.
> 
> In any case I don't have a strong opinion.

Take this case:

 		err = -ENOMEM;
-		dev_err(&pdev->dev, "Failed to allocate driver memory\n");
+		dev_err_probe(&pdev->dev, err, "Failed to allocate driver memory\n");

(1) there is no need to print ENOMEM if we say "failed to allocate memory"
(2) we don't use the return value of dev_err_probe() anyway, we have
    actual teardown to do (pci_disable_device).
(3) we _surely_ know that -ENOMEM != -EPROBE_DEFER

> 
> > > 
> > > Should this be a patch with a Fixes tag?
> > 
> > Whichever way you wish, no preference.
> 
> I'll limit it to just the one dev_err() and add a Fixes,
> there might be scripts out there who greps dmesg for errors.

Ok.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ