All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] bcm63xx_enet: do not overwrite ENET_CTL_REG value
@ 2010-04-09 11:04 Florian Fainelli
  2010-04-13 10:30 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Fainelli @ 2010-04-09 11:04 UTC (permalink / raw)
  To: netdev; +Cc: David Miller, Maxime Bizon

bcm_enet_hw_preinit will correctly set values in ENET_CTL_REG for internal
or external MII operations, however, bcm_enet_open will blindly overwrite the
ENET_CTL_REG register value and thus we will loose any changes to it that
were made in bcm_enet_hw_preinit, rendering external MII operations non-working.

This would lead to the driver not being able to check for link availability on
external PHY setups, and thus we would never get to sending packets because
link was down from the driver side.

This was completely un-noticed because all boards out there but BCM6338-based
ones use internal phy on their enet0 interface.

Signed-off-by: Florian Fainelli <ffainelli@freebox.fr>
---
diff --git a/drivers/net/bcm63xx_enet.c b/drivers/net/bcm63xx_enet.c
index 5173340..14ab4dc 100644
--- a/drivers/net/bcm63xx_enet.c
+++ b/drivers/net/bcm63xx_enet.c
@@ -958,7 +958,9 @@ static int bcm_enet_open(struct net_device *dev)
 	/* all set, enable mac and interrupts, start dma engine and
 	 * kick rx dma channel */
 	wmb();
-	enet_writel(priv, ENET_CTL_ENABLE_MASK, ENET_CTL_REG);
+	val = enet_readl(priv, ENET_CTL_REG);
+	val |= ENET_CTL_ENABLE_MASK;
+	enet_writel(priv, val, ENET_CTL_REG);
 	enet_dma_writel(priv, ENETDMA_CFG_EN_MASK, ENETDMA_CFG_REG);
 	enet_dma_writel(priv, ENETDMA_CHANCFG_EN_MASK,
 			ENETDMA_CHANCFG_REG(priv->rx_chan));

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/2] bcm63xx_enet: do not overwrite ENET_CTL_REG value
  2010-04-09 11:04 [PATCH 2/2] bcm63xx_enet: do not overwrite ENET_CTL_REG value Florian Fainelli
@ 2010-04-13 10:30 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-04-13 10:30 UTC (permalink / raw)
  To: ffainelli; +Cc: netdev, mbizon

From: Florian Fainelli <ffainelli@freebox.fr>
Date: Fri, 9 Apr 2010 13:04:52 +0200

> bcm_enet_hw_preinit will correctly set values in ENET_CTL_REG for internal
> or external MII operations, however, bcm_enet_open will blindly overwrite the
> ENET_CTL_REG register value and thus we will loose any changes to it that
> were made in bcm_enet_hw_preinit, rendering external MII operations non-working.
> 
> This would lead to the driver not being able to check for link availability on
> external PHY setups, and thus we would never get to sending packets because
> link was down from the driver side.
> 
> This was completely un-noticed because all boards out there but BCM6338-based
> ones use internal phy on their enet0 interface.
> 
> Signed-off-by: Florian Fainelli <ffainelli@freebox.fr>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-13 10:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-09 11:04 [PATCH 2/2] bcm63xx_enet: do not overwrite ENET_CTL_REG value Florian Fainelli
2010-04-13 10:30 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.