NetBSD-Users archive

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

Re: large disks



On Wed, Oct 03, 2012 at 12:20:06PM -0500, neoluddite%hushmail.com@localhost 
wrote:
> The patch did not help.

OK, so maybe the drive needs an explicit reset. Can you please try the
attached patch instead ?

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--
Index: wdc.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ic/wdc.c,v
retrieving revision 1.274
diff -u -p -u -r1.274 wdc.c
--- wdc.c       31 Jul 2012 15:50:34 -0000      1.274
+++ wdc.c       4 Oct 2012 20:27:55 -0000
@@ -214,6 +214,22 @@ wdc_sataprobe(struct ata_channel *chp)
        switch (sata_reset_interface(chp, wdr->sata_iot, wdr->sata_control,
            wdr->sata_status)) {
        case SStatus_DET_DEV:
+               /* clear error */
+               bus_space_write_4(wdr->sata_iot, wdr->sata_error,
+                   0, 0xffffffff);
+               /* now that communications is established, reset drive */
+               bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_sdh], 0,
+                   WDSD_IBM);
+               delay(10);      /* 400ns delay */
+               /* assert SRST, wait for reset to complete */
+               bus_space_write_1(wdr->ctl_iot, wdr->ctl_ioh, wd_aux_ctlr,
+                   WDCTL_RST | WDCTL_IDS | WDCTL_4BIT);
+               delay(2000);
+               (void) bus_space_read_1(wdr->cmd_iot,
+                   wdr->cmd_iohs[wd_error], 0);
+               bus_space_write_1(wdr->ctl_iot, wdr->ctl_ioh, wd_aux_ctlr,
+                   WDCTL_4BIT | WDCTL_IDS);
+               delay(10);      /* 400ns delay */
                /* wait 5s for BSY to clear */
                for (i = 0; i < WDC_PROBE_WAIT * hz; i++) {
                        bus_space_write_1(wdr->cmd_iot,


Home | Main Index | Thread Index | Old Index