aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorLalit Chandivade <lalit.chandivade@qlogic.com>2011-05-18 02:17:09 -0400
committerJames Bottomley <jbottomley@parallels.com>2011-05-24 12:40:02 -0400
commit1b46807e0bc6160449ce04a207fa98a694bc443c (patch)
tree9ebf09b3b4626872dc82148e8e3f3b965d586102 /drivers/scsi
parent977f46a4bb58e2a8f4d287db311084e24c502b77 (diff)
[SCSI] qla4xxx: Remove AF_DPC_SCHEDULED flag from ha.
Since queue_work does not requeue, there is no need to check if a work is in progress using the AF_DPC_SCHEDULED flag. queue_work would return if work is pending without adding the work, do_dpc would again get invoked from qla4xxx_timer if there is still DPC flags set. Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com> Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <jbottomley@parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/qla4xxx/ql4_def.h1
-rw-r--r--drivers/scsi/qla4xxx/ql4_os.c17
2 files changed, 5 insertions, 13 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h
index 75edfba92f48..8e3a28e300a4 100644
--- a/drivers/scsi/qla4xxx/ql4_def.h
+++ b/drivers/scsi/qla4xxx/ql4_def.h
@@ -368,7 +368,6 @@ struct scsi_qla_host {
368#define AF_INIT_DONE 1 /* 0x00000002 */ 368#define AF_INIT_DONE 1 /* 0x00000002 */
369#define AF_MBOX_COMMAND 2 /* 0x00000004 */ 369#define AF_MBOX_COMMAND 2 /* 0x00000004 */
370#define AF_MBOX_COMMAND_DONE 3 /* 0x00000008 */ 370#define AF_MBOX_COMMAND_DONE 3 /* 0x00000008 */
371#define AF_DPC_SCHEDULED 5 /* 0x00000020 */
372#define AF_INTERRUPTS_ON 6 /* 0x00000040 */ 371#define AF_INTERRUPTS_ON 6 /* 0x00000040 */
373#define AF_GET_CRASH_RECORD 7 /* 0x00000080 */ 372#define AF_GET_CRASH_RECORD 7 /* 0x00000080 */
374#define AF_LINK_UP 8 /* 0x00000100 */ 373#define AF_LINK_UP 8 /* 0x00000100 */
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 302938ed2015..9c1c8453d6c7 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -859,7 +859,7 @@ static void qla4xxx_timer(struct scsi_qla_host *ha)
859 } 859 }
860 860
861 /* Wakeup the dpc routine for this adapter, if needed. */ 861 /* Wakeup the dpc routine for this adapter, if needed. */
862 if ((start_dpc || 862 if (start_dpc ||
863 test_bit(DPC_RESET_HA, &ha->dpc_flags) || 863 test_bit(DPC_RESET_HA, &ha->dpc_flags) ||
864 test_bit(DPC_RETRY_RESET_HA, &ha->dpc_flags) || 864 test_bit(DPC_RETRY_RESET_HA, &ha->dpc_flags) ||
865 test_bit(DPC_RELOGIN_DEVICE, &ha->dpc_flags) || 865 test_bit(DPC_RELOGIN_DEVICE, &ha->dpc_flags) ||
@@ -869,9 +869,7 @@ static void qla4xxx_timer(struct scsi_qla_host *ha)
869 test_bit(DPC_LINK_CHANGED, &ha->dpc_flags) || 869 test_bit(DPC_LINK_CHANGED, &ha->dpc_flags) ||
870 test_bit(DPC_HA_UNRECOVERABLE, &ha->dpc_flags) || 870 test_bit(DPC_HA_UNRECOVERABLE, &ha->dpc_flags) ||
871 test_bit(DPC_HA_NEED_QUIESCENT, &ha->dpc_flags) || 871 test_bit(DPC_HA_NEED_QUIESCENT, &ha->dpc_flags) ||
872 test_bit(DPC_AEN, &ha->dpc_flags)) && 872 test_bit(DPC_AEN, &ha->dpc_flags)) {
873 !test_bit(AF_DPC_SCHEDULED, &ha->flags) &&
874 ha->dpc_thread) {
875 DEBUG2(printk("scsi%ld: %s: scheduling dpc routine" 873 DEBUG2(printk("scsi%ld: %s: scheduling dpc routine"
876 " - dpc flags = 0x%lx\n", 874 " - dpc flags = 0x%lx\n",
877 ha->host_no, __func__, ha->dpc_flags)); 875 ha->host_no, __func__, ha->dpc_flags));
@@ -1261,11 +1259,8 @@ static void qla4xxx_relogin_all_devices(struct scsi_qla_host *ha)
1261 1259
1262void qla4xxx_wake_dpc(struct scsi_qla_host *ha) 1260void qla4xxx_wake_dpc(struct scsi_qla_host *ha)
1263{ 1261{
1264 if (ha->dpc_thread && 1262 if (ha->dpc_thread)
1265 !test_bit(AF_DPC_SCHEDULED, &ha->flags)) {
1266 set_bit(AF_DPC_SCHEDULED, &ha->flags);
1267 queue_work(ha->dpc_thread, &ha->dpc_work); 1263 queue_work(ha->dpc_thread, &ha->dpc_work);
1268 }
1269} 1264}
1270 1265
1271/** 1266/**
@@ -1292,12 +1287,12 @@ static void qla4xxx_do_dpc(struct work_struct *work)
1292 1287
1293 /* Initialization not yet finished. Don't do anything yet. */ 1288 /* Initialization not yet finished. Don't do anything yet. */
1294 if (!test_bit(AF_INIT_DONE, &ha->flags)) 1289 if (!test_bit(AF_INIT_DONE, &ha->flags))
1295 goto do_dpc_exit; 1290 return;
1296 1291
1297 if (test_bit(AF_EEH_BUSY, &ha->flags)) { 1292 if (test_bit(AF_EEH_BUSY, &ha->flags)) {
1298 DEBUG2(printk(KERN_INFO "scsi%ld: %s: flags = %lx\n", 1293 DEBUG2(printk(KERN_INFO "scsi%ld: %s: flags = %lx\n",
1299 ha->host_no, __func__, ha->flags)); 1294 ha->host_no, __func__, ha->flags));
1300 goto do_dpc_exit; 1295 return;
1301 } 1296 }
1302 1297
1303 if (is_qla8022(ha)) { 1298 if (is_qla8022(ha)) {
@@ -1404,8 +1399,6 @@ dpc_post_reset_ha:
1404 } 1399 }
1405 } 1400 }
1406 1401
1407do_dpc_exit:
1408 clear_bit(AF_DPC_SCHEDULED, &ha->flags);
1409} 1402}
1410 1403
1411/** 1404/**