25 Mar, 2013

5 commits

  • With the addition of following patch:

    fcf8058 cpufreq: Simplify cpufreq_add_dev()

    cpufreq driver's .init() routine must initialize policy->cpus with
    mask of all possible CPUs (Online + Offline) that share the clock.
    Then the core would copy this mask onto policy->related_cpus and will
    reset policy->cpus to carry only online cpus.

    acpi-cpufreq driver wasn't updated with this assumption and so
    sometimes when we try to hot[un]plug CPUs at run time, sysfs
    directories get corrupted.

    This patch fixes acpi-cpufreq driver against this corruption.

    Reported-and-tested-by: Maciej Rutecki
    Tested-by: Borislav Petkov
    Signed-off-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     
  • In cpufreq_stats_free_sysfs() we aren't balancing calls to
    cpufreq_cpu_get() with cpufreq_cpu_put(). This will never let us have
    ref count to policy->kobj as zero.

    We will get a hang if somehow cpufreq_driver_unregister() is called.
    And that can happen when we compile our driver as module and
    insmod/rmmod it.

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

    viresh kumar
     
  • They are defined in coreboot (MSR_PLATFORM) and the other
    one is already defined in msr-index.h.

    Let's use those.

    Signed-off-by: Konrad Rzeszutek Wilk
    Acked-by: Viresh Kumar
    Acked-by: Dirk Brandewie
    Signed-off-by: Rafael J. Wysocki

    Konrad Rzeszutek Wilk
     
  • Use the correct pstate value to calculate the effective frequency.

    References: https://bugzilla.redhat.com/show_bug.cgi?id=923942
    Reported-by: Satish Balay
    Signed-off-by: Dirk Brandewie
    Signed-off-by: Rafael J. Wysocki

    Dirk Brandewie
     
  • Some VMs seem to try to implement some MSRs but not all the registers
    the driver needs. Check to make sure all the MSR that we need are
    available. If any of the required MSRs are not available refuse to
    load.

    References: https://bugzilla.redhat.com/show_bug.cgi?id=922923
    Reported-by: Josh Stone
    Signed-off-by: Dirk Brandewie
    Acked-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Dirk Brandewie
     

07 Mar, 2013

2 commits


04 Mar, 2013

2 commits


26 Feb, 2013

1 commit

  • Pull ACPI and power management fixes from Rafael Wysocki:

    - Fixes for blackfin and microblaze build problems introduced by the
    removal of global pm_idle. From Lars-Peter Clausen.

    - OPP core build fix from Shawn Guo.

    - Error condition check fix for the new imx6q-cpufreq driver from Wei
    Yongjun.

    - Fix for an AER driver crash related to the lack of APEI
    initialization for acpi=off. From Rafael J Wysocki.

    - Fix for a USB breakage on Thinkpad T430 related to ACPI power
    resources and PCI wakeup from Rafael J. Wysocki.

    * tag 'pm+acpi-fixes-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    ACPI / PM: Take unusual configurations of power resources into account
    imx6q-cpufreq: fix return value check in imx6q_cpufreq_probe()
    PM / OPP: fix condition for empty of_init_opp_table()
    ACPI / APEI: Fix crash in apei_hest_parse() for acpi=off
    microblaze idle: Fix compile error
    blackfin idle: Fix compile error

    Linus Torvalds
     

23 Feb, 2013

2 commits


22 Feb, 2013

3 commits

  • Pull ARM SoC driver specific changes from Arnd Bergmann:

    - Updates to the ux500 cpufreq code

    - Moving the u300 DMA controller driver to drivers/dma

    - Moving versatile express drivers out of arch/arm for sharing with arch/arm64

    - Device tree bindings for the OMAP General Purpose Memory Controller

    * tag 'drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (27 commits)
    ARM: OMAP2+: gpmc: Add device tree documentation for elm handle
    ARM: OMAP2+: gpmc: add DT bindings for OneNAND
    ARM: OMAP2+: gpmc-onenand: drop __init annotation
    mtd: omap-onenand: pass device_node in platform data
    ARM: OMAP2+: Prevent potential crash if GPMC probe fails
    ARM: OMAP2+: gpmc: Remove unneeded of_node_put()
    arm: Move sp810.h to include/linux/amba/
    ARM: OMAP: gpmc: add DT bindings for GPMC timings and NAND
    ARM: OMAP: gpmc: enable hwecc for AM33xx SoCs
    ARM: OMAP: gpmc-nand: drop __init annotation
    mtd: omap-nand: pass device_node in platform data
    ARM: OMAP: gpmc: don't create devices from initcall on DT
    dma: coh901318: cut down on platform data abstraction
    dma: coh901318: merge header files
    dma: coh901318: push definitions into driver
    dma: coh901318: push header down into the DMA subsystem
    dma: coh901318: skip hard-coded addresses
    dma: coh901318: remove hardcoded target addresses
    dma: coh901318: push platform data into driver
    dma: coh901318: create a proper platform data file
    ...

    Linus Torvalds
     
  • Pull ARM SoC cleanups from Arnd Bergmann:
    "A large number of cleanups, all over the platforms. This is dominated
    largely by the Samsung platforms (s3c, s5p, exynos) and a few of the
    others moving code out of arch/arm into more appropriate subsystems.

    The clocksource and irqchip drivers are now abstracted to the point
    where platforms that are already cleaned up do not need to even
    specify the driver they use, it can all get configured from the device
    tree as we do for normal device drivers. The clocksource changes
    basically touch every single platform in the process.

    We further clean up the use of platform specific header files here,
    with the goal of turning more of the platforms over to being
    "multiplatform" enabled, which implies that they cannot expose their
    headers to architecture independent code any more.

    It is expected that no functional changes are part of the cleanup.
    The overall reduction in total code lines is mostly the result of
    removing broken and obsolete code."

    * tag 'cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (133 commits)
    ARM: mvebu: correct gated clock documentation
    ARM: kirkwood: add missing include for nsa310
    ARM: exynos: move exynos4210-combiner to drivers/irqchip
    mfd: db8500-prcmu: update resource passing
    drivers/db8500-cpufreq: delete dangling include
    ARM: at91: remove NEOCORE 926 board
    sunxi: Cleanup the reset code and add meaningful registers defines
    ARM: S3C24XX: header mach/regs-mem.h local
    ARM: S3C24XX: header mach/regs-power.h local
    ARM: S3C24XX: header mach/regs-s3c2412-mem.h local
    ARM: S3C24XX: Remove plat-s3c24xx directory in arch/arm/
    ARM: S3C24XX: transform s3c2443 subirqs into new structure
    ARM: S3C24XX: modify s3c2443 irq init to initialize all irqs
    ARM: S3C24XX: move s3c2443 irq code to irq.c
    ARM: S3C24XX: transform s3c2416 irqs into new structure
    ARM: S3C24XX: modify s3c2416 irq init to initialize all irqs
    ARM: S3C24XX: move s3c2416 irq init to common irq code
    ARM: S3C24XX: Modify s3c_irq_wake to use the hwirq property
    ARM: S3C24XX: Move irq syscore-ops to irq-pm
    clocksource: always define CLOCKSOURCE_OF_DECLARE
    ...

    Linus Torvalds
     
  • Pull driver core patches from Greg Kroah-Hartman:
    "Here is the big driver core merge for 3.9-rc1

    There are two major series here, both of which touch lots of drivers
    all over the kernel, and will cause you some merge conflicts:

    - add a new function called devm_ioremap_resource() to properly be
    able to check return values.

    - remove CONFIG_EXPERIMENTAL

    Other than those patches, there's not much here, some minor fixes and
    updates"

    Fix up trivial conflicts

    * tag 'driver-core-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (221 commits)
    base: memory: fix soft/hard_offline_page permissions
    drivercore: Fix ordering between deferred_probe and exiting initcalls
    backlight: fix class_find_device() arguments
    TTY: mark tty_get_device call with the proper const values
    driver-core: constify data for class_find_device()
    firmware: Ignore abort check when no user-helper is used
    firmware: Reduce ifdef CONFIG_FW_LOADER_USER_HELPER
    firmware: Make user-mode helper optional
    firmware: Refactoring for splitting user-mode helper code
    Driver core: treat unregistered bus_types as having no devices
    watchdog: Convert to devm_ioremap_resource()
    thermal: Convert to devm_ioremap_resource()
    spi: Convert to devm_ioremap_resource()
    power: Convert to devm_ioremap_resource()
    mtd: Convert to devm_ioremap_resource()
    mmc: Convert to devm_ioremap_resource()
    mfd: Convert to devm_ioremap_resource()
    media: Convert to devm_ioremap_resource()
    iommu: Convert to devm_ioremap_resource()
    drm: Convert to devm_ioremap_resource()
    ...

    Linus Torvalds
     

17 Feb, 2013

1 commit


16 Feb, 2013

