From: Sascha Hauer <s.hauer@pengutronix.de>
To: Andreas Schmidt <mail@schmidt-andreas.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] net: cpsw: fix probe with fixed-link
Date: Fri, 16 Feb 2018 08:42:16 +0100 [thread overview]
Message-ID: <20180216074216.i47f5pswnhiayowe@pengutronix.de> (raw)
In-Reply-To: <20180213214816.28520-1-mail@schmidt-andreas.de>
Hi Andreas,
On Tue, Feb 13, 2018 at 10:48:16PM +0100, Andreas Schmidt wrote:
> If cpsw slave is set to fixed-link cpsw probe still try to probe and use
> a phy. This patch fix cpsw probe in case of fixed-link.
>
> Signed-off-by: Andreas Schmidt <mail@schmidt-andreas.de>
> ---
> drivers/net/cpsw.c | 41 +++++++++++++++++++++++++++--------------
> 1 file changed, 27 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
> index d11ca33f7..37e480248 100644
> --- a/drivers/net/cpsw.c
> +++ b/drivers/net/cpsw.c
> @@ -184,6 +184,7 @@ struct cpsw_slave {
> struct eth_device edev;
> struct cpsw_priv *cpsw;
> struct device_d dev;
> + int fixed_link;
> };
>
> struct cpdma_desc {
> @@ -913,18 +914,20 @@ static int cpsw_slave_setup(struct cpsw_slave *slave, int slave_num,
> struct eth_device *edev = &slave->edev;
> struct device_d *dev = &slave->dev;
> int ret;
> - struct phy_device *phy;
> + struct phy_device *phy = NULL;
>
> - phy = mdiobus_scan(&priv->miibus, priv->slaves[slave_num].phy_id);
> - if (IS_ERR(phy)) {
> - ret = PTR_ERR(phy);
> - goto err_out;
> - }
> + if (!slave->fixed_link) {
> + phy = mdiobus_scan(&priv->miibus, priv->slaves[slave_num].phy_id);
> + if (IS_ERR(phy)) {
> + ret = PTR_ERR(phy);
> + goto err_out;
> + }
Calling mdiobus_scan() here is not only wrong for a fixed phy, it is
wrong for a regular mdiobus phy aswell. I just sent out a patch which
just removes the call to mdiobus_scan(). Tested on a beaglebone which
has a real phy, it should work for you aswell.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2018-02-16 7:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-13 21:48 Andreas Schmidt
2018-02-16 7:42 ` Sascha Hauer [this message]
2018-02-22 22:16 ` [PATCH v2] " Andreas Schmidt
2018-02-27 8:41 ` Sascha Hauer
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=20180216074216.i47f5pswnhiayowe@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=mail@schmidt-andreas.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox