[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debian 7.1 on QNAP TS-412 mdadm always reassembles without drive in 4th bay



Success!

Am 01.07.2013 08:59, schrieb Martin Waschbüsch:

> To test this, I patched the driver from debian's linux-source-3.2
> accordingly and am re-compiling the kernel as we speak.
> I'll be back with results on that...

With the increased delay in place, I can now reliably boot my TS-412 and
all drives are up before the softraid is enabled. The patch I ended up
using is attached (though, as written before, it is simply copy & paste
from QNAP GPL sources).

Best,

Martin
--- linux-source-3.2-orig/drivers/ata/sata_mv.c	2013-05-30 15:35:16.000000000 +0200
+++ linux-source-3.2/drivers/ata/sata_mv.c	2013-07-01 11:30:43.094185000 +0200
@@ -73,6 +73,10 @@
 #define DRV_NAME	"sata_mv"
 #define DRV_VERSION	"1.28"
 
+//Patch by QNAP: delay SATA disk initialization
+#define	QMV_SATA_INIT_DELAY_PHASE	5000 //milliseconds
+////////////////////////////////////////////////////////////////
+
 /*
  * module options
  */
@@ -4329,7 +4333,11 @@
 		struct ata_port *ap = host->ports[port];
 		void __iomem *port_mmio = mv_port_base(hpriv->base, port);
 		unsigned int offset = port_mmio - hpriv->base;
-
+		// marvell 7042 port 2 port 3 will power on by order every  5 sec
+		if( (port==2) || (port == 3) ){
+			printk("Wait %d seconds to initialize scsi %d.\n",QMV_SATA_INIT_DELAY_PHASE/1000,port);
+			mdelay(QMV_SATA_INIT_DELAY_PHASE);
+		}
 		ata_port_pbar_desc(ap, MV_PRIMARY_BAR, -1, "mmio");
 		ata_port_pbar_desc(ap, MV_PRIMARY_BAR, offset, "port");
 	}

Reply to: