linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Dave.Martin@arm.com (Dave Martin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] squash! arm64: neon: Allow EFI runtime services to use FPSIMD in irq context
Date: Fri, 28 Jul 2017 15:02:09 +0100	[thread overview]
Message-ID: <1501250529-23303-1-git-send-email-Dave.Martin@arm.com> (raw)
In-Reply-To: <1501249824-18913-6-git-send-email-Dave.Martin@arm.com>

Fix misleading usage of efi_fpsimd_state_used.

Currently it's used to mean "efi_fpsimd_state not used", which is
confusing to say the least.  This patch inverts the sense of usage.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
---
 arch/arm64/kernel/fpsimd.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
index 601063c..138fcfa 100644
--- a/arch/arm64/kernel/fpsimd.c
+++ b/arch/arm64/kernel/fpsimd.c
@@ -347,11 +347,12 @@ void __efi_fpsimd_begin(void)
 
 	WARN_ON(preemptible());
 
-	if (may_use_simd()) {
+	if (may_use_simd())
 		kernel_neon_begin();
-		__this_cpu_write(efi_fpsimd_state_used, true);
-	} else
+	else {
 		fpsimd_save_state(this_cpu_ptr(&efi_fpsimd_state));
+		__this_cpu_write(efi_fpsimd_state_used, true);
+	}
 }
 
 /*
@@ -363,9 +364,9 @@ void __efi_fpsimd_end(void)
 		return;
 
 	if (__this_cpu_xchg(efi_fpsimd_state_used, false))
-		kernel_neon_end();
-	else
 		fpsimd_load_state(this_cpu_ptr(&efi_fpsimd_state));
+	else
+		kernel_neon_end();
 }
 
 #endif /* CONFIG_KERNEL_MODE_NEON */
-- 
2.1.4

  reply	other threads:[~2017-07-28 14:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-28 13:50 [RFC PATCH v4 0/5] Simplify kernel-mode NEON Dave Martin
2017-07-28 13:50 ` [RFC PATCH v4 1/5] arm64: neon: replace generic definition of may_use_simd() Dave Martin
2017-07-28 13:50 ` [RFC PATCH v4 2/5] arm64: neon: Add missing header guard in <asm/neon.h> Dave Martin
2017-07-28 13:50 ` [RFC PATCH v4 3/5] arm64: fpsimd: Consistently use __this_cpu_ ops where appropriate Dave Martin
2017-07-28 13:50 ` [RFC PATCH v4 4/5] arm64: neon: Remove support for nested or hardirq kernel-mode NEON Dave Martin
2017-08-02 10:02   ` Catalin Marinas
2017-08-02 13:00     ` Dave Martin
2017-08-02 14:31       ` Catalin Marinas
2017-07-28 13:50 ` [RFC PATCH v4 5/5] arm64: neon: Allow EFI runtime services to use FPSIMD in irq context Dave Martin
2017-07-28 14:02   ` Dave Martin [this message]
2017-08-02 14:58   ` Catalin Marinas
2017-08-02 15:15     ` Dave Martin
2017-08-02 16:02       ` Catalin Marinas
2017-08-02 16:19         ` Dave Martin
2017-08-01 12:15 ` [RFC PATCH v4 0/5] Simplify kernel-mode NEON Ard Biesheuvel

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=1501250529-23303-1-git-send-email-Dave.Martin@arm.com \
    --to=dave.martin@arm.com \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).