[lkml]   [2004]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [patch] libata: add ioctls to support SMART
John W. Linville wrote:
> Support for HDIO_DRIVE_CMD and HDIO_DRIVE_TASK in libata. Useful for
> supporting SMART w/ unmodified smartctl and smartd userland binaries.

First let me say that it's a damn fine first attempt, and people should
be able to use this for SMART until support is merged officially.

> Not happy w/ loop after failed ata_qc_new_init(), but needed because smartctl
> and smartd did not retry after failure. Likely need an option to wait for
> available qc? Also not sure all the error return codes are correct...

I'd like to implement it a bit differently, and I think this different
method will solve some of the open questions you have.

Take a look at

I would like to implement HDIO_DRIVE_CMD and HDIO_DRIVE_TASK completely
inside libata-scsi.c. These ioctls should translate the ioctl arguments
into an ATA-passthru SCSI command, and use the standard "issue a scsi
command" kernel API to submit the command and wait for a result.

That implies, then, that you would add code to libata-scsi.c that
translates the ATA-passthru SCSI command into an ATA command using the
ata_scsi_translate() infrastructure.

Note that you'll need to make up a SCSI opcode, inside the SCSI
vendor-specific opcode space, since the ATA-passthru hasn't yet been
assigned an official SCSI opcode. SPC-3
( lists the
available opcodes in section C.3, denoted with a 'V' across all columns.

Once libata-scsi.c can handle the ATA-passthru SCSI command,
implementing HDIO_DRIVE_{TASK,CMD} should be quite trivial.

And SMART support will be complete :)


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 14:05    [W:0.093 / U:1.212 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site