2006-02-19 18:59:11

by Ariel Garcia

[permalink] [raw]
Subject: 2.6.16-rc4 libata + AHCI patched for suspend fails on ICH6

Hi Jens,

regarding your suspend support patch for libata:

> author Jens Axboe <[email protected]>
> Fri, 6 Jan 2006 08:28:07 +0000 (09:28 +0100)
> commit 9b847548663ef1039dd49f0eb4463d001e596bc3

> [PATCH] Suspend support for libata
> This patch adds suspend patch to libata, and ata_piix in particular.
> For most low level drivers, they should just need to add the 4 hooks to
> work. As I can only test ata_piix, I didn't enable it for more though.

i tested the trivial "4-hooks" patch on kernel 2.6.16-rc4, on my laptop
(i915, ICH6 chipset, sata hd - a Fujitsu-Siemens 7020)
but it doesn't work as it should:
after resume the drive fails to respond to the commands so it
ends up remounted read-only.

I am attaching:
- the trivial patch i used
- the output of lsmod (lsmod-clean.txt)
- the output of lspci -vv before (lspci-clean.txt)
and after resuming (lspci-resume.txt)
- the output of dmesg (glueing the full boot + resuming messages)

All this was done running in single mode. I also tried suspending after
removing all unnecessary modules (usb, snd,ide,...), same result.

BTW, running a 'diff lspci-clean.txt lspci-resume.txt'
i also noticed that after resume some pci devices get a different
"BusMaster" polarity, but the SATA controller doesn't.

I would be glad to test patches/debug other things, feel free to ask.

