Hello Tejun, Gentle ping if you missed this email. Regards, Akshat On Mon, Aug 3, 2020 at 9:44 AM Akshat Jain <akshatzen@xxxxxxxxxx> wrote: > > Hello Jens Tejun, > I have a question regarding the ata_gen_passthru_sense function (libata-scsi.c). > > This function while generating fixed format sense blocks, puts the > INFORMATION field at offset 8 and COMMAND-SPECIFIC-INFORMATION at > offset 16. > While as per SCSI Primary commands - 4 specification, section 4.5.3 > Fixed format sense data Table 53, the INFORMATION field is at offset 3 > and COMMAND-SPECIFIC-INFORMATION is at offset 8. > > Code snippet: > > static void ata_gen_passthru_sense(struct ata_queued_cmd *qc) > { > struct scsi_cmnd *cmd = qc->scsicmd; > struct ata_taskfile *tf = &qc->result_tf; > unsigned char *sb = cmd->sense_buffer; > unsigned char *desc = sb + 8; > …. > if ((cmd->sense_buffer[0] & 0x7f) >= 0x72) { > .... > } else { > /* Fixed sense format */ > desc[0] = tf->feature; > desc[1] = tf->command; /* status */ > desc[2] = tf->device; > desc[3] = tf->nsect; > desc[7] = 0; > if (tf->flags & ATA_TFLAG_LBA48) { > desc[8] |= 0x80; > if (tf->hob_nsect) > desc[8] |= 0x40; > if (tf->hob_lbal || tf->hob_lbam || tf->hob_lbah) > desc[8] |= 0x20; > } > desc[9] = tf->lbal; > desc[10] = tf->lbam; > desc[11] = tf->lbah; > } > } > > Link to spec: https://www.t10.org/cgi-bin/ac.pl?t=f&f=spc4r37a.pdf > > My team has confirmed this observation. Do you believe our > interpretation of the specification is correct and if yes does this > need to be corrected? > > Regards, > Akshat Jain