netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND] fix #51791 - bug? mac 00:00:00:00:00:00 with natsemi DP83815 after driver load
@ 2014-11-18 21:51 Roland Kletzing
  2014-11-19 20:35 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Roland Kletzing @ 2014-11-18 21:51 UTC (permalink / raw)
  To: netdev; +Cc: David Miller

This one should fix Bugzilla #51791 

Natsemi driver does not read MAC correctly from eeprom, while natsemi-diag
from nictools-pci does. Apparently, it`s a timing issue in the kernel driver.

According to ftp://ftp.gwdg.de/pub/linux/misc/donald.becker/diag/natsemi-diag.c
, eeprom_delay(ee_addr) is defined as follows:

/* Delay between EEPROM clock transitions.
This flushes the write buffer to prevent quick double-writes.
*/
#define eeprom_delay(ee_addr) inl(ee_addr); inl(ee_addr)

while in the natsemi linux kernel driver, the delay is done this way :

#define eeprom_delay(ee_addr) readl(ee_addr)

, which results in the MAC being all zero`s.

So i simply added a second readl() to increase delay (instead of turning into 
inl() as proposed before). This may look a little bit ugly, but it`s fixing the
problem for me.

I´m not sure how many natsemi users being left on this planet (probably few),
but i guess this change does not do any harm on platforms where the driver does
not behave buggy, so please consider adding it to mainline/stable/longterm.

regards
Roland


Signed-off-by: Roland Kletzing <devzero@web.de>

---
drivers/net/ethernet/natsemi/natsemi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/natsemi/natsemi.c b/drivers/net/ethernet/natsemi/natsemi.c
index b83f7c0..96f0029 100644
--- a/drivers/net/ethernet/natsemi/natsemi.c
+++ b/drivers/net/ethernet/natsemi/natsemi.c
@@ -987,7 +987,7 @@ static int natsemi_probe1(struct pci_dev *pdev, const struct pci_device_id *ent)
    The old method of using an ISA access as a delay, __SLOW_DOWN_IO__, is
    deprecated.
 */
-#define eeprom_delay(ee_addr)  readl(ee_addr)
+#define eeprom_delay(ee_addr)  readl(ee_addr);  readl(ee_addr)

 #define EE_Write0 (EE_ChipSelect)
 #define EE_Write1 (EE_ChipSelect | EE_DataIn)
--

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

* Re: [PATCH RESEND] fix #51791 - bug? mac 00:00:00:00:00:00 with natsemi DP83815 after driver load
  2014-11-18 21:51 [PATCH RESEND] fix #51791 - bug? mac 00:00:00:00:00:00 with natsemi DP83815 after driver load Roland Kletzing
@ 2014-11-19 20:35 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-11-19 20:35 UTC (permalink / raw)
  To: devzero; +Cc: netdev

From: "Roland Kletzing" <devzero@web.de>
Date: Tue, 18 Nov 2014 22:51:23 +0100

> This one should fix Bugzilla #51791 

I'm sorry for being a pain, but I want to teach you how to properly
submit clean patches so that I don't need to go back and forth with
you in the future about these issues.

Your subject line needs adjusting.

After the [PATCH ...], there should be a properly subsystem prefix
followed by a colon character, which in this case could be "natsemi: "

Then, your subject line should be succinct and contain all of the
context necessary to understand exactly what the bug is about.

This means that the bug ID number doesn't belong there.  It's
completely ambiguous as to what bug repository that ID is for,
and such information belongs in the commit message body.

So when you mention bug IDs in the commit message body, say where
it's from.  If it's the main kernel bugzilla, say so.

Thanks.

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

end of thread, other threads:[~2014-11-19 20:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-18 21:51 [PATCH RESEND] fix #51791 - bug? mac 00:00:00:00:00:00 with natsemi DP83815 after driver load Roland Kletzing
2014-11-19 20:35 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).