platform/x86/intel-uncore-freq: Return error on write frequency
Subsystems (2)
Srinivas Pandruvada
maintainerPATCH 1/1 platform/x86/intel-uncore-freq: Return error on write frequency
Currently when the uncore_write() returns error, it is silently ignored. Return error to user space when uncore_write() fails.
---
This patch has no dependency on TPMI patches for uncore support.
.../x86/intel/uncore-frequency/uncore-frequency-common.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c +5 -1
@@ -44,14 +44,18 @@ static ssize_t store_min_max_freq_khz(struct uncore_data *data, int min_max) {unsigned int input; +int ret;if (kstrtouint (buf,10 , &input))return -EINVAL ;mutex_lock (&uncore_lock); -uncore_write (data, input, min_max); + ret =uncore_write (data, input, min_max);mutex_unlock (&uncore_lock); +if (ret) +return ret; +return count; }
Signature · 1 line
2.38.1
Quoted 25 lines · Srinivas Pandruvada
Currently when the
uncore_write()returns error, it is silently ignored. Return error to user space whenuncore_write()fails.Signed-off-by Srinivas Pandruvada <[email protected]>Reviewed-by Zhang Rui <[email protected]>Tested-by Wendy Wang <[email protected]>---
This patch has no dependency on TPMI patches for uncore support..../x86/intel/uncore-frequency/uncore-frequency-common.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c +1
-0@@ -44,14 +44,18 @@ static ssize_t store_min_max_freq_khz(struct uncore_data *data, int min_max) {unsigned int input; +int ret;if (kstrtouint (buf,10 , &input))return -EINVAL ;
drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c static ssize_t store_min_max_freq_khz(struct uncore_data *data, · line 60
Quoted 10 lines
drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c +4
-1mutex_lock (&uncore_lock); -uncore_write (data, input, min_max); + ret =uncore_write (data, input, min_max);mutex_unlock (&uncore_lock); +if (ret) +return ret; +return count; }
Shouldn't this have Fixes tag?
Other than that,
Signature · 1 line
i.
srinivas pandruvada
maintainerQuoted 38 lines · Ilpo Järvinen
Quoted 36 lines · Srinivas Pandruvada
Currently when the
uncore_write()returns error, it is silently ignored. Return error to user space whenuncore_write()fails.Signed-off-by: Srinivas Pandruvada
<[email protected]>Reviewed-by Zhang Rui <[email protected]>Tested-by Wendy Wang <[email protected]>---
This patch has no dependency on TPMI patches for uncore support..../x86/intel/uncore-frequency/uncore-frequency-common.c | 6
+++++-1 file changed, 5 insertions(+), 1 deletion(-)(quoted diff) +0
-0
frequency-common.cb/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c
indexcb24de9e97dc..fa8f14c925ec100644
--- a/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c
+++ b/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.cdrivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c +1
-0@@ -44,14 +44,18 @@ static ssize_t store_min_max_freq_khz(structuncore_data *data, int min_max) { unsigned int input; + int ret;
if (kstrtouint(buf, 10, &input))
return-EINVAL;
mutex_lock(&uncore_lock);
- uncore_write(data, input,min_max);
+ ret =uncore_write(data, input, min_max);
mutex_unlock(&uncore_lock);
Quoted 8 lines
Quoted 6 lines
+ if (ret)
+ return ret;
+
return count;
}Shouldn't this have Fixes tag?
With the reorg of the directories, the blame commit is not what which will be shown by "git blame". The original one is:
control")
Didn't mark to stable that the current MSR write can't fail on production systems.
Quoted 6 lines
Other than that,
Reviewed-by Ilpo Järvinen <[email protected]>
Thanks,
Srinivas
Hi,
Quoted 6 lines · Srinivas Pandruvada
Currently when the
uncore_write()returns error, it is silently ignored. Return error to user space whenuncore_write()fails.Signed-off-by Srinivas Pandruvada <[email protected]>Reviewed-by Zhang Rui <[email protected]>Tested-by Wendy Wang <[email protected]>
Thank you for your patch, I've applied this patch to my review-hans branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans
Note it will show up in my review-hans branch once I've pushed my local branch there, which might take a while.
Patches which are added to review-hans now are intended for the next rc1. This branch will get rebased to the next rc1 when it is out and after the rebasing the contents of review-hans will be pushed to the platform-drivers-x86/for-next branch.
Regards,
Hans
Quoted 30 lines
---
This patch has no dependency on TPMI patches for uncore support..../x86/intel/uncore-frequency/uncore-frequency-common.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c +5
-1@@ -44,14 +44,18 @@ static ssize_t store_min_max_freq_khz(struct uncore_data *data, int min_max) {unsigned int input; +int ret;if (kstrtouint (buf,10 , &input))return -EINVAL ;mutex_lock (&uncore_lock); -uncore_write (data, input, min_max); + ret =uncore_write (data, input, min_max);mutex_unlock (&uncore_lock); +if (ret) +return ret; +return count; }