Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
9c4d7e64
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看板
提交
9c4d7e64
编写于
7月 16, 2016
作者:
V
Vinod Koul
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'topic/sh' into for-linus
上级
00357c45
55bd582b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
37 addition
and
4 deletion
+37
-4
drivers/dma/sh/rcar-dmac.c
drivers/dma/sh/rcar-dmac.c
+37
-4
未找到文件。
drivers/dma/sh/rcar-dmac.c
浏览文件 @
9c4d7e64
...
...
@@ -311,7 +311,7 @@ static bool rcar_dmac_chan_is_busy(struct rcar_dmac_chan *chan)
{
u32
chcr
=
rcar_dmac_chan_read
(
chan
,
RCAR_DMACHCR
);
return
(
chcr
&
(
RCAR_DMACHCR_DE
|
RCAR_DMACHCR_TE
))
==
RCAR_DMACHCR_DE
;
return
!!
(
chcr
&
(
RCAR_DMACHCR_DE
|
RCAR_DMACHCR_TE
))
;
}
static
void
rcar_dmac_chan_start_xfer
(
struct
rcar_dmac_chan
*
chan
)
...
...
@@ -510,7 +510,7 @@ static void rcar_dmac_desc_put(struct rcar_dmac_chan *chan,
spin_lock_irqsave
(
&
chan
->
lock
,
flags
);
list_splice_tail_init
(
&
desc
->
chunks
,
&
chan
->
desc
.
chunks_free
);
list_add
_tail
(
&
desc
->
node
,
&
chan
->
desc
.
free
);
list_add
(
&
desc
->
node
,
&
chan
->
desc
.
free
);
spin_unlock_irqrestore
(
&
chan
->
lock
,
flags
);
}
...
...
@@ -990,6 +990,8 @@ static void rcar_dmac_free_chan_resources(struct dma_chan *chan)
list_splice_init
(
&
rchan
->
desc
.
done
,
&
list
);
list_splice_init
(
&
rchan
->
desc
.
wait
,
&
list
);
rchan
->
desc
.
running
=
NULL
;
list_for_each_entry
(
desc
,
&
list
,
node
)
rcar_dmac_realloc_hwdesc
(
rchan
,
desc
,
0
);
...
...
@@ -1143,19 +1145,46 @@ static unsigned int rcar_dmac_chan_get_residue(struct rcar_dmac_chan *chan,
struct
rcar_dmac_desc
*
desc
=
chan
->
desc
.
running
;
struct
rcar_dmac_xfer_chunk
*
running
=
NULL
;
struct
rcar_dmac_xfer_chunk
*
chunk
;
enum
dma_status
status
;
unsigned
int
residue
=
0
;
unsigned
int
dptr
=
0
;
if
(
!
desc
)
return
0
;
/*
* If the cookie corresponds to a descriptor that has been completed
* there is no residue. The same check has already been performed by the
* caller but without holding the channel lock, so the descriptor could
* now be complete.
*/
status
=
dma_cookie_status
(
&
chan
->
chan
,
cookie
,
NULL
);
if
(
status
==
DMA_COMPLETE
)
return
0
;
/*
* If the cookie doesn't correspond to the currently running transfer
* then the descriptor hasn't been processed yet, and the residue is
* equal to the full descriptor size.
*/
if
(
cookie
!=
desc
->
async_tx
.
cookie
)
return
desc
->
size
;
if
(
cookie
!=
desc
->
async_tx
.
cookie
)
{
list_for_each_entry
(
desc
,
&
chan
->
desc
.
pending
,
node
)
{
if
(
cookie
==
desc
->
async_tx
.
cookie
)
return
desc
->
size
;
}
list_for_each_entry
(
desc
,
&
chan
->
desc
.
active
,
node
)
{
if
(
cookie
==
desc
->
async_tx
.
cookie
)
return
desc
->
size
;
}
/*
* No descriptor found for the cookie, there's thus no residue.
* This shouldn't happen if the calling driver passes a correct
* cookie value.
*/
WARN
(
1
,
"No descriptor for cookie!"
);
return
0
;
}
/*
* In descriptor mode the descriptor running pointer is not maintained
...
...
@@ -1202,6 +1231,10 @@ static enum dma_status rcar_dmac_tx_status(struct dma_chan *chan,
residue
=
rcar_dmac_chan_get_residue
(
rchan
,
cookie
);
spin_unlock_irqrestore
(
&
rchan
->
lock
,
flags
);
/* if there's no residue, the cookie is complete */
if
(
!
residue
)
return
DMA_COMPLETE
;
dma_set_residue
(
txstate
,
residue
);
return
status
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录