Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Odd hardware - PCI Device not showing up in lspci or scanpci
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
roarinelk
Guru
Guru


Joined: 04 Mar 2004
Posts: 444

PostPosted: Fri Oct 01, 2010 7:00 pm    Post subject: Reply with quote

this should do it:

Code:

diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index d712675..d06135f 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -623,6 +623,7 @@ static const struct ich_laptop ich_laptop[] = {
        { 0x266F, 0x1025, 0x0066 },     /* ICH6 on ACER Aspire 1694WLMi */
        { 0x2653, 0x1043, 0x82D8 },     /* ICH6M on Asus Eee 701 */
        { 0x27df, 0x104d, 0x900e },     /* ICH7 on Sony TZ-90 */
+       { 0x27df, 0x8086, 0x27df },     /* RottenMutt's NAS */
        /* end marker */
        { 0, }
 };
Back to top
View user's profile Send private message
RottenMutt
n00b
n00b


Joined: 30 Sep 2010
Posts: 15
Location: fort worth

PostPosted: Fri Oct 01, 2010 7:19 pm    Post subject: Reply with quote

roarinelk wrote:
Quote:

ata5.00: limited to UDMA/33 due to 40-wire cable
ata5.00: configured for UDMA/33


Either you have a bad cable or cable detection is broken; probably the
latter.


I'm using a laptop drive converter on the end of a regular 80 pin cable. should i try cutting down the cable to the secondary position to make it shorter?

i guess the code checks for timming for the signal to bounce back.

edit: i cut down the cable and that did work. guess I'm compiling again, it should be a lot faster now in udma33 mode. need a little help with the sub-device stuff.


Last edited by RottenMutt on Fri Oct 01, 2010 7:40 pm; edited 1 time in total
Back to top
View user's profile Send private message
roarinelk
Guru
Guru


Joined: 04 Mar 2004
Posts: 444

PostPosted: Fri Oct 01, 2010 7:26 pm    Post subject: Reply with quote

RottenMutt wrote:
roarinelk wrote:
Quote:

ata5.00: limited to UDMA/33 due to 40-wire cable
ata5.00: configured for UDMA/33


Either you have a bad cable or cable detection is broken; probably the
latter.


i'm useing a laptop drive converter on the end of a regular 80 pin cable. should i try cutting down the cable to the secondary position to make it shorter?

i guess the code checks for timming for the signal to bounce back.


