Linux PARISC architecture development
 help / color / mirror / Atom feed
From: John David Anglin <dave.anglin@bell.net>
To: John David Anglin <dave@parisc-linux.org>,
	Mikulas Patocka <mpatocka@redhat.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>,
	Helge Deller <deller@gmx.de>,
	linux-parisc@vger.kernel.org
Subject: Re: ARCH_DMA_MINALIGN on PA-RISC
Date: Thu, 25 Jul 2024 16:05:08 -0400	[thread overview]
Message-ID: <ff54aa24-15be-4bca-8b9e-1b1166b0e0d9@bell.net> (raw)
In-Reply-To: <f3f59d8a-3ea4-4a21-8b0d-ba0d63ef1ff6@bell.net>

[-- Attachment #1: Type: text/plain, Size: 721 bytes --]

On 2024-07-25 3:13 p.m., John David Anglin wrote:
>> L1_CACHE_BYTES is a performance hint that is used to avoid cache line
>> ping-pong when multiple CPUs modify nearby data.
> Our L1_CACHE_BYTES define is wrong.  PA7100 has a L1 length of 16 bytes.
> PA7200 to PA7300LC have a length of 32 bytes.  PA8000 to PA8700 have a length of 64
> bytes.  PA8800 and PA8900 have a L1 length of 128 bytes (this is from ERS D_Stride).
>
The attached patch fixes the defines for L1_CACHE_SHIFT, L1_CACHE_BYTES and
ARCH_DMA_MINALIGN.  I left ARCH_DMA_MINALIGN at 16 as I believe this gives
128-byte alignment.

Testing.

Dave

-- 
John David Anglin  dave.anglin@bell.net

[-- Attachment #2: L1_CACHE_BYTES.d --]
[-- Type: text/plain, Size: 924 bytes --]

diff --git a/arch/parisc/include/asm/cache.h b/arch/parisc/include/asm/cache.h
index 2a60d7a72f1f..e9b0081546c9 100644
--- a/arch/parisc/include/asm/cache.h
+++ b/arch/parisc/include/asm/cache.h
@@ -9,18 +9,21 @@
 #include <asm/alternative.h>
 
 /*
- * PA 2.0 processors have 64 and 128-byte L2 cachelines; PA 1.1 processors
- * have 32-byte cachelines.  The L1 length appears to be 16 bytes but this
- * is not clearly documented.
+ * PA 2.0 processors have 64 and 128-byte cachelines; PA 1.1 processors
+ * have 32-byte cachelines.
  */
-#define L1_CACHE_BYTES 16
-#define L1_CACHE_SHIFT 4
+#ifdef CONFIG_PA20
+#define L1_CACHE_SHIFT 7
+#else
+#define L1_CACHE_SHIFT 5
+#endif
+#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
 
 #ifndef __ASSEMBLY__
 
 #define SMP_CACHE_BYTES L1_CACHE_BYTES
 
-#define ARCH_DMA_MINALIGN	L1_CACHE_BYTES
+#define ARCH_DMA_MINALIGN	16
 
 #define __read_mostly __section(".data..read_mostly")
 

  reply	other threads:[~2024-07-25 20:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-24 18:17 ARCH_DMA_MINALIGN on PA-RISC Mikulas Patocka
2024-07-24 18:48 ` John David Anglin
2024-07-24 19:25 ` James Bottomley
2024-07-25 16:45   ` John David Anglin
2024-07-25 17:27     ` Mikulas Patocka
2024-07-25 17:43       ` James Bottomley
2024-07-25 17:46         ` Mikulas Patocka
2024-07-25 19:19           ` James Bottomley
2024-07-25 19:13       ` John David Anglin
2024-07-25 20:05         ` John David Anglin [this message]
2024-07-25 20:36           ` Mikulas Patocka
2024-07-25 21:29             ` John David Anglin
2024-07-27 10:24               ` Mikulas Patocka
2024-07-27 15:06                 ` John David Anglin
2024-07-25 17:37   ` Mikulas Patocka

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=ff54aa24-15be-4bca-8b9e-1b1166b0e0d9@bell.net \
    --to=dave.anglin@bell.net \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=dave@parisc-linux.org \
    --cc=deller@gmx.de \
    --cc=linux-parisc@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    /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