linux/arch/x86/kernel/cpu
Srivatsa S. Bhat a720b2dd24 x86, intel_cacheinfo: Fix error return code in amd_set_l3_disable_slot()
If the L3 disable slot is already in use, return -EEXIST instead of
-EINVAL. The caller, store_cache_disable(), checks this return value to
print an appropriate warning.

Also, we want to signal with -EEXIST that the current index we're
disabling has actually been already disabled on the node:

$ echo 12 > /sys/devices/system/cpu/cpu3/cache/index3/cache_disable_0
$ echo 12 > /sys/devices/system/cpu/cpu3/cache/index3/cache_disable_0
-bash: echo: write error: File exists
$ echo 12 > /sys/devices/system/cpu/cpu3/cache/index3/cache_disable_1
-bash: echo: write error: File exists
$ echo 12 > /sys/devices/system/cpu/cpu5/cache/index3/cache_disable_1
-bash: echo: write error: File exists

The old code would say

-bash: echo: write error: Invalid argument

for disable slot 1 when playing the example above with no output in
dmesg, which is clearly misleading.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/20120419070053.GB16645@elgon.mountain
[Boris: add testing for the other index too]
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
2012-04-19 18:30:28 +02:00
..
mcheck Disintegrate asm/system.h for X86 2012-03-28 18:11:12 +01:00
mtrr Merge branch 'x86-x32-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-03-29 18:12:23 -07:00
.gitignore
amd.c x86/sched/perf/AMD: Set sched_clock_stable 2012-02-07 13:12:08 +01:00
bugs_64.c
bugs.c x86-32, fpu: Fix DNA exception during check_fpu() 2011-06-30 17:29:47 -07:00
centaur.c x86, centaur: Enable cx8 for VIA Eden too 2011-12-15 08:04:42 -08:00
common.c Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-03-29 14:28:26 -07:00
cpu.h x86, CPU: Drop superfluous get_cpu_cap() prototype 2011-12-09 08:00:53 +01:00
cyrix.c
hypervisor.c x86, hyper: Change hypervisor detection order 2011-07-08 16:22:29 -07:00
intel_cacheinfo.c x86, intel_cacheinfo: Fix error return code in amd_set_l3_disable_slot() 2012-04-19 18:30:28 +02:00
intel.c x86: Simplify code by removing a !SMP #ifdefs from 'struct cpuinfo_x86' 2011-12-21 09:25:09 +01:00
Makefile Add driver auto probing for x86 features v4 2012-01-26 16:44:41 -08:00
match.c x86/cpu: Clean up modalias feature matching 2012-02-13 15:24:26 -08:00
mkcapflags.pl
mshyperv.c x86: Hyper-V: Integrate the clocksource with Hyper-V detection code 2011-09-08 10:33:59 +02:00
perf_event_amd_ibs.c perf, x86: Force IBS LVT offset assignment for family 10h 2011-12-05 09:32:59 +01:00
perf_event_amd.c perf: Adding sysfs group format attribute for pmu device 2012-03-16 14:06:06 -03:00
perf_event_intel_ds.c perf/x86: Add LBR software filter support for Intel CPUs 2012-03-05 14:55:42 +01:00
perf_event_intel_lbr.c perf/x86: Add LBR software filter support for Intel CPUs 2012-03-05 14:55:42 +01:00
perf_event_intel.c perf: Adding sysfs group format attribute for pmu device 2012-03-16 14:06:06 -03:00
perf_event_p4.c perf/x86/p4: Add format attributes 2012-04-03 08:33:38 +02:00
perf_event_p6.c perf: Adding sysfs group format attribute for pmu device 2012-03-16 14:06:06 -03:00
perf_event.c Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-03-31 13:34:04 -07:00
perf_event.h perf: Adding sysfs group format attribute for pmu device 2012-03-16 14:06:06 -03:00
perfctr-watchdog.c perf, x86: Add new AMD family 15h msrs to perfctr reservation code 2011-02-16 13:30:50 +01:00
powerflags.c x86: Report cpb and eff_freq_ro flags correctly 2011-12-15 08:14:49 +01:00
proc.c x86: Simplify code by removing a !SMP #ifdefs from 'struct cpuinfo_x86' 2011-12-21 09:25:09 +01:00
rdrand.c x86, random: Verify RDRAND functionality and allow it to be disabled 2011-07-31 14:02:19 -07:00
scattered.c X86: Introduce HW-Pstate scattered cpuid feature 2012-01-26 16:49:06 -08:00
sched.c
topology.c x86, cpu: Split addon_cpuid_features.c 2010-07-19 19:02:41 -07:00
transmeta.c
umc.c
vmware.c x86: Fix common misspellings 2011-03-18 10:39:30 +01:00