From owner-freebsd-bugs@freebsd.org Sun Apr 21 14:12:06 2019 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FE66158E29C for ; Sun, 21 Apr 2019 14:12:06 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id D6335732EC for ; Sun, 21 Apr 2019 14:12:05 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: by mailman.ysv.freebsd.org (Postfix) id 96C5E158E29A; Sun, 21 Apr 2019 14:12:05 +0000 (UTC) Delivered-To: bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73044158E299 for ; Sun, 21 Apr 2019 14:12:05 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id BA1C9732E7 for ; Sun, 21 Apr 2019 14:12:04 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 216B54393EF; Mon, 22 Apr 2019 00:11:54 +1000 (AEST) Date: Mon, 22 Apr 2019 00:11:53 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: cab902@yahoo.com cc: bugs@freebsd.org Subject: Re: [Bug 202712] [cam] [ata] System doesn't recognize older hdd after boot In-Reply-To: Message-ID: <20190421234658.Y4866@besplex.bde.org> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=EqjOSCm-z1nmtPiAGewA:9 a=9HM3v3GA__yrzYc2:21 a=SosL6k-6dDdMXu4x:21 a=CjuIK1q_8ugA:10 a=ub_s37QjJTwA:10 a=baY2OIHTYzEA:10 a=IjZwj45LgO3ly-622nXo:22 X-Rspamd-Queue-Id: BA1C9732E7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2019 14:12:06 -0000 On Sun, 21 Apr 2019 a bug that doesn't want replies@freebsd.org wrote: > Created attachment 203861 > --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=203861&action=edit > dmesg log with 8.4 livefs disk > > I've booted the FreeBSD 8.4 livefs disk. > > Disk is correctly configured: > ad3: FAILURE - SETFEATURES SET TRANSFER MODE status=51 > error=4 > ad3: 405MB at ata1-slave WDMA1 > > I've succesfuly mounted the partition: > Filesystem 1K-blocks Used Avail Capacity Mounted on > /dev/md0 4175 3169 1006 76% / > devfs 1 1 0 100% /dev > /dev/acd0 276142 276142 0 100% /dist > /dev/ad3s1d 402150 367694 2284 99% /mnt > > I've succesfuly read all the files on the partition: > find /mnt -type f -exec cat '{}' > /dev/zero ';' > > There was no READ_DMA errors, nor errors of any kind. Any drive as small as that might only support CHS addressing. I have one of a similar size that was new in ~1993. It worked for about 20 years until it was broken in 2013 by dropping support for CHS addressing in r249083. The support was under ATA_CAM, and the main point of r249083 was to remove support for ATA_CAM. FreeBSD-9 still has this support, but FreeBSD-10 doesn't. -current still defines the flag ATA_D_USE_CHS for using this support, but never uses it. The error messages from not detecting the non-support for LBA addressing might be cryptic. I don't have the old system with this drive online for testing. My mail in 2015 to report this gives some boot messages: 2015> On a 15 year old system with 15+ year old drive and a 20+ year old drive, 2015> the 15+ year old drive still works, but the 20+ year old drive fails: 2015> 2015> X atapci0: port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xf000-0xf00f at device 7.1 on pci0 2015> X ata0: at channel 0 on atapci0 2015> X ata1: at channel 1 on atapci0 2015> X uhub0: on usbus0 2015> X ada0 at ata1 bus 0 scbus1 target 0 lun 0 2015> X ada0: ATA-0 device 2015> X ada0: Serial Number 462412383105 2015> X ada0: 4.200MB/s transfers (WDMA0, PIO 8192bytes) 2015> X ada0: 407MB (833664 512 byte sectors: 16H 52S/T 1002C) 2015> 2015> This drive fails. It is still identified. I found my old patches which 2015> say that WDMA0 mode doesn't work for writing. It works for reading. 2015> Apparently the probe detects more errors now, but it shouldn't do any 2015> writing. 2015> 2015> The newest kernel that I have on which the drive seems works correctly 2015> is FreeBSD-8. But I had forgotten the details, and only did read-only 2015> tests of this today. 2015> 2015> In some versions of FreeBSD, I changed the mode from WDMA0 to PIO4 in 2015> /etc/rc.early. I stopped doing this because I have a better local fix 2015> (in the patches) and this system is only used for testing and it 2015> atacontrol's binary compatibility keeps breaking (I use mostly FreeBSD-5 2015> utilities with kernels between FreeBSD-4 and -current). 2015> 2015> X ada0: Previously was known as ad2 2015> X ada1 at ata0 bus 0 scbus2 target 0 lun 0 2015> X ada1: ATA-3 device 2015> X ada1: Serial Number 156726945059 2015> X ada1: 33.300MB/s transfers (UDMA2, PIO 8192bytes) 2015> X ada1: 6149MB (12594960 512 byte sectors: 15H 63S/T 13328C) 2015> X ada1: Previously was known as ad0 2015> X 2015> X (ada0:ata1:0:0:0): READ_DMA. ACB: c8 00 00 00 00 40 00 00 00 00 01 00 2015> X (ada0:ata1:0:0:0): CAM status: ATA Status Error 2015> X (ada0:ata1:0:0:0): ATA status: 59 (DRDY SERV DRQ ERR), error: 04 (ABRT ) 2015> X (ada0:ata1:0:0:0): RES: 59 04 00 00 00 00 00 00 00 01 00 2015> X (ada0:ata1:0:0:0): Retrying command 2015> X (ada0:ata1:0:0:0): READ_DMA. ACB: c8 00 00 00 00 40 00 00 00 00 01 00 2015> X (ada0:ata1:0:0:0): CAM status: ATA Status Error 2015> X (ada0:ata1:0:0:0): ATA status: 59 (DRDY SERV DRQ ERR), error: 04 (ABRT ) 2015> X (ada0:ata1:0:0:0): RES: 59 04 00 00 00 00 00 00 00 01 00 2015> X (ada0:ata1:0:0:0): Retrying command 2015> X (ada0:ata1:0:0:0): READ_DMA. ACB: c8 00 00 00 00 40 00 00 00 00 01 00 2015> X (ada0:ata1:0:0:0): CAM status: ATA Status Error 2015> X (ada0:ata1:0:0:0): ATA status: 59 (DRDY SERV DRQ ERR), error: 04 (ABRT ) 2015> X (ada0:ata1:0:0:0): RES: 59 04 00 00 00 00 00 00 00 01 00 2015> X (ada0:ata1:0:0:0): Retrying command 2015> X (ada0:ata1:0:0:0): READ_DMA. ACB: c8 00 00 00 00 40 00 00 00 00 01 00 2015> X (ada0:ata1:0:0:0): CAM status: ATA Status Error 2015> X (ada0:ata1:0:0:0): ATA status: 59 (DRDY SERV DRQ ERR), error: 04 (ABRT ) 2015> X (ada0:ata1:0:0:0): RES: 59 04 00 00 00 00 00 00 00 01 00 2015> X (ada0:ata1:0:0:0): Retrying command 2015> X (ada0:ata1:0:0:0): READ_DMA. ACB: c8 00 00 00 00 40 00 00 00 00 01 00 2015> X (ada0:ata1:0:0:0): CAM status: ATA Status Error 2015> X (ada0:ata1:0:0:0): ATA status: 59 (DRDY SERV DRQ ERR), error: 04 (ABRT ) 2015> X (ada0:ata1:0:0:0): RES: 59 04 00 00 00 00 00 00 00 01 00 2015> X (ada0:ata1:0:0:0): Error 5, Retries exhausted 2015> X (ada0:ata1:0:0:0): READ_DMA. ACB: c8 00 00 00 00 40 00 00 00 00 01 00 2015> X (ada0:ata1:0:0:0): CAM status: ATA Status Error 2015> X (ada0:ata1:0:0:0): ATA status: 59 (DRDY SERV DRQ ERR), error: 04 (ABRT ) 2015> X (ada0:ata1:0:0:0): RES: 59 04 00 00 00 00 00 00 00 01 00 2015> X (ada0:ata1:0:0:0): Retrying command 2015> X (ada0:ata1:0:0:0): READ_DMA. ACB: c8 00 00 00 00 40 00 00 00 00 01 00 2015> X (ada0:ata1:0:0:0): CAM status: ATA Status Error 2015> X (ada0:ata1:0:0:0): ATA status: 59 (DRDY SERV DRQ ERR), error: 04 (ABRT ) 2015> X (ada0:ata1:0:0:0): RES: 59 04 00 00 00 00 00 00 00 01 00 2015> X (ada0:ata1:0:0:0): Retrying command 2015> X (ada0:ata1:0:0:0): READ_DMA. ACB: c8 00 00 00 00 40 00 00 00 00 01 00 2015> X (ada0:ata1:0:0:0): CAM status: ATA Status Error 2015> X (ada0:ata1:0:0:0): ATA status: 59 (DRDY SERV DRQ ERR), error: 04 (ABRT ) 2015> X (ada0:ata1:0:0:0): RES: 59 04 00 00 00 00 00 00 00 01 00 2015> X (ada0:ata1:0:0:0): Retrying command 2015> X (ada0:ata1:0:0:0): READ_DMA. ACB: c8 00 00 00 00 40 00 00 00 00 01 00 2015> X (ada0:ata1:0:0:0): CAM status: ATA Status Error 2015> X (ada0:ata1:0:0:0): ATA status: 59 (DRDY SERV DRQ ERR), error: 04 (ABRT ) 2015> X (ada0:ata1:0:0:0): RES: 59 04 00 00 00 00 00 00 00 01 00 2015> X (ada0:ata1:0:0:0): Retrying command 2015> X (ada0:ata1:0:0:0): READ_DMA. ACB: c8 00 00 00 00 40 00 00 00 00 01 00 2015> X (ada0:ata1:0:0:0): CAM status: ATA Status Error 2015> X (ada0:ata1:0:0:0): ATA status: 59 (DRDY SERV DRQ ERR), error: 04 (ABRT ) 2015> X (ada0:ata1:0:0:0): RES: 59 04 00 00 00 00 00 00 00 01 00 2015> X (ada0:ata1:0:0:0): Error 5, Retries exhausted Lots of retries, but it times out. If the DMA worked, that would be worse since it is for a wrong sector. 2015> 2015> It does look like just a mode error. 2015> 2015> This is before mountroot. FreeBSD-10 only fails later in fsck -p 2015> (where it opens the device r/w but shouldn't write anything), and 2015> doesn't print anything in the kernel. Perhaps because it wasn't 2015> attached to cam then? Bruce