libata: implement and use sata_std_hardreset()

Implement sata_std_hardreset(), which simply wraps around
sata_link_hardreset().  sata_std_hardreset() becomes new standard
hardreset method for sata_port_ops and sata_sff_hardreset() moves from
ata_base_port_ops to ata_sff_port_ops, which is where it really
belongs.

ata_is_builtin_hardreset() is added so that both
ata_std_error_handler() and ata_sff_error_handler() skip both builtin
hardresets if SCR isn't accessible.

piix_sidpr_hardreset() in ata_piix.c is identical to
sata_std_hardreset() in functionality and got replaced with the
standard function.

Signed-off-by: Tejun Heo <htejun@gmail.com>
This commit is contained in:
Tejun Heo
2008-04-07 22:47:19 +09:00
committed by Jeff Garzik
parent 9dadd45b24
commit 57c9efdfb3
6 changed files with 47 additions and 37 deletions

View File

@ -49,6 +49,7 @@ const struct ata_port_operations ata_sff_port_ops = {
.thaw = ata_sff_thaw,
.prereset = ata_sff_prereset,
.softreset = ata_sff_softreset,
.hardreset = sata_sff_hardreset,
.postreset = ata_sff_postreset,
.error_handler = ata_sff_error_handler,
.post_internal_cmd = ata_sff_post_internal_cmd,
@ -2031,14 +2032,12 @@ void ata_sff_error_handler(struct ata_port *ap)
/* PIO and DMA engines have been stopped, perform recovery */
/* ata_sff_softreset and sata_sff_hardreset are inherited to
* all SFF drivers from ata_sff_port_ops. Ignore softreset if
* ctl isn't accessible. Ignore hardreset if SCR access isn't
* available.
/* Ignore ata_sff_softreset if ctl isn't accessible and
* built-in hardresets if SCR access isn't available.
*/
if (softreset == ata_sff_softreset && !ap->ioaddr.ctl_addr)
softreset = NULL;
if (hardreset == sata_sff_hardreset && !sata_scr_valid(&ap->link))
if (ata_is_builtin_hardreset(hardreset) && !sata_scr_valid(&ap->link))
hardreset = NULL;
ata_do_eh(ap, ap->ops->prereset, softreset, hardreset,