On 2012年12月06日 23:43, Alan Stern wrote: > 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. Yeah. Two flags maybe good. In this situation, it should be call "power_is_on", right? power_is_on can be used to avoid to sending redundant PORT_POWER request. The other flag is dedicated to prevent device from being disconnected. Something like hub->busy_bits. We can can "child_busy", I am not very good at giving a name. So I'd like to see your opinion. :) > > Alan Stern > -- Best regards Tianyu Lan -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html