summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Yurchenko <grange@cvs.openbsd.org>2005-05-15 18:09:30 +0000
committerAlexander Yurchenko <grange@cvs.openbsd.org>2005-05-15 18:09:30 +0000
commit7680ecc4f68a0747b7a93e75e689cc59ac8fa358 (patch)
treea404b30b5c5fdd21567f17d768555a82c56a4d8e
parent1177586f605d0fc57128fce81a479094f3c75e7a (diff)
Use FLUSHCACHE EXT instead of FLUSHCACHE for LBA48 operations.
First noticed by christos@netbsd (iirc) a long time ago. Tested by canacar@ and krw@.
-rw-r--r--sys/dev/ata/wd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/ata/wd.c b/sys/dev/ata/wd.c
index 97c52e29b0f..840f088b165 100644
--- a/sys/dev/ata/wd.c
+++ b/sys/dev/ata/wd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wd.c,v 1.41 2004/07/06 00:38:38 aaron Exp $ */
+/* $OpenBSD: wd.c,v 1.42 2005/05/15 18:09:29 grange Exp $ */
/* $NetBSD: wd.c,v 1.193 1999/02/28 17:15:27 explorer Exp $ */
/*
@@ -1274,7 +1274,8 @@ wd_flushcache(struct wd_softc *wd, int flags)
if (wd->drvp->ata_vers < 4) /* WDCC_FLUSHCACHE is here since ATA-4 */
return;
bzero(&wdc_c, sizeof(struct wdc_command));
- wdc_c.r_command = WDCC_FLUSHCACHE;
+ wdc_c.r_command = (wd->sc_flags & WDF_LBA48 ? WDCC_FLUSHCACHE_EXT :
+ WDCC_FLUSHCACHE);
wdc_c.r_st_bmask = WDCS_DRDY;
wdc_c.r_st_pmask = WDCS_DRDY;
if (flags != 0) {