Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
c080a3e6
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 4 年多
通知
15
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
c080a3e6
编写于
6月 15, 2006
作者:
L
Len Brown
浏览文件
操作
浏览文件
下载
差异文件
Pull sem2mutex into release branch
上级
bf891bd6
36e43095
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
25 addition
and
24 deletion
+25
-24
drivers/acpi/pci_link.c
drivers/acpi/pci_link.c
+13
-12
drivers/acpi/processor_perflib.c
drivers/acpi/processor_perflib.c
+12
-11
drivers/acpi/scan.c
drivers/acpi/scan.c
+0
-1
未找到文件。
drivers/acpi/pci_link.c
浏览文件 @
c080a3e6
...
@@ -38,6 +38,7 @@
...
@@ -38,6 +38,7 @@
#include <linux/spinlock.h>
#include <linux/spinlock.h>
#include <linux/pm.h>
#include <linux/pm.h>
#include <linux/pci.h>
#include <linux/pci.h>
#include <linux/mutex.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#include <acpi/acpi_drivers.h>
...
@@ -91,7 +92,7 @@ static struct {
...
@@ -91,7 +92,7 @@ static struct {
int
count
;
int
count
;
struct
list_head
entries
;
struct
list_head
entries
;
}
acpi_link
;
}
acpi_link
;
DE
CLAR
E_MUTEX
(
acpi_link_lock
);
DE
FIN
E_MUTEX
(
acpi_link_lock
);
/* --------------------------------------------------------------------------
/* --------------------------------------------------------------------------
PCI Link Device Management
PCI Link Device Management
...
@@ -641,19 +642,19 @@ acpi_pci_link_allocate_irq(acpi_handle handle,
...
@@ -641,19 +642,19 @@ acpi_pci_link_allocate_irq(acpi_handle handle,
return_VALUE
(
-
1
);
return_VALUE
(
-
1
);
}
}
down
(
&
acpi_link_lock
);
mutex_lock
(
&
acpi_link_lock
);
if
(
acpi_pci_link_allocate
(
link
))
{
if
(
acpi_pci_link_allocate
(
link
))
{
up
(
&
acpi_link_lock
);
mutex_unlock
(
&
acpi_link_lock
);
return_VALUE
(
-
1
);
return_VALUE
(
-
1
);
}
}
if
(
!
link
->
irq
.
active
)
{
if
(
!
link
->
irq
.
active
)
{
up
(
&
acpi_link_lock
);
mutex_unlock
(
&
acpi_link_lock
);
ACPI_DEBUG_PRINT
((
ACPI_DB_ERROR
,
"Link active IRQ is 0!
\n
"
));
ACPI_DEBUG_PRINT
((
ACPI_DB_ERROR
,
"Link active IRQ is 0!
\n
"
));
return_VALUE
(
-
1
);
return_VALUE
(
-
1
);
}
}
link
->
refcnt
++
;
link
->
refcnt
++
;
up
(
&
acpi_link_lock
);
mutex_unlock
(
&
acpi_link_lock
);
if
(
triggering
)
if
(
triggering
)
*
triggering
=
link
->
irq
.
triggering
;
*
triggering
=
link
->
irq
.
triggering
;
...
@@ -691,9 +692,9 @@ int acpi_pci_link_free_irq(acpi_handle handle)
...
@@ -691,9 +692,9 @@ int acpi_pci_link_free_irq(acpi_handle handle)
return_VALUE
(
-
1
);
return_VALUE
(
-
1
);
}
}
down
(
&
acpi_link_lock
);
mutex_lock
(
&
acpi_link_lock
);
if
(
!
link
->
irq
.
initialized
)
{
if
(
!
link
->
irq
.
initialized
)
{
up
(
&
acpi_link_lock
);
mutex_unlock
(
&
acpi_link_lock
);
ACPI_DEBUG_PRINT
((
ACPI_DB_ERROR
,
"Link isn't initialized
\n
"
));
ACPI_DEBUG_PRINT
((
ACPI_DB_ERROR
,
"Link isn't initialized
\n
"
));
return_VALUE
(
-
1
);
return_VALUE
(
-
1
);
}
}
...
@@ -716,7 +717,7 @@ int acpi_pci_link_free_irq(acpi_handle handle)
...
@@ -716,7 +717,7 @@ int acpi_pci_link_free_irq(acpi_handle handle)
if
(
link
->
refcnt
==
0
)
{
if
(
link
->
refcnt
==
0
)
{
acpi_ut_evaluate_object
(
link
->
handle
,
"_DIS"
,
0
,
NULL
);
acpi_ut_evaluate_object
(
link
->
handle
,
"_DIS"
,
0
,
NULL
);
}
}
up
(
&
acpi_link_lock
);
mutex_unlock
(
&
acpi_link_lock
);
return_VALUE
(
link
->
irq
.
active
);
return_VALUE
(
link
->
irq
.
active
);
}
}
...
@@ -747,7 +748,7 @@ static int acpi_pci_link_add(struct acpi_device *device)
...
@@ -747,7 +748,7 @@ static int acpi_pci_link_add(struct acpi_device *device)
strcpy
(
acpi_device_class
(
device
),
ACPI_PCI_LINK_CLASS
);
strcpy
(
acpi_device_class
(
device
),
ACPI_PCI_LINK_CLASS
);
acpi_driver_data
(
device
)
=
link
;
acpi_driver_data
(
device
)
=
link
;
down
(
&
acpi_link_lock
);
mutex_lock
(
&
acpi_link_lock
);
result
=
acpi_pci_link_get_possible
(
link
);
result
=
acpi_pci_link_get_possible
(
link
);
if
(
result
)
if
(
result
)
goto
end
;
goto
end
;
...
@@ -782,7 +783,7 @@ static int acpi_pci_link_add(struct acpi_device *device)
...
@@ -782,7 +783,7 @@ static int acpi_pci_link_add(struct acpi_device *device)
end:
end:
/* disable all links -- to be activated on use */
/* disable all links -- to be activated on use */
acpi_ut_evaluate_object
(
link
->
handle
,
"_DIS"
,
0
,
NULL
);
acpi_ut_evaluate_object
(
link
->
handle
,
"_DIS"
,
0
,
NULL
);
up
(
&
acpi_link_lock
);
mutex_unlock
(
&
acpi_link_lock
);
if
(
result
)
if
(
result
)
kfree
(
link
);
kfree
(
link
);
...
@@ -837,9 +838,9 @@ static int acpi_pci_link_remove(struct acpi_device *device, int type)
...
@@ -837,9 +838,9 @@ static int acpi_pci_link_remove(struct acpi_device *device, int type)
link
=
(
struct
acpi_pci_link
*
)
acpi_driver_data
(
device
);
link
=
(
struct
acpi_pci_link
*
)
acpi_driver_data
(
device
);
down
(
&
acpi_link_lock
);
mutex_lock
(
&
acpi_link_lock
);
list_del
(
&
link
->
node
);
list_del
(
&
link
->
node
);
up
(
&
acpi_link_lock
);
mutex_unlock
(
&
acpi_link_lock
);
kfree
(
link
);
kfree
(
link
);
...
...
drivers/acpi/processor_perflib.c
浏览文件 @
c080a3e6
...
@@ -34,6 +34,7 @@
...
@@ -34,6 +34,7 @@
#ifdef CONFIG_X86_ACPI_CPUFREQ_PROC_INTF
#ifdef CONFIG_X86_ACPI_CPUFREQ_PROC_INTF
#include <linux/proc_fs.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/seq_file.h>
#include <linux/mutex.h>
#include <asm/uaccess.h>
#include <asm/uaccess.h>
#endif
#endif
...
@@ -48,7 +49,7 @@
...
@@ -48,7 +49,7 @@
#define _COMPONENT ACPI_PROCESSOR_COMPONENT
#define _COMPONENT ACPI_PROCESSOR_COMPONENT
ACPI_MODULE_NAME
(
"acpi_processor"
)
ACPI_MODULE_NAME
(
"acpi_processor"
)
static
DE
CLARE_MUTEX
(
performance_sem
);
static
DE
FINE_MUTEX
(
performance_mutex
);
/*
/*
* _PPC support is implemented as a CPUfreq policy notifier:
* _PPC support is implemented as a CPUfreq policy notifier:
...
@@ -72,7 +73,7 @@ static int acpi_processor_ppc_notifier(struct notifier_block *nb,
...
@@ -72,7 +73,7 @@ static int acpi_processor_ppc_notifier(struct notifier_block *nb,
struct
acpi_processor
*
pr
;
struct
acpi_processor
*
pr
;
unsigned
int
ppc
=
0
;
unsigned
int
ppc
=
0
;
down
(
&
performance_sem
);
mutex_lock
(
&
performance_mutex
);
if
(
event
!=
CPUFREQ_INCOMPATIBLE
)
if
(
event
!=
CPUFREQ_INCOMPATIBLE
)
goto
out
;
goto
out
;
...
@@ -93,7 +94,7 @@ static int acpi_processor_ppc_notifier(struct notifier_block *nb,
...
@@ -93,7 +94,7 @@ static int acpi_processor_ppc_notifier(struct notifier_block *nb,
core_frequency
*
1000
);
core_frequency
*
1000
);
out:
out:
up
(
&
performance_sem
);
mutex_unlock
(
&
performance_mutex
);
return
0
;
return
0
;
}
}
...
@@ -564,16 +565,16 @@ acpi_processor_register_performance(struct acpi_processor_performance
...
@@ -564,16 +565,16 @@ acpi_processor_register_performance(struct acpi_processor_performance
if
(
!
(
acpi_processor_ppc_status
&
PPC_REGISTERED
))
if
(
!
(
acpi_processor_ppc_status
&
PPC_REGISTERED
))
return_VALUE
(
-
EINVAL
);
return_VALUE
(
-
EINVAL
);
down
(
&
performance_sem
);
mutex_lock
(
&
performance_mutex
);
pr
=
processors
[
cpu
];
pr
=
processors
[
cpu
];
if
(
!
pr
)
{
if
(
!
pr
)
{
up
(
&
performance_sem
);
mutex_unlock
(
&
performance_mutex
);
return_VALUE
(
-
ENODEV
);
return_VALUE
(
-
ENODEV
);
}
}
if
(
pr
->
performance
)
{
if
(
pr
->
performance
)
{
up
(
&
performance_sem
);
mutex_unlock
(
&
performance_mutex
);
return_VALUE
(
-
EBUSY
);
return_VALUE
(
-
EBUSY
);
}
}
...
@@ -583,13 +584,13 @@ acpi_processor_register_performance(struct acpi_processor_performance
...
@@ -583,13 +584,13 @@ acpi_processor_register_performance(struct acpi_processor_performance
if
(
acpi_processor_get_performance_info
(
pr
))
{
if
(
acpi_processor_get_performance_info
(
pr
))
{
pr
->
performance
=
NULL
;
pr
->
performance
=
NULL
;
up
(
&
performance_sem
);
mutex_unlock
(
&
performance_mutex
);
return_VALUE
(
-
EIO
);
return_VALUE
(
-
EIO
);
}
}
acpi_cpufreq_add_file
(
pr
);
acpi_cpufreq_add_file
(
pr
);
up
(
&
performance_sem
);
mutex_unlock
(
&
performance_mutex
);
return_VALUE
(
0
);
return_VALUE
(
0
);
}
}
...
@@ -603,11 +604,11 @@ acpi_processor_unregister_performance(struct acpi_processor_performance
...
@@ -603,11 +604,11 @@ acpi_processor_unregister_performance(struct acpi_processor_performance
ACPI_FUNCTION_TRACE
(
"acpi_processor_unregister_performance"
);
ACPI_FUNCTION_TRACE
(
"acpi_processor_unregister_performance"
);
down
(
&
performance_sem
);
mutex_lock
(
&
performance_mutex
);
pr
=
processors
[
cpu
];
pr
=
processors
[
cpu
];
if
(
!
pr
)
{
if
(
!
pr
)
{
up
(
&
performance_sem
);
mutex_unlock
(
&
performance_mutex
);
return_VOID
;
return_VOID
;
}
}
...
@@ -617,7 +618,7 @@ acpi_processor_unregister_performance(struct acpi_processor_performance
...
@@ -617,7 +618,7 @@ acpi_processor_unregister_performance(struct acpi_processor_performance
acpi_cpufreq_remove_file
(
pr
);
acpi_cpufreq_remove_file
(
pr
);
up
(
&
performance_sem
);
mutex_unlock
(
&
performance_mutex
);
return_VOID
;
return_VOID
;
}
}
...
...
drivers/acpi/scan.c
浏览文件 @
c080a3e6
...
@@ -459,7 +459,6 @@ static int acpi_bus_get_perf_flags(struct acpi_device *device)
...
@@ -459,7 +459,6 @@ static int acpi_bus_get_perf_flags(struct acpi_device *device)
-------------------------------------------------------------------------- */
-------------------------------------------------------------------------- */
static
LIST_HEAD
(
acpi_bus_drivers
);
static
LIST_HEAD
(
acpi_bus_drivers
);
static
DECLARE_MUTEX
(
acpi_bus_drivers_lock
);
/**
/**
* acpi_bus_match - match device IDs to driver's supported IDs
* acpi_bus_match - match device IDs to driver's supported IDs
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录