Skip to contentSkip to conversation

New: s2disk hangs with nvidiafb

Bugme-new Sergei S. 1 participant 3 messages Feb 22, 2009 – Feb 27, 2009 1 message not in the archive Framebuffer layer

lore
Share & tools
lore

Sergei S.

author
#0 lore raw

Hello.

By the way.

[drivers/video/vesafb.c
static int __init vesafb_probe(struct platform_device *dev)]

	if (!request_mem_region(vesafb_fix.smem_start, size_total, "vesafb")) {
		printk(KERN_WARNING
		       "vesafb: cannot reserve video memory at 0x%lx\n",
			vesafb_fix.smem_start);
		/* We cannot make this fatal. Sometimes this comes from magic
		   spaces our resource handlers simply don't know about */
	}

Is there any reason not to make vesafb request_mem_region fail fatal?

In case we already have framebuffer at 0xc0000000 and framebuffer_alloc failed - we'll release non-vesafb memory region.

	info = framebuffer_alloc(sizeof(u32) * 256, &dev->dev);
	if (!info) {
		release_mem_region(vesafb_fix.smem_start, size_total);
		return -ENOMEM;
	}

So, what do you think about the idea to check num_registered_fb when request_mem_region fails?
----------------------------------------------------
...� ������ �������� �������������� ������
� ���� �������� ByFly ����� ������������ �������� EasyPay.
http://www.easypay.by/

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Linux-fbdev-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 30 lines · Krzysztof
Quoted 27 lines · On Sun, 22 Feb 2009 12:47:11 +0200 "Sergei S." <[email protected]> wrote:

Hello.

By the way.

[drivers/video/vesafb.c
static int __init vesafb_probe(struct platform_device *dev)]

      if (!request_mem_region(vesafb_fix.smem_start, size_total, "vesafb")) {
              printk(KERN_WARNING
                     "vesafb: cannot reserve video memory at 0x%lx\n",
                      vesafb_fix.smem_start);
              /* We cannot make this fatal. Sometimes this comes from magic
                 spaces our resource handlers simply don't know about */
      }

Is there any reason not to make vesafb request_mem_region fail fatal?

In case we already have framebuffer at 0xc0000000 and framebuffer_alloc failed - we'll release non-vesafb memory region.

      info = framebuffer_alloc(sizeof(u32) * 256, &dev->dev);
      if (!info) {
              release_mem_region(vesafb_fix.smem_start, size_total);
              return -ENOMEM;
      }
Quoted 2 lines
Quoted 2 lines

So, what do you think about the idea to check num_registered_fb when request_mem_region fails?

Hello.

Quoted 3 lines

I am not sure. Each request is done by a driver and it is assigned to it. Someone with more knowledge should clear this doubts. I suppose if a driver does not
request a resource releasing it should be void.

I think we should do some work at request_mem_region instead of simple printk KERN_WARNING (I may be wrong).

And what about:

Quoted 8 lines

In case we already have framebuffer at 0xc0000000 and framebuffer_alloc failed - we'll release non-vesafb memory region.

      info = framebuffer_alloc(sizeof(u32) * 256, &dev->dev);
      if (!info) {
              release_mem_region(vesafb_fix.smem_start, size_total);
              return -ENOMEM;
      }

IMHO at least we should have some bit showing that request_mem_region(vesafb_fix.smem_start, size_total, "vesafb") was successful. Just to call release_mem_region is not correct since we can release nvidiafb's (etc.) memory region.

Quoted 2 lines

Your case is more simple - nvidiafb does not suspend/resume correctly. This is easy to check - if only the nvidiafb is selected the s2disk does not work.

Well, it's not so simple, I guess. Looks like s2disk works with nvidiafb built with "Lots of debug messages" and doesn't work otherwise.

Before hibernation we create virtual console and make switch to it (am I right?). I'm not sure, but it seems I have problems in switching to virtual console (or even earlier).
I'll try to figure out.

Quoted 2 lines

This is probably not a regression - you can check if your older kernel works with only the nvidiafb selected.

I've tested 2.6.27.11. It seems a bit senseless to test kernels earlier than 2.6.27 (it can be difficult to find out the problem).

