Current-Users archive

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

Re: wd0: IDENTIFY failed



Hi! all,


From: KIYOHARA Takashi <kiyohara%kk.iij4u.or.jp@localhost>
Date: Mon, 05 Nov 2012 23:18:25 +0900 (JST)

> The OMSAL400(evbmips) has a internal storage(CF).
> It was not able to mount wd0 on and after August 2, 2012.  The following
> errors can be seen. 
> 
> 
>   wdc0 at pcmcia0 function 0: <TRANSCEND, TS512MCF80>
>   wdc0: i/o mapped mode
> 
>   <..snip..>
> 
>   atabus0 at wdc0 channel 0
>   wd0 at atabus0 drive 0
>   wd0: <TRANSCEND>
>   wd0: 488 MB, 993 cyl, 16 head, 63 sec, 512 bytes/sect x 1000944 sectors
> 
>   <..snip..>
> 
>   root device: wd0
>   dump device (default wd0b): 
>   file system (default generic): 
>   root on wd0a dumps on wd0b
> 
>   <..snip..>
> 
>   wd0: IDENTIFY failed
>   wd0: IDENTIFY failed
>   vfs_mountroot: can't open root device
>   cannot mount root, error = 5
>   root device (default wd0a): 
> 
> 
> I retry with ATADEBUG.
> 
>   atabus0 at wdc0 channel 0
>   wdc0:0: before reset, st0=0x58, st1=0xb0
>   wdc0:0:0: after reset, sc=0x1 sn=0x1 cl=0x0 ch=0x0
>   wdc0:0:1: after reset, sc=0x0 sn=0x0 cl=0x0 ch=0x0
>   wdc0:0: wdcwait_reset() end, st0=0x50 st1=0x0
>   wdc0:0: after reset, ret_value=0x1
>   wdc0:0:0: after reset, sc=0x1 sn=0x1 cl=0x0 ch=0x0
>   wdc0:0: wait DRDY st0 0x50 st1 0x0
>   ata_get_params
>   wdc_exec_command wdc0:0:0
>   ata_exec_xfer 0x87d00f88 channel 0 drive 0
>   atastart from ata_exec_xfer, flags 0x100
>   atastart: xfer 0x87d00f88 channel 0 drive 0
>   __wdccommand_start wdc0:0:0
>   __wdcwait wdc0:0
>   wdccommand wdc0:0:0: command=0xec cylin=0 head=160 sector=0 count=0 
> features=0
>   __wdccommand_intr wdc0:0:0
>   __wdcwait wdc0:0
>   __wdccommand_done wdc0:0:0 flags 0x59
>   atabusattach: ch_drive_type 0x1 0x0
>   wd0 at atabus0 drive 0wdattach
>   
>   ata_get_params
>   wdc_exec_command wdc0:0:0
>   ata_exec_xfer 0x87d00f88 channel 0 drive 0
>   atastart from ata_exec_xfer, flags 0x0
>   atastart: xfer 0x87d00f88 channel 0 drive 0
>   __wdccommand_start wdc0:0:0
>   __wdcwait wdc0:0
>   wdccommand wdc0:0:0: command=0xec cylin=0 head=160 sector=0 count=0 
> features=0
>   wdcintr
>   __wdccommand_intr wdc0:0:0
>   __wdcwait wdc0:0
>   __wdccommand_done wdc0:0:0 flags 0x49
>   wd0: <TRANSCEND>
>   wd0: 488 MB, 993 cyl, 16 head, 63 sec, 512 bytes/sect x 1000944 sectors
>   wd0: atap_dmatiming_mimi=0, atap_dmatiming_recom=0
>   ata_get_params
>   wdc_exec_command wdc0:0:0
>   ata_exec_xfer 0x87d00f88 channel 0 drive 0
>   atastart from ata_exec_xfer, flags 0x0
>   atastart: xfer 0x87d00f88 channel 0 drive 0
>   __wdccommand_start wdc0:0:0
>   __wdcwait wdc0:0
>   wdccommand wdc0:0:0: command=0xec cylin=0 head=160 sector=0 count=0 
> features=0
>   wdcintr
>   __wdccommand_intr wdc0:0:0
>   __wdcwait wdc0:0
>   __wdccommand_done wdc0:0:0 flags 0x49
>   ata_get_params
>   wdc_exec_command wdc0:0:0
>   ata_exec_xfer 0x87d00f88 channel 0 drive 0
>   atastart from ata_exec_xfer, flags 0x0
>   atastart: xfer 0x87d00f88 channel 0 drive 0
>   __wdccommand_start wdc0:0:0
>   __wdcwait wdc0:0
>   wdccommand wdc0:0:0: command=0xec cylin=0 head=160 sector=0 count=0 
> features=0
>   wdcintr
>   __wdccommand_intr wdc0:0:0
>   __wdcwait wdc0:0
>   __wdccommand_done wdc0:0:0 flags 0x49
> 
>   <..snip..>
> 
>   root on wd0a dumps on wd0b
>   wdsize
>   wdopen
>   ata_get_params
>   wdc_exec_command wdc0:0:0
>   ata_exec_xfer 0x87d00f88 channel 0 drive 0
>   atastart from ata_exec_xfer, flags 0x0
>   atastart: xfer 0x87d00f88 channel 0 drive 0
>   __wdccommand_start wdc0:0:0
>   __wdcwait wdc0:0
>   __wdcwait: timeout (time=11), status 58 error 0 (mask 0x48 bits 0x40)
>   __wdccommand_start wdc0:0:0
>   __wdcwait wdc0:0
>   __wdcwait: timeout (time=11), status 58 error 0 (mask 0x48 bits 0x40)
>   __wdcwait wdc0:0
>   __wdcwait: timeout (time=11), status 58 error 0 (mask 0x48 bits 0x40)
> 
>   : (repeat x300 last 2-lines) 
> 
>   __wdccommand_done wdc0:0:0 flags 0x109
>   ata_get_parms: ata_c.flags=0x129
>   wd0: IDENTIFY failed
>   wdopen
>   ata_get_params
>   wdc_exec_command wdc0:0:0
>   ata_exec_xfer 0x87d00f88 channel 0 drive 0
>   atastart from ata_exec_xfer, flags 0x0
>   atastart: xfer 0x87d00f88 channel 0 drive 0
>   __wdccommand_start wdc0:0:0
>   __wdcwait wdc0:0
>   __wdcwait: timeout (time=11), status 58 error 0 (mask 0x48 bits 0x40)
>   __wdccommand_start wdc0:0:0
>   __wdcwait wdc0:0
>   __wdcwait: timeout (time=11), status 58 error 0 (mask 0x48 bits 0x40)
> 
>   : (repeat x300 last 2-lines) 
> 
>   __wdccommand_done wdc0:0:0 flags 0x109
>   ata_get_parms: ata_c.flags=0x129
>   wd0: IDENTIFY failed
>   vfs_mountroot: can't open root device
>   cannot mount root, error = 5
> 
> 
> hmm...
> My OMSAL400 is wrong? or ata and wd?
> I avoid this problem with following change.  This lines added at 20120802.
> Please help anyone.  X-<

