28 May, 2016

1 commit

  • Most users of IS_ERR_VALUE() in the kernel are wrong, as they
    pass an 'int' into a function that takes an 'unsigned long'
    argument. This happens to work because the type is sign-extended
    on 64-bit architectures before it gets converted into an
    unsigned type.

    However, anything that passes an 'unsigned short' or 'unsigned int'
    argument into IS_ERR_VALUE() is guaranteed to be broken, as are
    8-bit integers and types that are wider than 'unsigned long'.

    Andrzej Hajda has already fixed a lot of the worst abusers that
    were causing actual bugs, but it would be nice to prevent any
    users that are not passing 'unsigned long' arguments.

    This patch changes all users of IS_ERR_VALUE() that I could find
    on 32-bit ARM randconfig builds and x86 allmodconfig. For the
    moment, this doesn't change the definition of IS_ERR_VALUE()
    because there are probably still architecture specific users
    elsewhere.

    Almost all the warnings I got are for files that are better off
    using 'if (err)' or 'if (err < 0)'.
    The only legitimate user I could find that we get a warning for
    is the (32-bit only) freescale fman driver, so I did not remove
    the IS_ERR_VALUE() there but changed the type to 'unsigned long'.
    For 9pfs, I just worked around one user whose calling conventions
    are so obscure that I did not dare change the behavior.

    I was using this definition for testing:

    #define IS_ERR_VALUE(x) ((unsigned long*)NULL == (typeof (x)*)NULL && \
    unlikely((unsigned long long)(x) >= (unsigned long long)(typeof(x))-MAX_ERRNO))

    which ends up making all 16-bit or wider types work correctly with
    the most plausible interpretation of what IS_ERR_VALUE() was supposed
    to return according to its users, but also causes a compile-time
    warning for any users that do not pass an 'unsigned long' argument.

    I suggested this approach earlier this year, but back then we ended
    up deciding to just fix the users that are obviously broken. After
    the initial warning that caused me to get involved in the discussion
    (fs/gfs2/dir.c) showed up again in the mainline kernel, Linus
    asked me to send the whole thing again.

    [ Updated the 9p parts as per Al Viro - Linus ]

    Signed-off-by: Arnd Bergmann
    Cc: Andrzej Hajda
    Cc: Andrew Morton
    Link: https://lkml.org/lkml/2016/1/7/363
    Link: https://lkml.org/lkml/2016/5/27/486
    Acked-by: Srinivas Kandagatla # For nvmem part
    Signed-off-by: Linus Torvalds

    Arnd Bergmann
     

27 May, 2016

1 commit

  • Pull thermal management updates from Zhang Rui:

    - Introduce generic ADC thermal driver, based on OF thermal (Laxman
    Dewangan)

    - Introduce new thermal driver for Tango chips (Marc Gonzalez)

    - Rockchip driver support for RK3399, RK3366, and some fixes (Caesar
    Wang, Elaine Zhang and Shawn Lin)

    - Add CPU power cooling model to Mediatek thermal driver (Dawei Chien)

    - Wider usage of dev_thermal_zone_of_sensor_register (Eduardo Valentin)

    - TI thermal driver gained a new maintainer (Keerthy).

    - Enabled powerclamp driver by checking CPU feature and package cstate
    counter instead of CPU whitelist (Jacob Pan)

    - Various fixes on thermal governor, OF thermal, Tegra, and RCAR

    * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (50 commits)
    thermal: tango: initialize TEMPSI_CFG
    thermal: rockchip: use the usleep_range instead of udelay
    thermal: rockchip: add the notes for better reading
    thermal: rockchip: Support RK3366 SoCs in the thermal driver
    thermal: rockchip: handle the power sequence for tsadc controller
    thermal: rockchip: update the tsadc table for rk3399
    thermal: rockchip: fixes the code_to_temp for tsadc driver
    thermal: rockchip: disable thermal->clk in err case
    thermal: tegra: add Tegra132 specific SOC_THERM driver
    thermal: fix ptr_ret.cocci warnings
    thermal: mediatek: Add cpu dynamic power cooling model.
    thermal: generic-adc: Add ADC based thermal sensor driver
    thermal: generic-adc: Add DT binding for ADC based thermal sensor
    thermal: tegra: fix static checker warning
    thermal: tegra: mark PM functions __maybe_unused
    thermal: add temperature sensor support for tango SoC
    thermal: hisilicon: fix IRQ imbalance enabling
    thermal: hisilicon: support to use any sensor
    thermal: rcar: Remove binding docs for r8a7794
    thermal: tegra: add PM support
    ...

    Linus Torvalds
     

26 May, 2016

