libata: add MODE_SENSE(6) emulation?
Hi Jeff,
Even though libata sets sdev->use_10_for_ms = 1;
libata still receives MODE_SENSE(6) and MODE_SELECT(6) commands during the test. (These commands seems to be coming from the user space, not from the SCSI mid-layer.)
Most ATAPI devices don't like it, and either return error or time out. (Ex.
Attached scsi CD-ROM sr0 at scsi7, channel 0, id 0, lun 0
ata7: command 0xa0 timeout, stat 0x50 host_stat 0x1)
Should MODE_SENSE(6) / MODE_SELECT(6) emulation be added to libata
to fix this? This can also make the ATAPI devices look more like real SCSI devices.
Albert
Quoted 6 lines · Albert Lee
Hi Jeff,
Even though libata sets
sdev->use_10_for_ms= 1;
libata still receivesMODE_SENSE(6)andMODE_SELECT(6)commands during the test. (These commands seems to be coming from the user space, not from the SCSI mid-layer.)
Quoted 7 lines
Most ATAPI devices don't like it, and either return error or time out. (Ex.
Attached scsi CD-ROM sr0 at scsi7, channel 0, id 0, lun 0
ata7: command0xa0timeout, stat0x50host_stat0x1)Should
MODE_SENSE(6)/MODE_SELECT(6)emulation be added to libata
to fix this? This can also make the ATAPI devices look more like real SCSI devices.
I would prefer not to add this emulation.
This has been standard behavior for ATAPI devices, and was the reason that use_10_for_{ms,rw} was created inside the kernel.
Userland applications should be fixed instead: the current SCSI MMC specification does not list MODE SENSE(6) either, and ATAPI devices are most like MMC devices.
The applications should be updated with more knowledge of the MMC specification.
Jeff
One thing that should get added to libata is the ability to issue READ_BUFFER_CAPACITY (5C) during write operations to CD/DVD-RW.
That way, userland apps can show the buffer usage and adapt data transmission to match etc..
Just like they do today with ide-scsi.
Or is this already there?
Cheers