Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xiphi1978
linux
提交
cc5d2c8c
L
linux
项目概览
xiphi1978
/
linux
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cc5d2c8c
编写于
3月 20, 2007
作者:
J
James Bottomley
提交者:
James Bottomley
3月 20, 2007
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[SCSI] sd: fix up start/stop messages for new sd_printk() API
Signed-off-by:
N
James Bottomley
<
James.Bottomley@SteelEye.com
>
上级
c3c94c5a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
16 addition
and
22 deletion
+16
-22
drivers/scsi/sd.c
drivers/scsi/sd.c
+16
-22
未找到文件。
drivers/scsi/sd.c
浏览文件 @
cc5d2c8c
...
...
@@ -1733,10 +1733,11 @@ static void scsi_disk_release(struct class_device *cdev)
kfree
(
sdkp
);
}
static
int
sd_start_stop_device
(
struct
scsi_d
evice
*
sd
p
,
int
start
)
static
int
sd_start_stop_device
(
struct
scsi_d
isk
*
sdk
p
,
int
start
)
{
unsigned
char
cmd
[
6
]
=
{
START_STOP
};
/* START_VALID */
struct
scsi_sense_hdr
sshdr
;
struct
scsi_device
*
sdp
=
sdkp
->
device
;
int
res
;
if
(
start
)
...
...
@@ -1748,12 +1749,10 @@ static int sd_start_stop_device(struct scsi_device *sdp, int start)
res
=
scsi_execute_req
(
sdp
,
cmd
,
DMA_NONE
,
NULL
,
0
,
&
sshdr
,
SD_TIMEOUT
,
SD_MAX_RETRIES
);
if
(
res
)
{
printk
(
KERN_WARNING
"FAILED
\n
status = %x, message = %02x, "
"host = %d, driver = %02x
\n
"
,
status_byte
(
res
),
msg_byte
(
res
),
host_byte
(
res
),
driver_byte
(
res
));
sd_printk
(
KERN_WARNING
,
sdkp
,
"START_STOP FAILED
\n
"
);
sd_print_result
(
sdkp
,
res
);
if
(
driver_byte
(
res
)
&
DRIVER_SENSE
)
s
csi_print_sense_hdr
(
"sd"
,
&
sshdr
);
s
d_print_sense_hdr
(
sdkp
,
&
sshdr
);
}
return
res
;
...
...
@@ -1766,7 +1765,6 @@ static int sd_start_stop_device(struct scsi_device *sdp, int start)
*/
static
void
sd_shutdown
(
struct
device
*
dev
)
{
struct
scsi_device
*
sdp
=
to_scsi_device
(
dev
);
struct
scsi_disk
*
sdkp
=
scsi_disk_get_from_dev
(
dev
);
if
(
!
sdkp
)
...
...
@@ -1777,10 +1775,9 @@ static void sd_shutdown(struct device *dev)
sd_sync_cache
(
sdkp
);
}
if
(
system_state
!=
SYSTEM_RESTART
&&
sdp
->
manage_start_stop
)
{
printk
(
KERN_NOTICE
"Stopping disk %s:
\n
"
,
sdkp
->
disk
->
disk_name
);
sd_start_stop_device
(
sdp
,
0
);
if
(
system_state
!=
SYSTEM_RESTART
&&
sdkp
->
device
->
manage_start_stop
)
{
sd_printk
(
KERN_NOTICE
,
sdkp
,
"Stopping disk
\n
"
);
sd_start_stop_device
(
sdkp
,
0
);
}
scsi_disk_put
(
sdkp
);
...
...
@@ -1788,7 +1785,6 @@ static void sd_shutdown(struct device *dev)
static
int
sd_suspend
(
struct
device
*
dev
,
pm_message_t
mesg
)
{
struct
scsi_device
*
sdp
=
to_scsi_device
(
dev
);
struct
scsi_disk
*
sdkp
=
scsi_disk_get_from_dev
(
dev
);
int
ret
;
...
...
@@ -1796,17 +1792,16 @@ static int sd_suspend(struct device *dev, pm_message_t mesg)
return
0
;
/* this can happen */
if
(
sdkp
->
WCE
)
{
printk
(
KERN_NOTICE
"Synchronizing SCSI cache for disk %s:
\n
"
,
sdkp
->
disk
->
disk_name
);
sd_printk
(
KERN_NOTICE
,
sdkp
,
"Synchronizing SCSI cache
\n
"
);
ret
=
sd_sync_cache
(
sdkp
);
if
(
ret
)
return
ret
;
}
if
(
mesg
.
event
==
PM_EVENT_SUSPEND
&&
sdp
->
manage_start_stop
)
{
printk
(
KERN_NOTICE
"Stopping disk %s:
\n
"
,
sdkp
->
disk
->
disk_name
);
ret
=
sd_start_stop_device
(
sdp
,
0
);
if
(
mesg
.
event
==
PM_EVENT_SUSPEND
&&
sdkp
->
device
->
manage_start_stop
)
{
sd_printk
(
KERN_NOTICE
,
sdkp
,
"Stopping disk
\n
"
);
ret
=
sd_start_stop_device
(
sd
k
p
,
0
);
if
(
ret
)
return
ret
;
}
...
...
@@ -1816,15 +1811,14 @@ static int sd_suspend(struct device *dev, pm_message_t mesg)
static
int
sd_resume
(
struct
device
*
dev
)
{
struct
scsi_device
*
sdp
=
to_scsi_device
(
dev
);
struct
scsi_disk
*
sdkp
=
scsi_disk_get_from_dev
(
dev
);
if
(
!
sd
p
->
manage_start_stop
)
if
(
!
sd
kp
->
device
->
manage_start_stop
)
return
0
;
printk
(
KERN_NOTICE
"Starting disk %s:
\n
"
,
sdkp
->
disk
->
disk_name
);
sd_printk
(
KERN_NOTICE
,
sdkp
,
"Starting disk
\n
"
);
return
sd_start_stop_device
(
sdp
,
1
);
return
sd_start_stop_device
(
sd
k
p
,
1
);
}
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录