Module Name: src Committed By: phx Date: Sun Jan 22 13:16:54 UTC 2012
Modified Files: src/sys/arch/sandpoint/stand/altboot: dsk.c Log Message: Cleanup in perform_atareset(). To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/arch/sandpoint/stand/altboot/dsk.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/sandpoint/stand/altboot/dsk.c diff -u src/sys/arch/sandpoint/stand/altboot/dsk.c:1.13 src/sys/arch/sandpoint/stand/altboot/dsk.c:1.14 --- src/sys/arch/sandpoint/stand/altboot/dsk.c:1.13 Sun Jan 22 13:08:16 2012 +++ src/sys/arch/sandpoint/stand/altboot/dsk.c Sun Jan 22 13:16:54 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: dsk.c,v 1.13 2012/01/22 13:08:16 phx Exp $ */ +/* $NetBSD: dsk.c,v 1.14 2012/01/22 13:16:54 phx Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -179,19 +179,14 @@ int perform_atareset(struct dkdev_ata *l, int n) { struct dvata_chan *chan = &l->chan[n]; -// int retries; -// for (retries = 0; retries < 10; retries++) { - CSR_WRITE_1(chan->ctl, ATA_DREQ); - delay(10); - CSR_WRITE_1(chan->ctl, ATA_SRST|ATA_DREQ); - delay(10); - CSR_WRITE_1(chan->ctl, ATA_DREQ); -// if (spinwait_unbusy(l, n, 1000/*250*/, NULL) != 0) -// return 1; -// delay(1000 * 1000); -// } - return spinwait_unbusy(l, n, 1000/*250*/, NULL); + CSR_WRITE_1(chan->ctl, ATA_DREQ); + delay(10); + CSR_WRITE_1(chan->ctl, ATA_SRST|ATA_DREQ); + delay(10); + CSR_WRITE_1(chan->ctl, ATA_DREQ); + + return spinwait_unbusy(l, n, 1000, NULL); } /* clear idle and standby timers to spin up the drive */