All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@gmail.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Andi Kleen <andi@firstfloor.org>, Jiri Kosina <jkosina@suse.cz>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jiri Slaby <jirislaby@gmail.com>, David Airlie <airlied@linux.ie>,
	"Rafael J. Wysocki" <rjw@sisk.pl>
Subject: [PATCH 1/1 v2] DRM: fix radeon suspend/resume oops
Date: Thu, 13 Nov 2008 23:09:56 +0100	[thread overview]
Message-ID: <1226614196-17019-1-git-send-email-jirislaby@gmail.com> (raw)
In-Reply-To: <491CA495.7010007@gmail.com>

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


  reply	other threads:[~2008-11-13 22:10 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-11  0:31 USB hid blocks USB port in 2.6.28rc3 Andi Kleen
2008-11-11  0:45 ` Alan Stern
2008-11-11  8:41   ` Andi Kleen
2008-11-11 17:02     ` Alan Stern
2008-11-11 21:07       ` Andi Kleen
     [not found]         ` <20081111210705.GG3810-qrUzlfsMFqo/4alezvVtWx2eb7JE58TQ@public.gmane.org>
2008-11-12 14:53           ` Alan Stern
2008-11-15 23:58         ` Rafael J. Wysocki
2008-11-15 23:54           ` Jiri Kosina
2008-11-16 12:35             ` Rafael J. Wysocki
     [not found]             ` <alpine.LNX.1.10.0811160053580.19853-YCXOAqNspd+N3ZZ/Hiejyg@public.gmane.org>
2008-11-16 22:12               ` Andi Kleen
     [not found] ` <20081111003117.GA10904-3rXA9MLqAseW/qJFnhkgxti2O/JbrIOy@public.gmane.org>
2008-11-12 14:31   ` Jiri Kosina
     [not found]     ` <alpine.LNX.1.10.0811121529240.32143-YCXOAqNspd+N3ZZ/Hiejyg@public.gmane.org>
2008-11-13 11:32       ` Andi Kleen
2008-11-13 12:30         ` Jiri Slaby
     [not found]           ` <491C1DFF.6000509-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2008-11-13 14:31             ` Andi Kleen
2008-11-13 15:54               ` Alan Stern
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 21:37                     ` Alan Stern
2008-11-13 22:05                     ` Jiri Slaby
2008-11-13 22:09                       ` Jiri Slaby [this message]
2008-11-13 22:11                         ` [PATCH 1/1 v2] DRM: fix radeon suspend/resume oops 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
  -- strict thread matches above, loose matches on Subject: below --
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1226614196-17019-1-git-send-email-jirislaby@gmail.com \
    --to=jirislaby@gmail.com \
    --cc=airlied@linux.ie \
    --cc=andi@firstfloor.org \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.