Bug 171228 - [re] [patch] if_re - eeprom write issues
Summary: [re] [patch] if_re - eeprom write issues
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-01 11:00 UTC by Dan Lukes
Modified: 2017-12-31 22:29 UTC (History)
0 users

See Also:


Attachments
patch-re (3.42 KB, text/plain)
2012-09-01 11:00 UTC, Dan Lukes
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Lukes 2012-09-01 11:00:20 UTC
Realtek network card driver, if_re.c:

1. re_clrwol()
   CFG5 register writen after config register write done claimed. Yes, some documentation show that it's not necesarry to be in such mode to write CFG5, but it's unclear it apply to all chip versions.
   See SVN rev 232145 comment also. 
   It's good to be consistent in all parts of code. All other writes to CFG5 register in module are done in "EEPROM write enable" mode but this one in re_clrwol() (see re_setwol and re_attach routines)

2. unecesarry writes into EEPROM (e.g. write of data althougth unchanged)
  There are several places, where config register is read, examined, sometime) modified, then written back into EEPROM. 
  Unfortunately, they are written back unconditionally, whenever they has been modified or not. 
  As EEPROM have limited number of write cycles, such behavior may short lifetime of network card

Fix: [1] - move CFG5 write before "EEPROM write mode" close. It's better to be on safe side and it doesn't harm anything even it's not necesarry for particular chip
[2] - store original value of configuration register read, write back only if changed

How-To-Repeat: 	see description
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2012-09-03 08:47:08 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-net

Over to maintainer(s).
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:29 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped