aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla4xxx
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2008-01-31 14:36:44 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-02-07 19:02:34 -0500
commitb635930de91be0a217292e3fe381af273e5ffaf7 (patch)
treeb817c8c5f40cf0ba1f58f5bd66ac811132ff5834 /drivers/scsi/qla4xxx
parent6eabafbe6616266e8de61980a7dac5ecc1ba1113 (diff)
[SCSI] qla4xxx: directly call iscsi recovery functions
Qla4xxx can just call the iscsi recovery functions directly. There is no need for userspace to do this for qla4xxx, because we do not use the mutex to iterate over devices anymore and iscsi_block /unblock_session can be called from interrupt context or the dpc thread. And having userspace do this just creates uneeded headaches for qla4xxx root situations where the session may experience problems. For example during the kernel shutdown the scsi layer wants to send sync caches, but at this time userspace is not up (iscsid is not running), so we cannot recover from the problem. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Cc: David Somayajulu <david.somayajulu@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/qla4xxx')
-rw-r--r--drivers/scsi/qla4xxx/ql4_init.c1
-rw-r--r--drivers/scsi/qla4xxx/ql4_os.c40
2 files changed, 5 insertions, 36 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_init.c b/drivers/scsi/qla4xxx/ql4_init.c
index 49925f92555e..10b3b9a620f3 100644
--- a/drivers/scsi/qla4xxx/ql4_init.c
+++ b/drivers/scsi/qla4xxx/ql4_init.c
@@ -1306,6 +1306,7 @@ int qla4xxx_process_ddb_changed(struct scsi_qla_host *ha,
1306 atomic_set(&ddb_entry->relogin_timer, 0); 1306 atomic_set(&ddb_entry->relogin_timer, 0);
1307 clear_bit(DF_RELOGIN, &ddb_entry->flags); 1307 clear_bit(DF_RELOGIN, &ddb_entry->flags);
1308 clear_bit(DF_NO_RELOGIN, &ddb_entry->flags); 1308 clear_bit(DF_NO_RELOGIN, &ddb_entry->flags);
1309 iscsi_unblock_session(ddb_entry->sess);
1309 iscsi_session_event(ddb_entry->sess, 1310 iscsi_session_event(ddb_entry->sess,
1310 ISCSI_KEVENT_CREATE_SESSION); 1311 ISCSI_KEVENT_CREATE_SESSION);
1311 /* 1312 /*
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 2e2b9fedffcc..a87fb9f00ac4 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -63,8 +63,6 @@ static int qla4xxx_sess_get_param(struct iscsi_cls_session *sess,
63 enum iscsi_param param, char *buf); 63 enum iscsi_param param, char *buf);
64static int qla4xxx_host_get_param(struct Scsi_Host *shost, 64static int qla4xxx_host_get_param(struct Scsi_Host *shost,
65 enum iscsi_host_param param, char *buf); 65 enum iscsi_host_param param, char *buf);
66static void qla4xxx_conn_stop(struct iscsi_cls_conn *conn, int flag);
67static int qla4xxx_conn_start(struct iscsi_cls_conn *conn);
68static void qla4xxx_recovery_timedout(struct iscsi_cls_session *session); 66static void qla4xxx_recovery_timedout(struct iscsi_cls_session *session);
69 67
70/* 68/*
@@ -116,8 +114,6 @@ static struct iscsi_transport qla4xxx_iscsi_transport = {
116 .get_conn_param = qla4xxx_conn_get_param, 114 .get_conn_param = qla4xxx_conn_get_param,
117 .get_session_param = qla4xxx_sess_get_param, 115 .get_session_param = qla4xxx_sess_get_param,
118 .get_host_param = qla4xxx_host_get_param, 116 .get_host_param = qla4xxx_host_get_param,
119 .start_conn = qla4xxx_conn_start,
120 .stop_conn = qla4xxx_conn_stop,
121 .session_recovery_timedout = qla4xxx_recovery_timedout, 117 .session_recovery_timedout = qla4xxx_recovery_timedout,
122}; 118};
123 119
@@ -140,38 +136,6 @@ static void qla4xxx_recovery_timedout(struct iscsi_cls_session *session)
140 queue_work(ha->dpc_thread, &ha->dpc_work); 136 queue_work(ha->dpc_thread, &ha->dpc_work);
141} 137}
142 138
143static int qla4xxx_conn_start(struct iscsi_cls_conn *conn)
144{
145 struct iscsi_cls_session *session;
146 struct ddb_entry *ddb_entry;
147
148 session = iscsi_dev_to_session(conn->dev.parent);
149 ddb_entry = session->dd_data;
150
151 DEBUG2(printk("scsi%ld: %s: index [%d] starting conn\n",
152 ddb_entry->ha->host_no, __func__,
153 ddb_entry->fw_ddb_index));
154 iscsi_unblock_session(session);
155 return 0;
156}
157
158static void qla4xxx_conn_stop(struct iscsi_cls_conn *conn, int flag)
159{
160 struct iscsi_cls_session *session;
161 struct ddb_entry *ddb_entry;
162
163 session = iscsi_dev_to_session(conn->dev.parent);
164 ddb_entry = session->dd_data;
165
166 DEBUG2(printk("scsi%ld: %s: index [%d] stopping conn\n",
167 ddb_entry->ha->host_no, __func__,
168 ddb_entry->fw_ddb_index));
169 if (flag == STOP_CONN_RECOVER)
170 iscsi_block_session(session);
171 else
172 printk(KERN_ERR "iscsi: invalid stop flag %d\n", flag);
173}
174
175static int qla4xxx_host_get_param(struct Scsi_Host *shost, 139static int qla4xxx_host_get_param(struct Scsi_Host *shost,
176 enum iscsi_host_param param, char *buf) 140 enum iscsi_host_param param, char *buf)
177{ 141{
@@ -308,6 +272,9 @@ int qla4xxx_add_sess(struct ddb_entry *ddb_entry)
308 DEBUG2(printk(KERN_ERR "Could not add connection.\n")); 272 DEBUG2(printk(KERN_ERR "Could not add connection.\n"));
309 return -ENOMEM; 273 return -ENOMEM;
310 } 274 }
275
276 /* finally ready to go */
277 iscsi_unblock_session(ddb_entry->sess);
311 return 0; 278 return 0;
312} 279}
313 280
@@ -364,6 +331,7 @@ void qla4xxx_mark_device_missing(struct scsi_qla_host *ha,
364 DEBUG3(printk("scsi%d:%d:%d: index [%d] marked MISSING\n", 331 DEBUG3(printk("scsi%d:%d:%d: index [%d] marked MISSING\n",
365 ha->host_no, ddb_entry->bus, ddb_entry->target, 332 ha->host_no, ddb_entry->bus, ddb_entry->target,
366 ddb_entry->fw_ddb_index)); 333 ddb_entry->fw_ddb_index));
334 iscsi_block_session(ddb_entry->sess);
367 iscsi_conn_error(ddb_entry->conn, ISCSI_ERR_CONN_FAILED); 335 iscsi_conn_error(ddb_entry->conn, ISCSI_ERR_CONN_FAILED);
368} 336}
369 337