public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* RE: hard drive errors on acpi s3 resume
@ 2005-11-09  0:06 Moore, Robert
  0 siblings, 0 replies; 21+ messages in thread
From: Moore, Robert @ 2005-11-09  0:06 UTC (permalink / raw)
  To: Pavel Machek; +Cc: ACPI mailing list

Yep on all.
Bob

> +       acpi_handle handle, parent_handle;

I don't like multiple declarations in one statement.

Bob

> -----Original Message-----
> From: Pavel Machek [mailto:pavel-+ZI9xUNit7I@public.gmane.org]
> Sent: Tuesday, November 08, 2005 1:12 AM
> To: Moore, Robert
> Cc: ACPI mailing list
> Subject: Re: [ACPI] hard drive errors on acpi s3 resume
> 
> Hi!
> 
> Please don't top post.
> 
> > Just out of curiosity, what issues do you find with the coding
> > style?
> 
> I hope that means you want to clean it up and apply it ;-).
> 
> +#ifdef CONFIG_ACPI
> +#include <linux/acpi.h>
> +#define DBG(x...) printk(x)
> 
> Include in the middle of file? Renaming of printk to confuse reader?
> 
> +       int i, tmp;
> +       acpi_integer addr;
> ...
> +       addr = i;
> 
> ...oops, something is very wrong in acpi land.
> 
> +#define GTM_LEN (sizeof(u32) * 5)
> ...
> +       u32     gtm[GTM_LEN/sizeof(u32)]; /* info from _GTM */
> 
> Eh? Better names would be nice, too.
> 
> +       for (i = 0; i < MAX_DEVICES; i ++)
> 
> Please no space between i and ++.
> 
> +static struct acpi_ide_stat *ide_get_acpi_state(acpi_handle handle)
> 
> The function is strange, btw. Linear search, and it basically returns
> pointer to zeros. I'd expect zeroing to be in caller or something like
> that.
> 
> +int acpi_ide_suspend(struct device *dev)
> +{
> +       acpi_handle handle, parent_handle;
> +       struct acpi_ide_stat *stat;
> +       acpi_status     status;
> 
> At least alignment should be consistent locally.
> 
> +static int acpi_ide_gtf(acpi_handle handle, ide_drive_t *drive)
> +{
> +       struct acpi_buffer      output = {ACPI_ALLOCATE_BUFFER, NULL};
> +       ide_task_t      args;
> +       int index = 0;
> +       unsigned char *data;
> +       union acpi_object       *package = NULL;
> +       acpi_status status;
> 
> ...even more horible example of above.
> 
> +               /* submit command request */
> +//             printk("return value %d\n", ide_raw_taskfile(drive,
&args,
> NULL));
> +               index += 7;
> 
> Someone should learn to use delete key and version control...
> 
> +       if (stat->channel_handled == 0) {
> +               stat->handle = NULL;
> +               goto gtf;
> +       }
> +DBG("Start STM\n");
> +       if (acpi_ide_stm(stat))
> +               return -ENODEV;
> +       stat->channel_handled = 0;
> +gtf:
> +       return acpi_ide_gtf(handle, drive);
> +}
> 
> What about "else" instead of ugly goto. And that DBG should really go
> away.
> 
> -
> +#ifdef CONFIG_ACPI
> +       acpi_ide_suspend(dev);
> +#endif
> 
> -
> +#ifdef CONFIG_ACPI
> +       acpi_ide_resume(dev);
> +#endif
>         memset(&rq, 0, sizeof(rq));
>         memset(&rqpm, 0, sizeof(rqpm));
>         memset(&args, 0, sizeof(args));
> 
> We normally allways provide acpi_ide_resume, but make them nop in
> !ACPI case. That means #ifdefs are avoided in callers.
> 
> ...should be enough...
> 							Pavel
> --
> Thanks, Sharp!


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php

^ permalink raw reply	[flat|nested] 21+ messages in thread
* RE: hard drive errors on acpi s3 resume
@ 2005-11-08  9:27 Li, Shaohua
  2005-11-08  9:30 ` Pavel Machek
  2005-11-08 19:06 ` Matthew Garrett
  0 siblings, 2 replies; 21+ messages in thread
