public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] DRM: fix radeon suspend/resume oops
@ 2008-11-09 21:55 Jiri Slaby
  2008-11-09 22:01 ` [PATCH 1/1 v2] " Jiri Slaby
  0 siblings, 1 reply; 12+ messages in thread
From: Jiri Slaby @ 2008-11-09 21:55 UTC (permalink / raw)
  To: akpm; +Cc: dri-devel, linux-kernel, Jiri Slaby, David Airlie

Hi,

I've sent a bugreport twice with no reply, so coming with a patch.
Andrew please apply, if no comments or a better patch from drm
fellows comes.

As the accesses to the mmio member are not protected by anything, they
seem to be racy with the open/clsoe anyways, setting this down there
too.

--
When the driver is bound to a device and nobody opens the device node,
it will oops on suspend and resume, since it's not mapped and
dev_priv->mmio is NULL.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: David Airlie <airlied@linux.ie>
---
 drivers/gpu/drm/radeon/radeon_drv.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index 71af746..2e74a98 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -52,10 +52,14 @@ static int dri_library_name(struct drm_device *dev, char *buf)
 		        "r300"));
 }
 
+/* FIXME all this suspend/resume races with open/close? */
 static int radeon_suspend(struct drm_device *dev, pm_message_t state)
 {
 	drm_radeon_private_t *dev_priv = dev->dev_private;
 
+	if (!dev_priv->mmio)
+		return 0;
+
 	/* Disable *all* interrupts */
 	if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RS690)
 		RADEON_WRITE(R500_DxMODE_INT_MASK, 0);
@@ -67,6 +71,9 @@ static int radeon_resume(struct drm_device *dev)
 {
 	drm_radeon_private_t *dev_priv = dev->dev_private;
 
+	if (!dev_priv->mmio)
+		return 0;
+
 	/* Restore interrupt registers */
 	if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RS690)
 		RADEON_WRITE(R500_DxMODE_INT_MASK, dev_priv->r500_disp_irq_reg);
-- 
1.6.0.3


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2008-11-14 13:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <Pine.LNX.4.44L0.0811131040160.2380-100000@iolanthe.rowland.org>
2008-11-13 21:10 ` [PATCH] HID: don't grab devices with no input Jiri Slaby
2008-11-13 21:37   ` Alan Stern
2008-11-13 22:05     ` Jiri Slaby
2008-11-13 22:09       ` [PATCH 1/1 v2] DRM: fix radeon suspend/resume oops Jiri Slaby
2008-11-13 22:11         ` Jiri Slaby
2008-11-13 22:10       ` [PATCH 1/1 v2] HID: don't grab devices with no input Jiri Slaby
2008-11-14 11:02         ` Jiri Kosina
2008-11-14 13:17           ` Andi Kleen
2008-11-14 13:09             ` Jiri Kosina
2008-11-13 22:22       ` [PATCH] " Andi Kleen
2008-11-13 22:14         ` Jiri Slaby
2008-11-09 21:55 [PATCH 1/1] DRM: fix radeon suspend/resume oops Jiri Slaby
2008-11-09 22:01 ` [PATCH 1/1 v2] " Jiri Slaby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox