From: ODonnell, Michael Date: Wed, 11 Jan 2006 19:26:22 +0000 (-0800) Subject: [PATCH] corruption during e100 MDI register access X-Git-Tag: v2.6.16-rc1~176^2~10 X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=ac7c66698a2c51e4c6a34b84621c79e7cb89e07d;hp=ac7c66698a2c51e4c6a34b84621c79e7cb89e07d;p=linux-2.6-omap-h63xx.git [PATCH] corruption during e100 MDI register access We have identified two related bugs in the e100 driver. Both bugs are related to manipulation of the MDI control register. The first problem is that the Ready bit is being ignored when writing to the Control register; we noticed this because the Linux bonding driver would occasionally come to the spurious conclusion that the link was down when querying Link State. It turned out that by failing to wait for a previous command to complete it was selecting what was essentially a random register in the MDI register set. When we added code that waits for the Ready bit (as shown in the patch file below) all such problems ceased. The second problem is that, although access to the MDI registers involves multiple steps which must not be intermixed, nothing was defending against two or more threads attempting simultaneous access. The most obvious situation where such interference could occur involves the watchdog versus ioctl paths, but there are probably others, so we recommend the locking shown in our patch file. Signed-off-by: Michael O'Donnell Cc: "David S. Miller" Cc: Jeff Garzik Cc: John Ronciak Cc: Ganesh Venkatesan Cc: Jesse Brandeburg Signed-off-by: Andrew Morton Signed-off-by: Jeff Garzik ---