of: add 'of_' prefix to machine_is_compatible()
[safe/jmp/linux-2.6] / arch / powerpc / platforms / cell / ras.c
index fdf088f..608fd2b 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/kexec.h>
 #include <linux/crash_dump.h>
 
+#include <asm/kexec.h>
 #include <asm/reg.h>
 #include <asm/io.h>
 #include <asm/prom.h>
@@ -37,16 +38,16 @@ static void dump_fir(int cpu)
        /* Todo: do some nicer parsing of bits and based on them go down
         * to other sub-units FIRs and not only IIC
         */
-       printk(KERN_ERR "Global Checkstop FIR    : 0x%016lx\n",
+       printk(KERN_ERR "Global Checkstop FIR    : 0x%016llx\n",
               in_be64(&pregs->checkstop_fir));
-       printk(KERN_ERR "Global Recoverable FIR  : 0x%016lx\n",
+       printk(KERN_ERR "Global Recoverable FIR  : 0x%016llx\n",
               in_be64(&pregs->checkstop_fir));
-       printk(KERN_ERR "Global MachineCheck FIR : 0x%016lx\n",
+       printk(KERN_ERR "Global MachineCheck FIR : 0x%016llx\n",
               in_be64(&pregs->spec_att_mchk_fir));
 
        if (iregs == NULL)
                return;
-       printk(KERN_ERR "IOC FIR                 : 0x%016lx\n",
+       printk(KERN_ERR "IOC FIR                 : 0x%016llx\n",
               in_be64(&iregs->ioc_fir));
 
 }
@@ -121,12 +122,23 @@ static int __init cbe_ptcal_enable_on_node(int nid, int order)
 
        area->nid = nid;
        area->order = order;
-       area->pages = alloc_pages_node(area->nid, GFP_KERNEL, area->order);
+       area->pages = alloc_pages_exact_node(area->nid, GFP_KERNEL|GFP_THISNODE,
+                                               area->order);
 
-       if (!area->pages)
+       if (!area->pages) {
+               printk(KERN_WARNING "%s: no page on node %d\n",
+                       __func__, area->nid);
                goto out_free_area;
+       }
 
-       addr = __pa(page_address(area->pages));
+       /*
+        * We move the ptcal area to the middle of the allocated
+        * page, in order to avoid prefetches in memcpy and similar
+        * functions stepping on it.
+        */
+       addr = __pa(page_address(area->pages)) + (PAGE_SIZE >> 1);
+       printk(KERN_DEBUG "%s: enabling PTCAL on node %d address=0x%016lx\n",
+                       __func__, area->nid, addr);
 
        ret = -EIO;
        if (rtas_call(ptcal_start_tok, 3, 1, NULL, area->nid,
@@ -243,7 +255,7 @@ static int __init cbe_sysreset_init(void)
 {
        struct cbe_pmd_regs __iomem *regs;
 
-       sysreset_hack = machine_is_compatible("IBM,CBPLUS-1.0");
+       sysreset_hack = of_machine_is_compatible("IBM,CBPLUS-1.0");
        if (!sysreset_hack)
                return 0;