Skip to content

PM / devfreq: check the get_cur_freq() return value

Bean Huo linux-pm linux-scsi lkml 3 versions – Applied

Status from this message: Applied them. Thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 1 replyApplied
  2. v24 patches 13 repliesApplied
  3. v13 patches 4 repliesSuperseded

Changes in v3 from the cover letter

- Patch 1: do not call ->get_cur_freq() inside the if condition. Read the frequency into a local variable and only use it when the callback returns 0, as Chanwoo suggested. Behavior is the same as in v2. I kept the Reviewed-by tags from Avri and Jie, since only the form of the code changed; please tell me if that is not OK.
- Patch 1 and 2: add Reviewed-by from Jie Zhan.
- Patch 2: add Acked-by from Chanwoo Choi. No change in the patch.

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/2PM / devfreq: Fall back to previous_freq when get_cur_freq() failsdrivers/devfreq/devfreq.c+7 -50 replies
2/2PM / devfreq: Add more details to the get_cur_freq() commentinclude/linux/devfreq.h+5 -20 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchAvri AltmanJie ZhanChanwoo Choi
1/2R-b R-b
2/2R-b R-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v3 thread

Cover letter [PATCH v3 0/2] PM / devfreq: check the get_cur_freq() return value

From: Bean Huo <[email protected]>

devfreq_set_target() does not check the return value of the optional ->get_cur_freq() callback, so a failing callback can leave an uninitialized frequency in freqs.old for the transition notifiers. Patch 1 fixes that by falling back to previous_freq, like the other two callers already do. Patch 2 writes down what a driver is expected to return from the callback.

v2 had four patches. Martin applied patches 3 and 4 (the ufshcd part) to the SCSI tree, so this v3 only has the two devfreq patches.

Changes since v2:
- Patch 1: do not call ->get_cur_freq() inside the if condition. Read the frequency into a local variable and only use it when the callback returns 0, as Chanwoo suggested. Behavior is the same as in v2. I kept the Reviewed-by tags from Avri and Jie, since only the form of the code changed; please tell me if that is not OK.
- Patch 1 and 2: add Reviewed-by from Jie Zhan.
- Patch 2: add Acked-by from Chanwoo Choi. No change in the patch.

v2: https://lore.kernel.org/all/[email protected]/

Bean Huo (2):
PM / devfreq: Fall back to previous_freq when get_cur_freq() fails PM / devfreq: Add more details to the get_cur_freq() comment

 drivers/devfreq/devfreq.c | 12 +++++++-----
 include/linux/devfreq.h   |  7 +++++--
 2 files changed, 12 insertions(+), 7 deletions(-)

base-commit: 4ff20abe28d65a0c52f0b280008fcfb93c3ee2b2

Signature · 1 line
2.34.1