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]
Date:   Thu, 25 Jun 2020 15:16:06 +0530
From:   Calvin Johnson <calvin.johnson@....nxp.com>
To:     Ioana Ciornei <ioana.ciornei@....com>
Cc:     Jeremy Linton <jeremy.linton@....com>,
        Russell King - ARM Linux admin <linux@...linux.org.uk>,
        Jon <jon@...id-run.com>,
        Cristi Sovaiala <cristian.sovaiala@....com>,
        Andrew Lunn <andrew@...n.ch>,
        Andy Shevchenko <andy.shevchenko@...il.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        "Madalin Bucur (OSS)" <madalin.bucur@....nxp.com>,
        "linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
        "linux.cj@...il.com" <linux.cj@...il.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [net-next PATCH v1] net: dpaa2-mac: Add ACPI support for DPAA2
 MAC driver

Hi Ioana,

On Thu, Jun 25, 2020 at 07:59:19AM +0000, Ioana Ciornei wrote:
> > Subject: [net-next PATCH v1] net: dpaa2-mac: Add ACPI support for DPAA2 MAC
> > driver
> > 
> > Modify dpaa2_mac_connect() to support ACPI along with DT.
> > Modify dpaa2_mac_get_node() to get the dpmac fwnode from either DT or
> > ACPI.
> > Replace of_get_phy_mode() with fwnode_get_phy_mode() to get phy-mode for
> > a dpmac_node.
> > Define and use helper function dpaa2_find_phy_device() to find phy_dev that is
> > later connected to mac->phylink.
> > 
> > Signed-off-by: Calvin Johnson <calvin.johnson@....nxp.com>
> > 
> > ---
> > 
> >  .../net/ethernet/freescale/dpaa2/dpaa2-mac.c  | 114 +++++++++++++-----
> >  1 file changed, 86 insertions(+), 28 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
> > b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
> > index 3ee236c5fc37..163da735ab29 100644
> > --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
> > +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
> > @@ -3,6 +3,8 @@
> > 
> >  #include "dpaa2-eth.h"
> >  #include "dpaa2-mac.h"
> > +#include <linux/acpi.h>
> > +#include <linux/platform_device.h>
> > 
> >  #define phylink_to_dpaa2_mac(config) \
> >  	container_of((config), struct dpaa2_mac, phylink_config) @@ -23,38
> > +25,54 @@ static int phy_mode(enum dpmac_eth_if eth_if, phy_interface_t
> > *if_mode)  }
> > 
> >  /* Caller must call of_node_put on the returned value */ -static struct
> > device_node *dpaa2_mac_get_node(u16 dpmac_id)
> > +static struct fwnode_handle *dpaa2_mac_get_node(struct device *dev,
> > +						u16 dpmac_id)
> >  {
> > -	struct device_node *dpmacs, *dpmac = NULL;
> > -	u32 id;
> > +	struct fwnode_handle *dpmacs, *dpmac = NULL;
> > +	unsigned long long adr;
> > +	acpi_status status;
> >  	int err;
> > +	u32 id;
> > 
> > -	dpmacs = of_find_node_by_name(NULL, "dpmacs");
> > -	if (!dpmacs)
> > -		return NULL;
> > +	if (is_of_node(dev->parent->fwnode)) {
> > +		dpmacs = device_get_named_child_node(dev->parent,
> > "dpmacs");
> > +		if (!dpmacs)
> > +			return NULL;
> 
> 
> Hi Calvin,
> 
> Unfortunately, this is breaking the OF use case.
> 
> [    4.236045] fsl_dpaa2_eth dpni.0 (unnamed net_device) (uninitialized): No dpmac@17 node found.              
> [    4.245646] fsl_dpaa2_eth dpni.0 (unnamed net_device) (uninitialized): Error connecting to the MAC endpoint 
> [    4.331921] fsl_dpaa2_eth dpni.0: fsl_mc_driver_probe failed: -19                                           
> 
> You replaced of_find_node_by_name() which searches the entire DTS
> file (hence the NULL first parameter) with device_get_named_child_node(dev->parent, ..)
> which only searches starting with the dev->parent device. In this case, the
> parent device is dprc.1 (the root container) which is not probing on the
> device tree so the associated fwnode_handle is NULL.

I had tested with UEFI+net-next tree and didn't encounter any such issue. Let
me see how to resolve this.

Thanks
Calvin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