ide: DMA_PIO_RETRY -> IDE_DFLAG_DMA_PIO_RETRY

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Monday, October 13, 2008 - 3:27 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c39220...
Commit:     c39220483ebe6871fb129d4b2236cd95290c41fc
Parent:     97100fc816badbbc162644cfde7ad39ae9211fb4
Author:     Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
AuthorDate: Mon Oct 13 21:39:37 2008 +0200
Committer:  Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
CommitDate: Mon Oct 13 21:39:37 2008 +0200

    ide: DMA_PIO_RETRY -> IDE_DFLAG_DMA_PIO_RETRY
    
    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(-)

diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 5f0ed59..11b602b 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -78,8 +78,9 @@ static int __ide_end_request(ide_drive_t *drive, struct request *rq,
 	 * 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_retry(ide_drive_t *drive, int error)
 	 * 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);
 
 	/*
diff --git a/include/linux/ide.h b/include/linux/ide.h
index b538d2e..230bd9d 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -48,12 +48,6 @@ typedef unsigned char	byte;	/* used everywhere */
 #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))
 
@@ -506,6 +500,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 {
@@ -535,7 +531,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 */
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
ide: DMA_PIO_RETRY -> IDE_DFLAG_DMA_PIO_RETRY, Linux Kernel Mailing ..., (Mon Oct 13, 3:27 pm)