2 commits

  • Pull more power management updates from Rafael Wysocki:
    "These are two stable-candidate fixes (PM core, cpuidle) and a bunch of
    cpufreq cleanups.

    Specifics:

    - Stable-candidate cpuidle fix to make it check the right variable
    when deciding whether or not to enable interrupts on the local CPU
    so as to avoid enabling iterrupts too early in some cases if the
    system has both coupled and per-core idle states (Daniel Lezcano).

    - Stable-candidate PM core fix to make it handle failures at the
    "late suspend" stage of device suspend consistently for all devices
    regardless of whether or not async suspend/resume is enabled for
    them (Rafael Wysocki).

    - Cleanups in the cpufreq core, the schedutil governor and the
    intel_pstate driver (Rafael Wysocki, Pankaj Gupta, Viresh Kumar)"

    * tag 'pm-4.7-rc1-more' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    PM / sleep: Handle failures in device_suspend_late() consistently
    cpufreq: schedutil: Improve prints messages with pr_fmt
    cpuidle: Fix cpuidle_state_is_coupled() argument in cpuidle_enter()
    cpufreq: simplified goto out in cpufreq_register_driver()
    cpufreq: governor: CPUFREQ_GOV_STOP never fails
    cpufreq: governor: CPUFREQ_GOV_POLICY_EXIT never fails
    intel_pstate: Simplify conditional in intel_pstate_set_policy()

    Linus Torvalds
     
  • * pm-cpufreq:
    cpufreq: schedutil: Improve prints messages with pr_fmt
    cpufreq: simplified goto out in cpufreq_register_driver()
    cpufreq: governor: CPUFREQ_GOV_STOP never fails
    cpufreq: governor: CPUFREQ_GOV_POLICY_EXIT never fails
    intel_pstate: Simplify conditional in intel_pstate_set_policy()

    * pm-cpuidle:
    cpuidle: Fix cpuidle_state_is_coupled() argument in cpuidle_enter()

    * pm-core:
    PM / sleep: Handle failures in device_suspend_late() consistently

    Rafael J. Wysocki
     

21 May, 2016

1 commit

  • Pull powerpc updates from Michael Ellerman:
    "Highlights:
    - Support for Power ISA 3.0 (Power9) Radix Tree MMU from Aneesh Kumar K.V
    - Live patching support for ppc64le (also merged via livepatching.git)

    Various cleanups & minor fixes from:
    - Aaro Koskinen, Alexey Kardashevskiy, Andrew Donnellan, Aneesh Kumar K.V,
    Chris Smart, Daniel Axtens, Frederic Barrat, Gavin Shan, Ian Munsie,
    Lennart Sorensen, Madhavan Srinivasan, Mahesh Salgaonkar, Markus Elfring,
    Michael Ellerman, Oliver O'Halloran, Paul Gortmaker, Paul Mackerras,
    Rashmica Gupta, Russell Currey, Suraj Jitindar Singh, Thiago Jung
    Bauermann, Valentin Rothberg, Vipin K Parashar.

    General:
    - Update LMB associativity index during DLPAR add/remove from Nathan
    Fontenot
    - Fix branching to OOL handlers in relocatable kernel from Hari Bathini
    - Add support for userspace Power9 copy/paste from Chris Smart
    - Always use STRICT_MM_TYPECHECKS from Michael Ellerman
    - Add mask of possible MMU features from Michael Ellerman

    PCI:
    - Enable pass through of NVLink to guests from Alexey Kardashevskiy
    - Cleanups in preparation for powernv PCI hotplug from Gavin Shan
    - Don't report error in eeh_pe_reset_and_recover() from Gavin Shan
    - Restore initial state in eeh_pe_reset_and_recover() from Gavin Shan
    - Revert "powerpc/eeh: Fix crash in eeh_add_device_early() on Cell"
    from Guilherme G Piccoli
    - Remove the dependency on EEH struct in DDW mechanism from Guilherme
    G Piccoli

    selftests:
    - Test cp_abort during context switch from Chris Smart
    - Add several tests for transactional memory support from Rashmica
    Gupta

    perf:
    - Add support for sampling interrupt register state from Anju T
    - Add support for unwinding perf-stackdump from Chandan Kumar

    cxl:
    - Configure the PSL for two CAPI ports on POWER8NVL from Philippe
    Bergheaud
    - Allow initialization on timebase sync failures from Frederic Barrat
    - Increase timeout for detection of AFU mmio hang from Frederic
    Barrat
    - Handle num_of_processes larger than can fit in the SPA from Ian
    Munsie
    - Ensure PSL interrupt is configured for contexts with no AFU IRQs
    from Ian Munsie
    - Add kernel API to allow a context to operate with relocate disabled
    from Ian Munsie
    - Check periodically the coherent platform function's state from
    Christophe Lombard

    Freescale:
    - Updates from Scott: "Contains 86xx fixes, minor device tree fixes,
    an erratum workaround, and a kconfig dependency fix."

    * tag 'powerpc-4.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (192 commits)
    powerpc/86xx: Fix PCI interrupt map definition
    powerpc/86xx: Move pci1 definition to the include file
    powerpc/fsl: Fix build of the dtb embedded kernel images
    powerpc/fsl: Fix rcpm compatible string
    powerpc/fsl: Remove FSL_SOC dependency from FSL_LBC
    powerpc/fsl-pci: Add a workaround for PCI 5 errata
    powerpc/fsl: Fix SPI compatible on t208xrdb and t1040rdb
    powerpc/powernv/npu: Add PE to PHB's list
    powerpc/powernv: Fix insufficient memory allocation
    powerpc/iommu: Remove the dependency on EEH struct in DDW mechanism
    Revert "powerpc/eeh: Fix crash in eeh_add_device_early() on Cell"
    powerpc/eeh: Drop unnecessary label in eeh_pe_change_owner()
    powerpc/eeh: Ignore handlers in eeh_pe_reset_and_recover()
    powerpc/eeh: Restore initial state in eeh_pe_reset_and_recover()
    powerpc/eeh: Don't report error in eeh_pe_reset_and_recover()
    Revert "powerpc/powernv: Exclude root bus in pnv_pci_reset_secondary_bus()"
    powerpc/powernv/npu: Enable NVLink pass through
    powerpc/powernv/npu: Rework TCE Kill handling
    powerpc/powernv/npu: Add set/unset window helpers
    powerpc/powernv/ioda2: Export debug helper pe_level_printk()
    ...

    Linus Torvalds
     

