linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Geoff Levand <geoff@infradead.org>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: cbe-oss-dev@lists.ozlabs.org, linuxppc-dev@lists.ozlabs.org,
	Nathan Whitehorn <nwhitehorn@freebsd.org>
Subject: [PATCH 3/6] powerpc/ps3: Write highmem info to repository
Date: Tue, 13 Jan 2015 01:00:20 +0000	[thread overview]
Message-ID: <3deced9919246f281e48f1258885937f11a4b4ee.1421109719.git.geoff@infradead.org> (raw)
In-Reply-To: <cover.1421109719.git.geoff@infradead.org>

Add calls to the ps3_mm_set_repository_highmem() routine when the ps3
r1 highmem region is either created or destroyed.

Signed-off-by: Geoff Levand <geoff@infradead.org>
---
 arch/powerpc/platforms/ps3/mm.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/ps3/mm.c b/arch/powerpc/platforms/ps3/mm.c
index 04c1b93..b0f3466 100644
--- a/arch/powerpc/platforms/ps3/mm.c
+++ b/arch/powerpc/platforms/ps3/mm.c
@@ -329,6 +329,7 @@ static void ps3_mm_region_destroy(struct mem_region *r)
 		r->size = r->base = r->offset = 0;
 		map.total = map.rm.size;
 	}
+	ps3_mm_set_repository_highmem(NULL);
 }
 
 /*============================================================================*/
@@ -1218,8 +1219,12 @@ void __init ps3_mm_init(void)
 
 	/* Check if we got the highmem region from an earlier boot step */
 
-	if (ps3_mm_get_repository_highmem(&map.r1))
-		ps3_mm_region_create(&map.r1, map.total - map.rm.size);
+	if (ps3_mm_get_repository_highmem(&map.r1)) {
+		result = ps3_mm_region_create(&map.r1, map.total - map.rm.size);
+
+		if (!result)
+			ps3_mm_set_repository_highmem(&map.r1);
+	}
 
 	/* correct map.total for the real total amount of memory we use */
 	map.total = map.rm.size + map.r1.size;
-- 
1.9.1

  parent reply	other threads:[~2015-01-13  1:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-13  1:00 [PATCH 0/6] *** SUBJECT HERE *** Geoff Levand
2015-01-13  1:00 ` [PATCH 4/6] powerpc/ps3: Fix vuart sparse warnings Geoff Levand
2015-01-13  1:00 ` [PATCH 2/6] powerpc/ps3: Add ps3_mm_set_repository_highmem Geoff Levand
2015-01-13  1:00 ` Geoff Levand [this message]
2015-01-13  3:04   ` [PATCH 3/6] powerpc/ps3: Write highmem info to repository Michael Ellerman
2015-01-13 18:33     ` Geoff Levand
2015-01-13  1:00 ` [PATCH 1/6] powerpc/ps3: Add empty repository highmem routines Geoff Levand
2015-01-13  1:00 ` [PATCH 5/6] powerpc/ps3: Fix sys-manager-core sparse warnings Geoff Levand
2015-01-13  1:00 ` [PATCH 6/6] powerpc/ps3: Update ps3_defconfig Geoff Levand

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=3deced9919246f281e48f1258885937f11a4b4ee.1421109719.git.geoff@infradead.org \
    --to=geoff@infradead.org \
    --cc=benh@kernel.crashing.org \
    --cc=cbe-oss-dev@lists.ozlabs.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=nwhitehorn@freebsd.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).