28 Apr, 2016

2 commits

  • There are no more users of platform-data for cpufreq-dt driver, get rid
    of it.

    Signed-off-by: Viresh Kumar
    Reviewed-by: Stephen Boyd
    Acked-by: Arnd Bergmann
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     
  • Existing platforms, which do not support operating-points-v2, can
    explicitly tell the opp core that some of the CPUs share opp tables,
    with help of dev_pm_opp_set_sharing_cpus().

    For such platforms, explicitly ask the opp core to provide list of CPUs
    sharing the opp table with current cpu device, before falling back to
    platform data.

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

    Viresh Kumar
     

05 Apr, 2016

1 commit


11 Feb, 2016

9 commits


28 Jan, 2016

1 commit

  • gcc warns quite a bit about values returned from allocate_resources()
    in cpufreq-dt.c:

    cpufreq-dt.c: In function 'cpufreq_init':
    cpufreq-dt.c:327:6: error: 'cpu_dev' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    cpufreq-dt.c:197:17: note: 'cpu_dev' was declared here
    cpufreq-dt.c:376:2: error: 'cpu_clk' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    cpufreq-dt.c:199:14: note: 'cpu_clk' was declared here
    cpufreq-dt.c: In function 'dt_cpufreq_probe':
    cpufreq-dt.c:461:2: error: 'cpu_clk' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    cpufreq-dt.c:447:14: note: 'cpu_clk' was declared here

    The problem is that it's slightly hard for gcc to follow return
    codes across PTR_ERR() calls.

    This patch uses explicit assignments to the "ret" variable to make
    it easier for gcc to verify that the code is actually correct,
    without the need to add a bogus initialization.

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

    Arnd Bergmann
     

05 Jan, 2016

1 commit

  • The function can return negative values so it should be assigned
    to signed type.

    The problem has been detected using proposed semantic patch
    scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci.

    Link: http://permalink.gmane.org/gmane.linux.kernel/2038576
    Signed-off-by: Andrzej Hajda
    Acked-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Andrzej Hajda
     

10 Dec, 2015

1 commit


15 Sep, 2015

2 commits


09 Sep, 2015

1 commit


03 Sep, 2015

3 commits

  • Tolerance applies on both sides of the target voltage, i.e. both min and
    max sides. But while checking if a voltage is supported by the regulator
    or not, we haven't taken care of tolerance on the lower side. Fix that.

    Cc: Lucas Stach
    Fixes: 045ee45c4ff2 ("cpufreq: cpufreq-dt: disable unsupported OPPs")
    Signed-off-by: Viresh Kumar
    Reviewed-by: Lucas Stach
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     
  • We need to explicitly mark OPPs as shared, when they are not defined
    with OPP-v2 bindings. This operation can potentially fail, and in that
    case we should at least print an error message.

    Fixes: 2e02d8723edf ("cpufreq: dt: Add support for operating-points-v2 bindings")
    Signed-off-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     
  • We need to explicitly mark OPPs as shared, when they are not defined
    with OPP-v2 bindings. But this isn't required to be done if we failed to
    initialize OPP table.

    Reorder code to verify OPP count before marking them shared.

    Fixes: 2e02d8723edf ("cpufreq: dt: Add support for operating-points-v2 bindings")
    Signed-off-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     

08 Aug, 2015

1 commit


07 Aug, 2015

2 commits

  • With opp-v2 DT bindings, few OPPs can be used only for the boost mode.
    But using such OPPs require the boost mode to be supported by cpufreq
    driver.

    We will parse DT bindings only during ->init() and so can enable boost
    support only after registering cpufreq driver.

    This enables boost support as soon as any policy has boost/turbo OPPs
    for its CPUs.

    We don't need to disable boost support as that is done by the core, when
    the driver is unregistered.

    Signed-off-by: Viresh Kumar
    Reviewed-by: Stephen Boyd
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     
  • Support for parsing operating-points-v2 bindings is in place now, lets
    modify cpufreq-dt driver to use them.

    For backward compatibility we will continue to support earlier bindings.
    Special handling for that is required, to make sure OPPs are initialized
    for all the CPUs.

    Reviewed-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Viresh Kumar
    Reviewed-by: Stephen Boyd
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     

17 Jun, 2015

1 commit


04 Feb, 2015

1 commit


30 Dec, 2014

