From: cjk@cs.unc.edu (Christopher Kenna)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] Add forgotten mask in cache way unlock for PL310.
Date: Wed, 10 Oct 2012 17:56:43 -0400 [thread overview]
Message-ID: <1349906203-7839-1-git-send-email-cjk@cs.unc.edu> (raw)
The part number should be masked out of the cache ID when detecting if
the cache controller is a PL310. Since this is done elsewhere, add a
macro for brevity.
Tested on a PandaBoard ES.
Signed-off-by: Christopher Kenna <cjk@cs.unc.edu>
---
arch/arm/mm/cache-l2x0.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 8a97e64..bdf2f66 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -27,6 +27,7 @@
#include <asm/hardware/cache-l2x0.h>
#define CACHE_LINE_SIZE 32
+#define CACHE_ID_PART(id) ((id) & L2X0_CACHE_ID_PART_MASK)
static void __iomem *l2x0_base;
static DEFINE_RAW_SPINLOCK(l2x0_lock);
@@ -292,7 +293,7 @@ static void l2x0_unlock(u32 cache_id)
int lockregs;
int i;
- if (cache_id == L2X0_CACHE_ID_PART_L310)
+ if (CACHE_ID_PART(cache_id) == L2X0_CACHE_ID_PART_L310)
lockregs = 8;
else
/* L210 and unknown types */
@@ -323,7 +324,7 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask)
aux |= aux_val;
/* Determine the number of ways */
- switch (cache_id & L2X0_CACHE_ID_PART_MASK) {
+ switch (CACHE_ID_PART(cache_id)) {
case L2X0_CACHE_ID_PART_L310:
if (aux & (1 << 16))
ways = 16;
--
1.7.9.5
reply other threads:[~2012-10-10 21:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1349906203-7839-1-git-send-email-cjk@cs.unc.edu \
--to=cjk@cs.unc.edu \
--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).