24 Nov, 2011

1 commit


08 Nov, 2011

1 commit

  • Commit 32aaeffbd4a7457bf2f7448b33b5946ff2a960eb (Merge branch
    'modsplit-Oct31_2011'...) caused some build errors. Fix these
    and make sure we always have export.h or module.h included
    for MODULE_ and EXPORT_SYMBOL users:

    $ grep -rl ^MODULE_ arch/arm/*omap*/*.c | xargs \
    grep -L linux/module.h
    arch/arm/mach-omap2/dsp.c
    arch/arm/mach-omap2/mailbox.c
    arch/arm/mach-omap2/omap-iommu.c
    arch/arm/mach-omap2/smartreflex.c

    Also check we either have export.h or module.h included
    for the files exporting symbols:

    $ grep -rl EXPORT_SYMBOL arch/arm/*omap*/*.c | xargs \
    grep -L linux/export.h | xargs grep -L linux/module.h

    Cc: Russell King
    Signed-off-by: Tony Lindgren

    Tony Lindgren
     

02 Nov, 2011

1 commit

  • * 'next/pm' of git://git.linaro.org/people/arnd/arm-soc: (66 commits)
    ARM: CSR: PM: use outer_resume to resume L2 cache
    ARM: CSR: call l2x0_of_init to init L2 cache of SiRFprimaII
    ARM: OMAP: voltage: voltage layer present, even when CONFIG_PM=n
    ARM: CSR: PM: add sleep entry for SiRFprimaII
    ARM: CSR: PM: save/restore irq status in suspend cycle
    ARM: CSR: PM: save/restore timer status in suspend cycle
    OMAP4: PM: TWL6030: add cmd register
    OMAP4: PM: TWL6030: fix ON/RET/OFF voltages
    OMAP4: PM: TWL6030: address 0V conversions
    OMAP4: PM: TWL6030: fix uv to voltage for >0x39
    OMAP4: PM: TWL6030: fix voltage conversion formula
    omap: voltage: add a stub header file for external/regulator use
    OMAP2+: VC: more registers are per-channel starting with OMAP5
    OMAP3+: voltage: update nominal voltage in voltdm_scale() not VC post-scale
    OMAP3+: voltage: rename omap_voltage_get_nom_volt -> voltdm_get_voltage
    OMAP3+: voltdm: final removal of omap_vdd_info
    OMAP3+: voltage: move/rename curr_volt from vdd_info into struct voltagedomain
    OMAP3+: voltage: rename scale and reset functions using voltdm_ prefix
    OMAP3+: VP: combine setting init voltage into common function
    OMAP3+: VP: remove unused omap_vp_get_curr_volt()
    ...

    Fix up trivial conflict in arch/arm/mach-prima2/l2x0.c (code removal vs
    edit)

    Linus Torvalds
     

16 Sep, 2011

1 commit

  • Remove read-only debugfs interface to VP values. Most of the values
    are init-time only and never change. Current voltage value should be
    retreived from the (eventual) regulator framework interface to the
    voltage domain.

    Fixes to original version provided by Nishanth Menon

    Signed-off-by: Kevin Hilman

    Kevin Hilman
     

15 Sep, 2011

2 commits


06 Aug, 2011

2 commits

  • omap_sr_disable_reset_volt is called with irqs off in omapx_enter_sleep,
    as part of idle sequence, this eventually calls sr_disable and
    pm_runtime_put_sync. pm_runtime_put_sync calls rpm_idle, which will
    enable interrupts in order to call the callback. In this short interval
    when interrupts are enabled, scenarios such as the following can occur:
    while interrupts are enabled, the timer interrupt that is supposed to
    wake the device out of idle occurs and is acked, so when the CPU finally
    goes to off, the timer is already gone, missing a wakeup event.

    Further, as the documentation for runtime states:"
    However, subsystems can use the pm_runtime_irq_safe() helper function
    to tell the PM core that a device's ->runtime_suspend() and ->runtime_resume()
    callbacks should be invoked in atomic context with interrupts disabled
    (->runtime_idle() is still invoked the default way)."

    Hence, replace pm_runtime_put_sync with pm_runtime_put_sync_suspend
    to invoke the suspend handler and shut off the fclk for SmartReflex
    module instead of using the idle handler in interrupt disabled context.

    Signed-off-by: Nishanth Menon
    Signed-off-by: Colin Cross
    [khilman@ti.com: minor Subject edits]
    Signed-off-by: Kevin Hilman

    Colin Cross
     
  • SmartReflex should be disabled while entering low power mode due to
    a) SmartReflex values are not defined for retention voltage, further
    b) with SmartReflex enabled, if CPU enters lower c-states, FSM will try
    to bump the voltage to current OPP's voltage for which it has entered c-state;
    hence SmartReflex needs to be disabled for MPU, CORE and IVA voltage
    domains in idle path before enabling auto retention voltage achievement
    on the device.

    However, since the current pm_runtime setup for SmartReflex devices are
    setup to allow callbacks to be invoked with interrupts enabled, calling
    SmartReflex enable/disable from other contexts such as idle paths
    where preemption is disabled causes warnings such as the following
    indicating of a potential race.
    [ 82.023895] [] (__irq_svc+0x3c/0x120) from [] (_raw_spin_unlock_irq+0x28/0x2c)
    [ 82.023895] [] (_raw_spin_unlock_irq+0x28/0x2c) from [] (rpm_callback+0x4c/0x68)
    [ 82.023956] [] (rpm_callback+0x4c/0x68) from [] (rpm_resume+0x338/0x53c)
    [ 82.023956] [] (rpm_resume+0x338/0x53c) from [] (__pm_runtime_resume+0x48/0x60)
    [ 82.023986] [] (__pm_runtime_resume+0x48/0x60) from [] (sr_enable+0xa8/0x19c)
    [ 82.023986] [] (sr_enable+0xa8/0x19c) from [] (omap_sr_enable+0x50/0x90)
    [ 82.024017] [] (omap_sr_enable+0x50/0x90) from [] (omap4_enter_sleep+0x138/0x168)

    Instead, we use pm_runtime_irq_safe to tell the PM core that callbacks can be
    invoked in interrupt disabled contexts.

    Acked-by: Rajendra Nayak
    Signed-off-by: Nishanth Menon
    [khilman@ti.com: minor changelog edits]
    Signed-off-by: Kevin Hilman

    Nishanth Menon
     

21 Jun, 2011

4 commits

  • Error label case seems to have a 2 tab indentation when just 1 is
    necessary.

    Signed-off-by: Nishanth Menon
    Signed-off-by: Kevin Hilman

    Nishanth Menon
     
  • Since we already know the state of the autocomp enablement, we can
    see if the requested state is different from the current state and
    enable/disable SR only on the need basis.

    Signed-off-by: Nishanth Menon
    Signed-off-by: Kevin Hilman

    Nishanth Menon
     
  • We will enable and disable interrupt on a need basis in the class
    driver. We need to keep the IRQ disabled by default else the
    forceupdate or vcbypass events could trigger events that we don't
    need/expect to handle.

    This is a preparation for SmartReflex AVS class drivers such as
    class 2 and class 1.5 which would need to use interrupts. Existing
    SmartReflex AVS class 3 driver does not require to use interrupts
    and is not impacted by this change.

    Signed-off-by: Nishanth Menon
    Signed-off-by: Kevin Hilman

    Nishanth Menon
     
  • Interrupt notification mechanism of SmartReflex can be used by the
    choice of implementation of the class driver. For example, Class 2 and
    Class 1.5 of SmartReflex can both use the interrupt notification to
    identify the transition of voltage or other events.

    Hence, the actual class does not matter for notifier. Let the class
    driver's handling decide how it should be used. SmartReflex driver
    should provide just the primitives.

    Signed-off-by: Nishanth Menon
    Signed-off-by: Kevin Hilman

    Nishanth Menon
     

03 May, 2011

5 commits


31 Mar, 2011

1 commit


12 Mar, 2011

1 commit


11 Mar, 2011

1 commit


10 Mar, 2011

2 commits


08 Mar, 2011

1 commit

  • There's no reason for this header file to be in
    plat-omap/include/plat/smartreflex.h. The hardware devices are in
    OMAP2+ SoCs only. Leaving this header file in plat-omap causes
    problems due to cross-dependencies with other header files that should
    live in mach-omap2/.

    Thanks to Benoît Cousson for suggesting the removal
    of the smartreflex.h include from the OMAP3xxx hwmod data.

    Signed-off-by: Paul Walmsley
    Cc: Benoît Cousson

    Paul Walmsley
     

03 Mar, 2011

2 commits

  • This Patch frees all the dynamically allocated memory
    which couldn't have been released in some error hitting cases.

    Signed-off-by: Shweta Gulati
    Signed-off-by: Kevin Hilman

    Shweta Gulati
     
  • Temporary strings with volt_* file names should be released after the
    debugfs entries are created. While at it, also simplify the string
    allocation, and use just snprintf() to create the name.

    The patch eliminates kmemleak reports with the following stack trace
    (multiple objects depending on HW):

    unreferenced object 0xcedbc5a0 (size 64):
    comm "swapper", pid 1, jiffies 4294929375 (age 423.734s)
    hex dump (first 32 bytes):
    76 6f 6c 74 5f 39 37 35 30 30 30 00 00 00 00 00 volt_975000.....
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    backtrace:
    [] create_object+0x104/0x208
    [] kmem_cache_alloc_trace+0xf0/0x17c
    [] omap_sr_probe+0x314/0x420
    [] platform_drv_probe+0x18/0x1c
    [] driver_probe_device+0xc8/0x188
    [] __driver_attach+0x68/0x8c
    [] bus_for_each_dev+0x44/0x74
    [] bus_add_driver+0xa0/0x228
    [] driver_register+0xa8/0x130
    [] platform_driver_probe+0x18/0x8c
    [] sr_init+0x40/0x74
    [] do_one_initcall+0xc8/0x1a0
    [] kernel_init+0x150/0x218
    [] kernel_thread_exit+0x0/0x8
    [] 0xffffffff

    Signed-off-by: Aaro Koskinen
    Signed-off-by: Kevin Hilman

    Aaro Koskinen
     

