All of lore.kernel.org
 help / color / mirror / Atom feed
From: robherring2@gmail.com (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 1/3] pstore-ram: use write-combine mappings
Date: Tue,  9 Apr 2013 22:08:15 -0500	[thread overview]
Message-ID: <1365563297-12480-1-git-send-email-robherring2@gmail.com> (raw)

From: Rob Herring <rob.herring@calxeda.com>

Atomic operations are undefined behavior on ARM for device or strongly
ordered memory types. So use write-combine variants for mappings. This
corresponds to normal, non-cacheable memory on ARM. For many other
architectures, this change should not change the mapping type.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Cc: Anton Vorontsov <cbouatmailru@gmail.com>
Cc: Colin Cross <ccross@android.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: linux-kernel at vger.kernel.org
---
 fs/pstore/ram_core.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c
index 0306303..e126d9f 100644
--- a/fs/pstore/ram_core.c
+++ b/fs/pstore/ram_core.c
@@ -337,7 +337,7 @@ static void *persistent_ram_vmap(phys_addr_t start, size_t size)
 	page_start = start - offset_in_page(start);
 	page_count = DIV_ROUND_UP(size + offset_in_page(start), PAGE_SIZE);
 
-	prot = pgprot_noncached(PAGE_KERNEL);
+	prot = pgprot_writecombine(PAGE_KERNEL);
 
 	pages = kmalloc(sizeof(struct page *) * page_count, GFP_KERNEL);
 	if (!pages) {
@@ -364,7 +364,7 @@ static void *persistent_ram_iomap(phys_addr_t start, size_t size)
 		return NULL;
 	}
 
-	return ioremap(start, size);
+	return ioremap_wc(start, size);
 }
 
 static int persistent_ram_buffer_map(phys_addr_t start, phys_addr_t size,
-- 
1.7.10.4

WARNING: multiple messages have this Message-ID (diff)
From: Rob Herring <robherring2@gmail.com>
To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Cc: Rob Herring <rob.herring@calxeda.com>,
	Anton Vorontsov <cbouatmailru@gmail.com>,
	Colin Cross <ccross@android.com>,
	Kees Cook <keescook@chromium.org>,
	Tony Luck <tony.luck@intel.com>
Subject: [RFC PATCH 1/3] pstore-ram: use write-combine mappings
Date: Tue,  9 Apr 2013 22:08:15 -0500	[thread overview]
Message-ID: <1365563297-12480-1-git-send-email-robherring2@gmail.com> (raw)

From: Rob Herring <rob.herring@calxeda.com>

Atomic operations are undefined behavior on ARM for device or strongly
ordered memory types. So use write-combine variants for mappings. This
corresponds to normal, non-cacheable memory on ARM. For many other
architectures, this change should not change the mapping type.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Cc: Anton Vorontsov <cbouatmailru@gmail.com>
Cc: Colin Cross <ccross@android.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: linux-kernel@vger.kernel.org
---
 fs/pstore/ram_core.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c
index 0306303..e126d9f 100644
--- a/fs/pstore/ram_core.c
+++ b/fs/pstore/ram_core.c
@@ -337,7 +337,7 @@ static void *persistent_ram_vmap(phys_addr_t start, size_t size)
 	page_start = start - offset_in_page(start);
 	page_count = DIV_ROUND_UP(size + offset_in_page(start), PAGE_SIZE);
 
-	prot = pgprot_noncached(PAGE_KERNEL);
+	prot = pgprot_writecombine(PAGE_KERNEL);
 
 	pages = kmalloc(sizeof(struct page *) * page_count, GFP_KERNEL);
 	if (!pages) {
@@ -364,7 +364,7 @@ static void *persistent_ram_iomap(phys_addr_t start, size_t size)
 		return NULL;
 	}
 
-	return ioremap(start, size);
+	return ioremap_wc(start, size);
 }
 
 static int persistent_ram_buffer_map(phys_addr_t start, phys_addr_t size,
-- 
1.7.10.4


             reply	other threads:[~2013-04-10  3:08 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-10  3:08 Rob Herring [this message]
2013-04-10  3:08 ` [RFC PATCH 1/3] pstore-ram: use write-combine mappings Rob Herring
2013-04-10  3:08 ` [RFC PATCH 2/3] pstore ram: remove the power of buffer size limitation Rob Herring
2013-04-10  3:08   ` Rob Herring
2013-04-10  3:08 ` [RFC PATCH 3/3] pstore/ram: avoid atomic accesses for ioremapped regions Rob Herring
2013-04-10  3:08   ` Rob Herring
2013-04-10  4:10   ` Colin Cross
2013-04-10  4:10     ` Colin Cross
2013-04-10 15:55     ` Rob Herring
2013-04-10 15:55       ` Rob Herring
2013-04-10  3:53 ` [RFC PATCH 1/3] pstore-ram: use write-combine mappings Colin Cross
2013-04-10  3:53   ` Colin Cross
2013-04-10 13:30   ` Rob Herring
2013-04-10 13:30     ` Rob Herring
2013-04-15 22:21     ` Colin Cross
2013-04-15 22:21       ` Colin Cross
2013-04-15 23:59       ` Rob Herring
2013-04-15 23:59         ` Rob Herring
2013-04-16  0:43         ` Colin Cross
2013-04-16  0:43           ` Colin Cross
2013-04-16  8:44           ` Will Deacon
2013-04-16  8:44             ` Will Deacon
2013-04-16 12:58             ` Rob Herring
2013-04-16 12:58               ` Rob Herring
2013-04-16 13:48               ` Catalin Marinas
2013-04-16 13:48                 ` Catalin Marinas
2013-04-19  9:54   ` Russell King - ARM Linux
2013-04-19  9:54     ` Russell King - ARM Linux
  -- strict thread matches above, loose matches on Subject: below --
2013-06-19 11:22 Wei Ni

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=1365563297-12480-1-git-send-email-robherring2@gmail.com \
    --to=robherring2@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.