Re: [PATCH v2 7/9] usb: add usb port auto power off mechanism

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2013年01月04日 23:57, Alan Stern wrote:
> On Fri, 4 Jan 2013, Lan Tianyu wrote:
>> @@ -2862,6 +2880,20 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg)
>>  		udev->port_is_suspended = 1;
>>  		msleep(10);
>>  	}
>> +
>> +	/*
>> +	 * Check whether current status is meeting requirement of
>> +	 * usb port power off mechanism
>> +	 */
>> +	if (!udev->do_remote_wakeup
>> +			&& (dev_pm_qos_flags(&port_dev->dev,
>> +			PM_QOS_FLAG_NO_POWER_OFF) != PM_QOS_FLAGS_ALL)
>> +			&& udev->persist_enabled
>> +			&& !status) {
>> +		pm_runtime_put_sync(&port_dev->dev);
>> +		port_dev->did_runtime_put = true;
> 
> You forgot to check port_dev->did_runtime_put in usb_disconnect.  
> Unless you check it, you could end up calling pm_runtime_put a second 
> time.
Thanks for your reminder. Yeah. If the did_runtime_put is true, the
pm_runtime_put() in the usb_disconnect() is not necessary.



-- 
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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux