Skip to contentSkip to conversation

libata: add support for ATA_16 on ATAPI

PATCH In review Tejun Heo 3 participants 6 messages Aug 1, 2007 – Aug 15, 2007 libata

lore
Share & tools
lore

Tejun Heo

author
#0 lore raw

PATCH 1/1 libata: add support for ATA_16 on ATAPI

From: Mark Lord <[email protected]>

Add support for issuing ATA_16 passthru commands to ATAPI devices managed by libata. It requires the previous CDB length fix patch.

A boot/module parameter, "atapi_scmd85=1" can be used to globally disable this feature, if ever desired.

tj: renamed ata16_passthru module param to atapi_scmd85 to reduce
confusion

tj: restructured __ata_scsi_queuecmd() according to Jeff's suggestion.

---
Jeff, Mark, are you guys okay with the modified version?

Thanks.

 drivers/ata/libata-core.c |    4 +++
 drivers/ata/libata-scsi.c |   52 +++++++++++++++++++++++++++++++---------------
 drivers/ata/libata.h      |    1 
 3 files changed, 41 insertions(+), 16 deletions(-)
drivers/ata/libata-core.c +4 -0
index 6001aae..d8c6789 100644
@@ -86,6 +86,10 @@ int atapi_dmadir = 0;
 module_param(atapi_dmadir, int, 0444);
 MODULE_PARM_DESC(atapi_dmadir, "Enable ATAPI DMADIR bridge support (0=off, 1=on)");
 
+int atapi_scmd85 = 0;
+module_param(atapi_scmd85, int, 0444);
+MODULE_PARM_DESC(atapi_scmd85, "Enable relay of SCSI opcode 0x85 and disable ATA_16 passthrough to ATAPI devices (0=off, 1=on)");
+
 int libata_fua = 0;
 module_param_named(fua, libata_fua, int, 0444);
 MODULE_PARM_DESC(fua, "FUA support (0=off, 1=on)");
drivers/ata/libata-eh.c +0 -0
drivers/ata/libata-scsi.c +36 -16

64 lines not on this page · raw message

drivers/ata/libata.h +1 -0
index 564cd23..59a71fc 100644
@@ -56,6 +56,7 @@ extern unsigned int ata_print_id;
 extern struct workqueue_struct *ata_aux_wq;
 extern int atapi_enabled;
 extern int atapi_dmadir;
+extern int atapi_scmd85;
 extern int libata_fua;
 extern int libata_noacpi;
 extern struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev);
include/linux/libata.h +0 -0
#1 lore raw
Quoted 11 lines · Tejun Heo

From: Mark Lord <[email protected]>

Add support for issuing ATA_16 passthru commands to ATAPI devices managed by libata. It requires the previous CDB length fix patch.

A boot/module parameter, "atapi_scmd85=1" can be used to globally disable this feature, if ever desired.

tj: renamed ata16_passthru module param to atapi_scmd85 to reduce
confusion

Quoted 6 lines

tj: restructured __ata_scsi_queuecmd() according to Jeff's suggestion.

---
Jeff, Mark, are you guys okay with the modified version?

Close! Thanks for revising!

My only comment now is that I dislike atapi_scmd85. That means nothing to me.

I liked the old name better. Or maybe use atapi_passthru16.

Jeff

author
#2 lore raw
Quoted 19 lines · Jeff Garzik
Quoted 11 lines · Tejun Heo

From: Mark Lord <[email protected]>

Add support for issuing ATA_16 passthru commands to ATAPI devices managed by libata. It requires the previous CDB length fix patch.

A boot/module parameter, "atapi_scmd85=1" can be used to globally disable this feature, if ever desired.

tj: renamed ata16_passthru module param to atapi_scmd85 to reduce
confusion

Quoted 6 lines

tj: restructured __ata_scsi_queuecmd() according to Jeff's suggestion.

---
Jeff, Mark, are you guys okay with the modified version?

Quoted 6 lines

Close! Thanks for revising!

My only comment now is that I dislike atapi_scmd85. That means nothing to me.

I liked the old name better. Or maybe use atapi_passthru16.

The problem with ata16_passthru is that it suggests the opposite of what it does. The default value 0 allows ATA_16 passthrough command while setting it to 1 disallows ATA_16 passthrough and passes through SCSI Command 0x85 which shares command byte with ATA_16. Maybe it's because I'm not a native speaker but the last sentence is pretty difficult to digest. So, IMHO, atapi_scmd85 is slightly better in that it means nothing rather than suggesting the opposite.