(Please CC me if replying to the ml, i'm not subscribed)

Thanks a lot!!

Ariel Garcia


Attachments:
(No filename) (0.00 B)
(No filename) (189.00 B)
Download all attachments

2006-02-19 19:18:54

by Jens Axboe

[permalink] [raw]
Subject: Re: 2.6.16-rc4 libata + AHCI patched for suspend fails on ICH6

On Sun, Feb 19 2006, Ariel Garcia wrote:
> Hi Jens,
>
> regarding your suspend support patch for libata:
>
> > author Jens Axboe <[email protected]>
> > Fri, 6 Jan 2006 08:28:07 +0000 (09:28 +0100)
> > commit 9b847548663ef1039dd49f0eb4463d001e596bc3
>
> > [PATCH] Suspend support for libata
> > This patch adds suspend patch to libata, and ata_piix in particular.
> > For most low level drivers, they should just need to add the 4 hooks to
> > work. As I can only test ata_piix, I didn't enable it for more though.
>
> i tested the trivial "4-hooks" patch on kernel 2.6.16-rc4, on my laptop
> (i915, ICH6 chipset, sata hd - a Fujitsu-Siemens 7020)
> but it doesn't work as it should:
> after resume the drive fails to respond to the commands so it
> ends up remounted read-only.
>
> I am attaching:
> - the trivial patch i used
> - the output of lsmod (lsmod-clean.txt)
> - the output of lspci -vv before (lspci-clean.txt)
> and after resuming (lspci-resume.txt)
> - the output of dmesg (glueing the full boot + resuming messages)
>
> All this was done running in single mode. I also tried suspending after
> removing all unnecessary modules (usb, snd,ide,...), same result.
>
> BTW, running a 'diff lspci-clean.txt lspci-resume.txt'
> i also noticed that after resume some pci devices get a different
> "BusMaster" polarity, but the SATA controller doesn't.
>
> I would be glad to test patches/debug other things, feel free to ask.

The first thing to try is to add the acpi addon from Randy and see if
that helps at all. Looking at the log, the first command we issue after
resume times out which smells a lot like an unlock command missing
(which is typically in the GTF list from acpi).

So try this patch on 2.6.16-rc3 (or -rc4, if it applies, haven't
checked) and make sure to keep the ahci patch you have that adds the 4
needed hooks as well.

--
Jens Axboe

2006-02-21 17:04:57

by Randy Dunlap

[permalink] [raw]
Subject: Re: 2.6.16-rc4 libata + AHCI patched for suspend fails on ICH6

On Sun, 19 Feb 2006, Jens Axboe wrote:

> On Sun, Feb 19 2006, Ariel Garcia wrote:
> > Hi Jens,
> >
> > regarding your suspend support patch for libata:
> >
> > > author Jens Axboe <[email protected]>
> > > Fri, 6 Jan 2006 08:28:07 +0000 (09:28 +0100)
> > > commit 9b847548663ef1039dd49f0eb4463d001e596bc3
> >
> > > [PATCH] Suspend support for libata
> > > This patch adds suspend patch to libata, and ata_piix in particular.
> > > For most low level drivers, they should just need to add the 4 hooks to
> > > work. As I can only test ata_piix, I didn't enable it for more though.
> >
> > i tested the trivial "4-hooks" patch on kernel 2.6.16-rc4, on my laptop
> > (i915, ICH6 chipset, sata hd - a Fujitsu-Siemens 7020)
> > but it doesn't work as it should:
> > after resume the drive fails to respond to the commands so it
> > ends up remounted read-only.
> >
> > I am attaching:
> > - the trivial patch i used
> > - the output of lsmod (lsmod-clean.txt)
> > - the output of lspci -vv before (lspci-clean.txt)
> > and after resuming (lspci-resume.txt)
> > - the output of dmesg (glueing the full boot + resuming messages)
> >
> > All this was done running in single mode. I also tried suspending after
> > removing all unnecessary modules (usb, snd,ide,...), same result.
> >
> > BTW, running a 'diff lspci-clean.txt lspci-resume.txt'
> > i also noticed that after resume some pci devices get a different
> > "BusMaster" polarity, but the SATA controller doesn't.
> >
> > I would be glad to test patches/debug other things, feel free to ask.
>
> The first thing to try is to add the acpi addon from Randy and see if
> that helps at all. Looking at the log, the first command we issue after
> resume times out which smells a lot like an unlock command missing
> (which is typically in the GTF list from acpi).

Ariel-
These patches (for 2.6.16-rc3) are at
http://www.xenotime.net/linux/SATA/2.6.16-rc3/libata-rollup-2616-rc3.patch

in case you didn't find them yet.

> So try this patch on 2.6.16-rc3 (or -rc4, if it applies, haven't
> checked) and make sure to keep the ahci patch you have that adds the 4
> needed hooks as well.

--
~Randy

2006-02-21 22:50:57

by Ariel Garcia

[permalink] [raw]
Subject: Re: 2.6.16-rc4 libata + AHCI patched for suspend fails on ICH6

Hi Randy, Jens,

> > The first thing to try is to add the acpi addon from Randy and see if
> > that helps at all. Looking at the log, the first command we issue
> > after resume times out which smells a lot like an unlock command
> > missing (which is typically in the GTF list from acpi).
>
> Ariel-
> These patches (for 2.6.16-rc3) are at
>http://www.xenotime.net/linux/SATA/2.6.16-rc3/libata-rollup-2616-rc3.patch
> in case you didn't find them yet.

yes, thanks! i had found them, but i hadn't reported yet because it didn't
work (exactly the same output as w/o the patch) and i wanted to enable
your new debugging functionality to get some additional feedback.

So at least now (printk=255) i can see that there seems to be an error
_before_ the suspend, just when loading the GTFs (whatever they are ;-)

do_drive_get_GTF: ERR: ata_dev_present: 0, PORT_DISABLED: 0
ata_acpi_exec_tfs: get_GTF error (-19)
ata_acpi_exec_tfs: ret=-19

but no extra debugging output after the suspend/restart. Does that help?
dmesg output attached.

Thanks for your work!
Ariel


Attachments:
(No filename) (1.04 kB)
dmesg (19.07 kB)
Download all attachments

2006-02-21 23:07:33

by Randy Dunlap

[permalink] [raw]
Subject: Re: 2.6.16-rc4 libata + AHCI patched for suspend fails on ICH6

On Tue, 21 Feb 2006, Ariel Garcia wrote:

> Hi Randy, Jens,
>
> > > The first thing to try is to add the acpi addon from Randy and see if
> > > that helps at all. Looking at the log, the first command we issue
> > > after resume times out which smells a lot like an unlock command
> > > missing (which is typically in the GTF list from acpi).
> >
> > Ariel-
> > These patches (for 2.6.16-rc3) are at
> >http://www.xenotime.net/linux/SATA/2.6.16-rc3/libata-rollup-2616-rc3.patch
> > in case you didn't find them yet.
>
> yes, thanks! i had found them, but i hadn't reported yet because it didn't
> work (exactly the same output as w/o the patch) and i wanted to enable
> your new debugging functionality to get some additional feedback.
>
> So at least now (printk=255) i can see that there seems to be an error
> _before_ the suspend, just when loading the GTFs (whatever they are ;-)

The ACPI "_GTF" method "gets taskfiles" (=> GTF). Taskfiles
are one or more arrays of ATA-interface registers.

> do_drive_get_GTF: ERR: ata_dev_present: 0, PORT_DISABLED: 0
> ata_acpi_exec_tfs: get_GTF error (-19)
> ata_acpi_exec_tfs: ret=-19
>
> but no extra debugging output after the suspend/restart. Does that help?
> dmesg output attached.

The "error" is only for the second drive (ix=1, which you don't have,
right?). I guess I need to disable that message.

Please add this additional patch (attached) (credit: SUSE) and
let us know if it helps. Meanwhile I will check the resume
path to see if I notice anything that is missing.

--
~Randy


Attachments:
sata-acpi-fsc-debug.patch (2.14 kB)

2006-02-21 23:58:11

by Mark Lord

[permalink] [raw]
Subject: Re: 2.6.16-rc4 libata + AHCI patched for suspend fails on ICH6

Hi Randy,

Just to let you know that my Dell i9300 (still!) suspends/resumes (RAM, Disk)
perfectly 100% with your patches applied.

And fails regularly without them. 2.6.16-rc4.

Cheers

2006-02-22 00:05:06

by Randy Dunlap

[permalink] [raw]
Subject: Re: 2.6.16-rc4 libata + AHCI patched for suspend fails on ICH6

On Tue, 21 Feb 2006, Mark Lord wrote:

> Hi Randy,
>
> Just to let you know that my Dell i9300 (still!) suspends/resumes (RAM, Disk)
> perfectly 100% with your patches applied.
>
> And fails regularly without them. 2.6.16-rc4.
>
> Cheers

Thanks, good to have the continued feedback.
It is SATA, right? The latest patchset also includes PATA ACPI
objects support (using libata), but it is missing a few calls
to the functions that do the real work during resume.
Will patch that this week also.

--
~Randy

2006-02-22 00:12:19

by Mark Lord

[permalink] [raw]
Subject: Re: 2.6.16-rc4 libata + AHCI patched for suspend fails on ICH6

Randy.Dunlap wrote:
>
> Thanks, good to have the continued feedback.
> It is SATA, right? The latest patchset also includes PATA ACPI
> objects support (using libata), but it is missing a few calls
> to the functions that do the real work during resume.
> Will patch that this week also.

It's a PATA notebook drive, attached with some kind of hidden
bridge chip, to an Intel 82801FBM SATA ICH6M.

libata thinks it is pure SATA.

Cheers

2006-02-22 00:35:06

by Ariel Garcia

[permalink] [raw]
Subject: Re: 2.6.16-rc4 libata + AHCI patched for suspend fails on ICH6

Hi again Randy,

wow, thanks for your ultra fast-patch ;-)

