From: Troy Kisky <troy.kisky@boundarydevices.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 4/5] net: fec_mxc: Nove autonegoatiate restart after mii_postcall
Date: Fri, 13 Jan 2012 14:22:53 -0700 [thread overview]
Message-ID: <4F10A0AD.1060502@boundarydevices.com> (raw)
In-Reply-To: <4F103790.1010406@denx.de>
On 1/13/2012 6:54 AM, Stefano Babic wrote:
> On 13/01/2012 13:10, Dirk Behme wrote:
>> From: Troy Kisky<troy.kisky@boundarydevices.com>
>>
>> Allow boards to change what is advertised before an autoneg
>> restart happens.
>>
>> Signed-off-by: Troy Kisky<troy.kisky@boundarydevices.com>
>> CC: Troy Kisky<troy.kisky@boundarydevices.com>
>> CC: Stefano Babic<sbabic@denx.de>
>> CC: Marek Vasut<marek.vasut@gmail.com>
>> ---
>> drivers/net/fec_mxc.c | 6 +++---
>> 1 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
>> index b50e01c..6271df5 100644
>> --- a/drivers/net/fec_mxc.c
>> +++ b/drivers/net/fec_mxc.c
>> @@ -206,12 +206,12 @@ static int miiphy_restart_aneg(struct eth_device *dev)
>> miiphy_write(dev->name, fec->phy_id, MII_ADVERTISE,
>> LPA_100FULL | LPA_100HALF | LPA_10FULL |
>> LPA_10HALF | PHY_ANLPAR_PSB_802_3);
>> - miiphy_write(dev->name, fec->phy_id, MII_BMCR,
>> - BMCR_ANENABLE | BMCR_ANRESTART);
>> -
>> if (fec->mii_postcall)
>> ret = fec->mii_postcall(fec->phy_id);
>>
>> + miiphy_write(dev->name, fec->phy_id, MII_BMCR,
>> + BMCR_ANENABLE | BMCR_ANRESTART);
>> +
> ...but you change the postcall into a precall...
I assumed mii_postcall meant mii_post_init_call
not mii_post_aneg_call.
A rename of the function may be desired.
Perhaps we should let the mii_postcall function do the
miiphy_write(dev->name, fec->phy_id, MII_BMCR,
BMCR_ANENABLE | BMCR_ANRESTART);
as well.
>
> The current implementation is correct. Something is set / written , and
> after that a specific supplied function (if any) is called, then the
> name postcall.
>
> Changing the order is not correct if the fec->mii_postcall thinks (as it
> should be) that the MII_BMCR register was already written.
>
> But you missed to mention why you need such as change : which is the
> failure / bug you discovered ?
I wanted the sabrelite board to be able to remove 1000BaseT
advertisement before aneg starts.
I think it works either way, but is clearer this way and doesn't rely on
luck.
>
> Best regards,
> Stefano Babic
>
next prev parent reply other threads:[~2012-01-13 21:22 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-13 12:10 [U-Boot] [PATCH 1/5] net: fec_mxc: Add 1000 Mbps selection Dirk Behme
2012-01-13 12:10 ` [U-Boot] [PATCH 2/5] net: fec_mxc: Increase autonegotiation timeout Dirk Behme
2012-01-13 12:10 ` [U-Boot] [PATCH 3/5] miiphyutil: Add Micrel KSZ9021 support to miiphy_speed Dirk Behme
2012-01-13 12:44 ` Marek Vasut
2012-01-15 0:56 ` Mike Frysinger
2012-01-19 12:38 ` Dirk Behme
2012-01-19 16:19 ` Dirk Behme
2012-01-19 18:24 ` Mike Frysinger
2012-01-19 18:24 ` Mike Frysinger
2012-01-19 12:27 ` Dirk Behme
2012-01-13 12:10 ` [U-Boot] [PATCH 4/5] net: fec_mxc: Nove autonegoatiate restart after mii_postcall Dirk Behme
2012-01-13 12:44 ` Marek Vasut
2012-01-13 21:42 ` Troy Kisky
2012-01-13 13:54 ` Stefano Babic
2012-01-13 21:22 ` Troy Kisky [this message]
2012-01-13 12:10 ` [U-Boot] [PATCH 5/5] i.mx6q: mx6qsabrelite: Update the network configuration Dirk Behme
2012-01-16 13:48 ` Jason Hui
2012-01-16 19:51 ` Troy Kisky
2012-01-13 12:42 ` [U-Boot] [PATCH 1/5] net: fec_mxc: Add 1000 Mbps selection Marek Vasut
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=4F10A0AD.1060502@boundarydevices.com \
--to=troy.kisky@boundarydevices.com \
--cc=u-boot@lists.denx.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