Re: Changes to ide-probe.c in 2.6.9-rc2 causing improper detection

From: Jeff Garzik
Date: Tue Sep 14 2004 - 10:27:23 EST


Alan Cox wrote:
On Maw, 2004-09-14 at 07:06, Jens Axboe wrote:

Alan, I bet there are a lot of these. Maybe we should consider letting
the user manually flag support for FLUSH_CACHE, at least it is in their
hands then.


You are assuming the drive supports "FLUSH_CACHE" just because it
doesn't error it. Thats a good way to have accidents.

The patch I posted originally did turn wcache off for barrier if no
flush cache support was present but had a small bug so that bit got
dropped.


FWIW the libata test for checking whether it is OK to issue a flush is

return ata_id_wcache_enabled(dev) ||
ata_id_has_flush(dev) ||
ata_id_has_flush_ext(dev);

and if it passes that test,

if ((tf->flags & ATA_TFLAG_LBA48) &&
(ata_id_has_flush_ext(qc->dev)))
tf->command = ATA_CMD_FLUSH_EXT;
else
tf->command = ATA_CMD_FLUSH;

I wouldn't object to removing the "ata_id_wcache_enabled" test if people feel that it is unsafe.

Jeff


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/