On 5/4/20 9:49 AM, John Garry wrote:
-
+ task->tag = cmd->request->tag;
task->scatter = scsi_sglist(cmd);
task->num_scatter = scsi_sg_count(cmd);
task->total_xfer_len = scsi_bufflen(cmd);
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index c927228019c9..af864f68b5cc 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -594,6 +594,8 @@ struct sas_task {
u32 total_xfer_len;
u8 data_dir:2; /* Use PCI_DMA_... */
+ u32 tag;
unsigned, yet we assign it -1?
Yeah, that's how the block layer does internally, too.
Maybe we should export SCSI_NO_TAG and use it here.
I think it's better that the LLDD would not have to deal with "no tag"
scenario (pm8001 driver has to handle it in this series). Rather libsas
can handle that, and fail an allocation of a slow_task to the LLDD instead.
I fully agree. The 'no tag' scenario should never happen with libsas
with this patchset.
But for that to happen we need to:
- Ensure that even ATA devices on libsas always have a domain device (I
think it's true nowadays, but we'll need to check).
- Add a host port to libsas, such that sas_alloc_target() will have a
valid target/port upon lookup (and your patch won't be needed anymore)
- Move ATA non-SCSI commands over to using sas slow tasks. This
shouldn't be much of a problem as really the only non-SCSI ATA command
which will need to be sent from within an I/O stream is the 'read log'
command, and that is handled internally by the drivers anyway.
All other commands are sent during device discovery or from out-of-band
things like ioctl, so they should be fine using slow tasks.
Cheers,
Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
hare@xxxxxxx +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer