Subject: RE: [PATCH V5 2/8] net: sxgbe: add basic framework for Samsung 10Gb ethernet driver

From: Byungho An <[email-masked]>
Date: Tue, 18 Mar 2014 13:56:12 -0700

Joe Perches <[email-masked]> wrote : 
> On Tue, 2014-03-18 at 11:19 -0700, Byungho An wrote:
> > From: Siva Reddy <[email-masked]>
> >
> > 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.