How about keeping the old name (or use atapi_passthru16) but flipping the meaning so that it defaults to 1. It just makes hell lot of sense that "ata16_passthru=1" means allowing ATA_16 passthrough not the other way around.

Thanks.

Signature · 1 line
tejun
#3 lore raw
Quoted 10 lines · Tejun Heo
Quoted 8 lines · Jeff Garzik
Quoted 1 line · Tejun Heo

Jeff, Mark, are you guys okay with the modified version?

Close! Thanks for revising!

My only comment now is that I dislike atapi_scmd85. That means nothing to me.

I liked the old name better. Or maybe use atapi_passthru16.

Quoted 7 lines

The problem with ata16_passthru is that it suggests the opposite of what it does. The default value 0 allows ATA_16 passthrough command while setting it to 1 disallows ATA_16 passthrough and passes through SCSI Command 0x85 which shares command byte with ATA_16. Maybe it's because I'm not a native speaker but the last sentence is pretty difficult to digest. So, IMHO, atapi_scmd85 is slightly better in that it means nothing rather than suggesting the opposite.

Thanks for plugging away at this one, Tejun.

And I do agree that ata16_passthru sounds backwards of what it really does. There's got to be a nicer name for this thing.

In practice, I doubt that anyone will ever use the parameter, so it really doesn't matter a whole lot what we call it.

But something sensible would be nice.
There's got to be a shorter version of "atapi_pass_opcode_0x85_to_device=1".

Perhaps "atapi_op_85_passthru=1" or "atapi_passthru_op_85=1" ??

Also, this is an example of something that is really a "per device" parameter, rather than a global. But we haven't yet cracked a good way to do that yet in libata.

Cheers

author
#4 lore raw

PATCH 1/1 libata: add support for ATA_16 on ATAPI

From: Mark Lord <[email protected]>

Add support for issuing ATA_16 passthru commands to ATAPI devices managed by libata. It requires the previous CDB length fix patch.

A boot/module parameter, "atapi_scmd85=1" can be used to globally disable this feature, if ever desired.

tj: renamed ata16_passthru module param to atapi_passthru16 and invert
its meaning to reduce confusion.

tj: restructured __ata_scsi_queuecmd() according to Jeff's suggestion.

---
Alright, the winner is atapi_passthru16.

 drivers/ata/libata-core.c |    4 +++
 drivers/ata/libata-scsi.c |   52 +++++++++++++++++++++++++++++++---------------
 drivers/ata/libata.h      |    1 
 3 files changed, 41 insertions(+), 16 deletions(-)
drivers/ata/libata-core.c +4 -0
index 60e78be..0ccac23 100644
@@ -86,6 +86,10 @@ int atapi_dmadir = 0;
 module_param(atapi_dmadir, int, 0444);
 MODULE_PARM_DESC(atapi_dmadir, "Enable ATAPI DMADIR bridge support (0=off, 1=on)");
 
+int atapi_passthru16 = 1;
+module_param(atapi_passthru16, int, 0444);
+MODULE_PARM_DESC(atapi_passthru16, "Enable ATA_16 passthru for ATAPI devices, on by default (0=off, 1=on)");
+
 int libata_fua = 0;
 module_param_named(fua, libata_fua, int, 0444);
 MODULE_PARM_DESC(fua, "FUA support (0=off, 1=on)");
drivers/ata/libata-scsi.c +36 -16

64 lines not on this page · raw message

drivers/ata/libata.h +1 -0
index 564cd23..bdee8c2 100644
@@ -56,6 +56,7 @@ extern unsigned int ata_print_id;
 extern struct workqueue_struct *ata_aux_wq;
 extern int atapi_enabled;
 extern int atapi_dmadir;
+extern int atapi_passthru16;
 extern int libata_fua;
 extern int libata_noacpi;
 extern struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev);
Applied
#5 lore raw
Quoted 15 lines · Tejun Heo

From: Mark Lord <[email protected]>

Add support for issuing ATA_16 passthru commands to ATAPI devices managed by libata. It requires the previous CDB length fix patch.

A boot/module parameter, "atapi_scmd85=1" can be used to globally disable this feature, if ever desired.

tj: renamed ata16_passthru module param to atapi_passthru16 and invert
its meaning to reduce confusion.

tj: restructured __ata_scsi_queuecmd() according to Jeff's suggestion.

Quoted 7 lines

---
Alright, the winner is atapi_passthru16.

 drivers/ata/libata-core.c |    4 +++
 drivers/ata/libata-scsi.c |   52 +++++++++++++++++++++++++++++++---------------
 drivers/ata/libata.h      |    1 
 3 files changed, 41 insertions(+), 16 deletions(-)

applied