diff mbox

hid-multitouch: eGalax Touchscreen not resuming after suspend

Message ID 2305931.9GBOrRiDsv@vostro.rjw.lan (mailing list archive)
State New, archived
Delegated to: Jiri Kosina
Headers show

Commit Message

Rafael Wysocki Nov. 29, 2012, 10:28 p.m. UTC
On Thursday, November 29, 2012 03:03:04 PM Jan-Matthias Braun wrote:
> Hi Rafael,
> 
> thanks for looking into this.
> 
> Am Donnerstag, 29. November 2012, 01:20:04 schrieb Rafael J. Wysocki:
> > On Tuesday, November 27, 2012 09:26:11 PM Jiri Kosina wrote:
> > > On Sun, 25 Nov 2012, Jan-Matthias Braun wrote:
> > > > I have now done a git bisection from 3.0 to 3.1 and have found commit
> > > > 1e2ef05bb8cf851a694d38e9170c89e7ff052741 PM: Limit race conditions between runtime PM and system sleep (v2)
> > > > to be the first one to introduce the necessity of a module reload after resume.
> > 
> > So with that commit your device doesn't work after resume from system suspend
> > unless you reload the driver?
> 
> Yes. Additionally, with later kernel revisions even this won't help, but I could imagine this to be a consequence of the same problem.
> 
> > > > I hope that this helps in finding a solution. As I (again) don't immediatly
> > > > know how to go on, I kindly ask you to give me some hints for testing/patching
> > > > or even a possible solution. :-)
> > 
> > Can you apply the patch below to the current mainline kernel and see if it makes any
> > difference, please?
> 
> It does: Current mainline kernel (version >3.7.0-rc7 from git) is not showing
> the problem, if the patch is applied.

If you apply the patch below instead of the previous one, does it make
the problem return, or is it still good?

Rafael


---
 drivers/base/power/main.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Comments

Jan-Matthias Braun Dec. 4, 2012, 10:11 p.m. UTC | #1
Hi Rafael,

Am Donnerstag 29. November 2012, 23:28:55 schrieb Rafael J. Wysocki:
> On Thursday, November 29, 2012 03:03:04 PM Jan-Matthias Braun wrote:
> > Am Donnerstag, 29. November 2012, 01:20:04 schrieb Rafael J. Wysocki:
> > > On Tuesday, November 27, 2012 09:26:11 PM Jiri Kosina wrote:
> > > > On Sun, 25 Nov 2012, Jan-Matthias Braun wrote:
> > > > > I have now done a git bisection from 3.0 to 3.1 and have found commit
> > > > > 1e2ef05bb8cf851a694d38e9170c89e7ff052741 PM: Limit race conditions between runtime PM and system sleep (v2)
> > > > > to be the first one to introduce the necessity of a module reload after resume.
> > > 
> > > So with that commit your device doesn't work after resume from system suspend
> > > unless you reload the driver?
> > 
> > Yes. Additionally, with later kernel revisions even this won't help, but I could imagine this to be a consequence of the same problem.
> > 
> > > > > I hope that this helps in finding a solution. As I (again) don't immediatly
> > > > > know how to go on, I kindly ask you to give me some hints for testing/patching
> > > > > or even a possible solution. :-)
> > > 
> > > Can you apply the patch below to the current mainline kernel and see if it makes any
> > > difference, please?
> > 
> > It does: Current mainline kernel (version >3.7.0-rc7 from git) is not showing
> > the problem, if the patch is applied.
> 
> If you apply the patch below instead of the previous one, does it make
> the problem return, or is it still good?

again, the problem does not occur; the resume behaviour of the touchscreen is still good.

Thanks a lot for testing!

Jan
Rafael Wysocki Dec. 5, 2012, 12:28 a.m. UTC | #2
On Tuesday, December 04, 2012 11:11:27 PM Jan-Matthias Braun wrote:
> Hi Rafael,
> 
> Am Donnerstag 29. November 2012, 23:28:55 schrieb Rafael J. Wysocki:
> > On Thursday, November 29, 2012 03:03:04 PM Jan-Matthias Braun wrote:
> > > Am Donnerstag, 29. November 2012, 01:20:04 schrieb Rafael J. Wysocki:
> > > > On Tuesday, November 27, 2012 09:26:11 PM Jiri Kosina wrote:
> > > > > On Sun, 25 Nov 2012, Jan-Matthias Braun wrote:
> > > > > > I have now done a git bisection from 3.0 to 3.1 and have found commit
> > > > > > 1e2ef05bb8cf851a694d38e9170c89e7ff052741 PM: Limit race conditions between runtime PM and system sleep (v2)
> > > > > > to be the first one to introduce the necessity of a module reload after resume.
> > > > 
> > > > So with that commit your device doesn't work after resume from system suspend
> > > > unless you reload the driver?
> > > 
> > > Yes. Additionally, with later kernel revisions even this won't help, but I could imagine this to be a consequence of the same problem.
> > > 
> > > > > > I hope that this helps in finding a solution. As I (again) don't immediatly
> > > > > > know how to go on, I kindly ask you to give me some hints for testing/patching
> > > > > > or even a possible solution. :-)
> > > > 
> > > > Can you apply the patch below to the current mainline kernel and see if it makes any
> > > > difference, please?
> > > 
> > > It does: Current mainline kernel (version >3.7.0-rc7 from git) is not showing
> > > the problem, if the patch is applied.
> > 
> > If you apply the patch below instead of the previous one, does it make
> > the problem return, or is it still good?
> 
> again, the problem does not occur; the resume behaviour of the touchscreen is still good.
> 
> Thanks a lot for testing!

