diff options
| author | perseant <perseant@NetBSD.org> | 2022-03-14 22:15:51 +0000 |
|---|---|---|
| committer | perseant <perseant@NetBSD.org> | 2022-03-14 22:15:51 +0000 |
| commit | 8bd0081aa71a33b40d73d41c7562fb322dfa1538 (patch) | |
| tree | dd4f43188bedb3b930123e53f1917dd37625e184 /sys/dev | |
| parent | 66380bc0cac70370c3e7aa6c16a9c67ee3b1bae4 (diff) | |
Avoid an unaccounted extra channel freeze, if a reset is requested
more than once before the thread services the request. Closes PR#56745.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/ata/ata.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sys/dev/ata/ata.c b/sys/dev/ata/ata.c index dc152339298..731c23ba729 100644 --- a/sys/dev/ata/ata.c +++ b/sys/dev/ata/ata.c @@ -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 @@ ata_thread_run(struct ata_channel *chp, int flags, int type, int arg) /* 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; |