No, don't damage the cable. Try the patch first: stress the disk a bit and
watch for kernel errors. If the ata link produces lots of CRC errors then back it
out again (or get a 80-wire cable with the small 44pin (2.5") connector on one end).
Back to top
View user's profile Send private message
krinn
Advocate
Advocate


Joined: 02 May 2003
Posts: 4402

PostPosted: Fri Oct 01, 2010 8:00 pm    Post subject: Reply with quote

roarinelk: sorry if you answer that already, but did you upstream that to gentoo kernel herd? And maybe even to kernel.org (as rottenmutt proof every distro might love to get that patch)
Back to top
View user's profile Send private message
RottenMutt
n00b
n00b


Joined: 30 Sep 2010
Posts: 15
Location: fort worth

PostPosted: Fri Oct 01, 2010 8:05 pm    Post subject: Reply with quote

roarinelk wrote:
this should do it:

Code:

diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index d712675..d06135f 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -623,6 +623,7 @@ static const struct ich_laptop ich_laptop[] = {
        { 0x266F, 0x1025, 0x0066 },     /* ICH6 on ACER Aspire 1694WLMi */
        { 0x2653, 0x1043, 0x82D8 },     /* ICH6M on Asus Eee 701 */
        { 0x27df, 0x104d, 0x900e },     /* ICH7 on Sony TZ-90 */
+       { 0x27df, 0x8086, 0x27df },     /* RottenMutt's NAS */
        /* end marker */
        { 0, }
 };


so just add a line is all, 27df twice?
Back to top
View user's profile Send private message
roarinelk
Guru
Guru


Joined: 04 Mar 2004
Posts: 444

PostPosted: Fri Oct 01, 2010 8:11 pm    Post subject: Reply with quote

krinn wrote:
roarinelk: sorry if you answer that already, but did you upstream that to gentoo kernel herd? And maybe even to kernel.org (as rottenmutt proof every distro might love to get that patch)


No I don't intend to, and they shouldn't. As is they're just hacks which
happen to work on these NAS boxes, but may cause harm on other systems.
Back to top
View user's profile Send private message
roarinelk
Guru
Guru


Joined: 04 Mar 2004
Posts: 444

PostPosted: Fri Oct 01, 2010 8:12 pm    Post subject: Reply with quote

RottenMutt wrote:
roarinelk wrote:
this should do it:

Code:

diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index d712675..d06135f 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -623,6 +623,7 @@ static const struct ich_laptop ich_laptop[] = {
        { 0x266F, 0x1025, 0x0066 },     /* ICH6 on ACER Aspire 1694WLMi */
        { 0x2653, 0x1043, 0x82D8 },     /* ICH6M on Asus Eee 701 */
        { 0x27df, 0x104d, 0x900e },     /* ICH7 on Sony TZ-90 */
+       { 0x27df, 0x8086, 0x27df },     /* RottenMutt's NAS */
        /* end marker */
        { 0, }
 };


so just add a line is all, 27df twice?


aye, the code in question checks for the PCI device id, and subdevice/subvendor.
The line in the patch is according to your lspci info.
Back to top
View user's profile Send private message
RottenMutt
n00b
n00b


Joined: 30 Sep 2010
Posts: 15
Location: fort worth

PostPosted: Fri Oct 01, 2010 8:36 pm    Post subject: Reply with quote

roarinelk wrote:


No, don't damage the cable. Try the patch first: stress the disk a bit and
watch for kernel errors. If the ata link produces lots of CRC errors then back it
out again (or get a 80-wire cable with the small 44pin (2.5") connector on one end).


haa, already did. How do i check for crc errors?
Back to top
View user's profile Send private message
RottenMutt
n00b
n00b


Joined: 30 Sep 2010
Posts: 15
Location: fort worth

PostPosted: Sat Oct 02, 2010 2:59 am    Post subject: Reply with quote

roarinelk wrote:
this should do it:

Code:

diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index d712675..d06135f 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -623,6 +623,7 @@ static const struct ich_laptop ich_laptop[] = {
        { 0x266F, 0x1025, 0x0066 },     /* ICH6 on ACER Aspire 1694WLMi */
        { 0x2653, 0x1043, 0x82D8 },     /* ICH6M on Asus Eee 701 */
        { 0x27df, 0x104d, 0x900e },     /* ICH7 on Sony TZ-90 */
+       { 0x27df, 0x8086, 0x27df },     /* RottenMutt's NAS */
        /* end marker */
        { 0, }
 };


wouldn't boot, couldn't find the drive.
Back to top
View user's profile Send private message
roarinelk
Guru
Guru


Joined: 04 Mar 2004
Posts: 444

PostPosted: Sat Oct 02, 2010 5:00 am    Post subject: Reply with quote

RottenMutt wrote:
roarinelk wrote:
this should do it:

Code:

diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index d712675..d06135f 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -623,6 +623,7 @@ static const struct ich_laptop ich_laptop[] = {
        { 0x266F, 0x1025, 0x0066 },     /* ICH6 on ACER Aspire 1694WLMi */
        { 0x2653, 0x1043, 0x82D8 },     /* ICH6M on Asus Eee 701 */
        { 0x27df, 0x104d, 0x900e },     /* ICH7 on Sony TZ-90 */
+       { 0x27df, 0x8086, 0x27df },     /* RottenMutt's NAS */
        /* end marker */
        { 0, }
 };


wouldn't boot, couldn't find the drive.


At least cable detection works. UDMA33 is all you'll get with your current cable setup.
Back to top
View user's profile Send private message
RottenMutt
n00b
n00b


Joined: 30 Sep 2010
Posts: 15
Location: fort worth

PostPosted: Sat Oct 02, 2010 7:56 pm    Post subject: Reply with quote

Bios reports UDMA-5
i can put the drive, cable and adapter in another system and it will boot up UDMA-5

i believe this is driver related.
Back to top
View user's profile Send private message
roarinelk
Guru
Guru


Joined: 04 Mar 2004
Posts: 444

PostPosted: Sat Oct 02, 2010 8:05 pm    Post subject: Reply with quote

RottenMutt wrote:
Bios reports UDMA-5
i can put the drive, cable and adapter in another system and it will boot up UDMA-5

i believe this is driver related.


Still, there's a reason the kernel limits to UDMA33, usually to get a stable link.
Back to top
View user's profile Send private message
RottenMutt
n00b
n00b


Joined: 30 Sep 2010
Posts: 15
Location: fort worth

PostPosted: Sun Oct 03, 2010 11:33 am    Post subject: Reply with quote

it worked, i was just dumb and didn't put the both patchs in the "ApplyPatch" section. i figured that out after i researched and came to the conclusion you where correct with device id, sub system vendor id, and sub system device id. http://en.wikipedia.org/wiki/PCI_configuration_space

Code:
[eric@ss4200 ~]$ dmesg | grep ata5
ata5: PATA max UDMA/100 cmd 0x1f0 ctl 0x3f6 bmdma 0xffa0 irq 14
ata5.00: ATA-8: WDC WD1600BEVE-00A0HT0, 11.01A11, max UDMA/100
ata5.00: 312581808 sectors, multi 16: LBA48
ata5.00: configured for UDMA/100


i'm getting write speeds around 54MB/s.
Back to top
View user's profile Send private message
RottenMutt
n00b
n00b


Joined: 30 Sep 2010
Posts: 15
Location: fort worth

PostPosted: Sun Oct 03, 2010 5:25 pm    Post subject: Reply with quote

here is the fedora 13 version of roarinelk's cable patch.

Code:
diff -uNrp kernel-2.6.34.fc13.orig/drivers/ata/ata_piix.c kernel-2.6.34.fc13.new/drivers/ata/ata_piix.c
--- kernel-2.6.34.fc13.orig/drivers/ata/ata_piix.c    2010-10-01 22:45:51.903535382 -0500
+++ kernel-2.6.34.fc13.new/drivers/ata/ata_piix.c    2010-10-01 22:52:37.199660503 -0500
@@ -619,6 +619,7 @@ static const struct ich_laptop ich_lapto
     { 0x266F, 0x1025, 0x0066 },    /* ICH6 on ACER Aspire 1694WLMi */
     { 0x2653, 0x1043, 0x82D8 },    /* ICH6M on Asus Eee 701 */
     { 0x27df, 0x104d, 0x900e },    /* ICH7 on Sony TZ-90 */
+    { 0x27DF, 0x8086, 0x27df },    /* ICH7 on Intel SS4200 */
     /* end marker */
     { 0, }
 };


i've been using this guide to spin custom kernels on fedora: http://fedoraproject.org/wiki/Docs/CustomKernel#Prepare_Build_Files

let me throw in the ICH7 patch for your one stop shopping experience.

Code:
diff -uNrp kernel-2.6.34.fc13.orig/drivers/pci/quirks.c kernel-2.6.34.fc13.new/drivers/pci/quirks.c
--- kernel-2.6.34.fc13.orig/drivers/pci/quirks.c    2010-10-01 01:19:07.915256467 -0500
+++ kernel-2.6.34.fc13.new/drivers/pci/quirks.c    2010-10-01 06:21:02.560376000 -0500
@@ -2833,3 +2833,53 @@ int pci_dev_specific_reset(struct pci_de
 
     return -ENOTTY;
 }
+
+
+/* XXX: hack to enable the PATA device on ICH7 */
+static void __iomem *xybrd_rcba_base;
+static void xybrd_hides_ide_lpc_ich7_suspend(struct pci_dev *dev)
+{
+   u32 rcba;
+
+   if (xybrd_rcba_base) {
+      printk(KERN_ALERT "WARNING: more than one ICH7 PATA!\n");
+      return;
+   }
+
+   pci_read_config_dword(dev, 0xF0, &rcba);
+   /* use bits 31:14, 16 kB aligned */
+   xybrd_rcba_base = ioremap_nocache(rcba & 0xFFFFC000, 0x4000);
+   if (xybrd_rcba_base == NULL)
+      return;
+}
+
+static void xybrd_hides_ide_lpc_ich7_resume_early(struct pci_dev *dev)
+{
+   u32 val;
+
+   if (!xybrd_rcba_base)
+      return;
+   /* read the Function Disable register, dword mode only */
+   val = readl(xybrd_rcba_base + 0x3418);
+   writel(val & 0xFFFFFFFD, xybrd_rcba_base + 0x3418); /* enable the PATA device */
+}
+
+static void xybrd_hides_ide_lpc_ich7_resume(struct pci_dev *dev)
+{
+   if (!xybrd_rcba_base)
+      return;
+   iounmap(xybrd_rcba_base);
+   xybrd_rcba_base = NULL;
+   dev_info(&dev->dev, "Enabled ICH7 IDE device\n");
+}
+
+static void xybrd_hides_ide_lpc_ich7(struct pci_dev *dev)
+{
+   xybrd_hides_ide_lpc_ich7_suspend(dev);
+   xybrd_hides_ide_lpc_ich7_resume_early(dev);
+   xybrd_hides_ide_lpc_ich7_resume(dev);
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_ICH7_0,   xybrd_hides_ide_lpc_ich7);
+DECLARE_PCI_FIXUP_SUSPEND(PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_ICH7_0,   xybrd_hides_ide_lpc_ich7_suspend);
+DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_ICH7_0,   xybrd_hides_ide_lpc_ich7_resume);
+DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_ICH7_0,   xybrd_hides_ide_lpc_ich7_resume_early);


lets recap, it works, 64 bit linux (fedora 13), on intel ss4200, detects PATA drive in UDMA/100 mode and four SATA drives; plus boots from the PATA drive. I'm running C2D E4600 with 1GB ram. Installed tigerVNC and am connecting to the box thru a secure socket (ssh) into the loop back interface; provides encription of VNC session (not that i really need it). tigerVNC makes it easier in some respect for a noob, i get to use the gui config utilities.

thanks again roarinelk for your help:)


