Remove deprecated workqueue interface users
cover Remove deprecated workqueue interface users
This patch set removes the instances of deprecated create_singlethread_workqueues in drivers/power by making the appropriate conversions.
Bhaktipriya Shridhar (8):
power: abx500_chargalg: Remove deprecated create_singlethread_workqueue
power: ab8500_btemp: Remove deprecated create_singlethread_workqueue
power: pm2301_charger: Remove deprecated create_singlethread_workqueue
power: intel_mid_battery: Remove deprecated create_singlethread_workqueue
power: ab8500_charger: Remove deprecated create_singlethread_workqueue
power: ipaq_micro_battery: Remove deprecated create_singlethread_workqueue
power: ab8500_fg: Remove deprecated create_singlethread_workqueue
power: ds2760_battery: Remove deprecated create_singlethread_workqueue
drivers/power/ab8500_btemp.c | 2 +- drivers/power/ab8500_charger.c | 4 ++-- drivers/power/ab8500_fg.c | 2 +- drivers/power/abx500_chargalg.c | 4 ++-- drivers/power/ds2760_battery.c | 3 ++- drivers/power/intel_mid_battery.c | 3 +-- drivers/power/ipaq_micro_battery.c | 2 +- drivers/power/pm2301_charger.c | 3 ++- 8 files changed, 12 insertions(+), 11 deletions(-)
--
2.1.4
PATCH 1/8 power: abx500_chargalg: Remove deprecated create_singlethread_workqueue
alloc_ordered_workqueue() with WQ_MEM_RECLAIM set replaces deprecated create_singlethread_workqueue(). This is the identity conversion.
The workqueue "chargalg_wq" is used for running the charging algorithm. It has multiple workitems viz &di->chargalg_periodic_work, &di->chargalg_wd_work, &di->chargalg_work per abx500_chargalg, which require ordering. It has been identity converted.
Also, WQ_MEM_RECLAIM has been set to ensure forward progress under memory pressure.
--- drivers/power/abx500_chargalg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/power/abx500_chargalg.c +2 -2
@@ -2091,8 +2091,8 @@ static int abx500_chargalg_probe(struct platform_device *pdev) abx500_chargalg_maintenance_timer_expired;/* Create a work queue for the chargalg */ - di->chargalg_wq = -create_singlethread_workqueue ("abx500_chargalg_wq" ); + di->chargalg_wq =alloc_ordered_workqueue ("abx500_chargalg_wq" , +WQ_MEM_RECLAIM );if (di->chargalg_wq ==NULL ) {dev_err (di->dev,"failed to create work queue\n" );return -ENOMEM ;
--
2.1.4
Hi,
Quoted 3 lines · Bhaktipriya Shridhar
This patch set removes the instances of deprecated
create_singlethread_workqueuesindrivers/powerby making the appropriate conversions.
Thanks, all queued into power-supply's for-next branch.
-- Sebastian
Quoted 4 lines · Bhaktipriya Shridhar
This patch set removes the instances of deprecated
create_singlethread_workqueuesindrivers/powerby making the appropriate conversions.
Quoted 9 lines
Bhaktipriya Shridhar (8):
power:abx500_chargalg: Remove deprecatedcreate_singlethread_workqueue
power:ab8500_btemp: Remove deprecatedcreate_singlethread_workqueue
power:pm2301_charger: Remove deprecatedcreate_singlethread_workqueue
power:intel_mid_battery: Remove deprecatedcreate_singlethread_workqueue
power:ab8500_charger: Remove deprecatedcreate_singlethread_workqueue
power:ipaq_micro_battery: Remove deprecatedcreate_singlethread_workqueue
power:ab8500_fg: Remove deprecatedcreate_singlethread_workqueue
power:ds2760_battery: Remove deprecatedcreate_singlethread_workqueue
Patches look good to me. I'm a bit curious about WQ_MEM_RECLAIM part tho. I suppose the reasoning is that as the hardware in question is involved in battery management which may be time critical, WQ_MEM_RECLAIM is added to ensure (timely) forward progress under memory pressure, right? It'd be great if someone who's more familiar with these hardware can confirm whether this is actually necessary.
Oh, it'd also be nice to put the target subsystem in the subject of the patchset - e.g. "[PATCH 0/8] power: Remove..."
Thanks.
Signature · 1 line
tejun
Hi,
Quoted 15 lines · Tejun Heo
Quoted 4 lines · Bhaktipriya Shridhar
This patch set removes the instances of deprecated
create_singlethread_workqueuesindrivers/powerby making the appropriate conversions.Quoted 9 lines
Bhaktipriya Shridhar (8):
power:abx500_chargalg: Remove deprecatedcreate_singlethread_workqueue
power:ab8500_btemp: Remove deprecatedcreate_singlethread_workqueue
power:pm2301_charger: Remove deprecatedcreate_singlethread_workqueue
power:intel_mid_battery: Remove deprecatedcreate_singlethread_workqueue
power:ab8500_charger: Remove deprecatedcreate_singlethread_workqueue
power:ipaq_micro_battery: Remove deprecatedcreate_singlethread_workqueue
power:ab8500_fg: Remove deprecatedcreate_singlethread_workqueue
power:ds2760_battery: Remove deprecatedcreate_singlethread_workqueue
Quoted 7 lines
Patches look good to me. I'm a bit curious about
WQ_MEM_RECLAIMpart tho. I suppose the reasoning is that as the hardware in question is involved in battery management which may be time critical,WQ_MEM_RECLAIMis added to ensure (timely) forward progress under memory pressure, right? It'd be great if someone who's more familiar with these hardware can confirm whether this is actually necessary.
At least the charger monitoring is timing critical: Many charger chips must be monitored (e.g. for over-temp. events). I think all of them have a self-protection, or a watchdog, so they would actually stop charging instead of overheating, but that may result in system failure due to power loss. Battery monitors also include some temperture safety checks. So without careful case-by-case checking the WQ_MEM_RECLAIM should not be removed IMHO.
Anyways, I queued this patchset, since create_singlethread_workqueue() did use WQ_MEM_RECLAIM, so removing that bit should be in another patch.
Quoted 2 lines
Oh, it'd also be nice to put the target subsystem in the subject of the patchset - e.g. "[PATCH 0/8] power: Remove..."
Yes please. Also it seems like PATCH2-8 have wrong reference to PATCH0/8 mail.
-- Sebastian
Hello, Sebastian.
Quoted 7 lines · Sebastian Reichel
At least the charger monitoring is timing critical: Many charger chips must be monitored (e.g. for over-temp. events). I think all of them have a self-protection, or a watchdog, so they would actually stop charging instead of overheating, but that may result in system failure due to power loss. Battery monitors also include some temperture safety checks. So without careful case-by-case checking the
WQ_MEM_RECLAIMshould not be removed IMHO.
Thanks for the clarification. Yeah, WQ_MEM_RECLAIM seems like the right call.
Thanks.
Signature · 1 line
tejun