Spin down successful

Jon Schneider jon at axismilton.ltd.uk
Mon Nov 3 10:42:14 GMT 2003


--Message-Boundary-2606
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Mail message body

As I said this is somebody else's work (not sure who) but now matched to 
4.9 sources as what I first tried didn't patch without help.

It isn't quite right though as the disk seems to attempt to sleep during 
boot. Just now when I booted there was a kernel whinge, a few seconds 
delay then it recovered perfectly. This morning I'm seeing a couple of 
timeouts on ad1 then ata0 resets but these may be harmless. 
So I'm not fully confident about the whole thing but the machine in 
question contains nothing important and I value silence. Soon to put it 
into firewall duty in place of the sparc.

Other things to do include an entry in loader.conf, remounting with 
noatime, loosing /var/log/cron and of course using a lean seldom-logging 
kernel/setup generally.

Jon



--Message-Boundary-2606
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Text from file 'spin-down.patch'

*** dev/ata/ata-disk.c	Fri Sep  5 19:27:38 2003
--- dev/ata/ata-disk.c	Sun Nov  2 16:58:25 2003
***************
*** 90,98 ****
--- 90,100 ----
  static int ata_dma = 1;
  static int ata_wc = 1;
  static int ata_tags = 0; 
+ static int ata_suspend = 0;
  TUNABLE_INT("hw.ata.ata_dma", &ata_dma);
  TUNABLE_INT("hw.ata.wc", &ata_wc);
  TUNABLE_INT("hw.ata.tags", &ata_tags);
+ TUNABLE_INT("hw.ata.suspend", &ata_suspend);
  static MALLOC_DEFINE(M_AD, "AD driver", "ATA disk driver");
  
  /* sysctl vars */
***************
*** 103,108 ****
--- 105,112 ----
  	   "ATA disk write caching");
  SYSCTL_INT(_hw_ata, OID_AUTO, tags, CTLFLAG_RD, &ata_tags, 0,
  	   "ATA disk tagged queuing support");
+ SYSCTL_INT(_hw_ata, OID_AUTO, suspend, CTLFLAG_RD, &ata_suspend, 0,
+ 	   "ATA disk suspend timer");
  
  void
  ad_attach(struct ata_device *atadev, int alreadylocked)
***************
*** 197,202 ****
--- 201,214 ----
  		      DEVSTAT_TYPE_DIRECT | DEVSTAT_TYPE_IF_IDE,
  		      DEVSTAT_PRIORITY_DISK);
  
+ 	 if(ata_suspend > 0) {
+ 		 /* attempt suspend mode.  The drive uses increments of ten seconds */
+ 		 if(ata_command(atadev, 0xe2, 0, ata_suspend/10, 0, ATA_WAIT_INTR))
+ 			 ata_prtdev(atadev, "suspend mode failed.");
+ 	 }
+ 
+ 
+ 
      dev = disk_create(adp->lun, &adp->disk, 0, &ad_cdevsw, &addisk_cdevsw);
      dev->si_drv1 = adp;
      dev->si_iosize_max = 256 * DEV_BSIZE;
***************
*** 907,912 ****
--- 919,929 ----
  		    ata_umode(adp->device->param));
      else
  	ata_dmainit(atadev, ata_pmode(adp->device->param), -1, -1);
+ 	 if(ata_suspend > 0) {
+ 		 /* attempt suspend mode.  The drive uses increments of ten seconds */
+ 		 if(ata_command(atadev, 0xe2, 0, ata_suspend/10, 0, ATA_WAIT_READY))
+ 			 ata_prtdev(atadev, "suspend mode failed.");
+ 	 }
  }
  
  void

--Message-Boundary-2606--




More information about the Ukfreebsd mailing list