Last edited by RottenMutt on Sat Oct 09, 2010 12:25 am; edited 2 times in total
Back to top
View user's profile Send private message
roarinelk
Guru
Guru


Joined: 04 Mar 2004
Posts: 444

PostPosted: Sun Oct 03, 2010 5:50 pm    Post subject: Reply with quote

RottenMutt wrote:
here is the fedora 13 version of roarinelk's cable patch.

Code:
diff -uNrp kernel-2.6.34.fc13.orig/drivers/ata/ata_piix.c kernel-2.6.34.fc13.new/drivers/ata/ata_piix.c
--- kernel-2.6.34.fc13.orig/drivers/ata/ata_piix.c    2010-10-01 22:45:51.903535382 -0500
+++ kernel-2.6.34.fc13.new/drivers/ata/ata_piix.c    2010-10-01 22:52:37.199660503 -0500
@@ -619,6 +619,7 @@ static const struct ich_laptop ich_lapto
     { 0x266F, 0x1025, 0x0066 },    /* ICH6 on ACER Aspire 1694WLMi */
     { 0x2653, 0x1043, 0x82D8 },    /* ICH6M on Asus Eee 701 */
     { 0x27df, 0x104d, 0x900e },    /* ICH7 on Sony TZ-90 */
+    { 0x27DF, 0x8086, 0x27df },    /* ICH7 on Intel SS4200 */
     /* end marker */
     { 0, }
 };




Technically it's just generic ICH7 (limited to all ICH7s where the bios doesn't bother to
change the default subvendor/device ids), but that's just me nitpicking :-)

Quote:

thanks again roarinelk for your help:)


my pleasure.
Back to top
View user's profile Send private message
omega13333
n00b
n00b


Joined: 23 Oct 2010
Posts: 5

PostPosted: Sat Oct 23, 2010 2:00 pm    Post subject: Reply with quote

I've patched my kernel on my SS4200 with the given patch and the IDE-Device just shows up fine. But another problem I found is that the patch still doesn't work with Suspend-To-RAM.

I boot my kernel with the options
Code:
acpi_sleep=s3_bios test_suspend=mem

which is necessary to use standby on the SS4200 and if I do so the IDE-Device still shows up under lspci but my IDE devices are not detected anymore. dmesg shows
Code:
ata_piix 0000:00:1f.1: PCI INT A disabled
ata_piix 0000:00:1f.1: version 2.13
ata_piix 0000:00:1f.1: PCI INT A -> Link[LNKC] -> GSI 11 (level, low) -> IRQ 11
ata_piix 0000:00:1f.1: setting latency timer to 64
scsi9 : ata_piix
scsi10 : ata_piix
ata9: PATA max UDMA/100 cmd 0x1f0 ctl 0x3f6 bmdma 0xffa0 irq 14
ata9: port disabled. ignoring.
ata10: PATA max UDMA/100 cmd 0x170 ctl 0x376 bmdma 0xffa8 irq 15
ata10: port disabled. ignoring.


If I boot the kernel without the options my IDE-devices show up and everything is fine, but I loose standby functionality
Back to top
View user's profile Send private message
roarinelk
Guru
Guru


Joined: 04 Mar 2004
Posts: 444

PostPosted: Sat Oct 23, 2010 5:18 pm    Post subject: Reply with quote

Add a printk(KERN_ALERT "<some text>\n") at the start of each function in the patch and post the complete dmesg after a suspend/resume cycle.
Back to top
View user's profile Send private message
omega13333
n00b
n00b


Joined: 23 Oct 2010
Posts: 5

PostPosted: Sun Oct 24, 2010 9:52 am    Post subject: Reply with quote

I added printk(KERN_ALERT "<function name>\n") to the patch functions and got the following output from dmesg. The lines from printk are "ich7_suspend", "ich7_resume_early", ...

