diff options
author | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-11-22 13:06:44 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-11-22 13:06:44 -0500 |
commit | 0bd2af46839ad6262d25714a6ec0365db9d6b98f (patch) | |
tree | dcced72d230d69fd0c5816ac6dd03ab84799a93e /drivers/scsi/qla4xxx/ql4_os.c | |
parent | e138a5d2356729b8752e88520cc1525fae9794ac (diff) | |
parent | f26b90440cd74c78fe10c9bd5160809704a9627c (diff) |
Merge ../scsi-rc-fixes-2.6
Diffstat (limited to 'drivers/scsi/qla4xxx/ql4_os.c')
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_os.c | 52 |
1 files changed, 17 insertions, 35 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index 178fcddcfd81..bab434ee774b 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c | |||
@@ -34,9 +34,9 @@ MODULE_PARM_DESC(ql4xdontresethba, | |||
34 | " default it will reset hba :0" | 34 | " default it will reset hba :0" |
35 | " set to 1 to avoid resetting HBA"); | 35 | " set to 1 to avoid resetting HBA"); |
36 | 36 | ||
37 | int qla4_extended_error_logging = 0; /* 0 = off, 1 = log errors */ | 37 | int ql4xextended_error_logging = 0; /* 0 = off, 1 = log errors */ |
38 | module_param(qla4_extended_error_logging, int, S_IRUGO | S_IRUSR); | 38 | module_param(ql4xextended_error_logging, int, S_IRUGO | S_IRUSR); |
39 | MODULE_PARM_DESC(qla4_extended_error_logging, | 39 | MODULE_PARM_DESC(ql4xextended_error_logging, |
40 | "Option to enable extended error logging, " | 40 | "Option to enable extended error logging, " |
41 | "Default is 0 - no logging, 1 - debug logging"); | 41 | "Default is 0 - no logging, 1 - debug logging"); |
42 | 42 | ||
@@ -919,18 +919,11 @@ static int qla4xxx_recover_adapter(struct scsi_qla_host *ha, | |||
919 | if (status == QLA_SUCCESS) { | 919 | if (status == QLA_SUCCESS) { |
920 | DEBUG2(printk("scsi%ld: %s - Performing soft reset..\n", | 920 | DEBUG2(printk("scsi%ld: %s - Performing soft reset..\n", |
921 | ha->host_no, __func__)); | 921 | ha->host_no, __func__)); |
922 | status = qla4xxx_soft_reset(ha); | 922 | qla4xxx_flush_active_srbs(ha); |
923 | } | 923 | if (ql4xxx_lock_drvr_wait(ha) == QLA_SUCCESS) |
924 | /* FIXMEkaren: Do we want to keep interrupts enabled and process | 924 | status = qla4xxx_soft_reset(ha); |
925 | AENs after soft reset */ | 925 | else |
926 | 926 | status = QLA_ERROR; | |
927 | /* If firmware (SOFT) reset failed, or if all outstanding | ||
928 | * commands have not returned, then do a HARD reset. | ||
929 | */ | ||
930 | if (status == QLA_ERROR) { | ||
931 | DEBUG2(printk("scsi%ld: %s - Performing hard reset..\n", | ||
932 | ha->host_no, __func__)); | ||
933 | status = qla4xxx_hard_reset(ha); | ||
934 | } | 927 | } |
935 | 928 | ||
936 | /* Flush any pending ddb changed AENs */ | 929 | /* Flush any pending ddb changed AENs */ |
@@ -1016,13 +1009,9 @@ static void qla4xxx_do_dpc(void *data) | |||
1016 | struct scsi_qla_host *ha = (struct scsi_qla_host *) data; | 1009 | struct scsi_qla_host *ha = (struct scsi_qla_host *) data; |
1017 | struct ddb_entry *ddb_entry, *dtemp; | 1010 | struct ddb_entry *ddb_entry, *dtemp; |
1018 | 1011 | ||
1019 | DEBUG2(printk("scsi%ld: %s: DPC handler waking up.\n", | 1012 | DEBUG2(printk("scsi%ld: %s: DPC handler waking up." |
1020 | ha->host_no, __func__)); | 1013 | "flags = 0x%08lx, dpc_flags = 0x%08lx\n", |
1021 | 1014 | ha->host_no, __func__, ha->flags, ha->dpc_flags)); | |
1022 | DEBUG2(printk("scsi%ld: %s: ha->flags = 0x%08lx\n", | ||
1023 | ha->host_no, __func__, ha->flags)); | ||
1024 | DEBUG2(printk("scsi%ld: %s: ha->dpc_flags = 0x%08lx\n", | ||
1025 | ha->host_no, __func__, ha->dpc_flags)); | ||
1026 | 1015 | ||
1027 | /* Initialization not yet finished. Don't do anything yet. */ | 1016 | /* Initialization not yet finished. Don't do anything yet. */ |
1028 | if (!test_bit(AF_INIT_DONE, &ha->flags)) | 1017 | if (!test_bit(AF_INIT_DONE, &ha->flags)) |
@@ -1032,16 +1021,8 @@ static void qla4xxx_do_dpc(void *data) | |||
1032 | test_bit(DPC_RESET_HA, &ha->dpc_flags) || | 1021 | test_bit(DPC_RESET_HA, &ha->dpc_flags) || |
1033 | test_bit(DPC_RESET_HA_INTR, &ha->dpc_flags) || | 1022 | test_bit(DPC_RESET_HA_INTR, &ha->dpc_flags) || |
1034 | test_bit(DPC_RESET_HA_DESTROY_DDB_LIST, &ha->dpc_flags)) { | 1023 | test_bit(DPC_RESET_HA_DESTROY_DDB_LIST, &ha->dpc_flags)) { |
1035 | if (test_bit(DPC_RESET_HA_DESTROY_DDB_LIST, &ha->dpc_flags)) | 1024 | if (test_bit(DPC_RESET_HA_DESTROY_DDB_LIST, &ha->dpc_flags) || |
1036 | /* | 1025 | test_bit(DPC_RESET_HA, &ha->dpc_flags)) |
1037 | * dg 09/23 Never initialize ddb list | ||
1038 | * once we up and running | ||
1039 | * qla4xxx_recover_adapter(ha, | ||
1040 | * REBUILD_DDB_LIST); | ||
1041 | */ | ||
1042 | qla4xxx_recover_adapter(ha, PRESERVE_DDB_LIST); | ||
1043 | |||
1044 | if (test_bit(DPC_RESET_HA, &ha->dpc_flags)) | ||
1045 | qla4xxx_recover_adapter(ha, PRESERVE_DDB_LIST); | 1026 | qla4xxx_recover_adapter(ha, PRESERVE_DDB_LIST); |
1046 | 1027 | ||
1047 | if (test_and_clear_bit(DPC_RESET_HA_INTR, &ha->dpc_flags)) { | 1028 | if (test_and_clear_bit(DPC_RESET_HA_INTR, &ha->dpc_flags)) { |
@@ -1122,7 +1103,8 @@ static void qla4xxx_free_adapter(struct scsi_qla_host *ha) | |||
1122 | destroy_workqueue(ha->dpc_thread); | 1103 | destroy_workqueue(ha->dpc_thread); |
1123 | 1104 | ||
1124 | /* Issue Soft Reset to put firmware in unknown state */ | 1105 | /* Issue Soft Reset to put firmware in unknown state */ |
1125 | qla4xxx_soft_reset(ha); | 1106 | if (ql4xxx_lock_drvr_wait(ha) == QLA_SUCCESS) |
1107 | qla4xxx_soft_reset(ha); | ||
1126 | 1108 | ||
1127 | /* Remove timer thread, if present */ | 1109 | /* Remove timer thread, if present */ |
1128 | if (ha->timer_active) | 1110 | if (ha->timer_active) |
@@ -1714,7 +1696,7 @@ static int __init qla4xxx_module_init(void) | |||
1714 | 1696 | ||
1715 | /* Derive version string. */ | 1697 | /* Derive version string. */ |
1716 | strcpy(qla4xxx_version_str, QLA4XXX_DRIVER_VERSION); | 1698 | strcpy(qla4xxx_version_str, QLA4XXX_DRIVER_VERSION); |
1717 | if (qla4_extended_error_logging) | 1699 | if (ql4xextended_error_logging) |
1718 | strcat(qla4xxx_version_str, "-debug"); | 1700 | strcat(qla4xxx_version_str, "-debug"); |
1719 | 1701 | ||
1720 | qla4xxx_scsi_transport = | 1702 | qla4xxx_scsi_transport = |
@@ -1724,13 +1706,13 @@ static int __init qla4xxx_module_init(void) | |||
1724 | goto release_srb_cache; | 1706 | goto release_srb_cache; |
1725 | } | 1707 | } |
1726 | 1708 | ||
1727 | printk(KERN_INFO "QLogic iSCSI HBA Driver\n"); | ||
1728 | ret = pci_register_driver(&qla4xxx_pci_driver); | 1709 | ret = pci_register_driver(&qla4xxx_pci_driver); |
1729 | if (ret) | 1710 | if (ret) |
1730 | goto unregister_transport; | 1711 | goto unregister_transport; |
1731 | 1712 | ||
1732 | printk(KERN_INFO "QLogic iSCSI HBA Driver\n"); | 1713 | printk(KERN_INFO "QLogic iSCSI HBA Driver\n"); |
1733 | return 0; | 1714 | return 0; |
1715 | |||
1734 | unregister_transport: | 1716 | unregister_transport: |
1735 | iscsi_unregister_transport(&qla4xxx_iscsi_transport); | 1717 | iscsi_unregister_transport(&qla4xxx_iscsi_transport); |
1736 | release_srb_cache: | 1718 | release_srb_cache: |