From: Tejun Heo Date: Sat, 22 Dec 2012 01:56:51 +0000 (-0800) Subject: charger_manager: Don't use [delayed_]work_pending() X-Git-Tag: v3.9-rc1~151^2~46 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fbb520d2079186727786b728ebc5bf20fc85520;p=pandora-kernel.git charger_manager: Don't use [delayed_]work_pending() There's no need to test whether a (delayed) work item in pending before queueing, flushing or cancelling it. Most uses are unnecessary and quite a few of them are buggy. Remove unnecessary pending tests and rewrite _setup_polling() so that it uses mod_delayed_work() if the next polling interval is sooner than currently scheduled. queue_delayed_work() is used otherwise. Only compile tested. I noticed that two work items - setup_polling and cm_monitor_work - schedule each other. It's a very unusual construct and I'm fairly sure it's racy. You can't break such circular dependency by calling cancel on each. I strongly recommend revising the mechanism. Signed-off-by: Tejun Heo Cc: Anton Vorontsov Cc: David Woodhouse Cc: Donggeun Kim Cc: MyungJoo Ham Signed-off-by: Anton Vorontsov --- Reading git-diff-tree failed