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