All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Jaswinder Singh Rajput <jaswinderlinux@gmail.com>,
	dri-devel@lists.freedesktop.org, Dave Airlie <airlied@linux.ie>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: DRM Error on Acer Aspire One
Date: Tue, 11 May 2010 19:19:26 +0100	[thread overview]
Message-ID: <89khjo$fd26d3@orsmga002.jf.intel.com> (raw)
In-Reply-To: <20100511104818.8382a7de.akpm@linux-foundation.org>

On Tue, 11 May 2010 10:48:18 -0400, Andrew Morton <akpm@linux-foundation.org> wrote:
> 
> On Tue, 11 May 2010 17:10:53 +0100 Chris Wilson <chris@chris-wilson.co.uk> wrote:
> 
> > On Tue, 11 May 2010 20:30:07 +0530, Jaswinder Singh Rajput <jaswinderlinux@gmail.com> wrote:
> > > Hello,
> > > 
> > > With latest git kernel, I am getting following DRM error and not
> > > getting XWindows :
> > 
> > [snip]
> > 
> > Hmm, there are still patches for capturing error state that haven't gone
> > upstream, shame on me.
> > 
> > That error is a secondary issue to the GPU hang that is being reported. If
> > it is a regression caused by a kernel update it would be very useful if
> > you could bisect to the erroneous commit.
> 
> It helps if one reads the code and the trace...
> 
> i915_error_object_create() is using KM_USER0 from softirq context. 
> That's a bug, and a pretty serious one.  If some innocent civilian is
> writing highmem data to disk and this timer interrupt fires and trashes
> his KM_USER0 slot, the disk contents will be corrupted.
> 
> Something like this...
> 
> --- a/drivers/gpu/drm/i915/i915_irq.c~a
> +++ a/drivers/gpu/drm/i915/i915_irq.c
> @@ -456,11 +456,15 @@ i915_error_object_create(struct drm_devi
>  
>  	for (page = 0; page < page_count; page++) {
>  		void *s, *d = kmalloc(PAGE_SIZE, GFP_ATOMIC);
> +		unsigned long flags;
> +
>  		if (d == NULL)
>  			goto unwind;
> -		s = kmap_atomic(src_priv->pages[page], KM_USER0);
> +		local_irq_save(flags);
> +		s = kmap_atomic(src_priv->pages[page], KM_IRQ0);
>  		memcpy(d, s, PAGE_SIZE);
> -		kunmap_atomic(s, KM_USER0);
> +		kunmap_atomic(s, KM_IRQ0);
> +		local_irq_restore(flags);
>  		dst->pages[page] = d;
>  	}
>  	dst->page_count = page_count;
> _
> 
> Please let's get a tested fix for this into 2.6.34.

The change that I actually want is to replace the kmap_atomic(cpu_page) with an
io_mapping_map_atomic_wc(gtt_page), in case there is a incoherency between
the CPU and the GPU, we want to record what the GPU executed. Do you know
how if similar precautions are required with io_mapping_map_atomic_wc()?

-- 
Chris Wilson, Intel Open Source Technology Centre

WARNING: multiple messages have this Message-ID (diff)
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: dri-devel@lists.freedesktop.org,
	Jaswinder Singh Rajput <jaswinderlinux@gmail.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: DRM Error on Acer Aspire One
Date: Tue, 11 May 2010 19:19:26 +0100	[thread overview]
Message-ID: <89khjo$fd26d3@orsmga002.jf.intel.com> (raw)
In-Reply-To: <20100511104818.8382a7de.akpm@linux-foundation.org>

On Tue, 11 May 2010 10:48:18 -0400, Andrew Morton <akpm@linux-foundation.org> wrote:
> 
> On Tue, 11 May 2010 17:10:53 +0100 Chris Wilson <chris@chris-wilson.co.uk> wrote:
> 
> > On Tue, 11 May 2010 20:30:07 +0530, Jaswinder Singh Rajput <jaswinderlinux@gmail.com> wrote:
> > > Hello,
> > > 
> > > With latest git kernel, I am getting following DRM error and not
> > > getting XWindows :
> > 
> > [snip]
> > 
> > Hmm, there are still patches for capturing error state that haven't gone
> > upstream, shame on me.
> > 
> > That error is a secondary issue to the GPU hang that is being reported. If
> > it is a regression caused by a kernel update it would be very useful if
> > you could bisect to the erroneous commit.
> 
> It helps if one reads the code and the trace...
> 
> i915_error_object_create() is using KM_USER0 from softirq context. 
> That's a bug, and a pretty serious one.  If some innocent civilian is
> writing highmem data to disk and this timer interrupt fires and trashes
> his KM_USER0 slot, the disk contents will be corrupted.
> 
> Something like this...
> 
> --- a/drivers/gpu/drm/i915/i915_irq.c~a
> +++ a/drivers/gpu/drm/i915/i915_irq.c
> @@ -456,11 +456,15 @@ i915_error_object_create(struct drm_devi
>  
>  	for (page = 0; page < page_count; page++) {
>  		void *s, *d = kmalloc(PAGE_SIZE, GFP_ATOMIC);
> +		unsigned long flags;
> +
>  		if (d == NULL)
>  			goto unwind;
> -		s = kmap_atomic(src_priv->pages[page], KM_USER0);
> +		local_irq_save(flags);
> +		s = kmap_atomic(src_priv->pages[page], KM_IRQ0);
>  		memcpy(d, s, PAGE_SIZE);
> -		kunmap_atomic(s, KM_USER0);
> +		kunmap_atomic(s, KM_IRQ0);
> +		local_irq_restore(flags);
>  		dst->pages[page] = d;
>  	}
>  	dst->page_count = page_count;
> _
> 
> Please let's get a tested fix for this into 2.6.34.

The change that I actually want is to replace the kmap_atomic(cpu_page) with an
io_mapping_map_atomic_wc(gtt_page), in case there is a incoherency between
the CPU and the GPU, we want to record what the GPU executed. Do you know
how if similar precautions are required with io_mapping_map_atomic_wc()?

-- 
Chris Wilson, Intel Open Source Technology Centre

  parent reply	other threads:[~2010-05-11 18:19 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-11 15:00 DRM Error on Acer Aspire One Jaswinder Singh Rajput
2010-05-11 16:10 ` Chris Wilson
2010-05-11 16:10 ` Chris Wilson
2010-05-11 14:48   ` Andrew Morton
2010-05-11 14:48     ` Andrew Morton
2010-05-11 18:18     ` Jaswinder Singh Rajput
2010-05-11 18:18     ` Jaswinder Singh Rajput
2010-05-11 18:19     ` Chris Wilson [this message]
2010-05-11 18:19       ` Chris Wilson
2010-05-11 15:35       ` Andrew Morton
2010-05-11 15:35       ` Andrew Morton
2010-05-11 18:52         ` Chris Wilson
2010-05-11 19:10           ` Andrew Morton
2010-05-11 19:10             ` Andrew Morton
2010-05-11 19:57             ` Chris Wilson
2010-05-11 19:57               ` Chris Wilson
2010-05-11 22:22               ` Dave Airlie
2010-05-11 22:22               ` Dave Airlie
2010-05-11 22:32                 ` Andrew Morton
2010-05-11 22:51                   ` Dave Airlie
2010-05-11 22:51                     ` Dave Airlie
2010-05-11 22:56                     ` Andrew Morton
2010-05-11 23:17                       ` Dave Airlie
2010-05-11 23:24                         ` Andrew Morton
2010-05-11 23:24                         ` Andrew Morton
2010-05-11 23:17                       ` Dave Airlie
2010-05-11 22:56                     ` Andrew Morton
2010-05-11 22:32                 ` Andrew Morton
2010-05-11 22:40                 ` Chris Wilson
2010-05-11 22:40                   ` Chris Wilson
2010-05-11 18:52         ` Chris Wilson
2010-05-11 17:39   ` Jaswinder Singh Rajput
2010-05-11 17:39   ` Jaswinder Singh Rajput
  -- strict thread matches above, loose matches on Subject: below --
2010-05-11 15:00 Jaswinder Singh Rajput

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='89khjo$fd26d3@orsmga002.jf.intel.com' \
    --to=chris@chris-wilson.co.uk \
    --cc=airlied@linux.ie \
    --cc=akpm@linux-foundation.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jaswinderlinux@gmail.com \
    --cc=linux-kernel@vger.kernel.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 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.