Bug 9804 - S3 resume: ACPI Error (dsopcode-0481): Attempt to CreateField of length zero - _GTF evaluation failed
Summary: S3 resume: ACPI Error (dsopcode-0481): Attempt to CreateField of length zero ...
Status: CLOSED PATCH_ALREADY_AVAILABLE
Alias: None
Product: ACPI
Classification: Unclassified
Component: Power-Sleep-Wake (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: ykzhao
URL:
Keywords:
: 9930 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-01-23 09:25 UTC by Bruce Duncan
Modified: 2008-06-13 22:06 UTC (History)
2 users (show)

See Also:
Kernel Version: 2.6.24-rc8
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
acpidump output (66.42 KB, text/plain)
2008-01-23 09:27 UTC, Bruce Duncan
Details
dmidecode output (11.85 KB, text/plain)
2008-01-23 09:27 UTC, Bruce Duncan
Details
try the debug patch (1.77 KB, patch)
2008-03-31 00:29 UTC, ykzhao
Details | Diff
dmesg-von-alexy (33.26 KB, text/plain)
2008-03-31 12:32 UTC, Oleksij Rempel (fishor)
Details

Description Bruce Duncan 2008-01-23 09:25:58 UTC
Hi all,

Sorry to lump this on you, Murphy's law says it's probably a libata thing but I don't know where it should go.

I'm running 2.6.24-rc8 and I've just switched to libata, even though I don't have any SATA disks, because sometimes my laptop hangs on resume (the hard drive LED stays on and each process is responsive until it causes a disk access) but I didn't have the stones to track down a bug like that. The hang never happens with libata (hooray!) but I got a lovely ACPI exception last night (0000:1f.0 is my ALI PATA controller):

Jan 23 00:06:52 moon kernel: Syncing filesystems ... done.
Jan 23 00:06:52 moon kernel: Freezing user space processes ... (elapsed 0.00 seconds) done.
Jan 23 00:06:52 moon kernel: Freezing remaining freezable tasks ... (elapsed 0.00 seconds) done.
Jan 23 00:06:52 moon kernel: Suspending console(s)
Jan 23 00:06:52 moon kernel: sd 0:0:0:0: [sda] Synchronizing SCSI cache
Jan 23 00:06:52 moon kernel: sd 0:0:0:0: [sda] Stopping disk
Jan 23 00:06:52 moon kernel: ACPI: PCI interrupt for device 0000:00:1f.0 disabled
Jan 23 00:06:52 moon kernel: Back to C!
<snip writing back config spaces for every other PCI device>
Jan 23 00:06:52 moon kernel: PM: Writing back config space on device 0000:00:1f.0 at offset 1 (was 2b00001, writing 2b00005)
Jan 23 00:06:52 moon kernel: ACPI: PCI Interrupt 0000:00:1f.0[A] -> GSI 21 (level, low) -> IRQ 21
Jan 23 00:06:52 moon kernel: ACPI Error (dsopcode-0481): Attempt to CreateField of length zero [20070126]
Jan 23 00:06:52 moon kernel: ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.PCI0.IDE0.RATA] (Node ffff81003781b360), AE_AML_OPERAND_VALUE
Jan 23 00:06:52 moon kernel: ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.PCI0.IDE0.CHN0.DRV1._GTF] (Node ffff81003781b060), AE_AML_OPERAND_VALUE
Jan 23 00:06:52 moon kernel: ata1.01: _GTF evaluation failed (AE 0x3006)
Jan 23 00:06:52 moon kernel: ACPI Error (dsopcode-0481): Attempt to CreateField of length zero [20070126]
Jan 23 00:06:52 moon kernel: ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.PCI0.IDE0.RATA] (Node ffff81003781b360), AE_AML_OPERAND_VALUE
Jan 23 00:06:52 moon kernel: ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.PCI0.IDE0.CHN1.DRV1._GTF] (Node ffff81003781b1a0), AE_AML_OPERAND_VALUE
Jan 23 00:06:52 moon kernel: ata2.01: _GTF evaluation failed (AE 0x3006)
Jan 23 00:06:52 moon kernel: i8042 aux 00:01: activation failed
Jan 23 00:06:52 moon kernel: i8042 kbd 00:02: activation failed
Jan 23 00:06:52 moon kernel: sd 0:0:0:0: [sda] Starting disk
Jan 23 00:06:52 moon kernel: ata1.00: ACPI cmd ef/03:45:00:00:00:a0 filtered out
Jan 23 00:06:52 moon kernel: ata1.00: ACPI cmd ef/03:01:00:00:00:a0 filtered out
Jan 23 00:06:52 moon kernel: ata1.00: ACPI cmd c6/00:10:00:00:00:a0 succeeded
Jan 23 00:06:52 moon kernel: ata1.00: configured for UDMA/100
Jan 23 00:06:52 moon kernel: ata1.00: configured for UDMA/100
Jan 23 00:06:52 moon kernel: ata1: EH complete
Jan 23 00:06:52 moon kernel: sd 0:0:0:0: [sda] 195371568 512-byte hardware sectors (100030 MB)
Jan 23 00:06:52 moon kernel: sd 0:0:0:0: [sda] Write Protect is off
Jan 23 00:06:52 moon kernel: sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
Jan 23 00:06:52 moon kernel: sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Jan 23 00:06:52 moon kernel: sd 0:0:0:0: [sda] 195371568 512-byte hardware sectors (100030 MB)
Jan 23 00:06:52 moon kernel: sd 0:0:0:0: [sda] Write Protect is off
Jan 23 00:06:52 moon kernel: sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
Jan 23 00:06:52 moon kernel: sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Jan 23 00:06:52 moon kernel: Restarting tasks ... done.
Jan 23 00:06:52 moon kernel: ata2.00: ACPI cmd ef/03:42:00:00:00:a0 filtered out
Jan 23 00:06:52 moon kernel: ata2.00: ACPI cmd ef/03:01:00:00:00:a0 filtered out
Jan 23 00:06:52 moon kernel: ata2.00: configured for UDMA/33

I tried a second suspend-to-ram but the exception didn't repeat. Next time I reboot I'll be on the lookout for the exception again. The drive works fine before and after suspend.

I'll attach an acpidump and dmidecode output.

Cheers,
Bruce
Comment 1 Bruce Duncan 2008-01-23 09:27:38 UTC
Created attachment 14545 [details]
acpidump output
Comment 2 Bruce Duncan 2008-01-23 09:27:59 UTC
Created attachment 14546 [details]
dmidecode output
Comment 3 ykzhao 2008-01-23 17:35:45 UTC
Will you please try the boot ption of "libata.noacpi=1" and see whether the above error disappears? 
Thanks.
Comment 4 Bruce Duncan 2008-01-25 07:06:51 UTC
Yes, it does! Thanks.
Bruce
Comment 5 ykzhao 2008-02-18 01:21:20 UTC
*** Bug 9930 has been marked as a duplicate of this bug. ***
Comment 6 Robert Moore 2008-03-26 15:11:34 UTC
This is the sequence to the failure, from the DSDT given above:

Name (ATA1, Buffer (0x1D) {})

Device (DRV1)
{
    Name (_ADR, One)
    Method (_GTF, 0, NotSerialized)
    {
        Return (RATA (ATA1))
    }
}
Method (RATA, 1, NotSerialized)
{
    CreateByteField (Arg0, Zero, CMDN)
    Multiply (CMDN, 0x38, Local0)
    CreateField (Arg0, 0x08, Local0, RETB)
    Store (RETB, Debug)
    Return (RETB)
}


It looks like the ATA1 buffer is being initialized to zero, or not being initialized at all.

The only place in the DSDT where ATA1 is initialized is here:

Method (_STM, 3, NotSerialized)
{
    Store (Arg0, TMD0)
    Store (PRW0, GMPT)
    Store (PRW1, GSPT)
    Store (UDTP, GMUT)
    Store (PAST, GAST)
    Store (PCBT, GCBT)
    STM ()
    Store (GMPT, PRW0)
    Store (GSPT, PRW1)
    Store (GMUT, UDTP)
    Store (GAST, PAST)
    Store (GCBT, PCBT)
    Store (GTF (Zero, Arg1), ATA0)
    Store (GTF (One, Arg2), ATA1)
}

The path to this method is \_SB_.PCI0.IDE0.CHN0._STM.

I suspect one of the following is the cause of the problem:

1) This _STM method is never being called by the host
2) An incorrect "drive 1 ATA block" is being passed to _STM by the host
3) The GTF control method is not returning a correctly initialized buffer

That's as much as I can glean from the DSDT.

Bob
Comment 7 ykzhao 2008-03-31 00:29:49 UTC
Created attachment 15525 [details]
try the debug patch

Hi, Bruce
    Will you please try the debug patch and see whether the problem still exists?
    Thanks.
Comment 8 ykzhao 2008-03-31 00:43:36 UTC
In current kernel the _GTF method will be called for every ata drive when the system is resumed from S3. But when _GTF method is called for the disabled ata drive, the following error message will appear.
>ACPI Error (dsopcode-0483): Attempt to CreateField of length zero [20070126]
>ACPI Error (psparse-0537): Method parse/execution failed
>[\_SB_.PCI0.IDE0.RATA] (Node df822a7c), AE_AML_OPERAND_VALUE
>ACPI Error (psparse-0537): Method parse/execution failed
>[\_SB_.PCI0.IDE0.CHN1.DRV0._GTF] (Node df822bd0), AE_AML_OPERAND_VALUE
>ata2.00: _GTF evaluation failed (AE 0x3006)

Maybe it is appropriate to call _GTF method only for the enabled ATA drive.
Comment 9 Oleksij Rempel (fishor) 2008-03-31 12:32:36 UTC
Created attachment 15541 [details]
dmesg-von-alexy

This patch working for me.
Comment 10 Len Brown 2008-06-13 22:06:15 UTC
shipped in 2.6.26-rc1 - closed.

commit 48feb3c419508487becfb9ea3afcc54c3eac6d80
Author: Shaohua Li <shaohua.li@intel.com>
Date:   Tue Mar 25 16:50:45 2008 +0800

    ata-acpi: don't call _GTF for disabled drive

Note You need to log in before you can comment on or make changes to this bug.