> > do_drive_get_GTF: ERR: ata_dev_present: 0, PORT_DISABLED: 0
> > ata_acpi_exec_tfs: get_GTF error (-19)
> > ata_acpi_exec_tfs: ret=-19
> >
> > but no extra debugging output after the suspend/restart. Does that
> > help? dmesg output attached.
>
> The "error" is only for the second drive (ix=1, which you don't have,
> right?). I guess I need to disable that message.

oh, right, only one sata HD (pure SATA, not pata as far as i understand)

> Please add this additional patch (attached) (credit: SUSE) and
> let us know if it helps. Meanwhile I will check the resume
> path to see if I notice anything that is missing.

done, attached the dmesg. All your new debugging lines appear.
This time i didn't care of unloading all unneded modules (like ipw2200,
etc) and as you can notice there is a kind of funtion call backtrace
regarding an unhandled interrupt just after call ata_exec_internal, that
is interrupt 177 which is associated to vga+audio+usb+cardbus

This reminded me that once every 10 boots (approx, just to put a number),
my laptop fails to initialize the HD when booting, the drive is detected
but it doesn't respond and therefore the partition table cannot be read...
(i find only sda in /proc/partitions)
When this happens, the root fs cannot be mounted (obviously), but i land in
the initramfs: from there I can reproduce the error messages by removing
and reloading either the ahci or the ata_piix modules. I have to reboot
to get the drive working again.
I saved the dmesg output when reloading the ahci module, it is attached
(bootfail-log-ahci.txt)

