On Thu, 6 Dec 2012, Lan Tianyu wrote:

> Hi Alan:
>       Doing port_dev->power_on = true in usb_hub_set_port_power() just after
> set PORT_POWER feature will cause device to be disconnected. If user set
> PM Qos NO_POWER_OFF flag after the device was power off, the port would
> be power on and do port_dev->power_on = true. But the port connect
> change event couldn't be ignored and the device would be disconnected.

The problem is that you chose a bad name for this flag.  Does 
"power_on" mean that the power _is_ on, that the power _was_ on, that 
the power _will be_ on, or that the power _should be_ on?

Maybe you really need two flags.  Do whatever is best; I'm sure you can
figure out a good scheme.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to