Skip to contentSkip to conversation

drm: omapdrm: Fix oops on rmmod

PATCH In review Tony Lindgren 2 participants 2 messages Mar 23, 2017 – Mar 24, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: omapdrm: Fix oops on rmmod

Looks like in Linux next we can now get an oops when unloading omapdrm:

Unable to handle kernel NULL pointer dereference at virtual address

00000000
...
LR is at omap_drm_irq_uninstall+0xb0/0xe0 [omapdrm]
...
[<bf6806a8>] (omap_drm_irq_uninstall [omapdrm]) from [<bf67f260>] (pdev_remove+0x50/0x88 [omapdrm])
[<bf67f260>] (pdev_remove [omapdrm]) from [<c058fa28>] (platform_drv_remove+0x24/0x3c)
[<c058fa28>] (platform_drv_remove) from [<c058ddb8>] (device_release_driver_internal+0x160/0x1f4) [<c058ddb8>] (device_release_driver_internal) from [<c058de90>] (driver_detach+0x38/0x6c)
[<c058de90>] (driver_detach) from [<c058d0b8>] (bus_remove_driver+0x4c/0xa0)
[<c058d0b8>] (bus_remove_driver) from [<c058fb1c>] (platform_unregister_drivers+0x24/0x30)
[<c058fb1c>] (platform_unregister_drivers) from [<c01e26e8>] (SyS_delete_module+0x150/0x218)
[<c01e26e8>] (SyS_delete_module) from [<c01077a0>] (ret_fast_syscall+0x0/0x1c)

Fix the issue by checking get_vblank_counter() before trying to call it.

---
 drivers/gpu/drm/omapdrm/omap_irq.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/omapdrm/omap_irq.c +3 -2
@@ -303,8 +303,9 @@ void omap_drm_irq_uninstall(struct drm_device *dev)
 		for (i = 0; i < dev->num_crtcs; i++) {
 			wake_up(&dev->vblank[i].queue);
 			dev->vblank[i].enabled = false;
-			dev->vblank[i].last =
-				dev->driver->get_vblank_counter(dev, i);
+			if (dev->driver->get_vblank_counter)
+				dev->vblank[i].last =
+					dev->driver->get_vblank_counter(dev, i);
 		}
 		spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
 	}
Signature · 5 lines
2.11.1
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw
Quoted 24 lines · Tony Lindgren

Looks like in Linux next we can now get an oops when unloading omapdrm:

Unable to handle kernel NULL pointer dereference at virtual address

00000000
...
LR is at omap_drm_irq_uninstall+0xb0/0xe0 [omapdrm]
...
[<bf6806a8>] (omap_drm_irq_uninstall [omapdrm]) from [<bf67f260>] (pdev_remove+0x50/0x88 [omapdrm])
[<bf67f260>] (pdev_remove [omapdrm]) from [<c058fa28>] (platform_drv_remove+0x24/0x3c)
[<c058fa28>] (platform_drv_remove) from [<c058ddb8>] (device_release_driver_internal+0x160/0x1f4) [<c058ddb8>] (device_release_driver_internal) from [<c058de90>] (driver_detach+0x38/0x6c)
[<c058de90>] (driver_detach) from [<c058d0b8>] (bus_remove_driver+0x4c/0xa0)
[<c058d0b8>] (bus_remove_driver) from [<c058fb1c>] (platform_unregister_drivers+0x24/0x30)
[<c058fb1c>] (platform_unregister_drivers) from [<c01e26e8>] (SyS_delete_module+0x150/0x218)
[<c01e26e8>] (SyS_delete_module) from [<c01077a0>] (ret_fast_syscall+0x0/0x1c)

Quoted 2 lines

Fix the issue by checking get_vblank_counter() before trying to call it.

Yep, there was a change in the DRM core that broke omapdrm. I've been trying to understand how to fix this. I hope I can send a patch today.

Tomi

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel