Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
f6ef65e6
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看板
提交
f6ef65e6
编写于
1月 27, 2006
作者:
J
Jeff Garzik
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'upstream-2.6.17'
上级
7103c7bc
c19ba8af
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
75 addition
and
29 deletion
+75
-29
drivers/scsi/ahci.c
drivers/scsi/ahci.c
+6
-0
drivers/scsi/libata-core.c
drivers/scsi/libata-core.c
+61
-26
include/linux/libata.h
include/linux/libata.h
+8
-3
未找到文件。
drivers/scsi/ahci.c
浏览文件 @
f6ef65e6
...
...
@@ -66,6 +66,8 @@ enum {
AHCI_IRQ_ON_SG
=
(
1
<<
31
),
AHCI_CMD_ATAPI
=
(
1
<<
5
),
AHCI_CMD_WRITE
=
(
1
<<
6
),
AHCI_CMD_RESET
=
(
1
<<
8
),
AHCI_CMD_CLR_BUSY
=
(
1
<<
10
),
RX_FIS_D2H_REG
=
0x40
,
/* offset of D2H Register FIS data */
...
...
@@ -85,6 +87,7 @@ enum {
/* HOST_CAP bits */
HOST_CAP_64
=
(
1
<<
31
),
/* PCI DAC (64-bit DMA) support */
HOST_CAP_CLO
=
(
1
<<
24
),
/* Command List Override support */
/* registers for each SATA port */
PORT_LST_ADDR
=
0x00
,
/* command list DMA addr */
...
...
@@ -138,6 +141,7 @@ enum {
PORT_CMD_LIST_ON
=
(
1
<<
15
),
/* cmd list DMA engine running */
PORT_CMD_FIS_ON
=
(
1
<<
14
),
/* FIS DMA engine running */
PORT_CMD_FIS_RX
=
(
1
<<
4
),
/* Enable FIS receive DMA engine */
PORT_CMD_CLO
=
(
1
<<
3
),
/* Command list override */
PORT_CMD_POWER_ON
=
(
1
<<
2
),
/* Power up device */
PORT_CMD_SPIN_UP
=
(
1
<<
1
),
/* Spin up device */
PORT_CMD_START
=
(
1
<<
0
),
/* Enable port DMA engine */
...
...
@@ -504,7 +508,9 @@ static void ahci_phy_reset(struct ata_port *ap)
struct
ata_device
*
dev
=
&
ap
->
device
[
0
];
u32
new_tmp
,
tmp
;
ahci_stop_engine
(
ap
);
__sata_phy_reset
(
ap
);
ahci_start_engine
(
ap
);
if
(
ap
->
flags
&
ATA_FLAG_PORT_DISABLED
)
return
;
...
...
drivers/scsi/libata-core.c
浏览文件 @
f6ef65e6
...
...
@@ -61,9 +61,6 @@
#include "libata.h"
static
unsigned
int
ata_busy_sleep
(
struct
ata_port
*
ap
,
unsigned
long
tmout_pat
,
unsigned
long
tmout
);
static
void
ata_dev_reread_id
(
struct
ata_port
*
ap
,
struct
ata_device
*
dev
);
static
void
ata_dev_init_params
(
struct
ata_port
*
ap
,
struct
ata_device
*
dev
);
static
void
ata_set_mode
(
struct
ata_port
*
ap
);
...
...
@@ -834,6 +831,7 @@ unsigned int ata_dev_classify(const struct ata_taskfile *tf)
* ata_dev_try_classify - Parse returned ATA device signature
* @ap: ATA channel to examine
* @device: Device to examine (starting at zero)
* @r_err: Value of error register on completion
*
* After an event -- SRST, E.D.D., or SATA COMRESET -- occurs,
* an ATA/ATAPI-defined set of values is placed in the ATA
...
...
@@ -846,11 +844,14 @@ unsigned int ata_dev_classify(const struct ata_taskfile *tf)
*
* LOCKING:
* caller.
*
* RETURNS:
* Device type - %ATA_DEV_ATA, %ATA_DEV_ATAPI or %ATA_DEV_NONE.
*/
static
u8
ata_dev_try_classify
(
struct
ata_port
*
ap
,
unsigned
int
device
)
static
unsigned
int
ata_dev_try_classify
(
struct
ata_port
*
ap
,
unsigned
int
device
,
u8
*
r_err
)
{
struct
ata_device
*
dev
=
&
ap
->
device
[
device
];
struct
ata_taskfile
tf
;
unsigned
int
class
;
u8
err
;
...
...
@@ -861,8 +862,8 @@ static u8 ata_dev_try_classify(struct ata_port *ap, unsigned int device)
ap
->
ops
->
tf_read
(
ap
,
&
tf
);
err
=
tf
.
feature
;
dev
->
class
=
ATA_DEV_NONE
;
if
(
r_err
)
*
r_err
=
err
;
/* see if device passed diags */
if
(
err
==
1
)
...
...
@@ -870,18 +871,16 @@ static u8 ata_dev_try_classify(struct ata_port *ap, unsigned int device)
else
if
((
device
==
0
)
&&
(
err
==
0x81
))
/* do nothing */
;
else
return
err
;
return
ATA_DEV_NONE
;
/* determine if device i
f
ATA or ATAPI */
/* determine if device i
s
ATA or ATAPI */
class
=
ata_dev_classify
(
&
tf
);
if
(
class
==
ATA_DEV_UNKNOWN
)
return
err
;
return
ATA_DEV_NONE
;
if
((
class
==
ATA_DEV_ATA
)
&&
(
ata_chk_status
(
ap
)
==
0
))
return
err
;
dev
->
class
=
class
;
return
err
;
return
ATA_DEV_NONE
;
return
class
;
}
/**
...
...
@@ -1073,6 +1072,24 @@ static unsigned int ata_pio_modes(const struct ata_device *adev)
timing API will get this right anyway */
}
static
inline
void
ata_queue_packet_task
(
struct
ata_port
*
ap
)
{
queue_work
(
ata_wq
,
&
ap
->
packet_task
);
}
static
inline
void
ata_queue_pio_task
(
struct
ata_port
*
ap
)
{
queue_work
(
ata_wq
,
&
ap
->
pio_task
);
}
static
inline
void
ata_queue_delayed_pio_task
(
struct
ata_port
*
ap
,
unsigned
long
delay
)
{
queue_delayed_work
(
ata_wq
,
&
ap
->
pio_task
,
delay
);
}
void
ata_qc_complete_internal
(
struct
ata_queued_cmd
*
qc
)
{
struct
completion
*
waiting
=
qc
->
private_data
;
...
...
@@ -1478,7 +1495,24 @@ static int ata_bus_probe(struct ata_port *ap)
{
unsigned
int
i
,
found
=
0
;
ap
->
ops
->
phy_reset
(
ap
);
if
(
ap
->
ops
->
probe_reset
)
{
unsigned
int
classes
[
ATA_MAX_DEVICES
];
int
rc
;
ata_port_probe
(
ap
);
rc
=
ap
->
ops
->
probe_reset
(
ap
,
classes
);
if
(
rc
==
0
)
{
for
(
i
=
0
;
i
<
ATA_MAX_DEVICES
;
i
++
)
ap
->
device
[
i
].
class
=
classes
[
i
];
}
else
{
printk
(
KERN_ERR
"ata%u: probe reset failed, "
"disabling port
\n
"
,
ap
->
id
);
ata_port_disable
(
ap
);
}
}
else
ap
->
ops
->
phy_reset
(
ap
);
if
(
ap
->
flags
&
ATA_FLAG_PORT_DISABLED
)
goto
err_out
;
...
...
@@ -1952,9 +1986,8 @@ static void ata_set_mode(struct ata_port *ap)
*
*/
static
unsigned
int
ata_busy_sleep
(
struct
ata_port
*
ap
,
unsigned
long
tmout_pat
,
unsigned
long
tmout
)
unsigned
int
ata_busy_sleep
(
struct
ata_port
*
ap
,
unsigned
long
tmout_pat
,
unsigned
long
tmout
)
{
unsigned
long
timer_start
,
timeout
;
u8
status
;
...
...
@@ -2173,9 +2206,9 @@ void ata_bus_reset(struct ata_port *ap)
/*
* determine by signature whether we have ATA or ATAPI devices
*/
err
=
ata_dev_try_classify
(
ap
,
0
);
ap
->
device
[
0
].
class
=
ata_dev_try_classify
(
ap
,
0
,
&
err
);
if
((
slave_possible
)
&&
(
err
!=
0x81
))
a
ta_dev_try_classify
(
ap
,
1
);
a
p
->
device
[
1
].
class
=
ata_dev_try_classify
(
ap
,
1
,
&
err
);
/* re-enable interrupts */
if
(
ap
->
ioaddr
.
ctl_addr
)
/* FIXME: hack. create a hook instead */
...
...
@@ -3598,7 +3631,7 @@ static void ata_pio_task(void *_data)
}
if
(
timeout
)
queue_delayed_work
(
ata_wq
,
&
ap
->
pio_task
,
timeout
);
ata_queue_delayed_pio_task
(
ap
,
timeout
);
else
if
(
has_next
)
goto
fsm_start
;
}
...
...
@@ -3960,7 +3993,7 @@ unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc)
if
(
qc
->
tf
.
flags
&
ATA_TFLAG_WRITE
)
{
/* PIO data out protocol */
ap
->
hsm_task_state
=
HSM_ST_FIRST
;
queue_work
(
ata_wq
,
&
ap
->
pio_task
);
ata_queue_pio_task
(
ap
);
/* always send first data block using
* the ata_pio_task() codepath.
...
...
@@ -3970,7 +4003,7 @@ unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc)
ap
->
hsm_task_state
=
HSM_ST
;
if
(
qc
->
tf
.
flags
&
ATA_TFLAG_POLLING
)
queue_work
(
ata_wq
,
&
ap
->
pio_task
);
ata_queue_pio_task
(
ap
);
/* if polling, ata_pio_task() handles the rest.
* otherwise, interrupt handler takes over from here.
...
...
@@ -3985,12 +4018,13 @@ unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc)
ata_qc_set_polling
(
qc
);
ata_tf_to_host
(
ap
,
&
qc
->
tf
);
ap
->
hsm_task_state
=
HSM_ST_FIRST
;
/* send cdb by polling if no cdb interrupt */
if
((
!
(
qc
->
dev
->
flags
&
ATA_DFLAG_CDB_INTR
))
||
(
qc
->
tf
.
flags
&
ATA_TFLAG_POLLING
))
queue_work
(
ata_wq
,
&
ap
->
pio_task
);
ata_queue_packet_task
(
ap
);
break
;
case
ATA_PROT_ATAPI_DMA
:
...
...
@@ -4002,7 +4036,7 @@ unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc)
/* send cdb by polling if no cdb interrupt */
if
(
!
(
qc
->
dev
->
flags
&
ATA_DFLAG_CDB_INTR
))
queue_work
(
ata_wq
,
&
ap
->
pio_task
);
ata_queue_packet_task
(
ap
);
break
;
default:
...
...
@@ -5433,6 +5467,7 @@ EXPORT_SYMBOL_GPL(__sata_phy_reset);
EXPORT_SYMBOL_GPL
(
ata_bus_reset
);
EXPORT_SYMBOL_GPL
(
ata_port_disable
);
EXPORT_SYMBOL_GPL
(
ata_ratelimit
);
EXPORT_SYMBOL_GPL
(
ata_busy_sleep
);
EXPORT_SYMBOL_GPL
(
ata_scsi_ioctl
);
EXPORT_SYMBOL_GPL
(
ata_scsi_queuecmd
);
EXPORT_SYMBOL_GPL
(
ata_scsi_error
);
...
...
include/linux/libata.h
浏览文件 @
f6ef65e6
...
...
@@ -149,9 +149,9 @@ enum {
ATA_FLAG_PORT_DISABLED
=
(
1
<<
2
),
/* port is disabled, ignore it */
ATA_FLAG_SATA
=
(
1
<<
3
),
ATA_FLAG_NO_LEGACY
=
(
1
<<
4
),
/* no legacy mode check */
ATA_FLAG_SRST
=
(
1
<<
5
),
/* use ATA SRST, not E.D.D. */
ATA_FLAG_SRST
=
(
1
<<
5
),
/*
(obsolete)
use ATA SRST, not E.D.D. */
ATA_FLAG_MMIO
=
(
1
<<
6
),
/* use MMIO, not PIO */
ATA_FLAG_SATA_RESET
=
(
1
<<
7
),
/* use COMRESET */
ATA_FLAG_SATA_RESET
=
(
1
<<
7
),
/*
(obsolete)
use COMRESET */
ATA_FLAG_PIO_DMA
=
(
1
<<
8
),
/* PIO cmds via DMA */
ATA_FLAG_PIO_POLLING
=
(
1
<<
9
),
/* use polling PIO if LLD
* doesn't handle PIO interrupts */
...
...
@@ -422,7 +422,9 @@ struct ata_port_operations {
u8
(
*
check_altstatus
)(
struct
ata_port
*
ap
);
void
(
*
dev_select
)(
struct
ata_port
*
ap
,
unsigned
int
device
);
void
(
*
phy_reset
)
(
struct
ata_port
*
ap
);
void
(
*
phy_reset
)
(
struct
ata_port
*
ap
);
/* obsolete */
int
(
*
probe_reset
)
(
struct
ata_port
*
ap
,
unsigned
int
*
classes
);
void
(
*
post_set_mode
)
(
struct
ata_port
*
ap
);
int
(
*
check_atapi_dma
)
(
struct
ata_queued_cmd
*
qc
);
...
...
@@ -503,6 +505,9 @@ extern int ata_scsi_device_suspend(struct scsi_device *);
extern
int
ata_device_resume
(
struct
ata_port
*
,
struct
ata_device
*
);
extern
int
ata_device_suspend
(
struct
ata_port
*
,
struct
ata_device
*
);
extern
int
ata_ratelimit
(
void
);
extern
unsigned
int
ata_busy_sleep
(
struct
ata_port
*
ap
,
unsigned
long
timeout_pat
,
unsigned
long
timeout
);
/*
* Default driver ops implementations
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录