]> git.karo-electronics.de Git - linux-beck.git/commitdiff
s390/memory hotplug: initialize storage keys
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Mon, 14 May 2012 09:04:10 +0000 (11:04 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 16 May 2012 12:42:44 +0000 (14:42 +0200)
Add missing storage key initialization when memory comes online.
Didn't hurt until now, since the kernel always uses access key 0.

However for debugging purposes we sometimes use a different key
and it might be good if everything is properly initialized...

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/char/sclp_cmd.c

index 231a1d85127b8778d8fdcac0c09662868201c739..36506366158daa719c5c66419c0000c233a09d87 100644 (file)
@@ -352,7 +352,17 @@ out:
 
 static int sclp_assign_storage(u16 rn)
 {
-       return do_assign_storage(0x000d0001, rn);
+       unsigned long long start, address;
+       int rc;
+
+       rc = do_assign_storage(0x000d0001, rn);
+       if (rc)
+               goto out;
+       start = address = rn2addr(rn);
+       for (; address < start + rzm; address += PAGE_SIZE)
+               page_set_storage_key(address, PAGE_DEFAULT_KEY, 0);
+out:
+       return rc;
 }
 
 static int sclp_unassign_storage(u16 rn)