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: <20200924052501.jk6o2w4ks2g4gfbq@skbuf>
Date:   Thu, 24 Sep 2020 05:25:03 +0000
From:   Ioana Ciornei <ioana.ciornei@....com>
To:     Andrew Lunn <andrew@...n.ch>
CC:     "davem@...emloft.net" <davem@...emloft.net>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux@...linux.org.uk" <linux@...linux.org.uk>
Subject: Re: [PATCH net-next v2 3/3] dpaa2-mac: add PCS support through the
 Lynx module

On Thu, Sep 24, 2020 at 03:10:51AM +0200, Andrew Lunn wrote:
> > +static int dpaa2_pcs_create(struct dpaa2_mac *mac,
> > +			    struct device_node *dpmac_node, int id)
> > +{
> > +	struct mdio_device *mdiodev;
> > +	struct device_node *node;
> > +
> > +	node = of_parse_phandle(dpmac_node, "pcs-handle", 0);
> > +	if (!node) {
> > +		/* do not error out on old DTS files */
> > +		netdev_warn(mac->net_dev, "pcs-handle node not found\n");
> > +		return 0;
> > +	}
> > +
> > +	if (!of_device_is_available(node) ||
> > +	    !of_device_is_available(node->parent)) {
> > +		netdev_err(mac->net_dev, "pcs-handle node not available\n");
> > +		return -ENODEV;
> > +	}
> 
> Can a child be available when its parent is not? I've no idea!
> 

One can definitely try and enable the child node from DTS while keeping
the parent disabled but what seems to be the outcome is that the
disabled state will trickle down from the parent node to all child
nodes.
This check is just a little more cautious than absolutely necessary.

Ioana

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