Bug 36422 - unable to hibernate with nouveau and NV11 [bisected]
Summary: unable to hibernate with nouveau and NV11 [bisected]
Status: RESOLVED INVALID
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/nouveau (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium normal
Assignee: Nouveau Project
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-20 05:57 UTC by c sights
Modified: 2013-08-18 18:10 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
dmesg of "last good" kernel boot (24.80 KB, text/plain)
2011-04-22 16:41 UTC, c sights
no flags Details
dmesg of "first bad" kernel boot (24.97 KB, text/plain)
2011-04-22 16:42 UTC, c sights
no flags Details
dmesg of 2.6.39-rc4 kernel boot (25.66 KB, text/plain)
2011-04-22 16:43 UTC, c sights
no flags Details
compile fix (512 bytes, patch)
2011-04-23 10:08 UTC, Marcin Slusarz
no flags Details | Splinter Review
possible fix (555 bytes, patch)
2011-04-25 03:10 UTC, Marcin Slusarz
no flags Details | Splinter Review
revert+debug (706 bytes, patch)
2011-04-25 14:49 UTC, Marcin Slusarz
no flags Details | Splinter Review

Description c sights 2011-04-20 05:57:06 UTC
Hi,
   This is a kernel bug and i've opened a report there.
https://bugzilla.kernel.org/show_bug.cgi?id=33582

but i heard that opening a bug here was appropriate.  if not, i :(, please close.

   I'm able to successfully hibernate while using nouveau with kernel version
2.6.35 (and before) but unable to hibernate in 2.6.36 (and after up to
2.6.39-rc2).
   I am not using X.  From the console I test whether hibernate is possible
using "pm-hibernate".
   I've bisected this and located a range of possible commits which changed
this behavior.  
last known good: d17f395cdcec39033a481f96d75e8b3d3c41d43a
first known bad: 816544b21b020bdb9dcb9a5003fe3e1f109e8698
   Between these commits the kernel would not compile.


   This is the nVidia card in the machine.
02:00.0 VGA compatible controller: nVidia Corporation NV11 [GeForce2 MX/MX 400]
(rev b2) (prog-if 00 [VGA controller])
        Subsystem: nVidia Corporation Device 0054
        Flags: bus master, 66MHz, medium devsel, latency 32, IRQ 11
        Memory at dc000000 (32-bit, non-prefetchable) [size=16M]
        Memory at d0000000 (32-bit, prefetchable) [size=128M]
        [virtual] Expansion ROM at dd000000 [disabled] [size=64K]
        Capabilities: [60] Power Management version 2
        Capabilities: [44] AGP version 2.0

Let me know if I can provide more info or test patches!

Thanks,  Chad.
Comment 1 Marcin Slusarz 2011-04-20 08:40:10 UTC
I probably can't help you with hibernation bug, but if you would post a compile error I could provide a patch or workaround, so you could continue bisecting this.

Please attach dmesg from last known good and first bad kernel.
Dmesg from .39-rcX might be useful too.
Comment 2 c sights 2011-04-20 16:00:35 UTC
(In reply to comment #1)
> I probably can't help you with hibernation bug, but if you would post a compile
> error I could provide a patch or workaround, so you could continue bisecting
> this.

  CC [M]  drivers/gpu/drm/nouveau/nouveau_drv.o
  CC [M]  drivers/gpu/drm/nouveau/nouveau_state.o
  CC [M]  drivers/gpu/drm/nouveau/nouveau_channel.o
  CC [M]  drivers/gpu/drm/nouveau/nouveau_mem.o
  CC [M]  drivers/gpu/drm/nouveau/nouveau_object.o
drivers/gpu/drm/nouveau/nouveau_object.c: In function 'nouveau_gpuobj_new':
drivers/gpu/drm/nouveau/nouveau_object.c:236:23: error: 'struct drm_mm' has no member named 'ml_entry'
make[4]: *** [drivers/gpu/drm/nouveau/nouveau_object.o] Error 1
make[3]: *** [drivers/gpu/drm/nouveau] Error 2
make[2]: *** [drivers/gpu/drm] Error 2
make[1]: *** [drivers/gpu] Error 2
make: *** [drivers] Error 2


> Please attach dmesg from last known good and first bad kernel.
> Dmesg from .39-rcX might be useful too.

I'll attach these later....
Comment 3 c sights 2011-04-22 16:41:55 UTC
Created attachment 45983 [details]
dmesg of "last good" kernel boot
Comment 4 c sights 2011-04-22 16:42:29 UTC
Created attachment 45984 [details]
dmesg of "first bad" kernel boot
Comment 5 c sights 2011-04-22 16:43:05 UTC
Created attachment 45985 [details]
dmesg of 2.6.39-rc4 kernel boot
Comment 6 c sights 2011-04-22 16:43:39 UTC
	Here are what appear to be the relevant parts of dmesg for the "last good" and "first bad" kernels.  The difference I see is that the "last good" emits "failed parsing" messages, whereas the "last bad" does not.  I will attach the full dmesg separately.

LAST GOOD d17f395cdcec39033a481f96d75e8b3d3c41d43a
[drm] Initialized drm 1.1.0 20060810
nouveau 0000:02:00.0: PCI INT A -> Link[APC4] -> GSI 19 (level, high) -> IRQ 19
[drm] nouveau 0000:02:00.0: Detected an NV10 generation card (0x011000b2)
[drm] nouveau 0000:02:00.0: Attempting to load BIOS image from PROM
[drm] nouveau 0000:02:00.0: ... appears to be valid
[drm] nouveau 0000:02:00.0: BMP BIOS found
[drm] nouveau 0000:02:00.0: BMP version 5.17
[drm] nouveau 0000:02:00.0: Bios version 03.11.00.18
[drm] nouveau 0000:02:00.0: Found Display Configuration Block version 1.2
[drm] nouveau 0000:02:00.0: No useful information in BIOS output table; adding all possible outputs
[drm] nouveau 0000:02:00.0: Probing TV encoders on I2C bus: 1
[drm] nouveau 0000:02:00.0: No TV encoders found.
[drm] nouveau 0000:02:00.0: Parsing VBIOS init table 0 at offset 0x07FE
[drm] nouveau 0000:02:00.0: 0x0818: Failed parsing init table opcode: INIT_CONFIGURE_PREINIT -19
[drm] nouveau 0000:02:00.0: Parsing VBIOS init table 1 at offset 0x0EA7
[drm] nouveau 0000:02:00.0: Parsing VBIOS init table 2 at offset 0x0819
[drm] nouveau 0000:02:00.0: 0x08AB: Failed parsing init table opcode: INIT_CONFIGURE_CLK -19
[drm] nouveau 0000:02:00.0: Parsing VBIOS init table 3 at offset 0x0E4E
[drm] nouveau 0000:02:00.0: Parsing VBIOS init table 4 at offset 0x08AC
[drm] nouveau 0000:02:00.0: 0x08D9: Failed parsing init table opcode: INIT_CONFIGURE_MEM -19
[drm] nouveau 0000:02:00.0: Parsing VBIOS init table 5 at offset 0x09BB
[drm] nouveau 0000:02:00.0: Parsing VBIOS init table 6 at offset 0x08DA
[drm] nouveau 0000:02:00.0: Parsing VBIOS init table 7 at offset 0x0956
[drm] nouveau 0000:02:00.0: Detected 32MiB VRAM
[TTM] Zone  kernel: Available graphics memory: 443408 kiB.
[TTM] Zone highmem: Available graphics memory: 1168372 kiB.
[TTM] Initializing pool allocator.
agpgart-nvidia 0000:00:00.0: AGP 2.0 bridge
agpgart-nvidia 0000:00:00.0: putting AGP V2 device into 4x mode
nouveau 0000:02:00.0: putting AGP V2 device into 4x mode
[drm] nouveau 0000:02:00.0: 64 MiB GART (aperture)
[drm] nouveau 0000:02:00.0: Allocating FIFO number 0
[drm] nouveau 0000:02:00.0: nouveau_channel_alloc: initialised FIFO 0
[drm] nouveau 0000:02:00.0: Initial CRTC_OWNER is 0
[drm] nouveau 0000:02:00.0: Saving VGA fonts
[drm] nouveau 0000:02:00.0: Detected a VGA connector
[drm] nouveau 0000:02:00.0: Detected a DVI-D connector
[drm] nouveau 0000:02:00.0: Setting dpms mode 3 on vga encoder (output 0)
[drm] nouveau 0000:02:00.0: Setting dpms mode 3 on tmds encoder (output 1)
[drm] nouveau 0000:02:00.0: allocated 1280x1024 fb: 0x48000, bo f665ec00
[drm] nouveau 0000:02:00.0: Setting dpms mode 0 on vga encoder (output 0)
[drm] nouveau 0000:02:00.0: Output VGA-1 is running on CRTC 0 using output @
Console: switching to colour frame buffer device 160x64
fb0: nouveaufb frame buffer device
drm: registered panic notifier
[drm] Initialized nouveau 0.0.16 20090420 for 0000:02:00.0 on minor 0



FIRST BAD 816544b21b020bdb9dcb9a5003fe3e1f109e8698
[drm] Initialized drm 1.1.0 20060810
nouveau 0000:02:00.0: PCI INT A -> Link[APC4] -> GSI 19 (level, high) -> IRQ 19
[drm] nouveau 0000:02:00.0: Detected an NV10 generation card (0x011000b2)
[drm] nouveau 0000:02:00.0: Attempting to load BIOS image from PROM
[drm] nouveau 0000:02:00.0: ... appears to be valid
[drm] nouveau 0000:02:00.0: BMP BIOS found
[drm] nouveau 0000:02:00.0: BMP version 5.17
[drm] nouveau 0000:02:00.0: Bios version 03.11.00.18
[drm] nouveau 0000:02:00.0: Found Display Configuration Block version 1.2
[drm] nouveau 0000:02:00.0: No useful information in BIOS output table; adding all possible outputs
[drm] nouveau 0000:02:00.0: Probing TV encoders on I2C bus: 1
[drm] nouveau 0000:02:00.0: No TV encoders found.
[drm] nouveau 0000:02:00.0: Parsing VBIOS init table 0 at offset 0x07FE
[drm] nouveau 0000:02:00.0: Parsing VBIOS init table 1 at offset 0x0EA7
[drm] nouveau 0000:02:00.0: Parsing VBIOS init table 2 at offset 0x0819
[drm] nouveau 0000:02:00.0: Parsing VBIOS init table 3 at offset 0x0E4E
[drm] nouveau 0000:02:00.0: Parsing VBIOS init table 4 at offset 0x08AC
[drm] nouveau 0000:02:00.0: Parsing VBIOS init table 5 at offset 0x09BB
[drm] nouveau 0000:02:00.0: Parsing VBIOS init table 6 at offset 0x08DA
[drm] nouveau 0000:02:00.0: Parsing VBIOS init table 7 at offset 0x0956
[drm] nouveau 0000:02:00.0: Detected 32MiB VRAM
[TTM] Zone  kernel: Available graphics memory: 443408 kiB.
[TTM] Zone highmem: Available graphics memory: 1168372 kiB.
[TTM] Initializing pool allocator.
agpgart-nvidia 0000:00:00.0: AGP 2.0 bridge
agpgart-nvidia 0000:00:00.0: putting AGP V2 device into 4x mode
nouveau 0000:02:00.0: putting AGP V2 device into 4x mode
[drm] nouveau 0000:02:00.0: 64 MiB GART (aperture)
[drm] nouveau 0000:02:00.0: Allocating FIFO number 0
[drm] nouveau 0000:02:00.0: nouveau_channel_alloc: initialised FIFO 0
[drm] nouveau 0000:02:00.0: Initial CRTC_OWNER is 0
[drm] nouveau 0000:02:00.0: Saving VGA fonts
[drm] nouveau 0000:02:00.0: Setting dpms mode 3 on vga encoder (output 0)
[drm] nouveau 0000:02:00.0: Setting dpms mode 3 on tmds encoder (output 1)
[drm] nouveau 0000:02:00.0: allocated 1280x1024 fb: 0x48000, bo f68e9400
[drm] nouveau 0000:02:00.0: Setting dpms mode 0 on vga encoder (output 0)
[drm] nouveau 0000:02:00.0: Output VGA-1 is running on CRTC 0 using output @
Console: switching to colour frame buffer device 160x64
fb0: nouveaufb frame buffer device
drm: registered panic notifier
[drm] Initialized nouveau 0.0.16 20090420 for 0000:02:00.0 on minor 0


	There is a range of commits skipped while bisecting because they don't compile.  If anyone can devise a patch to fix up the compile error that would be nice!  Here is the first compile error encountered after the "last good" commit:

  CC [M]  drivers/gpu/drm/nouveau/nouveau_drv.o
  CC [M]  drivers/gpu/drm/nouveau/nouveau_state.o
  CC [M]  drivers/gpu/drm/nouveau/nouveau_channel.o
  CC [M]  drivers/gpu/drm/nouveau/nouveau_mem.o
  CC [M]  drivers/gpu/drm/nouveau/nouveau_object.o
drivers/gpu/drm/nouveau/nouveau_object.c: In function 'nouveau_gpuobj_new':
drivers/gpu/drm/nouveau/nouveau_object.c:236:23: error: 'struct drm_mm' has no
member named 'ml_entry'
make[4]: *** [drivers/gpu/drm/nouveau/nouveau_object.o] Error 1
make[3]: *** [drivers/gpu/drm/nouveau] Error 2
make[2]: *** [drivers/gpu/drm] Error 2
make[1]: *** [drivers/gpu] Error 2
make: *** [drivers] Error 2
Comment 7 Marcin Slusarz 2011-04-23 10:08:24 UTC
Created attachment 45995 [details] [review]
compile fix

Ok. Here's the temporary compile fix.
(ml_entry was renamed to node_list in commit d1024ce91ff4c2c4ccbf692d204c71cbf215157a ("drm: sane naming for drm_mm.c"), but nouveau tree was rebased before pulling)



Before continuing bisection can you revert commit 309b8c89c8ddf9dd8e5f253c185d6af1d0358a79 on top of e.g. 816544b21b020bdb9dcb9a5003fe3e1f109e8698 and see if it fixes hibernation?
Comment 8 c sights 2011-04-24 15:26:52 UTC
Thanks for the compile fix work around!

I've completed the git bisect:


190a43783f2c43186180c827444d4eac901b4bcf is the first bad commit
commit 190a43783f2c43186180c827444d4eac901b4bcf
Author: Francisco Jerez <currojerez@riseup.net>
Date:   Thu Jun 17 12:42:14 2010 +0200

    drm/nouveau: Don't clear AGPCMD completely on INIT_RESET.
    
    We just need to clear the SBA and ENABLE bits to reset the AGP
    controller: If the AGP bridge was configured to use "fast writes",
    clearing the FW bit would break the subsequent MMIO writes and
    eventually end with a lockup.
    
    Note that all the BIOSes I've seen do the same as we did (it works for
    them because they don't use MMIO), OTOH the blob leaves FW untouched.
    
    Signed-off-by: Francisco Jerez <currojerez@riseup.net>
    Signed-off-by: Ben Skeggs <bskeggs@redhat.com>

:040000 040000 2af374ca41a86c67a662fd99fa0516df54ef3c55 89468256a014ee395b57d2ae2e1277fd8c244f31 M  drivers

I can test patches!
Comment 9 Marcin Slusarz 2011-04-25 03:10:01 UTC
Created attachment 46048 [details] [review]
possible fix

commit description does not match patch body, so let's apply commit description and see if it fixes your issue
Comment 10 c sights 2011-04-25 14:04:10 UTC
(In reply to comment #9)
> Created an attachment (id=46048) [details]
> possible fix
> 
> commit description does not match patch body, so let's apply commit description
> and see if it fixes your issue

  Unfortunately this did not fix the hibernate problem.  I tested on both 2.6.39-rc4 and modifying the original commit on the development tree.

Do you have another try? :)

Thanks,
  C.
Comment 11 Marcin Slusarz 2011-04-25 14:49:55 UTC
Created attachment 46068 [details] [review]
revert+debug

Please attach dmesg from successful resume with this patch applied. It's a revert + some debugging.

Attaching VBIOS from your card might be helpful too.
http://nouveau.freedesktop.org/wiki/DumpingVideoBios
Comment 12 c sights 2011-04-25 17:42:50 UTC
> Please attach dmesg from successful resume with this patch applied. It's a
> revert + some debugging.

   Actually, I've only been able to successfully _resume_ from hibernate using Debian's 2.6.32 with backported nouveau drivers.  2.6.33 only successfully hibernates, i.e. writes to disk and shuts off.  When turning on the % loaded reaches 100%, then there is a dark screen.
   I guess to track down the successful resume one would have to look at Debian's patches to 2.6.32.


   Would you still be interested in dmesg and vbios for a successful write to disk only? :)
Comment 13 Ilia Mirkin 2013-08-18 18:10:20 UTC
It appears that this bug report has laid dormant for quite a while. Sorry we haven't gotten to it. Since we fix bugs all the time, chances are pretty good that your issue has been fixed with the latest software. Please give it a shot. (Linux kernel 3.10.7, xf86-video-nouveau 1.0.9, mesa 9.1.6, or their git versions.) If upgrading to the latest isn't an option for you, your distro's bugzilla is probably the right destination for your bug report.

In an effort to clean up our bug list, we're pre-emptively closing all bugs that haven't seen updates since 2011. If the original issue remains, please make sure to provide fresh info, see http://nouveau.freedesktop.org/wiki/Bugs/ for what we need to see, and re-open this one.

Thanks,

The Nouveau Team


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.