Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ata Avoid an unaccounted extra channel freeze, if a ...



details:   https://anonhg.NetBSD.org/src/rev/60aed67fa2cd
branches:  trunk
changeset: 363907:60aed67fa2cd
user:      perseant <perseant%NetBSD.org@localhost>
date:      Mon Mar 14 22:15:51 2022 +0000

description:
Avoid an unaccounted extra channel freeze, if a reset is requested
more than once before the thread services the request.  Closes PR#56745.

diffstat:

 sys/dev/ata/ata.c |  18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diffs (39 lines):

diff -r 2ee157edd2b1 -r 60aed67fa2cd sys/dev/ata/ata.c
--- a/sys/dev/ata/ata.c Mon Mar 14 22:14:19 2022 +0000
+++ b/sys/dev/ata/ata.c Mon Mar 14 22:15:51 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ata.c,v 1.166 2022/02/23 21:54:40 andvar Exp $ */
+/*     $NetBSD: ata.c,v 1.167 2022/03/14 22:15:51 perseant Exp $       */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.166 2022/02/23 21:54:40 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.167 2022/03/14 22:15:51 perseant Exp $");
 
 #include "opt_ata.h"
 
@@ -1600,12 +1600,14 @@
                        /* NOTREACHED */
                }
 
-               /*
-                * Block execution of other commands while reset is scheduled
-                * to a thread.
-                */
-               ata_channel_freeze_locked(chp);
-               chp->ch_flags |= type;
+               if (!(chp->ch_flags & type)) {
+                       /*
+                        * Block execution of other commands while
+                        * reset is scheduled to a thread.
+                        */
+                       ata_channel_freeze_locked(chp);
+                       chp->ch_flags |= type;
+               }
 
                cv_signal(&chp->ch_thr_idle);
                return;



Home | Main Index | Thread Index | Old Index