Code:
[  196.941814] nfsd: last server has exited, flushing export cache
[  202.615253] PM: Syncing filesystems ... done.
[  202.742609] PM: Preparing system for mem sleep
[  202.744662] Freezing user space processes ... (elapsed 0.01 seconds) done.
[  202.766666] Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
[  202.786652] PM: Entering mem sleep
[  202.786670] Suspending console(s) (use no_console_suspend to debug)
[  202.793535] sd 3:0:0:0: [sdc] Synchronizing SCSI cache
[  202.793571] sd 1:0:0:0: [sdb] Synchronizing SCSI cache
[  202.793726] sd 1:0:0:0: [sdb] Stopping disk
[  202.793736] sd 3:0:0:0: [sdc] Stopping disk
[  202.793993] serial 00:06: disabled
[  202.794085] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[  202.794285] sata_sil24 0000:02:00.0: PCI INT A disabled
[  202.794297] sd 0:0:0:0: [sda] Stopping disk
[  202.794442] ata_piix 0000:00:1f.1: PCI INT A disabled
[  202.794453] ich7_suspend
[  202.794527] uhci_hcd 0000:00:1d.3: PCI INT D disabled
[  202.794536] uhci_hcd 0000:00:1d.2: PCI INT C disabled
[  202.794544] uhci_hcd 0000:00:1d.1: PCI INT B disabled
[  202.794552] uhci_hcd 0000:00:1d.0: PCI INT A disabled
[  202.822454] e1000e: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX
[  202.836044] ehci_hcd 0000:00:1d.7: PCI INT A disabled
[  202.884337] e1000e 0000:01:00.0: PCI INT A disabled
[  202.884347] e1000e 0000:01:00.0: PME# enabled
[  202.884362] pcieport 0000:00:1c.0: wake-up capability enabled by ACPI
[  203.736038] PM: suspend of devices complete after 942.995 msecs
[  203.736044] PM: suspend devices took 0.944 seconds
[  203.752214] PM: late suspend of devices complete after 16.163 msecs
[  203.752314] ACPI: Preparing to enter system sleep state S3
[  203.752773] PM: Saving platform NVS memory
[  203.752803] Extended CMOS year: 2000
[  203.752803] Back to C!
[  203.752803] PM: Restoring platform NVS memory
[  203.752803] Extended CMOS year: 2000
[  203.752803] ACPI: Waking up from system sleep state S3
[  203.752803] pci 0000:00:02.0: restoring config space at offset 0x7 (was 0xffa00000, writing 0xffa40000)
[  203.752803] pcieport 0000:00:1c.0: restoring config space at offset 0xf (was 0x20100, writing 0x2010a)
[  203.752803] pcieport 0000:00:1c.0: restoring config space at offset 0x9 (was 0x1fff1, writing 0x20112001)
[  203.752803] pcieport 0000:00:1c.0: restoring config space at offset 0x3 (was 0x810000, writing 0x810008)
[  203.752803] pcieport 0000:00:1c.0: restoring config space at offset 0x1 (was 0x100107, writing 0x100507)
[  203.752803] pcieport 0000:00:1c.2: restoring config space at offset 0xf (was 0x20300, writing 0x2030b)
[  203.752803] pcieport 0000:00:1c.2: restoring config space at offset 0x9 (was 0x1fff1, writing 0x20312021)
[  203.752803] pcieport 0000:00:1c.2: restoring config space at offset 0x3 (was 0x810000, writing 0x810008)
[  203.752803] pcieport 0000:00:1c.2: restoring config space at offset 0x1 (was 0x100107, writing 0x100507)
[  203.752803] uhci_hcd 0000:00:1d.0: restoring config space at offset 0x1 (was 0x2800005, writing 0x2800001)
[  203.752803] uhci_hcd 0000:00:1d.1: restoring config space at offset 0x1 (was 0x2800005, writing 0x2800001)
[  203.752803] uhci_hcd 0000:00:1d.2: restoring config space at offset 0x1 (was 0x2800005, writing 0x2800001)
[  203.752803] uhci_hcd 0000:00:1d.3: restoring config space at offset 0x1 (was 0x2800005, writing 0x2800001)
[  203.752803] ehci_hcd 0000:00:1d.7: restoring config space at offset 0x1 (was 0x2900006, writing 0x2900002)
[  203.752803] pci 0000:00:1e.0: restoring config space at offset 0xf (was 0x20000, writing 0x200ff)
[  203.752803] ich7_resume_early
[  203.752803] ata_piix 0000:00:1f.1: restoring config space at offset 0xb (was 0x0, writing 0x27df8086)
[  203.752803] ata_piix 0000:00:1f.1: restoring config space at offset 0x8 (was 0x1, writing 0xffa1)
[  203.752803] ata_piix 0000:00:1f.1: restoring config space at offset 0x7 (was 0x1, writing 0x8f9)
[  203.752803] ata_piix 0000:00:1f.1: restoring config space at offset 0x6 (was 0x1, writing 0x8f1)
[  203.752803] ata_piix 0000:00:1f.1: restoring config space at offset 0x1 (was 0x2800000, writing 0x2800005)
[  203.752803] ahci 0000:00:1f.2: restoring config space at offset 0x1 (was 0x2b00007, writing 0x2b00407)
[  203.752803] e1000e 0000:01:00.0: restoring config space at offset 0xf (was 0x100, writing 0x10a)
[  203.752803] e1000e 0000:01:00.0: restoring config space at offset 0x6 (was 0x1, writing 0xbc01)
[  203.752803] e1000e 0000:01:00.0: restoring config space at offset 0x4 (was 0x0, writing 0xff6e0000)
[  203.752803] e1000e 0000:01:00.0: restoring config space at offset 0x1 (was 0x100000, writing 0x100007)
[  203.752803] sata_sil24 0000:02:00.0: restoring config space at offset 0xf (was 0x100, writing 0x10b)
[  203.752803] sata_sil24 0000:02:00.0: restoring config space at offset 0xc (was 0x0, writing 0xff800000)
[  203.752803] sata_sil24 0000:02:00.0: restoring config space at offset 0x8 (was 0x1, writing 0xcc01)
[  203.752803] sata_sil24 0000:02:00.0: restoring config space at offset 0x6 (was 0x4, writing 0xff8f8004)
[  203.752803] sata_sil24 0000:02:00.0: restoring config space at offset 0x4 (was 0x4, writing 0xff8ffc04)
[  203.752803] sata_sil24 0000:02:00.0: restoring config space at offset 0x3 (was 0x0, writing 0x8)
[  203.752803] sata_sil24 0000:02:00.0: restoring config space at offset 0x1 (was 0x100000, writing 0x100007)
[  203.752803] PM: early resume of devices complete after 0.702 msecs
[  203.752803] uhci_hcd 0000:00:1d.0: PCI INT A -> Link[LNKH] -> GSI 5 (level, low) -> IRQ 5
[  203.752803] uhci_hcd 0000:00:1d.0: setting latency timer to 64
[  203.752803] usb usb1: root hub lost power or was reset
[  203.752803] uhci_hcd 0000:00:1d.1: PCI INT B -> Link[LNKD] -> GSI 3 (level, low) -> IRQ 3
[  203.752803] uhci_hcd 0000:00:1d.1: setting latency timer to 64
[  203.752803] usb usb2: root hub lost power or was reset
[  203.752803] uhci_hcd 0000:00:1d.2: PCI INT C -> Link[LNKC] -> GSI 11 (level, low) -> IRQ 11
[  203.752803] uhci_hcd 0000:00:1d.2: setting latency timer to 64
[  203.752803] usb usb3: root hub lost power or was reset
[  203.752803] uhci_hcd 0000:00:1d.3: PCI INT D -> Link[LNKA] -> GSI 10 (level, low) -> IRQ 10
[  203.752803] uhci_hcd 0000:00:1d.3: setting latency timer to 64
[  203.752803] usb usb4: root hub lost power or was reset
[  203.752803] ehci_hcd 0000:00:1d.7: PCI INT A -> Link[LNKH] -> GSI 5 (level, low) -> IRQ 5
[  203.752803] ehci_hcd 0000:00:1d.7: setting latency timer to 64
[  203.752803] pci 0000:00:1e.0: setting latency timer to 64
[  203.752803] ich7_resume
[  203.752803] leds_ss4200 0000:00:1f.0: Enabled ICH7 IDE device
[  203.752803] ata_piix 0000:00:1f.1: PCI INT A -> Link[LNKC] -> GSI 11 (level, low) -> IRQ 11
[  203.752803] ata_piix 0000:00:1f.1: setting latency timer to 64
[  203.752803] ahci 0000:00:1f.2: setting latency timer to 64
[  203.752803] pcieport 0000:00:1c.0: wake-up capability disabled by ACPI
[  203.752803] e1000e 0000:01:00.0: PME# disabled
[  203.752803] e1000e 0000:01:00.0: Disabling ASPM  L1
[  203.752803] e1000e 0000:01:00.0: irq 19 for MSI/MSI-X
[  203.763885] ata7: port disabled. ignoring.
[  203.765367] ata8: port disabled. ignoring.
[  203.765441] sata_sil24 0000:02:00.0: PCI INT A -> Link[LNKC] -> GSI 11 (level, low) -> IRQ 11
[  203.765449] sata_sil24 0000:02:00.0: setting latency timer to 64
[  203.765488] sd 0:0:0:0: [sda] Starting disk
[  203.765543] sd 1:0:0:0: [sdb] Starting disk
[  203.765558] sd 3:0:0:0: [sdc] Starting disk
[  203.767210] serial 00:06: activated
[  203.844497] e1000e: eth0 NIC Link is Down
[  204.084039] ata3: SATA link down (SStatus 0 SControl 300)
[  205.844044] ata6: SATA link down (SStatus 0 SControl 0)
[  205.844074] ata5: SATA link down (SStatus 0 SControl 0)
[  206.225001] e1000e: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX
[  213.776031] ata1: softreset failed (device not ready)
[  213.776041] ata4: softreset failed (device not ready)
[  213.776054] ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[  213.814529] ata2.00: configured for UDMA/133
[  214.268035] ata4: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[  214.298359] ata4.00: configured for UDMA/133
[  214.492033] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[  214.530575] ata1.00: configured for UDMA/133
[  214.546678] PM: resume of devices complete after 10792.435 msecs
[  214.546777] PM: resume devices took 10.792 seconds
[  214.546780] ------------[ cut here ]------------
[  214.546790] WARNING: at kernel/power/suspend_test.c:53 suspend_devices_and_enter+0x196/0x1d0()
[  214.546794] Hardware name: SS4200-E
[  214.546796] Component: resume devices, time: 10792
[  214.546799] Modules linked in: nfsd nfs lockd nfs_acl auth_rpcgss sunrpc 8021q i2c_i801 leds_ss4200 led_class i2c_core serio_raw rng_core processor button usb_storage sd_mod ata_piix ehci_hcd sata_sil24 uhci_hcd e1000e thermal fan thermal_sys ahci libahci libata scsi_mod [last unloaded: scsi_wait_scan]
[  214.546829] Pid: 2738, comm: s2ram Not tainted 2.6.36-nas #7
[  214.546832] Call Trace:
[  214.546839]  [<ffffffff8104abf1>] ? suspend_devices_and_enter+0x196/0x1d0
[  214.546845]  [<ffffffff8104abf1>] ? suspend_devices_and_enter+0x196/0x1d0
[  214.546851]  [<ffffffff81025e84>] ? warn_slowpath_common+0x78/0x8d
[  214.546856]  [<ffffffff81025f58>] ? warn_slowpath_fmt+0x56/0x5e
[  214.546863]  [<ffffffff8114aa3d>] ? kobject_get+0x12/0x17
[  214.546869]  [<ffffffff811b6170>] ? dpm_resume_end+0x339/0x346
[  214.546873]  [<ffffffff8104adf4>] ? suspend_test_finish+0x49/0x79
[  214.546879]  [<ffffffff8104abf1>] ? suspend_devices_and_enter+0x196/0x1d0
[  214.546884]  [<ffffffff8104ad24>] ? enter_state+0xf9/0x13a
[  214.546889]  [<ffffffff8104a551>] ? state_store+0xb2/0xd4
[  214.546894]  [<ffffffff810cba77>] ? sysfs_write_file+0xd0/0x107
[  214.546900]  [<ffffffff81081bb9>] ? vfs_write+0xac/0x133
[  214.546905]  [<ffffffff81081cfc>] ? sys_write+0x45/0x6e
[  214.546910]  [<ffffffff81002768>] ? system_call_fastpath+0x16/0x1b
[  214.546914] ---[ end trace 61ecc54a71f50ba2 ]---
[  215.024048] PM: Finishing wakeup.
[  215.024051] Restarting tasks ... done.
[  216.118388] svc: failed to register lockdv1 RPC service (errno 97).
[  216.124852] NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
[  216.132687] NFSD: starting 90-second grace period
[  245.968040] usb 5-1: reset high speed USB device using ehci_hcd and address 2
Back to top
View user's profile Send private message
roarinelk
Guru
Guru


