ibook, hda power off sequence (for IBM travelstar)

3 messages, 3 authors, 2001-01-08 · open the first message on its own page

ibook, hda power off sequence (for IBM travelstar)

From: Conrad H Ziesler <hidden>
Date: 2001-01-06 22:28:22

The IBM travelstar hd in the ibook wants a sleep command sent before poweroff.
According to the IBM docs, this orderly shutdown extends the life of some
component stressed by the emergency power fail head lifting mechanism.
It also stops that loud click that happens on linux power off.


This bit of code replaces pmu_shutdown from via-pmu.c, its the easiest
hack to get the IDE code to issue a sleep command to the disk at shutdown
time.

--conrad


void __openfirmware
pmu_shutdown(void)
{
  struct adb_request req;
  int ret;

  ret = broadcast_sleep(PBOOK_SLEEP_REQUEST, PBOOK_SLEEP_REJECT);
  if (ret != PBOOK_SLEEP_OK)
    printk("pmu: shutdown sleep rejected\n");
  fsync_dev(0);
  ret = broadcast_sleep(PBOOK_SLEEP_NOW, PBOOK_WAKE);
  if (ret != PBOOK_SLEEP_OK)
    printk("pmu: shutdown sleep failed\n");

  _disable_interrupts();

  pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, PMU_INT_ADB |
	      PMU_INT_TICK );
  while(!req.complete)
    pmu_poll();

  pmu_request(&req, NULL, 5, PMU_SHUTDOWN,
	      'M', 'A', 'T', 'T');
  while(!req.complete || (pmu_state != idle))
    pmu_poll();
  for (;;)
    ;
}


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

Re: ibook, hda power off sequence (for IBM travelstar)

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2001-01-08 11:26:25

This bit of code replaces pmu_shutdown from via-pmu.c, its the easiest
hack to get the IDE code to issue a sleep command to the disk at shutdown
time.
Broadcasting fake sleep requests is definitely not the correct way to
acheive what you want. Either add direct call to some ide-pmac sleep
function in the arch shutdown function, or use the shutdown notifiers in
ide-pmac to force a disk shutdown.

I'll have a look at it when I'm really back.

Ben.


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

Re: ibook, hda power off sequence (for IBM travelstar)

From: Andreas Tobler <hidden>
Date: 2001-01-08 14:32:29

Hi all,


Benjamin Herrenschmidt wrote:
quoted
This bit of code replaces pmu_shutdown from via-pmu.c, its the easiest
hack to get the IDE code to issue a sleep command to the disk at shutdown
time.
Broadcasting fake sleep requests is definitely not the correct way to
acheive what you want. Either add direct call to some ide-pmac sleep
function in the arch shutdown function, or use the shutdown notifiers in
ide-pmac to force a disk shutdown.

I'll have a look at it when I'm really back.
I'm also interested in this fix since I got my travelstar DJSA-220
finally to work on a WALLSTREET! I remarked the same noisy click and
since the troubles I had with a dead toshiba I pay very much attention
to strange noises.

For those who have a wallstreet and a travelstar, here the link which
made my combination work.

http://www.xlr8yourmac.com/PB_G3/wallstreet_hard_drive/

I first thought I really have to buy a new Powerbook.

Only a notice, it may help some one.....

Cheers

Andreas

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help