Module Name: src
Committed By: jakllsch
Date: Sun Jul 22 18:42:11 UTC 2012
Modified Files:
src/sys/dev/ata: wd.c
Log Message:
FLUSH CACHE EXT is a 48-bit command, issue as such. Both FLUSH CACHE commands
will return the LBA of first failure in the return task file, specifiy that we
want it read, even if we don't look at the value.
To generate a diff of this commit:
cvs rdiff -u -r1.396 -r1.397 src/sys/dev/ata/wd.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/ata/wd.c
diff -u src/sys/dev/ata/wd.c:1.396 src/sys/dev/ata/wd.c:1.397
--- src/sys/dev/ata/wd.c:1.396 Sun Jul 22 18:37:31 2012
+++ src/sys/dev/ata/wd.c Sun Jul 22 18:42:11 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: wd.c,v 1.396 2012/07/22 18:37:31 jakllsch Exp $ */
+/* $NetBSD: wd.c,v 1.397 2012/07/22 18:42:11 jakllsch Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved.
@@ -54,7 +54,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.396 2012/07/22 18:37:31 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.397 2012/07/22 18:42:11 jakllsch Exp $");
#include "opt_ata.h"
@@ -1906,13 +1906,14 @@ wd_flushcache(struct wd_softc *wd, int f
return ENODEV;
memset(&ata_c, 0, sizeof(struct ata_command));
if ((wd->sc_params.atap_cmd2_en & ATA_CMD2_LBA48) != 0 &&
- (wd->sc_params.atap_cmd2_en & ATA_CMD2_FCE) != 0)
+ (wd->sc_params.atap_cmd2_en & ATA_CMD2_FCE) != 0) {
ata_c.r_command = WDCC_FLUSHCACHE_EXT;
- else
+ flags |= AT_LBA48;
+ } else
ata_c.r_command = WDCC_FLUSHCACHE;
ata_c.r_st_bmask = WDCS_DRDY;
ata_c.r_st_pmask = WDCS_DRDY;
- ata_c.flags = flags;
+ ata_c.flags = flags | AT_READREG;
ata_c.timeout = 300000; /* 5m timeout */
if (wd->atabus->ata_exec_command(wd->drvp, &ata_c) != ATACMD_COMPLETE) {
aprint_error_dev(wd->sc_dev,