NetBSD Problem Report #37508

From juan@xtrarom.org  Sun Dec  9 21:32:25 2007
Return-Path: <juan@xtrarom.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id C557263B946
	for <gnats-bugs@gnats.NetBSD.org>; Sun,  9 Dec 2007 21:32:25 +0000 (UTC)
Message-Id: <20071209213223.CAEF516B87@nocturno>
Date: Sun,  9 Dec 2007 22:32:23 +0100 (CET)
From: juan@xtrarom.org
Reply-To: juan@xtrarom.org
To: gnats-bugs@NetBSD.org
Subject: After jmcneill-pm, disks are switched to standby before rebooting
X-Send-Pr-Version: 3.95

>Number:         37508
>Category:       kern
>Synopsis:       After jmcneill-pm, disks are switched to standby before rebooting
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    joerg
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 09 21:35:00 +0000 2007
>Closed-Date:    Sat Jan 05 05:16:40 +0000 2008
>Last-Modified:  Sat Jan 05 05:16:40 +0000 2008
>Originator:     juan@xtrarom.org
>Release:        NetBSD 4.99.41
>Organization:
Juan Romero Pardines	- The NetBSD Project
http://plog.xtrarom.org	- NetBSD/pkgsrc news in Spanish
>Environment:
System: NetBSD sasha 4.99.41 NetBSD 4.99.41 (Nocturno-nodbg) #70: Sun Dec 9 22:24:17 CET 2007 juan@sasha:/home/juan/build/i386/obj/sys/arch/i386/compile/Nocturno-nodbg i386
Architecture: i386
Machine: i386
>Description:

	After the jmcneill-pm branch has been merged in, issuing a reboot
	call will switch the IDE disks to standby/sleep mode before the system
	is rebooted... that's unacceptable for me because that means a longer
	time in the BIOS that is waiting for disk initialization.

>How-To-Repeat:
>Fix:
	Yes, please.

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->joerg
Responsible-Changed-By: jmcneill@netbsd.org
Responsible-Changed-When: Mon, 10 Dec 2007 15:44:21 +0000
Responsible-Changed-Why:
jmcneill-pm fallout


From: Manuel Bouyer <bouyer@antioche.eu.org>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@NetBSD.org, gnats-admin@NetBSD.org,
	netbsd-bugs@NetBSD.org
Subject: Re: kern/37508: After jmcneill-pm, disks are switched to standby before rebooting
Date: Mon, 10 Dec 2007 16:23:59 +0100

 On Sun, Dec 09, 2007 at 09:35:00PM +0000, juan@xtrarom.org wrote:
 > >Number:         37508
 > >Category:       kern
 > >Synopsis:       After jmcneill-pm, disks are switched to standby before rebooting
 > >Confidential:   no
 > >Severity:       serious
 > >Priority:       high
 > >Responsible:    kern-bug-people
 > >State:          open
 > >Class:          sw-bug
 > >Submitter-Id:   net
 > >Arrival-Date:   Sun Dec 09 21:35:00 +0000 2007
 > >Originator:     juan@xtrarom.org
 > >Release:        NetBSD 4.99.41
 > >Organization:
 > Juan Romero Pardines	- The NetBSD Project
 > http://plog.xtrarom.org	- NetBSD/pkgsrc news in Spanish
 > >Environment:
 > System: NetBSD sasha 4.99.41 NetBSD 4.99.41 (Nocturno-nodbg) #70: Sun Dec 9 22:24:17 CET 2007 juan@sasha:/home/juan/build/i386/obj/sys/arch/i386/compile/Nocturno-nodbg i386
 > Architecture: i386
 > Machine: i386
 > >Description:
 > 
 > 	After the jmcneill-pm branch has been merged in, issuing a reboot
 > 	call will switch the IDE disks to standby/sleep mode before the system
 > 	is rebooted... that's unacceptable for me because that means a longer
 > 	time in the BIOS that is waiting for disk initialization.

 That's also inacceptable because this means shortened life for the
 disks. They have a limited start/stop cycle count, and for some of them
 (the older ones, or some of the ones designed for 24x7 usage) it isn't that
 high. 

 -- 
 Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
      NetBSD: 26 ans d'experience feront toujours la difference
 --

From: Juan RP <juan@xtrarom.org>
To: Manuel Bouyer <bouyer@antioche.eu.org>
Cc: gnats-bugs@NetBSD.org
Subject: Re: kern/37508: After jmcneill-pm, disks are switched to standby
 before rebooting
Date: Mon, 10 Dec 2007 17:32:54 +0100

 On Mon, 10 Dec 2007 16:23:59 +0100
 Manuel Bouyer <bouyer@antioche.eu.org> wrote:

 > On Sun, Dec 09, 2007 at 09:35:00PM +0000, juan@xtrarom.org wrote:
 > > >Number:         37508
 > > >Category:       kern
 > > >Synopsis:       After jmcneill-pm, disks are switched to standby before rebooting
 > > >Confidential:   no
 > > >Severity:       serious
 > > >Priority:       high
 > > >Responsible:    kern-bug-people
 > > >State:          open
 > > >Class:          sw-bug
 > > >Submitter-Id:   net
 > > >Arrival-Date:   Sun Dec 09 21:35:00 +0000 2007
 > > >Originator:     juan@xtrarom.org
 > > >Release:        NetBSD 4.99.41
 > > >Organization:
 > > Juan Romero Pardines	- The NetBSD Project
 > > http://plog.xtrarom.org	- NetBSD/pkgsrc news in Spanish
 > > >Environment:
 > > System: NetBSD sasha 4.99.41 NetBSD 4.99.41 (Nocturno-nodbg) #70: Sun Dec 9 22:24:17 CET 2007 juan@sasha:/home/juan/build/i386/obj/sys/arch/i386/compile/Nocturno-nodbg i386
 > > Architecture: i386
 > > Machine: i386
 > > >Description:
 > > 
 > > 	After the jmcneill-pm branch has been merged in, issuing a reboot
 > > 	call will switch the IDE disks to standby/sleep mode before the system
 > > 	is rebooted... that's unacceptable for me because that means a longer
 > > 	time in the BIOS that is waiting for disk initialization.
 > 
 > That's also inacceptable because this means shortened life for the
 > disks. They have a limited start/stop cycle count, and for some of them
 > (the older ones, or some of the ones designed for 24x7 usage) it isn't that
 > high. 

 So the driver now does:

 +static bool
 +wd_suspend(device_t dv)
 +{
 +       struct wd_softc *sc = device_private(dv);
 +
 +       wd_flushcache(sc, AT_WAIT | AT_POLL);
 +       wd_standby(sc, AT_WAIT | AT_POLL);
 +
 +       return true;
  }

 This would be ok when you are suspending/resuming but not when rebooting or
 powering down the system!

 -- 
 Juan Romero Pardines	- The NetBSD Project
 http://plog.xtrarom.org	- NetBSD/pkgsrc news in Spanish

