diff options
author | Linsys Contractor Mithlesh Thukral <mithlesh@netxen.com> | 2007-03-13 08:15:06 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-03-15 10:59:54 -0400 |
commit | b58ecad8d6ca83e97cd2928a439efb49267539dc (patch) | |
tree | 691bfcc04a909bd3e77550d7abd15595c08cb4ac /drivers/net | |
parent | 8b902aea40544bc9e4de913b491dc3a3411fd5d0 (diff) |
NetXen: Fix softlockup seen during hardware access
NetXen: This will fix a softlock seen on some machines.
The reason was too much time was spent waiting for hardware access
to go through.
Signed-off by: Mithlesh Thukral <mithlesh@netxen.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/netxen/netxen_nic.h | 1 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_ethtool.c | 1 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_init.c | 11 |
3 files changed, 11 insertions, 2 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index 81742e4e5610..dd8ce35332fe 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -232,6 +232,7 @@ enum { | |||
232 | #define MPORT_SINGLE_FUNCTION_MODE 0x1111 | 232 | #define MPORT_SINGLE_FUNCTION_MODE 0x1111 |
233 | 233 | ||
234 | extern unsigned long long netxen_dma_mask; | 234 | extern unsigned long long netxen_dma_mask; |
235 | extern unsigned long last_schedule_time; | ||
235 | 236 | ||
236 | /* | 237 | /* |
237 | * NetXen host-peg signal message structure | 238 | * NetXen host-peg signal message structure |
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c index 986ef98db229..ee1b5a24cbe7 100644 --- a/drivers/net/netxen/netxen_nic_ethtool.c +++ b/drivers/net/netxen/netxen_nic_ethtool.c | |||
@@ -462,6 +462,7 @@ netxen_nic_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, | |||
462 | } | 462 | } |
463 | printk(KERN_INFO "%s: flash unlocked. \n", | 463 | printk(KERN_INFO "%s: flash unlocked. \n", |
464 | netxen_nic_driver_name); | 464 | netxen_nic_driver_name); |
465 | last_schedule_time = jiffies; | ||
465 | ret = netxen_flash_erase_secondary(adapter); | 466 | ret = netxen_flash_erase_secondary(adapter); |
466 | if (ret != FLASH_SUCCESS) { | 467 | if (ret != FLASH_SUCCESS) { |
467 | printk(KERN_ERR "%s: Flash erase failed.\n", | 468 | printk(KERN_ERR "%s: Flash erase failed.\n", |
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index 586d32b676af..229aa1c4fb79 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -42,6 +42,8 @@ struct crb_addr_pair { | |||
42 | u32 data; | 42 | u32 data; |
43 | }; | 43 | }; |
44 | 44 | ||
45 | unsigned long last_schedule_time; | ||
46 | |||
45 | #define NETXEN_MAX_CRB_XFORM 60 | 47 | #define NETXEN_MAX_CRB_XFORM 60 |
46 | static unsigned int crb_addr_xform[NETXEN_MAX_CRB_XFORM]; | 48 | static unsigned int crb_addr_xform[NETXEN_MAX_CRB_XFORM]; |
47 | #define NETXEN_ADDR_ERROR (0xffffffff) | 49 | #define NETXEN_ADDR_ERROR (0xffffffff) |
@@ -404,9 +406,14 @@ static inline int do_rom_fast_write(struct netxen_adapter *adapter, int addr, | |||
404 | static inline int | 406 | static inline int |
405 | do_rom_fast_read(struct netxen_adapter *adapter, int addr, int *valp) | 407 | do_rom_fast_read(struct netxen_adapter *adapter, int addr, int *valp) |
406 | { | 408 | { |
409 | if (jiffies > (last_schedule_time + (8 * HZ))) { | ||
410 | last_schedule_time = jiffies; | ||
411 | schedule(); | ||
412 | } | ||
413 | |||
407 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ADDRESS, addr); | 414 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ADDRESS, addr); |
408 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ABYTE_CNT, 3); | 415 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ABYTE_CNT, 3); |
409 | udelay(70); /* prevent bursting on CRB */ | 416 | udelay(100); /* prevent bursting on CRB */ |
410 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_DUMMY_BYTE_CNT, 0); | 417 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_DUMMY_BYTE_CNT, 0); |
411 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_INSTR_OPCODE, 0xb); | 418 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_INSTR_OPCODE, 0xb); |
412 | if (netxen_wait_rom_done(adapter)) { | 419 | if (netxen_wait_rom_done(adapter)) { |
@@ -415,7 +422,7 @@ do_rom_fast_read(struct netxen_adapter *adapter, int addr, int *valp) | |||
415 | } | 422 | } |
416 | /* reset abyte_cnt and dummy_byte_cnt */ | 423 | /* reset abyte_cnt and dummy_byte_cnt */ |
417 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ABYTE_CNT, 0); | 424 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ABYTE_CNT, 0); |
418 | udelay(70); /* prevent bursting on CRB */ | 425 | udelay(100); /* prevent bursting on CRB */ |
419 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_DUMMY_BYTE_CNT, 0); | 426 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_DUMMY_BYTE_CNT, 0); |
420 | 427 | ||
421 | *valp = netxen_nic_reg_read(adapter, NETXEN_ROMUSB_ROM_RDATA); | 428 | *valp = netxen_nic_reg_read(adapter, NETXEN_ROMUSB_ROM_RDATA); |