aboutsummaryrefslogtreecommitdiff
path: root/drivers/mfd/glamo/glamo-core.c
diff options
context:
space:
mode:
author\\\\\\\\\\\\\\\"Mike (mwester)\\\\\\\\\\\\ <mwester@dls.net>2008-11-19 17:10:54 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-11-19 17:10:54 +0000
commita0b21c7066eb0301eba21885c177eeb16eed0216 (patch)
tree22211e3350d753893c3fcf7f441c1f88fb385d62 /drivers/mfd/glamo/glamo-core.c
parent27ef48d603cb23afd637071dbf9683155c83e58a (diff)
always-call-resume-dependencies.patch
Attached is a patch that has greatly reduced the frequency of failures to resume (due to an oops from the glamo resume handler), and the dreaded "white screen after resume". I can't say that it fixes all of these, although I have yet to see the white-screen since applying this patch and suspending/resuming several hundred times (with the 30-second suspend on the 2008.8 image and the endless stream of GSM error messages generated by something in that image, it has proved to be very useful to do an automated stress test!) This patch will apply to stable, and should make stable slightly more, well, "stable". [Feel free to remove the debug messages if someone feels strongly about that; I left them in because I think they might be useful in triaging further crashes; I'm not at all convinced that this patch will fix all the cases of resume failures.] [[And, yes, this is ugly, really ugly.]] [[[Oh yeah - there's still one extreme case that will result in an oops: if a dependent driver is built as a module, and it is unloaded, and it happened that the preceding suspend/resume was aborted, and that abort happened between the dependent driver and the driver upon which it is dependent, then a list entry will be left behind referencing the unloaded module. There's just no good way to fix that given the way the resume dependency plumbing is connected up right now, so just avoid using modules for any of the drivers involved in the resume dependency stuff.]]] Regards, Mike (mwester) commit 905d2fc9c45f622418ce9ef4e67c23453aab7571 Author: Mike Westerhof <mwester@dls.net> Date: Mon Aug 11 11:11:25 2008 -0500 always-call-resume-dependencies.patch Ensure that a dependent resume handler is always executed, even if the resume handler for driver upon which it is dependent never suspends (and therefore never resumes either). Also make sure that we do not end up with duplicate dependencies registered, something that can happen if the suspend is aborted due to driver failure or an early resume (such as occurs when the GSM interrupts during suspend). Signed-off-by: Mike Westerhof <mwester@dls.net>
Diffstat (limited to 'drivers/mfd/glamo/glamo-core.c')
-rw-r--r--drivers/mfd/glamo/glamo-core.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mfd/glamo/glamo-core.c b/drivers/mfd/glamo/glamo-core.c
index 7123080e050..0fea4f4ea0e 100644
--- a/drivers/mfd/glamo/glamo-core.c
+++ b/drivers/mfd/glamo/glamo-core.c
@@ -1255,6 +1255,8 @@ void glamo_register_resume_dependency(struct resume_dependency *
{
register_resume_dependency(&glamo_handle->resume_dependency,
resume_dependency);
+ if (glamo_handle->is_suspended)
+ activate_all_resume_dependencies(&glamo_handle->resume_dependency);
}
EXPORT_SYMBOL_GPL(glamo_register_resume_dependency);
@@ -1262,12 +1264,15 @@ EXPORT_SYMBOL_GPL(glamo_register_resume_dependency);
static int glamo_suspend(struct platform_device *pdev, pm_message_t state)
{
glamo_power(glamo_handle, GLAMO_POWER_SUSPEND);
+ glamo_handle->is_suspended = 1;
+ activate_all_resume_dependencies(&glamo_handle->resume_dependency);
return 0;
}
static int glamo_resume(struct platform_device *pdev)
{
glamo_power(glamo_handle, GLAMO_POWER_ON);
+ glamo_handle->is_suspended = 0;
callback_all_resume_dependencies(&glamo_handle->resume_dependency);
return 0;