From eaec88ff94aa9b9aee9e290f3573381455a7507e Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 19 Jun 2012 18:09:32 +0000 Subject: [PATCH] mvsas_tgt: SATA hotplug fix Cleanup and prepare the FIS index before issuing the ATA command (during prep: mvs_task_prep_ata). This is to overcome the drive detection issue where the SATA drives fail to get detected during hotplug since the ATA module (libATA) detects errors set in the FIS even though the SATA analyzer shows that the IDENTIFY command was successful. This patch was provided by Praveen Murali . Compared to the original patch, the changelog entry has been reformatted, two spelling errors in comments has been fixed and fixed a checkpatch complaint has been fixed too. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4364 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- mvsas_tgt/mv_sas.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/mvsas_tgt/mv_sas.c b/mvsas_tgt/mv_sas.c index 4fc32b1d8..e861e2cbf 100644 --- a/mvsas_tgt/mv_sas.c +++ b/mvsas_tgt/mv_sas.c @@ -20,7 +20,16 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA -*/ + * + * Changelog: + * - Praveen Murali May 15, 2012 + * Cleanup and prepare the FIS index before issuing the ATA command + * (during prep: mvs_task_prep_ata). This is to overcome the drive + * detection issue where the SATA drives fail to get detected during + * hotplug since the ATA module (libATA) detects errors set in the FIS + * even though the SATA analyzer shows that the IDENTIFY command was + * successful. + */ #include "mv_sas.h" @@ -611,6 +620,10 @@ static int mvs_task_prep_ata(struct mvs_info *mvi, return -EBUSY; } + /* cleanup and prepare the allocated FIS index */ + memset(SATA_RECEIVED_D2H_FIS(mvi_dev->taskfileset), 0, + sizeof(struct dev_to_host_fis)); + slot = &mvi->slot_info[tag]; slot->tx = mvi->tx_prod; phy_mask = sas_port->phy_mask;