Re: broken suspend, sometimes (drm related) [Was: 2.6.24-rc5-mm1]

2007-12-17 Thread Jesse Barnes
 next suspend/resume try:
 BLE drm_addmap_core a: map 81007c2d9b00, handle 
 BLE drm_addmap_core c: map 81007c2d9b00, handle c20010092000
 BLE drm_rmmap_locked b: map 81007c2d9b00, handle c20010092000
 BLE drm_addmap_core a: map 81007c2d9b00, handle c20010092000
 BLE drm_addmap_core c: map 81007c2d9b00, handle c20010092000
 BLE drm_rmmap_locked b: map 81007c2d9b00, handle c20010092000
 BLE drm_addmap_core a: map 81007c2d9b00, handle c20010092000
 BLE drm_addmap_core c: map 81007c2d9b00, handle c20010092000
 BLE drm_addmap_core a: map 81007c2d90c0, handle 8000
 BLE drm_addmap_ioctl a: map 81007c2d96c0, handle 
 BLE drm_addmap_core a: map 81007c2d90c0, handle 
 BLE drm_addmap_ioctl a: map 81007c2d96c0, handle 
 BLE drm_addmap_core a: map 81007c2d9800, handle 
 BLE drm_addmap_core b: map 81007c2d9800, handle c2001038
 BLE drm_addmap_ioctl a: map 81007c2d96c0, handle 
 BLE drm_addmap_core a: map 81007c2d9e80, handle 81007c2d9d40
 BLE drm_addmap_ioctl a: map 81007c2d96c0, handle 
 BLE drm_core_ioremap: map 81007d0ab050, handle c2001024
 set status page addr 0x00033000
 BLE drm_core_ioremap: map 81007d0ab098, handle c20010096000
 BLE drm_addmap_core a: map 81007bd7d440, handle 6632785c63766632
 BLE drm_addmap_ioctl a: map 81007bd7d080, handle 
 BLE drm_addmap_core a: map 81007bd7d700, handle 6632785c63766632
 BLE drm_addmap_ioctl a: map 81007bd7d080, handle 
 BLE drm_addmap_core a: map 81007c16f840, handle 81007c16f680
 BLE drm_addmap_ioctl a: map 81007bd7d080, handle 
 BLE drm_addmap_core a: map 81007c16f2c0, handle 81007cc33e10
 BLE drm_addmap_ioctl a: map 81007c16f640, handle 
 BLE drm_core_ioremapfree a: map 81007d0ab050, handle c2001024
 BLE drm_core_ioremapfree b: map 81007d0ab050, handle c2001024
 BLE drm_core_ioremapfree a: map 81007d0ab098, handle c20010096000
 BLE drm_core_ioremapfree b: map 81007d0ab098, handle c20010096000
 BLE drm_rmmap_locked a: map 81007c2d9800, handle c2001038
 BLE drm_rmmap_locked b: map 81007c2d9b00, handle c20010092000
 PM: Syncing filesystems ... done.
 PM: Preparing system for mem sleep
 Freezing user space processes ... (elapsed 0.00 seconds) done.
 Freezing remaining freezable tasks ... (elapsed 0.00 seconds) done.
 PM: Entering mem sleep
 sd 2:0:0:0: [sdc] Synchronizing SCSI cache
 sd 2:0:0:0: [sdc] Stopping disk
 sd 1:0:0:0: [sdb] Synchronizing SCSI cache
 sd 1:0:0:0: [sdb] Stopping disk
 sd 0:0:0:0: [sda] Synchronizing SCSI cache
 sd 0:0:0:0: [sda] Stopping disk
 drm_sysfs_suspend
 BAD BAD BAD 81007c2d9800 
 suspend_device(): drm_sysfs_suspend+0x0/0x40() returns -5
 Could not suspend device card0: error -5
 sd 0:0:0:0: [sda] Starting disk

 I;m out of ideas, please give me a clue.

This sounds a lot like a problem we had recently.  The driver wasn't 
preserving its mappings across X startup/shutdown (drm open/close) and so 
you'd see crashes like this.  It should be fixed already in DRM git.

Jesse

-
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


broken suspend, sometimes (drm related) [Was: 2.6.24-rc5-mm1]

2007-12-15 Thread Jiri Slaby
On 12/13/2007 11:40 AM, Andrew Morton wrote:
 
 ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.24-rc5/2.6.24-rc5-mm1/

Broken @#$%^ suspend, again (and maybe still for a longer time). Unable to
reproduce this with netconsole.

trace led to i915_suspend
callpci_bus_read_config_byte#
movq8(%rbx), %rdi   # variable.mmio_map, variable.mmio_map
movq24(%rdi), %rax  # variable.handle, D.24395
movl458760(%rax), %eax  #, D.24397

