Bug 48101

Summary: [Ubuntu 12.04 LTS 32-bit] NVIDIA nForce 650i SLI and nForce 430i USB related ACPI S3 State Entry Failure
Product: ACPI Reporter: fpgahardwareengineer (mypersonalmailbox1)
Component: Power-Sleep-WakeAssignee: Lan Tianyu (tianyu.lan)
Status: CLOSED DUPLICATE    
Severity: high CC: alan, greg, lenb, tianyu.lan
Priority: P1    
Hardware: All   
OS: Linux   
URL: https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers/+bug/1033950
Kernel Version: 3.2.0-27-generic-pae Subsystem:
Regression: No Bisected commit-id:
Attachments: BootDmesg.txt
BootLog.gz
CurrentDmesg.txt
Dependencies.txt
DpkgLog.txt
GconfCompiz.txt
LightdmLog.txt
Lspci.txt
ProcCpuinfo.txt
ProcInterrupts.txt
ProcModules.txt
UdevDb.txt
UdevLog.txt
UnitySupportTest.txt
xdpyinfo.txt
XorgLog.txt
XorgLogOld.txt
Xrandr.txt
ASUS P5N-E SLI mainboard ACPI S3 State resume bug analysis

Description fpgahardwareengineer 2012-09-30 06:58:58 UTC
Hi,

I will like to report that if I set "USB Legacy support" to Enable in the BIOS setup of ASUS P5N-E SLI mainboard, Ubuntu will freeze when I try to put the computer into suspend mode (BIOS Setup -> Advanced -> USB Configuration -> USB Legacy support).
If I set this option to Disable, and if I use PS/2 keyboard and mouse, the computer will enter ACPI S3 state, and resume from it correctly.
If I use USB keyboard and mouse instead of PS/2 keyboard and mouse, the computer will enter ACPI S3 state briefly, and comes out of it instantly.
For more information about ASUS P5N-E SLI mainboard, refer to this link.

http://www.asus.com/Motherboards/Intel_Socket_775/P5NE_SLI

I noticed similar problems with ASUS A8N-LA mainboard that came with an HP desktop PC if I performed the same operation with Ubuntu 10.04.4 LTS 32-bit and 12.04 LTS 32-bit.
This mainboard also had NVIDIA nForce 430i on it.
For more information about ASUS A8N-LA mainboard, refer to this link.

http:// h10025. www1.hp. com/ewfrf/ wc/document? lc=en&cc= us&docname= c00647121& dlc=en

System Configuration:

- Ubuntu 12.04 LTS 32-bit
  * All updates as of 8/7/2012 have been applied
- Intel Pentium 4 521 2.8 GHz
  * 800 MHz FSB
  * 1 MB L2 cache
- ASUS P5N-E SLI mainboard
  * BIOS Revision 1406 (last release) 11/18/2009
  * NVIDIA nForce 650i SLI (NB) and nForce 430i (SB)
- 1 GB DDR2 800 DDR2 SDRAM
  * Corsair CM2X1024-6400C5DHX 1 GB module
  * Operating in single channel mode
- ZOTAC GeForce 8400 GS
  * 256 MB DDR3 SDRAM
  * PCI Express x16
  * Using open source NVIDIA display device driver
- NETGEAR WG311T Wireless LAN
  - 32-bit PCI card
- Maxtor STM380211 80 GB PATA hard drive
- Hitachi LG Data Storage GDR-8163B PATA DVD-ROM drive
- USB keyboard
- USB mouse
- Dell 19 inch LCD monitor
  * VGA input

I believe this is a bug of NVIDIA USB device driver, although I own other NVIDIA chipset-based mainboards, they don't exhibit the same problem (i.e., ECS NFORCE4-A939 and MSI NF980-G65).
From what I have seen, this issue seems specific to NVIDIA nForce 430i.
Please fix this bug.
I will do anything to help the developers fix the bug.
Please note that I don't have physical access to this computer setup at this point because it is currently located in another U.S. state where I visit only twice a year.

