From: Mark Lord <liml@rtr.ca>
To: Jeff Garzik <jeff@garzik.org>
Cc: Linux IDE <linux-ide@vger.kernel.org>, Tejun Heo <htejun@gmail.com>
Subject: Re: [PATCH] RESPIN: libata: add atapi_passthru=1 parameter
Date: Thu, 25 Jan 2007 21:39:02 -0500 [thread overview]
Message-ID: <200701252139.04383.liml@rtr.ca> (raw)
In-Reply-To: <45B15D65.1060203@garzik.org>
Jeff Garzik wrote:
> Mark Lord wrote:
>..
>> I believe Tejun and I were in agreement that proper
>> ATA16 support for ATAPI was the better way to go.
>
> I like both approaches. I think direct support of HDIO_GET_IDENTITY can
> reduce the number of failure points, while making old tools work a bit
> better.
Okay. It just seemed like a bit of cruft from my old drivers
that we could leave behind at this point. But that's fine,
it'll keep more folks off my back regarding hdparm. :)
Jeff: I just did this here from scratch:
git clone rsync://rsync2.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git libata-dev
cd libata-dev
git-checkout upstream
And then applied my patches for ATAPI-ATA16 support to them.
They appear to have applied 100% cleanly as-is.
Do I have the correct "upstream" repo ?
Here is the unified patch.
This adds ATA16 command support to libata for ATAPI drives,
permitting issuing of ATA (not ATAPI packet) commands to
ATAPI devices (eg. "hdparm -I" and "hdparm -C").
libata-core.c | 4 ++++
libata-scsi.c | 23 ++++++++++++-----------
libata.h | 1 +
3 files changed, 17 insertions(+), 11 deletions(-)
Signed-off-by: Mark Lord <mlord@pobox.com>
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 5117577..509d04a 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -78,6 +78,10 @@ int atapi_enabled = 1;
module_param(atapi_enabled, int, 0444);
MODULE_PARM_DESC(atapi_enabled, "Enable discovery of ATAPI devices (0=off, 1=on)");
+int atapi_passthru = 0;
+module_param(atapi_passthru, int, 0444);
+MODULE_PARM_DESC(atapi_passthru, "Enable passthru of SCSI opcode 0x85 to ATAPI devices");
+
int atapi_dmadir = 0;
module_param(atapi_dmadir, int, 0444);
MODULE_PARM_DESC(atapi_dmadir, "Enable ATAPI DMADIR bridge support (0=off, 1=on)");
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index a39d100..4c60d16 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -2690,6 +2690,12 @@ static unsigned int ata_scsi_pass_thru(s
static inline ata_xlat_func_t ata_get_xlat_func(struct ata_device *dev, u8 cmd)
{
+ if (cmd == ATA_16 && !atapi_passthru)
+ return ata_scsi_pass_thru;
+
+ if (dev->class == ATA_DEV_ATAPI)
+ return atapi_xlat;
+
switch (cmd) {
case READ_6:
case READ_10:
@@ -2748,6 +2754,7 @@ static inline int __ata_scsi_queuecmd(st
void (*done)(struct scsi_cmnd *),
struct ata_device *dev)
{
+ ata_xlat_func_t xlat_func;
int rc = 0;
if (unlikely(!scmd->cmd_len)) {
@@ -2757,17 +2764,11 @@ static inline int __ata_scsi_queuecmd(st
return 0;
}
- if (dev->class == ATA_DEV_ATA) {
- ata_xlat_func_t xlat_func = ata_get_xlat_func(dev,
- scmd->cmnd[0]);
-
- if (xlat_func)
- rc = ata_scsi_translate(dev, scmd, done, xlat_func);
- else
- ata_scsi_simulate(dev, scmd, done);
- } else
- rc = ata_scsi_translate(dev, scmd, done, atapi_xlat);
-
+ xlat_func = ata_get_xlat_func(dev, scmd->cmnd[0]);
+ if (xlat_func)
+ rc = ata_scsi_translate(dev, scmd, done, xlat_func);
+ else
+ ata_scsi_simulate(dev, scmd, done);
return rc;
}
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h
index 81ae41d..89981b4 100644
--- a/drivers/ata/libata.h
+++ b/drivers/ata/libata.h
@@ -46,6 +46,7 @@ enum {
extern struct workqueue_struct *ata_aux_wq;
extern int atapi_enabled;
+extern int atapi_passthru;
extern int atapi_dmadir;
extern int libata_fua;
extern struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev);
prev parent reply other threads:[~2007-01-26 2:39 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-03 0:39 [PATCH] libata: add support for ATA_16 commands to ATAPI devices Mark Lord
2007-01-03 0:44 ` Mark Lord
2007-01-03 0:50 ` [PATCH] " Jeff Garzik
2007-01-03 1:07 ` Alan
2007-01-03 1:06 ` Jeff Garzik
2007-01-03 5:44 ` Mark Lord
2007-01-03 11:34 ` Alan
2007-01-03 14:18 ` Mark Lord
2007-01-03 5:47 ` Mark Lord
2007-01-03 6:01 ` [PATCH] libata: add atapi_passthru=1 parameter Mark Lord
2007-01-03 6:24 ` [PATCH] RESPIN: " Mark Lord
2007-01-03 18:17 ` Mark Lord
2007-01-20 0:08 ` Jeff Garzik
2007-01-26 2:39 ` Mark Lord [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200701252139.04383.liml@rtr.ca \
--to=liml@rtr.ca \
--cc=htejun@gmail.com \
--cc=jeff@garzik.org \
--cc=linux-ide@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.