public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* oops in radeon_suspend (mmotm 2008-10-22-17-18)
@ 2008-10-26 15:23 Jiri Slaby
  2008-11-08  9:09 ` Jiri Slaby
  2008-11-09 21:55 ` [PATCH 1/1] DRM: fix radeon suspend/resume oops Jiri Slaby
  0 siblings, 2 replies; 5+ messages in thread
From: Jiri Slaby @ 2008-10-26 15:23 UTC (permalink / raw)
  To: Gareth Hughes
  Cc: Dave Airlie, dri-devel, Andrew Morton, Linux Kernel Mailing List,
	Jesse Barnes, Eric Anholt, Michel Dänzer

Hi,

this oops occured on suspend of mmotm:
http://decibel.fi.muni.cz/~xslaby/radeon_oops1.png
http://decibel.fi.muni.cz/~xslaby/radeon_oops2.png

radeon_suspend:
movq    288(%rcx), %rax # <variable>.mmio, <variable>.mmio
xorl    %edx, %edx      # tmp68
movq    24(%rax), %rax  # <variable>.handle, <variable>.handle

rax (dev_priv->mmio) is null.

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

* Re: oops in radeon_suspend (mmotm 2008-10-22-17-18)
  2008-10-26 15:23 oops in radeon_suspend (mmotm 2008-10-22-17-18) Jiri Slaby
@ 2008-11-08  9:09 ` Jiri Slaby
  2008-11-09 21:55 ` [PATCH 1/1] DRM: fix radeon suspend/resume oops Jiri Slaby
  1 sibling, 0 replies; 5+ messages in thread
From: Jiri Slaby @ 2008-11-08  9:09 UTC (permalink / raw)
  Cc: Gareth Hughes, Dave Airlie, dri-devel, Andrew Morton,
	Linux Kernel Mailing List, Jesse Barnes, Eric Anholt,
	Michel Dänzer

Ping

On 10/26/2008 04:23 PM, Jiri Slaby wrote:
> Hi,
> 
> this oops occured on suspend of mmotm:
> http://decibel.fi.muni.cz/~xslaby/radeon_oops1.png
> http://decibel.fi.muni.cz/~xslaby/radeon_oops2.png
> 
> radeon_suspend:
> movq    288(%rcx), %rax # <variable>.mmio, <variable>.mmio
> xorl    %edx, %edx      # tmp68
> movq    24(%rax), %rax  # <variable>.handle, <variable>.handle
> 
> rax (dev_priv->mmio) is null.

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

* [PATCH 1/1] DRM: fix radeon suspend/resume oops
  2008-10-26 15:23 oops in radeon_suspend (mmotm 2008-10-22-17-18) Jiri Slaby
  2008-11-08  9:09 ` Jiri Slaby
@ 2008-11-09 21:55 ` Jiri Slaby
  2008-11-09 22:01   ` [PATCH 1/1 v2] " Jiri Slaby
  2008-11-10  0:10   ` [PATCH 1/1] " Dave Airlie
  1 sibling, 2 replies; 5+ 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] 5+ messages in thread

* [PATCH 1/1 v2] DRM: fix radeon suspend/resume oops
  2008-11-09 21:55 ` [PATCH 1/1] DRM: fix radeon suspend/resume oops Jiri Slaby
@ 2008-11-09 22:01   ` Jiri Slaby
  2008-11-10  0:10   ` [PATCH 1/1] " Dave Airlie
  1 sibling, 0 replies; 5+ messages in thread
From: Jiri Slaby @ 2008-11-09 22:01 UTC (permalink / raw)
  To: akpm; +Cc: dri-devel, linux-kernel, Jiri Slaby, David Airlie,
	Rafael J. Wysocki

me wrote:
> 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.

On the second though it should be protected. Updated patch below...

+ added Rafael to cc list

--

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>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
---
 drivers/gpu/drm/radeon/radeon_drv.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index 71af746..7672310 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -56,6 +56,9 @@ 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 +70,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] 5+ messages in thread

* Re: [PATCH 1/1] DRM: fix radeon suspend/resume oops
  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
@ 2008-11-10  0:10   ` Dave Airlie
  1 sibling, 0 replies; 5+ messages in thread
From: Dave Airlie @ 2008-11-10  0:10 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: akpm, dri-devel, linux-kernel


> 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.

We got a patch last week from Jesse Barnes to fix this, I'll pull it and 
send it to Linus, I was waiting for some other fixes first.

Dave.

> 
> --
> 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);
> 

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

end of thread, other threads:[~2008-11-10  0:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-26 15:23 oops in radeon_suspend (mmotm 2008-10-22-17-18) Jiri Slaby
2008-11-08  9:09 ` 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
2008-11-10  0:10   ` [PATCH 1/1] " Dave Airlie

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