08 Feb, 2011

1 commit


01 Feb, 2011

2 commits

  • These errors were found by cppcheck:
    arch/arm/mach-omap2/smartreflex.c:784: error: Possible null pointer dereference: sr_info
    arch/arm/mach-omap2/smartreflex.c:799: error: Possible null pointer dereference: sr_info

    Both conditional statements are executed when sr_info == NULL,
    so accessing sr_info->voltdm would fail.

    Cc: Russell King
    Cc: linux-omap@vger.kernel.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Stefan Weil
    Signed-off-by: Kevin Hilman

    Stefan Weil
     
  • sr_info was allocated and needs a kfree before returning.

    This error was reported by cppcheck:
    arch/arm/mach-omap2/smartreflex.c:837: error: Memory leak: sr_info

    To: Tony Lindgren
    Cc: Russell King
    Cc: linux-omap@vger.kernel.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Stefan Weil
    Acked-by: Shweta Gulati
    Signed-off-by: Kevin Hilman

    Stefan Weil
     

25 Jan, 2011

1 commit

  • Function _sr_lookup, defined in the same file, returns ERR_PTR not NULL in
    an error case.

    The semantic match that finds this problem is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @r@
    identifier f;
    @@
    f(...) { ... return ERR_PTR(...); }

    @@
    identifier r.f, fld;
    expression x;
    statement S1,S2;
    @@
    x = f(...)
    ... when != IS_ERR(x)
    (
    if (IS_ERR(x) ||...) S1 else S2
    |
    *x->fld
    )
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Kevin Hilman

    Julia Lawall
     

23 Dec, 2010

3 commits

  • This patch extends the smartreflex framework to support
    OMAP4. The changes are minor like compiling smartreflex Kconfig
    option for OMAP4 also, and a couple of OMAP4 checks in
    the smartreflex framework.

    The change in sr_device.c where new logic has to be introduced
    for reading the efuse registers is due to the fact that in OMAP4
    the efuse registers are 24 bit aligned. A __raw_readl will
    fail for non-32 bit aligned address and hence the 8-bit read
    and shift.

    Signed-off-by: Thara Gopinath
    Signed-off-by: Kevin Hilman

    Thara Gopinath
     
  • This patch adds debug support to the voltage and smartreflex drivers.
    This means a whole bunch of voltage processor and smartreflex
    parameters are now visible through the pm debugfs.
    The voltage parameters can be viewed at
    /debug/voltage/vdd_/
    and the smartreflex parameters can be viewed at
    /debug/voltage/vdd_/smartreflex/

    Also smartreflex n-target values are now exposed out at
    /debug/voltage/vdd_/smartreflex/nvalue/

    This is a read-write interface which means user has the
    flexibility to change the n-target values for any opp.

    Signed-off-by: Thara Gopinath
    Signed-off-by: Kevin Hilman

    Thara Gopinath
     
  • SmartReflex modules do adaptive voltage control for real-time
    voltage adjustments. With Smartreflex the power supply voltage
    can be adapted to the silicon performance(manufacturing process,
    temperature induced performance, age induced performance etc).

    There are differnet classes of smartreflex implementation.
    Class-0: Manufacturing Test Calibration
    Class-1: Boot-Time Software Calibration
    Class-2: Continuous Software Calibration
    Class-3: Continuous Hardware Calibration
    Class-4: Fully Integrated Power Management

    OMAP3 has two smartreflex modules one associated with VDD MPU and the
    other associated with VDD CORE.
    This patch adds support for smartreflex driver. The driver is designed
    for Class-1 , Class-2 and Class-3 support and is a platform driver.
    Smartreflex driver can be enabled through a Kconfig option
    "SmartReflex support" under "System type"->"TI OMAP implementations" menu.

    Smartreflex autocompensation feature can be enabled runtime through
    a debug fs option.
    To enable smartreflex autocompensation feature
    echo 1 > /debug/voltage/vdd_/smartreflex/autocomp
    To disable smartreflex autocompensation feature
    echo 0 > /debug/voltage/vdd_/smartreflex/autocomp

    where X can be mpu, core , iva etc.

    This patch contains code originally in linux omap pm branch.
    Major contributors to this driver are
    Lesly A M, Rajendra Nayak, Kalle Jokiniemi, Paul Walmsley,
    Nishant Menon, Kevin Hilman.

    Signed-off-by: Thara Gopinath
    Signed-off-by: Kevin Hilman

    Thara Gopinath