On Tue, 2014-03-18 at 11:19 -0700, Byungho An wrote:
> From: Siva Reddy <[email protected]>
>
> 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)
> +
> + 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;
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html