20 May, 2016

1 commit

  • Pull MIPS updates from Ralf Baechle:
    "This is the main pull request for MIPS for 4.7. Here's the summary of
    the changes:

    - ATH79: Support for DTB passuing using the UHI boot protocol
    - ATH79: Remove support for builtin DTB.
    - ATH79: Add zboot debug serial support.
    - ATH79: Add initial support for Dragino MS14 (Dragine 2), Onion Omega
    and DPT-Module.
    - ATH79: Update devicetree clock support for AR9132 and AR9331.
    - ATH79: Cleanup the DT code.
    - ATH79: Support newer SOCs in ath79_ddr_ctrl_init.
    - ATH79: Fix regression in PCI window initialization.
    - BCM47xx: Move SPROM driver to drivers/firmware/
    - BCM63xx: Enable partition parser in defconfig.
    - BMIPS: BMIPS5000 has I cache filing from D cache
    - BMIPS: BMIPS: Add cpu-feature-overrides.h
    - BMIPS: Add Whirlwind support
    - BMIPS: Adjust mips-hpt-frequency for BCM7435
    - BMIPS: Remove maxcpus from BCM97435SVMB DTS
    - BMIPS: Add missing 7038 L1 register cells to BCM7435
    - BMIPS: Various tweaks to initialization code.
    - BMIPS: Enable partition parser in defconfig.
    - BMIPS: Cache tweaks.
    - BMIPS: Add UART, I2C and SATA devices to DT.
    - BMIPS: Add BCM6358 and BCM63268support
    - BMIPS: Add device tree example for BCM6358.
    - BMIPS: Improve Improve BCM6328 and BCM6368 device trees
    - Lantiq: Add support for device tree file from boot loader
    - Lantiq: Allow build with no built-in DT.
    - Loongson 3: Reserve 32MB for RS780E integrated GPU.
    - Loongson 3: Fix build error after ld-version.sh modification
    - Loongson 3: Move chipset ACPI code from drivers to arch.
    - Loongson 3: Speedup irq processing.
    - Loongson 3: Add basic Loongson 3A support.
    - Loongson 3: Set cache flush handlers to nop.
    - Loongson 3: Invalidate special TLBs when needed.
    - Loongson 3: Fast TLB refill handler.
    - MT7620: Fallback strategy for invalid syscfg0.
    - Netlogic: Fix CP0_EBASE redefinition warnings
    - Octeon: Initialization fixes
    - Octeon: Add DTS files for the D-Link DSR-1000N and EdgeRouter Lite
    - Octeon: Enable add Octeon-drivers in cavium_octeon_defconfig
    - Octeon: Correctly handle endian-swapped initramfs images.
    - Octeon: Support CN73xx, CN75xx and CN78xx.
    - Octeon: Remove dead code from cvmx-sysinfo.
    - Octeon: Extend number of supported CPUs past 32.
    - Octeon: Remove some code limiting NR_IRQS to 255.
    - Octeon: Simplify octeon_irq_ciu_gpio_set_type.
    - Octeon: Mark some functions __init in smp.c
    - Octeon: Octeon: Add Octeon III CN7xxx interface detection
    - PIC32: Add serial driver and bindings for it.
    - PIC32: Add PIC32 deadman timer driver and bindings.
    - PIC32: Add PIC32 clock timer driver and bindings.
    - Pistachio: Determine SoC revision during boot
    - Sibyte: Fix Kconfig dependencies of SIBYTE_BUS_WATCHER.
    - Sibyte: Strip redundant comments from bcm1480_regs.h.
    - Panic immediately if panic_on_oops is set.
    - module: fix incorrect IS_ERR_VALUE macro usage.
    - module: Make consistent use of pr_*
    - Remove no longer needed work_on_cpu() call.
    - Remove CONFIG_IPV6_PRIVACY from defconfigs.
    - Fix registers of non-crashing CPUs in dumps.
    - Handle MIPSisms in new vmcore_elf32_check_arch.
    - Select CONFIG_HANDLE_DOMAIN_IRQ and make it work.
    - Allow RIXI to be used on non-R2 or R6 cores.
    - Reserve nosave data for hibernation
    - Fix siginfo.h to use strict POSIX types.
    - Don't unwind user mode with EVA.
    - Fix watchpoint restoration
    - Ptrace watchpoints for R6.
    - Sync icache when it fills from dcache
    - I6400 I-cache fills from dcache.
    - Various MSA fixes.
    - Cleanup MIPS_CPU_* definitions.
    - Signal: Move generic copy_siginfo to signal.h
    - Signal: Fix uapi include in exported asm/siginfo.h
    - Timer fixes for sake of KVM.
    - XPA TLB refill fixes.
    - Treat perf counter feature
    - Update John Crispin's email address
    - Add PIC32 watchdog and bindings.
    - Handle R10000 LL/SC bug in set_pte()
    - cpufreq: Various fixes for Longson1.
    - R6: Fix R2 emulation.
    - mathemu: Cosmetic fix to ADDIUPC emulation, plenty of other small fixes
    - ELF: ABI and FP fixes.
    - Allow for relocatable kernel and use that to support KASLR.
    - Fix CPC_BASE_ADDR mask
    - Plenty fo smp-cps, CM, R6 and M6250 fixes.
    - Make reset_control_ops const.
    - Fix kernel command line handling of leading whitespace.
    - Cleanups to cache handling.
    - Add brcm, bcm6345-l1-intc device tree bindings.
    - Use generic clkdev.h header
    - Remove CLK_IS_ROOT usage.
    - Misc small cleanups.
    - CM: Fix compilation error when !MIPS_CM
    - oprofile: Fix a preemption issue
    - Detect DSP ASE v3 support:1"

    * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (275 commits)
    MIPS: pic32mzda: fix getting timer clock rate.
    MIPS: ath79: fix regression in PCI window initialization
    MIPS: ath79: make ath79_ddr_ctrl_init() compatible for newer SoCs
    MIPS: Fix VZ probe gas errors with binutils of MSA context in non-MSA kernels
    MIPS: cevt-r4k: Dynamically calculate min_delta_ns
    MIPS: malta-time: Take seconds into account
    MIPS: malta-time: Start GIC count before syncing to RTC
    MIPS: Force CPUs to lose FP context during mode switches
    ...

    Linus Torvalds
     

