From: Daniel Vetter <daniel@ffwll.ch>
To: Ben Widawsky <benjamin.widawsky@intel.com>
Cc: Ben Widawsky <ben@bwidawsk.net>,
Intel GFX <intel-gfx@lists.freedesktop.org>,
DRI Development <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH] [v2] drm/cache: Use wbinvd helpers
Date: Tue, 16 Dec 2014 08:56:31 +0100 [thread overview]
Message-ID: <20141216075631.GJ2711@phenom.ffwll.local> (raw)
In-Reply-To: <1418675206-17499-1-git-send-email-benjamin.widawsky@intel.com>
On Mon, Dec 15, 2014 at 12:26:46PM -0800, Ben Widawsky wrote:
> From: Ben Widawsky <ben@bwidawsk.net>
>
> When the original drm code was written there were no centralized functions for
> doing a coordinated wbinvd across all CPUs. Now (since 2010) there are, so use
> them instead of rolling a new one.
>
> v2: On x86 UP systems the wbinvd_on_all_cpus() is defined as a static inline in
> smp.h. We must therefore include this file so we don't get compiler errors.
> This error was found by 0-DAY kernel test infrastructure. We only need this for
> x86.
Oh dear UP ;-) Thanks for the quick updated, new patch merged to dinq.
-Daniel
>
> Cc: Intel GFX <intel-gfx@lists.freedesktop.org>
> Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> (v1)
> ---
> drivers/gpu/drm/drm_cache.c | 13 ++++---------
> 1 file changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_cache.c b/drivers/gpu/drm/drm_cache.c
> index a6b6906..9a62d7a 100644
> --- a/drivers/gpu/drm/drm_cache.c
> +++ b/drivers/gpu/drm/drm_cache.c
> @@ -32,6 +32,7 @@
> #include <drm/drmP.h>
>
> #if defined(CONFIG_X86)
> +#include <asm/smp.h>
>
> /*
> * clflushopt is an unordered instruction which needs fencing with mfence or
> @@ -64,12 +65,6 @@ static void drm_cache_flush_clflush(struct page *pages[],
> drm_clflush_page(*pages++);
> mb();
> }
> -
> -static void
> -drm_clflush_ipi_handler(void *null)
> -{
> - wbinvd();
> -}
> #endif
>
> void
> @@ -82,7 +77,7 @@ drm_clflush_pages(struct page *pages[], unsigned long num_pages)
> return;
> }
>
> - if (on_each_cpu(drm_clflush_ipi_handler, NULL, 1) != 0)
> + if (wbinvd_on_all_cpus())
> printk(KERN_ERR "Timed out waiting for cache flush.\n");
>
> #elif defined(__powerpc__)
> @@ -121,7 +116,7 @@ drm_clflush_sg(struct sg_table *st)
> return;
> }
>
> - if (on_each_cpu(drm_clflush_ipi_handler, NULL, 1) != 0)
> + if (wbinvd_on_all_cpus())
> printk(KERN_ERR "Timed out waiting for cache flush.\n");
> #else
> printk(KERN_ERR "Architecture has no drm_cache.c support\n");
> @@ -144,7 +139,7 @@ drm_clflush_virt_range(void *addr, unsigned long length)
> return;
> }
>
> - if (on_each_cpu(drm_clflush_ipi_handler, NULL, 1) != 0)
> + if (wbinvd_on_all_cpus())
> printk(KERN_ERR "Timed out waiting for cache flush.\n");
> #else
> printk(KERN_ERR "Architecture has no drm_cache.c support\n");
> --
> 2.1.3
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2014-12-16 7:55 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1418526504-26316-1-git-send-email-benjamin.widawsky@intel.com>
2014-12-14 3:08 ` [PATCH 1/4] drm/cache: Use wbinvd helpers Ben Widawsky
2014-12-14 12:43 ` Chris Wilson
2014-12-15 7:49 ` Daniel Vetter
2014-12-15 20:26 ` [PATCH] [v2] " Ben Widawsky
2014-12-16 2:26 ` shuang.he
2014-12-16 7:56 ` Daniel Vetter [this message]
2014-12-14 3:08 ` [PATCH 2/4] drm/cache: Try to be smarter about clflushing on x86 Ben Widawsky
2014-12-14 4:15 ` Matt Turner
2014-12-15 22:07 ` Ben Widawsky
2014-12-14 12:59 ` [Intel-gfx] " Chris Wilson
2014-12-15 4:06 ` Jesse Barnes
2014-12-15 19:54 ` Ben Widawsky
2014-12-14 3:08 ` [PATCH 3/4] drm/cache: Return what type of cache flush occurred Ben Widawsky
2014-12-14 3:08 ` [PATCH 4/4] drm/i915: Opportunistically reduce flushing at execbuf Ben Widawsky
2014-12-14 9:35 ` shuang.he
2014-12-14 13:12 ` [Intel-gfx] " Ville Syrjälä
2014-12-14 23:37 ` Ben Widawsky
2014-12-15 7:55 ` [Intel-gfx] " Daniel Vetter
2014-12-15 8:20 ` Chris Wilson
2014-12-15 19:56 ` Ben Widawsky
2014-12-15 20:39 ` Chris Wilson
2014-12-15 21:06 ` [Intel-gfx] " Ben Widawsky
2014-12-16 7:57 ` Chris Wilson
2014-12-16 19:38 ` Ben Widawsky
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=20141216075631.GJ2711@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=ben@bwidawsk.net \
--cc=benjamin.widawsky@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.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