public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] UEAGLE : be suspend friendly
@ 2006-10-03 19:46 matthieu castet
  2006-10-04 22:05 ` Pavel Machek
  0 siblings, 1 reply; 8+ messages in thread
From: matthieu castet @ 2006-10-03 19:46 UTC (permalink / raw)
  To: greg; +Cc: linux-kernel, usbatm, linux-usb-devel, ueagle

[-- Attachment #1: Type: text/plain, Size: 185 bytes --]

Hi,


this patch avoid that the kernel thread block the suspend process.
Some work is still need to recover after a resume.


Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>



[-- Attachment #2: eagle-suspend --]
[-- Type: text/plain, Size: 711 bytes --]

this patch avoid that the kernel thread block the suspend process.
Some work is still need to recover after a resume.

Signed-off-by: matthieu castet <castet.matthieu@free.fr>
Index: linux/drivers/usb/atm/ueagle-atm.c
===================================================================
--- linux.orig/drivers/usb/atm/ueagle-atm.c	2006-09-22 21:39:56.000000000 +0200
+++ linux/drivers/usb/atm/ueagle-atm.c	2006-09-22 21:40:45.000000000 +0200
@@ -1177,6 +1177,9 @@
 			ret = uea_stat(sc);
 		if (ret != -EAGAIN)
 			msleep(1000);
+ 		if (try_to_freeze())
+			uea_err(INS_TO_USBDEV(sc), "suspend/resume not supported, "
+				"please unplug/replug your modem\n");
 	}
 	uea_leaves(INS_TO_USBDEV(sc));
 	return ret;

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] UEAGLE : be suspend friendly
  2006-10-03 19:46 [PATCH 1/3] UEAGLE : be suspend friendly matthieu castet
@ 2006-10-04 22:05 ` Pavel Machek
  2006-10-05  7:17   ` Duncan Sands
  0 siblings, 1 reply; 8+ messages in thread
From: Pavel Machek @ 2006-10-04 22:05 UTC (permalink / raw)
  To: matthieu castet; +Cc: greg, linux-kernel, usbatm, linux-usb-devel, ueagle

Hi!

You marked all the patches as 1/3, btw.

> this patch avoid that the kernel thread block the suspend process.
> Some work is still need to recover after a resume.
> 
> Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
> 
> 

> this patch avoid that the kernel thread block the suspend process.
> Some work is still need to recover after a resume.
> 
> Signed-off-by: matthieu castet <castet.matthieu@free.fr>
> Index: linux/drivers/usb/atm/ueagle-atm.c
> ===================================================================
> --- linux.orig/drivers/usb/atm/ueagle-atm.c	2006-09-22 21:39:56.000000000 +0200
> +++ linux/drivers/usb/atm/ueagle-atm.c	2006-09-22 21:40:45.000000000 +0200
> @@ -1177,6 +1177,9 @@
>  			ret = uea_stat(sc);
>  		if (ret != -EAGAIN)
>  			msleep(1000);
> + 		if (try_to_freeze())
> +			uea_err(INS_TO_USBDEV(sc), "suspend/resume not supported, "
> +				"please unplug/replug your modem\n");

Plug/unplug should be easy enough to simulate from usb driver, no?
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] UEAGLE : be suspend friendly
  2006-10-04 22:05 ` Pavel Machek
@ 2006-10-05  7:17   ` Duncan Sands
  2006-10-05 16:22     ` [linux-usb-devel] " Alan Stern
  0 siblings, 1 reply; 8+ messages in thread
From: Duncan Sands @ 2006-10-05  7:17 UTC (permalink / raw)
  To: usbatm
  Cc: Pavel Machek, matthieu castet, greg, ueagle, linux-kernel,
	linux-usb-devel

Hi Pavel,

> > Signed-off-by: matthieu castet <castet.matthieu@free.fr>
> > Index: linux/drivers/usb/atm/ueagle-atm.c
> > ===================================================================
> > --- linux.orig/drivers/usb/atm/ueagle-atm.c	2006-09-22 21:39:56.000000000 +0200
> > +++ linux/drivers/usb/atm/ueagle-atm.c	2006-09-22 21:40:45.000000000 +0200
> > @@ -1177,6 +1177,9 @@
> >  			ret = uea_stat(sc);
> >  		if (ret != -EAGAIN)
> >  			msleep(1000);
> > + 		if (try_to_freeze())
> > +			uea_err(INS_TO_USBDEV(sc), "suspend/resume not supported, "
> > +				"please unplug/replug your modem\n");
> 
> Plug/unplug should be easy enough to simulate from usb driver, no?

if a USB driver doesn't define suspend/resume methods, then the core simply
unplugs it on suspend, and replugs on resume (IIRC).  Maybe Matthieu is trying
for something better - hopefully he will explain.  Since this is a modem, it
would be nice if the internet connection sprang back to life on resume, which
requires more work than unplug/plug.  I've no idea what needs to be done to achieve
this.  These modems use the ATM networking layer by the way, I don't know if that
makes things easier or harder.

Ciao,

Duncan.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [linux-usb-devel] [PATCH 1/3] UEAGLE : be suspend friendly
  2006-10-05  7:17   ` Duncan Sands
@ 2006-10-05 16:22     ` Alan Stern
  2006-10-05 18:14       ` Pavel Machek
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Stern @ 2006-10-05 16:22 UTC (permalink / raw)
  To: Duncan Sands
  Cc: usbatm, linux-usb-devel, greg, Pavel Machek, linux-kernel, ueagle,
	matthieu castet

On Thu, 5 Oct 2006, Duncan Sands wrote:

> > Plug/unplug should be easy enough to simulate from usb driver, no?
> 
> if a USB driver doesn't define suspend/resume methods, then the core simply
> unplugs it on suspend, and replugs on resume (IIRC).

No longer true, and IIRC it never was.  All that happens is that URB 
submissions fail with -EHOSTUNREACH once the device is suspended.

Alan Stern


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [linux-usb-devel] [PATCH 1/3] UEAGLE : be suspend friendly
  2006-10-05 16:22     ` [linux-usb-devel] " Alan Stern
