From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: Suleiman Souhlal <ssouhlal@freebsd.org>
Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] Make the IDE DMA timeout modifiable
Date: Wed, 21 Feb 2007 02:44:53 +0100 [thread overview]
Message-ID: <200702210244.53514.bzolnier@gmail.com> (raw)
In-Reply-To: <20070221011922.GA1777@freefall.freebsd.org>
On Wednesday 21 February 2007 02:19, Suleiman Souhlal wrote:
> It can be changed via /proc/ide/hd?/settings.
Why do we need to change IDE DMA timeout dynamically?
BTW /proc/ide/hd?/settings is obsoleted
> Signed-off-by: Ed Falk <efalk@google.com>
>
> ---
> drivers/ide/ide-dma.c | 3 ++-
> drivers/ide/ide.c | 2 ++
> include/linux/ide.h | 3 +++
> 3 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
> index 08e7cd0..a8da725 100644
> --- a/drivers/ide/ide-dma.c
> +++ b/drivers/ide/ide-dma.c
> @@ -579,7 +579,8 @@ EXPORT_SYMBOL_GPL(ide_dma_setup);
> static void ide_dma_exec_cmd(ide_drive_t *drive, u8 command)
> {
> /* issue cmd to drive */
> - ide_execute_command(drive, command, &ide_dma_intr, 2*WAIT_CMD, dma_timer_expiry);
> + ide_execute_command(drive, command, &ide_dma_intr, drive->dma_timeout,
> + dma_timer_expiry);
> }
>
> void ide_dma_start(ide_drive_t *drive)
> diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
> index b3c0818..ca841f2 100644
> --- a/drivers/ide/ide.c
> +++ b/drivers/ide/ide.c
> @@ -245,6 +245,7 @@ static void init_hwif_data(ide_hwif_t *h
> drive->name[1] = 'd';
> drive->name[2] = 'a' + (index * MAX_DRIVES) + unit;
> drive->max_failures = IDE_DEFAULT_MAX_FAILURES;
> + drive->dma_timeout = WAIT_DMA;
> drive->using_dma = 0;
> drive->vdma = 0;
> INIT_LIST_HEAD(&drive->list);
> @@ -1197,6 +1198,7 @@ void ide_add_generic_settings (ide_drive
> __ide_add_setting(drive, "init_speed", SETTING_RW, -1, -1, TYPE_BYTE, 0, 70, 1, 1, &drive->init_speed, NULL, 0);
> __ide_add_setting(drive, "current_speed", SETTING_RW, -1, -1, TYPE_BYTE, 0, 70, 1, 1, &drive->current_speed, set_xfer_rate, 0);
> __ide_add_setting(drive, "number", SETTING_RW, -1, -1, TYPE_BYTE, 0, 3, 1, 1, &drive->dn, NULL, 0);
> + __ide_add_setting(drive, "dma_timeout", SETTING_RW, -1, -1, TYPE_INT, 0, 2000000000, 1, 1, &drive->dma_timeout, NULL, 0);
> }
>
> /**
> diff --git a/include/linux/ide.h b/include/linux/ide.h
> index 79c0282..3861753 100644
> --- a/include/linux/ide.h
> +++ b/include/linux/ide.h
> @@ -183,6 +183,7 @@ #define WAIT_READY (5*HZ) /* 5sec - som
> #define WAIT_PIDENTIFY (10*HZ) /* 10sec - should be less than 3ms (?), if all ATAPI CD is closed at boot */
> #define WAIT_WORSTCASE (30*HZ) /* 30sec - worst case when spinning up */
> #define WAIT_CMD (10*HZ) /* 10sec - maximum wait for an IRQ to happen */
> +#define WAIT_DMA (20*HZ) /* 20sec - maximum wait for an IRQ to happen */
> #define WAIT_MIN_SLEEP (2*HZ/100) /* 20msec - minimum sleep time */
>
> /*
> @@ -638,6 +639,8 @@ typedef struct ide_drive_s {
> unsigned int drive_data; /* use by tuneproc/selectproc */
> unsigned int failures; /* current failure count */
> unsigned int max_failures; /* maximum allowed failure count */
> + int dma_timeout; /* number of jiffies to wait for a
> + dma to complete */
> u64 probed_capacity;/* initial reported media capacity (ide-cd only currently) */
>
> u64 capacity64; /* total number of sectors */
>
>
next prev parent reply other threads:[~2007-02-21 1:38 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-21 1:19 [PATCH 1/3] Make the IDE DMA timeout modifiable Suleiman Souhlal
2007-02-21 1:44 ` Bartlomiej Zolnierkiewicz [this message]
2007-02-21 2:13 ` Suleiman Souhlal
2007-02-21 2:42 ` Bartlomiej Zolnierkiewicz
2007-06-12 19:11 ` Sergei Shtylyov
2007-06-15 23:23 ` Bartlomiej Zolnierkiewicz
2007-07-10 19:10 ` Sergei Shtylyov
2007-07-13 15:16 ` Alan Cox
2007-07-13 15:12 ` Mark Lord
2007-07-13 15:21 ` Sergei Shtylyov
2007-07-13 19:36 ` Mark Lord
2007-07-13 19:40 ` Sergei Shtylyov
2007-07-13 19:46 ` Mark Lord
2007-07-13 20:03 ` Sergei Shtylyov
2007-07-13 21:00 ` Mark Lord
2007-07-16 19:29 ` Rogier Wolff
2007-07-17 14:18 ` Sergei Shtylyov
2007-07-13 20:08 ` Sergei Shtylyov
2007-07-13 20:54 ` Mark Lord
2007-07-13 21:00 ` 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=200702210244.53514.bzolnier@gmail.com \
--to=bzolnier@gmail.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ssouhlal@freebsd.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.