Commit Graph

19 Commits

Author SHA1 Message Date
Patrick Cain
b599ff7fcb Revert "power: wakelock: don't set check_done flag if aborting"
This reverts commit 7ef4dbaa2a.

Revert "power: wakelock: BUG if wakelock is taken very late"

This reverts commit 57b34bbdca.

Change-Id: Ie1288b5e6c899ac4419c55b91cb024b8093b5ffe
Signed-off-by: Patrick Cain <pcain@codeaurora.org>
2011-11-28 14:41:25 -08:00
Bryan Huntsman
d074fa2796 Merge remote-tracking branch 'common/android-3.0' into msm-3.0
* common/android-3.0: (570 commits)
  misc: remove kernel debugger core
  ARM: common: fiq_debugger: dump sysrq directly to console if enabled
  ARM: common: fiq_debugger: add irq context debug functions
  net: wireless: bcmdhd: Call init_ioctl() only if was started properly for WEXT
  net: wireless: bcmdhd: Call init_ioctl() only if was started properly
  net: wireless: bcmdhd: Fix possible memory leak in escan/iscan
  cpufreq: interactive governor: default 20ms timer
  cpufreq: interactive governor: go to intermediate hi speed before max
  cpufreq: interactive governor: scale to max only if at min speed
  cpufreq: interactive governor: apply intermediate load on current speed
  ARM: idle: update idle ticks before call idle end notifier
  input: gpio_input: don't print debounce message unless flag is set
  net: wireless: bcm4329: Skip dhd_bus_stop() if bus is already down
  net: wireless: bcmdhd: Skip dhd_bus_stop() if bus is already down
  net: wireless: bcmdhd: Improve suspend/resume processing
  net: wireless: bcmdhd: Check if FW is Ok for internal FW call
  tcp: Don't nuke connections for the wrong protocol
  ARM: common: fiq_debugger: make uart irq be no_suspend
  net: wireless: Skip connect warning for CONFIG_CFG80211_ALLOW_RECONNECT
  mm: avoid livelock on !__GFP_FS allocations
  ...

Conflicts:
	arch/arm/mm/cache-l2x0.c
	arch/arm/vfp/vfpmodule.c
	drivers/mmc/core/host.c
	kernel/power/wakelock.c
	net/bluetooth/hci_event.c

Signed-off-by: Bryan Huntsman <bryanh@codeaurora.org>
2011-11-16 13:52:50 -08:00
Patrick Cain
afcffe54c3 Revert "power: wakelock: don't set check_done flag if aborting"
This reverts commit 7ef4dbaa2a.

Revert "power: wakelock: BUG if wakelock is taken very late"

This reverts commit 57b34bbdca.

Change-Id: Id4e05b191cf7781b8e0d0bed42f1c136b1ac428e
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2011-11-08 23:21:57 -08:00
Patrick Cain
b811aa7237 Revert "power: wakelock: reset wakelock checked early"
This reverts commit fa3a6d5572.

Signed-off-by: Patrick Cain <pcain@codeaurora.org>
2011-11-04 14:25:36 -07:00
Abhijeet Dharmapurikar
fa3a6d5572 power: wakelock: reset wakelock checked early
Currently we reset msm_suspend_check_done in resume_noirq and set it
in the suspend_noirq stage right after the wakelock checks are done.

An issue is discovered recently that a wakelock can be held much earlier
in the resume sequence - a tasklet was scheduled right in the arch specifc
resume path, and this tasklet was run as soon as local interrupt was
enabled (the I bit in the CPSR for arm processors).  The tasklet endedup
grabbing a wakelock thus causing a BUG.

To avoid this situation reset msm_suspend_check_done before enabling local
interrupts using the syscore ops.

Change-Id: I12766cb759134185e9727829f71893934492cc5f
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2011-10-25 20:14:44 -07:00
Abhijeet Dharmapurikar
7ef4dbaa2a power: wakelock: don't set check_done flag if aborting
If there is a wakelock held the wakelock driver rejects the suspend
by returning EAGAIN(-11). In this case since the suspend is rejected
in suspend_noirq callback, the resume_noirq callback is not called on
the wakelock driver, leading to the check_done flag not being cleared
and causing a BUG for the next wakelock request.

Don't set the check_done flag if suspend_noirq aborts suspend.

