Re: [PATCH 2/6] mv643xx_eth: replace fixed-count spin delays

From: Christoph Hellwig
Date: Tue Dec 14 2004 - 18:33:40 EST


On Mon, Dec 13, 2004 at 03:14:31PM -0700, Dale Farnsworth wrote:
> This patch removes spin delays (count to 1000000, ugh) and instead waits
> with udelay or msleep for hardware flags to change.
>
> It also adds a spinlock to protect access to the MV64340_ETH_SMI_REG,
> which is shared across ports.

Care to add a comment with this information? Driver-global locks are
something we tend to avoid, and cases like this one where it's actually
nessecary should be properly documented.

> + for (i=0; i<10; i++) {

This is missing some space, should be:

for (i = 0; i < 10; i++) {

> +#define PHY_WAIT_ITERATIONS 1000 /* 1000 iterations * 10uS = 10mS max */

Put this into the header or at least ontop of the file?

> + /* wait for the SMI register to become available */
> + for (i=0; MV_READ(MV64340_ETH_SMI_REG) & ETH_SMI_BUSY; i++) {

Missing spaces again.

> + for (i=0; !(MV_READ(MV64340_ETH_SMI_REG) & ETH_SMI_READ_VALID); i++) {

Dito. (And a few more)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/