Regards,

fpgahardwareengineer
Comment 1 fpgahardwareengineer 2012-09-30 07:09:10 UTC
Created attachment 81541 [details]
BootDmesg.txt
Comment 2 fpgahardwareengineer 2012-09-30 07:11:00 UTC
Created attachment 81551 [details]
BootLog.gz
Comment 3 fpgahardwareengineer 2012-09-30 07:11:28 UTC
Created attachment 81561 [details]
CurrentDmesg.txt
Comment 4 fpgahardwareengineer 2012-09-30 07:12:09 UTC
Created attachment 81571 [details]
Dependencies.txt
Comment 5 Alan 2012-09-30 13:36:16 UTC
There are huge numbers of USB suspend/resume fixes between 3.2 and 3.6, including a pile of workarounds for buggy firmware. Please test 3.6 once it's out otherwise the chances are this is an already fixed bug
Comment 6 fpgahardwareengineer 2012-10-01 02:25:22 UTC
Created attachment 81581 [details]
DpkgLog.txt
Comment 7 fpgahardwareengineer 2012-10-01 02:33:31 UTC
Created attachment 81591 [details]
GconfCompiz.txt
Comment 8 fpgahardwareengineer 2012-10-01 02:34:13 UTC
Created attachment 81601 [details]
LightdmLog.txt
Comment 9 fpgahardwareengineer 2012-10-01 02:35:08 UTC
Created attachment 81611 [details]
Lspci.txt
Comment 10 fpgahardwareengineer 2012-10-01 02:35:51 UTC
Created attachment 81621 [details]
ProcCpuinfo.txt
Comment 11 fpgahardwareengineer 2012-10-01 02:36:37 UTC
Created attachment 81631 [details]
ProcInterrupts.txt
Comment 12 fpgahardwareengineer 2012-10-01 02:37:34 UTC
Created attachment 81641 [details]
ProcModules.txt
Comment 13 fpgahardwareengineer 2012-10-01 02:38:35 UTC
Created attachment 81651 [details]
UdevDb.txt
Comment 14 fpgahardwareengineer 2012-10-01 02:39:27 UTC
Created attachment 81661 [details]
UdevLog.txt
Comment 15 fpgahardwareengineer 2012-10-01 02:40:09 UTC
Created attachment 81671 [details]
UnitySupportTest.txt
Comment 16 fpgahardwareengineer 2012-10-01 02:40:36 UTC
Created attachment 81681 [details]
xdpyinfo.txt
Comment 17 fpgahardwareengineer 2012-10-01 02:41:03 UTC
Created attachment 81691 [details]
XorgLog.txt
Comment 18 fpgahardwareengineer 2012-10-01 02:41:36 UTC
Created attachment 81701 [details]
XorgLogOld.txt
Comment 19 fpgahardwareengineer 2012-10-01 02:42:26 UTC
Created attachment 81711 [details]
Xrandr.txt
Comment 20 fpgahardwareengineer 2012-10-01 03:06:06 UTC
(In reply to comment #5)
> There are huge numbers of USB suspend/resume fixes between 3.2 and 3.6,
> including a pile of workarounds for buggy firmware. Please test 3.6 once it's
> out otherwise the chances are this is an already fixed bug

Hi Alan,

Are there any plans to feedback the bug fixes to Linux 2.6 and 3.2 kernels?
Do Linux developers even feedback bug fixes to older kernels in the first place?
I use Ubuntu 10.04.4 LTS 32-bit (Canonical support going out in April 2013) and 12.04.1 LTS 32-bit.
I do find quite a few bugs (30+ bugs I have observed with 30+ mainboards I own myself.) in Ubuntu 10.04.4 and 12.04.1, and before Canonical phases out Ubuntu 10.04.4 LTS, I will like to see as many fixes incorporated into Ubuntu 10.04.4 LTS in particular.
        Is there a list of fixes made to USB/ACPI area of Linux that you are talking about?
I own quite a few NVIDIA, SiS, and VIA Technologies chipset-based mainboards, and compared to Intel chipset-based mainboards, USB/ACPI S3 State resume is a lot shakier to say it charitably.
By the way, I always update the mainboard BIOS with the last non-beta version released by the mainboard manufacturer before filing a bug report.
If the last non-beta BIOS doesn't work for a given mainboard, I will try the beta version BIOS or go back to one version before the last non-beta version BIOS. (ASUS often releases beta version BIOS for their mainboards.)
Case in point, I got my ASUS P4S8X-MX mainboard (SiS 661GX/964 chipset) to stop freezing occasionally when resuming from ACPI S3 State by switching back to BIOS Revision 0808 rather than the Revision 0901 that used to be on ASUS website. (Revision 0901 used to be on their website, but somehow disappeared. I downloaded it 2 or so years ago.)
Although with ASUS P4S8X-MX mainboard, I had to disable its onboard USB within BIOS setup because of USB/ACPI S3 State resume bug that appeared in Linux 3.2 kernel that didn't exist in Linux 2.6 kernel.
That's the reason why I think bug fixes should go back into the older kernels.

Regards,

fpgahardwareengineer
Comment 21 fpgahardwareengineer 2012-10-01 03:12:29 UTC
Hi,

I forgot to add one more thing.
The ASUS P4S8X-MX ACPI S3 State resume bug workaround (Solution: Disable onboard USB via BIOS setup, use BIOS Revision 0808 instead of no longer publicly available Revision 0901, use PS/2 keyboard and mouse, and use a PCI USB 2.0 card instead of onboard USB) is discussed in Bug 47991 I posted recently.
I still will like to see the SiS USB/ACPI S3 State resume issue fixed in Linux 3.2 kernel.
Ubuntu 12.04.1 LTS uses Linux 3.2 kernel.

Regards,

fpgahardwareengineer
Comment 22 Alan 2012-10-01 11:08:54 UTC
Stuff will get rippled back into older releases if it can be done safely and if people verify it actually fixes the problems being seen.

You can attach as much as you like the only relevant question is does 3.6 work on your system.
Comment 23 fpgahardwareengineer 2012-10-03 07:52:10 UTC
(In reply to comment #22)
> Stuff will get rippled back into older releases if it can be done safely and
> if
> people verify it actually fixes the problems being seen.
> 
> You can attach as much as you like the only relevant question is does 3.6
> work
> on your system.

Hi Alan,

Well, I don't like to sound rude, but may I ask why do I need to wait until 3.6 to see if the issues I have raised are addressed?
You know, if you made such a comment inside an automobile company, I don't think you will be able to keep your job for long, especially if you worked on the area of automotive brake control software or airbag control software.
I have spend fair amount of time doing compatibility testing of Linux with variety of computer hardware available, and now I am told that my effort doesn't count too much.
I know many in the Linux community hate Microsoft, but Microsoft has gotten their USB/ACPI areas right since Windows 2000.
It seems like Linux after more than 10 years of lack of quality control with regard to USB/ACPI areas is where Microsoft was with Windows 95 OSR2/Windows 98 when it comes to USB/ACPI reliability.
How many years do you guys have to spend to get USB/ACPI right?
Alan, do you take any pride in the software you write or maintain?
I have developed PCI DMA engine/industry grade PCI interface (It has never passed PCI-SIG testing, but it probably will if I had the money to go get it tested and certified.) in the past, and as a hardware guy, I am sometimes surprised to see the casual attitude towards bugs or crashes software/firmware people have.
People may hate Microsoft or Bill Gates all they want to (I am not a Microsoft fan either.), but when it comes to device driver quality, I hate to say that Microsoft is years ahead of Linux.
When will anyone take responsibility here?

Regards,

fpgahardwareengineer
Comment 24 fpgahardwareengineer 2012-10-03 08:01:06 UTC
Hi, 

Alan's comments have been bothering me for the past 2 days so I had to write what I just wrote.
I don't like to criticize other people too much, but I seen so many similar attitudes with other Linux developers when it comes to taking responsibility and acknowledging bugs within Linux for the last 2 years.
To me, it's not too difficult to find hardware that doesn't work correctly with Linux because it looks like Linux developers don't know or care about device driver quality.
Please don't blame buggy BIOS all the time because that's not where all the problems are.
I guess this is why paid software (i.e., software written by for-profit corporations) works because one might lose their job or the corporation might go bankrupt if the software doesn't work, but open-source people write software just as a hobby.

Regards,

fpgahardwareengineer
Comment 25 Alan 2012-10-03 11:20:04 UTC
If you have a commercial support contract with Ubuntu then take it up with them. If not then perhaps given your expectations to have someone immediately fix your bug you should enquire about obtaining one.
Comment 26 Greg Kroah-Hartman 2012-10-03 15:25:24 UTC
As Alan has pointed out, if you are relying on a distro to provide your kernel for you, please contact them, they are really the only ones that can help you out, we can't do anything with their older kernel releases.

We can only help you if you are using the latest kernel.org releases, or the -stable kernel releases from kernel.org.

As for "USB Legacy mode", why are you using that?  I wouldn't recommend using it as many BIOSes can not handle this properly with suspend/resume as you have noticed.  Does everything work properly if you disable that option?
Comment 27 fpgahardwareengineer 2013-01-01 09:48:17 UTC
Hi,

I have not updated this bug report for a while because I didn't have access to this mainboard for 4 months.
I gave ASUS P5N-E SLI mainboard to my parents for use as a Ubuntu computer.
I am visiting them now and I will have access to this computer for 10 more days.
    I upgraded this computer with a brand new, good looking computer case, Intel Core 2 Duo E8500 (3.16 GHz, Wolfdale), and 2 GB X 2 DDR2-667 DDR2 SDRAM.
Anyway, if anyone has followed this bug report, the bug it has is very similar to Bug 47991.

https://bugzilla.kernel.org/show_bug.cgi?id=47991

Bug 47991 is a bug where ASUS P4S8X-MX mainboard (SiS 661GX and SiS 964) and ASUS P4S8X mainboard (SiS 648 and SiS 963) will cause an instant wakeup from ACPI S3 State if USB 1.x devices are connected.
The only known workaround of this bug right now is to disable wakeup via Terminal.

cat /proc/acpi/wakeup

See the names of USB devices.
Typically it will be called USB, USB0, USB1, USB2, etc., and it depends on the mainboard.
For ASUS P5N-E SLI mainboard, it should look like this.

Device    S-state      Status   Sysfs node
HUB0      S5    *disabled  pci:0000:00:10.0
XVRA      S5    *disabled  pci:0000:00:03.0
XVRB      S5    *disabled 
XVRC      S5    *disabled 
XVRD      S5    *disabled  pci:0000:00:07.0
UAR1      S5    *disabled  pnp:00:08
PS2M      S4    *disabled  pnp:00:0a
PS2K      S4    *enabled   pnp:00:0b
USB0      S4    *enabled   pci:0000:00:0b.0
USB2      S4    *enabled   pci:0000:00:0b.1
AZAD      S5    *disabled  pci:0000:00:10.1
MMAC      S5    *disabled  pci:0000:00:14.0
MMCI      S5    *disabled 

Now run this.

sudo sh -c "echo USB0 > /proc/acpi/wakeup"
sudo sh -c "echo USB2 > /proc/acpi/wakeup"

All this will suppress the ACPI S3 State resume issue for now.
USB 2.0 devices like most USB storage sticks manufactured recently are not affected by this bug.
    I have done some testing of ACPI S3 State resume on ASUS P5N-E SLI mainboard, and here is the test results.

____________________________________________________________________________
Equipment:

PS/2 Keyboard: emachines 5143 (from emachines T2984 desktop computer)
PS/2 Mouse: Sysgration Ltd. SAGM002 (from emachines T2984 desktop computer)
USB Keyboard: Dell SK-8115
USB Mouse: Logitech M-UAE96 (optical)
USB Storage Stick: Patriot Memory SNIP 16 GB




Experiment:

(1)
USB Emulation: Disabled
Keyboard: PS/2 keyboard
Mouse: PS/2 mouse
USB Storage Stick: No

ACPI S3 State entry: Successful
ACPI S3 State resume: Successful
ACPI S3 State resume reliability: Good


(2)
USB Emulation: Disabled
Keyboard: USB keyboard
Mouse: USB mouse
USB Storage Stick: No

ACPI S3 State entry: Successful
ACPI S3 State resume: Instant Wakeup
ACPI S3 State resume reliability: Good

Note: 'sudo sh -c "echo USB0 > /proc/acpi/wakeup"' and 'sudo sh -c "echo USB2 > /proc/acpi/wakeup"' suppresses the ACPI S3 State wakeup bug.


(3)
USB Emulation: Enabled
Keyboard: PS/2 keyboard
Mouse: PS/2 mouse
USB Storage Stick: No

ACPI S3 State entry: Failure (Freeze; Ubuntu bootup screen freezes.)
ACPI S3 State resume: Failure (obviously)
ACPI S3 State resume reliability: Failure (obviously)


(4)
USB Emulation: Enabled
Keyboard: USB keyboard
Mouse: USB mouse
USB Storage Stick: No

ACPI S3 State entry: Failure (Freeze; Ubuntu bootup screen freezes.)
ACPI S3 State resume: Failure (obviously)
ACPI S3 State resume reliability: Failure (obviously)




(5)
USB Emulation: Disabled
Keyboard: PS/2 keyboard
Mouse: PS/2 mouse, USB mouse
USB Storage Stick: No

ACPI S3 State entry: Successful
ACPI S3 State resume: Instant Wakeup
ACPI S3 State resume reliability: Failure


(6)
USB Emulation: Disabled
Keyboard: PS/2 keyboard, USB keyboard
Mouse: PS/2 mouse, USB mouse
USB Storage Stick: No

ACPI S3 State entry: Successful
ACPI S3 State resume: Instant Wakeup
ACPI S3 State resume reliability: Good
Note: 'sudo sh -c "echo USB0 > /proc/acpi/wakeup"' and 'sudo sh -c "echo USB2 > /proc/acpi/wakeup"' suppresses the ACPI S3 State wakeup bug.


(7)
USB Emulation: Disabled
Keyboard: PS/2 keyboard
Mouse: PS/2 mouse
USB Storage Stick: Yes

ACPI S3 State entry: Successful
ACPI S3 State resume: Successful
ACPI S3 State resume reliability: Good


(8)
USB Emulation: Disabled
Keyboard: PS/2 keyboard, USB keyboard
Mouse: PS/2 mouse, USB mouse
USB Storage Stick: Yes

ACPI S3 State entry: Successful
ACPI S3 State resume: Instant Wakeup
ACPI S3 State resume reliability: Good
Note: 'sudo sh -c "echo USB0 > /proc/acpi/wakeup"' and 'sudo sh -c "echo USB2 > /proc/acpi/wakeup"' suppresses the ACPI S3 State wakeup bug.
____________________________________________________________________________


Enabling "USB Emulation" in ASUS P5N-E SLI mainboard's BIOS setup causes the computer to freeze when "entering" ACPI S3 State (Note the "entering" part. I cannot even do resume since the computer won't even enter ACPI S3 State.).
If I set "USB Emulation" in BIOS setup to Disable, the bug symptoms are identical to those of ASUS P4S8X-MX and P4S8X mainboards.
    I am willing to do further testing using Canonical pre-compiled Linux 3.7 kernel on the same box if that is what the upstream developers want me to do.
For this test, I continued to use Linux 3.2.0-35-generic-pae kernel.
Let me know what I should do next to help fix this bug.

Regards,

fpgahardwareengineer
Comment 28 fpgahardwareengineer 2013-01-01 10:02:57 UTC
(In reply to comment #26)

Hi Greg,

> As Alan has pointed out, if you are relying on a distro to provide your
> kernel
> for you, please contact them, they are really the only ones that can help you
> out, we can't do anything with their older kernel releases.
> 
> We can only help you if you are using the latest kernel.org releases, or the
> -stable kernel releases from kernel.org.
> 
> As for "USB Legacy mode", why are you using that?  I wouldn't recommend using
> it as many BIOSes can not handle this properly with suspend/resume as you
> have
> noticed.  Does everything work properly if you disable that option?


I know you are a "big dog" regarding the development of Linux kernel, but as an avid amateur Linux hardware tester (I own 30+ mainboards and many different graphics cards in my apartment.), I can say that activating "USB emulation" "USB keyboard/mouse emulation" "USB keyboard for DOS" or whatever terminology used to active USB keyboard/mouse port 60H/64H emulation in BIOS setup does not cause ACPI S3 State related freezes for the most part.
Most ACPI S3 State freezes are Linux device driver bug related, and in particular, graphics cards related from my extensive experience dealing with this issue for 2 years.
The only expections I know are ASUS mainboards that happened to have NVIDIA nForce 430i (MCP51) chipset like ASUS P5N-E SLI and ASUS A8N-LA mainboards.

http://www.asus.com/Motherboards/Intel_Socket_775/P5NE_SLI
http://h10025.www1.hp.com/ewfrf/wc/document?lc=en&cc=us&docname=c00647121&dlc=en

I use USB emulation so that I don't lose keyboard control in some programs.
If I am correct, when Ubuntu boots from a DVD, it will need USB emulation for the keyboard to work since USB is not fully initialized at that point.
At least that is what I read somewhere.

Regards,

fpgahardwareengineer
Comment 29 fpgahardwareengineer 2013-01-01 10:04:40 UTC
Created attachment 90041 [details]
ASUS P5N-E SLI mainboard ACPI S3 State resume bug analysis
Comment 30 fpgahardwareengineer 2013-01-01 10:10:14 UTC
Hi,

Not that it is that important, but I will update the current hardware description.


System Configuration:

- Ubuntu 12.04 LTS 32-bit
  * All updates as of 12/29/2012 have been applied
- Intel Core 2 Duo E8500
  * Wolfdale
  * 3.16 GHz
  * 1333 MHz FSB
  * 6 MB L2 cache
- ASUS P5N-E SLI mainboard
  * BIOS Revision 1406 (last release) 11/18/2009
  * NVIDIA nForce 650i SLI (NB)
  * NVIDIA nForce 430i (SB)
- 4 GB DDR2-667 DDR2 SDRAM
  * Hynix 2 GB module X 2
  * Operating in dual channel mode
- ZOTAC GeForce 8400 GS
  * 256 MB DDR3 SDRAM
  * PCI Express x16
  * Using open source NVIDIA display device driver
- NETGEAR WG311T Wireless LAN
  - 32-bit PCI card
- Maxtor STM380211 80 GB PATA hard drive
- Hitachi LG Data Storage GDR-8163B PATA DVD-ROM drive
- PS/2 or USB keyboard
- PS/2 or USB mouse
- Dell 19 inch LCD monitor
  * VGA input
- Nice brand new computer case


Regards,

fpgahardwareengineer
Comment 31 Lan Tianyu 2013-01-09 07:07:57 UTC
This bug also duplicates with bug 43081

*** This bug has been marked as a duplicate of bug 43081 ***