aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ibmvscsi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/ibmvscsi')
-rw-r--r--drivers/scsi/ibmvscsi/ibmvfc.c33
-rw-r--r--drivers/scsi/ibmvscsi/ibmvfc.h8
-rw-r--r--drivers/scsi/ibmvscsi/ibmvscsi.c13
3 files changed, 32 insertions, 22 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index ee0739b217b6..ed1e728763a2 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -933,7 +933,7 @@ static void ibmvfc_get_host_speed(struct Scsi_Host *shost)
933 fc_host_speed(shost) = FC_PORTSPEED_16GBIT; 933 fc_host_speed(shost) = FC_PORTSPEED_16GBIT;
934 break; 934 break;
935 default: 935 default:
936 ibmvfc_log(vhost, 3, "Unknown port speed: %ld Gbit\n", 936 ibmvfc_log(vhost, 3, "Unknown port speed: %lld Gbit\n",
937 vhost->login_buf->resp.link_speed / 100); 937 vhost->login_buf->resp.link_speed / 100);
938 fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN; 938 fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN;
939 break; 939 break;
@@ -1322,7 +1322,9 @@ static int ibmvfc_map_sg_data(struct scsi_cmnd *scmd,
1322 &evt->ext_list_token); 1322 &evt->ext_list_token);
1323 1323
1324 if (!evt->ext_list) { 1324 if (!evt->ext_list) {
1325 scmd_printk(KERN_ERR, scmd, "Can't allocate memory for scatterlist\n"); 1325 scsi_dma_unmap(scmd);
1326 if (vhost->log_level > IBMVFC_DEFAULT_LOG_LEVEL)
1327 scmd_printk(KERN_ERR, scmd, "Can't allocate memory for scatterlist\n");
1326 return -ENOMEM; 1328 return -ENOMEM;
1327 } 1329 }
1328 } 1330 }
@@ -1571,9 +1573,6 @@ static int ibmvfc_queuecommand(struct scsi_cmnd *cmnd,
1571 vfc_cmd->resp_len = sizeof(vfc_cmd->rsp); 1573 vfc_cmd->resp_len = sizeof(vfc_cmd->rsp);
1572 vfc_cmd->cancel_key = (unsigned long)cmnd->device->hostdata; 1574 vfc_cmd->cancel_key = (unsigned long)cmnd->device->hostdata;
1573 vfc_cmd->tgt_scsi_id = rport->port_id; 1575 vfc_cmd->tgt_scsi_id = rport->port_id;
1574 if ((rport->supported_classes & FC_COS_CLASS3) &&
1575 (fc_host_supported_classes(vhost->host) & FC_COS_CLASS3))
1576 vfc_cmd->flags = IBMVFC_CLASS_3_ERR;
1577 vfc_cmd->iu.xfer_len = scsi_bufflen(cmnd); 1576 vfc_cmd->iu.xfer_len = scsi_bufflen(cmnd);
1578 int_to_scsilun(cmnd->device->lun, &vfc_cmd->iu.lun); 1577 int_to_scsilun(cmnd->device->lun, &vfc_cmd->iu.lun);
1579 memcpy(vfc_cmd->iu.cdb, cmnd->cmnd, cmnd->cmd_len); 1578 memcpy(vfc_cmd->iu.cdb, cmnd->cmnd, cmnd->cmd_len);
@@ -2149,8 +2148,8 @@ static void ibmvfc_handle_async(struct ibmvfc_async_crq *crq,
2149{ 2148{
2150 const char *desc = ibmvfc_get_ae_desc(crq->event); 2149 const char *desc = ibmvfc_get_ae_desc(crq->event);
2151 2150
2152 ibmvfc_log(vhost, 3, "%s event received. scsi_id: %lx, wwpn: %lx," 2151 ibmvfc_log(vhost, 3, "%s event received. scsi_id: %llx, wwpn: %llx,"
2153 " node_name: %lx\n", desc, crq->scsi_id, crq->wwpn, crq->node_name); 2152 " node_name: %llx\n", desc, crq->scsi_id, crq->wwpn, crq->node_name);
2154 2153
2155 switch (crq->event) { 2154 switch (crq->event) {
2156 case IBMVFC_AE_LINK_UP: 2155 case IBMVFC_AE_LINK_UP:
@@ -2184,7 +2183,7 @@ static void ibmvfc_handle_async(struct ibmvfc_async_crq *crq,
2184 ibmvfc_link_down(vhost, IBMVFC_HALTED); 2183 ibmvfc_link_down(vhost, IBMVFC_HALTED);
2185 break; 2184 break;
2186 default: 2185 default:
2187 dev_err(vhost->dev, "Unknown async event received: %ld\n", crq->event); 2186 dev_err(vhost->dev, "Unknown async event received: %lld\n", crq->event);
2188 break; 2187 break;
2189 }; 2188 };
2190} 2189}
@@ -2261,13 +2260,13 @@ static void ibmvfc_handle_crq(struct ibmvfc_crq *crq, struct ibmvfc_host *vhost)
2261 * actually sent 2260 * actually sent
2262 */ 2261 */
2263 if (unlikely(!ibmvfc_valid_event(&vhost->pool, evt))) { 2262 if (unlikely(!ibmvfc_valid_event(&vhost->pool, evt))) {
2264 dev_err(vhost->dev, "Returned correlation_token 0x%08lx is invalid!\n", 2263 dev_err(vhost->dev, "Returned correlation_token 0x%08llx is invalid!\n",
2265 crq->ioba); 2264 crq->ioba);
2266 return; 2265 return;
2267 } 2266 }
2268 2267
2269 if (unlikely(atomic_read(&evt->free))) { 2268 if (unlikely(atomic_read(&evt->free))) {
2270 dev_err(vhost->dev, "Received duplicate correlation_token 0x%08lx!\n", 2269 dev_err(vhost->dev, "Received duplicate correlation_token 0x%08llx!\n",
2271 crq->ioba); 2270 crq->ioba);
2272 return; 2271 return;
2273 } 2272 }
@@ -3259,11 +3258,12 @@ static int ibmvfc_alloc_target(struct ibmvfc_host *vhost, u64 scsi_id)
3259 3258
3260 tgt = mempool_alloc(vhost->tgt_pool, GFP_KERNEL); 3259 tgt = mempool_alloc(vhost->tgt_pool, GFP_KERNEL);
3261 if (!tgt) { 3260 if (!tgt) {
3262 dev_err(vhost->dev, "Target allocation failure for scsi id %08lx\n", 3261 dev_err(vhost->dev, "Target allocation failure for scsi id %08llx\n",
3263 scsi_id); 3262 scsi_id);
3264 return -ENOMEM; 3263 return -ENOMEM;
3265 } 3264 }
3266 3265
3266 memset(tgt, 0, sizeof(*tgt));
3267 tgt->scsi_id = scsi_id; 3267 tgt->scsi_id = scsi_id;
3268 tgt->new_scsi_id = scsi_id; 3268 tgt->new_scsi_id = scsi_id;
3269 tgt->vhost = vhost; 3269 tgt->vhost = vhost;
@@ -3574,9 +3574,18 @@ static void ibmvfc_log_ae(struct ibmvfc_host *vhost, int events)
3574static void ibmvfc_tgt_add_rport(struct ibmvfc_target *tgt) 3574static void ibmvfc_tgt_add_rport(struct ibmvfc_target *tgt)
3575{ 3575{
3576 struct ibmvfc_host *vhost = tgt->vhost; 3576 struct ibmvfc_host *vhost = tgt->vhost;
3577 struct fc_rport *rport; 3577 struct fc_rport *rport = tgt->rport;
3578 unsigned long flags; 3578 unsigned long flags;
3579 3579
3580 if (rport) {
3581 tgt_dbg(tgt, "Setting rport roles\n");
3582 fc_remote_port_rolechg(rport, tgt->ids.roles);
3583 spin_lock_irqsave(vhost->host->host_lock, flags);
3584 ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_NONE);
3585 spin_unlock_irqrestore(vhost->host->host_lock, flags);
3586 return;
3587 }
3588
3580 tgt_dbg(tgt, "Adding rport\n"); 3589 tgt_dbg(tgt, "Adding rport\n");
3581 rport = fc_remote_port_add(vhost->host, 0, &tgt->ids); 3590 rport = fc_remote_port_add(vhost->host, 0, &tgt->ids);
3582 spin_lock_irqsave(vhost->host->host_lock, flags); 3591 spin_lock_irqsave(vhost->host->host_lock, flags);
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.h b/drivers/scsi/ibmvscsi/ibmvfc.h
index babdf3db59df..b21e071b9862 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.h
+++ b/drivers/scsi/ibmvscsi/ibmvfc.h
@@ -32,7 +32,7 @@
32#define IBMVFC_DRIVER_VERSION "1.0.4" 32#define IBMVFC_DRIVER_VERSION "1.0.4"
33#define IBMVFC_DRIVER_DATE "(November 14, 2008)" 33#define IBMVFC_DRIVER_DATE "(November 14, 2008)"
34 34
35#define IBMVFC_DEFAULT_TIMEOUT 15 35#define IBMVFC_DEFAULT_TIMEOUT 60
36#define IBMVFC_INIT_TIMEOUT 120 36#define IBMVFC_INIT_TIMEOUT 120
37#define IBMVFC_MAX_REQUESTS_DEFAULT 100 37#define IBMVFC_MAX_REQUESTS_DEFAULT 100
38 38
@@ -691,13 +691,13 @@ struct ibmvfc_host {
691#define DBG_CMD(CMD) do { if (ibmvfc_debug) CMD; } while (0) 691#define DBG_CMD(CMD) do { if (ibmvfc_debug) CMD; } while (0)
692 692
693#define tgt_dbg(t, fmt, ...) \ 693#define tgt_dbg(t, fmt, ...) \
694 DBG_CMD(dev_info((t)->vhost->dev, "%lX: " fmt, (t)->scsi_id, ##__VA_ARGS__)) 694 DBG_CMD(dev_info((t)->vhost->dev, "%llX: " fmt, (t)->scsi_id, ##__VA_ARGS__))
695 695
696#define tgt_info(t, fmt, ...) \ 696#define tgt_info(t, fmt, ...) \
697 dev_info((t)->vhost->dev, "%lX: " fmt, (t)->scsi_id, ##__VA_ARGS__) 697 dev_info((t)->vhost->dev, "%llX: " fmt, (t)->scsi_id, ##__VA_ARGS__)
698 698
699#define tgt_err(t, fmt, ...) \ 699#define tgt_err(t, fmt, ...) \
700 dev_err((t)->vhost->dev, "%lX: " fmt, (t)->scsi_id, ##__VA_ARGS__) 700 dev_err((t)->vhost->dev, "%llX: " fmt, (t)->scsi_id, ##__VA_ARGS__)
701 701
702#define ibmvfc_dbg(vhost, ...) \ 702#define ibmvfc_dbg(vhost, ...) \
703 DBG_CMD(dev_info((vhost)->dev, ##__VA_ARGS__)) 703 DBG_CMD(dev_info((vhost)->dev, ##__VA_ARGS__))
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index 5c541f7850f9..c9aa7611e408 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -432,6 +432,7 @@ static int map_sg_data(struct scsi_cmnd *cmd,
432 sdev_printk(KERN_ERR, cmd->device, 432 sdev_printk(KERN_ERR, cmd->device,
433 "Can't allocate memory " 433 "Can't allocate memory "
434 "for indirect table\n"); 434 "for indirect table\n");
435 scsi_dma_unmap(cmd);
435 return 0; 436 return 0;
436 } 437 }
437 } 438 }
@@ -1061,7 +1062,7 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd)
1061 } 1062 }
1062 1063
1063 sdev_printk(KERN_INFO, cmd->device, 1064 sdev_printk(KERN_INFO, cmd->device,
1064 "aborting command. lun 0x%lx, tag 0x%lx\n", 1065 "aborting command. lun 0x%llx, tag 0x%llx\n",
1065 (((u64) lun) << 48), (u64) found_evt); 1066 (((u64) lun) << 48), (u64) found_evt);
1066 1067
1067 wait_for_completion(&evt->comp); 1068 wait_for_completion(&evt->comp);
@@ -1082,7 +1083,7 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd)
1082 if (rsp_rc) { 1083 if (rsp_rc) {
1083 if (printk_ratelimit()) 1084 if (printk_ratelimit())
1084 sdev_printk(KERN_WARNING, cmd->device, 1085 sdev_printk(KERN_WARNING, cmd->device,
1085 "abort code %d for task tag 0x%lx\n", 1086 "abort code %d for task tag 0x%llx\n",
1086 rsp_rc, tsk_mgmt->task_tag); 1087 rsp_rc, tsk_mgmt->task_tag);
1087 return FAILED; 1088 return FAILED;
1088 } 1089 }
@@ -1102,12 +1103,12 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd)
1102 1103
1103 if (found_evt == NULL) { 1104 if (found_evt == NULL) {
1104 spin_unlock_irqrestore(hostdata->host->host_lock, flags); 1105 spin_unlock_irqrestore(hostdata->host->host_lock, flags);
1105 sdev_printk(KERN_INFO, cmd->device, "aborted task tag 0x%lx completed\n", 1106 sdev_printk(KERN_INFO, cmd->device, "aborted task tag 0x%llx completed\n",
1106 tsk_mgmt->task_tag); 1107 tsk_mgmt->task_tag);
1107 return SUCCESS; 1108 return SUCCESS;
1108 } 1109 }
1109 1110
1110 sdev_printk(KERN_INFO, cmd->device, "successfully aborted task tag 0x%lx\n", 1111 sdev_printk(KERN_INFO, cmd->device, "successfully aborted task tag 0x%llx\n",
1111 tsk_mgmt->task_tag); 1112 tsk_mgmt->task_tag);
1112 1113
1113 cmd->result = (DID_ABORT << 16); 1114 cmd->result = (DID_ABORT << 16);
@@ -1182,7 +1183,7 @@ static int ibmvscsi_eh_device_reset_handler(struct scsi_cmnd *cmd)
1182 return FAILED; 1183 return FAILED;
1183 } 1184 }
1184 1185
1185 sdev_printk(KERN_INFO, cmd->device, "resetting device. lun 0x%lx\n", 1186 sdev_printk(KERN_INFO, cmd->device, "resetting device. lun 0x%llx\n",
1186 (((u64) lun) << 48)); 1187 (((u64) lun) << 48));
1187 1188
1188 wait_for_completion(&evt->comp); 1189 wait_for_completion(&evt->comp);
@@ -1203,7 +1204,7 @@ static int ibmvscsi_eh_device_reset_handler(struct scsi_cmnd *cmd)
1203 if (rsp_rc) { 1204 if (rsp_rc) {
1204 if (printk_ratelimit()) 1205 if (printk_ratelimit())
1205 sdev_printk(KERN_WARNING, cmd->device, 1206 sdev_printk(KERN_WARNING, cmd->device,
1206 "reset code %d for task tag 0x%lx\n", 1207 "reset code %d for task tag 0x%llx\n",
1207 rsp_rc, tsk_mgmt->task_tag); 1208 rsp_rc, tsk_mgmt->task_tag);
1208 return FAILED; 1209 return FAILED;
1209 } 1210 }