14 Jan, 2012

1 commit


26 Dec, 2011

3 commits

  • After adding PM QoS constraints for the I2C controller in the A4R
    domain, that domain can be allowed to be turned off and on by runtime
    PM, so remove the "always on" governor from it.

    However, the A4R domain has to be "on" when suspend_device_irqs() and
    resume_device_irqs() are executed during system suspend and resume,
    respectively, so that those functions don't crash while accessing the
    INTCS. For this reason, add a PM notifier to the SH7372 PM code and
    make it restore power to A4R before system suspend and remove power
    from all unused PM domains after system resume.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Magnus Damm

    Rafael J. Wysocki
     
  • SH7372 uses two independent mechanisms for ensuring that power
    domains will never be turned off: the stay_on flag and the "always
    on" domain governor. Moreover, the "always on" governor is only taken
    into accout by runtime PM code paths, while the stay_on flag affects
    all attempts to turn the given domain off. Thus setting the stay_on
    flag causes the "always on" governor to be unnecessary, which is
    quite confusing.

    However, the stay_on flag is currently only set for two domains: A3SP
    and A4S. Moreover, it only is set for the A3SP domain if
    console_suspend_enabled is set, so stay_on won't be necessary for
    that domain any more if console_suspend_enabled is checked directly
    in its .suspend() routine. [This requires domain .suspend() to
    return a result, but that is a minor modification.] Analogously,
    stay_on won't be necessary for the A4S domain if it's .suspend()
    routine always returns an error code.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Magnus Damm

    Rafael J. Wysocki
     
  • The sh7372 contains a power domain named A4S which in turn
    contains power domains for both I/O Devices and CPU cores.

    At this point only System wide Suspend-to-RAM is supported,
    but the the hardware can also support CPUIdle. With more
    efforts in the future CPUIdle can work with bot A4S and A3SM.

    Tested on the sh7372 Mackerel board.

    [rjw: Rebased on top of the current linux-pm tree.]

    Signed-off-by: Magnus Damm
    Signed-off-by: Rafael J. Wysocki

    Magnus Damm
     

10 Dec, 2011

1 commit


07 Dec, 2011

1 commit


02 Dec, 2011

2 commits

  • Add a function deciding whether or not devices should be stopped in
    pm_genpd_runtime_suspend() depending on their PM QoS constraints
    and stop/start timing values. Make it possible to add information
    used by this function to device objects.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Magnus Damm

    Rafael J. Wysocki
     
  • The current generic PM domains code requires that the same .stop(),
    .start() and .active_wakeup() device callback routines be used for
    all devices in the given domain, which is inflexible and may not
    cover some specific use cases. For this reason, make it possible to
    use device specific .start()/.stop() and .active_wakeup() callback
    routines by adding corresponding callback pointers to struct
    generic_pm_domain_data. Add a new helper routine,
    pm_genpd_register_callbacks(), that can be used to populate
    the new per-device callback pointers.

    Modify the shmobile's power domains code to allow drivers to add
    their own code to be run during the device stop and start operations
    with the help of the new callback pointers.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Magnus Damm

    Rafael J. Wysocki
     

21 Nov, 2011

1 commit

  • * 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    PM / Suspend: Fix bug in suspend statistics update
    PM / Hibernate: Fix the early termination of test modes
    PM / shmobile: Fix build of sh7372_pm_init() for CONFIG_PM unset
    PM Sleep: Do not extend wakeup paths to devices with ignore_children set
    PM / driver core: disable device's runtime PM during shutdown
    PM / devfreq: correct Kconfig dependency
    PM / devfreq: fix use after free in devfreq_remove_device
    PM / shmobile: Avoid restoring the INTCS state during initialization
    PM / devfreq: Remove compiler error after irq.h update
    PM / QoS: Properly use the WARN() macro in dev_pm_qos_add_request()
    PM / Clocks: Only disable enabled clocks in pm_clk_suspend()
    ARM: mach-shmobile: sh7372 A3SP no_suspend_console fix
    PM / shmobile: Don't skip debugging output in pd_power_up()

    Linus Torvalds
     

18 Nov, 2011

1 commit


15 Nov, 2011

1 commit

  • The SH7372 PM domain initialization routine calls pd_power_up()
    that executes the domain's .resume() callback, if present, and for
    the A4R domain this callback attepmts to restore the INTCS state from
    uninitialized data. To avoid that, introduce __pd_power_up() that
    will only execute the domain's .resume() callback if its second
    argument is 'true' and make the SH7372 PM domain initialization
    use it with 'false' as its second argument. Redefine pd_power_up()
    as a wrapper around __pd_power_up().

    Reported-by: Guennadi Liakhovetski
    Tracked-down-by: Magnus Damm
    Signed-off-by: Rafael J. Wysocki
    Acked-by: Magnus Damm

    Rafael J. Wysocki
     

11 Nov, 2011

1 commit

  • The following commits break cpuidle on SH-Mobile ARM:

    46bcfad cpuidle: Single/Global registration of idle states
    e978aa7 cpuidle: Move dev->last_residency update to driver enter routine; remove dev->last_state

    This patch remedies these issues by up-porting the SH-Mobile
    code to fit with the above introduced framework changes.

    It is worth noting that the new code becomes significantly cleaner,
    so these framework changes are very welcome. At the same time this
    breakage could probably have been avoided by grepping for "last_state"
    and "cpuidle_register_driver".

    Signed-off-by: Magnus Damm
    Signed-off-by: Paul Mundt

    Magnus Damm
     

10 Nov, 2011

2 commits


22 Oct, 2011

2 commits

  • This change adds support for the sh7372 A4R power domain.

    The sh7372 A4R hardware power domain contains the
    SH CPU Core and a set of I/O devices including
    multimedia accelerators and I2C controllers.

    One special case about A4R is the INTCS interrupt
    controller that needs to be saved and restored to
    keep working as expected. Also the LCDC hardware
    blocks are in a different hardware power domain
    but have their IRQs routed only through INTCS. So
    as long as LCDCs are active we cannot power down
    INTCS because that would risk losing interrupts.

    Signed-off-by: Magnus Damm
    Signed-off-by: Rafael J. Wysocki

    Magnus Damm
     
  • This change adds support for the sh7372 A3SP power domain.

    The sh7372 A3SP hardware power domain contains a
    wide range of I/O devices. The list of I/O devices
    include SCIF serial ports, DMA Engine hardware,
    SD and MMC controller hardware, USB controllers
    and I2C master controllers.

    This patch adds the A3SP low level code which
    powers the hardware power domain on and off. It
    also ties in platform devices to the pm domain
    support code.

    It is worth noting that the serial console is
    hooked up to SCIFA0 on most sh7372 boards, and
    the SCIFA0 port is included in the A3SP hardware
    power domain. For this reason we cannot output
    debug messages from the low level power control
    code in the case of A3SP.

    QoS support is needed in drivers before we can
    enable the A3SP power control on the fly.

    Signed-off-by: Magnus Damm
    Signed-off-by: Rafael J. Wysocki

    Magnus Damm
     

26 Sep, 2011

3 commits

  • Update the sh7372 sleep code to build parts of the
    code only when SUSPEND and/or CPU_IDLE are set.

    Signed-off-by: Magnus Damm
    Signed-off-by: Rafael J. Wysocki

    Magnus Damm
     
  • This patch adds sh7372 A3SM power domain support.

    The sh7372 A3SM hardware power domain contains the
    ARM Cortex-A8 CPU Core including L2 cache. This
    sleep mode can be seen as a one step deeper sleep
    mode from the already existing Core Standby mode.

    To wake up from A3SM sleep only a few wakeup sources
    are supported - so the regular INTC controller will
    not be able to help us unfortunately.

    The code in this patch will enter A3SM sleep via the
    regular Suspend-to-RAM interface in the case of only
    wakeups supported by A3SM are enabled. If unsupported
    wakeups are enabled then Core Standby will be used
    instead.

    Signed-off-by: Magnus Damm
    Signed-off-by: Rafael J. Wysocki

    Magnus Damm
     
  • Convert the sh7372 Core Standby code to make use
    of the new generic ARM cpu suspend/resume code.

    Signed-off-by: Magnus Damm
    Signed-off-by: Rafael J. Wysocki

    Magnus Damm
     

25 Aug, 2011

5 commits

  • The generic PM domains framework currently doesn't work with devices
    whose power.irq_safe flag is set, because runtime PM callbacks for
    such devices are run with interrupts disabled and the callbacks
    provided by the generic PM domains framework use domain mutexes
    and may sleep. However, such devices very well may belong to
    power domains on some systems, so the generic PM domains framework
    should take them into account.

    For this reason, modify the generic PM domains framework so that the
    domain .power_off() and .power_on() callbacks are never executed for
    a domain containing devices with power.irq_safe set, although the
    .stop_device() and .start_device() callbacks are still run for them.

    Additionally, introduce a flag allowing the creator of a
    struct generic_pm_domain object to indicate that its .stop_device()
    and .start_device() callbacks may be run in interrupt context
    (might_sleep_if() triggers if that flag is not set and one of those
    callbacks is run in interrupt context).

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Since the PM clock management code in drivers/base/power/clock_ops.c
    is used for both runtime PM and system suspend/hibernation, the
    definitions of data structures and headers related to it should not
    be located in include/linux/pm_rumtime.h. Move them to a separate
    header file.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Currently pm_genpd_runtime_resume() has to walk the list of devices
    from the device's PM domain to find the corresponding device list
    object containing the need_restore field to check if the driver's
    .runtime_resume() callback should be executed for the device.
    This is suboptimal and can be simplified by using power.sybsys_data
    to store device information used by the generic PM domains code.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Introduce struct pm_subsys_data that may be subclassed by subsystems
    to store subsystem-specific information related to the device. Move
    the clock management fields accessed through the power.subsys_data
    pointer in struct device to the new strucutre.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Instead of coding the undocumented dependencies between power domains
    A3RV and A4LC on SH7372 directly into the low-level power up/down
    routines, make A3RV be a subdomain of A4LC, which will cause the
    same dependecies to hold.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Magnus Damm

    Rafael J. Wysocki
     

15 Jul, 2011

2 commits


13 Jul, 2011

1 commit


10 Jul, 2011

4 commits

  • Add a power domain workaround for the VPU and A3RV on sh7372.

    The sh7372 data sheet mentions that the VPU is located in the
    A3RV power domain. The A3RV power domain is not related to A4LC
    in any way, but testing shows that unless A3RV _and_ A4LC are
    powered on the VPU test program will bomb out.

    This issue may be caused by a more or less undocumented dependency
    on the MERAM block that happens to be located in A4LC. So now we
    know that the out-of-reset requirement of the VPU is that the MERAM
    is powered on.

    This patch adds a workaround for A3RV to make sure A4LC is powered
    on - this so we can use the VPU even though the LCDCs are in blanking
    state and A4LC is supposed to be off.

    Signed-off-by: Magnus Damm
    Signed-off-by: Rafael J. Wysocki

    Magnus Damm
     
  • Add sh7372 specific code to power down unused pm domains.

    This should really be replaced by some generic PM core
    code IMO, but until that happens this patch makes sure
    we don't waste power by leaving unused power domains on.

    Signed-off-by: Magnus Damm
    Signed-off-by: Rafael J. Wysocki

    Magnus Damm
     
  • Add support for the sh7372 D4 power domain. This power domain
    contains the Coresight-ETM hardware block.

    Signed-off-by: Magnus Damm
    Signed-off-by: Rafael J. Wysocki

    Magnus Damm
     
  • Add support for the sh7372 A4MP power domain
    and hook up the FSI/SPU2 device.

    Signed-off-by: Kuninori Morimoto
    Acked-by: Magnus Damm
    Signed-off-by: Rafael J. Wysocki

    Kuninori Morimoto
     

02 Jul, 2011

4 commits


25 May, 2011

3 commits