kernel_optimize_test/drivers/net/ibm_emac
Eugene Surovegin 5bb96e9f24 ibm_emac: improved PHY support
Original patch is from Jeff Haran  <jharan@brocade.com> with my minor style
fixes. His comments follow:

The first problem was in the function that configures the PHY for
autonegotiation, genmii_setup_aneg(). The original code does a
read/modify/write of the autonegotiation advertizement register (reg 4),
followed by a read/modify/write of the control register (reg 0). While
the original code follows the proper procedure as per reading the IEEE
specs, what I found is that on at least one PHY model (National DP83843)
the read of the control register comes back with the soft reset bit set
(bit 15). Because of the read/modify/write operation, this causes the
write to write a 1 back to the reset bit, which initiates a software
reset of the PHY. This software reset causes the PHY to return to its
power up state which advertizes all modes of operation, thus negating
the write to the autoneg advertizement register. The modification is to
spin reading the control register until the soft reset bit is clear
before doing the modify/write.
The second problem was in the function that configures the PHY for
forced operation, genmii_setup_forced(). The original code initiates a
software reset operation via a write of a 1 to bit 15 of the control
register (reg 0), but then proceeds to do a second write to that same
register without waiting until that reset bit is cleared by the PHY
itself (which according to the IEEE specs indicates that the PHY reset
is complete). This is a violation of how one is supposed to use this
software reset feature of these PHYs and I believe was the cause of
mysterious, difficult to reproduce link failures that we've observed on
some of our systems that use this driver. The fix is to modify the
function so that it spins waiting for the reset bit to clear after doing
the soft reset and before doing the subsequent write.

Signed-off-by: Jeff Haran <jharan@brocade.com>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Eugene Surovegin <ebs@ebshome.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-05-17 20:43:14 -04:00
..
ibm_emac_core.c PCI: Cleanup the includes of <linux/pci.h> 2007-05-02 19:02:35 -07:00
ibm_emac_core.h Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
ibm_emac_debug.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
ibm_emac_debug.h fix file specification in comments 2006-10-03 23:01:26 +02:00
ibm_emac_mal.c ibm_emac: fix section mismatch warnings 2007-05-17 20:43:14 -04:00
ibm_emac_mal.h ibm_emac: fix section mismatch warnings 2007-05-17 20:43:14 -04:00
ibm_emac_phy.c ibm_emac: improved PHY support 2007-05-17 20:43:14 -04:00
ibm_emac_phy.h [PATCH] New PowerPC 4xx on-chip ethernet controller driver 2005-10-28 16:42:01 -04:00
ibm_emac_rgmii.c ibm_emac: fix section mismatch warnings 2007-05-17 20:43:14 -04:00
ibm_emac_rgmii.h ibm_emac: fix section mismatch warnings 2007-05-17 20:43:14 -04:00
ibm_emac_tah.c ibm_emac: fix section mismatch warnings 2007-05-17 20:43:14 -04:00
ibm_emac_tah.h ibm_emac: fix section mismatch warnings 2007-05-17 20:43:14 -04:00
ibm_emac_zmii.c ibm_emac: fix section mismatch warnings 2007-05-17 20:43:14 -04:00
ibm_emac_zmii.h ibm_emac: fix section mismatch warnings 2007-05-17 20:43:14 -04:00
ibm_emac.h Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
Makefile [PATCH] New PowerPC 4xx on-chip ethernet controller driver 2005-10-28 16:42:01 -04:00