aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_os.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_os.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c63
1 files changed, 37 insertions, 26 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 2c0876c81a3..c194c23ca1f 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -37,12 +37,12 @@ static struct kmem_cache *srb_cachep;
37static struct kmem_cache *ctx_cachep; 37static struct kmem_cache *ctx_cachep;
38 38
39int ql2xlogintimeout = 20; 39int ql2xlogintimeout = 20;
40module_param(ql2xlogintimeout, int, S_IRUGO|S_IRUSR); 40module_param(ql2xlogintimeout, int, S_IRUGO);
41MODULE_PARM_DESC(ql2xlogintimeout, 41MODULE_PARM_DESC(ql2xlogintimeout,
42 "Login timeout value in seconds."); 42 "Login timeout value in seconds.");
43 43
44int qlport_down_retry; 44int qlport_down_retry;
45module_param(qlport_down_retry, int, S_IRUGO|S_IRUSR); 45module_param(qlport_down_retry, int, S_IRUGO);
46MODULE_PARM_DESC(qlport_down_retry, 46MODULE_PARM_DESC(qlport_down_retry,
47 "Maximum number of command retries to a port that returns " 47 "Maximum number of command retries to a port that returns "
48 "a PORT-DOWN status."); 48 "a PORT-DOWN status.");
@@ -55,12 +55,12 @@ MODULE_PARM_DESC(ql2xplogiabsentdevice,
55 "Default is 0 - no PLOGI. 1 - perfom PLOGI."); 55 "Default is 0 - no PLOGI. 1 - perfom PLOGI.");
56 56
57int ql2xloginretrycount = 0; 57int ql2xloginretrycount = 0;
58module_param(ql2xloginretrycount, int, S_IRUGO|S_IRUSR); 58module_param(ql2xloginretrycount, int, S_IRUGO);
59MODULE_PARM_DESC(ql2xloginretrycount, 59MODULE_PARM_DESC(ql2xloginretrycount,
60 "Specify an alternate value for the NVRAM login retry count."); 60 "Specify an alternate value for the NVRAM login retry count.");
61 61
62int ql2xallocfwdump = 1; 62int ql2xallocfwdump = 1;
63module_param(ql2xallocfwdump, int, S_IRUGO|S_IRUSR); 63module_param(ql2xallocfwdump, int, S_IRUGO);
64MODULE_PARM_DESC(ql2xallocfwdump, 64MODULE_PARM_DESC(ql2xallocfwdump,
65 "Option to enable allocation of memory for a firmware dump " 65 "Option to enable allocation of memory for a firmware dump "
66 "during HBA initialization. Memory allocation requirements " 66 "during HBA initialization. Memory allocation requirements "
@@ -73,7 +73,7 @@ MODULE_PARM_DESC(ql2xextended_error_logging,
73 "Default is 0 - no logging. 1 - log errors."); 73 "Default is 0 - no logging. 1 - log errors.");
74 74
75int ql2xshiftctondsd = 6; 75int ql2xshiftctondsd = 6;
76module_param(ql2xshiftctondsd, int, S_IRUGO|S_IRUSR); 76module_param(ql2xshiftctondsd, int, S_IRUGO);
77MODULE_PARM_DESC(ql2xshiftctondsd, 77MODULE_PARM_DESC(ql2xshiftctondsd,
78 "Set to control shifting of command type processing " 78 "Set to control shifting of command type processing "
79 "based on total number of SG elements."); 79 "based on total number of SG elements.");
@@ -81,7 +81,7 @@ MODULE_PARM_DESC(ql2xshiftctondsd,
81static void qla2x00_free_device(scsi_qla_host_t *); 81static void qla2x00_free_device(scsi_qla_host_t *);
82 82
83int ql2xfdmienable=1; 83int ql2xfdmienable=1;
84module_param(ql2xfdmienable, int, S_IRUGO|S_IRUSR); 84module_param(ql2xfdmienable, int, S_IRUGO);
85MODULE_PARM_DESC(ql2xfdmienable, 85MODULE_PARM_DESC(ql2xfdmienable,
86 "Enables FDMI registrations. " 86 "Enables FDMI registrations. "
87 "0 - no FDMI. Default is 1 - perform FDMI."); 87 "0 - no FDMI. Default is 1 - perform FDMI.");
@@ -106,27 +106,27 @@ MODULE_PARM_DESC(ql2xenablehba_err_chk,
106 " Default is 0 - Error isolation disabled, 1 - Enable it"); 106 " Default is 0 - Error isolation disabled, 1 - Enable it");
107 107
108int ql2xiidmaenable=1; 108int ql2xiidmaenable=1;
109module_param(ql2xiidmaenable, int, S_IRUGO|S_IRUSR); 109module_param(ql2xiidmaenable, int, S_IRUGO);
110MODULE_PARM_DESC(ql2xiidmaenable, 110MODULE_PARM_DESC(ql2xiidmaenable,
111 "Enables iIDMA settings " 111 "Enables iIDMA settings "
112 "Default is 1 - perform iIDMA. 0 - no iIDMA."); 112 "Default is 1 - perform iIDMA. 0 - no iIDMA.");
113 113
114int ql2xmaxqueues = 1; 114int ql2xmaxqueues = 1;
115module_param(ql2xmaxqueues, int, S_IRUGO|S_IRUSR); 115module_param(ql2xmaxqueues, int, S_IRUGO);
116MODULE_PARM_DESC(ql2xmaxqueues, 116MODULE_PARM_DESC(ql2xmaxqueues,
117 "Enables MQ settings " 117 "Enables MQ settings "
118 "Default is 1 for single queue. Set it to number " 118 "Default is 1 for single queue. Set it to number "
119 "of queues in MQ mode."); 119 "of queues in MQ mode.");
120 120
121int ql2xmultique_tag; 121int ql2xmultique_tag;
122module_param(ql2xmultique_tag, int, S_IRUGO|S_IRUSR); 122module_param(ql2xmultique_tag, int, S_IRUGO);
123MODULE_PARM_DESC(ql2xmultique_tag, 123MODULE_PARM_DESC(ql2xmultique_tag,
124 "Enables CPU affinity settings for the driver " 124 "Enables CPU affinity settings for the driver "
125 "Default is 0 for no affinity of request and response IO. " 125 "Default is 0 for no affinity of request and response IO. "
126 "Set it to 1 to turn on the cpu affinity."); 126 "Set it to 1 to turn on the cpu affinity.");
127 127
128int ql2xfwloadbin; 128int ql2xfwloadbin;
129module_param(ql2xfwloadbin, int, S_IRUGO|S_IRUSR); 129module_param(ql2xfwloadbin, int, S_IRUGO);
130MODULE_PARM_DESC(ql2xfwloadbin, 130MODULE_PARM_DESC(ql2xfwloadbin,
131 "Option to specify location from which to load ISP firmware:\n" 131 "Option to specify location from which to load ISP firmware:\n"
132 " 2 -- load firmware via the request_firmware() (hotplug)\n" 132 " 2 -- load firmware via the request_firmware() (hotplug)\n"
@@ -135,39 +135,32 @@ MODULE_PARM_DESC(ql2xfwloadbin,
135 " 0 -- use default semantics.\n"); 135 " 0 -- use default semantics.\n");
136 136
137int ql2xetsenable; 137int ql2xetsenable;
138module_param(ql2xetsenable, int, S_IRUGO|S_IRUSR); 138module_param(ql2xetsenable, int, S_IRUGO);
139MODULE_PARM_DESC(ql2xetsenable, 139MODULE_PARM_DESC(ql2xetsenable,
140 "Enables firmware ETS burst." 140 "Enables firmware ETS burst."
141 "Default is 0 - skip ETS enablement."); 141 "Default is 0 - skip ETS enablement.");
142 142
143int ql2xdbwr = 1; 143int ql2xdbwr = 1;
144module_param(ql2xdbwr, int, S_IRUGO|S_IRUSR); 144module_param(ql2xdbwr, int, S_IRUGO);
145MODULE_PARM_DESC(ql2xdbwr, 145MODULE_PARM_DESC(ql2xdbwr,
146 "Option to specify scheme for request queue posting\n" 146 "Option to specify scheme for request queue posting\n"
147 " 0 -- Regular doorbell.\n" 147 " 0 -- Regular doorbell.\n"
148 " 1 -- CAMRAM doorbell (faster).\n"); 148 " 1 -- CAMRAM doorbell (faster).\n");
149 149
150int ql2xdontresethba;
151module_param(ql2xdontresethba, int, S_IRUGO|S_IRUSR);
152MODULE_PARM_DESC(ql2xdontresethba,
153 "Option to specify reset behaviour\n"
154 " 0 (Default) -- Reset on failure.\n"
155 " 1 -- Do not reset on failure.\n");
156
157int ql2xtargetreset = 1; 150int ql2xtargetreset = 1;
158module_param(ql2xtargetreset, int, S_IRUGO|S_IRUSR); 151module_param(ql2xtargetreset, int, S_IRUGO);
159MODULE_PARM_DESC(ql2xtargetreset, 152MODULE_PARM_DESC(ql2xtargetreset,
160 "Enable target reset." 153 "Enable target reset."
161 "Default is 1 - use hw defaults."); 154 "Default is 1 - use hw defaults.");
162 155
163int ql2xgffidenable; 156int ql2xgffidenable;
164module_param(ql2xgffidenable, int, S_IRUGO|S_IRUSR); 157module_param(ql2xgffidenable, int, S_IRUGO);
165MODULE_PARM_DESC(ql2xgffidenable, 158MODULE_PARM_DESC(ql2xgffidenable,
166 "Enables GFF_ID checks of port type. " 159 "Enables GFF_ID checks of port type. "
167 "Default is 0 - Do not use GFF_ID information."); 160 "Default is 0 - Do not use GFF_ID information.");
168 161
169int ql2xasynctmfenable; 162int ql2xasynctmfenable;
170module_param(ql2xasynctmfenable, int, S_IRUGO|S_IRUSR); 163module_param(ql2xasynctmfenable, int, S_IRUGO);
171MODULE_PARM_DESC(ql2xasynctmfenable, 164MODULE_PARM_DESC(ql2xasynctmfenable,
172 "Enables issue of TM IOCBs asynchronously via IOCB mechanism" 165 "Enables issue of TM IOCBs asynchronously via IOCB mechanism"
173 "Default is 0 - Issue TM IOCBs via mailbox mechanism."); 166 "Default is 0 - Issue TM IOCBs via mailbox mechanism.");
@@ -2371,7 +2364,7 @@ qla2x00_remove_one(struct pci_dev *pdev)
2371 list_for_each_entry(vha, &ha->vp_list, list) { 2364 list_for_each_entry(vha, &ha->vp_list, list) {
2372 atomic_inc(&vha->vref_count); 2365 atomic_inc(&vha->vref_count);
2373 2366
2374 if (vha && vha->fc_vport) { 2367 if (vha->fc_vport) {
2375 spin_unlock_irqrestore(&ha->vport_slock, flags); 2368 spin_unlock_irqrestore(&ha->vport_slock, flags);
2376 2369
2377 fc_vport_terminate(vha->fc_vport); 2370 fc_vport_terminate(vha->fc_vport);
@@ -3386,6 +3379,21 @@ qla2x00_do_dpc(void *data)
3386 clear_bit(FCPORT_UPDATE_NEEDED, &base_vha->dpc_flags); 3379 clear_bit(FCPORT_UPDATE_NEEDED, &base_vha->dpc_flags);
3387 } 3380 }
3388 3381
3382 if (test_bit(ISP_QUIESCE_NEEDED, &base_vha->dpc_flags)) {
3383 DEBUG(printk(KERN_INFO "scsi(%ld): dpc: sched "
3384 "qla2x00_quiesce_needed ha = %p\n",
3385 base_vha->host_no, ha));
3386 qla82xx_device_state_handler(base_vha);
3387 clear_bit(ISP_QUIESCE_NEEDED, &base_vha->dpc_flags);
3388 if (!ha->flags.quiesce_owner) {
3389 qla2x00_perform_loop_resync(base_vha);
3390
3391 qla82xx_idc_lock(ha);
3392 qla82xx_clear_qsnt_ready(base_vha);
3393 qla82xx_idc_unlock(ha);
3394 }
3395 }
3396
3389 if (test_and_clear_bit(RESET_MARKER_NEEDED, 3397 if (test_and_clear_bit(RESET_MARKER_NEEDED,
3390 &base_vha->dpc_flags) && 3398 &base_vha->dpc_flags) &&
3391 (!(test_and_set_bit(RESET_ACTIVE, &base_vha->dpc_flags)))) { 3399 (!(test_and_set_bit(RESET_ACTIVE, &base_vha->dpc_flags)))) {
@@ -3589,13 +3597,16 @@ qla2x00_timer(scsi_qla_host_t *vha)
3589 return; 3597 return;
3590 } 3598 }
3591 3599
3592 if (IS_QLA82XX(ha))
3593 qla82xx_watchdog(vha);
3594
3595 /* Hardware read to raise pending EEH errors during mailbox waits. */ 3600 /* Hardware read to raise pending EEH errors during mailbox waits. */
3596 if (!pci_channel_offline(ha->pdev)) 3601 if (!pci_channel_offline(ha->pdev))
3597 pci_read_config_word(ha->pdev, PCI_VENDOR_ID, &w); 3602 pci_read_config_word(ha->pdev, PCI_VENDOR_ID, &w);
3598 3603
3604 if (IS_QLA82XX(ha)) {
3605 if (test_bit(ISP_QUIESCE_NEEDED, &vha->dpc_flags))
3606 start_dpc++;
3607 qla82xx_watchdog(vha);
3608 }
3609
3599 /* Loop down handler. */ 3610 /* Loop down handler. */
3600 if (atomic_read(&vha->loop_down_timer) > 0 && 3611 if (atomic_read(&vha->loop_down_timer) > 0 &&
3601 !(test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags)) 3612 !(test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags))