Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 39174fe3 authored by Gautham R. Shenoy's avatar Gautham R. Shenoy Committed by Rahul Shahare
Browse files

cpufreq: stats: Handle the case when trans_table goes beyond PAGE_SIZE



On platforms with large number of Pstates, the transition table, which
is a NxN matrix, can overflow beyond the PAGE_SIZE boundary.

This can be seen on POWER9 which has 100+ Pstates.

As a result, each time the trans_table is read for any of the CPUs, we
will get the following error.

---------------------------------------------------
fill_read_buffer: show+0x0/0xa0 returned bad count
---------------------------------------------------

This patch ensures that in case of an overflow, we print a warning
once in the dmesg and return FILE TOO LARGE error for this and all
subsequent accesses of trans_table.

Change-Id: I4d22a81fcad037e887b4ddf2999904b321401441
Signed-off-by: default avatarGautham R. Shenoy <ego@linux.vnet.ibm.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Git-repo: https://android.googlesource.com/kernel/common/


Git-commit: f7bc9b209e27c0b617378400136cc663a6314d0c
Signed-off-by: default avatarRahul Shahare <rshaha@codeaurora.org>
parent c81bd970
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment