Bug 9704

Summary: ACPI: processor throttling set error
Product: ACPI Reporter: Yi Yang (yi.y.yang)
Component: Config-ProcessorsAssignee: acpi_config-processors
Status: CLOSED CODE_FIX    
Severity: normal CC: acpi-bugzilla, bunk, yi.y.yang
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2,6.24-rc6 Subsystem:
Regression: --- Bisected commit-id:
Attachments: This patch fixed this bug.

Description Yi Yang 2008-01-06 23:36:52 UTC
Most recent kernel where this bug did not occur: None
Distribution: FC8
Hardware Environment: All
Software Environment: All
Problem Description: 
When echo some invalid values to /proc/acpi/processor/*/throttling,
there isn't any error info returned, on the contray, it sets
throttling value to some T* successfully, obviously, this is incorrect,
a correct way should be to let it fail and return error info.

Steps to reproduce:

[root@localhost /]# echo "2xxxx" > /proc/acpi/processor/CPU0/throttling
[root@localhost /]# cat /proc/acpi/processor/CPU0/throttling
state count:             8
active state:            T2
state available: T0 to T7
states:
    T0:                  100%
    T1:                  87%
   *T2:                  75%
    T3:                  62%
    T4:                  50%
    T5:                  37%
    T6:                  25%
    T7:                  12%
[root@localhost /]# echo "" > /proc/acpi/processor/CPU0/throttling
[root@localhost /]# cat /proc/acpi/processor/CPU0/throttling
state count:             8
active state:            T0
state available: T0 to T7
states:
   *T0:                  100%
    T1:                  87%
    T2:                  75%
    T3:                  62%
    T4:                  50%
    T5:                  37%
    T6:                  25%
    T7:                  12%
[root@localhost /]# echo "7xxx" > /proc/acpi/processor/CPU0/throttling
[root@localhost /]# cat /proc/acpi/processor/CPU0/throttling
state count:             8
active state:            T7
state available: T0 to T7
states:
    T0:                  100%
    T1:                  87%
    T2:                  75%
    T3:                  62%
    T4:                  50%
    T5:                  37%
    T6:                  25%
   *T7:                  12%
[root@localhost /]#
Comment 1 Yi Yang 2008-01-06 23:39:12 UTC
Created attachment 14319 [details]
This patch fixed this bug.

This patch fixed the aforementioned issue, it also enables
/proc/acpi/processor/*/throttling to accept such values as 't0' and 'T0',
it also strictly limits /proc/acpi/processor/*/throttling only to accept
 "*", "t*" and "T*", "*" is the throttling state value the processor can
support, current, it is 0 - 7.
Comment 2 Len Brown 2008-06-13 21:54:57 UTC
patch in comment #1 applied to acpi-test
Comment 3 Adrian Bunk 2008-07-16 15:40:32 UTC
in Linus' tree as commit 3d532d5e3882c1387a2722df2a368c4a9224b12f