@ 2006-10-05 18:14       ` Pavel Machek
  2006-10-05 20:29         ` Alan Stern
  0 siblings, 1 reply; 8+ messages in thread
From: Pavel Machek @ 2006-10-05 18:14 UTC (permalink / raw)
  To: Alan Stern
  Cc: Duncan Sands, usbatm, linux-usb-devel, greg, linux-kernel, ueagle,
	matthieu castet

Hi!

> > > Plug/unplug should be easy enough to simulate from usb driver, no?
> > 
> > if a USB driver doesn't define suspend/resume methods, then the core simply
> > unplugs it on suspend, and replugs on resume (IIRC).
> 
> No longer true, and IIRC it never was.  All that happens is that URB 
> submissions fail with -EHOSTUNREACH once the device is suspended.

Could we get "old" behaviour for devices like this? "printk("please
unplug/replug me\n")" is not a good solution.
								Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [linux-usb-devel] [PATCH 1/3] UEAGLE : be suspend friendly
  2006-10-05 18:14       ` Pavel Machek
@ 2006-10-05 20:29         ` Alan Stern
  2006-10-06 15:10           ` Duncan Sands
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Stern @ 2006-10-05 20:29 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Duncan Sands, usbatm, linux-usb-devel, greg, linux-kernel, ueagle,
	matthieu castet

On Thu, 5 Oct 2006, Pavel Machek wrote:

> Hi!
> 
> > > > Plug/unplug should be easy enough to simulate from usb driver, no?
> > > 
> > > if a USB driver doesn't define suspend/resume methods, then the core simply
> > > unplugs it on suspend, and replugs on resume (IIRC).
> > 
> > No longer true, and IIRC it never was.  All that happens is that URB 
> > submissions fail with -EHOSTUNREACH once the device is suspended.
> 
> Could we get "old" behaviour for devices like this? "printk("please
> unplug/replug me\n")" is not a good solution.

I would much rather see this fixed in the driver itself.

For the time being, a "dummy" suspend routine could look like this:

static int foo_suspend(struct usb_interface *intf, pm_message_t msg)
{
	up(&intf->dev.sem);
	device_release_driver(&intf->dev);
	down(&intf->dev.sem);
	return 0;
}

Getting reprobed during resume would be more difficult; it would need help 
from userspace.

Maybe UEAGLE can do something a little more sensible...

Alan Stern


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [linux-usb-devel] [PATCH 1/3] UEAGLE : be suspend friendly
  2006-10-05 20:29         ` Alan Stern
@ 2006-10-06 15:10           ` Duncan Sands
  2006-10-06 18:20             ` Alan Stern
  0 siblings, 1 reply; 8+ messages in thread
From: Duncan Sands @ 2006-10-06 15:10 UTC (permalink / raw)
  To: Alan Stern
  Cc: Pavel Machek, usbatm, linux-usb-devel, greg, linux-kernel, ueagle,
	matthieu castet

> Maybe UEAGLE can do something a little more sensible...

What is the modem supposed to do if it receives a packet to
transmit after it has been told to suspend?  This is a real
question, I'm not pretending!  I've never thought about or
read about suspend/resume and have no idea how it is supposed
to work.  Should it just reject it, or should it wake the
modem up?

Ciao,

Duncan.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [linux-usb-devel] [PATCH 1/3] UEAGLE : be suspend friendly
  2006-10-06 15:10           ` Duncan Sands
@ 2006-10-06 18:20             ` Alan Stern
  0 siblings, 0 replies; 8+ messages in thread
From: Alan Stern @ 2006-10-06 18:20 UTC (permalink / raw)
  To: Duncan Sands
  Cc: Pavel Machek, usbatm, linux-usb-devel, greg, linux-kernel, ueagle,
	matthieu castet

On Fri, 6 Oct 2006, Duncan Sands wrote:

> > Maybe UEAGLE can do something a little more sensible...
> 
> What is the modem supposed to do if it receives a packet to
> transmit after it has been told to suspend?  This is a real
> question, I'm not pretending!  I've never thought about or
> read about suspend/resume and have no idea how it is supposed
> to work.  Should it just reject it, or should it wake the
> modem up?

It depends on the context in which the modem was suspended.  If this was a 
regular system sleep transition, or some other suspend request coming from 
outside the driver, then packets should be dropped.

But if the suspend originated within the driver itself, as a power-saving 
measure while the connection was idle, then new packets should cause the 
driver to wake the modem up.  That is, self-originated suspends should be 
transparent.  Outside-originated suspends are someone else's problem.

Alan Stern


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-10-06 18:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-03 19:46 [PATCH 1/3] UEAGLE : be suspend friendly matthieu castet
2006-10-04 22:05 ` Pavel Machek
2006-10-05  7:17   ` Duncan Sands
2006-10-05 16:22     ` [linux-usb-devel] " Alan Stern
2006-10-05 18:14       ` Pavel Machek
2006-10-05 20:29         ` Alan Stern
2006-10-06 15:10           ` Duncan Sands
2006-10-06 18:20             ` Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox