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-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html