Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/jdolecek-ncqfixes]: src/sys/dev/ata relax the NOERROR + C_CHAOS, just re...
details: https://anonhg.NetBSD.org/src/rev/42012adbdda7
branches: jdolecek-ncqfixes
changeset: 1025088:42012adbdda7
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Thu Oct 04 19:42:01 2018 +0000
description:
relax the NOERROR + C_CHAOS, just rerun the xfer instead of panic, to handle
another variant of bad/missing AHCI error recovery, this time under Parallels
diffstat:
sys/dev/ata/TODO.ncq | 5 +++--
sys/dev/ata/wd.c | 20 +++++++++++++++-----
2 files changed, 18 insertions(+), 7 deletions(-)
diffs (58 lines):
diff -r 58b4111c7dfd -r 42012adbdda7 sys/dev/ata/TODO.ncq
--- a/sys/dev/ata/TODO.ncq Thu Oct 04 17:59:35 2018 +0000
+++ b/sys/dev/ata/TODO.ncq Thu Oct 04 19:42:01 2018 +0000
@@ -1,6 +1,7 @@
jdolecek-ncqfixes goals:
-- fix ahci(4) error handling under paralles - invalid bio via WD_CHAOS_MONKEY
- ends up being handled as NOERROR, triggering KASSERT() in wd(4)
+- re-check READ LOG EXT handling under native and Parallels to make sure
+ the NOERROR under Parallels is their bug and not ours
+- run recovery via atathread, move to new function and share ahci/siisata/mvsata
- remove controller-specific slot bitmaps (ic/siisata.c, ic/ahcisata_core.c)
Bugs
diff -r 58b4111c7dfd -r 42012adbdda7 sys/dev/ata/wd.c
--- a/sys/dev/ata/wd.c Thu Oct 04 17:59:35 2018 +0000
+++ b/sys/dev/ata/wd.c Thu Oct 04 19:42:01 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wd.c,v 1.441.2.8 2018/10/04 17:53:23 jdolecek Exp $ */
+/* $NetBSD: wd.c,v 1.441.2.9 2018/10/04 19:42:01 jdolecek 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.441.2.8 2018/10/04 17:53:23 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.441.2.9 2018/10/04 19:42:01 jdolecek Exp $");
#include "opt_ata.h"
#include "opt_wd.h"
@@ -914,13 +914,23 @@
bp->b_error = EIO;
break;
case NOERROR:
+#ifdef WD_CHAOS_MONKEY
+ /*
+ * For example Parallels AHCI emulation doesn't actually
+ * return error for the invalid I/O, so just re-run
+ * the request and do not panic.
+ */
+ if (__predict_false(xfer->c_flags & C_CHAOS)) {
+ xfer->c_bio.error = REQUEUE;
+ errmsg = "chaos noerror";
+ goto retry2;
+ }
+#endif
+
noerror: if ((xfer->c_bio.flags & ATA_CORR) || xfer->c_retries > 0)
device_printf(dksc->sc_dev,
"soft error (corrected) xfer %"PRIxPTR"\n",
(intptr_t)xfer & PAGE_MASK);
-#ifdef WD_CHAOS_MONKEY
- KASSERT((xfer->c_flags & C_CHAOS) == 0);
-#endif
break;
case ERR_NODEV:
bp->b_error = EIO;
Home |
Main Index |
Thread Index |
Old Index