I understand this reason.
This wdc is 'i/o mapped' and not 32bit mode.
I avoid this problem with following change now.

Index: ata/ata.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ata/ata.c,v
retrieving revision 1.126
diff -u -r1.126 ata.c
--- ata/ata.c   1 Nov 2012 13:46:52 -0000       1.126
+++ ata/ata.c   15 Dec 2012 10:33:20 -0000
@@ -1314,6 +1314,23 @@
                        s = splbio();
                        drvp->drive_flags &= ~ATA_DRIVE_CAP32;
                        splx(s);
+
+                       /*
+                        * We have to drain away 256 bytes of remaining data. 
+                        * Until DRQ is probably deasserted. 
+                        */
+                       {
+
+                               struct wdc_softc *wdc = CHAN_TO_WDC(chp);
+                               u_int16_t drive_flags = drvp->drive_flags;
+                               char *buf = kmem_zalloc(DEV_BSIZE, KM_SLEEP);
+
+printf("%s: Oops: drain IDENTIFY data\n", __func__);
+                               drive_flags |= ATA_DRIVE_NOSTREAM;
+                               wdc->datain_pio(chp, drive_flags,
+                                   buf, DEV_BSIZE);
+                               kmem_free(buf, DEV_BSIZE);
+                       }
                } else {
                        aprint_verbose_dev(drv_dev, "32-bit data port\n");
                }


Maybe need more smart resolution.  Shall we add drain function to
'struct ata_bustype'?

Thanks,
--
kiyohara


Home | Main Index | Thread Index | Old Index