Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7e2b19fb authored by James Smart's avatar James Smart Committed by James Bottomley
Browse files

[SCSI] lpfc : Correct queue tag handling

This patch corrects the lpfc tag handling issue identified by Hannes Reinecke
http://marc.info/?l=linux-scsi@m=119270235628850&w=2



The basis for this patch originated from Hajime Kai. Thank You Hajime.

Signed-off-by: default avatar <hajime-kai@soft.fujitsu.com>
Signed-off-by: default avatarJames Smart <James.Smart@emulex.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent c4e1608e
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -682,6 +682,7 @@ lpfc_scsi_prep_cmnd(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,
	IOCB_t *iocb_cmd = &lpfc_cmd->cur_iocbq.iocb;
	IOCB_t *iocb_cmd = &lpfc_cmd->cur_iocbq.iocb;
	struct lpfc_iocbq *piocbq = &(lpfc_cmd->cur_iocbq);
	struct lpfc_iocbq *piocbq = &(lpfc_cmd->cur_iocbq);
	int datadir = scsi_cmnd->sc_data_direction;
	int datadir = scsi_cmnd->sc_data_direction;
	char tag[2];


	lpfc_cmd->fcp_rsp->rspSnsLen = 0;
	lpfc_cmd->fcp_rsp->rspSnsLen = 0;
	/* clear task management bits */
	/* clear task management bits */
@@ -692,8 +693,8 @@ lpfc_scsi_prep_cmnd(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,


	memcpy(&fcp_cmnd->fcpCdb[0], scsi_cmnd->cmnd, 16);
	memcpy(&fcp_cmnd->fcpCdb[0], scsi_cmnd->cmnd, 16);


	if (scsi_cmnd->device->tagged_supported) {
	if (scsi_populate_tag_msg(scsi_cmnd, tag)) {
		switch (scsi_cmnd->tag) {
		switch (tag[0]) {
		case HEAD_OF_QUEUE_TAG:
		case HEAD_OF_QUEUE_TAG:
			fcp_cmnd->fcpCntl1 = HEAD_OF_Q;
			fcp_cmnd->fcpCntl1 = HEAD_OF_Q;
			break;
			break;