All of lore.kernel.org
 help / color / mirror / Atom feed
From: Morten Holst Larsen <m-larsen@post6.tele.dk>
To: linux-alpha@vger.kernel.org
Subject: [PATCH] Fix de2104x driver failing to readout MAC address correctly
Date: Thu, 10 Jun 2010 10:48:12 +0200	[thread overview]
Message-ID: <E1OMdQq-00036t-RU@mhlnet.dk> (raw)

Fix de2104x driver failing to readout MAC address correctly

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>
----
diff -uNr a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
--- a/drivers/net/tulip/de2104x.c	2010-06-06 05:43:24.000000000 +0200
+++ b/drivers/net/tulip/de2104x.c	2010-06-07 15:45:35.000000000 +0200
@@ -367,8 +367,8 @@
 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,
@@ -1706,6 +1706,7 @@
 		int value, boguscnt = 100000;
 		do {
 			value = dr32(ROMCmd);
+			rmb();
 		} while (value < 0 && --boguscnt > 0);
 		de->dev->dev_addr[i] = value;
 		udelay(1);


                 reply	other threads:[~2010-06-10  8:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1OMdQq-00036t-RU@mhlnet.dk \
    --to=m-larsen@post6.tele.dk \
    --cc=linux-alpha@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.