Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b58ecad8d6ca83e97cd2928a439efb49267539dc
Commit:     b58ecad8d6ca83e97cd2928a439efb49267539dc
Parent:     8b902aea40544bc9e4de913b491dc3a3411fd5d0
Author:     Linsys Contractor Mithlesh Thukral <[EMAIL PROTECTED]>
AuthorDate: Tue Mar 13 04:15:06 2007 -0800
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Thu Mar 15 10:59:54 2007 -0400

    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 <[EMAIL PROTECTED]>
    
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/net/netxen/netxen_nic.h         |    1 +
 drivers/net/netxen/netxen_nic_ethtool.c |    1 +
 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 81742e4..dd8ce35 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -232,6 +232,7 @@ enum {
 #define MPORT_SINGLE_FUNCTION_MODE 0x1111
 
 extern unsigned long long netxen_dma_mask;
+extern unsigned long last_schedule_time;
 
 /*
  * 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 986ef98..ee1b5a2 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,
                }
                printk(KERN_INFO "%s: flash unlocked. \n", 
                        netxen_nic_driver_name);
+               last_schedule_time = jiffies;
                ret = netxen_flash_erase_secondary(adapter);
                if (ret != FLASH_SUCCESS) {
                        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 586d32b..229aa1c 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 {
        u32 data;
 };
 
+unsigned long last_schedule_time;
+
 #define NETXEN_MAX_CRB_XFORM 60
 static unsigned int crb_addr_xform[NETXEN_MAX_CRB_XFORM];
 #define NETXEN_ADDR_ERROR (0xffffffff)
@@ -404,9 +406,14 @@ static inline int do_rom_fast_write(struct netxen_adapter 
*adapter, int addr,
 static inline int
 do_rom_fast_read(struct netxen_adapter *adapter, int addr, int *valp)
 {
+       if (jiffies > (last_schedule_time + (8 * HZ))) {
+               last_schedule_time = jiffies;
+               schedule();
+       }
+
        netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ADDRESS, addr);
        netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ABYTE_CNT, 3);
-       udelay(70);             /* prevent bursting on CRB */
+       udelay(100);            /* prevent bursting on CRB */
        netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_DUMMY_BYTE_CNT, 0);
        netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_INSTR_OPCODE, 0xb);
        if (netxen_wait_rom_done(adapter)) {
@@ -415,7 +422,7 @@ do_rom_fast_read(struct netxen_adapter *adapter, int addr, 
int *valp)
        }
        /* reset abyte_cnt and dummy_byte_cnt */
        netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ABYTE_CNT, 0);
-       udelay(70);             /* prevent bursting on CRB */
+       udelay(100);            /* prevent bursting on CRB */
        netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_DUMMY_BYTE_CNT, 0);
 
        *valp = netxen_nic_reg_read(adapter, NETXEN_ROMUSB_ROM_RDATA);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to