Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
eb7004e6
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
eb7004e6
编写于
1月 23, 2012
作者:
L
Len Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge branches 'atomicio-apei', 'hotplug', 'sony-nvs-nosave' and 'thermal-netlink' into release
上级
459413db
99b72508
93f77084
2d58d7ea
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
129 addition
and
46 deletion
+129
-46
Documentation/thermal/sysfs-api.txt
Documentation/thermal/sysfs-api.txt
+1
-1
drivers/acpi/processor_driver.c
drivers/acpi/processor_driver.c
+114
-40
drivers/acpi/sleep.c
drivers/acpi/sleep.c
+8
-0
drivers/idle/intel_idle.c
drivers/idle/intel_idle.c
+1
-1
drivers/thermal/thermal_sys.c
drivers/thermal/thermal_sys.c
+2
-2
include/acpi/processor.h
include/acpi/processor.h
+1
-0
include/linux/thermal.h
include/linux/thermal.h
+2
-2
未找到文件。
Documentation/thermal/sysfs-api.txt
浏览文件 @
eb7004e6
...
...
@@ -284,7 +284,7 @@ method, the sys I/F structure will be built like this:
The framework includes a simple notification mechanism, in the form of a
netlink event. Netlink socket initialization is done during the _init_
of the framework. Drivers which intend to use the notification mechanism
just need to call generate_netlink_event() with two arguments viz
just need to call
thermal_
generate_netlink_event() with two arguments viz
(originator, event). Typically the originator will be an integer assigned
to a thermal_zone_device when it registers itself with the framework. The
event will be one of:{THERMAL_AUX0, THERMAL_AUX1, THERMAL_CRITICAL,
...
...
drivers/acpi/processor_driver.c
浏览文件 @
eb7004e6
...
...
@@ -84,7 +84,7 @@ static int acpi_processor_remove(struct acpi_device *device, int type);
static
void
acpi_processor_notify
(
struct
acpi_device
*
device
,
u32
event
);
static
acpi_status
acpi_processor_hotadd_init
(
struct
acpi_processor
*
pr
);
static
int
acpi_processor_handle_eject
(
struct
acpi_processor
*
pr
);
static
int
acpi_processor_start
(
struct
acpi_processor
*
pr
);
static
const
struct
acpi_device_id
processor_device_ids
[]
=
{
{
ACPI_PROCESSOR_OBJECT_HID
,
0
},
...
...
@@ -423,10 +423,29 @@ static int acpi_cpu_soft_notify(struct notifier_block *nfb,
struct
acpi_processor
*
pr
=
per_cpu
(
processors
,
cpu
);
if
(
action
==
CPU_ONLINE
&&
pr
)
{
acpi_processor_ppc_has_changed
(
pr
,
0
);
acpi_processor_hotplug
(
pr
);
acpi_processor_reevaluate_tstate
(
pr
,
action
);
acpi_processor_tstate_has_changed
(
pr
);
/* CPU got physically hotplugged and onlined the first time:
* Initialize missing things
*/
if
(
pr
->
flags
.
need_hotplug_init
)
{
struct
cpuidle_driver
*
idle_driver
=
cpuidle_get_driver
();
printk
(
KERN_INFO
"Will online and init hotplugged "
"CPU: %d
\n
"
,
pr
->
id
);
WARN
(
acpi_processor_start
(
pr
),
"Failed to start CPU:"
" %d
\n
"
,
pr
->
id
);
pr
->
flags
.
need_hotplug_init
=
0
;
if
(
idle_driver
&&
!
strcmp
(
idle_driver
->
name
,
"intel_idle"
))
{
intel_idle_cpu_init
(
pr
->
id
);
}
/* Normal CPU soft online event */
}
else
{
acpi_processor_ppc_has_changed
(
pr
,
0
);
acpi_processor_cst_has_changed
(
pr
);
acpi_processor_reevaluate_tstate
(
pr
,
action
);
acpi_processor_tstate_has_changed
(
pr
);
}
}
if
(
action
==
CPU_DEAD
&&
pr
)
{
/* invalidate the flag.throttling after one CPU is offline */
...
...
@@ -440,6 +459,71 @@ static struct notifier_block acpi_cpu_notifier =
.
notifier_call
=
acpi_cpu_soft_notify
,
};
/*
* acpi_processor_start() is called by the cpu_hotplug_notifier func:
* acpi_cpu_soft_notify(). Getting it __cpuinit{data} is difficult, the
* root cause seem to be that acpi_processor_uninstall_hotplug_notify()
* is in the module_exit (__exit) func. Allowing acpi_processor_start()
* to not be in __cpuinit section, but being called from __cpuinit funcs
* via __ref looks like the right thing to do here.
*/
static
__ref
int
acpi_processor_start
(
struct
acpi_processor
*
pr
)
{
struct
acpi_device
*
device
=
per_cpu
(
processor_device_array
,
pr
->
id
);
int
result
=
0
;
#ifdef CONFIG_CPU_FREQ
acpi_processor_ppc_has_changed
(
pr
,
0
);
#endif
acpi_processor_get_throttling_info
(
pr
);
acpi_processor_get_limit_info
(
pr
);
if
(
!
cpuidle_get_driver
()
||
cpuidle_get_driver
()
==
&
acpi_idle_driver
)
acpi_processor_power_init
(
pr
,
device
);
pr
->
cdev
=
thermal_cooling_device_register
(
"Processor"
,
device
,
&
processor_cooling_ops
);
if
(
IS_ERR
(
pr
->
cdev
))
{
result
=
PTR_ERR
(
pr
->
cdev
);
goto
err_power_exit
;
}
dev_dbg
(
&
device
->
dev
,
"registered as cooling_device%d
\n
"
,
pr
->
cdev
->
id
);
result
=
sysfs_create_link
(
&
device
->
dev
.
kobj
,
&
pr
->
cdev
->
device
.
kobj
,
"thermal_cooling"
);
if
(
result
)
{
printk
(
KERN_ERR
PREFIX
"Create sysfs link
\n
"
);
goto
err_thermal_unregister
;
}
result
=
sysfs_create_link
(
&
pr
->
cdev
->
device
.
kobj
,
&
device
->
dev
.
kobj
,
"device"
);
if
(
result
)
{
printk
(
KERN_ERR
PREFIX
"Create sysfs link
\n
"
);
goto
err_remove_sysfs_thermal
;
}
return
0
;
err_remove_sysfs_thermal:
sysfs_remove_link
(
&
device
->
dev
.
kobj
,
"thermal_cooling"
);
err_thermal_unregister:
thermal_cooling_device_unregister
(
pr
->
cdev
);
err_power_exit:
acpi_processor_power_exit
(
pr
,
device
);
return
result
;
}
/*
* Do not put anything in here which needs the core to be online.
* For example MSR access or setting up things which check for cpuinfo_x86
* (cpu_data(cpu)) values, like CPU feature flags, family, model, etc.
* Such things have to be put in and set up above in acpi_processor_start()
*/
static
int
__cpuinit
acpi_processor_add
(
struct
acpi_device
*
device
)
{
struct
acpi_processor
*
pr
=
NULL
;
...
...
@@ -495,48 +579,27 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device)
goto
err_free_cpumask
;
}
#ifdef CONFIG_CPU_FREQ
acpi_processor_ppc_has_changed
(
pr
,
0
);
#endif
acpi_processor_get_throttling_info
(
pr
);
acpi_processor_get_limit_info
(
pr
);
if
(
!
cpuidle_get_driver
()
||
cpuidle_get_driver
()
==
&
acpi_idle_driver
)
acpi_processor_power_init
(
pr
,
device
);
pr
->
cdev
=
thermal_cooling_device_register
(
"Processor"
,
device
,
&
processor_cooling_ops
);
if
(
IS_ERR
(
pr
->
cdev
))
{
result
=
PTR_ERR
(
pr
->
cdev
);
goto
err_power_exit
;
}
/*
* Do not start hotplugged CPUs now, but when they
* are onlined the first time
*/
if
(
pr
->
flags
.
need_hotplug_init
)
return
0
;
dev_dbg
(
&
device
->
dev
,
"registered as cooling_device%d
\n
"
,
pr
->
cdev
->
id
);
/*
* Do not start hotplugged CPUs now, but when they
* are onlined the first time
*/
if
(
pr
->
flags
.
need_hotplug_init
)
return
0
;
result
=
sysfs_create_link
(
&
device
->
dev
.
kobj
,
&
pr
->
cdev
->
device
.
kobj
,
"thermal_cooling"
);
if
(
result
)
{
printk
(
KERN_ERR
PREFIX
"Create sysfs link
\n
"
);
goto
err_thermal_unregister
;
}
result
=
sysfs_create_link
(
&
pr
->
cdev
->
device
.
kobj
,
&
device
->
dev
.
kobj
,
"device"
);
if
(
result
)
{
printk
(
KERN_ERR
PREFIX
"Create sysfs link
\n
"
);
result
=
acpi_processor_start
(
pr
);
if
(
result
)
goto
err_remove_sysfs
;
}
return
0
;
err_remove_sysfs:
sysfs_remove_link
(
&
device
->
dev
.
kobj
,
"thermal_cooling"
);
err_thermal_unregister:
thermal_cooling_device_unregister
(
pr
->
cdev
);
err_power_exit:
acpi_processor_power_exit
(
pr
,
device
);
sysfs_remove_link
(
&
device
->
dev
.
kobj
,
"sysdev"
);
err_free_cpumask:
free_cpumask_var
(
pr
->
throttling
.
shared_cpu_map
);
...
...
@@ -735,6 +798,17 @@ static acpi_status acpi_processor_hotadd_init(struct acpi_processor *pr)
return
AE_ERROR
;
}
/* CPU got hot-plugged, but cpu_data is not initialized yet
* Set flag to delay cpu_idle/throttling initialization
* in:
* acpi_processor_add()
* acpi_processor_get_info()
* and do it when the CPU gets online the first time
* TBD: Cleanup above functions and try to do this more elegant.
*/
printk
(
KERN_INFO
"CPU %d got hotplugged
\n
"
,
pr
->
id
);
pr
->
flags
.
need_hotplug_init
=
1
;
return
AE_OK
;
}
...
...
drivers/acpi/sleep.c
浏览文件 @
eb7004e6
...
...
@@ -438,6 +438,14 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
},
{
.
callback
=
init_nvs_nosave
,
.
ident
=
"Sony Vaio VPCCW29FX"
,
.
matches
=
{
DMI_MATCH
(
DMI_SYS_VENDOR
,
"Sony Corporation"
),
DMI_MATCH
(
DMI_PRODUCT_NAME
,
"VPCCW29FX"
),
},
},
{
.
callback
=
init_nvs_nosave
,
.
ident
=
"Averatec AV1020-ED2"
,
.
matches
=
{
DMI_MATCH
(
DMI_SYS_VENDOR
,
"AVERATEC"
),
...
...
drivers/idle/intel_idle.c
浏览文件 @
eb7004e6
...
...
@@ -527,7 +527,7 @@ int intel_idle_cpu_init(int cpu)
return
0
;
}
EXPORT_SYMBOL_GPL
(
intel_idle_cpu_init
);
static
int
__init
intel_idle_init
(
void
)
{
...
...
drivers/thermal/thermal_sys.c
浏览文件 @
eb7004e6
...
...
@@ -1304,7 +1304,7 @@ static struct genl_multicast_group thermal_event_mcgrp = {
.
name
=
THERMAL_GENL_MCAST_GROUP_NAME
,
};
int
generate_netlink_event
(
u32
orig
,
enum
events
event
)
int
thermal_
generate_netlink_event
(
u32
orig
,
enum
events
event
)
{
struct
sk_buff
*
skb
;
struct
nlattr
*
attr
;
...
...
@@ -1363,7 +1363,7 @@ int generate_netlink_event(u32 orig, enum events event)
return
result
;
}
EXPORT_SYMBOL
(
generate_netlink_event
);
EXPORT_SYMBOL
(
thermal_
generate_netlink_event
);
static
int
genetlink_init
(
void
)
{
...
...
include/acpi/processor.h
浏览文件 @
eb7004e6
...
...
@@ -195,6 +195,7 @@ struct acpi_processor_flags {
u8
has_cst
:
1
;
u8
power_setup_done
:
1
;
u8
bm_rld_set
:
1
;
u8
need_hotplug_init
:
1
;
};
struct
acpi_processor
{
...
...
include/linux/thermal.h
浏览文件 @
eb7004e6
...
...
@@ -152,9 +152,9 @@ struct thermal_cooling_device *thermal_cooling_device_register(char *, void *,
void
thermal_cooling_device_unregister
(
struct
thermal_cooling_device
*
);
#ifdef CONFIG_NET
extern
int
generate_netlink_event
(
u32
orig
,
enum
events
event
);
extern
int
thermal_
generate_netlink_event
(
u32
orig
,
enum
events
event
);
#else
static
inline
int
generate_netlink_event
(
u32
orig
,
enum
events
event
)
static
inline
int
thermal_
generate_netlink_event
(
u32
orig
,
enum
events
event
)
{
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录