Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] 53c700: brown paper bag fix for auto request sense

In the switch over, I forgot to set the command length, so it sends out
a request sense with whatever length the prior command had (and fails
badly if it wasn't 6).

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>

authored by

James Bottomley and committed by
James Bottomley
c603d04e 46ddab7b

+6 -1
+6 -1
drivers/scsi/53c700.c
··· 622 622 dma_unmap_single(hostdata->dev, slot->dma_handle, sizeof(SCp->sense_buffer), DMA_FROM_DEVICE); 623 623 /* restore the old result if the request sense was 624 624 * successful */ 625 - if(result == 0) 625 + if (result == 0) 626 626 result = cmnd[7]; 627 + /* restore the original length */ 628 + SCp->cmd_len = cmnd[8]; 627 629 } else 628 630 NCR_700_unmap(hostdata, SCp, slot); 629 631 ··· 1009 1007 * of the command */ 1010 1008 cmnd[6] = NCR_700_INTERNAL_SENSE_MAGIC; 1011 1009 cmnd[7] = hostdata->status[0]; 1010 + cmnd[8] = SCp->cmd_len; 1011 + SCp->cmd_len = 6; /* command length for 1012 + * REQUEST_SENSE */ 1012 1013 slot->pCmd = dma_map_single(hostdata->dev, cmnd, MAX_COMMAND_SIZE, DMA_TO_DEVICE); 1013 1014 slot->dma_handle = dma_map_single(hostdata->dev, SCp->sense_buffer, sizeof(SCp->sense_buffer), DMA_FROM_DEVICE); 1014 1015 slot->SG[0].ins = bS_to_host(SCRIPT_MOVE_DATA_IN | sizeof(SCp->sense_buffer));