Good night! Ariel


Attachments:
(No filename) (1.63 kB)
dmesg (22.76 kB)
lspci (6.88 kB)
bootfail-log-ahci.txt (5.52 kB)
Download all attachments

2006-02-22 00:40:45

by Nigel Cunningham

[permalink] [raw]
Subject: Re: 2.6.16-rc4 libata + AHCI patched for suspend fails on ICH6

Hi Randy et al.

On Wednesday 22 February 2006 03:04, Randy.Dunlap wrote:
> These patches (for 2.6.16-rc3) are at
> http://www.xenotime.net/linux/SATA/2.6.16-rc3/libata-rollup-2616-rc3.patch

Randy, do you mind if I start including this in the suspend2 patch? I'm
starting to see more and more people who could probably use this.

Regards,

Nigel


Attachments:
(No filename) (348.00 B)
(No filename) (189.00 B)
Download all attachments

2006-02-22 00:42:47

by Randy Dunlap

[permalink] [raw]
Subject: Re: 2.6.16-rc4 libata + AHCI patched for suspend fails on ICH6

On Wed, 22 Feb 2006, Nigel Cunningham wrote:

> Hi Randy et al.
>
> On Wednesday 22 February 2006 03:04, Randy.Dunlap wrote:
> > These patches (for 2.6.16-rc3) are at
> > http://www.xenotime.net/linux/SATA/2.6.16-rc3/libata-rollup-2616-rc3.patch
>
> Randy, do you mind if I start including this in the suspend2 patch? I'm
> starting to see more and more people who could probably use this.

I don't mind....

--
~Randy

2006-02-22 08:16:18

by Jens Axboe

[permalink] [raw]
Subject: Re: 2.6.16-rc4 libata + AHCI patched for suspend fails on ICH6

On Tue, Feb 21 2006, Mark Lord wrote:
> Randy.Dunlap wrote:
> >
> >Thanks, good to have the continued feedback.
> >It is SATA, right? The latest patchset also includes PATA ACPI
> >objects support (using libata), but it is missing a few calls
> >to the functions that do the real work during resume.
> >Will patch that this week also.
>
> It's a PATA notebook drive, attached with some kind of hidden
> bridge chip, to an Intel 82801FBM SATA ICH6M.
>
> libata thinks it is pure SATA.

Actually libata does know it's behind a bridge and limits it somewhat,
but beyond that it's pure SATA for all it cares about.

--
Jens Axboe