aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-core.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2008-04-07 09:47:19 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-04-17 15:44:23 -0400
commit57c9efdfb3cee5d4564fcb5f70555e2edb1bc52a (patch)
treec2289500f093736853a94d2d9577036658676498 /drivers/ata/libata-core.c
parent9dadd45b24145d6aee2fabb28d7aef972301892b (diff)
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>
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r--drivers/ata/libata-core.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index b607292b648..c4fd4afbf34 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -75,7 +75,6 @@ const unsigned long sata_deb_timing_long[] = { 100, 2000, 5000 };
75 75
76const struct ata_port_operations ata_base_port_ops = { 76const struct ata_port_operations ata_base_port_ops = {
77 .prereset = ata_std_prereset, 77 .prereset = ata_std_prereset,
78 .hardreset = sata_sff_hardreset,
79 .postreset = ata_std_postreset, 78 .postreset = ata_std_postreset,
80 .error_handler = ata_std_error_handler, 79 .error_handler = ata_std_error_handler,
81}; 80};
@@ -84,6 +83,7 @@ const struct ata_port_operations sata_port_ops = {
84 .inherits = &ata_base_port_ops, 83 .inherits = &ata_base_port_ops,
85 84
86 .qc_defer = ata_std_qc_defer, 85 .qc_defer = ata_std_qc_defer,
86 .hardreset = sata_std_hardreset,
87 .sff_dev_select = ata_noop_dev_select, 87 .sff_dev_select = ata_noop_dev_select,
88}; 88};
89 89
@@ -3661,6 +3661,33 @@ int sata_link_hardreset(struct ata_link *link, const unsigned long *timing,
3661} 3661}
3662 3662
3663/** 3663/**
3664 * sata_std_hardreset - COMRESET w/o waiting or classification
3665 * @link: link to reset
3666 * @class: resulting class of attached device
3667 * @deadline: deadline jiffies for the operation
3668 *
3669 * Standard SATA COMRESET w/o waiting or classification.
3670 *
3671 * LOCKING:
3672 * Kernel thread context (may sleep)
3673 *
3674 * RETURNS:
3675 * 0 if link offline, -EAGAIN if link online, -errno on errors.
3676 */
3677int sata_std_hardreset(struct ata_link *link, unsigned int *class,
3678 unsigned long deadline)
3679{
3680 const unsigned long *timing = sata_ehc_deb_timing(&link->eh_context);
3681 bool online;
3682 int rc;
3683
3684 /* do hardreset */
3685 rc = sata_link_hardreset(link, timing, deadline, &online, NULL);
3686 *class = ATA_DEV_NONE;
3687 return online ? -EAGAIN : rc;
3688}
3689
3690/**
3664 * ata_std_postreset - standard postreset callback 3691 * ata_std_postreset - standard postreset callback
3665 * @link: the target ata_link 3692 * @link: the target ata_link
3666 * @classes: classes of attached devices 3693 * @classes: classes of attached devices
@@ -6225,6 +6252,7 @@ EXPORT_SYMBOL_GPL(sata_link_debounce);
6225EXPORT_SYMBOL_GPL(sata_link_resume); 6252EXPORT_SYMBOL_GPL(sata_link_resume);
6226EXPORT_SYMBOL_GPL(ata_std_prereset); 6253EXPORT_SYMBOL_GPL(ata_std_prereset);
6227EXPORT_SYMBOL_GPL(sata_link_hardreset); 6254EXPORT_SYMBOL_GPL(sata_link_hardreset);
6255EXPORT_SYMBOL_GPL(sata_std_hardreset);
6228EXPORT_SYMBOL_GPL(ata_std_postreset); 6256EXPORT_SYMBOL_GPL(ata_std_postreset);
6229EXPORT_SYMBOL_GPL(ata_dev_classify); 6257EXPORT_SYMBOL_GPL(ata_dev_classify);
6230EXPORT_SYMBOL_GPL(ata_dev_pair); 6258EXPORT_SYMBOL_GPL(ata_dev_pair);