All of lore.kernel.org
 help / color / mirror / Atom feed
From: Calvin Johnson <calvin.johnson@oss.nxp.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Jeremy Linton <jeremy.linton@arm.com>,
	Russell King - ARM Linux admin <linux@armlinux.org.uk>,
	Jon <jon@solid-run.com>,
	Cristi Sovaiala <cristian.sovaiala@nxp.com>,
	Ioana Ciornei <ioana.ciornei@nxp.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Madalin Bucur <madalin.bucur@oss.nxp.com>,
	linux-acpi@vger.kernel.org, linux.cj@gmail.com,
	netdev@vger.kernel.org,
	"Rajesh V. Bikkina" <rajesh.bikkina@nxp.com>
Subject: Re: [net-next PATCH v1] net: dpaa2-mac: Add ACPI support for DPAA2 MAC driver
Date: Fri, 26 Jun 2020 18:50:24 +0530	[thread overview]
Message-ID: <20200626132024.GA15707@lsv03152.swis.in-blr01.nxp.com> (raw)
In-Reply-To: <20200625194211.GA535869@lunn.ch>

On Thu, Jun 25, 2020 at 09:42:11PM +0200, Andrew Lunn wrote:
> On Thu, Jun 25, 2020 at 10:05:38AM +0530, Calvin Johnson wrote:
> 
> > +static struct phy_device *dpaa2_find_phy_device(struct fwnode_handle *fwnode)
> > +{
> > +	struct fwnode_reference_args args;
> > +	struct platform_device *pdev;
> > +	struct mii_bus *mdio;
> > +	struct device *dev;
> > +	acpi_status status;
> > +	int addr;
> > +	int err;
> > +
> > +	status = acpi_node_get_property_reference(fwnode, "mdio-handle",
> > +						  0, &args);
> > +
> > +	if (ACPI_FAILURE(status) || !is_acpi_device_node(args.fwnode))
> > +		return NULL;
> > +
> > +	dev = bus_find_device_by_fwnode(&platform_bus_type, args.fwnode);
> > +	if (IS_ERR_OR_NULL(dev))
> > +		return NULL;
> > +	pdev =  to_platform_device(dev);
> > +	mdio = platform_get_drvdata(pdev);
> > +
> > +	err = fwnode_property_read_u32(fwnode, "phy-channel", &addr);
> > +	if (err < 0 || addr < 0 || addr >= PHY_MAX_ADDR)
> > +		return NULL;
> > +
> > +	return mdiobus_get_phy(mdio, addr);
> > +}
> 
> Hi Calvin
> 
> I think this needs putting somewhere global, since you are effectively
> defines how all ACPI MACs will find their PHY. This becomes the
> defacto standard until the ACPI standards committee comes along and
> tells you, you are doing it wrong, it should be like....
> 
> Does Linux have a location to document all its defacto standard ACPI
> stuff? It would be good to document this somewhere.

Hi Andrew

As you know, making this code generic would bring us back to waiting for
ACPI team's approval which is very difficult to get as the ACPI doesn't
have any opinion on MDIO bus.

Like other ACPI ethernet drivers, can't we keep it local to this driver to
avoid the above issue?

I can add more documentation to this function itself.
If we plan to make this approach generic, then it may have to be put in:
Documentation/firmware-guide/acpi/

Please advice.

Thanks
Calvin

  reply	other threads:[~2020-06-26 13:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-25  4:35 [net-next PATCH v1] net: dpaa2-mac: Add ACPI support for DPAA2 MAC driver Calvin Johnson
2020-06-25  7:59 ` Ioana Ciornei
2020-06-25  9:46   ` Calvin Johnson
2020-06-25 11:05 ` kernel test robot
2020-06-25 11:05   ` kernel test robot
2020-06-25 19:29   ` Andy Shevchenko
2020-06-25 19:29     ` Andy Shevchenko
2020-06-29 11:40     ` Calvin Johnson
2020-06-25 19:42 ` Andrew Lunn
2020-06-26 13:20   ` Calvin Johnson [this message]
2020-06-26 13:39     ` Andrew Lunn
2020-06-26 14:02       ` Calvin Johnson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200626132024.GA15707@lsv03152.swis.in-blr01.nxp.com \
    --to=calvin.johnson@oss.nxp.com \
    --cc=andrew@lunn.ch \
    --cc=andy.shevchenko@gmail.com \
    --cc=cristian.sovaiala@nxp.com \
    --cc=f.fainelli@gmail.com \
    --cc=ioana.ciornei@nxp.com \
    --cc=jeremy.linton@arm.com \
    --cc=jon@solid-run.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux.cj@gmail.com \
    --cc=linux@armlinux.org.uk \
    --cc=madalin.bucur@oss.nxp.com \
    --cc=netdev@vger.kernel.org \
    --cc=rajesh.bikkina@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.