All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sata_sx4: speed up ECC initialization
@ 2009-04-14  2:26 Alexander Beregalov
  2009-04-14 11:57 ` Jeff Garzik
  0 siblings, 1 reply; 10+ messages in thread
From: Alexander Beregalov @ 2009-04-14  2:26 UTC (permalink / raw)
  To: jeff; +Cc: linux-ide, Alexander Beregalov

ECC initialization takes too long. It writes zeroes by portions of 4
byte, it takes more than 6 minutes to initialize 512Mb DIMM module.
Change portion to 1Mb.

before:
[10857.207576] pdc20621_dimm_init: Start ECC initialization
[11235.333118] pdc20621_dimm_init: Finish ECC initialization

after:
[ 1005.126437] pdc20621_dimm_init: Local DIMM Speed = 100
[ 1005.128111] pdc20621_dimm_init: Local DIMM Size = 512MB
[ 1005.133508] Local DIMM ECC Enabled
[ 1005.236482] pdc20621_dimm_init: Start ECC initialization
[ 1031.278098] pdc20621_dimm_init: Finish ECC initialization

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
---
 drivers/ata/sata_sx4.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/ata/sata_sx4.c b/drivers/ata/sata_sx4.c
index dce3dcc..d329501 100644
--- a/drivers/ata/sata_sx4.c
+++ b/drivers/ata/sata_sx4.c
@@ -1208,7 +1208,6 @@ static unsigned int pdc20621_dimm_init(struct ata_host *host)
 {
 	int speed, size, length;
 	u32 addr, spd0, pci_status;
-	u32 tmp = 0;
 	u32 time_period = 0;
 	u32 tcount = 0;
 	u32 ticks = 0;
@@ -1323,14 +1322,17 @@ static unsigned int pdc20621_dimm_init(struct ata_host *host)
 	pdc20621_i2c_read(host, PDC_DIMM0_SPD_DEV_ADDRESS,
 			  PDC_DIMM_SPD_TYPE, &spd0);
 	if (spd0 == 0x02) {
+		void *buf;
 		VPRINTK("Start ECC initialization\n");
 		addr = 0;
 		length = size * 1024 * 1024;
+		buf = kzalloc(PDC_20621_PAGE_SIZE * 32, GFP_KERNEL);
 		while (addr < length) {
-			pdc20621_put_to_dimm(host, (void *) &tmp, addr,
-					     sizeof(u32));
-			addr += sizeof(u32);
+			pdc20621_put_to_dimm(host, buf, addr,
+					     PDC_20621_PAGE_SIZE * 32);
+			addr += PDC_20621_PAGE_SIZE * 32;
 		}
+		kfree(buf);
 		VPRINTK("Finish ECC initialization\n");
 	}
 	return 0;
-- 
1.6.2.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-05-16 19:17 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-14  2:26 [PATCH] sata_sx4: speed up ECC initialization Alexander Beregalov
2009-04-14 11:57 ` Jeff Garzik
2009-04-14 20:00   ` Alexander Beregalov
2009-04-14 20:21     ` Jeff Garzik
2009-04-14 20:51       ` Alexander Beregalov
2009-04-15  8:02         ` Mikael Pettersson
2009-05-16  6:29         ` Jeff Garzik
2009-05-16 13:29           ` Alexander Beregalov
2009-05-16 19:11             ` Jeff Garzik
2009-05-16 19:17               ` Alexander Beregalov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.