All of lore.kernel.org
 help / color / mirror / Atom feed
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: [PATCH] RESPIN: libata: add atapi_passthru=1 parameter
Date: Wed, 3 Jan 2007 01:24:19 -0500	[thread overview]
Message-ID: <200701030124.19568.liml@rtr.ca> (raw)
In-Reply-To: <200701030101.09838.liml@rtr.ca>

On Wednesday 03 January 2007 01:01, Mark Lord wrote:
>..
> This patch isn't really needed, but it might provide an "out"
> just in case somebody has some really non-compliant hardware
> out there someday.
> 
> Add a boot/module parameter for libata to force the ATA_16
> SCSI opcode to not be interpreted as a standards-compliant
> ATA passthrough mechanism when used on an ATAPI device
>  -- instead, it gets passed directly to the ATAPI device.

This version of the patch leaves ATA_16 enabled for non-ATAPI
regardless of the setting of the new module parm.  Take your pick.

Signed-off-by:  Mark Lord <mlord@pobox.com>

--- old/drivers/ata/libata.h	2007-01-02 19:06:56.000000000 -0500
+++ linux/drivers/ata/libata.h	2007-01-03 00:55:01.000000000 -0500
@@ -46,6 +46,7 @@
 
 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);
--- old/drivers/ata/libata-core.c	2007-01-02 19:09:06.000000000 -0500
+++ linux/drivers/ata/libata-core.c	2007-01-03 00:52:51.000000000 -0500
@@ -78,6 +78,10 @@
 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)");
--- old/drivers/ata/libata-scsi.c	2007-01-02 19:20:49.000000000 -0500
+++ linux/drivers/ata/libata-scsi.c	2007-01-03 01:21:28.000000000 -0500
@@ -2650,7 +2650,7 @@
 
 static inline ata_xlat_func_t ata_get_xlat_func(struct ata_device *dev, u8 cmd)
 {
-	if (cmd == ATA_16)
+	if (cmd == ATA_16 && !atapi_passthru)
 		return ata_scsi_pass_thru;
 
 	if (dev->class == ATA_DEV_ATAPI)
@@ -2676,6 +2676,7 @@
 		return ata_scsi_verify_xlat;
 
 	case ATA_12:
+	case ATA_16:
 		return ata_scsi_pass_thru;
 
 	case START_STOP:

  reply	other threads:[~2007-01-03  6:24 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       ` Mark Lord [this message]
2007-01-03 18:17         ` [PATCH] RESPIN: " Mark Lord
2007-01-20  0:08         ` Jeff Garzik
2007-01-26  2:39           ` Mark Lord

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=200701030124.19568.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.