Joined: 04 Mar 2004
Posts: 444

PostPosted: Sun Oct 24, 2010 10:09 am    Post subject: Reply with quote

omega13333 wrote:
I added printk(KERN_ALERT "<function name>\n") to the patch functions and got the following output from dmesg. The lines from printk are "ich7_suspend", "ich7_resume_early", ...

Code:

[  203.752803] ich7_resume
[  203.752803] leds_ss4200 0000:00:1f.0: Enabled ICH7 IDE device


According to this output the patch seems to work as intended.
EDIT: no scratch that, I have a hunch. I'll cook up an updated patch for you to try. Stay tuned
Back to top
View user's profile Send private message
roarinelk
Guru
Guru


Joined: 04 Mar 2004
Posts: 444

PostPosted: Sun Oct 24, 2010 11:13 am    Post subject: Reply with quote

Please try this patch and send me the dmesg output again:

Code:

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 857ae01..faa9da5 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -2902,3 +2902,92 @@ int pci_dev_specific_reset(struct pci_dev *dev, int probe)
 
    return -ENOTTY;
 }
+
+
+/* XXX: hack to enable the PATA device on ICH7 */
+static void __iomem *xybrd_rcba_base;
+static void xybrd_hides_ide_lpc_ich7_suspend(struct pci_dev *dev)
+{
+   u32 rcba;
+
+   dev_info(&dev->dev, "ICH7_IDE_HACK_suspend ENTER\n");
+
+   if (xybrd_rcba_base) {
+      printk(KERN_ALERT "WARNING: more than one ICH7 PATA!\n");
+      goto out;
+   }
+
+   pci_read_config_dword(dev, 0xF0, &rcba);
+   /* use bits 31:14, 16 kB aligned */
+   xybrd_rcba_base = ioremap_nocache(rcba & 0xFFFFC000, 0x4000);
+   if (xybrd_rcba_base == NULL)
+      dev_info(&dev->dev, "ICH7_IDE_HACK_suspend: ioremap() failed\n");
+
+out:
+   dev_info(&dev->dev, "ICH7_IDE_HACK_suspend DONE\n");
+}
+
+static void xybrd_hides_ide_lpc_ich7_resume_early(struct pci_dev *dev)
+{
+   u32 val;
+
+   dev_info(&dev->dev, "ICH7_IDE_HACK_resume_early ENTER\n");
+
+   if (!xybrd_rcba_base) {
+      dev_info(&dev->dev, "ICH7_IDE_HACK_resume_early: no base\n");
+      goto out;
+   }
+
+   /* read the Function Disable register, dword mode only */
+   val = readl(xybrd_rcba_base + 0x3418);
+   writel(val & 0xFFFFFFFD, xybrd_rcba_base + 0x3418); /* enable the PATA device */
+
+out:
+   dev_info(&dev->dev, "ICH7_IDE_HACK_resume_early DONE\n");
+}
+
+static void xybrd_hides_ide_lpc_ich7_resume(struct pci_dev *dev)
+{
+   u32 val;
+
+   dev_info(&dev->dev, "ICH7_IDE_HACK_resume ENTER\n");
+
+   if (!xybrd_rcba_base) {
+      dev_info(&dev->dev, "ICH7_IDE_HACK_resume: no base\n");
+      goto out;
+   }
+
+   /* look if someone disable the bloody thing in the meantime */
+   val = readl(xybrd_rcba_base + 0x3418);
+   if (val & ~0xfffffffd) {
+      dev_info(&dev->dev, "ICH7_IDE_HACK_resume: someone "
+                "disabled IDE again! Enabling again\n");
+      xybrd_hides_ide_lpc_ich7_resume_early(dev);
+   }
+
+   iounmap(xybrd_rcba_base);
+   xybrd_rcba_base = NULL;
+out:
+   dev_info(&dev->dev, "ICH7_IDE_HACK_resume DONE\n");
+}
+
+static void xybrd_hides_ide_lpc_ich7(struct pci_dev *dev)
+{
+   dev_info(&dev->dev, "ICH7_IDE_HACK ENTER\n");
+   xybrd_hides_ide_lpc_ich7_suspend(dev);
+   xybrd_hides_ide_lpc_ich7_resume_early(dev);
+   xybrd_hides_ide_lpc_ich7_resume(dev);
+   dev_info(&dev->dev, "ICH7_IDE_HACK DONE\n");
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,
+          PCI_DEVICE_ID_INTEL_ICH7_0,
+          xybrd_hides_ide_lpc_ich7);
+DECLARE_PCI_FIXUP_SUSPEND(PCI_VENDOR_ID_INTEL,
+           PCI_DEVICE_ID_INTEL_ICH7_0,
+           xybrd_hides_ide_lpc_ich7_suspend);
+DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL,
+          PCI_DEVICE_ID_INTEL_ICH7_0,
+          xybrd_hides_ide_lpc_ich7_resume);
+DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_INTEL,
+                PCI_DEVICE_ID_INTEL_ICH7_0,
+                xybrd_hides_ide_lpc_ich7_resume_early);
Back to top
View user's profile Send private message
omega13333
n00b
n00b


