Merge tag 'exynos-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene...
[cascardo/linux.git] / arch / powerpc / platforms / powernv / setup.c
index 19884b2..110f4fb 100644 (file)
@@ -26,6 +26,8 @@
 #include <linux/of_fdt.h>
 #include <linux/interrupt.h>
 #include <linux/bug.h>
+#include <linux/cpuidle.h>
+#include <linux/pci.h>
 
 #include <asm/machdep.h>
 #include <asm/firmware.h>
@@ -140,13 +142,22 @@ static void pnv_progress(char *s, unsigned short hex)
 {
 }
 
+static int pnv_dma_set_mask(struct device *dev, u64 dma_mask)
+{
+       if (dev_is_pci(dev))
+               return pnv_pci_dma_set_mask(to_pci_dev(dev), dma_mask);
+       return __dma_set_mask(dev, dma_mask);
+}
+
 static void pnv_shutdown(void)
 {
        /* Let the PCI code clear up IODA tables */
        pnv_pci_shutdown();
 
-       /* And unregister all OPAL interrupts so they don't fire
-        * up while we kexec
+       /*
+        * Stop OPAL activity: Unregister all OPAL interrupts so they
+        * don't fire up while we kexec and make sure all potentially
+        * DMA'ing ops are complete (such as dump retrieval).
         */
        opal_shutdown();
 }
@@ -214,6 +225,16 @@ static int __init pnv_probe(void)
        return 1;
 }
 
+void powernv_idle(void)
+{
+       /* Hook to cpuidle framework if available, else
+        * call on default platform idle code
+        */
+       if (cpuidle_idle_call()) {
+               power7_idle();
+       }
+}
+
 define_machine(powernv) {
        .name                   = "PowerNV",
        .probe                  = pnv_probe,
@@ -223,8 +244,9 @@ define_machine(powernv) {
        .show_cpuinfo           = pnv_show_cpuinfo,
        .progress               = pnv_progress,
        .machine_shutdown       = pnv_shutdown,
-       .power_save             = power7_idle,
+       .power_save             = powernv_idle,
        .calibrate_decr         = generic_calibrate_decr,
+       .dma_set_mask           = pnv_dma_set_mask,
 #ifdef CONFIG_KEXEC
        .kexec_cpu_down         = pnv_kexec_cpu_down,
 #endif