Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/scsipi If periph->periph_callout is already active, ...
details: https://anonhg.NetBSD.org/src/rev/db7404903c8c
branches: trunk
changeset: 526532:db7404903c8c
user: bouyer <bouyer%NetBSD.org@localhost>
date: Sun May 05 15:16:30 2002 +0000
description:
If periph->periph_callout is already active, don't freeze the periph again:
scispi_periph_timed_thaw() will be called only one time anyway.
diffstat:
sys/dev/scsipi/cd.c | 7 ++++---
sys/dev/scsipi/scsipi_base.c | 6 +++---
sys/dev/scsipi/sd.c | 7 ++++---
sys/dev/scsipi/st.c | 7 ++++---
4 files changed, 15 insertions(+), 12 deletions(-)
diffs (111 lines):
diff -r 31e51e988462 -r db7404903c8c sys/dev/scsipi/cd.c
--- a/sys/dev/scsipi/cd.c Sun May 05 15:05:33 2002 +0000
+++ b/sys/dev/scsipi/cd.c Sun May 05 15:16:30 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cd.c,v 1.161 2001/12/09 22:56:10 veego Exp $ */
+/* $NetBSD: cd.c,v 1.162 2002/05/05 15:16:31 bouyer Exp $ */
/*-
* Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -54,7 +54,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.161 2001/12/09 22:56:10 veego Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.162 2002/05/05 15:16:31 bouyer Exp $");
#include "rnd.h"
@@ -959,7 +959,8 @@
SC_DEBUG(periph, SCSIPI_DB1, ("Waiting 5 sec for CD "
"spinup\n"));
- scsipi_periph_freeze(periph, 1);
+ if (!callout_active(&periph->periph_callout))
+ scsipi_periph_freeze(periph, 1);
callout_reset(&periph->periph_callout,
5 * hz, scsipi_periph_timed_thaw, periph);
retval = ERESTART;
diff -r 31e51e988462 -r db7404903c8c sys/dev/scsipi/scsipi_base.c
--- a/sys/dev/scsipi/scsipi_base.c Sun May 05 15:05:33 2002 +0000
+++ b/sys/dev/scsipi/scsipi_base.c Sun May 05 15:16:30 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: scsipi_base.c,v 1.71 2002/04/01 20:37:42 bouyer Exp $ */
+/* $NetBSD: scsipi_base.c,v 1.72 2002/05/05 15:16:32 bouyer Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.71 2002/04/01 20:37:42 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.72 2002/05/05 15:16:32 bouyer Exp $");
#include "opt_scsi.h"
@@ -1519,7 +1519,7 @@
if ((xs->xs_control & XS_CTL_POLL) ||
(chan->chan_flags & SCSIPI_CHAN_TACTIVE) == 0) {
delay(1000000);
- } else {
+ } else if (!callout_active(&periph->periph_callout)) {
scsipi_periph_freeze(periph, 1);
callout_reset(&periph->periph_callout,
hz, scsipi_periph_timed_thaw, periph);
diff -r 31e51e988462 -r db7404903c8c sys/dev/scsipi/sd.c
--- a/sys/dev/scsipi/sd.c Sun May 05 15:05:33 2002 +0000
+++ b/sys/dev/scsipi/sd.c Sun May 05 15:16:30 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sd.c,v 1.181 2002/01/09 04:12:11 thorpej Exp $ */
+/* $NetBSD: sd.c,v 1.182 2002/05/05 15:16:30 bouyer Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -54,7 +54,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.181 2002/01/09 04:12:11 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.182 2002/05/05 15:16:30 bouyer Exp $");
#include "opt_scsi.h"
#include "rnd.h"
@@ -1259,7 +1259,8 @@
*/
printf("%s: waiting for pack to spin up...\n",
sd->sc_dev.dv_xname);
- scsipi_periph_freeze(periph, 1);
+ if (!callout_active(&periph->periph_callout))
+ scsipi_periph_freeze(periph, 1);
callout_reset(&periph->periph_callout,
5 * hz, scsipi_periph_timed_thaw, periph);
retval = ERESTART;
diff -r 31e51e988462 -r db7404903c8c sys/dev/scsipi/st.c
--- a/sys/dev/scsipi/st.c Sun May 05 15:05:33 2002 +0000
+++ b/sys/dev/scsipi/st.c Sun May 05 15:16:30 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: st.c,v 1.154 2002/05/03 20:41:17 bouyer Exp $ */
+/* $NetBSD: st.c,v 1.155 2002/05/05 15:16:31 bouyer Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -56,7 +56,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: st.c,v 1.154 2002/05/03 20:41:17 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: st.c,v 1.155 2002/05/05 15:16:31 bouyer Exp $");
#include "opt_scsi.h"
@@ -2092,7 +2092,8 @@
if (key == SKEY_NOT_READY && st->asc == 0x4 && st->ascq == 0x1) {
/* Not Ready, Logical Unit Is in Process Of Becoming Ready */
- scsipi_periph_freeze(periph, 1);
+ if (!callout_active(&periph->periph_callout))
+ scsipi_periph_freeze(periph, 1);
callout_reset(&periph->periph_callout,
hz, scsipi_periph_timed_thaw, periph);
return (ERESTART);
Home |
Main Index |
Thread Index |
Old Index