Skip to content

Commit

Permalink
drivers: qpnp-fg-gen3/mdss: Queue work on power efficient WQ
Browse files Browse the repository at this point in the history
Signed-off-by: celtare21 <celtare21@gmail.com>
Signed-off-by: Lau <laststandrighthere@gmail.com>
  • Loading branch information
celtare21 authored and TogoFire committed Apr 7, 2023
1 parent 176612c commit 931b1c9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
18 changes: 9 additions & 9 deletions drivers/power/supply/qcom/qpnp-fg-gen3.c
Original file line number Diff line number Diff line change
Expand Up @@ -2635,7 +2635,7 @@ static void fg_ttf_update(struct fg_chip *chip)
chip->ttf.last_ttf = 0;
chip->ttf.last_ms = 0;
mutex_unlock(&chip->ttf.lock);
schedule_delayed_work(&chip->ttf_work, msecs_to_jiffies(delay_ms));
queue_delayed_work(system_power_efficient_wq, &chip->ttf_work, msecs_to_jiffies(delay_ms));
}

static void restore_cycle_counter(struct fg_chip *chip)
Expand Down Expand Up @@ -3371,7 +3371,7 @@ static void sram_dump_work(struct work_struct *work)
fg_dbg(chip, FG_STATUS, "SRAM Dump done at %lld.%d\n",
quotient, remainder);
resched:
schedule_delayed_work(&chip->sram_dump_work,
queue_delayed_work(system_power_efficient_wq, &chip->sram_dump_work,
msecs_to_jiffies(fg_sram_dump_period_ms));
}

Expand Down Expand Up @@ -3399,7 +3399,7 @@ static int fg_sram_dump_sysfs(const char *val, const struct kernel_param *kp)

chip = power_supply_get_drvdata(bms_psy);
if (fg_sram_dump)
schedule_delayed_work(&chip->sram_dump_work,
queue_delayed_work(system_power_efficient_wq, &chip->sram_dump_work,
msecs_to_jiffies(fg_sram_dump_period_ms));
else
cancel_delayed_work_sync(&chip->sram_dump_work);
Expand Down Expand Up @@ -3968,7 +3968,7 @@ static void ttf_work(struct work_struct *work)
/* keep the wake lock and prime the IBATT and VBATT buffers */
if (ttf < 0) {
/* delay for one FG cycle */
schedule_delayed_work(&chip->ttf_work,
queue_delayed_work(system_power_efficient_wq, &chip->ttf_work,
msecs_to_jiffies(1500));
mutex_unlock(&chip->ttf.lock);
return;
Expand All @@ -3985,7 +3985,7 @@ static void ttf_work(struct work_struct *work)
}

/* recurse every 10 seconds */
schedule_delayed_work(&chip->ttf_work, msecs_to_jiffies(10000));
queue_delayed_work(system_power_efficient_wq, &chip->ttf_work, msecs_to_jiffies(10000));
end_work:
vote(chip->awake_votable, TTF_PRIMING, false, 0);
mutex_unlock(&chip->ttf.lock);
Expand Down Expand Up @@ -4808,7 +4808,7 @@ static irqreturn_t fg_batt_missing_irq_handler(int irq, void *data)
}

clear_battery_profile(chip);
schedule_delayed_work(&chip->profile_load_work, 0);
queue_delayed_work(system_power_efficient_wq, &chip->profile_load_work, 0);

if (chip->fg_psy)
power_supply_changed(chip->fg_psy);
Expand Down Expand Up @@ -5930,7 +5930,7 @@ static int fg_gen3_probe(struct platform_device *pdev)
}

device_init_wakeup(chip->dev, true);
schedule_delayed_work(&chip->profile_load_work, 0);
queue_delayed_work(system_power_efficient_wq, &chip->profile_load_work, 0);

pr_debug("FG GEN3 driver probed successfully\n");
return 0;
Expand Down Expand Up @@ -5967,9 +5967,9 @@ static int fg_gen3_resume(struct device *dev)
if (rc < 0)
pr_err("Error in configuring ESR timer, rc=%d\n", rc);

schedule_delayed_work(&chip->ttf_work, 0);
queue_delayed_work(system_power_efficient_wq, &chip->ttf_work, 0);
if (fg_sram_dump)
schedule_delayed_work(&chip->sram_dump_work,
queue_delayed_work(system_power_efficient_wq, &chip->sram_dump_work,
msecs_to_jiffies(fg_sram_dump_period_ms));

if (!work_pending(&chip->status_change_work)) {
Expand Down
3 changes: 2 additions & 1 deletion drivers/video/fbdev/msm/mdss_mdp_intf_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,8 @@ int mdss_mdp_resource_control(struct mdss_mdp_ctl *ctl, u32 sw_event)
* reached. This is to prevent the case where early wake
* up is called but no frame update is sent.
*/
schedule_delayed_work(&ctx->delayed_off_clk_work,
queue_delayed_work(system_power_efficient_wq,
&ctx->delayed_off_clk_work,
CMD_MODE_IDLE_TIMEOUT);
pr_debug("off work scheduled\n");
}
Expand Down

0 comments on commit 931b1c9

Please sign in to comment.