Joined: 23 Oct 2010
Posts: 5

PostPosted: Mon Oct 25, 2010 7:51 am    Post subject: Reply with quote

The new patch has not changed the behavior.
Here is my dmesg output with the new patch

Code:
[  144.753759] PM: Syncing filesystems ... done.
[  144.866605] PM: Preparing system for mem sleep
[  144.868653] Freezing user space processes ... (elapsed 0.01 seconds) done.
[  144.890662] Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
[  144.910647] PM: Entering mem sleep
[  144.910662] Suspending console(s) (use no_console_suspend to debug)
[  144.917540] sd 3:0:0:0: [sdc] Synchronizing SCSI cache
[  144.917575] sd 1:0:0:0: [sdb] Synchronizing SCSI cache
[  144.917591] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[  144.917724] sd 3:0:0:0: [sdc] Stopping disk
[  144.917734] sd 1:0:0:0: [sdb] Stopping disk
[  144.917741] sd 0:0:0:0: [sda] Stopping disk
[  144.918015] serial 00:06: disabled
[  144.918242] sata_sil24 0000:02:00.0: PCI INT A disabled
[  144.918375] ata_piix 0000:00:1f.1: PCI INT A disabled
[  144.918386] leds_ss4200 0000:00:1f.0: ICH7_IDE_HACK_suspend ENTER
[  144.918427] leds_ss4200 0000:00:1f.0: ICH7_IDE_HACK_suspend DONE
[  144.918459] uhci_hcd 0000:00:1d.3: PCI INT D disabled
[  144.918467] uhci_hcd 0000:00:1d.2: PCI INT C disabled
[  144.918475] uhci_hcd 0000:00:1d.1: PCI INT B disabled
[  144.918484] uhci_hcd 0000:00:1d.0: PCI INT A disabled
[  144.948043] ehci_hcd 0000:00:1d.7: PCI INT A disabled
[  144.996326] e1000e 0000:01:00.0: PCI INT A disabled
[  144.996335] e1000e 0000:01:00.0: PME# enabled
[  144.996349] pcieport 0000:00:1c.0: wake-up capability enabled by ACPI
[  145.860039] PM: suspend of devices complete after 942.996 msecs
[  145.860043] PM: suspend devices took 0.944 seconds
[  145.876207] PM: late suspend of devices complete after 16.158 msecs
[  145.876303] ACPI: Preparing to enter system sleep state S3
[  145.876775] PM: Saving platform NVS memory
[  145.876804] Extended CMOS year: 2000
[  145.876804] Back to C!
[  145.876804] PM: Restoring platform NVS memory
[  145.876804] Extended CMOS year: 2000
[  145.876804] ACPI: Waking up from system sleep state S3
[  145.876804] pci 0000:00:02.0: restoring config space at offset 0x7 (was 0xffa00000, writing 0xffa40000)
[  145.876804] pcieport 0000:00:1c.0: restoring config space at offset 0xf (was 0x20100, writing 0x2010a)
[  145.876804] pcieport 0000:00:1c.0: restoring config space at offset 0x9 (was 0x1fff1, writing 0x20112001)
[  145.876804] pcieport 0000:00:1c.0: restoring config space at offset 0x3 (was 0x810000, writing 0x810008)
[  145.876804] pcieport 0000:00:1c.0: restoring config space at offset 0x1 (was 0x100107, writing 0x100507)
[  145.876804] pcieport 0000:00:1c.2: restoring config space at offset 0xf (was 0x20300, writing 0x2030b)
[  145.876804] pcieport 0000:00:1c.2: restoring config space at offset 0x9 (was 0x1fff1, writing 0x20312021)
[  145.876804] pcieport 0000:00:1c.2: restoring config space at offset 0x3 (was 0x810000, writing 0x810008)
[  145.876804] pcieport 0000:00:1c.2: restoring config space at offset 0x1 (was 0x100107, writing 0x100507)
[  145.876804] uhci_hcd 0000:00:1d.0: restoring config space at offset 0x1 (was 0x2800005, writing 0x2800001)
[  145.876804] uhci_hcd 0000:00:1d.1: restoring config space at offset 0x1 (was 0x2800005, writing 0x2800001)
[  145.876804] uhci_hcd 0000:00:1d.2: restoring config space at offset 0x1 (was 0x2800005, writing 0x2800001)
[  145.876804] uhci_hcd 0000:00:1d.3: restoring config space at offset 0x1 (was 0x2800005, writing 0x2800001)
[  145.876804] ehci_hcd 0000:00:1d.7: restoring config space at offset 0x1 (was 0x2900006, writing 0x2900002)
[  145.876804] pci 0000:00:1e.0: restoring config space at offset 0xf (was 0x20000, writing 0x200ff)
[  145.876804] leds_ss4200 0000:00:1f.0: ICH7_IDE_HACK_resume_early ENTER
[  145.876804] leds_ss4200 0000:00:1f.0: ICH7_IDE_HACK_resume_early DONE
[  145.876804] ata_piix 0000:00:1f.1: restoring config space at offset 0xb (was 0x0, writing 0x27df8086)
[  145.876804] ata_piix 0000:00:1f.1: restoring config space at offset 0x8 (was 0x1, writing 0xffa1)
[  145.876804] ata_piix 0000:00:1f.1: restoring config space at offset 0x7 (was 0x1, writing 0x8f9)
[  145.876804] ata_piix 0000:00:1f.1: restoring config space at offset 0x6 (was 0x1, writing 0x8f1)
[  145.876804] ata_piix 0000:00:1f.1: restoring config space at offset 0x1 (was 0x2800000, writing 0x2800005)
[  145.876804] ahci 0000:00:1f.2: restoring config space at offset 0x1 (was 0x2b00007, writing 0x2b00407)
[  145.876804] e1000e 0000:01:00.0: restoring config space at offset 0xf (was 0x100, writing 0x10a)
[  145.876804] e1000e 0000:01:00.0: restoring config space at offset 0x6 (was 0x1, writing 0xbc01)
[  145.876804] e1000e 0000:01:00.0: restoring config space at offset 0x4 (was 0x0, writing 0xff6e0000)
[  145.876804] e1000e 0000:01:00.0: restoring config space at offset 0x1 (was 0x100000, writing 0x100007)
[  145.876804] sata_sil24 0000:02:00.0: restoring config space at offset 0xf (was 0x100, writing 0x10b)
[  145.876804] sata_sil24 0000:02:00.0: restoring config space at offset 0xc (was 0x0, writing 0xff800000)
[  145.876804] sata_sil24 0000:02:00.0: restoring config space at offset 0x8 (was 0x1, writing 0xcc01)
[  145.876804] sata_sil24 0000:02:00.0: restoring config space at offset 0x6 (was 0x4, writing 0xff8f8004)
[  145.876804] sata_sil24 0000:02:00.0: restoring config space at offset 0x4 (was 0x4, writing 0xff8ffc04)
[  145.876804] sata_sil24 0000:02:00.0: restoring config space at offset 0x3 (was 0x0, writing 0x8)
[  145.876804] sata_sil24 0000:02:00.0: restoring config space at offset 0x1 (was 0x100000, writing 0x100007)
[  145.876804] PM: early resume of devices complete after 0.707 msecs
[  145.876804] uhci_hcd 0000:00:1d.0: PCI INT A -> Link[LNKH] -> GSI 5 (level, low) -> IRQ 5
[  145.876804] uhci_hcd 0000:00:1d.0: setting latency timer to 64
[  145.876804] usb usb1: root hub lost power or was reset
[  145.876804] uhci_hcd 0000:00:1d.1: PCI INT B -> Link[LNKD] -> GSI 3 (level, low) -> IRQ 3
[  145.876804] uhci_hcd 0000:00:1d.1: setting latency timer to 64
[  145.876804] usb usb2: root hub lost power or was reset
[  145.876804] uhci_hcd 0000:00:1d.2: PCI INT C -> Link[LNKC] -> GSI 11 (level, low) -> IRQ 11
[  145.876804] uhci_hcd 0000:00:1d.2: setting latency timer to 64
[  145.876804] usb usb3: root hub lost power or was reset
[  145.876804] uhci_hcd 0000:00:1d.3: PCI INT D -> Link[LNKA] -> GSI 10 (level, low) -> IRQ 10
[  145.876804] uhci_hcd 0000:00:1d.3: setting latency timer to 64
[  145.876804] usb usb4: root hub lost power or was reset
[  145.876804] ehci_hcd 0000:00:1d.7: PCI INT A -> Link[LNKH] -> GSI 5 (level, low) -> IRQ 5
[  145.876804] ehci_hcd 0000:00:1d.7: setting latency timer to 64
[  145.876804] pci 0000:00:1e.0: setting latency timer to 64
[  145.876804] leds_ss4200 0000:00:1f.0: ICH7_IDE_HACK_resume ENTER
[  145.876804] leds_ss4200 0000:00:1f.0: ICH7_IDE_HACK_resume DONE
[  145.876804] ata_piix 0000:00:1f.1: PCI INT A -> Link[LNKC] -> GSI 11 (level, low) -> IRQ 11
[  145.876804] ata_piix 0000:00:1f.1: setting latency timer to 64
[  145.876804] ahci 0000:00:1f.2: setting latency timer to 64
[  145.876804] pcieport 0000:00:1c.0: wake-up capability disabled by ACPI
[  145.876804] e1000e 0000:01:00.0: PME# disabled
[  145.876804] e1000e 0000:01:00.0: Disabling ASPM  L1
[  145.876804] e1000e 0000:01:00.0: irq 19 for MSI/MSI-X
[  145.887854] ata7: port disabled. ignoring.
[  145.889344] ata8: port disabled. ignoring.
[  145.889415] sata_sil24 0000:02:00.0: PCI INT A -> Link[LNKC] -> GSI 11 (level, low) -> IRQ 11
[  145.889423] sata_sil24 0000:02:00.0: setting latency timer to 64
[  145.889461] sd 0:0:0:0: [sda] Starting disk
[  145.889519] sd 1:0:0:0: [sdb] Starting disk
[  145.889534] sd 3:0:0:0: [sdc] Starting disk
[  145.891184] serial 00:06: activated
[  146.208043] ata3: SATA link down (SStatus 0 SControl 300)
[  147.968043] ata5: SATA link down (SStatus 0 SControl 0)
[  147.968074] ata6: SATA link down (SStatus 0 SControl 0)
[  148.368997] e1000e: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX
[  155.228039] ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[  155.259362] ata2.00: configured for UDMA/133
[  155.508038] ata4: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[  155.547453] ata4.00: configured for UDMA/133
[  155.900027] ata1: softreset failed (device not ready)
[  156.392033] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[  156.424078] ata1.00: configured for UDMA/133
[  156.451305] PM: resume of devices complete after 10573.046 msecs
[  156.451407] PM: resume devices took 10.572 seconds
[  156.451410] ------------[ cut here ]------------
[  156.451420] WARNING: at kernel/power/suspend_test.c:53 suspend_devices_and_enter+0x196/0x1d0()
[  156.451424] Hardware name: SS4200-E
[  156.451426] Component: resume devices, time: 10572
[  156.451429] Modules linked in: nfsd nfs lockd nfs_acl auth_rpcgss sunrpc 8021q i2c_i801 serio_raw leds_ss4200 led_class i2c_core rng_core button processor usb_storage sd_mod ata_piix ehci_hcd sata_sil24 uhci_hcd e1000e thermal fan thermal_sys ahci libahci libata scsi_mod [last unloaded: scsi_wait_scan]
[  156.451458] Pid: 2706, comm: s2ram Not tainted 2.6.36-nas #9
[  156.451460] Call Trace:
[  156.451468]  [<ffffffff8104abf1>] ? suspend_devices_and_enter+0x196/0x1d0
[  156.451474]  [<ffffffff8104abf1>] ? suspend_devices_and_enter+0x196/0x1d0
[  156.451480]  [<ffffffff81025e84>] ? warn_slowpath_common+0x78/0x8d
[  156.451485]  [<ffffffff81025f58>] ? warn_slowpath_fmt+0x56/0x5e
[  156.451492]  [<ffffffff8114aa3d>] ? kobject_get+0x12/0x17
[  156.451499]  [<ffffffff811b6238>] ? dpm_resume_end+0x339/0x346
[  156.451504]  [<ffffffff8104adf4>] ? suspend_test_finish+0x49/0x79
[  156.451509]  [<ffffffff8104abf1>] ? suspend_devices_and_enter+0x196/0x1d0
[  156.451514]  [<ffffffff8104ad24>] ? enter_state+0xf9/0x13a
[  156.451519]  [<ffffffff8104a551>] ? state_store+0xb2/0xd4
[  156.451525]  [<ffffffff810cba77>] ? sysfs_write_file+0xd0/0x107
[  156.451532]  [<ffffffff81081bb9>] ? vfs_write+0xac/0x133
[  156.451536]  [<ffffffff81081cfc>] ? sys_write+0x45/0x6e
[  156.451541]  [<ffffffff81002768>] ? system_call_fastpath+0x16/0x1b
[  156.451545] ---[ end trace 41e358c54a3f99a4 ]---
[  156.935351] PM: Finishing wakeup.
[  156.935354] Restarting tasks ... done.


