Skip to content
  1. Jan 18, 2018
    • Rafael J. Wysocki's avatar
      Merge branches 'pm-opp', 'pm-devfreq', 'pm-avs' and 'pm-tools' · ee43730d
      Rafael J. Wysocki authored
      * pm-opp:
        OPP: Introduce "required-opp" property
        OPP: Allow OPP table to be used for power-domains
      
      * pm-devfreq:
        PM / devfreq: Fix potential NULL pointer dereference in governor_store
        PM / devfreq: Propagate error from devfreq_add_device()
      
      * pm-avs:
        PM / AVS: rockchip-io: account for const type of of_device_id.data
      
      * pm-tools:
        tools/power/x86/intel_pstate_tracer: Free the trace buffer memory
        cpupower: Remove FSF address
      ee43730d
    • Rafael J. Wysocki's avatar
      Merge branches 'acpi-pm' and 'pm-sleep' · bcaea467
      Rafael J. Wysocki authored
      * acpi-pm:
        platform/x86: surfacepro3: Support for wakeup from suspend-to-idle
        ACPI / PM: Use Low Power S0 Idle on more systems
        ACPI / PM: Make it possible to ignore the system sleep blacklist
      
      * pm-sleep:
        PM / hibernate: Drop unused parameter of enough_swap
        block, scsi: Fix race between SPI domain validation and system suspend
        PM / sleep: Make lock/unlock_system_sleep() available to kernel modules
        PM: hibernate: Do not subtract NR_FILE_MAPPED in minimum_image_size()
      bcaea467
    • Rafael J. Wysocki's avatar
      Merge branch 'pm-core' · 4b67157f
      Rafael J. Wysocki authored
      * pm-core: (29 commits)
        dmaengine: rcar-dmac: Make DMAC reinit during system resume explicit
        PM / runtime: Allow no callbacks in pm_runtime_force_suspend|resume()
        PM / runtime: Check ignore_children in pm_runtime_need_not_resume()
        PM / runtime: Rework pm_runtime_force_suspend/resume()
        PM / wakeup: Print warn if device gets enabled as wakeup source during sleep
        PM / core: Propagate wakeup_path status flag in __device_suspend_late()
        PM / core: Re-structure code for clearing the direct_complete flag
        PM: i2c-designware-platdrv: Optimize power management
        PM: i2c-designware-platdrv: Use DPM_FLAG_SMART_PREPARE
        PM / mfd: intel-lpss: Use DPM_FLAG_SMART_SUSPEND
        PCI / PM: Use SMART_SUSPEND and LEAVE_SUSPENDED flags for PCIe ports
        PM / wakeup: Add device_set_wakeup_path() helper to control wakeup path
        PM / core: Assign the wakeup_path status flag in __device_prepare()
        PM / wakeup: Do not fail dev_pm_attach_wake_irq() unnecessarily
        PM / core: Direct DPM_FLAG_LEAVE_SUSPENDED handling
        PM / core: Direct DPM_FLAG_SMART_SUSPEND optimization
        PM / core: Add helpers for subsystem callback selection
        PM / wakeup: Drop redundant check from device_init_wakeup()
        PM / wakeup: Drop redundant check from device_set_wakeup_enable()
        PM / wakeup: only recommend "call"ing device_init_wakeup() once
        ...
      4b67157f
    • Rafael J. Wysocki's avatar
      Merge branches 'pm-domains', 'pm-kconfig', 'pm-cpuidle' and 'powercap' · f9b736f6
      Rafael J. Wysocki authored
      * pm-domains:
        PM / genpd: Stop/start devices without pm_runtime_force_suspend/resume()
        PM / domains: Don't skip driver's ->suspend|resume_noirq() callbacks
        PM / Domains: Remove obsolete "samsung,power-domain" check
      
      * pm-kconfig:
        bus: simple-pm-bus: convert bool SIMPLE_PM_BUS to tristate
        PM: Provide a config snippet for disabling PM
      
      * pm-cpuidle:
        cpuidle: Avoid NULL argument in cpuidle_switch_governor()
      
      * powercap:
        powercap: intel_rapl: Fix trailing semicolon
        powercap: add suspend and resume mechanism for SOC power limit
        powercap: Simplify powercap_init()
      f9b736f6
    • Rafael J. Wysocki's avatar
      Merge branch 'pm-cpufreq' · f31c3760
      Rafael J. Wysocki authored
      * pm-cpufreq: (36 commits)
        cpufreq: scpi: remove arm_big_little dependency
        drivers: psci: remove cluster terminology and dependency on physical_package_id
        cpufreq: powernv: Dont assume distinct pstate values for nominal and pmin
        cpufreq: intel_pstate: Add Skylake servers support
        cpufreq: intel_pstate: Replace bxt_funcs with core_funcs
        cpufreq: imx6q: add 696MHz operating point for i.mx6ul
        ARM: dts: imx6ul: add 696MHz operating point
        cpufreq: stats: Change return type of cpufreq_stats_update() as void
        powernv-cpufreq: Treat pstates as opaque 8-bit values
        powernv-cpufreq: Fix pstate_to_idx() to handle non-continguous pstates
        powernv-cpufreq: Add helper to extract pstate from PMSR
        cpu_cooling: Remove static-power related documentation
        cpufreq: imx6q: switch to Use clk_bulk_get() to refine clk operations
        PM / OPP: Make local function ti_opp_supply_set_opp() static
        PM / OPP: Add ti-opp-supply driver
        dt-bindings: opp: Introduce ti-opp-supply bindings
        cpufreq: ti-cpufreq: Add support for multiple regulators
        cpufreq: ti-cpufreq: Convert to module_platform_driver
        cpufreq: Add DVFS support for Armada 37xx
        MAINTAINERS: add new entries for Armada 37xx cpufreq driver
        ...
      f31c3760
    • Rafael J. Wysocki's avatar
      Merge branch 'pm-cpufreq-thermal' into pm-cpufreq · f06970f4
      Rafael J. Wysocki authored
      * pm-cpufreq-thermal:
        cpu_cooling: Remove static-power related documentation
        cpu_cooling: Drop static-power related stuff
        cpu_cooling: Keep only one of_cpufreq*cooling_register() helper
        cpu_cooling: Remove unused cpufreq_power_cooling_register()
        cpu_cooling: Make of_cpufreq_power_cooling_register() parse DT
      f06970f4
    • Luis de Bethencourt's avatar
      PCI / PM: Remove spurious semicolon · bee344cb
      Luis de Bethencourt authored
      
      
      The trailing semicolon is an empty statement that does no operation.
      Removing it since it doesn't do anything.
      
      Signed-off-by: default avatarLuis de Bethencourt <luisbg@kernel.org>
      Acked-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      bee344cb
  2. Jan 17, 2018
  3. Jan 16, 2018
  4. Jan 15, 2018
    • Rafael J. Wysocki's avatar
      PM / runtime: Rework pm_runtime_force_suspend/resume() · 4918e1f8
      Rafael J. Wysocki authored
      
      
      One of the limitations of pm_runtime_force_suspend/resume() is that
      if a parent driver wants to use these functions, all of its child
      drivers generally have to do that too because of the parent usage
      counter manipulations necessary to get the correct state of the parent
      during system-wide transitions to the working state (system resume).
      However, that limitation turns out to be artificial, so remove it.
      
      Namely, pm_runtime_force_suspend() only needs to update the children
      counter of its parent (if there's is a parent) when the device can
      stay in suspend after the subsequent system resume transition, as
      that counter is correct already otherwise.  Now, if the parent's
      children counter is not updated, it is not necessary to increment
      the parent's usage counter in that case any more, as long as the
      children counters of devices are checked along with their usage
      counters in order to decide whether or not the devices may be left
      in suspend after the subsequent system resume transition.
      
      Accordingly, modify pm_runtime_force_suspend() to only call
      pm_runtime_set_suspended() for devices whose usage and children
      counters are at the "no references" level (the runtime PM status
      of the device needs to be updated to "suspended" anyway in case
      this function is called once again for the same device during the
      transition under way), drop the parent usage counter incrementation
      from it and update pm_runtime_force_resume() to compensate for these
      changes.
      
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      4918e1f8
    • Rafael J. Wysocki's avatar
    • Rafael J. Wysocki's avatar
      PM / genpd: Stop/start devices without pm_runtime_force_suspend/resume() · 17218e00
      Rafael J. Wysocki authored
      There are problems with calling pm_runtime_force_suspend/resume()
      to "stop" and "start" devices in genpd_finish_suspend() and
      genpd_resume_noirq() (and in analogous hibernation-specific genpd
      callbacks) after commit 122a2237 (PM / Domains: Stop/start
      devices during system PM suspend/resume in genpd) as those routines
      do much more than just "stopping" and "starting" devices (which was
      the stated purpose of that commit) unnecessarily and may not play
      well with system-wide PM driver callbacks.
      
      First, consider the pm_runtime_force_suspend() in
      genpd_finish_suspend().  If the current runtime PM status of the
      device is "suspended", that function most likely does the right thing
      by ignoring the device, because it should have been "stopped" already
      and whatever needed to be done to deactivate it shoud have been done.
      In turn, if the runtime PM status of the device is "active",
      genpd_runtime_suspend() is called for it (indirectly) and (1) runs
      the ->runtime_suspend callback provided by the device's driver
      (assuming no bus type with ->runtime_suspend of its own), (2) "stops"
      the device and (3) checks if the domain can be powered down, and then
      (4) the device's runtime PM status is changed to "suspended".  Out of
      the four actions above (1) is not necessary and it may be outright
      harmful, (3) is pointless and (4) is questionable.  The only
      operation that needs to be carried out here is (2).
      
      The reason why (1) is not necessary is because the system-wide
      PM callbacks provided by the device driver for the transition in
      question have been run and they should have taken care of the
      driver's part of device suspend already.  Moreover, it may be
      harmful, because the ->runtime_suspend callback may want to
      access the device which is partially suspended at that point
      and may not be responsive.  Also, system-wide PM callbacks may
      have been run already (in the previous phases of the system
      transition under way) for the device's parent or for its supplier
      devices (if any) and the device may not be accessible because of
      that.
      
      There also is no reason to do (3), because genpd_finish_suspend()
      will repeat it anyway, and (4) potentially causes confusion to ensue
      during the subsequent system transition to the working state.
      
      Consider pm_runtime_force_resume() in genpd_resume_noirq() now.
      It runs genpd_runtime_resume() for all devices with runtime PM
      status set to "suspended", which includes all of the devices
      whose runtime PM status was changed by pm_runtime_force_suspend()
      before and may include some devices already suspended when the
      pm_runtime_force_suspend() was running, which may be confusing.  The
      genpd_runtime_resume() first tries to power up the domain, which
      (again) is pointless, because genpd_resume_noirq() has done that
      already.  Then, it "starts" the device and runs the ->runtime_resume
      callback (from the driver, say) for it.  If all is well, the device
      is left with the runtime PM status set to "active".
      
      Unfortunately, running the driver's ->runtime_resume callback
      before its system-wide PM callbacks and possibly before some
      system-wide PM callbacks of the parent device's driver (let
      alone supplier drivers) is asking for trouble, especially if
      the device had been suspended before pm_runtime_force_suspend()
      ran previously or if the callbacks in question expect to be run
      back-to-back with their suspend-side counterparts.  It also should
      not be necessary, because the system-wide PM driver callbacks that
      will be invoked for the device subsequently should take care of
      resuming it just fine.
      
      [Running the driver's ->runtime_resume callback in the "noirq"
      phase of the transition to the working state may be problematic
      even for devices whose drivers do use pm_runtime_force_resume()
      in (or as) their system-wide PM callbacks if they have suppliers
      other than their parents, because it may cause the supplier to
      be resumed after the consumer in some cases.]
      
      Because of the above, modify genpd as follows:
      
       1. Change genpd_finish_suspend() to only "stop" devices with
          runtime PM status set to "active" (without invoking runtime PM
          callbacks for them, changing their runtime PM status and so on).
      
          That doesn't change the handling of devices whose drivers use
          pm_runtime_force_suspend/resume() in (or as) their system-wide
          PM callbacks and addresses the issues described above for the
          other devices.
      
       2. Change genpd_resume_noirq() to only "start" devices with
          runtime PM status set to "active" (without invoking runtime PM
          callbacks for them, changing their runtime PM status and so on).
      
          Again, that doesn't change the handling of devices whose drivers
          use pm_runtime_force_suspend/resume() in (or as) their system-wide
          PM callbacks and addresses the described issues for the other
          devices.  Devices with runtime PM status set to "suspended"
          are not started with the assumption that they will be resumed
          later, either by pm_runtime_force_resume() or via runtime PM.
      
       3. Change genpd_restore_noirq() to follow genpd_resume_noirq().
      
          That causes devices already suspended before hibernation to be
          left alone (which also is the case without the change) and
          avoids running the ->runtime_resume driver callback too early
          for the other devices.
      
       4. Change genpd_freeze_noirq() and genpd_thaw_noirq() in accordance
          with the above modifications.
      
      Fixes: 122a2237
      
       (PM / Domains: Stop/start devices during system PM suspend/resume in genpd)
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      17218e00
    • Linus Torvalds's avatar
      Linux 4.15-rc8 · a8750ddc
      Linus Torvalds authored
      a8750ddc
    • Linus Torvalds's avatar
      Merge branch 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · aaae98a8
      Linus Torvalds authored
      Pull x86 fixlet from Thomas Gleixner.
      
      Remove a warning about lack of compiler support for retpoline that most
      people can't do anything about, so it just annoys them needlessly.
      
      * 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/retpoline: Remove compile time warning
      aaae98a8
    • Linus Torvalds's avatar
      Merge tag 'powerpc-4.15-7' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 6bb82119
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "One fix for an oops at boot if we take a hotplug interrupt before we
        are ready to handle it.
      
        The bulk is patches to implement mitigation for Meltdown, see the
        change logs for more details.
      
        Thanks to: Nicholas Piggin, Michael Neuling, Oliver O'Halloran, Jon
        Masters, Jose Ricardo Ziviani, David Gibson"
      
      * tag 'powerpc-4.15-7' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/powernv: Check device-tree for RFI flush settings
        powerpc/pseries: Query hypervisor for RFI flush settings
        powerpc/64s: Support disabling RFI flush with no_rfi_flush and nopti
        powerpc/64s: Add support for RFI flush of L1-D cache
        powerpc/64s: Convert slb_miss_common to use RFI_TO_USER/KERNEL
        powerpc/64: Convert fast_exception_return to use RFI_TO_USER/KERNEL
        powerpc/64: Convert the syscall exit path to use RFI_TO_USER/KERNEL
        powerpc/64s: Simple RFI macro conversions
        powerpc/64: Add macros for annotating the destination of rfid/hrfid
        powerpc/pseries: Add H_GET_CPU_CHARACTERISTICS flags & wrapper
        powerpc/pseries: Make RAS IRQ explicitly dependent on DLPAR WQ
      6bb82119
    • Thomas Gleixner's avatar
      x86/retpoline: Remove compile time warning · b8b9ce4b
      Thomas Gleixner authored
      Remove the compile time warning when CONFIG_RETPOLINE=y and the compiler
      does not have retpoline support. Linus rationale for this is:
      
        It's wrong because it will just make people turn off RETPOLINE, and the
        asm updates - and return stack clearing - that are independent of the
        compiler are likely the most important parts because they are likely the
        ones easiest to target.
      
        And it's annoying because most people won't be able to do anything about
        it. The number of people building their own compiler? Very small. So if
        their distro hasn't got a compiler yet (and pretty much nobody does), the
        warning is just annoying crap.
      
        It is already properly reported as part of the sysfs interface. The
        compile-time warning only encourages bad things.
      
      Fixes: 76b04384
      
       ("x86/retpoline: Add initial retpoline support")
      Requested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: David Woodhouse <dwmw@amazon.co.uk>
      Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
      Cc: gnomes@lxorguk.ukuu.org.uk
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: thomas.lendacky@amd.com
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Jiri Kosina <jikos@kernel.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Kees Cook <keescook@google.com>
      Cc: Tim Chen <tim.c.chen@linux.intel.com>
      Cc: Greg Kroah-Hartman <gregkh@linux-foundation.org>
      Link: https://lkml.kernel.org/r/CA+55aFzWgquv4i6Mab6bASqYXg3ErV3XDFEYf=GEcCDQg5uAtw@mail.gmail.com
      b8b9ce4b
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.dk/linux-block · 9443c168
      Linus Torvalds authored
      Pull NVMe fix from Jens Axboe:
       "Just a single fix for nvme over fabrics that should go into 4.15"
      
      * 'for-linus' of git://git.kernel.dk/linux-block:
        nvme-fabrics: initialize default host->id in nvmf_host_default()
      9443c168
    • Linus Torvalds's avatar
      Merge branch 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 40548c6b
      Linus Torvalds authored
      Pull x86 pti updates from Thomas Gleixner:
       "This contains:
      
         - a PTI bugfix to avoid setting reserved CR3 bits when PCID is
           disabled. This seems to cause issues on a virtual machine at least
           and is incorrect according to the AMD manual.
      
         - a PTI bugfix which disables the perf BTS facility if PTI is
           enabled. The BTS AUX buffer is not globally visible and causes the
           CPU to fault when the mapping disappears on switching CR3 to user
           space. A full fix which restores BTS on PTI is non trivial and will
           be worked on.
      
         - PTI bugfixes for EFI and trusted boot which make sure that the user
           space visible page table entries have the NX bit cleared
      
         - removal of dead code in the PTI pagetable setup functions
      
         - add PTI documentation
      
         - add a selftest for vsyscall to verify that the kernel actually
           implements what it advertises.
      
         - a sysfs interface to expose vulnerability and mitigation
           information so there is a coherent way for users to retrieve the
           status.
      
         - the initial spectre_v2 mitigations, aka retpoline:
      
            + The necessary ASM thunk and compiler support
      
            + The ASM variants of retpoline and the conversion of affected ASM
              code
      
            + Make LFENCE serializing on AMD so it can be used as speculation
              trap
      
            + The RSB fill after vmexit
      
         - initial objtool support for retpoline
      
        As I said in the status mail this is the most of the set of patches
        which should go into 4.15 except two straight forward patches still on
        hold:
      
         - the retpoline add on of LFENCE which waits for ACKs
      
         - the RSB fill after context switch
      
        Both should be ready to go early next week and with that we'll have
        covered the major holes of spectre_v2 and go back to normality"
      
      * 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (28 commits)
        x86,perf: Disable intel_bts when PTI
        security/Kconfig: Correct the Documentation reference for PTI
        x86/pti: Fix !PCID and sanitize defines
        selftests/x86: Add test_vsyscall
        x86/retpoline: Fill return stack buffer on vmexit
        x86/retpoline/irq32: Convert assembler indirect jumps
        x86/retpoline/checksum32: Convert assembler indirect jumps
        x86/retpoline/xen: Convert Xen hypercall indirect jumps
        x86/retpoline/hyperv: Convert assembler indirect jumps
        x86/retpoline/ftrace: Convert ftrace assembler indirect jumps
        x86/retpoline/entry: Convert entry assembler indirect jumps
        x86/retpoline/crypto: Convert crypto assembler indirect jumps
        x86/spectre: Add boot time option to select Spectre v2 mitigation
        x86/retpoline: Add initial retpoline support
        objtool: Allow alternatives to be ignored
        objtool: Detect jumps to retpoline thunks
        x86/pti: Make unpoison of pgd for trusted boot work for real
        x86/alternatives: Fix optimize_nops() checking
        sysfs/cpu: Fix typos in vulnerability documentation
        x86/cpu/AMD: Use LFENCE_RDTSC in preference to MFENCE_RDTSC
        ...
      40548c6b
  5. Jan 14, 2018
  6. Jan 13, 2018
    • Masahiro Yamada's avatar
      genksyms: drop *.hash.c from .gitignore · 36c16816
      Masahiro Yamada authored
      This is a left-over of commit bb3290d9
      
       ("Remove gperf usage from
      toolchain").
      
      We do not generate a hash function any more.
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      36c16816
    • Andy Lutomirski's avatar
      selftests/x86: Add test_vsyscall · 352909b4
      Andy Lutomirski authored
      
      
      This tests that the vsyscall entries do what they're expected to do.
      It also confirms that attempts to read the vsyscall page behave as
      expected.
      
      If changes are made to the vsyscall code or its memory map handling,
      running this test in all three of vsyscall=none, vsyscall=emulate,
      and vsyscall=native are helpful.
      
      (Because it's easy, this also compares the vsyscall results to their
       vDSO equivalents.)
      
      Note to KAISER backporters: please test this under all three
      vsyscall modes.  Also, in the emulate and native modes, make sure
      that test_vsyscall_64 agrees with the command line or config
      option as to which mode you're in.  It's quite easy to mess up
      the kernel such that native mode accidentally emulates
      or vice versa.
      
      Greg, etc: please backport this to all your Meltdown-patched
      kernels.  It'll help make sure the patches didn't regress
      vsyscalls.
      
      CSigned-off-by: default avatarAndy Lutomirski <luto@kernel.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: stable@vger.kernel.org
      Link: http://lkml.kernel.org/r/2b9c5a174c1d60fd7774461d518aa75598b1d8fd.1515719552.git.luto@kernel.org
      
      
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      352909b4
    • Matthew Garrett's avatar
      apparmor: Fix regression in profile conflict logic · 1a3881d3
      Matthew Garrett authored
      The intended behaviour in apparmor profile matching is to flag a
      conflict if two profiles match equally well. However, right now a
      conflict is generated if another profile has the same match length even
      if that profile doesn't actually match. Fix the logic so we only
      generate a conflict if the profiles match.
      
      Fixes: 844b8292
      
       ("apparmor: ensure that undecidable profile attachments fail")
      Cc: Stable <stable@vger.kernel.org>
      Signed-off-by: default avatarMatthew Garrett <mjg59@google.com>
      Signed-off-by: default avatarJohn Johansen <john.johansen@canonical.com>
      1a3881d3