Change-Id: Iddd12cefd9a30020784416b4e5bec7fe3f7fc0e6
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2011-10-14 09:22:49 -07:00
Abhijeet Dharmapurikar
57b34bbdca power: wakelock: BUG if wakelock is taken very late
There has been handful of corner cases where a driver would call
wake_lock very late in the suspend sequence but the suspend proceeds
anyways and causes issues.

Add code to BUG if a driver grabs a wakelock after suspend_noirq callbacks
are called, this will aid in correct wakelock usage for new drivers and
give us callstacks for misbehaving drivers.

Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2011-10-04 17:14:23 -07:00
Pratik Patel
529461b70c power: fix suspend_sys_sync_wait()
Since the workqueue code deletes the work before executing it,
checking for no work item being currently queued to the workqueue
is not sufficient to guarantee that all the works have finished
execution.

Use a counter to guarantee that all the pending suspend_sys_sync()
works have finished execution before returning from
suspend_sys_sync_wait().

CRs-Fixed: 293595
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>

Conflicts:

	kernel/power/wakelock.c
2011-10-03 10:26:58 -07:00
Todd Poynor
7013f49763 PM: Backoff suspend if repeated attempts fail
Change-Id: I32289676d95a307ea3aa5e78f6c126ca979c0fec
Signed-off-by: Todd Poynor <toddpoynor@google.com>
2011-09-06 13:49:57 -07:00
Todd Poynor
ca64b0cd3a PM: wakelocks: Display wakelocks preventing suspend by default
Use DEBUG_WAKEUP flag to show wakelocks that abort suspend, in
addition to showing wakelocks held during system resume.
DEBUG_WAKEUP is enabled by default.

Change-Id: If6fa68e8afbc482a5300ffab2964694b02b34f41
Signed-off-by: Todd Poynor <toddpoynor@google.com>
2011-08-10 16:14:56 -07:00
Todd Poynor
ed27e538aa PM: wakelocks: Don't report wake up wakelock if suspend aborted
If the wakelock driver aborts suspend due to an already-held
wakelock, don't report the next wakelock held as the "wake up
wakelock".

Change-Id: I582ffbb87a3c361739a77d839a0c62921cff11a6
Signed-off-by: Todd Poynor <toddpoynor@google.com>
2011-08-08 19:03:09 -07:00
Colin Cross
28e23cf73c power: wakelock: use get_xtime_and_monotonic_and_sleep_offset in get_expired_time
Change-Id: I6ebe6b954b2ff328d46898d683650dafb9c4fe74
Signed-off-by: Erik Gilling <konkers@android.com>
2011-06-14 09:09:53 -07:00
Erik Gilling
435aacd2a0 power: wakelock: call __get_wall_to_monotonic() instead of using wall_to_monotonic
Change-Id: I9e9c3b923bf9a22ffd48f80a72050289496e57d8
2011-06-14 09:09:35 -07:00
Colin Cross
0c7841ce3e wakelock: Fix operator precedence bug
Change-Id: I21366ace371d1b8f4684ddbe4ea8d555a926ac21
Signed-off-by: Colin Cross <ccross@google.com>
2011-06-14 09:09:34 -07:00
Mike Chan
af62b25adb power: wakelock: Print active wakelocks when has_wake_lock() is called
When DEBUG_SUSPEND is enabled print active wakelocks when we check
if there are any active wakelocks.

In print_active_locks(), print expired wakelocks if DEBUG_EXPIRE is enabled

Change-Id: Ib1cb795555e71ff23143a2bac7c8a58cbce16547
Signed-off-by: Mike Chan <mike@android.com>
2011-06-14 09:09:27 -07:00
Arve Hjønnevåg
1b0749512f PM: wakelocks: Use seq_file for /proc/wakelocks so we can get more than 3K of stats.
Change-Id: I42ed8bea639684f7a8a95b2057516764075c6b01
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2011-06-14 09:08:42 -07:00
Erik Gilling
10f0138c56 power: wakelocks: fix buffer overflow in print_wake_locks
Change-Id: Ic944e3b3d3bc53eddc6fd0963565fd072cac373c
Signed-off-by: Erik Gilling <konkers@android.com>
2011-06-14 09:08:42 -07:00
Mike Chan
97a0a74383 power: Prevent spinlock recursion when wake_unlock() is called
Signed-off-by: Mike Chan <mike@android.com>
2011-06-14 09:08:42 -07:00
Arve Hjønnevåg
fe6cd633ef PM: Implement wakelock api.
PM: wakelock: Replace expire work with a timer

The expire work function did not work in the normal case.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
2011-06-14 09:08:41 -07:00