public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Dave Airlie <airlied@linux.ie>
Cc: torvalds@linux-foundation.org, dri-devel@lists.sf.net,
	linux-kernel@vger.kernel.org
Subject: Re: [git pull] drm fixes for 2.6.27-rc5
Date: Tue, 11 Nov 2008 00:29:58 -0800	[thread overview]
Message-ID: <20081111002958.7620fb56.akpm@linux-foundation.org> (raw)
In-Reply-To: <alpine.DEB.0.82.0811110811350.2182@skynet.skynet.ie>

On Tue, 11 Nov 2008 08:15:26 +0000 (GMT) Dave Airlie <airlied@linux.ie> wrote:

> commit 78538bf14995a136c2d9a22159ada49937359119
> Author: Dave Airlie <airlied@linux.ie>
> Date:   Tue Nov 11 17:56:16 2008 +1000
> 
>     drm/radeon: map registers at load time
>     
>     Now that the radeon driver has suspend/resume functions, it needs to map its
>     registers at load time or it will likely crash if a suspend operation occurs
>     before the driver has been initialized.
>     
>     This patch moves the register mapping code from firstopen to load and makes
>     the mapping into a _DRM_DRIVER one so that the core won't remove it at
>     lastclose time.

Does this make the below patch obsolete?

>     Fixes (at least partially) kernel bz #11891.

A little thing: there are (or used to be) people who troll commits for
bugzilla reports to close off.  I've adopted the convention of
indicating bugzilla reports via their full URL to make those efforts
easier and to increase their accuracy.



From: Jiri Slaby <jirislaby@gmail.com>

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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/gpu/drm/radeon/radeon_drv.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff -puN drivers/gpu/drm/radeon/radeon_drv.c~drm-fix-radeon-suspend-resume-oops drivers/gpu/drm/radeon/radeon_drv.c
--- a/drivers/gpu/drm/radeon/radeon_drv.c~drm-fix-radeon-suspend-resume-oops
+++ a/drivers/gpu/drm/radeon/radeon_drv.c
@@ -56,6 +56,9 @@ static int radeon_suspend(struct drm_dev
 {
 	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_devi
 {
 	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);
_


  reply	other threads:[~2008-11-11  8:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-11  8:15 [git pull] drm fixes for 2.6.27-rc5 Dave Airlie
2008-11-11  8:29 ` Andrew Morton [this message]
2008-11-11  8:37   ` Dave Airlie
2008-11-11 18:13     ` Jesse Barnes

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=20081111002958.7620fb56.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.sf.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox