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@xxxxxxxxxxx> > > > > --- > > > > .../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