Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
64f043d8
Commit
64f043d8
authored
Nov 17, 2005
by
Jeff Garzik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[libata] add timeout to commands for which we call wait_completion()
parent
556c66db
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
4 deletions
+28
-4
drivers/scsi/libata-core.c
drivers/scsi/libata-core.c
+28
-4
No files found.
drivers/scsi/libata-core.c
View file @
64f043d8
...
@@ -1046,6 +1046,30 @@ static unsigned int ata_pio_modes(const struct ata_device *adev)
...
@@ -1046,6 +1046,30 @@ static unsigned int ata_pio_modes(const struct ata_device *adev)
return
modes
;
return
modes
;
}
}
static
int
ata_qc_wait_err
(
struct
ata_queued_cmd
*
qc
,
struct
completion
*
wait
)
{
int
rc
=
0
;
if
(
wait_for_completion_timeout
(
wait
,
30
*
HZ
)
<
1
)
{
/* timeout handling */
unsigned
int
err_mask
=
ac_err_mask
(
ata_chk_status
(
qc
->
ap
));
if
(
!
err_mask
)
{
printk
(
KERN_WARNING
"ata%u: slow completion (cmd %x)
\n
"
,
qc
->
ap
->
id
,
qc
->
tf
.
command
);
}
else
{
printk
(
KERN_WARNING
"ata%u: qc timeout (cmd %x)
\n
"
,
qc
->
ap
->
id
,
qc
->
tf
.
command
);
rc
=
-
EIO
;
}
ata_qc_complete
(
qc
,
err_mask
);
}
return
rc
;
}
/**
/**
* ata_dev_identify - obtain IDENTIFY x DEVICE page
* ata_dev_identify - obtain IDENTIFY x DEVICE page
* @ap: port on which device we wish to probe resides
* @ap: port on which device we wish to probe resides
...
@@ -1125,7 +1149,7 @@ static void ata_dev_identify(struct ata_port *ap, unsigned int device)
...
@@ -1125,7 +1149,7 @@ static void ata_dev_identify(struct ata_port *ap, unsigned int device)
if
(
rc
)
if
(
rc
)
goto
err_out
;
goto
err_out
;
else
else
wait_for_completion
(
&
wait
);
ata_qc_wait_err
(
qc
,
&
wait
);
spin_lock_irqsave
(
&
ap
->
host_set
->
lock
,
flags
);
spin_lock_irqsave
(
&
ap
->
host_set
->
lock
,
flags
);
ap
->
ops
->
tf_read
(
ap
,
&
qc
->
tf
);
ap
->
ops
->
tf_read
(
ap
,
&
qc
->
tf
);
...
@@ -2269,7 +2293,7 @@ static void ata_dev_set_xfermode(struct ata_port *ap, struct ata_device *dev)
...
@@ -2269,7 +2293,7 @@ static void ata_dev_set_xfermode(struct ata_port *ap, struct ata_device *dev)
if
(
rc
)
if
(
rc
)
ata_port_disable
(
ap
);
ata_port_disable
(
ap
);
else
else
wait_for_completion
(
&
wait
);
ata_qc_wait_err
(
qc
,
&
wait
);
DPRINTK
(
"EXIT
\n
"
);
DPRINTK
(
"EXIT
\n
"
);
}
}
...
@@ -2317,7 +2341,7 @@ static void ata_dev_reread_id(struct ata_port *ap, struct ata_device *dev)
...
@@ -2317,7 +2341,7 @@ static void ata_dev_reread_id(struct ata_port *ap, struct ata_device *dev)
if
(
rc
)
if
(
rc
)
goto
err_out
;
goto
err_out
;
wait_for_completion
(
&
wait
);
ata_qc_wait_err
(
qc
,
&
wait
);
swap_buf_le16
(
dev
->
id
,
ATA_ID_WORDS
);
swap_buf_le16
(
dev
->
id
,
ATA_ID_WORDS
);
...
@@ -2373,7 +2397,7 @@ static void ata_dev_init_params(struct ata_port *ap, struct ata_device *dev)
...
@@ -2373,7 +2397,7 @@ static void ata_dev_init_params(struct ata_port *ap, struct ata_device *dev)
if
(
rc
)
if
(
rc
)
ata_port_disable
(
ap
);
ata_port_disable
(
ap
);
else
else
wait_for_completion
(
&
wait
);
ata_qc_wait_err
(
qc
,
&
wait
);
DPRINTK
(
"EXIT
\n
"
);
DPRINTK
(
"EXIT
\n
"
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment