From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: linux-ide@vger.kernel.org
Subject: [PATCH 5/7] ide: add "hdx=nodma" kernel parameter
Date: Sat, 18 Aug 2007 20:50:50 +0200 [thread overview]
Message-ID: <200708182050.50372.bzolnier@gmail.com> (raw)
* Add "hdx=nodma" option allowing user to disallow DMA for a given device.
* Obsolete "ide=nodma" option.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
Documentation/ide.txt | 4 ++--
drivers/ide/ide-dma.c | 2 +-
drivers/ide/ide.c | 7 +++++--
include/linux/ide.h | 1 +
4 files changed, 9 insertions(+), 5 deletions(-)
Index: b/Documentation/ide.txt
===================================================================
--- a/Documentation/ide.txt
+++ b/Documentation/ide.txt
@@ -242,6 +242,8 @@ Summary of ide driver parameters for ker
and quite likely to cause trouble with
older/odd IDE drives.
+ "hdx=nodma" : disallow DMA
+
"hdx=swapdata" : when the drive is a disk, byte swap all data
"hdx=bswap" : same as above..........
@@ -286,8 +288,6 @@ Summary of ide driver parameters for ker
"ide=reverse" : formerly called to pci sub-system, but now local.
- "ide=nodma" : disable DMA globally for the IDE subsystem.
-
The following are valid ONLY on ide0, which usually corresponds
to the first ATA interface found on the particular host, and the defaults for
the base,ctl ports must not be altered.
Index: b/drivers/ide/ide-dma.c
===================================================================
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -754,7 +754,7 @@ static int ide_tune_dma(ide_drive_t *dri
{
u8 speed;
- if (noautodma || (drive->id->capability & 1) == 0)
+ if (noautodma || drive->nodma || (drive->id->capability & 1) == 0)
return 0;
/* consult the list of known "bad" drives */
Index: b/drivers/ide/ide.c
===================================================================
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -1274,7 +1274,7 @@ static int __init ide_setup(char *s)
if (!strcmp(s, "ide=nodma")) {
printk(" : Prevented DMA\n");
noautodma = 1;
- return 1;
+ goto obsolete_option;
}
#ifdef CONFIG_IDEPCI_PCIBUS_ORDER
@@ -1308,7 +1308,7 @@ static int __init ide_setup(char *s)
*/
if (s[0] == 'h' && s[1] == 'd' && s[2] >= 'a' && s[2] <= max_drive) {
const char *hd_words[] = {
- "none", "noprobe", "nowerr", "cdrom", "minus5",
+ "none", "noprobe", "nowerr", "cdrom", "nodma",
"autotune", "noautotune", "minus8", "swapdata", "bswap",
"noflush", "remap", "remap63", "scsi", NULL };
unit = s[2] - 'a';
@@ -1336,6 +1336,9 @@ static int __init ide_setup(char *s)
drive->ready_stat = 0;
hwif->noprobe = 0;
goto done;
+ case -5: /* nodma */
+ drive->nodma = 1;
+ goto done;
case -6: /* "autotune" */
drive->autotune = IDE_TUNE_AUTO;
goto obsolete_option;
Index: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -599,6 +599,7 @@ typedef struct ide_drive_s {
unsigned nice0 : 1; /* give obvious excess bandwidth */
unsigned nice2 : 1; /* give a share in our own bandwidth */
unsigned doorlocking : 1; /* for removable only: door lock/unlock works */
+ unsigned nodma : 1; /* disallow DMA */
unsigned autotune : 2; /* 0=default, 1=autotune, 2=noautotune */
unsigned remap_0_to_1 : 1; /* 0=noremap, 1=remap 0->1 (for EZDrive) */
unsigned blocked : 1; /* 1=powermanagment told us not to do anything, so sleep nicely */
next reply other threads:[~2007-08-18 19:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-18 18:50 Bartlomiej Zolnierkiewicz [this message]
2007-08-19 13:43 ` [PATCH 5/7] ide: add "hdx=nodma" kernel parameter Sergei Shtylyov
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=200708182050.50372.bzolnier@gmail.com \
--to=bzolnier@gmail.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).