2 commits

  • When intel_pstate is configured into the kernel it will become the
    preferred scaling driver for processors that it supports. Allow the
    user to override this by adding:
    intel_pstate=disable
    on the kernel command line.

    Signed-off-by: Dirk Brandewie
    Signed-off-by: Rafael J. Wysocki

    Dirk Brandewie
     
  • Load order is important in order for intel_pstate to take over as the
    default scaling driver from acpi-cpufreq.

    If both are built-in, acpi-cpufreq uses late_initcall() and
    intel_pstate uses device_initcall() so it will be able to register as
    the scaling before acpi-cpufreq for the processors supported by
    intel_pstate.

    If acpi-cpufreq is built as a module then intel_pstate still gets
    first option to become the scaling driver.

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

    Dirk Brandewie
     

15 Feb, 2013

2 commits

  • …git/kgene/linux-samsung

    * 'next/cpufreq-exynos' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung:
    cpufreq: exynos: Fix hang in pm handler due to frequency mismatch
    cpufreq: exynos: Initialize return variable
    cpufreq: exynos: Fix unsigned variable being checked for negative value
    cpufreq: exynos: Get booting freq value in exynos_cpufreq_init
    cpufreq: exynos: Show list of available frequencies
    cpufreq: exynos: Add missing static
    cpufreq: exynos: Split exynos_target function into two functions
    cpufreq: exynos: Use APLL_FREQ macro for cpu divider value
    cpufreq: exynos: Check old & new frequency early
    cpufreq: exynos: Remove unused variable & IS_ERR

    Rafael J. Wysocki
     
  • * pm-cpufreq: (55 commits)
    cpufreq / intel_pstate: Fix 32 bit build
    cpufreq: conservative: Fix typos in comments
    cpufreq: ondemand: Fix typos in comments
    cpufreq: exynos: simplify .init() for setting policy->cpus
    cpufreq: kirkwood: Add a cpufreq driver for Marvell Kirkwood SoCs
    cpufreq/x86: Add P-state driver for sandy bridge.
    cpufreq_stats: do not remove sysfs files if frequency table is not present
    cpufreq: Do not track governor name for scaling drivers with internal governors.
    cpufreq: Only call cpufreq_out_of_sync() for driver that implement cpufreq_driver.target()
    cpufreq: Retrieve current frequency from scaling drivers with internal governors
    cpufreq: Fix locking issues
    cpufreq: Create a macro for unlock_policy_rwsem{read,write}
    cpufreq: Remove unused HOTPLUG_CPU code
    cpufreq: governors: Fix WARN_ON() for multi-policy platforms
    cpufreq: ondemand: Replace down_differential tuner with adj_up_threshold
    cpufreq / stats: Get rid of CPUFREQ_STATDEVICE_ATTR
    cpufreq: Don't check cpu_online(policy->cpu)
    cpufreq: add imx6q-cpufreq driver
    cpufreq: Don't remove sysfs link for policy->cpu
    cpufreq: Remove unnecessary use of policy->shared_type
    ...

    Rafael J. Wysocki
     

13 Feb, 2013

1 commit


12 Feb, 2013

2 commits

  • There was a dangling #include in the cpufreq
    file missing from commit
    7a4f26097d389c16c9956bc03b81532698d97d64
    "ARM: ux500: de-globalize "

    Causing build regressions when building with cpufreq
    support.

    Cc: arm@kernel.org
    Cc: Rafael J. Wysocki
    Signed-off-by: Linus Walleij

    Linus Walleij
     
  • Fixes 32 bit build.

    on i386:
    drivers/built-in.o: In function `intel_pstate_timer_func':
    intel_pstate.c:(.text+0x4ce97e): undefined reference to `__udivdi3'
    drivers/built-in.o: In function `intel_pstate_cpu_init':
    intel_pstate.c:(.cpuinit.text+0x974): undefined reference to `__udivdi3'

    Reported-by: Randy Dunlap
    Signed-off-by: Dirk Brandewie
    Signed-off-by: Rafael J. Wysocki

    Dirk Brandewie
     

09 Feb, 2013

