Dear all,

For avoid race condition, mutex lock is added to protect power_state
variable.

Please help to integrate the patch, thanks

 

Subject: Add mutex while power_state changed

 

Add mutex while power_state changed

 

Signed-off-by: Mike Hsu <[email protected]>

Signed-off-by: Stanley Zeng <[email protected]>

 

---

ektf2136_spi.c |    4 ++++

1 file changed, 4 insertions(+)

 

--- a/drivers/input/touchscreen/ektf2136_spi.c   2011-05-02
10:11:52.238182002 +0000

+++ a/drivers/input/touchscreen/ektf2136_spi.c           2011-05-02
10:15:56.770182005 +0000

@@ -1759,7 +1759,9 @@ static int ektf2136_runtime_suspend(stru

          if (ret < 0)

                    return ret;

 

+        mutex_lock(&ed->sysfs_mutex);

          ed->power_state = 0;

+        mutex_unlock(&ed->sysfs_mutex);

          msleep(100);

          return 0;

 }

@@ -1776,7 +1778,9 @@ static int ektf2136_runtime_resume(struc

          if (ret < 0)

                    return ret;

 

+        mutex_lock(&ed->sysfs_mutex);

          ed->power_state = 1;

+        mutex_unlock(&ed->sysfs_mutex);

          msleep(100);

          return 0;

 }

Attachment: ektf2136_spi_Add_mutex_between_power_state_changed.patch
Description: Binary data

_______________________________________________
MeeGo-kernel mailing list
[email protected]
http://lists.meego.com/listinfo/meego-kernel

Reply via email to