[PATCH] ide: option to disable cache flushes for buggy drives
authorJens Axboe <axboe@suse.de>
Fri, 28 Jul 2006 06:54:59 +0000 (08:54 +0200)
committerJens Axboe <axboe@suse.de>
Fri, 28 Jul 2006 06:54:59 +0000 (08:54 +0200)
Some drives claim they support cache flushing, but get seriously
confused if you try. Add this option to be able to boot with
barriers enabled by default.

Signed-off-by: Jens Axboe <axboe@suse.de>
drivers/ide/ide-disk.c
drivers/ide/ide.c
include/linux/ide.h

index f712e4cfd9dcb7eb1dafba2dc59f7e1c584f80f2..7cf3eb02352140d8f8558533aee4107c8fd1a445 100644 (file)
@@ -776,7 +776,7 @@ static void update_ordered(ide_drive_t *drive)
                 * not available so we don't need to recheck that.
                 */
                capacity = idedisk_capacity(drive);
-               barrier = ide_id_has_flush_cache(id) &&
+               barrier = ide_id_has_flush_cache(id) && !drive->noflush &&
                        (drive->addressing == 0 || capacity <= (1ULL << 28) ||
                         ide_id_has_flush_cache_ext(id));
 
index 05fbd9298db7c7cd5e265a8d9a65a994ec1c81f5..defd4b4bd37488ab38198e8ab86f963c438e2809 100644 (file)
@@ -1539,7 +1539,7 @@ static int __init ide_setup(char *s)
                const char *hd_words[] = {
                        "none", "noprobe", "nowerr", "cdrom", "serialize",
                        "autotune", "noautotune", "minus8", "swapdata", "bswap",
-                       "minus11", "remap", "remap63", "scsi", NULL };
+                       "noflush", "remap", "remap63", "scsi", NULL };
                unit = s[2] - 'a';
                hw   = unit / MAX_DRIVES;
                unit = unit % MAX_DRIVES;
@@ -1578,6 +1578,9 @@ static int __init ide_setup(char *s)
                        case -10: /* "bswap" */
                                drive->bswap = 1;
                                goto done;
+                       case -11: /* noflush */
+                               drive->noflush = 1;
+                               goto done;
                        case -12: /* "remap" */
                                drive->remap_0_to_1 = 1;
                                goto done;
index dc7abef1096545c167e9ee7122ddc32b5712413b..99620451d958730a7754cf80acf572a770d75e40 100644 (file)
@@ -571,6 +571,7 @@ typedef struct ide_drive_s {
        u8      waiting_for_dma;        /* dma currently in progress */
        u8      unmask;                 /* okay to unmask other irqs */
        u8      bswap;                  /* byte swap data */
+       u8      noflush;                /* don't attempt flushes */
        u8      dsc_overlap;            /* DSC overlap */
        u8      nice1;                  /* give potential excess bandwidth */