From: Li, Shaohua @ 2005-11-08  9:27 UTC (permalink / raw)
  To: Pavel Machek, Moore, Robert; +Cc: ACPI mailing list

Hi,
>
>Please don't top post.
>
>> Just out of curiosity, what issues do you find with the coding
>> style?
>
>I hope that means you want to clean it up and apply it ;-).
>
BTW, is this really worth submitting to upstream? It doesn't support
_GTF. And it appears useless in my test systems.

Thanks,
Shaohua


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php

^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: hard drive errors on acpi s3 resume
@ 2005-11-08  3:06 sdfa
       [not found] ` <20051108030627.93670109EB8-ch062KcR4Qzgx848pHWfrcMwje2lEl0q0E9HWUfgJXw@public.gmane.org>
  0 siblings, 1 reply; 21+ messages in thread
From: sdfa @ 2005-11-08  3:06 UTC (permalink / raw)
  To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f


wow, i didn't expect so many responses, thanks alot!



about the patch:

i'll try that patch and tell you guys how it goes.



about checking the dsdt:

i dont have much experience with dsdts, so i dont know how to check them, edit them, definitely wouldnt know what interesting behavior might constitute. but this guy here: http://linux.highsphere.net/howtos/b100b.php has almost the exact same laptop as i do(the only difference is screensize, i believe) and he didn't seem to have any problems with his dsdt, though he doesnt seem to have this hard drive issue(or isnt aware of it, he does mention it taking about 40 seconds to resume from s3).



about spinning the drive down before s3: 

when i do a hdparm -y /dev/hda, the drive immediately spins back up, probably due to some logger daemon. i've tried killing syslogd and klogd, but this still happens.



about it being an ide driver problem:

if it is an ide driver issue, can anybody point me in the right direction? maybe an ide driver mailing list or something? i'm believe i'm using the PIIX driver(i've got an ich4-m ide controller), but i havent been able to find a development website or anything for it. the help in menuconfig said that PIIX was for ich4 ide controllers, so i was hoping to find some intel-sponsored ich4-m driver development, but no luck.

_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php

^ permalink raw reply	[flat|nested] 21+ messages in thread
* RE: hard drive errors on acpi s3 resume
@ 2005-11-07  1:29 Li, Shaohua
  0 siblings, 0 replies; 21+ messages in thread
From: Li, Shaohua @ 2005-11-07  1:29 UTC (permalink / raw)
  To: Matthew Garrett, Alan Cox
  Cc: Pavel Machek, sdfa, acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f


Hi,
>-----Original Message-----
>From: acpi-devel-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org [mailto:acpi-devel-
>admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of Matthew Garrett
>Sent: Monday, November 07, 2005 9:23 AM
>To: Alan Cox
>Cc: Pavel Machek; sdfa; acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>Subject: Re: [ACPI] hard drive errors on acpi s3 resume
>
>On Sun, Nov 06, 2005 at 08:48:59PM +0000, Alan Cox wrote:
>> On Sul, 2005-11-06 at 17:27 +0100, Pavel Machek wrote:
>> > Also I'm afraid you'll have to ask this on ide lists; this is not
an
>> > ACPI but a driver problem.
>>
>> Its probably also an ACPI problem. ACPI provides disk suspend/resume
>> methods but nobody as hooked them to anything. Basically you
shouldn't
>> mix ACPI S3 and IDE disks in Linux until this is done.
>
>There's a patch that floated on here a while ago - we're shipping it in
>Ubuntu. Hang on...
>
>http://www.codon.org.uk/~mjg59/tmp/external-drivers-ide_sleep.dpatch is
>what we're shipping - it seems to work in most cases, but not all. It
>implements the _GTM and _STM methods, but doesn't do anything with _GTF
>since the IDE layer hasn't been resumed at the point where this code
>executes, so there's no existing mechanism to execute the taskfile
>commands returned. It may help in this case.
>
>(I've no idea why this hasn't been submitted upstream yet - it's not my
>patch...)
yes, this is the debug patch from me. As you said, it does nothing with
_GTF, so I didn't submit it.

Alan, is there any way we can execute the taskfile commands before the
IDE device resume?

Thanks,
Shaohua


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php

^ permalink raw reply	[flat|nested] 21+ messages in thread
* hard drive errors on acpi s3 resume
@ 2005-11-04  6:39 sdfa
       [not found] ` <20051104063946.BB9CA3DF4-ch062KcR4Qw632oaNHexgA1yzfppHFFyQQ4Iyu8u01E@public.gmane.org>
  0 siblings, 1 reply; 21+ messages in thread
