aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/dm9000.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index 3bef3b25ff0e..5a883711d1f4 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -1073,17 +1073,29 @@ dm9000_rx(struct net_device *dev)
1073static void 1073static void
1074dm9000_read_eeprom(board_info_t *db, int offset, u8 *to) 1074dm9000_read_eeprom(board_info_t *db, int offset, u8 *to)
1075{ 1075{
1076 unsigned long flags;
1077
1076 mutex_lock(&db->addr_lock); 1078 mutex_lock(&db->addr_lock);
1077 1079
1080 spin_lock_irqsave(&db->lock, flags);
1081
1078 iow(db, DM9000_EPAR, offset); 1082 iow(db, DM9000_EPAR, offset);
1079 iow(db, DM9000_EPCR, EPCR_ERPRR); 1083 iow(db, DM9000_EPCR, EPCR_ERPRR);
1084
1085 spin_unlock_irqrestore(&db->lock, flags);
1086
1080 mdelay(8); /* according to the datasheet 200us should be enough, 1087 mdelay(8); /* according to the datasheet 200us should be enough,
1081 but it doesn't work */ 1088 but it doesn't work */
1089
1090 spin_lock_irqsave(&db->lock, flags);
1091
1082 iow(db, DM9000_EPCR, 0x0); 1092 iow(db, DM9000_EPCR, 0x0);
1083 1093
1084 to[0] = ior(db, DM9000_EPDRL); 1094 to[0] = ior(db, DM9000_EPDRL);
1085 to[1] = ior(db, DM9000_EPDRH); 1095 to[1] = ior(db, DM9000_EPDRH);
1086 1096
1097 spin_unlock_irqrestore(&db->lock, flags);
1098
1087 mutex_unlock(&db->addr_lock); 1099 mutex_unlock(&db->addr_lock);
1088} 1100}
1089 1101
@@ -1093,14 +1105,22 @@ dm9000_read_eeprom(board_info_t *db, int offset, u8 *to)
1093static void 1105static void
1094dm9000_write_eeprom(board_info_t *db, int offset, u8 *data) 1106dm9000_write_eeprom(board_info_t *db, int offset, u8 *data)
1095{ 1107{
1108 unsigned long flags;
1109
1096 mutex_lock(&db->addr_lock); 1110 mutex_lock(&db->addr_lock);
1097 1111
1112 spin_lock_irqsave(&db->lock, flags);
1098 iow(db, DM9000_EPAR, offset); 1113 iow(db, DM9000_EPAR, offset);
1099 iow(db, DM9000_EPDRH, data[1]); 1114 iow(db, DM9000_EPDRH, data[1]);
1100 iow(db, DM9000_EPDRL, data[0]); 1115 iow(db, DM9000_EPDRL, data[0]);
1101 iow(db, DM9000_EPCR, EPCR_WEP | EPCR_ERPRW); 1116 iow(db, DM9000_EPCR, EPCR_WEP | EPCR_ERPRW);
1117 spin_unlock_irqrestore(&db->lock, flags);
1118
1102 mdelay(8); /* same shit */ 1119 mdelay(8); /* same shit */
1120
1121 spin_lock_irqsave(&db->lock, flags);
1103 iow(db, DM9000_EPCR, 0); 1122 iow(db, DM9000_EPCR, 0);
1123 spin_unlock_irqrestore(&db->lock, flags);
1104 1124
1105 mutex_unlock(&db->addr_lock); 1125 mutex_unlock(&db->addr_lock);
1106} 1126}