Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Jul 2008 11:28:45 +0900
From:      "Munenori Ohuchi" <ohuchi@iij.ad.jp>
To:        <freebsd-stable@freebsd.org>
Cc:        Munenori Ohuchi <ohuchi@iij.ad.jp>
Subject:   Re: MCP55 SATA data corruption in FreeBSD 7
Message-ID:  <021501c8ed35$0053a330$47a8a8c0@iij.ad.jp>

next in thread | raw e-mail | index | archive | help
Hi Daniel,

Could you try the following patch?
You can apply this patch in freebsd 7.0 just by copying and
pasting to your shell.

Before you apply this patch, you can check as follows 
if this works on your environment or not.

1. Set bootverbose mode.

cat >> /boot/loader.conf << EOF
boot_verbose="YES"
EOF

2. Reboot your machine.
3. Check the dmesg log of your HDDs as follows.

dmesg | grep ata
     .
     .
ata2-master: pio=PIO4 wdma=WDMA2 udma=UDMA100 cable=40 wire
                                 ^^^^^^^^^^^^
ad4: 115328MB <Super Talent Tech 02.10103> at ata2-master SATA150
ata3-master: pio=PIO4 wdma=WDMA2 udma=UDMA133 cable=40 wire
ad6: 953869MB <Hitachi HDS721010KLA330 GKAOA51D> at ata3-master SATA150

If you have a device like 'ad4' which is detected as 
'udma=UDMA100', this patch will work.

------------------------patch start----------------------------
cd /usr/src/sys/dev/ata
cat> ata-chipset.c.patch <<EOF
--- ata-chipset.c.orig  2008-04-02 00:20:49.000000000 +0900
+++ ata-chipset.c       2008-07-18 19:15:24.000000000 +0900
@@ -377,6 +377,7 @@
 ata_sata_setmode(device_t dev, int mode)
 {
     struct ata_device *atadev = device_get_softc(dev);
+    struct ata_params *atacap = &atadev->param;

     /*
      * if we detect that the device isn't a real SATA device we limit
@@ -390,7 +391,7 @@

        /* on some drives we need to set the transfer mode */
        ata_controlcmd(dev, ATA_SETFEATURES, ATA_SF_SETXFER, 0,
-                      ata_limit_mode(dev, mode, ATA_UDMA6));
+                      ata_limit_mode(dev, mode, ata_umode(atacap)));

        /* query SATA STATUS for the speed */
         if (ch->r_io[ATA_SSTATUS].res &&
EOF

patch -l < ata-chipset.c.patch
------------------------patch end----------------------------

Best regards,
--
Munenori Ohuchi <ohuchi@iij.ad.jp>
Internet Initiative Japan Inc.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?021501c8ed35$0053a330$47a8a8c0>