Looks like the patch works like expected (the IDE controller shows up after standby) but I assume the problem is that the driver thinks that the two ports are disabled in BIOS. Maybe the pci config for this is not restored properly after standby.

Perhaps these are the bits checked by the following function in ata_piix.c.
Code:
static int piix_pata_prereset(struct ata_link *link, unsigned long deadline)
{
        struct ata_port *ap = link->ap;
        struct pci_dev *pdev = to_pci_dev(ap->host->dev);

        if (!pci_test_config_bits(pdev, &piix_enable_bits[ap->port_no]))
                return -ENOENT;
        return ata_sff_prereset(link, deadline);
}

Code:
static struct pci_bits piix_enable_bits[] = {
        { 0x41U, 1U, 0x80UL, 0x80UL },  /* port 0 */
        { 0x43U, 1U, 0x80UL, 0x80UL },  /* port 1 */
};
Back to top
View user's profile Send private message
roarinelk
Guru
Guru


Joined: 04 Mar 2004
Posts: 444

PostPosted: Mon Oct 25, 2010 7:55 am    Post subject: Reply with quote

You seem to know C, so I suggest you add some printk()s to ata_piix and trace where
resume gets stuck. The patch does what it's supposed to do it seems.
Back to top
View user's profile Send private message
omega13333
n00b
n00b


