Re: [linux-usb-devel] [QUESTION] HCD's suspend implementation

2005-12-22 Thread David Brownell
On Wednesday 21 December 2005 12:15 am, Franck wrote: Aynways, this work seems to be already done by driver model. Check in dpm_runtime_suspend : if (!(error = suspend_device(dev, state))) dev-power.power_state = state; Which represents a couple bugs,

Re: [linux-usb-devel] [QUESTION] HCD's suspend implementation

2005-12-21 Thread Franck
2005/12/19, Alan Stern [EMAIL PROTECTED]: On Mon, 19 Dec 2005, Franck wrote: The new code is supposed to work okay, even with values between 0 and 500. If it doesn't, maybe Franck has found a real problem with it. setting hcd-power_budget to 0 (meaning power budget illimeted) fixes

Re: [linux-usb-devel] [QUESTION] HCD's suspend implementation

2005-12-21 Thread Franck
2005/12/19, Alan Stern [EMAIL PROTECTED]: On Mon, 19 Dec 2005, Franck wrote: BTW, the hcd suspend method do: dev-dev.power.power_state = state; I think this work should be part of the driver model, shouldn't it ? No. The driver core does not understand the power states any

Re: [linux-usb-devel] [QUESTION] HCD's suspend implementation

2005-12-21 Thread Alan Stern
On Wed, 21 Dec 2005, Franck wrote: 2005/12/19, Alan Stern [EMAIL PROTECTED]: On Mon, 19 Dec 2005, Franck wrote: BTW, the hcd suspend method do: dev-dev.power.power_state = state; I think this work should be part of the driver model, shouldn't it ? No. The driver

Re: [linux-usb-devel] [QUESTION] HCD's suspend implementation

2005-12-19 Thread Franck
2005/12/19, Olav Kongas [EMAIL PROTECTED]: On Sun, 18 Dec 2005, David Brownell wrote: OK, but what happen if HC suspend is called whereas bus and its attached devices have not been suspended yet ? That would be a bug; the driver model is supposed to ensure that the children

Re: [linux-usb-devel] [QUESTION] HCD's suspend implementation

2005-12-19 Thread Alan Stern
On Mon, 19 Dec 2005, Franck wrote: The new code is supposed to work okay, even with values between 0 and 500. If it doesn't, maybe Franck has found a real problem with it. setting hcd-power_budget to 0 (meaning power budget illimeted) fixes the problem. I actually do not understand

Re: [linux-usb-devel] [QUESTION] HCD's suspend implementation

2005-12-19 Thread Alan Stern
On Mon, 19 Dec 2005, Franck wrote: BTW, the hcd suspend method do: dev-dev.power.power_state = state; I think this work should be part of the driver model, shouldn't it ? No. The driver core does not understand the power states any particular device can be in. It's up to the

Re: [linux-usb-devel] [QUESTION] HCD's suspend implementation

2005-12-18 Thread Franck
Hi Olav 2005/12/17, Olav Kongas [EMAIL PROTECTED]: On Fri, 16 Dec 2005, Alan Stern wrote: On Fri, 16 Dec 2005, Franck wrote: Hi Alan, 2005/12/15, Alan Stern [EMAIL PROTECTED]: No, the bus should already be suspended. In fact, you should fail the driver-suspend

Re: [linux-usb-devel] [QUESTION] HCD's suspend implementation

2005-12-18 Thread Franck
2005/12/17, Alan Stern [EMAIL PROTECTED]: On Fri, 16 Dec 2005, Franck wrote: No, that's not what it means. Suspending all the devices attached to a bus is different from suspending the bus itself. Well stopping any activity on the bus (that's what happen when suspending all

Re: [linux-usb-devel] [QUESTION] HCD's suspend implementation

2005-12-18 Thread Franck
2005/12/17, Olav Kongas [EMAIL PROTECTED]: On Fri, 16 Dec 2005, Franck wrote: 2005/12/16, Alan Stern [EMAIL PROTECTED]: By definition every host controller, including yours, has a root hub. That one port is the root hub's downstream port. The point of a bus suspend is that the

Re: [linux-usb-devel] [QUESTION] HCD's suspend implementation

2005-12-18 Thread Alan Stern
On Sun, 18 Dec 2005, Franck wrote: 2005/12/17, Alan Stern [EMAIL PROTECTED]: On Fri, 16 Dec 2005, Franck wrote: No, that's not what it means. Suspending all the devices attached to a bus is different from suspending the bus itself. Well stopping any activity on the bus

Re: [linux-usb-devel] [QUESTION] HCD's suspend implementation

2005-12-18 Thread David Brownell
No, that's not what it means. Suspending all the devices attached to a bus is different from suspending the bus itself. Well stopping any activity on the bus (that's what happen when suspending all devices from the bus) sounds to me like suspending the bus...

