Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
656217d2
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看板
提交
656217d2
编写于
4月 16, 2009
作者:
M
Martin Fuzzey
提交者:
Pierre Ossman
6月 03, 2009
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mxcmmc: Fix missing return value checking in DMA setup code.
Signed-off-by:
N
Martin Fuzzey
<
mfuzzey@gmail.com
>
上级
18489fa2
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
26 addition
and
10 deletion
+26
-10
drivers/mmc/host/mxcmmc.c
drivers/mmc/host/mxcmmc.c
+26
-10
未找到文件。
drivers/mmc/host/mxcmmc.c
浏览文件 @
656217d2
...
@@ -162,7 +162,7 @@ static void mxcmci_softreset(struct mxcmci_host *host)
...
@@ -162,7 +162,7 @@ static void mxcmci_softreset(struct mxcmci_host *host)
writew
(
0xff
,
host
->
base
+
MMC_REG_RES_TO
);
writew
(
0xff
,
host
->
base
+
MMC_REG_RES_TO
);
}
}
static
void
mxcmci_setup_data
(
struct
mxcmci_host
*
host
,
struct
mmc_data
*
data
)
static
int
mxcmci_setup_data
(
struct
mxcmci_host
*
host
,
struct
mmc_data
*
data
)
{
{
unsigned
int
nob
=
data
->
blocks
;
unsigned
int
nob
=
data
->
blocks
;
unsigned
int
blksz
=
data
->
blksz
;
unsigned
int
blksz
=
data
->
blksz
;
...
@@ -170,6 +170,7 @@ static void mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data)
...
@@ -170,6 +170,7 @@ static void mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data)
#ifdef HAS_DMA
#ifdef HAS_DMA
struct
scatterlist
*
sg
;
struct
scatterlist
*
sg
;
int
i
;
int
i
;
int
ret
;
#endif
#endif
if
(
data
->
flags
&
MMC_DATA_STREAM
)
if
(
data
->
flags
&
MMC_DATA_STREAM
)
nob
=
0xffff
;
nob
=
0xffff
;
...
@@ -185,7 +186,7 @@ static void mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data)
...
@@ -185,7 +186,7 @@ static void mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data)
for_each_sg
(
data
->
sg
,
sg
,
data
->
sg_len
,
i
)
{
for_each_sg
(
data
->
sg
,
sg
,
data
->
sg_len
,
i
)
{
if
(
sg
->
offset
&
3
||
sg
->
length
&
3
)
{
if
(
sg
->
offset
&
3
||
sg
->
length
&
3
)
{
host
->
do_dma
=
0
;
host
->
do_dma
=
0
;
return
;
return
0
;
}
}
}
}
...
@@ -194,23 +195,30 @@ static void mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data)
...
@@ -194,23 +195,30 @@ static void mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data)
host
->
dma_nents
=
dma_map_sg
(
mmc_dev
(
host
->
mmc
),
data
->
sg
,
host
->
dma_nents
=
dma_map_sg
(
mmc_dev
(
host
->
mmc
),
data
->
sg
,
data
->
sg_len
,
host
->
dma_dir
);
data
->
sg_len
,
host
->
dma_dir
);
imx_dma_setup_sg
(
host
->
dma
,
data
->
sg
,
host
->
dma_nents
,
datasize
,
ret
=
imx_dma_setup_sg
(
host
->
dma
,
data
->
sg
,
host
->
dma_nents
,
host
->
res
->
start
+
MMC_REG_BUFFER_ACCESS
,
datasize
,
DMA_MODE_READ
);
host
->
res
->
start
+
MMC_REG_BUFFER_ACCESS
,
DMA_MODE_READ
);
}
else
{
}
else
{
host
->
dma_dir
=
DMA_TO_DEVICE
;
host
->
dma_dir
=
DMA_TO_DEVICE
;
host
->
dma_nents
=
dma_map_sg
(
mmc_dev
(
host
->
mmc
),
data
->
sg
,
host
->
dma_nents
=
dma_map_sg
(
mmc_dev
(
host
->
mmc
),
data
->
sg
,
data
->
sg_len
,
host
->
dma_dir
);
data
->
sg_len
,
host
->
dma_dir
);
imx_dma_setup_sg
(
host
->
dma
,
data
->
sg
,
host
->
dma_nents
,
datasize
,
ret
=
imx_dma_setup_sg
(
host
->
dma
,
data
->
sg
,
host
->
dma_nents
,
host
->
res
->
start
+
MMC_REG_BUFFER_ACCESS
,
datasize
,
DMA_MODE_WRITE
);
host
->
res
->
start
+
MMC_REG_BUFFER_ACCESS
,
DMA_MODE_WRITE
);
}
}
if
(
ret
)
{
dev_err
(
mmc_dev
(
host
->
mmc
),
"failed to setup DMA : %d
\n
"
,
ret
);
return
ret
;
}
wmb
();
wmb
();
imx_dma_enable
(
host
->
dma
);
imx_dma_enable
(
host
->
dma
);
#endif
/* HAS_DMA */
#endif
/* HAS_DMA */
return
0
;
}
}
static
int
mxcmci_start_cmd
(
struct
mxcmci_host
*
host
,
struct
mmc_command
*
cmd
,
static
int
mxcmci_start_cmd
(
struct
mxcmci_host
*
host
,
struct
mmc_command
*
cmd
,
...
@@ -536,6 +544,7 @@ static void mxcmci_request(struct mmc_host *mmc, struct mmc_request *req)
...
@@ -536,6 +544,7 @@ static void mxcmci_request(struct mmc_host *mmc, struct mmc_request *req)
{
{
struct
mxcmci_host
*
host
=
mmc_priv
(
mmc
);
struct
mxcmci_host
*
host
=
mmc_priv
(
mmc
);
unsigned
int
cmdat
=
host
->
cmdat
;
unsigned
int
cmdat
=
host
->
cmdat
;
int
error
;
WARN_ON
(
host
->
req
!=
NULL
);
WARN_ON
(
host
->
req
!=
NULL
);
...
@@ -545,7 +554,12 @@ static void mxcmci_request(struct mmc_host *mmc, struct mmc_request *req)
...
@@ -545,7 +554,12 @@ static void mxcmci_request(struct mmc_host *mmc, struct mmc_request *req)
host
->
do_dma
=
1
;
host
->
do_dma
=
1
;
#endif
#endif
if
(
req
->
data
)
{
if
(
req
->
data
)
{
mxcmci_setup_data
(
host
,
req
->
data
);
error
=
mxcmci_setup_data
(
host
,
req
->
data
);
if
(
error
)
{
req
->
cmd
->
error
=
error
;
goto
out
;
}
cmdat
|=
CMD_DAT_CONT_DATA_ENABLE
;
cmdat
|=
CMD_DAT_CONT_DATA_ENABLE
;
...
@@ -553,7 +567,9 @@ static void mxcmci_request(struct mmc_host *mmc, struct mmc_request *req)
...
@@ -553,7 +567,9 @@ static void mxcmci_request(struct mmc_host *mmc, struct mmc_request *req)
cmdat
|=
CMD_DAT_CONT_WRITE
;
cmdat
|=
CMD_DAT_CONT_WRITE
;
}
}
if
(
mxcmci_start_cmd
(
host
,
req
->
cmd
,
cmdat
))
error
=
mxcmci_start_cmd
(
host
,
req
->
cmd
,
cmdat
);
out:
if
(
error
)
mxcmci_finish_request
(
host
,
req
);
mxcmci_finish_request
(
host
,
req
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录