netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: "Allan W. Nielsen" <allan.nielsen@microsemi.com>
Cc: netdev@vger.kernel.org, f.fainelli@gmail.com,
	raju.lakkaraju@microsemi.com, cphealy@gmail.com, robh@kernel.org
Subject: Re: [PATCH net-next 5/5] net: phy: Add downshift get/set support in Microsemi PHYs driver
Date: Fri, 4 Nov 2016 14:55:00 +0100	[thread overview]
Message-ID: <20161104135500.GB3600@lunn.ch> (raw)
In-Reply-To: <20161104134234.GC11277@microsemi.com>

On Fri, Nov 04, 2016 at 02:42:34PM +0100, Allan W. Nielsen wrote:
> On 04/11/16 13:27, Andrew Lunn wrote:
> > > +     } else if (count) {
> > > +             /* Downshift count is either 2,3,4 or 5 */
> > > +             count = (((count - 2) << DOWNSHIFT_CNTL_POS) | DOWNSHIFT_EN);
> > 
> > Ah, now i see why + 2. But this means it never does what you ask it to
> > do. It would be better to round up < 2 to 2, and leave all the others
> > as is.
> Not sure I understand what you mean...
> 
> If the user configure "count == 1", then you want that to be rounded up to
> "count == 2", because the HW does not support a count of 1???

Yes. The other option would be to return ERANGE when 1 is asked
for. The real question is, which is better for the user? Returning
ERANGE and letting the user make a guessing game to figure out what is
valid, or magically turn 1 into 2. I will let you decide which is
best.

> If the user configure count to 6, 7, 8 etc. would you also like to round it down
> to 5?

No. ERANGE. The user has to expect some upper limit, and ERANGE is a
good indication they have reached it. But having a lowered limit of 2
is less obvious.

   Andrew

      reply	other threads:[~2016-11-04 13:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-04 10:35 [PATCH net-next 0/5] Adding PHY-Tunables and downshift support Allan W. Nielsen
2016-11-04 10:35 ` [PATCH net-next 1/5] ethtool: (uapi) Add ETHTOOL_PHY_GTUNABLE and ETHTOOL_PHY_STUNABLE Allan W. Nielsen
2016-11-04 12:03   ` Andrew Lunn
2016-11-04 12:18     ` Allan W. Nielsen
2016-11-04 12:29       ` Andrew Lunn
2016-11-04 10:35 ` [PATCH net-next 2/5] ethtool: Implements ETHTOOL_PHY_GTUNABLE/ETHTOOL_PHY_STUNABLE Allan W. Nielsen
2016-11-04 12:13   ` Andrew Lunn
2016-11-04 13:31     ` Allan W. Nielsen
2016-11-04 10:35 ` [PATCH net-next 3/5] ethtool: (uapi) Add ETHTOOL_PHY_DOWNSHIFT to PHY tunables Allan W. Nielsen
2016-11-04 10:35 ` [PATCH net-next 4/5] ethtool: Core impl for ETHTOOL_PHY_DOWNSHIFT tunable Allan W. Nielsen
2016-11-04 10:35 ` [PATCH net-next 5/5] net: phy: Add downshift get/set support in Microsemi PHYs driver Allan W. Nielsen
2016-11-04 12:27   ` Andrew Lunn
2016-11-04 13:42     ` Allan W. Nielsen
2016-11-04 13:55       ` Andrew Lunn [this message]

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=20161104135500.GB3600@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=allan.nielsen@microsemi.com \
    --cc=cphealy@gmail.com \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=raju.lakkaraju@microsemi.com \
    --cc=robh@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).