2009-04-25 09:26:48

by Bruno Prémont

[permalink] [raw]
Subject: Re: Stop disks on reboot for laptop which cuts power

On Sat, 25 April 2009 Ciprian Dorin Craciun wrote:
> On Apr 18, 7:30 pm, Bruno Prémont <[email protected]> wrote:
> > Hi,
> >
> > During shutdown (power off) the disks are stopped gracefully thus
> > the stopping is skipped for reboot case.
> >
> > On my Acer Travelmate 660 reboot is more like power-off as it cuts
> > all power during reboot which currently causes the disk to
> > emergency-park its head (noisy and shortens disk life).
> >
> > This patch series adds a DMI-based check to ide-gd and sd to still
> > stop the disks for affected laptop during reboot.
> >
> > Has been compile an run-tested with libata and just compile-tested
> > for ide.
> >
> > Bruno Prémont
>
> (I've tried to reply to the group by google-groups, but it didn't
> worked...)
>
> I have a Benq JoyBook S32 laptop that has the same behaviour...
> I've applied you patch, and just replaced the condition (dmi_...) with
> true, and now my laptop works OK while rebooting (it doesn't just cut
> power to the disks)...
>
> So I would say this is a very needed patch for the mainline
> kernel... Will it be included? Also how do I add my laptop to the
> table provided in your patch?
>
> Thanks,
> Ciprian Craciun.
>
Just a note, my patches do not change the BIOS behavior on reboot, thus
power is still being cut if it was so before applying the patches. But
it stops the disks first so those do not suffer from the power cut.

The variant for IDE-GD is on its way for inclusion, for the SD one I
don't know.

Below is a sample patch to add your system to the list, please check if
it works when applied on top of my 2 patches. If it doesn't you will
have to adjust the name of your laptop's manufacturer and it's product
name to correctly match your system. Please report if it works (or what
manufacturer/product name it works with) for you.
The right information can be extracted from dmidecode (System
Information block)


Tejun suggested eventually stopping the disks for all machines though
as far as I can see here my laptop is the only one affected out of a
dozen different boxes I have around. (eventually just doing it for
laptops might be reasonable as generalization)

Bruno

---

sd, ide-gd: stop disk on reboot for Benq JoyBook S32

Ciprian Craciun reported that Benq JoyBook S32 was affected by
the same power-cut on reboot as Acer TravelMate 660, so add it
to the list.

---
diff --git a/drivers/ide/ide-gd.c b/drivers/ide/ide-gd.c
index 4b6b71e..a78813d 100644
--- a/drivers/ide/ide-gd.c
+++ b/drivers/ide/ide-gd.c
@@ -109,6 +109,14 @@ static const struct dmi_system_id ide_coldreboot_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 660"),
},
},
+ {
+ /* Benq JoyBook S32 cuts power during reboot */
+ .ident = "Benq JoyBook S32",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Benq"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "JoyBook S32"),
+ },
+ },

{ } /* terminate list */
};
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index fdad8bc..68c828a 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2137,6 +2137,14 @@ static const struct dmi_system_id sd_coldreboot_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 660"),
},
},
+ {
+ /* Benq JoyBook S32 cuts power during reboot */
+ .ident = "Benq JoyBook S32",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Benq"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "JoyBook S32"),
+ },
+ },

{ } /* terminate list */
};