From: sdfa @ 2005-11-04  6:39 UTC (permalink / raw)
  To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f


i've been trying to get s3 working on my sony vaio, but i'm having some problems concerning the hard drive during resume. after a resume i see these messages in dmesg:



hda: lost interrupt

 evevent-0299: *** Error: No installed handler for fixed event [00000002]

Restarting tasks... done

hda: dma_timer_expiry: dma status == 0x21

hda: DMA timeout error

hda: dma timeout error: status=0x50 { DriveReady SeekComplete }

ide: failed opcode was: unknown

hda: status error: status=0x50 { DriveReady SeekComplete }

ide: failed opcode was: unknown

hda: no DRQ after issuing MULTWRITE_EXT

hda: status error: status=0x50 { DriveReady SeekComplete }

ide: failed opcode was: unknown

hda: no DRQ after issuing MULTWRITE_EXT

hda: lost interrupt

hda: status error: status=0x50 { DriveReady SeekComplete }

ide: failed opcode was: unknown

hda: no DRQ after issuing MULTWRITE_EXT

hda: status error: status=0x50 { DriveReady SeekComplete }

ide: failed opcode was: unknown

hda: no DRQ after issuing MULTWRITE_EXT

ide0: reset: success



sometimes i also see this message right before all of this, i'm not sure if it's related:

acpi_bus_0200 [77] bus_set_power      : Device is not power manageable



the drive eventually spins up and the resume is a success, but it takes like two minutes(too long) and i'm afraid it may be damaging my hard drive.



the drive is an ide ata drive with an ich4-m controller.

_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2005-11-09  1:26 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <971FCB6690CD0E4898387DBF7552B90E0356BAE2@orsmsx403.amr.corp.intel.com>
     [not found] ` <971FCB6690CD0E4898387DBF7552B90E0356BAE2-sBd4vmA9Se5Qxe9IK+vIArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2005-11-08  9:11   ` hard drive errors on acpi s3 resume Pavel Machek
2005-11-09  0:06 Moore, Robert
  -- strict thread matches above, loose matches on Subject: below --
2005-11-08  9:27 Li, Shaohua
2005-11-08  9:30 ` Pavel Machek
     [not found]   ` <20051108093041.GI15730-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-11-09  0:57     ` Shaohua Li
2005-11-08 19:06 ` Matthew Garrett
     [not found]   ` <20051108190620.GA1316-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
2005-11-08 21:49     ` Pavel Machek
2005-11-09  0:52     ` Shaohua Li
     [not found]       ` <1131497528.2998.4.camel-ECwVeV2eNyQD0+JXs3kMbRL4W9x8LtSr@public.gmane.org>
2005-11-09  1:26         ` Alan Cox
2005-11-08  3:06 sdfa
     [not found] ` <20051108030627.93670109EB8-ch062KcR4Qzgx848pHWfrcMwje2lEl0q0E9HWUfgJXw@public.gmane.org>
2005-10-07  6:31   ` Pavel Machek
2005-11-08 12:29   ` Alan Cox
2005-11-07  1:29 Li, Shaohua
2005-11-04  6:39 sdfa
     [not found] ` <20051104063946.BB9CA3DF4-ch062KcR4Qw632oaNHexgA1yzfppHFFyQQ4Iyu8u01E@public.gmane.org>
2005-11-06 16:27   ` Pavel Machek
     [not found]     ` <20051106162739.GA28697-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2005-11-06 19:36       ` DJA
     [not found]         ` <436E5B50.3060600-+tLDYo+61VM+Va1GwOuvDg@public.gmane.org>
2005-10-07  6:29           ` Pavel Machek
2005-11-06 20:48       ` Alan Cox
     [not found]         ` <1131310139.1212.37.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2005-11-06 20:21           ` Pavel Machek
2005-11-07  1:22           ` Matthew Garrett
     [not found]             ` <20051107012229.GA19681-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
2005-11-07 23:34               ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox