r4121 - branches/src/target/kernel/2.6.24.x/patches

werner at sita.openmoko.org werner at sita.openmoko.org
Wed Feb 27 13:56:45 CET 2008


Author: werner
Date: 2008-02-27 13:56:41 +0100 (Wed, 27 Feb 2008)
New Revision: 4121

Added:
   branches/src/target/kernel/2.6.24.x/patches/pcf50633-suspend-hacks.patch
Modified:
   branches/src/target/kernel/2.6.24.x/patches/series
Log:
fix-pcf50633-one-shot-resume.patch

From: Andy Green <andy at openmoko.com>

The wakeup sources behind the PMU interrupt only worked once
as a wakeup source for suspend.  This is because of further
resume sequencing trouble meaning that the PMU interrupt
gets accepted for service before the I2C driver resumed and
it is able to actually talk to the PMU.  A previous patch
stopped this situation stalling resume, but this patch
extends it to scheduling a retry after an msleep(1).

Failing to service the PMU interrupt led to no further PMU
interrupts being recognized due to edge triggering, with the
retry we typically get it on the next try since I2C is up
by then, and PMU interrupts continue to be recognized for
wake and other functions.

Signed-off-by: Andy Green <andy at openmoko.com>

---

 drivers/i2c/chips/pcf50633.c |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)



Added: branches/src/target/kernel/2.6.24.x/patches/pcf50633-suspend-hacks.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/pcf50633-suspend-hacks.patch	2008-02-27 07:36:29 UTC (rev 4120)
+++ branches/src/target/kernel/2.6.24.x/patches/pcf50633-suspend-hacks.patch	2008-02-27 12:56:41 UTC (rev 4121)
@@ -0,0 +1,33 @@
+Index: linux-2.6.24/drivers/i2c/chips/pcf50633.c
+===================================================================
+--- linux-2.6.24.orig/drivers/i2c/chips/pcf50633.c
++++ linux-2.6.24/drivers/i2c/chips/pcf50633.c
+@@ -567,8 +567,26 @@ static void pcf50633_work(struct work_st
+ 	 */
+ 	ret = i2c_smbus_read_i2c_block_data(&pcf->client, PCF50633_REG_INT1, 5,
+ 					    pcfirq);
+-	if (ret != 5)
+-		DEBUGP("Oh crap PMU IRQ register read failed %d\n", ret);
++	if (ret != 5) {
++		DEBUGP("Oh crap PMU IRQ register read failed -- "
++		       "retrying later %d\n", ret);
++		/*
++		 * this situation can happen during resume, just defer
++		 * handling the interrupt until enough I2C is up we can
++		 * actually talk to the PMU.  We can't just ignore this
++		 * because we are on a falling edge interrupt and our
++		 * PMU interrupt source does not clear until we read these
++		 * interrupt source registers.
++		 */
++		if (!schedule_work(&pcf->work) && !pcf->working)
++			dev_dbg(&pcf->client.dev, "work item may be lost\n");
++
++		/* we don't put the device here, hold it for next time */
++		mutex_unlock(&pcf->working_lock);
++		/* don't spew, delaying whatever else is happening */
++		msleep(1);
++		return;
++	}
+ 
+ 	if (!pcf->coldplug_done) {
+ 		DEBUGP("PMU Coldplug init\n");

Modified: branches/src/target/kernel/2.6.24.x/patches/series
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/series	2008-02-27 07:36:29 UTC (rev 4120)
+++ branches/src/target/kernel/2.6.24.x/patches/series	2008-02-27 12:56:41 UTC (rev 4121)
@@ -46,6 +46,7 @@
 
 # gta02 feature set
 pcf50633.patch
+pcf50633-suspend-hacks.patch
 smedia-glamo.patch
 glamo-mmc.patch
 gta02-core.patch





More information about the commitlog mailing list