18 May, 2016

4 commits

  • simplified goto out in cpufreq_register_driver for increasing
    code readability

    Signed-off-by: Pankaj Gupta
    Signed-off-by: Sanjeev Yadav
    Acked-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Pankaj Gupta
     
  • None of the cpufreq governors currently in the tree will ever fail
    an invocation of the ->governor() callback with the event argument
    equal to CPUFREQ_GOV_STOP (unless invoked with incorrect arguments
    which doesn't matter anyway) and it is rather difficult to imagine
    a valid reason for such a failure.

    Accordingly, rearrange the code in the core to make it clear that
    this call never fails.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Viresh Kumar

    Rafael J. Wysocki
     
  • None of the cpufreq governors currently in the tree will ever fail
    an invocation of the ->governor() callback with the event argument
    equal to CPUFREQ_GOV_POLICY_EXIT (unless invoked with incorrect
    arguments which doesn't matter anyway) and it wouldn't really
    make sense to fail it, because the caller won't be able to handle
    that failure in a meaningful way.

    Accordingly, rearrange the code in the core to make it clear that
    this call never fails.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Viresh Kumar

    Rafael J. Wysocki
     
  • One of the if () statements in intel_pstate_set_policy() causes
    another if () to be evaluated if the condition is true and it
    doesn't do anything else, so merge the two if () statements into
    one.

    No functional changes.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Srinivas Pandruvada

    Rafael J. Wysocki
     

17 May, 2016

3 commits

  • MT8173 cpufreq driver select of_cpufreq_power_cooling_register registering
    cooling devices with dynamic power coefficient.

    Acked-by: Viresh Kumar
    Signed-off-by: Dawei Chien
    Signed-off-by: Eduardo Valentin

    Dawei Chien
     
  • Pull power management updates from Rafael Wysocki:
    "The majority of changes go into the cpufreq subsystem this time.

    To me, quite obviously, the biggest ticket item is the new "schedutil"
    governor. Interestingly enough, it's the first new cpufreq governor
    since the beginning of the git era (except for some out-of-the-tree
    ones).

    There are two main differences between it and the existing governors.
    First, it uses the information provided by the scheduler directly for
    making its decisions, so it doesn't have to track anything by itself.
    Second, it can invoke drivers (supporting that feature) to adjust CPU
    performance right away without having to spawn work items to be
    executed in process context or similar. Currently, the acpi-cpufreq
    driver is the only one supporting that mode of operation, but then it
    is used on a large number of systems.

    The "schedutil" governor as included here is very simple and mostly
    regarded as a foundation for future work on the integration of the
    scheduler with CPU power management (in fact, there is work in
    progress on top of it already). Nevertheless it works and the
    preliminary results obtained with it are encouraging.

    There also is some consolidation of CPU frequency management for ARM
    platforms that can add their machine IDs the the new stub dt-platdev
    driver now and that will take care of creating the requisite platform
    device for cpufreq-dt, so it is not necessary to do that in platform
    code any more. Several ARM platforms are switched over to using this
    generic mechanism.

    In addition to that, the intel_pstate driver is now going to respect
    CPU frequency limits set by the platform firmware (or a BMC) and
    provided via the ACPI _PPC object.

    The devfreq subsystem is getting a new "passive" governor for SoCs
    subsystems that will depend on somebody else to manage their voltage
    rails and its support for Samsung Exynos SoCs is consolidated.

    The rest is support for new hardware (Intel Broxton support in
    intel_idle for one example), bug fixes, optimizations and cleanups in
    a number of places.

    Specifics:

    - New cpufreq "schedutil" governor (making decisions based on CPU
    utilization information provided by the scheduler and capable of
    switching CPU frequencies right away if the underlying driver
    supports that) and support for fast frequency switching in the
    acpi-cpufreq driver (Rafael Wysocki)

    - Consolidation of CPU frequency management on ARM platforms allowing
    them to get rid of some platform-specific boilerplate code if they
    are going to use the cpufreq-dt driver (Viresh Kumar, Finley Xiao,
    Marc Gonzalez)

    - Support for ACPI _PPC and CPU frequency limits in the intel_pstate
    driver (Srinivas Pandruvada)

    - Fixes and cleanups in the cpufreq core and generic governor code
    (Rafael Wysocki, Sai Gurrappadi)

    - intel_pstate driver optimizations and cleanups (Rafael Wysocki,
    Philippe Longepe, Chen Yu, Joe Perches)

    - cpufreq powernv driver fixes and cleanups (Akshay Adiga, Shilpasri
    Bhat)

    - cpufreq qoriq driver fixes and cleanups (Jia Hongtao)

    - ACPI cpufreq driver cleanups (Viresh Kumar)

    - Assorted cpufreq driver updates (Ashwin Chaugule, Geliang Tang,
    Javier Martinez Canillas, Paul Gortmaker, Sudeep Holla)

    - Assorted cpufreq fixes and cleanups (Joe Perches, Arnd Bergmann)

    - Fixes and cleanups in the OPP (Operating Performance Points)
    framework, mostly related to OPP sharing, and reorganization of
    OF-dependent code in it (Viresh Kumar, Arnd Bergmann, Sudeep Holla)

    - New "passive" governor for devfreq (for SoC subsystems that will
    rely on someone else for the management of their power resources)
    and consolidation of devfreq support for Exynos platforms, coding
    style and typo fixes for devfreq (Chanwoo Choi, MyungJoo Ham)

    - PM core fixes and cleanups, mostly to make it work better with the
    generic power domains (genpd) framework, and updates for that
    framework (Ulf Hansson, Thierry Reding, Colin Ian King)

    - Intel Broxton support for the intel_idle driver (Len Brown)

    - cpuidle core optimization and fix (Daniel Lezcano, Dave Gerlach)

    - ARM cpuidle cleanups (Jisheng Zhang)

    - Intel Kabylake support for the RAPL power capping driver (Jacob
    Pan)

    - AVS (Adaptive Voltage Switching) rockchip-io driver update (Heiko
    Stuebner)

    - Updates for the cpupower tool (Arjun Sreedharan, Colin Ian King,
    Mattia Dongili, Thomas Renninger)"

    * tag 'pm-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (112 commits)
    intel_pstate: Clean up get_target_pstate_use_performance()
    intel_pstate: Use sample.core_avg_perf in get_avg_pstate()
    intel_pstate: Clarify average performance computation
    intel_pstate: Avoid unnecessary synchronize_sched() during initialization
    cpufreq: schedutil: Make default depend on CONFIG_SMP
    cpufreq: powernv: del_timer_sync when global and local pstate are equal
    cpufreq: powernv: Move smp_call_function_any() out of irq safe block
    intel_pstate: Clean up intel_pstate_get()
    cpufreq: schedutil: Make it depend on CONFIG_SMP
    cpufreq: governor: Fix handling of special cases in dbs_update()
    PM / OPP: Move CONFIG_OF dependent code in a separate file
    cpufreq: intel_pstate: Ignore _PPC processing under HWP
    cpufreq: arm_big_little: use generic OPP functions for {init, free}_opp_table
    PM / OPP: add non-OF versions of dev_pm_opp_{cpumask_, }remove_table
    cpufreq: tango: Use generic platdev driver
    PM / OPP: pass cpumask by reference
    cpufreq: Fix GOV_LIMITS handling for the userspace governor
    cpupower: fix potential memory leak
    PM / devfreq: style/typo fixes
    PM / devfreq: exynos: Add the detailed correlation for Exynos5422 bus
    ..

    Linus Torvalds
     
  • Pull x86 asm updates from Ingo Molnar:
    "The main changes in this cycle were:

    - MSR access API fixes and enhancements (Andy Lutomirski)

    - early exception handling improvements (Andy Lutomirski)

    - user-space FS/GS prctl usage fixes and improvements (Andy
    Lutomirski)

    - Remove the cpu_has_*() APIs and replace them with equivalents
    (Borislav Petkov)

    - task switch micro-optimization (Brian Gerst)

    - 32-bit entry code simplification (Denys Vlasenko)

    - enhance PAT handling in enumated CPUs (Toshi Kani)

    ... and lots of other cleanups/fixlets"

    * 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (70 commits)
    x86/arch_prctl/64: Restore accidentally removed put_cpu() in ARCH_SET_GS
    x86/entry/32: Remove asmlinkage_protect()
    x86/entry/32: Remove GET_THREAD_INFO() from entry code
    x86/entry, sched/x86: Don't save/restore EFLAGS on task switch
    x86/asm/entry/32: Simplify pushes of zeroed pt_regs->REGs
    selftests/x86/ldt_gdt: Test set_thread_area() deletion of an active segment
    x86/tls: Synchronize segment registers in set_thread_area()
    x86/asm/64: Rename thread_struct's fs and gs to fsbase and gsbase
    x86/arch_prctl/64: Remove FSBASE/GSBASE < 4G optimization
    x86/segments/64: When load_gs_index fails, clear the base
    x86/segments/64: When loadsegment(fs, ...) fails, clear the base
    x86/asm: Make asm/alternative.h safe from assembly
    x86/asm: Stop depending on ptrace.h in alternative.h
    x86/entry: Rename is_{ia32,x32}_task() to in_{ia32,x32}_syscall()
    x86/asm: Make sure verify_cpu() has a good stack
    x86/extable: Add a comment about early exception handlers
    x86/msr: Set the return value to zero when native_rdmsr_safe() fails
    x86/paravirt: Make "unsafe" MSR accesses unsafe even if PARAVIRT=y
    x86/paravirt: Add paravirt_{read,write}_msr()
    x86/msr: Carry on after a non-"safe" MSR access fails
    ...

    Linus Torvalds
     

13 May, 2016

5 commits

  • This patch replaces goto out with return in ls1x_cpufreq_probe().

    Signed-off-by: Kelvin Cheung
    Acked-by: Viresh Kumar
    Cc: Rafael J. Wysocki
    Cc: linux-pm@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/13056/
    Signed-off-by: Ralf Baechle

    Kelvin Cheung
     
  • This patch uses devm_kzalloc() instead of global structure.

    Signed-off-by: Kelvin Cheung
    Acked-by: Viresh Kumar
    Cc: Rafael J. Wysocki
    Cc: linux-pm@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/13055/
    Signed-off-by: Ralf Baechle

    Kelvin Cheung
     
  • This patch uses dev_get_platdata() to get the platform_data
    instead of referencing it directly.

    Signed-off-by: Kelvin Cheung
    Acked-by: Viresh Kumar
    Cc: Rafael J. Wysocki
    Cc: linux-pm@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/13054/
    Signed-off-by: Ralf Baechle

    Kelvin Cheung
     
  • This patch replaces kzalloc() with kcalloc() when allocating
    frequency table, and remove unnecessary 'out of memory' message.

    Signed-off-by: Kelvin Cheung
    Acked-by: Viresh Kumar
    Cc: Rafael J. Wysocki
    Cc: linux-pm@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/13053/
    Signed-off-by: Ralf Baechle

    Kelvin Cheung
     
  • This patch renames the file to loongson1-cpufreq.c,
    and also includes some minor updates.

    Signed-off-by: Kelvin Cheung
    Acked-by: Viresh Kumar
    Cc: Rafael J. Wysocki
    Cc: linux-pm@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/13052/
    Signed-off-by: Ralf Baechle

    Kelvin Cheung
     

12 May, 2016

6 commits

  • The comments and the core_busy variable name in
    get_target_pstate_use_performance() are totally confusing,
    so modify them to reflect what's going on.

    The results of the computations should be the same as before.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Notice that get_avg_pstate() can use sample.core_avg_perf instead of
    carrying the same division again, so make it do that.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • The core_pct_busy field of struct sample actually contains the
    average performace during the last sampling period (in percent)
    and not the utilization of the core as suggested by its name
    which is confusing.

    For this reason, change the name of that field to core_avg_perf
    and rename the function that computes its value accordingly.

    Also notice that storing this value as percentage requires a costly
    integer multiplication to be carried out in a hot path, so instead
    store it as an "extended fixed point" value with more fraction bits
    and update the code using it accordingly (it is better to change the
    name of the field along with its meaning in one go than to make those
    two changes separately, as that would likely lead to more
    confusion).

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Currently, in intel_pstate_clear_update_util_hook(), after
    clearing the utilization update hook, we leverage
    synchronize_sched() to deal with synchronization, which
    is a little bit time-costly because synchronize_sched()
    has to wait for all the CPUs to go through a grace period.

    Actually, the synchronize_sched() is not necessary if the utilization
    update hook has not been set for the given CPU yet, so make the driver
    check if that's the case and avoid the synchronize_sched() call then.

    Link: https://bugzilla.kernel.org/show_bug.cgi?id=116371
    Tested-by: Tian Ye
    Signed-off-by: Chen Yu
    [ rjw : Rebase ]
    Signed-off-by: Rafael J. Wysocki

    Chen Yu
     
  • Rafael J. Wysocki
     
  • CPU_FREQ_GOV_SCHEDUTIL gained a dependency on SMP, so now we
    get a warning if it gets selected by CPU_FREQ_DEFAULT_GOV_SCHEDUTIL
    without SMP:

    warning: (CPU_FREQ_DEFAULT_GOV_SCHEDUTIL) selects CPU_FREQ_GOV_SCHEDUTIL which has unmet direct dependencies (CPU_FREQ && SMP)

    This adds another dependency to avoid the problem.

    Signed-off-by: Arnd Bergmann
    Fixes: bf7cdff19429 (cpufreq: schedutil: Make it depend on CONFIG_SMP)
    Signed-off-by: Rafael J. Wysocki

    Arnd Bergmann
     

11 May, 2016

2 commits

  • When global and local pstate are equal in a powernv_target_index() call,
    we don't queue a timer. But we may have timer already queued for future.
    This could cause the timer to fire one additional time for no use.

    Signed-off-by: Akshay Adiga
    Acked-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Akshay Adiga
     
  • Fix a WARN_ON caused by smp_call_function_any() when irq is disabled,
    because of changes made in the patch ('cpufreq: powernv: Ramp-down
    global pstate slower than local-pstate')
    https://patchwork.ozlabs.org/patch/612058/

    WARNING: CPU: 0 PID: 4 at kernel/smp.c:291
    smp_call_function_single+0x170/0x180

    Call Trace:
    [c0000007f648f9f0] [c0000007f648fa90] 0xc0000007f648fa90 (unreliable)
    [c0000007f648fa30] [c0000000001430e0] smp_call_function_any+0x170/0x1c0
    [c0000007f648fa90] [c0000000007b4b00]
    powernv_cpufreq_target_index+0xe0/0x250
    [c0000007f648fb00] [c0000000007ac9dc]
    __cpufreq_driver_target+0x20c/0x3d0
    [c0000007f648fbc0] [c0000000007b1b4c] od_dbs_timer+0xcc/0x260
    [c0000007f648fc10] [c0000000007b3024] dbs_work_handler+0x54/0xa0
    [c0000007f648fc50] [c0000000000c49a8] process_one_work+0x1d8/0x590
    [c0000007f648fce0] [c0000000000c4e08] worker_thread+0xa8/0x660
    [c0000007f648fd80] [c0000000000cca88] kthread+0x108/0x130
    [c0000007f648fe30] [c0000000000095e8] ret_from_kernel_thread+0x5c/0x74

    - Calling smp_call_function_any() with interrupt disabled (through
    spin_lock_irqsave) could cause a deadlock, as smp_call_function_any()
    relies on the IPI to complete. This is detected in the
    smp_call_function_any() call and hence the WARN_ON.

    - As the spinlock (gpstates->lock) is only used to synchronize access of
    global_pstate_info between timer irq handler and target_index calls. And
    the timer irq handler just try_locks() hence it would not cause a
    deadlock. Hence could do without making spinlocks irq safe.

    - As the smp_call_function_any() is a blocking call and does not access
    global_pstates_info, it could reduce the critcal section by moving
    smp_call_function_any() after giving up the lock.

    Reported-by: Abdul Haleem
    Signed-off-by: Akshay Adiga
    Acked-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Akshay Adiga
     

10 May, 2016

1 commit


09 May, 2016

1 commit


07 May, 2016

2 commits

  • Make the schedutil cpufreq governor depend on CONFIG_SMP, because
    the scheduler-provided utilization numbers used by it are only
    available with CONFIG_SMP set.

    Fixes: 9bdcb44e391d (cpufreq: schedutil: New governor based on scheduler utilization data)
    Reported-by: Steve Muckle
    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • * pm-cpufreq-fixes:
    intel_pstate: Fix intel_pstate_get()
    cpufreq: intel_pstate: Fix HWP on boot CPU after system resume
    cpufreq: st: enable selective initialization based on the platform
    cpufreq: intel_pstate: Fix processing for turbo activation ratio

    Rafael J. Wysocki
     

06 May, 2016

2 commits

  • As reported in KBZ 69821:

    "With CONFIG_HZ_PERIODIC=y cpu stays at the lowest frequcency 800MHz
    even if usage goes to 100%, frequency does not scale up, the governor
    in use is ondemand. Neither works conservative. Performance and
    userspace governors work as expected.

    With CONFIG_NO_HZ_IDLE or CONFIG_NO_HZ_FULL cpu scales up with ondemand
    as expected."

    Analysis carried out by Chen Yu leads to the conclusion that the
    observed issue is due to idle_time in dbs_update() representing a
    negative number in which case the function will return 0 as the load
    (unless load is greater than 0 for another CPU sharing the policy),
    although that need not be the right choice.

    Indeed, idle_time representing a negative number means that during
    the last sampling interval the CPU was almost 100% busy on the rough
    average, so 100 should be returned as the load in that case.

    Modify the code accordingly and rearrange it to clarify the handling
    of all of the special cases in it. While at it, also avoid returning
    zero as the load if time_elapsed is 0 (it doesn't really make sense
    to return 0 then).

    Link: https://bugzilla.kernel.org/show_bug.cgi?id=69821
    Tested-by: Chen Yu
    Tested-by: Timo Valtoaho
    Signed-off-by: Rafael J. Wysocki
    Acked-by: Viresh Kumar

    Rafael J. Wysocki
     
  • * pm-opp-fixes:
    PM / OPP: Remove useless check

    * pm-cpufreq-fixes:
    intel_pstate: Fix intel_pstate_get()
    cpufreq: intel_pstate: Fix HWP on boot CPU after system resume
    cpufreq: st: enable selective initialization based on the platform

    * pm-cpuidle-fixes:
    ARM: cpuidle: Pass on arm_cpuidle_suspend()'s return value

    Rafael J. Wysocki
     

05 May, 2016

5 commits

  • Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • When HWP (hardware P states) feature is active, the ACPI _PSS and _PPC
    is not used. So ignore processing for _PPC limits.

    Signed-off-by: Srinivas Pandruvada
    Signed-off-by: Rafael J. Wysocki

    Srinivas Pandruvada
     
  • Currently when performing random CPU hot-plugs and suspend-to-ram(S2R)
    on systems using arm_big_little cpufreq driver, we get warnings similar
    to something like below:

    cpu cpu1: _opp_add: duplicate OPPs detected. Existing: freq: 600000000,
    volt: 800000, enabled: 1. New: freq: 600000000, volt: 800000, enabled: 1

    This is mainly because the OPPs for the shared cpus are not set. We can
    just use dev_pm_opp_of_cpumask_add_table in case the OPPs are obtained
    from DT(arm_big_little_dt.c) or use dev_pm_opp_set_sharing_cpus if the
    OPPs are obtained by other means like firmware(e.g. scpi-cpufreq.c)

    Also now that the generic dev_pm_opp{,_of}_cpumask_remove_table can
    handle removal of opp table and entries for all associated CPUs, we can
    re-use dev_pm_opp{,_of}_cpumask_remove_table as free_opp_table in
    cpufreq_arm_bL_ops.

    This patch makes necessary changes to reuse the generic OPP functions for
    {init,free}_opp_table and thereby eliminating the warnings.

    Signed-off-by: Sudeep Holla
    Acked-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Sudeep Holla
     
  • Add tango4 compatible string to the list.

    Signed-off-by: Marc Gonzalez
    Acked-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Marc Gonzalez
     
  • Currently, the userspace governor only updates frequency on GOV_LIMITS
    if policy->cur falls outside policy->{min/max}. However, it is also
    necessary to update current frequency on GOV_LIMITS to match the user
    requested value if it can be achieved within the new policy->{max/min}.

    This was previously the behaviour in the governor until commit d1922f0
    ("cpufreq: Simplify userspace governor") which incorrectly assumed that
    policy->cur == user requested frequency via scaling_setspeed. This won't
    be true if the user requested frequency falls outside policy->{min/max}.
    Ex: a temporary thermal cap throttled the user requested frequency.

    Fix this by storing the user requested frequency in a seperate variable.
    The governor will then try to achieve this request on every GOV_LIMITS
    change.

    Fixes: d1922f02562f (cpufreq: Simplify userspace governor)
    Signed-off-by: Sai Gurrappadi
    Acked-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Sai Gurrappadi
     

04 May, 2016

1 commit

  • After commit 8fa520af5081 "intel_pstate: Remove freq calculation from
    intel_pstate_calc_busy()" intel_pstate_get() calls get_avg_frequency()
    to compute the average frequency, which is problematic for two reasons.

    First, intel_pstate_get() may be invoked before the driver reads the
    CPU feedback registers for the first time and if that happens,
    get_avg_frequency() will attempt to divide by zero.

    Second, the get_avg_frequency() call in intel_pstate_get() is racy
    with respect to intel_pstate_sample() and it may end up returning
    completely meaningless values for this reason.

    Moreover, after commit 7349ec0470b6 "intel_pstate: Move
    intel_pstate_calc_busy() into get_target_pstate_use_performance()"
    sample.core_pct_busy is never computed on Atom, but it is used in
    intel_pstate_adjust_busy_pstate() in that case too.

    To address those problems notice that if sample.core_pct_busy
    was used in the average frequency computation carried out by
    get_avg_frequency(), both the divide by zero problem and the
    race with respect to intel_pstate_sample() would be avoided.

    Accordingly, move the invocation of intel_pstate_calc_busy() from
    get_target_pstate_use_performance() to intel_pstate_update_util(),
    which also will take care of the uninitialized sample.core_pct_busy
    on Atom, and modify get_avg_frequency() to use sample.core_pct_busy
    as per the above.

    Reported-by: kernel test robot
    Link: http://marc.info/?l=linux-kernel&m=146226437623173&w=4
    Fixes: 8fa520af5081 "intel_pstate: Remove freq calculation from intel_pstate_calc_busy()"
    Fixes: 7349ec0470b6 "intel_pstate: Move intel_pstate_calc_busy() into get_target_pstate_use_performance()"
    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

02 May, 2016

1 commit

  • Commit 41cfd64cf49fc "Update frequencies of policy->cpus only from
    ->set_policy()" changed the way the intel_pstate driver's ->set_policy
    callback updates the HWP (hardware-managed P-states) settings.
    A side effect of it is that if those settings are modified on the
    boot CPU during system suspend and wakeup, they will never be
    restored during subsequent system resume.

    To address this problem, allow cpufreq drivers that don't provide
    ->target or ->target_index callbacks to use ->suspend and ->resume
    callbacks and add a ->resume callback to intel_pstate to restore
    the HWP settings on the CPUs that belong to the given policy.

    Fixes: 41cfd64cf49fc "Update frequencies of policy->cpus only from ->set_policy()"
    Tested-by: Srinivas Pandruvada
    Signed-off-by: Rafael J. Wysocki
    Acked-by: Viresh Kumar

    Rafael J. Wysocki
     

01 May, 2016

1 commit