On Mon, Nov 09, 2015 at 03:13:09AM +0000, Oder Chiou wrote:
What makes you claim that this is "essential in case of the operation of kcontrol continuously"?
Like the Chrome OS, while the user pull the volume bar up or down, the kcontrol will be manipulated by the UI continuously and seamlessly. In this kind of case, if the "cancel_delayed_work_sync" is removed, the queue_delayed_work will be failed within 200ms after the previous queue_delayed_work, and it will not be able to make sure the power of the RC clock enabled at least 200ms, thanks.
No, it won't. To repeat what I said if you just schedule the delayed work again without cancelling then the right thing will happen.
The following logs are our test result. =========================================================================== [ 123.365789] [rt5645_spk_put_volsw]->(584) queue_delayed_work ret = 1 [ 123.367204] [rt5645_spk_put_volsw]->(584) queue_delayed_work ret = 0 [ 123.392307] [rt5645_spk_put_volsw]->(584) queue_delayed_work ret = 0 [ 123.393542] [rt5645_spk_put_volsw]->(584) queue_delayed_work ret = 0 [ 123.469445] [rt5645_spk_put_volsw]->(584) queue_delayed_work ret = 0 [ 123.470581] [rt5645_spk_put_volsw]->(584) queue_delayed_work ret = 0 [ 123.565417] [rt5645_rcclock_work]->(3156) =========================================================================== If we didn't cancel the delayed work, the function will return false to indicate the delayed work that are already on the queue. It will make the delayed work that cannot make sure to be manipulated at least 200ms after the last rt5645_spk_put_volsw was manipulated. In the log, we remove the cancel_delayed_work and there is only 95ms delay that cannot meet our requirement, thanks.