1 commit

  • * pm-cpufreq:
    cpufreq: fix a NULL pointer dereference in __cpufreq_governor()
    cpufreq-dt: defer probing if OPP table is not ready

    * pm-cpuidle:
    cpuidle / ACPI: remove unused CPUIDLE_FLAG_TIME_INVALID
    cpuidle: ladder: Better idle duration measurement without using CPUIDLE_FLAG_TIME_INVALID
    cpuidle: menu: Better idle duration measurement without using CPUIDLE_FLAG_TIME_INVALID

    Rafael J. Wysocki
     

18 Dec, 2014

1 commit

  • cpufreq-dt driver supports mode when OPP table is provided by platform
    code and not device tree. However on certain platforms code that fills
    OPP table may run after cpufreq driver tries to initialize, so let's
    report -EPROBE_DEFER if we do not find any entires in OPP table for the
    CPU.

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

    Dmitry Torokhov
     

15 Dec, 2014

1 commit

  • Pull driver core update from Greg KH:
    "Here's the set of driver core patches for 3.19-rc1.

    They are dominated by the removal of the .owner field in platform
    drivers. They touch a lot of files, but they are "simple" changes,
    just removing a line in a structure.

    Other than that, a few minor driver core and debugfs changes. There
    are some ath9k patches coming in through this tree that have been
    acked by the wireless maintainers as they relied on the debugfs
    changes.

    Everything has been in linux-next for a while"

    * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits)
    Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries"
    fs: debugfs: add forward declaration for struct device type
    firmware class: Deletion of an unnecessary check before the function call "vunmap"
    firmware loader: fix hung task warning dump
    devcoredump: provide a one-way disable function
    device: Add dev__once variants
    ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries
    ath: use seq_file api for ath9k debugfs files
    debugfs: add helper function to create device related seq_file
    drivers/base: cacheinfo: remove noisy error boot message
    Revert "core: platform: add warning if driver has no owner"
    drivers: base: support cpu cache information interface to userspace via sysfs
    drivers: base: add cpu_device_create to support per-cpu devices
    topology: replace custom attribute macros with standard DEVICE_ATTR*
    cpumask: factor out show_cpumap into separate helper function
    driver core: Fix unbalanced device reference in drivers_probe
    driver core: fix race with userland in device_add()
    sysfs/kernfs: make read requests on pre-alloc files use the buffer.
    sysfs/kernfs: allow attributes to request write buffer be pre-allocated.
    fs: sysfs: return EGBIG on write if offset is larger than file size
    ...

    Linus Torvalds
     

13 Dec, 2014

1 commit

  • Pull trivial tree update from Jiri Kosina:
    "Usual stuff: documentation updates, printk() fixes, etc"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (24 commits)
    intel_ips: fix a type in error message
    cpufreq: cpufreq-dt: Move newline to end of error message
    ps3rom: fix error return code
    treewide: fix typo in printk and Kconfig
    ARM: dts: bcm63138: change "interupts" to "interrupts"
    Replace mentions of "list_struct" to "list_head"
    kernel: trace: fix printk message
    scsi: mpt2sas: fix ioctl in comment
    zbud, zswap: change module author email
    clocksource: Fix 'clcoksource' typo in comment
    arm: fix wording of "Crotex" in CONFIG_ARCH_EXYNOS3 help
    gpio: msm-v1: make boolean argument more obvious
    usb: Fix typo in usb-serial-simple.c
    PCI: Fix comment typo 'COMFIG_PM_OPS'
    powerpc: Fix comment typo 'CONIFG_8xx'
    powerpc: Fix comment typos 'CONFiG_ALTIVEC'
    clk: st: Spelling s/stucture/structure/
    isci: Spelling s/stucture/structure/
    usb: gadget: zero: Spelling s/infrastucture/infrastructure/
    treewide: Fix company name in module descriptions
    ...

    Linus Torvalds
     

01 Dec, 2014

1 commit


30 Nov, 2014

2 commits

  • Currently we are calling of_cpufreq_cooling_register() from ->init() callback.
    At this point of time cpufreq driver's policy isn't completely ready to be used
    as few of its fields/structure/pointers aren't yet initialized.

    Because of_cpufreq_cooling_register() tries to access policy with help of
    cpufreq_cpu_get() and then tries to get freq-table as well, these calls fail.

    To fix this, register the cooling device after the policy is ready to be used.
    And the right callback for it is the newly added ->ready() one.

    Signed-off-by: Viresh Kumar
    Reviewed-by: Eduardo Valentin
    Tested-by: Eduardo Valentin
    Reviewed-by: Lukasz Majewski
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     
  • The second parameter of of_cpufreq_cooling_register() should be the CPUs to
    which the frequency constraint will apply. As the cpufreq-dt driver now supports
    platforms with multiple 'struct cpufreq_policy' instances (i.e. > 1 clock
    domains for CPUs), passing 'cpu_present_mask' isn't correct anymore. As every
    policy will have a set of CPUs and that may not be equal to 'cpu_present_mask'
    always.

    So, pass only mask of CPUs which are controlled by current policy.

    Signed-off-by: Viresh Kumar
    Reviewed-by: Eduardo Valentin
    Tested-by: Eduardo Valentin
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     

