Merge branches 'pm-sleep' and 'powercap'
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 22 May 2017 18:32:05 +0000 (20:32 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 22 May 2017 18:32:05 +0000 (20:32 +0200)
* pm-sleep:
  PM / hibernate: Declare variables as static
  RTC: rtc-cmos: Fix wakeup from suspend-to-idle
  PM / wakeup: Fix up wakeup_source_report_event()

* powercap:
  PowerCap: Fix an error code in powercap_register_zone()

1  2  3 
drivers/rtc/rtc-cmos.c
kernel/power/snapshot.c

diff --combined drivers/rtc/rtc-cmos.c
index b3de973a62607de6812615e81ac1d00bce5c1f1a,dabe47b9be72b44b828859fac3da9e2db0e44f04,f4a96dbdabf21ec4bdf8017e524ea42b9b0ce5c7..9dca53df35845cc64366a5428d9927bff7f28220
   #include <linux/pm.h>
   #include <linux/of.h>
   #include <linux/of_platform.h>
 ++#ifdef CONFIG_X86
 ++#include <asm/i8259.h>
 ++#endif
   
   /* this is for "generic access to PC-style RTC" using CMOS_READ/CMOS_WRITE */
   #include <linux/mc146818rtc.h>
@@@@ -1088,7 -1085,7 -1085,7 +1088,7 @@@@ static u32 rtc_handler(void *context
        }
        spin_unlock_irqrestore(&rtc_lock, flags);
   
- -     pm_wakeup_event(dev, 0);
+ +     pm_wakeup_hard_event(dev);
        acpi_clear_event(ACPI_EVENT_RTC);
        acpi_disable_event(ACPI_EVENT_RTC, 0);
        return ACPI_INTERRUPT_HANDLED;
@@@@ -1196,23 -1193,17 -1193,17 +1196,23 @@@@ static int cmos_pnp_probe(struct pnp_de
   {
        cmos_wake_setup(&pnp->dev);
   
 --     if (pnp_port_start(pnp, 0) == 0x70 && !pnp_irq_valid(pnp, 0))
 ++     if (pnp_port_start(pnp, 0) == 0x70 && !pnp_irq_valid(pnp, 0)) {
 ++             unsigned int irq = 0;
 ++#ifdef CONFIG_X86
                /* Some machines contain a PNP entry for the RTC, but
                 * don't define the IRQ. It should always be safe to
 --              * hardcode it in these cases
 ++              * hardcode it on systems with a legacy PIC.
                 */
 ++             if (nr_legacy_irqs())
 ++                     irq = 8;
 ++#endif
                return cmos_do_probe(&pnp->dev,
 --                             pnp_get_resource(pnp, IORESOURCE_IO, 0), 8);
 --     else
 ++                             pnp_get_resource(pnp, IORESOURCE_IO, 0), irq);
 ++     } else {
                return cmos_do_probe(&pnp->dev,
                                pnp_get_resource(pnp, IORESOURCE_IO, 0),
                                pnp_irq(pnp, 0));
 ++     }
   }
   
   static void cmos_pnp_remove(struct pnp_dev *pnp)
diff --combined kernel/power/snapshot.c
index 3b1e0f3ad07fa69d9524bcb72d1c6d0bab1a9ad8,a628cccafa4ac7dcc858140e53ab69f4ad15f7d8,d79a38de425a0d642834adb5e8ac68ba237db93d..fa46606f33565613d2ef13a1e948f2bae0dfaa8b
   #include <asm/pgtable.h>
   #include <asm/tlbflush.h>
   #include <asm/io.h>
 ++#ifdef CONFIG_STRICT_KERNEL_RWX
 ++#include <asm/set_memory.h>
 ++#endif
   
   #include "power.h"
   
@@@@ -1425,7 -1422,7 -1422,7 +1425,7 @@@@ static unsigned int nr_meta_pages
    * Numbers of normal and highmem page frames allocated for hibernation image
    * before suspending devices.
    */
- -unsigned int alloc_normal, alloc_highmem;
+ +static unsigned int alloc_normal, alloc_highmem;
   /*
    * Memory bitmap used for marking saveable pages (during hibernation) or
    * hibernation image pages (during restore)