address in rax (i.e. dev_priv-mmio_map-handle) is broken, at least it seems so
from the part of the trace and RIP.

movl%eax, 408(%rbx) # D.24397, variable.savePIPEACONF
movq24(%rdi), %rax  # variable.handle, temp.676
movl393244(%rax), %eax  #, D.24399

in
pci_save_state(dev-pdev);
pci_read_config_byte(dev-pdev, LBB, dev_priv-saveLBB);

/* Pipe  plane A info */
-- dev_priv-savePIPEACONF = I915_READ(PIPEACONF);

I use distro pm-utils and it chvt's to some terminal, write out the output,
suspend, resume, switch back to X.

The patch I'm currently using for debugging:
Index: BH/drivers/char/drm/i915_drv.c
===
--- BH.orig/drivers/char/drm/i915_drv.c
+++ BH/drivers/char/drm/i915_drv.c
@@ -274,9 +274,18 @@ static int i915_suspend(struct drm_devic
return -ENODEV;
}

+   if (!dev_priv-mmio_map || !dev_priv-mmio_map-handle) {
+   printk(KERN_ERR BAD BAD BAD %p %p\n, dev_priv-mmio_map,
+   dev_priv-mmio_map ? dev_priv-mmio_map-handle : NULL);
+   return -EIO;
+   }
+
pci_save_state(dev-pdev);
pci_read_config_byte(dev-pdev, LBB, dev_priv-saveLBB);

+   printk(KERN_ERR \n\n\nmap %p, HANDLE: %p\n\n\n, dev_priv-mmio_map,
+   dev_priv-mmio_map-handle);
+   msleep(5000);
/* Pipe  plane A info */
dev_priv-savePIPEACONF = I915_READ(PIPEACONF);
dev_priv-savePIPEASRC = I915_READ(PIPEASRC);
Index: BH/drivers/char/drm/drm_bufs.c
===
--- BH.orig/drivers/char/drm/drm_bufs.c
+++ BH/drivers/char/drm/drm_bufs.c
@@ -136,6 +136,7 @@ static int drm_addmap_core(struct drm_de
return -EINVAL;
}
map-mtrr = -1;
+   printk(BLE %s a: map %p, handle %p\n, __func__, map, map-handle);
map-handle = NULL;

switch (map-type) {
@@ -183,6 +184,7 @@ static int drm_addmap_core(struct drm_de
drm_free(map, sizeof(*map), DRM_MEM_MAPS);
return -ENOMEM;
}
+   printk(BLE %s b: map %p, handle %p\n, __func__, map, map-handle);
}

break;
@@ -201,6 +203,7 @@ static int drm_addmap_core(struct drm_de
return 0;
}
map-handle = vmalloc_user(map-size);
+   printk(BLE %s c: map %p, handle %p\n, __func__, map, map-handle);
DRM_DEBUG(%lu %d %p\n,
  map-size, drm_order(map-size), map-handle);
if (!map-handle) {
@@ -211,6 +214,7 @@ static int drm_addmap_core(struct drm_de
if (map-flags  _DRM_CONTAINS_LOCK) {
/* Prevent a 2nd X Server from creating a 2nd lock */
if (dev-lock.hw_lock != NULL) {
+   printk(BLE %s d: map %p, handle %p\n, __func__, map, map-handle);
vfree(map-handle);
drm_free(map, sizeof(*map), DRM_MEM_MAPS);
return -EBUSY;
@@ -281,6 +285,7 @@ static int drm_addmap_core(struct drm_de
return -ENOMEM;
}
map-handle = dmah-vaddr;
+   printk(BLE %s f: map %p, handle %p\n, __func__, map, map-handle);
map-offset = (unsigned long)dmah-busaddr;
kfree(dmah);
break;
@@ -291,6 +296,7 @@ static int drm_addmap_core(struct drm_de

list = drm_alloc(sizeof(*list), DRM_MEM_MAPS);
if (!list) {
+   printk(BLE %s g: map %p, handle %p\n, __func__, map, map-handle);
if (map-type == _DRM_REGISTERS)
iounmap(map-handle);
drm_free(map, sizeof(*map), DRM_MEM_MAPS);
@@ -308,6 +314,7 @@ static int drm_addmap_core(struct drm_de
map-offset;
ret = drm_map_handle(dev, list-hash, user_token, 0);
if (ret) {
+   printk(BLE %s h: map %p, handle %p\n, __func__, map, map-handle);
if (map-type == _DRM_REGISTERS)
iounmap(map-handle);
drm_free(map, sizeof(*map), DRM_MEM_MAPS);
@@ -355,6 +362,7 @@ int drm_addmap_ioctl(struct drm_device *
return err;

/* avoid a warning on 64-bit, this casting isn't very nice, but the API
is set so