Commit a28ca3f3 authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6:
  [SCSI] bnx2i: Bug fixes related to MTU change issue when there are active iscsi sessions
  [SCSI] ibmvscsi: fix DMA API misuse
  [SCSI] wd7000: fix reset handler typo spin_unlock_irq() => spin_lock_irq()
  [SCSI] zfcp: Fix tracing of requests with error status
  [SCSI] zfcp: Update MAINTAINERS entry
  [SCSI] iscsi_tcp: fix relogin/shutdown hang
  [SCSI] qla2xxx: fix lock imbalance
  [SCSI] lpfc: fix lock imbalances
  [SCSI] be2iscsi: fix lock imbalance
  [SCSI] dpt_i2o: several use after free issues
parents 61fb06cc 490475a9
...@@ -4791,12 +4791,11 @@ F: drivers/s390/crypto/ ...@@ -4791,12 +4791,11 @@ F: drivers/s390/crypto/
S390 ZFCP DRIVER S390 ZFCP DRIVER
M: Christof Schmitt <christof.schmitt@de.ibm.com> M: Christof Schmitt <christof.schmitt@de.ibm.com>
M: Martin Peschke <mp3@de.ibm.com> M: Swen Schillig <swen@vnet.ibm.com>
M: linux390@de.ibm.com M: linux390@de.ibm.com
L: linux-s390@vger.kernel.org L: linux-s390@vger.kernel.org
W: http://www.ibm.com/developerworks/linux/linux390/ W: http://www.ibm.com/developerworks/linux/linux390/
S: Supported S: Supported
F: Documentation/s390/zfcpdump.txt
F: drivers/s390/scsi/zfcp_* F: drivers/s390/scsi/zfcp_*
S390 IUCV NETWORK LAYER S390 IUCV NETWORK LAYER
......
...@@ -2105,7 +2105,8 @@ static void zfcp_fsf_req_trace(struct zfcp_fsf_req *req, struct scsi_cmnd *scsi) ...@@ -2105,7 +2105,8 @@ static void zfcp_fsf_req_trace(struct zfcp_fsf_req *req, struct scsi_cmnd *scsi)
blktrc.inb_usage = req->qdio_req.qdio_inb_usage; blktrc.inb_usage = req->qdio_req.qdio_inb_usage;
blktrc.outb_usage = req->qdio_req.qdio_outb_usage; blktrc.outb_usage = req->qdio_req.qdio_outb_usage;
if (req->adapter->adapter_features & FSF_FEATURE_MEASUREMENT_DATA) { if (req->adapter->adapter_features & FSF_FEATURE_MEASUREMENT_DATA &&
!(req->status & ZFCP_STATUS_FSFREQ_ERROR)) {
blktrc.flags |= ZFCP_BLK_LAT_VALID; blktrc.flags |= ZFCP_BLK_LAT_VALID;
blktrc.channel_lat = lat_in->channel_lat * ticks; blktrc.channel_lat = lat_in->channel_lat * ticks;
blktrc.fabric_lat = lat_in->fabric_lat * ticks; blktrc.fabric_lat = lat_in->fabric_lat * ticks;
...@@ -2157,9 +2158,8 @@ static void zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *req) ...@@ -2157,9 +2158,8 @@ static void zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *req)
fcp_rsp = (struct fcp_resp_with_ext *) &req->qtcb->bottom.io.fcp_rsp; fcp_rsp = (struct fcp_resp_with_ext *) &req->qtcb->bottom.io.fcp_rsp;
zfcp_fc_eval_fcp_rsp(fcp_rsp, scpnt); zfcp_fc_eval_fcp_rsp(fcp_rsp, scpnt);
zfcp_fsf_req_trace(req, scpnt);
skip_fsfstatus: skip_fsfstatus:
zfcp_fsf_req_trace(req, scpnt);
zfcp_dbf_scsi_result(req->adapter->dbf, scpnt, req); zfcp_dbf_scsi_result(req->adapter->dbf, scpnt, req);
scpnt->host_scribble = NULL; scpnt->host_scribble = NULL;
......
...@@ -169,6 +169,7 @@ unsigned char mgmt_invalidate_icds(struct beiscsi_hba *phba, ...@@ -169,6 +169,7 @@ unsigned char mgmt_invalidate_icds(struct beiscsi_hba *phba,
SE_DEBUG(DBG_LVL_1, SE_DEBUG(DBG_LVL_1,
"Failed to allocate memory for" "Failed to allocate memory for"
"mgmt_invalidate_icds \n"); "mgmt_invalidate_icds \n");
spin_unlock(&ctrl->mbox_lock);
return -1; return -1;
} }
nonemb_cmd.size = sizeof(struct invalidate_commands_params_in); nonemb_cmd.size = sizeof(struct invalidate_commands_params_in);
......
...@@ -362,6 +362,7 @@ struct bnx2i_hba { ...@@ -362,6 +362,7 @@ struct bnx2i_hba {
u32 num_ccell; u32 num_ccell;
int ofld_conns_active; int ofld_conns_active;
wait_queue_head_t eh_wait;
int max_active_conns; int max_active_conns;
struct iscsi_cid_queue cid_que; struct iscsi_cid_queue cid_que;
...@@ -381,6 +382,7 @@ struct bnx2i_hba { ...@@ -381,6 +382,7 @@ struct bnx2i_hba {
spinlock_t lock; /* protects hba structure access */ spinlock_t lock; /* protects hba structure access */
struct mutex net_dev_lock;/* sync net device access */ struct mutex net_dev_lock;/* sync net device access */
int hba_shutdown_tmo;
/* /*
* PCI related info. * PCI related info.
*/ */
......
...@@ -177,11 +177,22 @@ void bnx2i_stop(void *handle) ...@@ -177,11 +177,22 @@ void bnx2i_stop(void *handle)
struct bnx2i_hba *hba = handle; struct bnx2i_hba *hba = handle;
/* check if cleanup happened in GOING_DOWN context */ /* check if cleanup happened in GOING_DOWN context */
clear_bit(ADAPTER_STATE_UP, &hba->adapter_state);
if (!test_and_clear_bit(ADAPTER_STATE_GOING_DOWN, if (!test_and_clear_bit(ADAPTER_STATE_GOING_DOWN,
&hba->adapter_state)) &hba->adapter_state))
iscsi_host_for_each_session(hba->shost, iscsi_host_for_each_session(hba->shost,
bnx2i_drop_session); bnx2i_drop_session);
/* Wait for all endpoints to be torn down, Chip will be reset once
* control returns to network driver. So it is required to cleanup and
* release all connection resources before returning from this routine.
*/
wait_event_interruptible_timeout(hba->eh_wait,
(hba->ofld_conns_active == 0),
hba->hba_shutdown_tmo);
/* This flag should be cleared last so that ep_disconnect() gracefully
* cleans up connection context
*/
clear_bit(ADAPTER_STATE_UP, &hba->adapter_state);
} }
/** /**
......
...@@ -820,6 +820,11 @@ struct bnx2i_hba *bnx2i_alloc_hba(struct cnic_dev *cnic) ...@@ -820,6 +820,11 @@ struct bnx2i_hba *bnx2i_alloc_hba(struct cnic_dev *cnic)
spin_lock_init(&hba->lock); spin_lock_init(&hba->lock);
mutex_init(&hba->net_dev_lock); mutex_init(&hba->net_dev_lock);
init_waitqueue_head(&hba->eh_wait);
if (test_bit(BNX2I_NX2_DEV_57710, &hba->cnic_dev_type))
hba->hba_shutdown_tmo = 240 * HZ;
else /* 5706/5708/5709 */
hba->hba_shutdown_tmo = 30 * HZ;
if (iscsi_host_add(shost, &hba->pcidev->dev)) if (iscsi_host_add(shost, &hba->pcidev->dev))
goto free_dump_mem; goto free_dump_mem;
...@@ -1658,8 +1663,8 @@ static struct iscsi_endpoint *bnx2i_ep_connect(struct Scsi_Host *shost, ...@@ -1658,8 +1663,8 @@ static struct iscsi_endpoint *bnx2i_ep_connect(struct Scsi_Host *shost,
*/ */
hba = bnx2i_check_route(dst_addr); hba = bnx2i_check_route(dst_addr);
if (!hba) { if (!hba || test_bit(ADAPTER_STATE_GOING_DOWN, &hba->adapter_state)) {
rc = -ENOMEM; rc = -EINVAL;
goto check_busy; goto check_busy;
} }
...@@ -1804,7 +1809,7 @@ static int bnx2i_ep_poll(struct iscsi_endpoint *ep, int timeout_ms) ...@@ -1804,7 +1809,7 @@ static int bnx2i_ep_poll(struct iscsi_endpoint *ep, int timeout_ms)
(bnx2i_ep->state == (bnx2i_ep->state ==
EP_STATE_CONNECT_COMPL)), EP_STATE_CONNECT_COMPL)),
msecs_to_jiffies(timeout_ms)); msecs_to_jiffies(timeout_ms));
if (!rc || (bnx2i_ep->state == EP_STATE_OFLD_FAILED)) if (bnx2i_ep->state == EP_STATE_OFLD_FAILED)
rc = -1; rc = -1;
if (rc > 0) if (rc > 0)
...@@ -1957,6 +1962,8 @@ static void bnx2i_ep_disconnect(struct iscsi_endpoint *ep) ...@@ -1957,6 +1962,8 @@ static void bnx2i_ep_disconnect(struct iscsi_endpoint *ep)
if (!hba->ofld_conns_active) if (!hba->ofld_conns_active)
bnx2i_unreg_dev_all(); bnx2i_unreg_dev_all();
wake_up_interruptible(&hba->eh_wait);
} }
......
...@@ -188,7 +188,8 @@ MODULE_DEVICE_TABLE(pci,dptids); ...@@ -188,7 +188,8 @@ MODULE_DEVICE_TABLE(pci,dptids);
static int adpt_detect(struct scsi_host_template* sht) static int adpt_detect(struct scsi_host_template* sht)
{ {
struct pci_dev *pDev = NULL; struct pci_dev *pDev = NULL;
adpt_hba* pHba; adpt_hba *pHba;
adpt_hba *next;
PINFO("Detecting Adaptec I2O RAID controllers...\n"); PINFO("Detecting Adaptec I2O RAID controllers...\n");
...@@ -206,7 +207,8 @@ static int adpt_detect(struct scsi_host_template* sht) ...@@ -206,7 +207,8 @@ static int adpt_detect(struct scsi_host_template* sht)
} }
/* In INIT state, Activate IOPs */ /* In INIT state, Activate IOPs */
for (pHba = hba_chain; pHba; pHba = pHba->next) { for (pHba = hba_chain; pHba; pHba = next) {
next = pHba->next;
// Activate does get status , init outbound, and get hrt // Activate does get status , init outbound, and get hrt
if (adpt_i2o_activate_hba(pHba) < 0) { if (adpt_i2o_activate_hba(pHba) < 0) {
adpt_i2o_delete_hba(pHba); adpt_i2o_delete_hba(pHba);
...@@ -243,7 +245,8 @@ static int adpt_detect(struct scsi_host_template* sht) ...@@ -243,7 +245,8 @@ static int adpt_detect(struct scsi_host_template* sht)
PDEBUG("HBA's in OPERATIONAL state\n"); PDEBUG("HBA's in OPERATIONAL state\n");
printk("dpti: If you have a lot of devices this could take a few minutes.\n"); printk("dpti: If you have a lot of devices this could take a few minutes.\n");
for (pHba = hba_chain; pHba; pHba = pHba->next) { for (pHba = hba_chain; pHba; pHba = next) {
next = pHba->next;
printk(KERN_INFO"%s: Reading the hardware resource table.\n", pHba->name); printk(KERN_INFO"%s: Reading the hardware resource table.\n", pHba->name);
if (adpt_i2o_lct_get(pHba) < 0){ if (adpt_i2o_lct_get(pHba) < 0){
adpt_i2o_delete_hba(pHba); adpt_i2o_delete_hba(pHba);
...@@ -263,7 +266,8 @@ static int adpt_detect(struct scsi_host_template* sht) ...@@ -263,7 +266,8 @@ static int adpt_detect(struct scsi_host_template* sht)
adpt_sysfs_class = NULL; adpt_sysfs_class = NULL;
} }
for (pHba = hba_chain; pHba; pHba = pHba->next) { for (pHba = hba_chain; pHba; pHba = next) {
next = pHba->next;
if (adpt_scsi_host_alloc(pHba, sht) < 0){ if (adpt_scsi_host_alloc(pHba, sht) < 0){
adpt_i2o_delete_hba(pHba); adpt_i2o_delete_hba(pHba);
continue; continue;
...@@ -1229,11 +1233,10 @@ static void adpt_i2o_delete_hba(adpt_hba* pHba) ...@@ -1229,11 +1233,10 @@ static void adpt_i2o_delete_hba(adpt_hba* pHba)
} }
} }
pci_dev_put(pHba->pDev); pci_dev_put(pHba->pDev);
kfree(pHba);
if (adpt_sysfs_class) if (adpt_sysfs_class)
device_destroy(adpt_sysfs_class, device_destroy(adpt_sysfs_class,
MKDEV(DPTI_I2O_MAJOR, pHba->unit)); MKDEV(DPTI_I2O_MAJOR, pHba->unit));
kfree(pHba);
if(hba_count <= 0){ if(hba_count <= 0){
unregister_chrdev(DPTI_I2O_MAJOR, DPT_DRIVER); unregister_chrdev(DPTI_I2O_MAJOR, DPT_DRIVER);
......
...@@ -323,16 +323,6 @@ static void set_srp_direction(struct scsi_cmnd *cmd, ...@@ -323,16 +323,6 @@ static void set_srp_direction(struct scsi_cmnd *cmd,
srp_cmd->buf_fmt = fmt; srp_cmd->buf_fmt = fmt;
} }
static void unmap_sg_list(int num_entries,
struct device *dev,
struct srp_direct_buf *md)
{
int i;
for (i = 0; i < num_entries; ++i)
dma_unmap_single(dev, md[i].va, md[i].len, DMA_BIDIRECTIONAL);
}
/** /**
* unmap_cmd_data: - Unmap data pointed in srp_cmd based on the format * unmap_cmd_data: - Unmap data pointed in srp_cmd based on the format
* @cmd: srp_cmd whose additional_data member will be unmapped * @cmd: srp_cmd whose additional_data member will be unmapped
...@@ -350,24 +340,9 @@ static void unmap_cmd_data(struct srp_cmd *cmd, ...@@ -350,24 +340,9 @@ static void unmap_cmd_data(struct srp_cmd *cmd,
if (out_fmt == SRP_NO_DATA_DESC && in_fmt == SRP_NO_DATA_DESC) if (out_fmt == SRP_NO_DATA_DESC && in_fmt == SRP_NO_DATA_DESC)
return; return;
else if (out_fmt == SRP_DATA_DESC_DIRECT ||
in_fmt == SRP_DATA_DESC_DIRECT) {
struct srp_direct_buf *data =
(struct srp_direct_buf *) cmd->add_data;
dma_unmap_single(dev, data->va, data->len, DMA_BIDIRECTIONAL);
} else {
struct srp_indirect_buf *indirect =
(struct srp_indirect_buf *) cmd->add_data;
int num_mapped = indirect->table_desc.len /
sizeof(struct srp_direct_buf);
if (num_mapped <= MAX_INDIRECT_BUFS) { if (evt_struct->cmnd)
unmap_sg_list(num_mapped, dev, &indirect->desc_list[0]); scsi_dma_unmap(evt_struct->cmnd);
return;
}
unmap_sg_list(num_mapped, dev, evt_struct->ext_list);
}
} }
static int map_sg_list(struct scsi_cmnd *cmd, int nseg, static int map_sg_list(struct scsi_cmnd *cmd, int nseg,
......
...@@ -599,7 +599,7 @@ static void iscsi_sw_tcp_conn_stop(struct iscsi_cls_conn *cls_conn, int flag) ...@@ -599,7 +599,7 @@ static void iscsi_sw_tcp_conn_stop(struct iscsi_cls_conn *cls_conn, int flag)
set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_rx); set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_rx);
write_unlock_bh(&tcp_sw_conn->sock->sk->sk_callback_lock); write_unlock_bh(&tcp_sw_conn->sock->sk->sk_callback_lock);
if (sock->sk->sk_sleep && waitqueue_active(sock->sk->sk_sleep)) { if (sock->sk->sk_sleep) {
sock->sk->sk_err = EIO; sock->sk->sk_err = EIO;
wake_up_interruptible(sock->sk->sk_sleep); wake_up_interruptible(sock->sk->sk_sleep);
} }
......
...@@ -433,7 +433,7 @@ lpfc_bsg_rport_els_cmp(struct lpfc_hba *phba, ...@@ -433,7 +433,7 @@ lpfc_bsg_rport_els_cmp(struct lpfc_hba *phba,
dd_data = cmdiocbq->context1; dd_data = cmdiocbq->context1;
/* normal completion and timeout crossed paths, already done */ /* normal completion and timeout crossed paths, already done */
if (!dd_data) { if (!dd_data) {
spin_unlock_irqrestore(&phba->hbalock, flags); spin_unlock_irqrestore(&phba->ct_ev_lock, flags);
return; return;
} }
...@@ -1196,7 +1196,7 @@ lpfc_issue_ct_rsp_cmp(struct lpfc_hba *phba, ...@@ -1196,7 +1196,7 @@ lpfc_issue_ct_rsp_cmp(struct lpfc_hba *phba,
dd_data = cmdiocbq->context1; dd_data = cmdiocbq->context1;
/* normal completion and timeout crossed paths, already done */ /* normal completion and timeout crossed paths, already done */
if (!dd_data) { if (!dd_data) {
spin_unlock_irqrestore(&phba->hbalock, flags); spin_unlock_irqrestore(&phba->ct_ev_lock, flags);
return; return;
} }
......
...@@ -2393,6 +2393,7 @@ qla24xx_bsg_timeout(struct fc_bsg_job *bsg_job) ...@@ -2393,6 +2393,7 @@ qla24xx_bsg_timeout(struct fc_bsg_job *bsg_job)
return 0; return 0;
done: done:
spin_unlock_irqrestore(&ha->hardware_lock, flags);
if (bsg_job->request->msgcode == FC_BSG_HST_CT) if (bsg_job->request->msgcode == FC_BSG_HST_CT)
kfree(sp->fcport); kfree(sp->fcport);
kfree(sp->ctx); kfree(sp->ctx);
......
...@@ -1587,7 +1587,7 @@ static int wd7000_host_reset(struct scsi_cmnd *SCpnt) ...@@ -1587,7 +1587,7 @@ static int wd7000_host_reset(struct scsi_cmnd *SCpnt)
{ {
Adapter *host = (Adapter *) SCpnt->device->host->hostdata; Adapter *host = (Adapter *) SCpnt->device->host->hostdata;
spin_unlock_irq(SCpnt->device->host->host_lock); spin_lock_irq(SCpnt->device->host->host_lock);
if (wd7000_adapter_reset(host) < 0) { if (wd7000_adapter_reset(host) < 0) {
spin_unlock_irq(SCpnt->device->host->host_lock); spin_unlock_irq(SCpnt->device->host->host_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment