Module Name: src
Committed By: martin
Date: Tue Feb 8 14:45:00 UTC 2022
Modified Files:
src/sys/dev/ata [netbsd-9]: ata_recovery.c ata_subr.c
Log Message:
Pull up following revision(s) (requested by jdolecek in ticket #1426):
sys/dev/ata/ata_recovery.c: revision 1.3
sys/dev/ata/ata_subr.c: revision 1.9
stop xfer timeouts during recovery, all xfers will be requeued anyway
this avoids race with the timeout routine when processing the xfers
for requeueing
should fix PR kern/54790 by Izumi Tsutsui
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.8.1 src/sys/dev/ata/ata_recovery.c
cvs rdiff -u -r1.8 -r1.8.4.1 src/sys/dev/ata/ata_subr.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/ata_recovery.c
diff -u src/sys/dev/ata/ata_recovery.c:1.2 src/sys/dev/ata/ata_recovery.c:1.2.8.1
--- src/sys/dev/ata/ata_recovery.c:1.2 Mon Oct 22 20:13:47 2018
+++ src/sys/dev/ata/ata_recovery.c Tue Feb 8 14:45:00 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: ata_recovery.c,v 1.2 2018/10/22 20:13:47 jdolecek Exp $ */
+/* $NetBSD: ata_recovery.c,v 1.2.8.1 2022/02/08 14:45:00 martin Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ata_recovery.c,v 1.2 2018/10/22 20:13:47 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata_recovery.c,v 1.2.8.1 2022/02/08 14:45:00 martin Exp $");
#include "opt_ata.h"
@@ -171,6 +171,9 @@ ata_recovery_resume(struct ata_channel *
ata_queue_hold(chp);
+ /* Stop the timeout callout, recovery will requeue once done */
+ callout_stop(&chp->c_timo_callout);
+
KASSERT(drive < chp->ch_ndrives);
drvp = &chp->ch_drive[drive];
Index: src/sys/dev/ata/ata_subr.c
diff -u src/sys/dev/ata/ata_subr.c:1.8 src/sys/dev/ata/ata_subr.c:1.8.4.1
--- src/sys/dev/ata/ata_subr.c:1.8 Wed Nov 7 17:05:54 2018
+++ src/sys/dev/ata/ata_subr.c Tue Feb 8 14:45:00 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: ata_subr.c,v 1.8 2018/11/07 17:05:54 jdolecek Exp $ */
+/* $NetBSD: ata_subr.c,v 1.8.4.1 2022/02/08 14:45:00 martin Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved.
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ata_subr.c,v 1.8 2018/11/07 17:05:54 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata_subr.c,v 1.8.4.1 2022/02/08 14:45:00 martin Exp $");
#include "opt_ata.h"
@@ -235,6 +235,11 @@ ata_timeout(void *v)
callout_ack(&chp->c_timo_callout);
+ if (chp->ch_flags & ATACH_RECOVERING) {
+ /* Do nothing, recovery will requeue the xfers */
+ return;
+ }
+
/*
* If there is a timeout, means the last enqueued command
* timed out, and thus all commands timed out.