diff --git a/drivers/misc/qseecom.c b/drivers/misc/qseecom.c index bfede3b686acf..782efee718e55 100644 --- a/drivers/misc/qseecom.c +++ b/drivers/misc/qseecom.c @@ -6881,9 +6881,11 @@ static int __qseecom_update_qteec_req_buf(struct qseecom_qteec_modfd_req *req, for (i = 0; i < MAX_ION_FD; i++) { if (req->ifd_data[i].fd > 0) { ion_fd = req->ifd_data[i].fd; - if ((req->req_len < sizeof(uint32_t)) || + if ((req->req_len < + sizeof(struct qseecom_param_memref)) || (req->ifd_data[i].cmd_buf_offset > - req->req_len - sizeof(uint32_t))) { + req->req_len - + sizeof(struct qseecom_param_memref))) { pr_err("Invalid offset/req len 0x%x/0x%x\n", req->req_len, req->ifd_data[i].cmd_buf_offset); diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index 4f95fe8f25c40..f330ae77bfbea 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c @@ -855,6 +855,9 @@ static int pci_pm_resume(struct device *dev) const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; int error = 0; + if (pci_dev->no_d3hot) + goto skip_pci_pm_restore; + /* * This is necessary for the suspend error path in which resume is * called without restoring the standard config registers of the device. @@ -862,6 +865,7 @@ static int pci_pm_resume(struct device *dev) if (pci_dev->state_saved) pci_restore_standard_config(pci_dev); +skip_pci_pm_restore: if (pci_has_legacy_pm_support(pci_dev)) return pci_legacy_resume(dev); diff --git a/drivers/power/supply/qcom/fg-alg.c b/drivers/power/supply/qcom/fg-alg.c index dcb5ff97f9489..e60d73e267fef 100644 --- a/drivers/power/supply/qcom/fg-alg.c +++ b/drivers/power/supply/qcom/fg-alg.c @@ -1167,7 +1167,7 @@ static int get_step_chg_current_window(struct ttf *ttf) struct range_data *step_chg_cfg = ttf->step_chg_cfg; int i, rc, curr_window, vbatt; - if (ttf->mode == TTF_MODE_V_STEP_CHG) { + if (ttf->mode == TTF_MODE_VBAT_STEP_CHG) { rc = ttf->get_ttf_param(ttf->data, TTF_VBAT, &vbatt); if (rc < 0) { pr_err("failed to get battery voltage, rc=%d\n", rc); @@ -1293,7 +1293,7 @@ static int get_time_to_full_locked(struct ttf *ttf, int *val) /* estimated battery current at the CC to CV transition */ switch (ttf->mode) { case TTF_MODE_NORMAL: - case TTF_MODE_V_STEP_CHG: + case TTF_MODE_VBAT_STEP_CHG: case TTF_MODE_OCV_STEP_CHG: i_cc2cv = ibatt_avg * vbatt_avg / max(MILLI_UNIT, float_volt_uv / MILLI_UNIT); @@ -1351,7 +1351,7 @@ static int get_time_to_full_locked(struct ttf *ttf, int *val) ibatt_this_step, t_predicted_this_step); } break; - case TTF_MODE_V_STEP_CHG: + case TTF_MODE_VBAT_STEP_CHG: case TTF_MODE_OCV_STEP_CHG: if (!step_chg_data || !step_chg_cfg) break; @@ -1392,7 +1392,7 @@ static int get_time_to_full_locked(struct ttf *ttf, int *val) MILLI_UNIT); } - if (ttf->mode == TTF_MODE_V_STEP_CHG) + if (ttf->mode == TTF_MODE_VBAT_STEP_CHG) step_chg_data[i].ocv = step_chg_cfg[i].high_threshold - (rbatt * i_step); diff --git a/drivers/power/supply/qcom/fg-alg.h b/drivers/power/supply/qcom/fg-alg.h index 5b37abc583000..8e144d5fe8e6e 100644 --- a/drivers/power/supply/qcom/fg-alg.h +++ b/drivers/power/supply/qcom/fg-alg.h @@ -91,7 +91,7 @@ struct cap_learning { enum ttf_mode { TTF_MODE_NORMAL = 0, TTF_MODE_QNOVO, - TTF_MODE_V_STEP_CHG, + TTF_MODE_VBAT_STEP_CHG, TTF_MODE_OCV_STEP_CHG, }; diff --git a/drivers/power/supply/qcom/qpnp-fg-gen4.c b/drivers/power/supply/qcom/qpnp-fg-gen4.c index 5d9fa9baac775..a1d6e793c24b3 100644 --- a/drivers/power/supply/qcom/qpnp-fg-gen4.c +++ b/drivers/power/supply/qcom/qpnp-fg-gen4.c @@ -1079,7 +1079,7 @@ static int fg_gen4_get_ttf_param(void *data, enum ttf_param param, int *val) if (is_qnovo_en(fg)) *val = TTF_MODE_QNOVO; else if (chip->ttf->step_chg_cfg_valid) - *val = TTF_MODE_V_STEP_CHG; + *val = TTF_MODE_VBAT_STEP_CHG; else if (chip->ttf->ocv_step_chg_cfg_valid) *val = TTF_MODE_OCV_STEP_CHG; else diff --git a/drivers/power/supply/qcom/qpnp-qg.c b/drivers/power/supply/qcom/qpnp-qg.c index 13c3fca11e9a1..4debea696ef75 100644 --- a/drivers/power/supply/qcom/qpnp-qg.c +++ b/drivers/power/supply/qcom/qpnp-qg.c @@ -1615,7 +1615,7 @@ static int qg_get_ttf_param(void *data, enum ttf_param param, int *val) break; case TTF_MODE: if (chip->ttf->step_chg_cfg_valid) - *val = TTF_MODE_V_STEP_CHG; + *val = TTF_MODE_VBAT_STEP_CHG; else *val = TTF_MODE_NORMAL; break;