Re: [linux-usb-devel] [QUESTION] HCD's suspend implementation

2005-12-18 Thread David Brownell
OK, but what happen if HC suspend is called whereas bus and its attached devices have not been suspended yet ? That would be a bug; the driver model is supposed to ensure that the children (bus and its devices) are suspended before the parent.

Re: [linux-usb-devel] [QUESTION] HCD's suspend implementation

2005-12-18 Thread David Brownell
nope, my hcd-power_budget is set to 500mA. This error is printed by hub_port_connect_change in hub.c. The condition that refuses the new device is not related to power budget, is it ? Try not setting that power budget. There's a glitch in how root port budgets are calculated ... it works for

Re: [linux-usb-devel] [QUESTION] HCD's suspend implementation

2005-12-18 Thread Olav Kongas
On Sun, 18 Dec 2005, David Brownell wrote: OK, but what happen if HC suspend is called whereas bus and its attached devices have not been suspended yet ? That would be a bug; the driver model is supposed to ensure that the children (bus and its devices) are suspended before the

Re: [linux-usb-devel] [QUESTION] HCD's suspend implementation

2005-12-18 Thread Olav Kongas
On Sun, 18 Dec 2005, Franck wrote: 2005/12/17, Olav Kongas [EMAIL PROTECTED]: On Fri, 16 Dec 2005, Franck wrote: ok so bus_suspend is actually used to suspend root hub or hcd circuitry related to bus activity ? If so I can't do anything useful here with my hardware. Frank,

Re: [linux-usb-devel] [QUESTION] HCD's suspend implementation

2005-12-16 Thread Franck
Hi Alan, 2005/12/15, Alan Stern [EMAIL PROTECTED]: No, the bus should already be suspended. In fact, you should fail the driver-suspend request if the bus isn't already suspended. hmm I think so but I don't see this behaviour in isp116 or sl811 hcds. The former do actually nothing, even if

Re: [linux-usb-devel] [QUESTION] HCD's suspend implementation

2005-12-16 Thread Alan Stern
On Fri, 16 Dec 2005, Franck wrote: Hi Alan, 2005/12/15, Alan Stern [EMAIL PROTECTED]: No, the bus should already be suspended. In fact, you should fail the driver-suspend request if the bus isn't already suspended. hmm I think so but I don't see this behaviour in isp116 or sl811

Re: [linux-usb-devel] [QUESTION] HCD's suspend implementation

2005-12-16 Thread Franck
2005/12/16, Alan Stern [EMAIL PROTECTED]: On Fri, 16 Dec 2005, Franck wrote: OK, I think I get the main idea of suspend/resume process for usb. But now, I don't see the purpose of hcd-bus_suspend method. What is it supposed to do since all of its children must be suspended (meaning that

Re: [linux-usb-devel] [QUESTION] HCD's suspend implementation

2005-12-16 Thread Olav Kongas
On Fri, 16 Dec 2005, Alan Stern wrote: On Fri, 16 Dec 2005, Franck wrote: Hi Alan, 2005/12/15, Alan Stern [EMAIL PROTECTED]: No, the bus should already be suspended. In fact, you should fail the driver-suspend request if the bus isn't already suspended. hmm I think so

Re: [linux-usb-devel] [QUESTION] HCD's suspend implementation

2005-12-16 Thread Alan Stern
On Fri, 16 Dec 2005, Franck wrote: No, that's not what it means. Suspending all the devices attached to a bus is different from suspending the bus itself. Well stopping any activity on the bus (that's what happen when suspending all devices from the bus) sounds to me like suspending

Re: [linux-usb-devel] [QUESTION] HCD's suspend implementation

2005-12-16 Thread Olav Kongas
On Fri, 16 Dec 2005, Franck wrote: 2005/12/16, Alan Stern [EMAIL PROTECTED]: By definition every host controller, including yours, has a root hub. That one port is the root hub's downstream port. The point of a bus suspend is that the host controller can save power by turning off the

[linux-usb-devel] [QUESTION] HCD's suspend implementation

2005-12-15 Thread Franck
Hi, I'm looking at the USB suspend code of kernel 2.6.15-rc5. It seems that it has changed a lot since 2.6.14, and I'm quite confused on how to implement the suspend feature for a HCD. Actually the hcd can be suspended itself (driver suspend) or it can be asked to suspend the bus through its

Re: [linux-usb-devel] [QUESTION] HCD's suspend implementation

2005-12-15 Thread Alan Stern
On Thu, 15 Dec 2005, Franck wrote: Hi, I'm looking at the USB suspend code of kernel 2.6.15-rc5. It seems that it has changed a lot since 2.6.14, and I'm quite confused on how to implement the suspend feature for a HCD. Actually the hcd can be suspended itself (driver suspend) or it can