Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
9d674f21
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9d674f21
编写于
6月 12, 2014
作者:
R
Rafael J. Wysocki
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'acpi-hotplug'
* acpi-hotplug: ACPI / hotplug / PCI: Add hotplug contexts to PCI host bridges
上级
9b758d4e
882d18a7
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
52 addition
and
18 deletion
+52
-18
drivers/pci/hotplug/acpiphp.h
drivers/pci/hotplug/acpiphp.h
+10
-0
drivers/pci/hotplug/acpiphp_glue.c
drivers/pci/hotplug/acpiphp_glue.c
+42
-18
未找到文件。
drivers/pci/hotplug/acpiphp.h
浏览文件 @
9d674f21
...
...
@@ -142,6 +142,16 @@ static inline acpi_handle func_to_handle(struct acpiphp_func *func)
return
func_to_acpi_device
(
func
)
->
handle
;
}
struct
acpiphp_root_context
{
struct
acpi_hotplug_context
hp
;
struct
acpiphp_bridge
*
root_bridge
;
};
static
inline
struct
acpiphp_root_context
*
to_acpiphp_root_context
(
struct
acpi_hotplug_context
*
hp
)
{
return
container_of
(
hp
,
struct
acpiphp_root_context
,
hp
);
}
/*
* struct acpiphp_attention_info - device specific attention registration
*
...
...
drivers/pci/hotplug/acpiphp_glue.c
浏览文件 @
9d674f21
...
...
@@ -373,17 +373,13 @@ static acpi_status acpiphp_add_context(acpi_handle handle, u32 lvl, void *data,
static
struct
acpiphp_bridge
*
acpiphp_dev_to_bridge
(
struct
acpi_device
*
adev
)
{
struct
acpiphp_context
*
context
;
struct
acpiphp_bridge
*
bridge
=
NULL
;
acpi_lock_hp_context
();
context
=
acpiphp_get_context
(
adev
);
if
(
context
)
{
bridge
=
context
->
bridge
;
if
(
adev
->
hp
)
{
bridge
=
to_acpiphp_root_context
(
adev
->
hp
)
->
root_bridge
;
if
(
bridge
)
get_bridge
(
bridge
);
acpiphp_put_context
(
context
);
}
acpi_unlock_hp_context
();
return
bridge
;
...
...
@@ -881,7 +877,17 @@ void acpiphp_enumerate_slots(struct pci_bus *bus)
*/
get_device
(
&
bus
->
dev
);
if
(
!
pci_is_root_bus
(
bridge
->
pci_bus
))
{
acpi_lock_hp_context
();
if
(
pci_is_root_bus
(
bridge
->
pci_bus
))
{
struct
acpiphp_root_context
*
root_context
;
root_context
=
kzalloc
(
sizeof
(
*
root_context
),
GFP_KERNEL
);
if
(
!
root_context
)
goto
err
;
root_context
->
root_bridge
=
bridge
;
acpi_set_hp_context
(
adev
,
&
root_context
->
hp
,
NULL
,
NULL
,
NULL
);
}
else
{
struct
acpiphp_context
*
context
;
/*
...
...
@@ -890,21 +896,16 @@ void acpiphp_enumerate_slots(struct pci_bus *bus)
* parent is going to be handled by pciehp, in which case this
* bridge is not interesting to us either.
*/
acpi_lock_hp_context
();
context
=
acpiphp_get_context
(
adev
);
if
(
!
context
)
{
acpi_unlock_hp_context
();
put_device
(
&
bus
->
dev
);
pci_dev_put
(
bridge
->
pci_dev
);
kfree
(
bridge
);
return
;
}
if
(
!
context
)
goto
err
;
bridge
->
context
=
context
;
context
->
bridge
=
bridge
;
/* Get a reference to the parent bridge. */
get_bridge
(
context
->
func
.
parent
);
acpi_unlock_hp_context
();
}
acpi_unlock_hp_context
();
/* Must be added to the list prior to calling acpiphp_add_context(). */
mutex_lock
(
&
bridge_mutex
);
...
...
@@ -919,6 +920,30 @@ void acpiphp_enumerate_slots(struct pci_bus *bus)
cleanup_bridge
(
bridge
);
put_bridge
(
bridge
);
}
return
;
err:
acpi_unlock_hp_context
();
put_device
(
&
bus
->
dev
);
pci_dev_put
(
bridge
->
pci_dev
);
kfree
(
bridge
);
}
void
acpiphp_drop_bridge
(
struct
acpiphp_bridge
*
bridge
)
{
if
(
pci_is_root_bus
(
bridge
->
pci_bus
))
{
struct
acpiphp_root_context
*
root_context
;
struct
acpi_device
*
adev
;
acpi_lock_hp_context
();
adev
=
ACPI_COMPANION
(
bridge
->
pci_bus
->
bridge
);
root_context
=
to_acpiphp_root_context
(
adev
->
hp
);
adev
->
hp
=
NULL
;
acpi_unlock_hp_context
();
kfree
(
root_context
);
}
cleanup_bridge
(
bridge
);
put_bridge
(
bridge
);
}
/**
...
...
@@ -936,8 +961,7 @@ void acpiphp_remove_slots(struct pci_bus *bus)
list_for_each_entry
(
bridge
,
&
bridge_list
,
list
)
if
(
bridge
->
pci_bus
==
bus
)
{
mutex_unlock
(
&
bridge_mutex
);
cleanup_bridge
(
bridge
);
put_bridge
(
bridge
);
acpiphp_drop_bridge
(
bridge
);
return
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录