From: Albert Lee <albertcc@tw.ibm.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: Tejun Heo <htejun@gmail.com>,
Jonathan Blake Benson <airbatica@verizon.net>,
linux-ide@vger.kernel.org, Doug Maxey <dwm@maxeymade.com>
Subject: [PATCH] libata: convert ATAPI_ENABLE_DMADIR to module parameter
Date: Tue, 04 Apr 2006 10:57:18 +0800 [thread overview]
Message-ID: <4431E08E.8040108@tw.ibm.com> (raw)
In-Reply-To: <4431D6D1.9020206@gmail.com>
Convert the ATAPI_ENABLE_DMADIR compile time option needed
by some SATA-PATA bridge to runtime module parameter.
Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
---
Before we can detect the bridge chips which need the ATAPI DMADIR workaround
automatically, maybe using a module parameter is easier for the end users to
turn on this option.
Patch against upstream (af64371ada9452632c349563d688d30d94e918ba).
For your review, thanks.
--- upstream/drivers/scsi/libata-core.c 2006-04-03 13:15:20.000000000 +0800
+++ upstream_dmadir/drivers/scsi/libata-core.c 2006-04-04 10:40:39.000000000 +0800
@@ -76,6 +76,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_dmadir = 0;
+module_param(atapi_dmadir, int, 0444);
+MODULE_PARM_DESC(atapi_dmadir, "Enable ATAPI DMADIR bridge support (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)");
--- upstream/drivers/scsi/libata-scsi.c 2006-04-03 13:15:20.000000000 +0800
+++ upstream_dmadir/drivers/scsi/libata-scsi.c 2006-04-04 10:33:52.000000000 +0800
@@ -2163,11 +2163,9 @@ static unsigned int atapi_xlat(struct at
qc->tf.protocol = ATA_PROT_ATAPI_DMA;
qc->tf.feature |= ATAPI_PKT_DMA;
-#ifdef ATAPI_ENABLE_DMADIR
- /* some SATA bridges need us to indicate data xfer direction */
- if (cmd->sc_data_direction != DMA_TO_DEVICE)
+ if (atapi_dmadir && (cmd->sc_data_direction != DMA_TO_DEVICE))
+ /* some SATA bridges need us to indicate data xfer direction */
qc->tf.feature |= ATAPI_DMADIR;
-#endif
}
qc->nbytes = cmd->bufflen;
--- upstream/drivers/scsi/libata.h 2006-04-03 13:15:20.000000000 +0800
+++ upstream_dmadir/drivers/scsi/libata.h 2006-04-04 10:39:14.000000000 +0800
@@ -41,6 +41,7 @@ struct ata_scsi_args {
/* libata-core.c */
extern int atapi_enabled;
+extern int atapi_dmadir;
extern int libata_fua;
extern struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap,
struct ata_device *dev);
--- upstream/include/linux/libata.h 2006-04-03 13:15:27.000000000 +0800
+++ upstream_dmadir/include/linux/libata.h 2006-04-04 10:41:01.000000000 +0800
@@ -44,7 +44,6 @@
#undef ATA_NDEBUG /* define to disable quick runtime checks */
#undef ATA_ENABLE_PATA /* define to enable PATA support in some
* low-level drivers */
-#undef ATAPI_ENABLE_DMADIR /* enables ATAPI DMADIR bridge support */
/* note: prints function name for you */
next prev parent reply other threads:[~2006-04-04 2:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-03 18:56 libata machine check on Alpha Jonathan Blake Benson
2006-04-04 1:43 ` Tejun Heo
2006-04-04 2:12 ` Albert Lee
2006-04-04 2:15 ` Tejun Heo
2006-04-04 2:49 ` Albert Lee
2006-04-04 3:05 ` Tejun Heo
2006-04-04 8:24 ` Jeff Garzik
2006-04-04 2:57 ` Albert Lee [this message]
2006-04-04 3:07 ` [PATCH] libata: convert ATAPI_ENABLE_DMADIR to module parameter Tejun Heo
2006-04-04 12:44 ` Jeff Garzik
2006-04-05 15:48 ` libata machine check on Alpha Jonathan Blake Benson
2006-04-06 9:17 ` Albert Lee
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=4431E08E.8040108@tw.ibm.com \
--to=albertcc@tw.ibm.com \
--cc=airbatica@verizon.net \
--cc=albertl@mail.com \
--cc=dwm@maxeymade.com \
--cc=htejun@gmail.com \
--cc=jgarzik@pobox.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).