Skip to content

Commit

Permalink
alpha: Fix de2104x driver failing to readout MAC address correctly
Browse files Browse the repository at this point in the history
This patch fixes a missing read memory barrier that is needed for the
driver to readout the MAC address correctly from the on-board ROM.
Also it replaces the use of the deprecated functions readl()/writel().

Signed-off-by: Morten H. Larsen <m-larsen@post6.tele.dk>
Signed-off-by: Matt Turner <mattst88@gmail.com>
  • Loading branch information
Morten H. Larsen authored and Matt Turner committed Jun 15, 2010
1 parent 932e0c2 commit 84cc153
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/tulip/de2104x.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,8 @@ static u16 t21041_csr14[] = { 0xFFFF, 0xF7FD, 0xF7FD, 0x6F3F, 0x6F3D, };
static u16 t21041_csr15[] = { 0x0008, 0x0006, 0x000E, 0x0008, 0x0008, };


#define dr32(reg) readl(de->regs + (reg))
#define dw32(reg,val) writel((val), de->regs + (reg))
#define dr32(reg) ioread32(de->regs + (reg))
#define dw32(reg, val) iowrite32((val), de->regs + (reg))


static void de_rx_err_acct (struct de_private *de, unsigned rx_tail,
Expand Down Expand Up @@ -1706,6 +1706,7 @@ static void __devinit de21040_get_mac_address (struct de_private *de)
int value, boguscnt = 100000;
do {
value = dr32(ROMCmd);
rmb();
} while (value < 0 && --boguscnt > 0);
de->dev->dev_addr[i] = value;
udelay(1);
Expand Down

0 comments on commit 84cc153

Please sign in to comment.