aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_isr.c
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2010-05-04 18:01:26 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-05-16 18:21:47 -0400
commit5ff1d58410ffb160b388d622ef0c6a0411a05559 (patch)
treea8d95de2c47bf3b0beaae6730b61b3d84c2bde56 /drivers/scsi/qla2xxx/qla_isr.c
parent99b0bec7bbf3350d1a920a7138fa62c456a8ecf1 (diff)
[SCSI] qla2xxx: Limit mailbox command contention for ADISC requests.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_isr.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_isr.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 037bc41eef57..a1968eb5e9ce 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -899,6 +899,7 @@ qla2x00_mbx_iocb_entry(scsi_qla_host_t *vha, struct req_que *req,
899 srb_t *sp; 899 srb_t *sp;
900 struct srb_logio *lio; 900 struct srb_logio *lio;
901 uint16_t *data; 901 uint16_t *data;
902 uint16_t status;
902 903
903 sp = qla2x00_get_sp_from_handle(vha, func, req, mbx); 904 sp = qla2x00_get_sp_from_handle(vha, func, req, mbx);
904 if (!sp) 905 if (!sp)
@@ -910,7 +911,9 @@ qla2x00_mbx_iocb_entry(scsi_qla_host_t *vha, struct req_que *req,
910 fcport = sp->fcport; 911 fcport = sp->fcport;
911 data = lio->data; 912 data = lio->data;
912 913
913 data[0] = data[1] = 0; 914 data[0] = MBS_COMMAND_ERROR;
915 data[1] = lio->flags & SRB_LOGIN_RETRIED ?
916 QLA_LOGIO_LOGIN_RETRIED : 0;
914 if (mbx->entry_status) { 917 if (mbx->entry_status) {
915 DEBUG2(printk(KERN_WARNING 918 DEBUG2(printk(KERN_WARNING
916 "scsi(%ld:%x): Async-%s error entry - entry-status=%x " 919 "scsi(%ld:%x): Async-%s error entry - entry-status=%x "
@@ -921,26 +924,27 @@ qla2x00_mbx_iocb_entry(scsi_qla_host_t *vha, struct req_que *req,
921 le16_to_cpu(mbx->status_flags))); 924 le16_to_cpu(mbx->status_flags)));
922 DEBUG2(qla2x00_dump_buffer((uint8_t *)mbx, sizeof(*mbx))); 925 DEBUG2(qla2x00_dump_buffer((uint8_t *)mbx, sizeof(*mbx)));
923 926
924 data[0] = MBS_COMMAND_ERROR;
925 data[1] = lio->flags & SRB_LOGIN_RETRIED ?
926 QLA_LOGIO_LOGIN_RETRIED: 0;
927 goto logio_done; 927 goto logio_done;
928 } 928 }
929 929
930 if (!mbx->status && le16_to_cpu(mbx->mb0) == MBS_COMMAND_COMPLETE) { 930 status = le16_to_cpu(mbx->status);
931 if (status == 0x30 && lio->ctx.type == SRB_LOGIN_CMD &&
932 le16_to_cpu(mbx->mb0) == MBS_COMMAND_COMPLETE)
933 status = 0;
934 if (!status && le16_to_cpu(mbx->mb0) == MBS_COMMAND_COMPLETE) {
931 DEBUG2(printk(KERN_DEBUG 935 DEBUG2(printk(KERN_DEBUG
932 "scsi(%ld:%x): Async-%s complete - mbx1=%x.\n", 936 "scsi(%ld:%x): Async-%s complete - mbx1=%x.\n",
933 fcport->vha->host_no, sp->handle, type, 937 fcport->vha->host_no, sp->handle, type,
934 le16_to_cpu(mbx->mb1))); 938 le16_to_cpu(mbx->mb1)));
935 939
936 data[0] = MBS_COMMAND_COMPLETE; 940 data[0] = MBS_COMMAND_COMPLETE;
937 if (lio->ctx.type == SRB_LOGIN_CMD) 941 if (lio->ctx.type == SRB_LOGIN_CMD) {
938 fcport->port_type = FCT_TARGET; 942 fcport->port_type = FCT_TARGET;
939 if (le16_to_cpu(mbx->mb1) & BIT_0) 943 if (le16_to_cpu(mbx->mb1) & BIT_0)
940 fcport->port_type = FCT_INITIATOR; 944 fcport->port_type = FCT_INITIATOR;
941 if (le16_to_cpu(mbx->mb1) & BIT_1) 945 if (le16_to_cpu(mbx->mb1) & BIT_1)
942 fcport->flags |= FCF_FCP2_DEVICE; 946 fcport->flags |= FCF_FCP2_DEVICE;
943 947 }
944 goto logio_done; 948 goto logio_done;
945 } 949 }
946 950
@@ -953,15 +957,13 @@ qla2x00_mbx_iocb_entry(scsi_qla_host_t *vha, struct req_que *req,
953 break; 957 break;
954 default: 958 default:
955 data[0] = MBS_COMMAND_ERROR; 959 data[0] = MBS_COMMAND_ERROR;
956 data[1] = lio->flags & SRB_LOGIN_RETRIED ?
957 QLA_LOGIO_LOGIN_RETRIED: 0;
958 break; 960 break;
959 } 961 }
960 962
961 DEBUG2(printk(KERN_WARNING 963 DEBUG2(printk(KERN_WARNING
962 "scsi(%ld:%x): Async-%s failed - status=%x mb0=%x mb1=%x mb2=%x " 964 "scsi(%ld:%x): Async-%s failed - status=%x mb0=%x mb1=%x mb2=%x "
963 "mb6=%x mb7=%x.\n", 965 "mb6=%x mb7=%x.\n",
964 fcport->vha->host_no, sp->handle, type, le16_to_cpu(mbx->status), 966 fcport->vha->host_no, sp->handle, type, status,
965 le16_to_cpu(mbx->mb0), le16_to_cpu(mbx->mb1), 967 le16_to_cpu(mbx->mb0), le16_to_cpu(mbx->mb1),
966 le16_to_cpu(mbx->mb2), le16_to_cpu(mbx->mb6), 968 le16_to_cpu(mbx->mb2), le16_to_cpu(mbx->mb6),
967 le16_to_cpu(mbx->mb7))); 969 le16_to_cpu(mbx->mb7)));
@@ -1086,7 +1088,9 @@ qla24xx_logio_entry(scsi_qla_host_t *vha, struct req_que *req,
1086 fcport = sp->fcport; 1088 fcport = sp->fcport;
1087 data = lio->data; 1089 data = lio->data;
1088 1090
1089 data[0] = data[1] = 0; 1091 data[0] = MBS_COMMAND_ERROR;
1092 data[1] = lio->flags & SRB_LOGIN_RETRIED ?
1093 QLA_LOGIO_LOGIN_RETRIED : 0;
1090 if (logio->entry_status) { 1094 if (logio->entry_status) {
1091 DEBUG2(printk(KERN_WARNING 1095 DEBUG2(printk(KERN_WARNING
1092 "scsi(%ld:%x): Async-%s error entry - entry-status=%x.\n", 1096 "scsi(%ld:%x): Async-%s error entry - entry-status=%x.\n",
@@ -1094,9 +1098,6 @@ qla24xx_logio_entry(scsi_qla_host_t *vha, struct req_que *req,
1094 logio->entry_status)); 1098 logio->entry_status));
1095 DEBUG2(qla2x00_dump_buffer((uint8_t *)logio, sizeof(*logio))); 1099 DEBUG2(qla2x00_dump_buffer((uint8_t *)logio, sizeof(*logio)));
1096 1100
1097 data[0] = MBS_COMMAND_ERROR;
1098 data[1] = lio->flags & SRB_LOGIN_RETRIED ?
1099 QLA_LOGIO_LOGIN_RETRIED: 0;
1100 goto logio_done; 1101 goto logio_done;
1101 } 1102 }
1102 1103
@@ -1107,7 +1108,7 @@ qla24xx_logio_entry(scsi_qla_host_t *vha, struct req_que *req,
1107 le32_to_cpu(logio->io_parameter[0]))); 1108 le32_to_cpu(logio->io_parameter[0])));
1108 1109
1109 data[0] = MBS_COMMAND_COMPLETE; 1110 data[0] = MBS_COMMAND_COMPLETE;
1110 if (lio->ctx.type == SRB_LOGOUT_CMD) 1111 if (lio->ctx.type != SRB_LOGIN_CMD)
1111 goto logio_done; 1112 goto logio_done;
1112 1113
1113 iop[0] = le32_to_cpu(logio->io_parameter[0]); 1114 iop[0] = le32_to_cpu(logio->io_parameter[0]);
@@ -1144,8 +1145,6 @@ qla24xx_logio_entry(scsi_qla_host_t *vha, struct req_que *req,
1144 /* Fall through. */ 1145 /* Fall through. */
1145 default: 1146 default:
1146 data[0] = MBS_COMMAND_ERROR; 1147 data[0] = MBS_COMMAND_ERROR;
1147 data[1] = lio->flags & SRB_LOGIN_RETRIED ?
1148 QLA_LOGIO_LOGIN_RETRIED: 0;
1149 break; 1148 break;
1150 } 1149 }
1151 1150