On 01/22/15 11:02, Nicholas A. Bellinger wrote: > On Wed, 2015-01-21 at 17:18 +0100, Bart Van Assche wrote: >> Although several SCSI LLDs compare sc_data_direction with the value >> DMA_BIDIRECTIONAL apparently scsi_setup_cmnd() never sets >> sc_data_direction to the value DMA_BIDIRECTIONAL. Is this behavior on >> purpose ? > > Yes. Bi-directional CDBs are signaled using scsi_bidi_cmnd(), and IIRC > ->sc_data_direction = DMA_TO_DEVICE is set for those cases. But why is sc_data_direction set to DMA_BIDIRECTIONAL in scsi_ioctl_reset() in drivers/scsi/scsi_error.c ? I think scsi_bidi_cmnd() will return false for the SCSI command submitted by scsi_ioctl_reset() since in this case scmd->request->next_rq == NULL. Bart. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html