netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mugunthan V N <mugunthanvnm@ti.com>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: netdev <netdev@vger.kernel.org>, David Miller <davem@davemloft.net>
Subject: Re: [net PATCH 1/1] net: phy: fix phy link up when limiting speed via device tree
Date: Fri, 26 Jun 2015 00:32:57 +0530	[thread overview]
Message-ID: <558C5061.6090509@ti.com> (raw)
In-Reply-To: <CAGVrzcZcs5n7A+VF3uextDgONS_UNLYDianw=NwH62Bx-6ZEyw@mail.gmail.com>

On Thursday 25 June 2015 11:01 PM, Florian Fainelli wrote:
> 2015-06-25 9:51 GMT-07:00 Mugunthan V N <mugunthanvnm@ti.com>:
>> > When limiting phy link speed using "max-speed" to 100mbps or less on a
>> > giga bit phy, phy never completes auto negotiation and phy state
>> > machine is held in PHY_AN. Fixing this issue by comparing the giga
>> > bit advertise though phydev->supported doesn't have it but phy has
>> > BMSR_ESTATEN set. So that auto negotiation is restarted as old and
>> > new advertise are different and link comes up fine.
> This looks valid, however, I am curious why this part of the code:
> 
>         oldadv = adv;
>         adv &= ~(ADVERTISE_ALL | ADVERTISE_100BASE4 | ADVERTISE_PAUSE_CAP |
>                  ADVERTISE_PAUSE_ASYM);
>         adv |= ethtool_adv_to_mii_adv_t(advertise);
> 
>         if (adv != oldadv) {
>                 err = phy_write(phydev, MII_ADVERTISE, adv);
> 
>                 if (err < 0)
>                         return err;
>                 changed = 1;
>         }
> 
> Is not flagging this as a change already?
> 

This can flag a change when the selected limit is 10mbps, if 100mbps is
selected, at this instant oldadv and adv are same so change is not
flagged here.

Regards
Mugunthan V N

  reply	other threads:[~2015-06-25 19:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-25 16:51 [net PATCH 1/1] net: phy: fix phy link up when limiting speed via device tree Mugunthan V N
2015-06-25 17:31 ` Florian Fainelli
2015-06-25 19:02   ` Mugunthan V N [this message]
2015-06-26  3:03 ` Florian Fainelli
2015-06-26  4:56   ` Mugunthan V N
2015-06-28 23:59 ` David Miller

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=558C5061.6090509@ti.com \
    --to=mugunthanvnm@ti.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).