Well, thank you. :-)

I'll add a changelog to this patch and submit it as a fix for the issue
you're observing.

Thanks,
Rafael
Jan-Matthias Braun Dec. 5, 2012, 9:12 a.m. UTC | #3
Am Mittwoch, 5. Dezember 2012, 01:28:53 schrieb Rafael J. Wysocki:
> On Tuesday, December 04, 2012 11:11:27 PM Jan-Matthias Braun wrote:
> > Am Donnerstag 29. November 2012, 23:28:55 schrieb Rafael J. Wysocki:
> > > On Thursday, November 29, 2012 03:03:04 PM Jan-Matthias Braun wrote:
> > > > Am Donnerstag, 29. November 2012, 01:20:04 schrieb Rafael J. Wysocki:
> > > > > On Tuesday, November 27, 2012 09:26:11 PM Jiri Kosina wrote:
> > > > > > On Sun, 25 Nov 2012, Jan-Matthias Braun wrote:
> > > > > > > I have now done a git bisection from 3.0 to 3.1 and have found commit
> > > > > > > 1e2ef05bb8cf851a694d38e9170c89e7ff052741 PM: Limit race conditions between runtime PM and system sleep (v2)
> > > > > > > to be the first one to introduce the necessity of a module reload after resume.
> > > > > 
> > > > > So with that commit your device doesn't work after resume from system suspend
> > > > > unless you reload the driver?
> > > > 
> > > > Yes. Additionally, with later kernel revisions even this won't help, but I could imagine this to be a consequence of the same problem.
> > > > 
> > > > > > > I hope that this helps in finding a solution. As I (again) don't immediatly
> > > > > > > know how to go on, I kindly ask you to give me some hints for testing/patching
> > > > > > > or even a possible solution. :-)
> > > > > 
> > > > > Can you apply the patch below to the current mainline kernel and see if it makes any
> > > > > difference, please?
> > > > 
> > > > It does: Current mainline kernel (version >3.7.0-rc7 from git) is not showing
> > > > the problem, if the patch is applied.
> > > 
> > > If you apply the patch below instead of the previous one, does it make
> > > the problem return, or is it still good?
> > 
> > again, the problem does not occur; the resume behaviour of the touchscreen is still good.
> > 
> > Thanks a lot for testing!
> 
> Well, thank you. :-)
> 
> I'll add a changelog to this patch and submit it as a fix for the issue
> you're observing.

Great! Thank you and all others involved for their time!

Jan-Matthias Braun
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

Index: linux/drivers/base/power/main.c
===================================================================
--- linux.orig/drivers/base/power/main.c
+++ linux/drivers/base/power/main.c
@@ -513,6 +513,8 @@  static int device_resume_early(struct de
 
  Out:
 	TRACE_RESUME(error);
+
+	pm_runtime_enable(dev);
 	return error;
 }
 
@@ -589,8 +591,6 @@  static int device_resume(struct device *
 	if (!dev->power.is_suspended)
 		goto Unlock;
 
-	pm_runtime_enable(dev);
-
 	if (dev->pm_domain) {
 		info = "power domain ";
 		callback = pm_op(&dev->pm_domain->ops, state);
@@ -930,6 +930,8 @@  static int device_suspend_late(struct de
 	pm_callback_t callback = NULL;
 	char *info = NULL;
 
+	__pm_runtime_disable(dev, false);
+
 	if (dev->power.syscore)
 		return 0;
 
@@ -1133,11 +1135,8 @@  static int __device_suspend(struct devic
 
  Complete:
 	complete_all(&dev->power.completion);
-
 	if (error)
 		async_error = error;
-	else if (dev->power.is_suspended)
-		__pm_runtime_disable(dev, false);
 
 	return error;
 }