devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Byungho An <bh74.an@samsung.com>
To: 'Joe Perches' <joe@perches.com>
Cc: netdev@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	devicetree@vger.kernel.org, davem@davemloft.net,
	siva.kallam@samsung.com, ks.giri@samsung.com,
	ilho215.lee@samsung.com, vipul.pandya@samsung.com
Subject: RE: [PATCH V5 2/8] net: sxgbe: add basic framework for Samsung 10Gb ethernet driver
Date: Tue, 18 Mar 2014 13:56:12 -0700	[thread overview]
Message-ID: <003601cf42ec$80bd2bf0$823783d0$@samsung.com> (raw)
In-Reply-To: <1395171314.2812.80.camel@joe-AO722>


Joe Perches <joe@perches.com> wrote : 
> On Tue, 2014-03-18 at 11:19 -0700, Byungho An wrote:
> > From: Siva Reddy <siva.kallam@samsung.com>
> >
> > This patch adds support for Samsung 10Gb ethernet driver(sxgbe).
> 
> More trivia, nothing that should stop this from being applied and updated
> later...
> 
> > diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_mdio.c
> > b/drivers/net/ethernet/samsung/sxgbe/sxgbe_mdio.c
> []
> > +static int sxgbe_mdio_busy_wait(void __iomem *ioaddr, unsigned int
> > +mii_data) {
> > +	unsigned long cur_time;
> > +	unsigned long fin_time = jiffies + 3 * HZ; /* 30 ms */
> 
> This is actually 3 seconds.
> If this should be 30ms, then use msecs_to_jiffies(30)
This is a typo, comment will be changed to "3 sec".

> 
> > +
> > +	do {
> > +		cur_time = jiffies;
> > +		if (readl(ioaddr + mii_data) & SXGBE_MII_BUSY)
> > +			cpu_relax();
> > +		else
> > +			return 0;
> > +	} while (!time_after_eq(cur_time, fin_time));
> > +
> > +	return -EBUSY;
> > +}
> 
> This may be clearer as
> 
> 	unsigned long fin_time = jiffies + msecs_to_jiffies(30);
> 
> 	while (!time_after(jiffies, fin_time))
> 		if (!(readl(ioaddr + mii_data) & SXGBE_MII_BUSY))
> 			return 0;
> 		cpu_relax();
> 	}
> 
> 	return -EBUSY;
OK.

      reply	other threads:[~2014-03-18 20:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-18 18:19 [PATCH V5 2/8] net: sxgbe: add basic framework for Samsung 10Gb ethernet driver Byungho An
2014-03-18 18:59 ` Florian Fainelli
2014-03-18 22:16   ` Byungho An
2014-03-18 22:24     ` Florian Fainelli
2014-03-19  5:22       ` Byungho An
2014-03-18 19:35 ` Joe Perches
2014-03-18 20:56   ` Byungho An [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='003601cf42ec$80bd2bf0$823783d0$@samsung.com' \
    --to=bh74.an@samsung.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=ilho215.lee@samsung.com \
    --cc=joe@perches.com \
    --cc=ks.giri@samsung.com \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=siva.kallam@samsung.com \
    --cc=vipul.pandya@samsung.com \
    /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).