Skip to content

Commit

Permalink
power: pm2301_charger: Remove deprecated create_singlethread_workqueue
Browse files Browse the repository at this point in the history
alloc_ordered_workqueue() with WQ_MEM_RECLAIM set replaces
deprecated create_singlethread_workqueue(). This is the identity
conversion.

The workqueue "charger_wq" is used for running all the charger related
tasks. This involves charger detection, checking for HW failure and HW
status. This workqueue has been identity converted.

It queues multiple workitems viz &pm2->check_main_thermal_prot_work,
&pm2->check_hw_failure_work, &pm2->ac_work. Hence, the deprecated
create_singlethread_workqueue() instance has been replaced with a
dedicated ordered workqueue.

The WQ_MEM_RECLAIM flag has been set to ensure forward progress under
memory pressure.

Signed-off-by: Bhaktipriya Shridhar <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
  • Loading branch information
bhaktipriya authored and sre committed Aug 15, 2016
1 parent a8dd5b6 commit d8a6925
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/power/supply/pm2301_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,8 @@ static int pm2xxx_wall_charger_probe(struct i2c_client *i2c_client,
pm2->ac_chg.external = true;

/* Create a work queue for the charger */
pm2->charger_wq = create_singlethread_workqueue("pm2xxx_charger_wq");
pm2->charger_wq = alloc_ordered_workqueue("pm2xxx_charger_wq",
WQ_MEM_RECLAIM);
if (pm2->charger_wq == NULL) {
ret = -ENOMEM;
dev_err(pm2->dev, "failed to create work queue\n");
Expand Down

0 comments on commit d8a6925

Please sign in to comment.