Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
aab8d802
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
aab8d802
编写于
10月 19, 2016
作者:
B
Bjorn Andersson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remoteproc: Assign kref to rproc_vdev
No functional change Signed-off-by:
N
Bjorn Andersson
<
bjorn.andersson@linaro.org
>
上级
be33c28f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
20 addition
and
4 deletion
+20
-4
drivers/remoteproc/remoteproc_core.c
drivers/remoteproc/remoteproc_core.c
+10
-0
drivers/remoteproc/remoteproc_internal.h
drivers/remoteproc/remoteproc_internal.h
+1
-0
drivers/remoteproc/remoteproc_virtio.c
drivers/remoteproc/remoteproc_virtio.c
+6
-4
include/linux/remoteproc.h
include/linux/remoteproc.h
+3
-0
未找到文件。
drivers/remoteproc/remoteproc_core.c
浏览文件 @
aab8d802
...
...
@@ -356,6 +356,8 @@ static int rproc_handle_vdev(struct rproc *rproc, struct fw_rsc_vdev *rsc,
if
(
!
rvdev
)
return
-
ENOMEM
;
kref_init
(
&
rvdev
->
refcount
);
rvdev
->
rproc
=
rproc
;
/* parse the vrings */
...
...
@@ -384,6 +386,14 @@ static int rproc_handle_vdev(struct rproc *rproc, struct fw_rsc_vdev *rsc,
return
ret
;
}
void
rproc_vdev_release
(
struct
kref
*
ref
)
{
struct
rproc_vdev
*
rvdev
=
container_of
(
ref
,
struct
rproc_vdev
,
refcount
);
list_del
(
&
rvdev
->
node
);
kfree
(
rvdev
);
}
/**
* rproc_handle_trace() - handle a shared trace buffer resource
* @rproc: the remote processor
...
...
drivers/remoteproc/remoteproc_internal.h
浏览文件 @
aab8d802
...
...
@@ -49,6 +49,7 @@ struct rproc_fw_ops {
void
rproc_release
(
struct
kref
*
kref
);
irqreturn_t
rproc_vq_interrupt
(
struct
rproc
*
rproc
,
int
vq_id
);
int
rproc_boot_nowait
(
struct
rproc
*
rproc
);
void
rproc_vdev_release
(
struct
kref
*
ref
);
/* from remoteproc_virtio.c */
int
rproc_add_virtio_dev
(
struct
rproc_vdev
*
rvdev
,
int
id
);
...
...
drivers/remoteproc/remoteproc_virtio.c
浏览文件 @
aab8d802
...
...
@@ -282,14 +282,13 @@ static const struct virtio_config_ops rproc_virtio_config_ops = {
* Never call this function directly; it will be called by the driver
* core when needed.
*/
static
void
rproc_vdev_release
(
struct
device
*
dev
)
static
void
rproc_v
irtio_
dev_release
(
struct
device
*
dev
)
{
struct
virtio_device
*
vdev
=
dev_to_virtio
(
dev
);
struct
rproc_vdev
*
rvdev
=
vdev_to_rvdev
(
vdev
);
struct
rproc
*
rproc
=
vdev_to_rproc
(
vdev
);
list_del
(
&
rvdev
->
node
);
kfree
(
rvdev
);
kref_put
(
&
rvdev
->
refcount
,
rproc_vdev_release
);
put_device
(
&
rproc
->
dev
);
}
...
...
@@ -313,7 +312,7 @@ int rproc_add_virtio_dev(struct rproc_vdev *rvdev, int id)
vdev
->
id
.
device
=
id
,
vdev
->
config
=
&
rproc_virtio_config_ops
,
vdev
->
dev
.
parent
=
dev
;
vdev
->
dev
.
release
=
rproc_vdev_release
;
vdev
->
dev
.
release
=
rproc_v
irtio_
dev_release
;
/*
* We're indirectly making a non-temporary copy of the rproc pointer
...
...
@@ -325,6 +324,9 @@ int rproc_add_virtio_dev(struct rproc_vdev *rvdev, int id)
*/
get_device
(
&
rproc
->
dev
);
/* Reference the vdev and vring allocations */
kref_get
(
&
rvdev
->
refcount
);
ret
=
register_virtio_device
(
vdev
);
if
(
ret
)
{
put_device
(
&
rproc
->
dev
);
...
...
include/linux/remoteproc.h
浏览文件 @
aab8d802
...
...
@@ -487,6 +487,7 @@ struct rproc_vring {
/**
* struct rproc_vdev - remoteproc state for a supported virtio device
* @refcount: reference counter for the vdev and vring allocations
* @node: list node
* @rproc: the rproc handle
* @vdev: the virio device
...
...
@@ -494,6 +495,8 @@ struct rproc_vring {
* @rsc_offset: offset of the vdev's resource entry
*/
struct
rproc_vdev
{
struct
kref
refcount
;
struct
list_head
node
;
struct
rproc
*
rproc
;
struct
virtio_device
vdev
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录