20 Nov, 2014

1 commit


06 Nov, 2014

3 commits


04 Nov, 2014

1 commit


28 Oct, 2014

2 commits

  • Commit 34e5a5273d6aa0ee ("cpufreq: cpufreq-dt: extend with
    platform_data") changed cpufreq_init() to only call
    cpumask_setall(policy->cpus) if the platform data indicates that all
    CPUs share the same clock. Before, cpufreq_generic_init() did this
    unconditionally.

    This causes a crash on r8a7791/koelsch when resuming from s2ram:

    Enabling non-boot CPUs ...
    CPU1: Booted secondary processor
    Unable to handle kernel NULL pointer dereference at virtual address 0000003c
    pgd = ee71f980
    [0000003c] *pgd=6eeb6003, *pmd=6e0e9003, *pte=00000000
    Internal error: Oops: a07 [#1] SMP ARM
    Modules linked in:
    CPU: 0 PID: 1397 Comm: s2ram Tainted: G W 3.18.0-rc2-koelsch-00762-g7eed2a4e61d2d978 #581
    task: ee6b76c0 ti: ee7f0000 task.ti: ee7f0000
    PC is at __cpufreq_add_dev.isra.24+0x24c/0x77c
    LR is at __cpufreq_add_dev.isra.24+0x244/0x77c
    pc : [] lr : [] psr: 60000153
    sp : ee7f1d48 ip : ee7f1d48 fp : ee7f1d84
    r10: c04e8448 r9 : 00000000 r8 : 00000001
    r7 : c054a8c4 r6 : 00000001 r5 : 00000001 r4 : 00000000
    r3 : 00000000 r2 : 00000000 r1 : 20000153 r0 : c054a950
    Flags: nZCv IRQs on FIQs off Mode SVC_32 ISA ARM Segment user
    Control: 30c5307d Table: 6e71f980 DAC: fffffffd
    Process s2ram (pid: 1397, stack limit = 0xee7f0240)

    ...

    Backtrace:
    [] (__cpufreq_add_dev.isra.24) from [] (cpufreq_cpu_callback+0x6c/0x74)
    r10:eec75240 r9:c04e8448 r8:c04ef3a0 r7:00000001 r6:00000012 r5:00000000
    r4:00000012
    [] (cpufreq_cpu_callback) from [] (notifier_call_chain+0x48/0x70)
    r4:ffffffdd r3:c029e5b4
    [] (notifier_call_chain) from [] (__raw_notifier_call_chain+0x1c/0x24)
    r8:00000001 r7:00000010 r6:00000000 r5:00000000 r4:00000012 r3:ffffffff
    [] (__raw_notifier_call_chain) from [] (__cpu_notify+0x34/0x50)
    [] (__cpu_notify) from [] (cpu_notify+0x18/0x1c)
    r4:00000001
    [] (cpu_notify) from [] (_cpu_up+0x108/0x144)
    [] (_cpu_up) from [] (enable_nonboot_cpus+0x68/0xb8)
    r10:00000000 r9:c04e8ee6 r8:00000000 r7:00000003 r6:c04e8528 r5:c0506248
    r4:00000001
    [] (enable_nonboot_cpus) from [] (suspend_devices_and_enter+0x29c/0x3e8)
    r6:c0506e70 r5:00000000 r4:00000000 r3:60000153

    Restore the old default of calling cpumask_setall(policy->cpus) if no
    platform data is available to fix this.

    Fixes: 34e5a5273d6aa0ee (cpufreq: cpufreq-dt: extend with platform_data)
    Signed-off-by: Geert Uytterhoeven
    Reviewed-by: Thomas Petazzoni
    Signed-off-by: Rafael J. Wysocki

    Geert Uytterhoeven
     
  • If the regulator connected to the CPU voltage plane doesn't
    support an OPP specified voltage with the acceptable tolerance
    it's better to just disable the OPP instead of constantly
    failing the voltage scaling later on.

    Includes a fix to move initialization of opp_freq outside
    the loop to avoid an endless loop from Geert Uytterhoeven.

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Lucas Stach
    Acked-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Lucas Stach