From: "Clément Leger" <cleger@kalray.eu>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH] phy: call adjust_link in attach if using fixed-link
Date: Mon, 15 Oct 2018 17:00:04 +0200 (CEST) [thread overview]
Message-ID: <1034587066.7904413.1539615604832.JavaMail.zimbra@kalray.eu> (raw)
Normally, phy_update_status is in charge of reporting a change in link
status when phy is updated. When using fixed-link, speed and duplex are
initialized directly after registering the phy and there is no driver.
Hence when phy_update_status is called, the check for new values fails
and returns directly. Since update_link call is mandatory for some
network devices to work, call it directly when using fixed link in
phy_device_attach to force update of link.
Signed-off-by: Clement Leger <clement.leger@kalray.eu>
---
drivers/net/phy/phy.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 42dcad906..63f249fcf 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -398,6 +398,10 @@ static int phy_device_attach(struct phy_device *phy, struct eth_device *edev,
phy->adjust_link = adjust_link;
+ /* If the phy is a fixed-link, then call adjust_link directly */
+ if (!phy->bus && adjust_link)
+ adjust_link(edev);
+
return 0;
}
--
2.15.0.276.g89ea799
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next reply other threads:[~2018-10-15 15:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-15 15:00 Clément Leger [this message]
2018-10-16 6:56 ` 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=1034587066.7904413.1539615604832.JavaMail.zimbra@kalray.eu \
--to=cleger@kalray.eu \
--cc=barebox@lists.infradead.org \
/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