Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
c1d96203
K
Kernel
项目概览
openeuler
/
Kernel
12 个月 前同步成功
通知
5
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c1d96203
编写于
10月 31, 2005
作者:
L
Linus Torvalds
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev
上级
4fd5f826
005a5a06
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
51 deletion
+18
-51
drivers/scsi/libata-core.c
drivers/scsi/libata-core.c
+10
-49
drivers/scsi/libata-scsi.c
drivers/scsi/libata-scsi.c
+8
-1
drivers/scsi/libata.h
drivers/scsi/libata.h
+0
-1
未找到文件。
drivers/scsi/libata-core.c
浏览文件 @
c1d96203
...
...
@@ -294,28 +294,6 @@ void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf)
ata_exec_command_pio
(
ap
,
tf
);
}
/**
* ata_exec - issue ATA command to host controller
* @ap: port to which command is being issued
* @tf: ATA taskfile register set
*
* Issues PIO/MMIO write to ATA command register, with proper
* synchronization with interrupt handler / other threads.
*
* LOCKING:
* Obtains host_set lock.
*/
static
inline
void
ata_exec
(
struct
ata_port
*
ap
,
const
struct
ata_taskfile
*
tf
)
{
unsigned
long
flags
;
DPRINTK
(
"ata%u: cmd 0x%X
\n
"
,
ap
->
id
,
tf
->
command
);
spin_lock_irqsave
(
&
ap
->
host_set
->
lock
,
flags
);
ap
->
ops
->
exec_command
(
ap
,
tf
);
spin_unlock_irqrestore
(
&
ap
->
host_set
->
lock
,
flags
);
}
/**
* ata_tf_to_host - issue ATA taskfile to host controller
* @ap: port to which command is being issued
...
...
@@ -326,30 +304,11 @@ static inline void ata_exec(struct ata_port *ap, const struct ata_taskfile *tf)
* other threads.
*
* LOCKING:
* Obtains host_set lock.
*/
static
void
ata_tf_to_host
(
struct
ata_port
*
ap
,
const
struct
ata_taskfile
*
tf
)
{
ap
->
ops
->
tf_load
(
ap
,
tf
);
ata_exec
(
ap
,
tf
);
}
/**
* ata_tf_to_host_nolock - issue ATA taskfile to host controller
* @ap: port to which command is being issued
* @tf: ATA taskfile register set
*
* Issues ATA taskfile register set to ATA host controller,
* with proper synchronization with interrupt handler and
* other threads.
*
* LOCKING:
* spin_lock_irqsave(host_set lock)
*/
void
ata_tf_to_host_nolock
(
struct
ata_port
*
ap
,
const
struct
ata_taskfile
*
tf
)
static
inline
void
ata_tf_to_host
(
struct
ata_port
*
ap
,
const
struct
ata_taskfile
*
tf
)
{
ap
->
ops
->
tf_load
(
ap
,
tf
);
ap
->
ops
->
exec_command
(
ap
,
tf
);
...
...
@@ -1912,12 +1871,14 @@ static void ata_bus_post_reset(struct ata_port *ap, unsigned int devmask)
*
* LOCKING:
* PCI/etc. bus probe sem.
* Obtains host_set lock.
*
*/
static
unsigned
int
ata_bus_edd
(
struct
ata_port
*
ap
)
{
struct
ata_taskfile
tf
;
unsigned
long
flags
;
/* set up execute-device-diag (bus reset) taskfile */
/* also, take interrupts to a known state (disabled) */
...
...
@@ -1928,7 +1889,9 @@ static unsigned int ata_bus_edd(struct ata_port *ap)
tf
.
protocol
=
ATA_PROT_NODATA
;
/* do bus reset */
spin_lock_irqsave
(
&
ap
->
host_set
->
lock
,
flags
);
ata_tf_to_host
(
ap
,
&
tf
);
spin_unlock_irqrestore
(
&
ap
->
host_set
->
lock
,
flags
);
/* spec says at least 2ms. but who knows with those
* crazy ATAPI devices...
...
...
@@ -3555,7 +3518,7 @@ int ata_qc_issue_prot(struct ata_queued_cmd *qc)
switch
(
qc
->
tf
.
protocol
)
{
case
ATA_PROT_NODATA
:
ata_tf_to_host
_nolock
(
ap
,
&
qc
->
tf
);
ata_tf_to_host
(
ap
,
&
qc
->
tf
);
break
;
case
ATA_PROT_DMA
:
...
...
@@ -3566,20 +3529,20 @@ int ata_qc_issue_prot(struct ata_queued_cmd *qc)
case
ATA_PROT_PIO
:
/* load tf registers, initiate polling pio */
ata_qc_set_polling
(
qc
);
ata_tf_to_host
_nolock
(
ap
,
&
qc
->
tf
);
ata_tf_to_host
(
ap
,
&
qc
->
tf
);
ap
->
hsm_task_state
=
HSM_ST
;
queue_work
(
ata_wq
,
&
ap
->
pio_task
);
break
;
case
ATA_PROT_ATAPI
:
ata_qc_set_polling
(
qc
);
ata_tf_to_host
_nolock
(
ap
,
&
qc
->
tf
);
ata_tf_to_host
(
ap
,
&
qc
->
tf
);
queue_work
(
ata_wq
,
&
ap
->
packet_task
);
break
;
case
ATA_PROT_ATAPI_NODATA
:
ap
->
flags
|=
ATA_FLAG_NOINTR
;
ata_tf_to_host
_nolock
(
ap
,
&
qc
->
tf
);
ata_tf_to_host
(
ap
,
&
qc
->
tf
);
queue_work
(
ata_wq
,
&
ap
->
packet_task
);
break
;
...
...
@@ -4126,8 +4089,6 @@ static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host,
host
->
unique_id
=
ata_unique_id
++
;
host
->
max_cmd_len
=
12
;
scsi_assign_lock
(
host
,
&
host_set
->
lock
);
ap
->
flags
=
ATA_FLAG_PORT_DISABLED
;
ap
->
id
=
host
->
unique_id
;
ap
->
host
=
host
;
...
...
drivers/scsi/libata-scsi.c
浏览文件 @
c1d96203
...
...
@@ -39,6 +39,7 @@
#include <scsi/scsi.h>
#include "scsi.h"
#include <scsi/scsi_host.h>
#include <scsi/scsi_device.h>
#include <linux/libata.h>
#include <linux/hdreg.h>
#include <asm/uaccess.h>
...
...
@@ -2405,8 +2406,12 @@ int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
struct
ata_port
*
ap
;
struct
ata_device
*
dev
;
struct
scsi_device
*
scsidev
=
cmd
->
device
;
struct
Scsi_Host
*
shost
=
scsidev
->
host
;
ap
=
(
struct
ata_port
*
)
&
scsidev
->
host
->
hostdata
[
0
];
ap
=
(
struct
ata_port
*
)
&
shost
->
hostdata
[
0
];
spin_unlock
(
shost
->
host_lock
);
spin_lock
(
&
ap
->
host_set
->
lock
);
ata_scsi_dump_cdb
(
ap
,
cmd
);
...
...
@@ -2429,6 +2434,8 @@ int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
ata_scsi_translate
(
ap
,
dev
,
cmd
,
done
,
atapi_xlat
);
out_unlock:
spin_unlock
(
&
ap
->
host_set
->
lock
);
spin_lock
(
shost
->
host_lock
);
return
0
;
}
...
...
drivers/scsi/libata.h
浏览文件 @
c1d96203
...
...
@@ -48,7 +48,6 @@ extern int ata_qc_issue(struct ata_queued_cmd *qc);
extern
int
ata_check_atapi_dma
(
struct
ata_queued_cmd
*
qc
);
extern
void
ata_dev_select
(
struct
ata_port
*
ap
,
unsigned
int
device
,
unsigned
int
wait
,
unsigned
int
can_sleep
);
extern
void
ata_tf_to_host_nolock
(
struct
ata_port
*
ap
,
const
struct
ata_taskfile
*
tf
);
extern
void
swap_buf_le16
(
u16
*
buf
,
unsigned
int
buf_words
);
extern
int
ata_task_ioctl
(
struct
scsi_device
*
scsidev
,
void
__user
*
arg
);
extern
int
ata_cmd_ioctl
(
struct
scsi_device
*
scsidev
,
void
__user
*
arg
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录