Joined: 23 Oct 2010
Posts: 5

PostPosted: Mon Oct 25, 2010 2:28 pm    Post subject: Reply with quote

I have played around a little bit and actually the problem is like I assumed.
I analyzed the bits that are checked by
Code:
 if (!pci_test_config_bits(pdev, &piix_enable_bits[ap->port_no]))

in function "piix_pata_prereset" and found out that the bits differ when I boot the kernel with option "test_suspend=mem" from booting without it. I then added a line ata_piix.c to manually override these values with the correct ones and now my IDE disk shows up. :D

I've changed the function "piix_pata_prereset" in ata_piix.c as shown bellow
Code:
static int piix_pata_prereset(struct ata_link *link, unsigned long deadline)
{
        struct ata_port *ap = link->ap;
        struct pci_dev *pdev = to_pci_dev(ap->host->dev);

        struct pci_bits *bits = &piix_enable_bits[ap->port_no];
        pci_write_config_byte(pdev, bits->reg, 0xc0);

                /% To control the state of the bits %/
                u8 tmp8 = 0;
                pci_read_config_byte(pdev, bits->reg, &tmp8);
                printk(KERN_ALERT "ICH7 piix_pata_prereset bits %x\n", tmp8);
                dev_info(&pdev->dev, "ICH7 piix_pata_prereset\n");


        if (!pci_test_config_bits(pdev, &piix_enable_bits[ap->port_no]))
                return -ENOENT;
        return ata_sff_prereset(link, deadline);
}

The patch is quite dirty, but I am not so experienced in C or kernel-hacking. For the moment it does the job for me.

EDIT: When I unload the ata_piix module the system freezes immediatly, so I suggest not to use this patch if you like to keep your data safe.


Last edited by omega13333 on Mon Nov 22, 2010 6:44 pm; edited 1 time in total
Back to top
View user's profile Send private message
RottenMutt
n00b
n00b


Joined: 30 Sep 2010
Posts: 15
Location: fort worth

PostPosted: Fri Nov 19, 2010 11:27 pm    Post subject: Reply with quote

omega, how quick does your nas return from standby when accessing your shares? what is your drive configuration?

mine is 4x hard disks in raid5 off of the sata controllers, and a pata disk with OS.
Back to top
View user's profile Send private message
RottenMutt
n00b
n00b


Joined: 30 Sep 2010
Posts: 15
Location: fort worth

PostPosted: Sun Nov 21, 2010 3:48 pm    Post subject: Reply with quote

omega, are u able to get speed step working? I'm running e4600 cpu, and because it isn't throttling I'm leaving 5 watts on the table. I've enable power management on my four Hitachi 2 TB drives so they spin down which gets me to 42 watts.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum