linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] drm/i915: Avoid using simd from interrupt context
       [not found] <20200503203108.15420-1-chris@chris-wilson.co.uk>
@ 2020-05-03 20:37 ` Jason A. Donenfeld
  0 siblings, 0 replies; only message in thread
From: Jason A. Donenfeld @ 2020-05-03 20:37 UTC (permalink / raw)
  To: Chris Wilson
  Cc: intel-gfx, LKML, stable, Sebastian Andrzej Siewior, David Laight,
	Christoph Hellwig

On Sun, May 3, 2020 at 2:31 PM Chris Wilson <chris@chris-wilson.co.uk> wrote:
>
> Query whether or not we are in a legal context for using SIMD, before
> using SSE4.2 registers.
>
> Suggested-by: Jason A. Donenfeld <Jason@zx2c4.com>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/i915_memcpy.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_memcpy.c b/drivers/gpu/drm/i915/i915_memcpy.c
> index 7b3b83bd5ab8..fc18d6c28d5f 100644
> --- a/drivers/gpu/drm/i915/i915_memcpy.c
> +++ b/drivers/gpu/drm/i915/i915_memcpy.c
> @@ -24,6 +24,7 @@
>
>  #include <linux/kernel.h>
>  #include <asm/fpu/api.h>
> +#include <asm/simd.h>
>
>  #include "i915_memcpy.h"
>
> @@ -115,6 +116,9 @@ bool i915_memcpy_from_wc(void *dst, const void *src, unsigned long len)
>         if (unlikely(((unsigned long)dst | (unsigned long)src | len) & 15))
>                 return false;
>
> +       if (unlikely(!may_use_simd()))
> +               return false;
> +
>         if (static_branch_likely(&has_movntdqa)) {
>                 if (likely(len))
>                         __memcpy_ntdqa(dst, src, len >> 4);
> --
> 2.20.1

Looks like you beat me to the punch. Thanks for doing this.

Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-03 20:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200503203108.15420-1-chris@chris-wilson.co.uk>
2020-05-03 20:37 ` [PATCH] drm/i915: Avoid using simd from interrupt context Jason A. Donenfeld

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).