[PATCH 13/15] sas_ata: Implement a libata error handler

From: Darrick J. Wong
Date: Fri Nov 17 2006 - 16:03:23 EST





Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx>
---

drivers/scsi/libsas/sas_ata.c | 24 +++++++++++++++++++++++-
1 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
index e897140..7338775 100644
--- a/drivers/scsi/libsas/sas_ata.c
+++ b/drivers/scsi/libsas/sas_ata.c
@@ -351,6 +351,27 @@ static u32 sas_ata_scr_read(struct ata_p
}
}

+static int sas_ata_hardreset(struct ata_port *ap, unsigned int *classes)
+{
+ struct domain_device *dev = ap->private_data;
+ struct sas_phy *phy = dev->port->phy;
+
+ return sas_phy_reset(phy, 1);
+}
+
+static int sas_ata_softreset(struct ata_port *ap, unsigned int *classes)
+{
+ struct domain_device *dev = ap->private_data;
+ struct sas_phy *phy = dev->port->phy;
+
+ return sas_phy_reset(phy, 0);
+}
+
+static void sas_ata_eh(struct ata_port *ap)
+{
+ ata_do_eh(ap, NULL, sas_ata_softreset, sas_ata_hardreset, NULL);
+}
+
static struct ata_port_operations sas_sata_ops = {
.port_disable = ata_port_disable,
.check_status = sas_ata_check_status,
@@ -364,7 +385,8 @@ static struct ata_port_operations sas_sa
.port_start = ata_sas_port_start,
.port_stop = ata_sas_port_stop,
.scr_read = sas_ata_scr_read,
- .scr_write = sas_ata_scr_write
+ .scr_write = sas_ata_scr_write,
+ .error_handler = sas_ata_eh
};

static struct ata_port_info sata_port_info = {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/