From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Juan RP <juan@xtrarom.org>
Cc: gnats-bugs@NetBSD.org
Subject: Re: kern/37508: After jmcneill-pm, disks are switched to standby before rebooting
Date: Mon, 10 Dec 2007 17:46:09 +0100

 On Mon, Dec 10, 2007 at 05:32:54PM +0100, Juan RP wrote:
 > On Mon, 10 Dec 2007 16:23:59 +0100
 > Manuel Bouyer <bouyer@antioche.eu.org> wrote:
 > 
 > > On Sun, Dec 09, 2007 at 09:35:00PM +0000, juan@xtrarom.org wrote:
 > > > >Number:         37508
 > > > >Category:       kern
 > > > >Synopsis:       After jmcneill-pm, disks are switched to standby before rebooting
 > > > >Confidential:   no
 > > > >Severity:       serious
 > > > >Priority:       high
 > > > >Responsible:    kern-bug-people
 > > > >State:          open
 > > > >Class:          sw-bug
 > > > >Submitter-Id:   net
 > > > >Arrival-Date:   Sun Dec 09 21:35:00 +0000 2007
 > > > >Originator:     juan@xtrarom.org
 > > > >Release:        NetBSD 4.99.41
 > > > >Organization:
 > > > Juan Romero Pardines	- The NetBSD Project
 > > > http://plog.xtrarom.org	- NetBSD/pkgsrc news in Spanish
 > > > >Environment:
 > > > System: NetBSD sasha 4.99.41 NetBSD 4.99.41 (Nocturno-nodbg) #70: Sun Dec 9 22:24:17 CET 2007 juan@sasha:/home/juan/build/i386/obj/sys/arch/i386/compile/Nocturno-nodbg i386
 > > > Architecture: i386
 > > > Machine: i386
 > > > >Description:
 > > > 
 > > > 	After the jmcneill-pm branch has been merged in, issuing a reboot
 > > > 	call will switch the IDE disks to standby/sleep mode before the system
 > > > 	is rebooted... that's unacceptable for me because that means a longer
 > > > 	time in the BIOS that is waiting for disk initialization.
 > > 
 > > That's also inacceptable because this means shortened life for the
 > > disks. They have a limited start/stop cycle count, and for some of them
 > > (the older ones, or some of the ones designed for 24x7 usage) it isn't that
 > > high. 
 > 
 > So the driver now does:
 > 
 > +static bool
 > +wd_suspend(device_t dv)
 > +{
 > +       struct wd_softc *sc = device_private(dv);
 > +
 > +       wd_flushcache(sc, AT_WAIT | AT_POLL);
 > +       wd_standby(sc, AT_WAIT | AT_POLL);
 > +
 > +       return true;
 >  }
 > 
 > This would be ok when you are suspending/resuming but not when rebooting or
 > powering down the system!

 It may be OK for a power down (there is even a PR for this: kern/32766:
 some macppc systems rely on the system doing the wd_standby() before powering
 down, the firmware doesn't do it). But it's definitively not OK
 for a reboot, or a halt without power down.

 From the discussion about the PR mentionned above, it came that we should
 not spin down a drive on reboot or halt without -p, and an extra argument to
 the PM callbacks is needed. 

 -- 
 Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
      NetBSD: 26 ans d'experience feront toujours la difference
 --

From: Joerg Sonnenberger <joerg@britannica.bec.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/37508: After jmcneill-pm, disks are switched to standby
	before rebooting
Date: Sat, 15 Dec 2007 10:25:47 +0100

 On Mon, Dec 10, 2007 at 04:50:02PM +0000, Manuel Bouyer wrote:
 >  It may be OK for a power down (there is even a PR for this: kern/32766:
 >  some macppc systems rely on the system doing the wd_standby() before powering
 >  down, the firmware doesn't do it). But it's definitively not OK
 >  for a reboot, or a halt without power down.

 I would even reference the older PR kern/21531.

 >  From the discussion about the PR mentionned above, it came that we should
 >  not spin down a drive on reboot or halt without -p, and an extra argument to
 >  the PM callbacks is needed. 

 I would like to avoid having to carry an extra argument that is used
 only by a few drivers. What do you think of extending boothowto to
 actually have a RB_REBOOT flag and use that to decide if we are
 currently going to suspend the system/drive or reboot/halt? I have a
 patch for that.

 Joerg

From: Manuel Bouyer <bouyer@antioche.eu.org>
To: gnats-bugs@NetBSD.org
Cc: joerg@NetBSD.org, gnats-admin@NetBSD.org, netbsd-bugs@NetBSD.org,
	juan@xtrarom.org
Subject: Re: kern/37508: After jmcneill-pm, disks are switched to standby before rebooting
Date: Sat, 15 Dec 2007 11:42:55 +0100

 On Sat, Dec 15, 2007 at 10:40:02AM +0000, Joerg Sonnenberger wrote:
 >  >  From the discussion about the PR mentionned above, it came that we should
 >  >  not spin down a drive on reboot or halt without -p, and an extra argument to
 >  >  the PM callbacks is needed. 
 >  
 >  I would like to avoid having to carry an extra argument that is used
 >  only by a few drivers. What do you think of extending boothowto to
 >  actually have a RB_REBOOT flag and use that to decide if we are
 >  currently going to suspend the system/drive or reboot/halt? I have a
 >  patch for that.

 I'm not sure what you mean. Do you mean the drivers should consult the
 global variable boothowto ?

 -- 
 Manuel Bouyer <bouyer@antioche.eu.org>
      NetBSD: 26 ans d'experience feront toujours la difference
 --

From: Joerg Sonnenberger <joerg@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/37508 CVS commit: src/sys/dev/ata
Date: Tue, 18 Dec 2007 15:30:40 +0000 (UTC)

 Module Name:	src
 Committed By:	joerg
 Date:		Tue Dec 18 15:30:40 UTC 2007

 Modified Files:
 	src/sys/dev/ata: wd.c

 Log Message:
 Restore suspend handler. Put the disc into standby on suspend and for
 powerdown, but not for normal halt or reboot or panic. Fixes PR 37508.


 To generate a diff of this commit:
 cvs rdiff -r1.353 -r1.354 src/sys/dev/ata/wd.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: joerg@netbsd.org
State-Changed-When: Sat, 05 Jan 2008 05:16:40 +0000
State-Changed-Why:
Changed as discussed in the PR.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.