here is the updated patch. On Thu, 2012-06-21 at 09:48 -0700, Dan Williams wrote: > On Thu, Jun 21, 2012 at 9:41 AM, Praveen Murali <pmurali@xxxxxxxxxxxx> wrote: > > Ok, do you want me to regenerate the patch? > > Yes, James will be the one to ultimately apply it and would save him > time to have a new patch. The patch you attached had a shorter > changelog I think it would be fine to include your entire 4 paragraph > lead in message.
From 6ad9cf691f9d11e8c6de332efc35bd945c0f2840 Mon Sep 17 00:00:00 2001 From: Praveen Murali <pmurali@xxxxxxxxxxxx> Date: Thu, 21 Jun 2012 09:57:03 -0700 Subject: [PATCH v2] Fix mvsas SATA disk detection issues I am using the Marvell SAS HBA (MV64460/64461/64462 System Controller, Revision B (rev 01)), on a system running Ubuntu 12.04 stock kernel. And i am seeing some drive detection issues with SATA drives, mostly during hotplugging the drives; the issue gets exaggerated when we keep removing and plugging in drives. From dmesg, after starting the LibATA debugs, it looks like the ata_eh_revalidate_and_attach fails because ata_dev_read_id fails to get the IDENTIFY command response. I see "both IDENTIFYs aborted, assuming NODEV" for all these drives that go undetected. At this point, if I unload and reload the mvsas driver, these drives detect fine. So, I hooked up a SATA analyzer between the HBA and one of the drives, and restarted the test. From what I can see, even though the drive responds to the IDENTIFY command, the upper layer detects an error and discards the response. On further debugging it was evident that the error was being detected in the FIS. After going thru the mvsas driver, I see that during init the driver allocates a DMA area for an FIS pool (for as many as 33 FIS's) and initializes it to 0. And each ATA command is allocated a FIS area from this pool during the command prep; but its never cleared. The fix is to cleanup and prepare the FIS index before issuing the ATA command (during prep: mvs_task_prep_ata). --- drivers/scsi/mvsas/mv_sas.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/scsi/mvsas/mv_sas.c b/drivers/scsi/mvsas/mv_sas.c index a4884a5..73d9816 100644 --- a/drivers/scsi/mvsas/mv_sas.c +++ b/drivers/scsi/mvsas/mv_sas.c @@ -458,6 +458,11 @@ static int mvs_task_prep_ata(struct mvs_info *mvi, mvi_dev->device_id); 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; del_q = TXQ_MODE_I | tag | -- 1.7.10