aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/be2iscsi/be_mgmt.c1
-rw-r--r--drivers/scsi/bnx2i/bnx2i.h2
-rw-r--r--drivers/scsi/bnx2i/bnx2i_init.c13
-rw-r--r--drivers/scsi/bnx2i/bnx2i_iscsi.c13
-rw-r--r--drivers/scsi/dpt_i2o.c15
-rw-r--r--drivers/scsi/ibmvscsi/ibmvscsi.c29
-rw-r--r--drivers/scsi/iscsi_tcp.c2
-rw-r--r--drivers/scsi/lpfc/lpfc_bsg.c4
-rw-r--r--drivers/scsi/qla2xxx/qla_attr.c1
-rw-r--r--drivers/scsi/qla4xxx/ql4_mbx.c2
-rw-r--r--drivers/scsi/wd7000.c2
11 files changed, 42 insertions, 42 deletions
diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c
index 72617b650a7..e641922f20b 100644
--- a/drivers/scsi/be2iscsi/be_mgmt.c
+++ b/drivers/scsi/be2iscsi/be_mgmt.c
@@ -169,6 +169,7 @@ unsigned char mgmt_invalidate_icds(struct beiscsi_hba *phba,
169 SE_DEBUG(DBG_LVL_1, 169 SE_DEBUG(DBG_LVL_1,
170 "Failed to allocate memory for" 170 "Failed to allocate memory for"
171 "mgmt_invalidate_icds \n"); 171 "mgmt_invalidate_icds \n");
172 spin_unlock(&ctrl->mbox_lock);
172 return -1; 173 return -1;
173 } 174 }
174 nonemb_cmd.size = sizeof(struct invalidate_commands_params_in); 175 nonemb_cmd.size = sizeof(struct invalidate_commands_params_in);
diff --git a/drivers/scsi/bnx2i/bnx2i.h b/drivers/scsi/bnx2i/bnx2i.h
index 6cf9dc37d78..6b624e767d3 100644
--- a/drivers/scsi/bnx2i/bnx2i.h
+++ b/drivers/scsi/bnx2i/bnx2i.h
@@ -362,6 +362,7 @@ struct bnx2i_hba {
362 u32 num_ccell; 362 u32 num_ccell;
363 363
364 int ofld_conns_active; 364 int ofld_conns_active;
365 wait_queue_head_t eh_wait;
365 366
366 int max_active_conns; 367 int max_active_conns;
367 struct iscsi_cid_queue cid_que; 368 struct iscsi_cid_queue cid_que;
@@ -381,6 +382,7 @@ struct bnx2i_hba {
381 spinlock_t lock; /* protects hba structure access */ 382 spinlock_t lock; /* protects hba structure access */
382 struct mutex net_dev_lock;/* sync net device access */ 383 struct mutex net_dev_lock;/* sync net device access */
383 384
385 int hba_shutdown_tmo;
384 /* 386 /*
385 * PCI related info. 387 * PCI related info.
386 */ 388 */
diff --git a/drivers/scsi/bnx2i/bnx2i_init.c b/drivers/scsi/bnx2i/bnx2i_init.c
index 6d8172e781c..5d9296c599f 100644
--- a/drivers/scsi/bnx2i/bnx2i_init.c
+++ b/drivers/scsi/bnx2i/bnx2i_init.c
@@ -177,11 +177,22 @@ void bnx2i_stop(void *handle)
177 struct bnx2i_hba *hba = handle; 177 struct bnx2i_hba *hba = handle;
178 178
179 /* check if cleanup happened in GOING_DOWN context */ 179 /* check if cleanup happened in GOING_DOWN context */
180 clear_bit(ADAPTER_STATE_UP, &hba->adapter_state);
181 if (!test_and_clear_bit(ADAPTER_STATE_GOING_DOWN, 180 if (!test_and_clear_bit(ADAPTER_STATE_GOING_DOWN,
182 &hba->adapter_state)) 181 &hba->adapter_state))
183 iscsi_host_for_each_session(hba->shost, 182 iscsi_host_for_each_session(hba->shost,
184 bnx2i_drop_session); 183 bnx2i_drop_session);
184
185 /* Wait for all endpoints to be torn down, Chip will be reset once
186 * control returns to network driver. So it is required to cleanup and
187 * release all connection resources before returning from this routine.
188 */
189 wait_event_interruptible_timeout(hba->eh_wait,
190 (hba->ofld_conns_active == 0),
191 hba->hba_shutdown_tmo);
192 /* This flag should be cleared last so that ep_disconnect() gracefully
193 * cleans up connection context
194 */
195 clear_bit(ADAPTER_STATE_UP, &hba->adapter_state);
185} 196}
186 197
187/** 198/**
diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c
index f2e9b18fe76..fa68ab34b99 100644
--- a/drivers/scsi/bnx2i/bnx2i_iscsi.c
+++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c
@@ -820,6 +820,11 @@ struct bnx2i_hba *bnx2i_alloc_hba(struct cnic_dev *cnic)
820 820
821 spin_lock_init(&hba->lock); 821 spin_lock_init(&hba->lock);
822 mutex_init(&hba->net_dev_lock); 822 mutex_init(&hba->net_dev_lock);
823 init_waitqueue_head(&hba->eh_wait);
824 if (test_bit(BNX2I_NX2_DEV_57710, &hba->cnic_dev_type))
825 hba->hba_shutdown_tmo = 240 * HZ;
826 else /* 5706/5708/5709 */
827 hba->hba_shutdown_tmo = 30 * HZ;
823 828
824 if (iscsi_host_add(shost, &hba->pcidev->dev)) 829 if (iscsi_host_add(shost, &hba->pcidev->dev))
825 goto free_dump_mem; 830 goto free_dump_mem;
@@ -1658,8 +1663,8 @@ static struct iscsi_endpoint *bnx2i_ep_connect(struct Scsi_Host *shost,
1658 */ 1663 */
1659 hba = bnx2i_check_route(dst_addr); 1664 hba = bnx2i_check_route(dst_addr);
1660 1665
1661 if (!hba) { 1666 if (!hba || test_bit(ADAPTER_STATE_GOING_DOWN, &hba->adapter_state)) {
1662 rc = -ENOMEM; 1667 rc = -EINVAL;
1663 goto check_busy; 1668 goto check_busy;
1664 } 1669 }
1665 1670
@@ -1804,7 +1809,7 @@ static int bnx2i_ep_poll(struct iscsi_endpoint *ep, int timeout_ms)
1804 (bnx2i_ep->state == 1809 (bnx2i_ep->state ==
1805 EP_STATE_CONNECT_COMPL)), 1810 EP_STATE_CONNECT_COMPL)),
1806 msecs_to_jiffies(timeout_ms)); 1811 msecs_to_jiffies(timeout_ms));
1807 if (!rc || (bnx2i_ep->state == EP_STATE_OFLD_FAILED)) 1812 if (bnx2i_ep->state == EP_STATE_OFLD_FAILED)
1808 rc = -1; 1813 rc = -1;
1809 1814
1810 if (rc > 0) 1815 if (rc > 0)
@@ -1957,6 +1962,8 @@ return_bnx2i_ep:
1957 1962
1958 if (!hba->ofld_conns_active) 1963 if (!hba->ofld_conns_active)
1959 bnx2i_unreg_dev_all(); 1964 bnx2i_unreg_dev_all();
1965
1966 wake_up_interruptible(&hba->eh_wait);
1960} 1967}
1961 1968
1962 1969
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
index 496764349c4..0435d044c9d 100644
--- a/drivers/scsi/dpt_i2o.c
+++ b/drivers/scsi/dpt_i2o.c
@@ -188,7 +188,8 @@ MODULE_DEVICE_TABLE(pci,dptids);
188static int adpt_detect(struct scsi_host_template* sht) 188static int adpt_detect(struct scsi_host_template* sht)
189{ 189{
190 struct pci_dev *pDev = NULL; 190 struct pci_dev *pDev = NULL;
191 adpt_hba* pHba; 191 adpt_hba *pHba;
192 adpt_hba *next;
192 193
193 PINFO("Detecting Adaptec I2O RAID controllers...\n"); 194 PINFO("Detecting Adaptec I2O RAID controllers...\n");
194 195
@@ -206,7 +207,8 @@ static int adpt_detect(struct scsi_host_template* sht)
206 } 207 }
207 208
208 /* In INIT state, Activate IOPs */ 209 /* In INIT state, Activate IOPs */
209 for (pHba = hba_chain; pHba; pHba = pHba->next) { 210 for (pHba = hba_chain; pHba; pHba = next) {
211 next = pHba->next;
210 // Activate does get status , init outbound, and get hrt 212 // Activate does get status , init outbound, and get hrt
211 if (adpt_i2o_activate_hba(pHba) < 0) { 213 if (adpt_i2o_activate_hba(pHba) < 0) {
212 adpt_i2o_delete_hba(pHba); 214 adpt_i2o_delete_hba(pHba);
@@ -243,7 +245,8 @@ rebuild_sys_tab:
243 PDEBUG("HBA's in OPERATIONAL state\n"); 245 PDEBUG("HBA's in OPERATIONAL state\n");
244 246
245 printk("dpti: If you have a lot of devices this could take a few minutes.\n"); 247 printk("dpti: If you have a lot of devices this could take a few minutes.\n");
246 for (pHba = hba_chain; pHba; pHba = pHba->next) { 248 for (pHba = hba_chain; pHba; pHba = next) {
249 next = pHba->next;
247 printk(KERN_INFO"%s: Reading the hardware resource table.\n", pHba->name); 250 printk(KERN_INFO"%s: Reading the hardware resource table.\n", pHba->name);
248 if (adpt_i2o_lct_get(pHba) < 0){ 251 if (adpt_i2o_lct_get(pHba) < 0){
249 adpt_i2o_delete_hba(pHba); 252 adpt_i2o_delete_hba(pHba);
@@ -263,7 +266,8 @@ rebuild_sys_tab:
263 adpt_sysfs_class = NULL; 266 adpt_sysfs_class = NULL;
264 } 267 }
265 268
266 for (pHba = hba_chain; pHba; pHba = pHba->next) { 269 for (pHba = hba_chain; pHba; pHba = next) {
270 next = pHba->next;
267 if (adpt_scsi_host_alloc(pHba, sht) < 0){ 271 if (adpt_scsi_host_alloc(pHba, sht) < 0){
268 adpt_i2o_delete_hba(pHba); 272 adpt_i2o_delete_hba(pHba);
269 continue; 273 continue;
@@ -1229,11 +1233,10 @@ static void adpt_i2o_delete_hba(adpt_hba* pHba)
1229 } 1233 }
1230 } 1234 }
1231 pci_dev_put(pHba->pDev); 1235 pci_dev_put(pHba->pDev);
1232 kfree(pHba);
1233
1234 if (adpt_sysfs_class) 1236 if (adpt_sysfs_class)
1235 device_destroy(adpt_sysfs_class, 1237 device_destroy(adpt_sysfs_class,
1236 MKDEV(DPTI_I2O_MAJOR, pHba->unit)); 1238 MKDEV(DPTI_I2O_MAJOR, pHba->unit));
1239 kfree(pHba);
1237 1240
1238 if(hba_count <= 0){ 1241 if(hba_count <= 0){
1239 unregister_chrdev(DPTI_I2O_MAJOR, DPT_DRIVER); 1242 unregister_chrdev(DPTI_I2O_MAJOR, DPT_DRIVER);
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index ff5ec5ac1fb..88bad0e81bd 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -323,16 +323,6 @@ static void set_srp_direction(struct scsi_cmnd *cmd,
323 srp_cmd->buf_fmt = fmt; 323 srp_cmd->buf_fmt = fmt;
324} 324}
325 325
326static void unmap_sg_list(int num_entries,
327 struct device *dev,
328 struct srp_direct_buf *md)
329{
330 int i;
331
332 for (i = 0; i < num_entries; ++i)
333 dma_unmap_single(dev, md[i].va, md[i].len, DMA_BIDIRECTIONAL);
334}
335
336/** 326/**
337 * unmap_cmd_data: - Unmap data pointed in srp_cmd based on the format 327 * unmap_cmd_data: - Unmap data pointed in srp_cmd based on the format
338 * @cmd: srp_cmd whose additional_data member will be unmapped 328 * @cmd: srp_cmd whose additional_data member will be unmapped
@@ -350,24 +340,9 @@ static void unmap_cmd_data(struct srp_cmd *cmd,
350 340
351 if (out_fmt == SRP_NO_DATA_DESC && in_fmt == SRP_NO_DATA_DESC) 341 if (out_fmt == SRP_NO_DATA_DESC && in_fmt == SRP_NO_DATA_DESC)
352 return; 342 return;
353 else if (out_fmt == SRP_DATA_DESC_DIRECT ||
354 in_fmt == SRP_DATA_DESC_DIRECT) {
355 struct srp_direct_buf *data =
356 (struct srp_direct_buf *) cmd->add_data;
357 dma_unmap_single(dev, data->va, data->len, DMA_BIDIRECTIONAL);
358 } else {
359 struct srp_indirect_buf *indirect =
360 (struct srp_indirect_buf *) cmd->add_data;
361 int num_mapped = indirect->table_desc.len /
362 sizeof(struct srp_direct_buf);
363 343
364 if (num_mapped <= MAX_INDIRECT_BUFS) { 344 if (evt_struct->cmnd)
365 unmap_sg_list(num_mapped, dev, &indirect->desc_list[0]); 345 scsi_dma_unmap(evt_struct->cmnd);
366 return;
367 }
368
369 unmap_sg_list(num_mapped, dev, evt_struct->ext_list);
370 }
371} 346}
372 347
373static int map_sg_list(struct scsi_cmnd *cmd, int nseg, 348static int map_sg_list(struct scsi_cmnd *cmd, int nseg,
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index 0ee725ced51..02143af7c1a 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -599,7 +599,7 @@ static void iscsi_sw_tcp_conn_stop(struct iscsi_cls_conn *cls_conn, int flag)
599 set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_rx); 599 set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_rx);
600 write_unlock_bh(&tcp_sw_conn->sock->sk->sk_callback_lock); 600 write_unlock_bh(&tcp_sw_conn->sock->sk->sk_callback_lock);
601 601
602 if (sock->sk->sk_sleep && waitqueue_active(sock->sk->sk_sleep)) { 602 if (sock->sk->sk_sleep) {
603 sock->sk->sk_err = EIO; 603 sock->sk->sk_err = EIO;
604 wake_up_interruptible(sock->sk->sk_sleep); 604 wake_up_interruptible(sock->sk->sk_sleep);
605 } 605 }
diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c
index ec3723831e8..d62b3e46792 100644
--- a/drivers/scsi/lpfc/lpfc_bsg.c
+++ b/drivers/scsi/lpfc/lpfc_bsg.c
@@ -433,7 +433,7 @@ lpfc_bsg_rport_els_cmp(struct lpfc_hba *phba,
433 dd_data = cmdiocbq->context1; 433 dd_data = cmdiocbq->context1;
434 /* normal completion and timeout crossed paths, already done */ 434 /* normal completion and timeout crossed paths, already done */
435 if (!dd_data) { 435 if (!dd_data) {
436 spin_unlock_irqrestore(&phba->hbalock, flags); 436 spin_unlock_irqrestore(&phba->ct_ev_lock, flags);
437 return; 437 return;
438 } 438 }
439 439
@@ -1196,7 +1196,7 @@ lpfc_issue_ct_rsp_cmp(struct lpfc_hba *phba,
1196 dd_data = cmdiocbq->context1; 1196 dd_data = cmdiocbq->context1;
1197 /* normal completion and timeout crossed paths, already done */ 1197 /* normal completion and timeout crossed paths, already done */
1198 if (!dd_data) { 1198 if (!dd_data) {
1199 spin_unlock_irqrestore(&phba->hbalock, flags); 1199 spin_unlock_irqrestore(&phba->ct_ev_lock, flags);
1200 return; 1200 return;
1201 } 1201 }
1202 1202
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 359e9a71a02..1c7ef55966f 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -2393,6 +2393,7 @@ qla24xx_bsg_timeout(struct fc_bsg_job *bsg_job)
2393 return 0; 2393 return 0;
2394 2394
2395done: 2395done:
2396 spin_unlock_irqrestore(&ha->hardware_lock, flags);
2396 if (bsg_job->request->msgcode == FC_BSG_HST_CT) 2397 if (bsg_job->request->msgcode == FC_BSG_HST_CT)
2397 kfree(sp->fcport); 2398 kfree(sp->fcport);
2398 kfree(sp->ctx); 2399 kfree(sp->ctx);
diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
index 09d6d4b76f3..caeb7d10ae0 100644
--- a/drivers/scsi/qla4xxx/ql4_mbx.c
+++ b/drivers/scsi/qla4xxx/ql4_mbx.c
@@ -467,7 +467,7 @@ int qla4xxx_get_fwddb_entry(struct scsi_qla_host *ha,
467 if (conn_err_detail) 467 if (conn_err_detail)
468 *conn_err_detail = mbox_sts[5]; 468 *conn_err_detail = mbox_sts[5];
469 if (tcp_source_port_num) 469 if (tcp_source_port_num)
470 *tcp_source_port_num = (uint16_t) mbox_sts[6] >> 16; 470 *tcp_source_port_num = (uint16_t) (mbox_sts[6] >> 16);
471 if (connection_id) 471 if (connection_id)
472 *connection_id = (uint16_t) mbox_sts[6] & 0x00FF; 472 *connection_id = (uint16_t) mbox_sts[6] & 0x00FF;
473 status = QLA_SUCCESS; 473 status = QLA_SUCCESS;
diff --git a/drivers/scsi/wd7000.c b/drivers/scsi/wd7000.c
index d0b7d2ff9ac..333580bf37c 100644
--- a/drivers/scsi/wd7000.c
+++ b/drivers/scsi/wd7000.c
@@ -1587,7 +1587,7 @@ static int wd7000_host_reset(struct scsi_cmnd *SCpnt)
1587{ 1587{
1588 Adapter *host = (Adapter *) SCpnt->device->host->hostdata; 1588 Adapter *host = (Adapter *) SCpnt->device->host->hostdata;
1589 1589
1590 spin_unlock_irq(SCpnt->device->host->host_lock); 1590 spin_lock_irq(SCpnt->device->host->host_lock);
1591 1591
1592 if (wd7000_adapter_reset(host) < 0) { 1592 if (wd7000_adapter_reset(host) < 0) {
1593 spin_unlock_irq(SCpnt->device->host->host_lock); 1593 spin_unlock_irq(SCpnt->device->host->host_lock);