Quoted 4 lines

Unfortunately, I have no card to reproduce this and I don't know what is wrong with the nvidiafb suspend/resume functions.

I hope someone will help you.

Thanks.

Best regards,
Sergey

Quoted 2 lines

Kind regards,
Krzysztof

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H

#3 lore raw
In reply to a message not in the archive

Hello.
Sorry, I've been a bit busy. So, back to the s2disk problem.

For 2.6.29-rc6-git1 strace s2disk shows:
------------------------------------------------------
execve("/usr/sbin/s2disk", ["s2disk"], [/* 37 vars */]) = 0
brk(0) = 0x8e9f000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fad000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=77137, ...}) = 0
mmap2(NULL, 77137, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f9a000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/usr/lib/liblzo2.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\320#\0\0004\0\0\0\24"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=124924, ...}) = 0
mmap2(NULL, 127840, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7f7a000 mmap2(0xb7f99000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1e) = 0xb7f99000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/usr/lib/libgcrypt.so.11", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\240D\0\0004\0\0\0\314"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=425220, ...}) = 0
mmap2(NULL, 424676, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7f12000 mmap2(0xb7f78000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x66) = 0xb7f78000

close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libsplashy.so.1", O_RDONLY)  = 3

read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\300\17\0\0004\0\0\0004"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=18716, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f11000 mmap2(NULL, 21828, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7f0b000 mmap2(0xb7f10000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4) = 0xb7f10000

close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libgcc_s.so.1", O_RDONLY)    = 3

read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\220\34\0\0004\0\0\0\254"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=50916, ...}) = 0
mmap2(NULL, 49928, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7efe000 mmap2(0xb7f0a000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xc) = 0xb7f0a000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i686/cmov/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\260e\1\0004\0\0\0\4"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0755, st_size=1413540, ...}) = 0
mmap2(NULL, 1418864, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7da3000 mmap2(0xb7ef8000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x155) = 0xb7ef8000 mmap2(0xb7efb000, 9840, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7efb000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/usr/lib/libgpg-error.so.0", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\220\6\0\0004\0\0\0\214"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=11556, ...}) = 0
mmap2(NULL, 14568, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7d9f000 mmap2(0xb7da2000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2) = 0xb7da2000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/usr/lib/libglib-2.0.so.0", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\340\25\1\0004\0\0\0\24"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=736588, ...}) = 0
mmap2(NULL, 740420, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7cea000 mmap2(0xb7d9e000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xb3) = 0xb7d9e000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/libsplashycnf.so.1", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0 \v\0\0004\0\0\0P"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=7696, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7ce9000 mmap2(NULL, 10684, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7ce6000 mmap2(0xb7ce8000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1) = 0xb7ce8000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/usr/lib/libdirectfb-1.0.so.0", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0P\274\0\0004\0\0\0\314"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=421300, ...}) = 0
mmap2(NULL, 421540, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7c7f000 mmap2(0xb7ce4000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x65) = 0xb7ce4000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/usr/lib/libpcre.so.3", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\260\17\0\0004\0\0\0@"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=162088, ...}) = 0
mmap2(NULL, 164984, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7c56000 mmap2(0xb7c7e000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x27) = 0xb7c7e000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/usr/lib/libdirect-1.0.so.0", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\2602\0\0004\0\0\0t"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=76932, ...}) = 0
mmap2(NULL, 81836, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7c42000 mmap2(0xb7c55000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x12) = 0xb7c55000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/usr/lib/libfusion-1.0.so.0", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20$\0\0004\0\0\0\370"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=28344, ...}) = 0
mmap2(NULL, 31328, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7c3a000 mmap2(0xb7c41000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6) = 0xb7c41000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i686/cmov/libdl.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`\n\0\0004\0\0\0H"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=9680, ...}) = 0
mmap2(NULL, 12412, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7c36000 mmap2(0xb7c38000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1) = 0xb7c38000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i686/cmov/libpthread.so.0", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0000H\0\0004\0\0\0\330"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0755, st_size=116414, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7c35000 mmap2(NULL, 98784, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7c1c000

mmap2(0xb7c31000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14) = 0xb7c31000
mmap2(0xb7c33000, 4576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7c33000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7c1b000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7c1b6b0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
mprotect(0xb7ef8000, 4096, PROT_READ)   = 0
munmap(0xb7f9a000, 77137)               = 0
set_tid_address(0xb7c1b6f8)             = 3293
set_robust_list(0xb7c1b700, 0xc)        = 0

futex(0xbfcc9770, FUTEX_WAKE_PRIVATE, 1) = 0 rt_sigaction(SIGRTMIN, {0xb7c202e0, [], SA_SIGINFO}, NULL, 8) = 0 rt_sigaction(SIGRT_1, {0xb7c20720, [], SA_RESTART|SA_SIGINFO}, NULL, 8) = 0 rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0 getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0 uname({sys="Linux", node="swordfish", ...}) = 0

brk(0)                                  = 0x8e9f000
brk(0x8ec0000)                          = 0x8ec0000
open("/dev/null", O_RDWR)               = 3
close(3)                                = 0

stat64("/etc/uswsusp.conf", {st_mode=S_IFREG|0644, st_size=204, ...}) = 0
open("/etc/uswsusp.conf", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=204, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fac000 read(3, "# /etc/uswsusp.conf(8) -- Configu"..., 4096) = 204

read(3, ""..., 4096)                    = 0
close(3)                                = 0
munmap(0xb7fac000, 4096)                = 0

mmap2(NULL, 212992, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7be7000
mlockall(MCL_CURRENT|MCL_FUTURE) = 0
mount("none", "/proc/3293", "tmpfs", 0, NULL) = 0
stat64("/dev/sda5", {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 5), ...}) = 0
chdir("/proc/3293") = 0
mknod("resume", S_IFBLK|0600, makedev(8, 5)) = 0

open("resume", O_RDWR)                  = 3
stat64("/dev/snapshot", {st_mode=S_IFCHR|0660, st_rdev=makedev(10, 231), ...}) = 0
open("/dev/snapshot", O_RDONLY)         = 4
ioctl(4, 0x400c330d, 0xbfcc9714)        = 0
open("/dev/console", O_RDONLY)          = 5
ioctl(5, KDGKBTYPE, 0xbfcc9748)         = 0
ioctl(5, TIOCLINUX, 0xbfcc9766)         = 0
ioctl(5, VT_GETSTATE, 0xbfcc973e)       = 0

ioctl(5, VIDIOC_QUERYCAP or VT_OPENQRY, 0xbfcc9744) = 0
close(5) = 0
open("/dev/tty8", O_RDWR) = 5
ioctl(5, VIDIOC_G_COMP or VT_ACTIVATE, 0x8) = 0 ioctl(5, VIDIOC_S_COMP or VT_WAITACTIVE

drivers/char/vt_ioctl.c

int vt_ioctl(struct tty_struct *tty, struct file * file,
unsigned int cmd, unsigned long arg)
...
case VT_WAITACTIVE:

                if (!perm)
                        goto eperm;
                if (arg == 0 || arg > MAX_NR_CONSOLES)
                        ret = -ENXIO;
                else
                        ret = vt_waitactive(arg - 1);
                break;

"Never" returns:
int vt_waitactive(int vt)

{
        int retval;
        DECLARE_WAITQUEUE(wait, current);

        add_wait_queue(&vt_activate_queue, &wait);
        for (;;) {
                retval = 0;

                /*
                 * Synchronize with redraw_screen(). By acquiring the console
                 * semaphore we make sure that the console switch is completed
                 * before we return. If we didn't wait for the semaphore, we
                 * could return at a point where fg_console has already been
                 * updated, but the console switch hasn't been completed.
                 */
                acquire_console_sem();
                set_current_state(TASK_INTERRUPTIBLE);
                if (vt == fg_console) {
                        release_console_sem();
                        break;
                }
                release_console_sem();
                retval = -ERESTARTNOHAND;
                if (signal_pending(current))
                        break;

                schedule();
                ^^^^^^^^^^^
        }
        remove_wait_queue(&vt_activate_queue, &wait);
        __set_current_state(TASK_RUNNING);
        return retval;
}

Best regards,
Sergey.

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H

_______________________________________________
Linux-fbdev-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel