All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Free hardware status page on unload when physically mapped
@ 2010-10-07  4:24 Keith Packard
  2010-10-07  5:43 ` Dave Airlie
  0 siblings, 1 reply; 3+ messages in thread
From: Keith Packard @ 2010-10-07  4:24 UTC (permalink / raw)
  To: intel-gfx; +Cc: dri-devel

A physically mapped hardware status page is allocated at driver load
time but was never freed. Call the existing code to free this page at
driver unload time on hardware which uses this kind.

Signed-off-by: Keith Packard <keithp@keithp.com>
---
 drivers/gpu/drm/i915/i915_dma.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 9d67b48..98bf1f0 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -2305,6 +2305,9 @@ int i915_driver_unload(struct drm_device *dev)
 		intel_cleanup_overlay(dev);
 	}
 
+	if (!I915_NEED_GFX_HWS(dev))
+		i915_free_hws(dev);
+
 	intel_teardown_mchbar(dev);
 
 	pci_dev_put(dev_priv->bridge_dev);
-- 
1.7.1

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

* Re: [PATCH] drm/i915: Free hardware status page on unload when physically mapped
  2010-10-07  4:24 [PATCH] drm/i915: Free hardware status page on unload when physically mapped Keith Packard
@ 2010-10-07  5:43 ` Dave Airlie
  2010-10-07  8:19   ` Chris Wilson
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Airlie @ 2010-10-07  5:43 UTC (permalink / raw)
  To: Keith Packard; +Cc: intel-gfx, dri-devel

On Wed, 2010-10-06 at 21:24 -0700, Keith Packard wrote:
> A physically mapped hardware status page is allocated at driver load
> time but was never freed. Call the existing code to free this page at
> driver unload time on hardware which uses this kind.

the free_hws gets called after we disappear the mmio mapping for the
registers. it then writes a register after killing the hws, and oopses.

Dave.

> 
> Signed-off-by: Keith Packard <keithp@keithp.com>
> ---
>  drivers/gpu/drm/i915/i915_dma.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> index 9d67b48..98bf1f0 100644
> --- a/drivers/gpu/drm/i915/i915_dma.c
> +++ b/drivers/gpu/drm/i915/i915_dma.c
> @@ -2305,6 +2305,9 @@ int i915_driver_unload(struct drm_device *dev)
>  		intel_cleanup_overlay(dev);
>  	}
>  
> +	if (!I915_NEED_GFX_HWS(dev))
> +		i915_free_hws(dev);
> +
>  	intel_teardown_mchbar(dev);
>  
>  	pci_dev_put(dev_priv->bridge_dev);

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

* Re: [PATCH] drm/i915: Free hardware status page on unload when physically mapped
  2010-10-07  5:43 ` Dave Airlie
@ 2010-10-07  8:19   ` Chris Wilson
  0 siblings, 0 replies; 3+ messages in thread
From: Chris Wilson @ 2010-10-07  8:19 UTC (permalink / raw)
  To: Dave Airlie, Keith Packard; +Cc: intel-gfx, dri-devel

On Thu, 07 Oct 2010 15:43:43 +1000, Dave Airlie <airlied@redhat.com> wrote:
> On Wed, 2010-10-06 at 21:24 -0700, Keith Packard wrote:
> > A physically mapped hardware status page is allocated at driver load
> > time but was never freed. Call the existing code to free this page at
> > driver unload time on hardware which uses this kind.
> 
> the free_hws gets called after we disappear the mmio mapping for the
> registers. it then writes a register after killing the hws, and oopses.

Right, freeing the hws page is a definite oversight. It looks like we
should only be doing so on the KMS-only path anyway which neatly pulls the
call before the mmio teardown.

Applied with the amendment to -next.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

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

end of thread, other threads:[~2010-10-07  8:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-07  4:24 [PATCH] drm/i915: Free hardware status page on unload when physically mapped Keith Packard
2010-10-07  5:43 ` Dave Airlie
2010-10-07  8:19   ` Chris Wilson

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.