diff options
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_scsi.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_scsi.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index dafabeefc5b3..f93799873721 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************* | 1 | /******************************************************************* |
2 | * This file is part of the Emulex Linux Device Driver for * | 2 | * This file is part of the Emulex Linux Device Driver for * |
3 | * Fibre Channel Host Bus Adapters. * | 3 | * Fibre Channel Host Bus Adapters. * |
4 | * Copyright (C) 2004-2005 Emulex. All rights reserved. * | 4 | * Copyright (C) 2004-2006 Emulex. All rights reserved. * |
5 | * EMULEX and SLI are trademarks of Emulex. * | 5 | * EMULEX and SLI are trademarks of Emulex. * |
6 | * www.emulex.com * | 6 | * www.emulex.com * |
7 | * Portions Copyright (C) 2004-2005 Christoph Hellwig * | 7 | * Portions Copyright (C) 2004-2005 Christoph Hellwig * |
@@ -467,7 +467,12 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn, | |||
467 | sdev = cmd->device; | 467 | sdev = cmd->device; |
468 | cmd->scsi_done(cmd); | 468 | cmd->scsi_done(cmd); |
469 | 469 | ||
470 | if (!result && | 470 | if (phba->cfg_poll & ENABLE_FCP_RING_POLLING) { |
471 | lpfc_release_scsi_buf(phba, lpfc_cmd); | ||
472 | return; | ||
473 | } | ||
474 | |||
475 | if (!result && pnode != NULL && | ||
471 | ((jiffies - pnode->last_ramp_up_time) > | 476 | ((jiffies - pnode->last_ramp_up_time) > |
472 | LPFC_Q_RAMP_UP_INTERVAL * HZ) && | 477 | LPFC_Q_RAMP_UP_INTERVAL * HZ) && |
473 | ((jiffies - pnode->last_q_full_time) > | 478 | ((jiffies - pnode->last_q_full_time) > |
@@ -495,7 +500,7 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn, | |||
495 | * Check for queue full. If the lun is reporting queue full, then | 500 | * Check for queue full. If the lun is reporting queue full, then |
496 | * back off the lun queue depth to prevent target overloads. | 501 | * back off the lun queue depth to prevent target overloads. |
497 | */ | 502 | */ |
498 | if (result == SAM_STAT_TASK_SET_FULL) { | 503 | if (result == SAM_STAT_TASK_SET_FULL && pnode != NULL) { |
499 | pnode->last_q_full_time = jiffies; | 504 | pnode->last_q_full_time = jiffies; |
500 | 505 | ||
501 | shost_for_each_device(tmp_sdev, sdev->host) { | 506 | shost_for_each_device(tmp_sdev, sdev->host) { |
@@ -743,7 +748,7 @@ lpfc_scsi_tgt_reset(struct lpfc_scsi_buf * lpfc_cmd, struct lpfc_hba * phba) | |||
743 | const char * | 748 | const char * |
744 | lpfc_info(struct Scsi_Host *host) | 749 | lpfc_info(struct Scsi_Host *host) |
745 | { | 750 | { |
746 | struct lpfc_hba *phba = (struct lpfc_hba *) host->hostdata[0]; | 751 | struct lpfc_hba *phba = (struct lpfc_hba *) host->hostdata; |
747 | int len; | 752 | int len; |
748 | static char lpfcinfobuf[384]; | 753 | static char lpfcinfobuf[384]; |
749 | 754 | ||
@@ -803,7 +808,7 @@ static int | |||
803 | lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) | 808 | lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) |
804 | { | 809 | { |
805 | struct lpfc_hba *phba = | 810 | struct lpfc_hba *phba = |
806 | (struct lpfc_hba *) cmnd->device->host->hostdata[0]; | 811 | (struct lpfc_hba *) cmnd->device->host->hostdata; |
807 | struct lpfc_sli *psli = &phba->sli; | 812 | struct lpfc_sli *psli = &phba->sli; |
808 | struct lpfc_rport_data *rdata = cmnd->device->hostdata; | 813 | struct lpfc_rport_data *rdata = cmnd->device->hostdata; |
809 | struct lpfc_nodelist *ndlp = rdata->pnode; | 814 | struct lpfc_nodelist *ndlp = rdata->pnode; |
@@ -877,7 +882,7 @@ static int | |||
877 | lpfc_abort_handler(struct scsi_cmnd *cmnd) | 882 | lpfc_abort_handler(struct scsi_cmnd *cmnd) |
878 | { | 883 | { |
879 | struct Scsi_Host *shost = cmnd->device->host; | 884 | struct Scsi_Host *shost = cmnd->device->host; |
880 | struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata[0]; | 885 | struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata; |
881 | struct lpfc_sli_ring *pring = &phba->sli.ring[phba->sli.fcp_ring]; | 886 | struct lpfc_sli_ring *pring = &phba->sli.ring[phba->sli.fcp_ring]; |
882 | struct lpfc_iocbq *iocb; | 887 | struct lpfc_iocbq *iocb; |
883 | struct lpfc_iocbq *abtsiocb; | 888 | struct lpfc_iocbq *abtsiocb; |
@@ -981,7 +986,7 @@ static int | |||
981 | lpfc_reset_lun_handler(struct scsi_cmnd *cmnd) | 986 | lpfc_reset_lun_handler(struct scsi_cmnd *cmnd) |
982 | { | 987 | { |
983 | struct Scsi_Host *shost = cmnd->device->host; | 988 | struct Scsi_Host *shost = cmnd->device->host; |
984 | struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata[0]; | 989 | struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata; |
985 | struct lpfc_scsi_buf *lpfc_cmd; | 990 | struct lpfc_scsi_buf *lpfc_cmd; |
986 | struct lpfc_iocbq *iocbq, *iocbqrsp; | 991 | struct lpfc_iocbq *iocbq, *iocbqrsp; |
987 | struct lpfc_rport_data *rdata = cmnd->device->hostdata; | 992 | struct lpfc_rport_data *rdata = cmnd->device->hostdata; |
@@ -1094,7 +1099,7 @@ static int | |||
1094 | lpfc_reset_bus_handler(struct scsi_cmnd *cmnd) | 1099 | lpfc_reset_bus_handler(struct scsi_cmnd *cmnd) |
1095 | { | 1100 | { |
1096 | struct Scsi_Host *shost = cmnd->device->host; | 1101 | struct Scsi_Host *shost = cmnd->device->host; |
1097 | struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata[0]; | 1102 | struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata; |
1098 | struct lpfc_nodelist *ndlp = NULL; | 1103 | struct lpfc_nodelist *ndlp = NULL; |
1099 | int match; | 1104 | int match; |
1100 | int ret = FAILED, i, err_count = 0; | 1105 | int ret = FAILED, i, err_count = 0; |
@@ -1195,7 +1200,7 @@ out: | |||
1195 | static int | 1200 | static int |
1196 | lpfc_slave_alloc(struct scsi_device *sdev) | 1201 | lpfc_slave_alloc(struct scsi_device *sdev) |
1197 | { | 1202 | { |
1198 | struct lpfc_hba *phba = (struct lpfc_hba *)sdev->host->hostdata[0]; | 1203 | struct lpfc_hba *phba = (struct lpfc_hba *)sdev->host->hostdata; |
1199 | struct lpfc_scsi_buf *scsi_buf = NULL; | 1204 | struct lpfc_scsi_buf *scsi_buf = NULL; |
1200 | struct fc_rport *rport = starget_to_rport(scsi_target(sdev)); | 1205 | struct fc_rport *rport = starget_to_rport(scsi_target(sdev)); |
1201 | uint32_t total = 0, i; | 1206 | uint32_t total = 0, i; |
@@ -1251,7 +1256,7 @@ lpfc_slave_alloc(struct scsi_device *sdev) | |||
1251 | static int | 1256 | static int |
1252 | lpfc_slave_configure(struct scsi_device *sdev) | 1257 | lpfc_slave_configure(struct scsi_device *sdev) |
1253 | { | 1258 | { |
1254 | struct lpfc_hba *phba = (struct lpfc_hba *) sdev->host->hostdata[0]; | 1259 | struct lpfc_hba *phba = (struct lpfc_hba *) sdev->host->hostdata; |
1255 | struct fc_rport *rport = starget_to_rport(sdev->sdev_target); | 1260 | struct fc_rport *rport = starget_to_rport(sdev->sdev_target); |
1256 | 1261 | ||
1257 | if (sdev->tagged_supported) | 1262 | if (sdev->tagged_supported) |