linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: linux-ide@vger.kernel.org
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 6/9] ide: DMA_PIO_RETRY -> IDE_DFLAG_DMA_PIO_RETRY
Date: Sun, 17 Aug 2008 19:15:29 +0200	[thread overview]
Message-ID: <20080817171529.27943.88937.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20080817171454.27943.37234.sendpatchset@localhost.localdomain>

Add IDE_DFLAG_DMA_PIO_RETRY and use it instead of
ide_drive_t.state + DMA_PIO_RETRY.

There should be no functional changes cause by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/ide-io.c |    7 ++++---
 include/linux/ide.h  |    9 ++-------
 2 files changed, 6 insertions(+), 10 deletions(-)

Index: b/drivers/ide/ide-io.c
===================================================================
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -78,8 +78,9 @@ static int __ide_end_request(ide_drive_t
 	 * decide whether to reenable DMA -- 3 is a random magic for now,
 	 * if we DMA timeout more than 3 times, just stay in PIO
 	 */
-	if (drive->state == DMA_PIO_RETRY && drive->retry_pio <= 3) {
-		drive->state = 0;
+	if ((drive->dev_flags & IDE_DFLAG_DMA_PIO_RETRY) &&
+	    drive->retry_pio <= 3) {
+		drive->dev_flags &= ~IDE_DFLAG_DMA_PIO_RETRY;
 		ide_dma_on(drive);
 	}
 
@@ -1195,8 +1196,8 @@ static ide_startstop_t ide_dma_timeout_r
 	 * a timeout -- we'll reenable after we finish this next request
 	 * (or rather the first chunk of it) in pio.
 	 */
+	drive->dev_flags |= IDE_DFLAG_DMA_PIO_RETRY;
 	drive->retry_pio++;
-	drive->state = DMA_PIO_RETRY;
 	ide_dma_off_quietly(drive);
 
 	/*
Index: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -48,12 +48,6 @@ typedef unsigned char	byte;	/* used ever
 #define ERROR_RESET	3	/* Reset controller every 4th retry */
 #define ERROR_RECAL	1	/* Recalibrate every 2nd retry */
 
-/*
- * state flags
- */
-
-#define DMA_PIO_RETRY	1	/* retrying in PIO */
-
 #define HWIF(drive)		((ide_hwif_t *)((drive)->hwif))
 #define HWGROUP(drive)		((ide_hwgroup_t *)(HWIF(drive)->hwgroup))
 
@@ -504,6 +498,8 @@ enum {
 	IDE_DFLAG_WCACHE		= (1 << 23),
 	/* used for ignoring ATA_DF */
 	IDE_DFLAG_NOWERR		= (1 << 24),
+	/* retrying in PIO */
+	IDE_DFLAG_DMA_PIO_RETRY		= (1 << 25),
 };
 
 struct ide_drive_s {
@@ -533,7 +529,6 @@ struct ide_drive_s {
 	select_t	select;		/* basic drive/head select reg value */
 
 	u8	retry_pio;		/* retrying dma capable host in pio */
-	u8	state;			/* retry state */
 	u8	waiting_for_dma;	/* dma currently in progress */
 
         u8	quirk_list;	/* considered quirky, set for a specific host */

  parent reply	other threads:[~2008-08-17 17:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-17 17:14 [PATCH 1/9] ide: fix IDE ACPI for slave device-only configurations Bartlomiej Zolnierkiewicz
2008-08-17 17:15 ` [PATCH 2/9] ide-disk: set_addressing() fixes Bartlomiej Zolnierkiewicz
2008-08-23 21:45   ` Sergei Shtylyov
2008-08-25 20:23     ` Bartlomiej Zolnierkiewicz
2008-08-17 17:15 ` [PATCH 3/9] ide-disk: remove stale init_idedisk_capacity() documentation Bartlomiej Zolnierkiewicz
2008-08-20 10:06   ` Sergei Shtylyov
2008-08-17 17:15 ` [PATCH 4/9] ide-disk: add ide_do_setfeature() helper Bartlomiej Zolnierkiewicz
2008-08-20 10:04   ` Sergei Shtylyov
2008-08-17 17:15 ` [PATCH 5/9] ide: add device flags Bartlomiej Zolnierkiewicz
2008-08-17 17:15 ` Bartlomiej Zolnierkiewicz [this message]
2008-08-17 17:15 ` [PATCH 7/9] ide: remove superfluous ->media field from ide_driver_t Bartlomiej Zolnierkiewicz
2008-08-23 21:07   ` Sergei Shtylyov
2008-08-17 17:15 ` [PATCH 8/9] ide: remove superfluous ->dma field from ide_hwif_t Bartlomiej Zolnierkiewicz
2008-08-20 10:15   ` Sergei Shtylyov
2008-08-17 17:15 ` [PATCH 9/9] ide: remove superfluous ->waiting_for_dma checks Bartlomiej Zolnierkiewicz
2008-08-20 10:08   ` 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=20080817171529.27943.88937.sendpatchset@localhost.localdomain \
    --to=bzolnier@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@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).