]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/s390/char/sclp_cmd.c
[S390] Add support for memory hot-remove.
[linux-2.6-omap-h63xx.git] / drivers / s390 / char / sclp_cmd.c
index 4f45884c92c3fa71cf7c19e7068b0ad7bd13937e..eb5f1b8bc57fd0546c94067a5b57364f3db1addf 100644 (file)
@@ -67,7 +67,7 @@ out:
        return rc;
 }
 
-void __init sclp_read_info_early(void)
+static void __init sclp_read_info_early(void)
 {
        int rc;
        int i;
@@ -97,30 +97,33 @@ void __init sclp_read_info_early(void)
 
 void __init sclp_facilities_detect(void)
 {
-       if (!early_read_info_sccb_valid)
-               return;
-       sclp_facilities = early_read_info_sccb.facilities;
-       sclp_fac84 = early_read_info_sccb.fac84;
-}
-
-unsigned long long __init sclp_memory_detect(void)
-{
-       unsigned long long memsize;
        struct read_info_sccb *sccb;
 
+       sclp_read_info_early();
        if (!early_read_info_sccb_valid)
-               return 0;
+               return;
+
        sccb = &early_read_info_sccb;
+       sclp_facilities = sccb->facilities;
+       sclp_fac84 = sccb->fac84;
        rnmax = sccb->rnmax ? sccb->rnmax : sccb->rnmax2;
        rzm = sccb->rnsize ? sccb->rnsize : sccb->rnsize2;
        rzm <<= 20;
-       memsize = rzm * rnmax;
-       return memsize;
+}
+
+unsigned long long sclp_get_rnmax(void)
+{
+       return rnmax;
+}
+
+unsigned long long sclp_get_rzm(void)
+{
+       return rzm;
 }
 
 /*
- * This function will be called after sclp_memory_detect(), which gets called
- * early from early.c code. Therefore the sccb should have valid contents.
+ * This function will be called after sclp_facilities_detect(), which gets
+ * called from early.c code. Therefore the sccb should have valid contents.
  */
 void __init sclp_get_ipl_info(struct sclp_ipl_info *info)
 {
@@ -424,6 +427,8 @@ static int sclp_mem_notifier(struct notifier_block *nb,
                        sclp_attach_storage(id);
        switch (action) {
        case MEM_ONLINE:
+       case MEM_GOING_OFFLINE:
+       case MEM_CANCEL_OFFLINE:
                break;
        case MEM_GOING_ONLINE:
                rc = sclp_mem_change_state(start, size, 1);
@@ -431,6 +436,9 @@ static int sclp_mem_notifier(struct notifier_block *nb,
        case MEM_CANCEL_ONLINE:
                sclp_mem_change_state(start, size, 0);
                break;
+       case MEM_OFFLINE:
+               sclp_mem_change_state(start, size, 0);
+               break;
        default:
                rc = -EINVAL;
                break;