17 commits

  • Fix a couple of typos in comments.

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

    Stratos Karafotis
     
  • Fix some typos in comments.

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

    Stratos Karafotis
     
  • With the recent changes in cpufreq core, we just need to set mask of all
    possible cpus into policy->cpus. Rest would be done by core.

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

    Viresh Kumar
     
  • The Marvell Kirkwood SoCs have simple cpufreq support in hardware. The
    CPU can either use the a high speed cpu clock, or the slower DDR
    clock. Add a driver to swap between these two clock sources.

    Signed-off-by: Andrew Lunn
    Acked-by: Jason Cooper
    Acked-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Andrew Lunn
     
  • Add a P-state driver for the Intel Sandy bridge processor. In cpufreq
    terminology this driver implements a scaling driver with an internal
    governor.

    When built into the the kernel this driver will be the preferred
    scaling driver for Sandy bridge processors.

    In addition to the interfaces provided by the cpufreq subsystem for
    controlling scaling drivers. The user may control the behavior of the
    driver via three sysfs files located in
    "/sys/devices/system/cpu/intel_pstate".

    max_perf_pct: limits the maximum P state that will be requested by
    the driver stated as a percentage of the avail performance.

    min_perf_pct: limits the minimum P state that will be requested by
    the driver stated as a percentage of the avail performance.

    no_turbo: limits the driver to selecting P states below the turbo
    frequency range.

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

    Dirk Brandewie
     
  • The sysfs files for cpufreq_stats are created in cpufreq_stats_create_table()
    called from cpufreq_stat_notifier_policy() when a policy is added to
    the cpu. cpufreq_stats_create_table() will not be called if the
    scaling driver does not export a frequency table to cpufreq. Use the
    same fence on tear down.

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

    Dirk Brandewie
     
  • Scaling drivers that implement internal governors do not have governor
    structures assocaited with them. Only track the name of the governor
    associated with the CPU if the driver does not implement
    cpufreq_driver.setpolicy()

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

    Dirk Brandewie
     
  • Scaling drivers that implement cpufreq_driver.setpolicy() have
    internal governors that do not signal changes via
    cpufreq_notify_transition() so the frequncy in the policy will almost
    certainly be different than the current frequncy. Only call
    cpufreq_out_of_sync() when the underlying driver implements
    cpufreq_driver.target()

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

    Dirk Brandewie
     
  • Scaling drivers that implement the cpufreq_driver.setpolicy() versus
    the cpufreq_driver.target() interface do not set policy->cur.

    Normally policy->cur is set during the call to cpufreq_driver.target()
    when the frequnecy request is made by the governor.

    If the scaling driver implements cpufreq_driver.setpolicy() and
    cpufreq_driver.get() interfaces use cpufreq_driver.get() to retrieve
    the current frequency.

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

    Dirk Brandewie
     
  • cpufreq core uses two locks:
    - cpufreq_driver_lock: General lock for driver and cpufreq_cpu_data array.
    - cpu_policy_rwsemfix locking: per CPU reader-writer semaphore designed to cure
    all cpufreq/hotplug/workqueue/etc related lock issues.

    These locks were not used properly and are placed against their principle
    (present before their definition) at various places. This patch is an attempt to
    fix their use.

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

    Viresh Kumar
     
  • On the lines of macro: lock_policy_rwsem, we can create another macro for
    unlock_policy_rwsem. Lets do it.

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

    Viresh Kumar
     
  • Because the sibling cpu of any online cpu is identified very early in
    cpufreq_add_dev(), below code is never executed. And so can be removed.

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

    Viresh Kumar
     
  • On multi-policy systems there is a single instance of governor for both the
    policies (if same governor is chosen for both policies). With the code update
    from following patches:

    8eeed09 cpufreq: governors: Get rid of dbs_data->enable field
    b394058 cpufreq: governors: Reset tunables only for cpufreq_unregister_governor()

    We are creating/removing sysfs directory of governor for for every call to
    GOV_START and STOP. This would fail for multi-policy system as there is a
    per-policy call to START/STOP.

    This patch reuses the governor->initialized variable to detect total users of
    governor.

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

    Viresh Kumar
     
  • In order to avoid the calculation of up_threshold - down_differential
    every time that the frequency must be decreased, we replace the
    down_differential tuner with the adj_up_threshold which keeps the
    difference across multiple checks.

    Update the adj_up_threshold only when the up_theshold is also updated.

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

    Stratos Karafotis
     
  • Macro "CPUFREQ_STATDEVICE_ATTR" is defined local to cpufreq_stats.c file and is
    almost a copy of the generic version present in cpufreq.h file. Lets use the
    generic version instead.

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

    Viresh Kumar
     
  • policy->cpu or cpus in policy->cpus can't be offline anymore. And so we don't
    need to check if they are online or not.

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

    Viresh Kumar
     
  • Add an imx6q-cpufreq driver for Freescale i.MX6Q SoC to handle the
    hardware specific frequency and voltage scaling requirements.

    The driver supports module build and is instantiated by the platform
    device/driver mechanism, so that it will not be instantiated on other
    platforms, as IMX is built with multiplatform support.

    Signed-off-by: Shawn Guo
    Reviewed-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Shawn Guo