From nobody@FreeBSD.org  Tue Nov 30 21:21:01 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AD9FC1065670
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 30 Nov 2010 21:21:01 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (unknown [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 9CB678FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 30 Nov 2010 21:21:01 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id oAULL1Mf004581
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 30 Nov 2010 21:21:01 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id oAULL139004580;
	Tue, 30 Nov 2010 21:21:01 GMT
	(envelope-from nobody)
Message-Id: <201011302121.oAULL139004580@red.freebsd.org>
Date: Tue, 30 Nov 2010 21:21:01 GMT
From: Alessandro Gallo <llgxela@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Weird Hard Disk clicking noise on system shutdown
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         152720
>Category:       kern
>Synopsis:       Weird Hard Disk clicking noise on system shutdown
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    brucec
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 30 21:30:15 UTC 2010
>Closed-Date:    Tue Nov 30 23:25:16 UTC 2010
>Last-Modified:  Wed Dec  1 10:50:02 UTC 2010
>Originator:     Alessandro Gallo
>Release:        8.1-RELEASE
>Organization:
>Environment:
i386 architecture, generic kernel, default installation.
>Description:
The HDD of the system makes a weird clicking noise when powered off 
with shutdown or halt using ACPI. I experienced this problem on three 
different machines (two laptops and one desktop). It's like the Hard 
Disk heads are not parked before the power is cut off. Same problem 
on OpenBSD but not on NetBSD, where some parking is made. I fear this 
problem could potentially shorten the life of my HDDs. Thank you.
>How-To-Repeat:
Turn off the system via 'shutdown -hp now' or 'halt -p'
>Fix:
None as of now.

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: brucec 
State-Changed-When: Tue Nov 30 23:20:06 UTC 2010 
State-Changed-Why:  
The clicking sound is an Emegency Unload being done as the drive loses  
power. This is fixed in stable/7 and stable/8 by spinning the disks down  
during shutdown if the cam subsystem is being used (i.e. ATA_CAM or ahci(4)).  
It's unlikely that the ata(4) driver will get the same fix  
since it's being deprecated in favour of  
ATA_CAM and ahci(4), and it has issues with power management. 


Responsible-Changed-From-To: freebsd-bugs->brucec  
Responsible-Changed-By: brucec 
Responsible-Changed-When: Tue Nov 30 23:20:06 UTC 2010 
Responsible-Changed-Why:  
Track. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=152720 

From: Tijl Coosemans <tijl@coosemans.org>
To: bug-followup@freebsd.org
Cc: Alessandro Gallo <llgxela@gmail.com>
Subject: Re: kern/152720: Weird Hard Disk clicking noise on system shutdown
Date: Wed, 1 Dec 2010 11:44:09 +0100

 --Boundary-00=_7bi9M27GWkesO3p
 Content-Type: Text/Plain;
   charset="us-ascii"
 Content-Transfer-Encoding: 7bit
 
 You can try this patch. It won't be committed because it also spins
 down the disk on reboot. However, a spin down spin up cycle is not as
 bad as an emergency shutdown and if you shutdown your systems more often
 than you reboot them this patch will do more good than harm.
 
 --Boundary-00=_7bi9M27GWkesO3p
 Content-Type: text/plain;
   charset="us-ascii";
   name="patch-ata-standby"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
 	filename="patch-ata-standby"
 
 --- sys/dev/ata/ata-disk.c.orig	2010-05-15 20:08:16.000000000 +0200
 +++ sys/dev/ata/ata-disk.c	2010-05-15 20:09:09.000000000 +0200
 @@ -193,6 +193,8 @@
  
      if (atadev->param.support.command2 & ATA_SUPPORT_FLUSHCACHE)
  	ata_controlcmd(dev, ATA_FLUSHCACHE, 0, 0, 0);
 +    if (atadev->param.support.command1 & ATA_SUPPORT_POWERMGT)
 +	ata_controlcmd(dev, ATA_STANDBY_IMMEDIATE, 0, 0, 0);
      return 0;
  }
  
 
 --Boundary-00=_7bi9M27GWkesO3p--
>Unformatted:
