From owner-freebsd-current@FreeBSD.ORG Sun Dec 28 21:36:21 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DF95416A4CE; Sun, 28 Dec 2003 21:36:20 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7872543D1D; Sun, 28 Dec 2003 21:36:18 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id QAA02594; Mon, 29 Dec 2003 16:36:15 +1100 Date: Mon, 29 Dec 2003 16:36:13 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: current@freebsd.org Message-ID: <20031229160809.I2822@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: slow probe for ata channel with only an atapi master on it X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Dec 2003 05:36:21 -0000 Probing for a nonexistent slave on ata1 now takes 31+epsilon seconds in -current. The master is a cdrom burner () jumpered as a master: %%% ata1: reset tp1 mask=03 ostat0=50 ostat1=01 ata1-master: stat=0x00 err=0x01 lsb=0x14 msb=0xeb ata1-slave: stat=0x01 err=0x00 lsb=0x00 msb=0x00 [... 310 - 2 = 308 more of these deleted] ata1-slave: stat=0x01 err=0x00 lsb=0x00 msb=0x00 ata1: reset tp2 mask=01 stat0=00 stat1=81 devices=0x4 ata1: at 0x170 irq 15 on atapci0 ata1: [MPSAFE] %%% This is because the slave status is always 1 and ata_reset() doesn't understand this. Another channel with an atapi slave only works a bit better, although this setup is outside of the ata spec: %%% atapci1: port 0xbc00-0xbcff,0xb800-0xb803,0xb400-0xb407 irq 11 at device 19.0 on pci0 atapci1: [MPSAFE] ata2: reset tp1 mask=03 ostat0=7f ostat1=50 ata2-master: stat=0x7f err=0x7f lsb=0x7f msb=0x7f ata2-master: stat=0x7f err=0x7f lsb=0x7f msb=0x7f ata2-master: stat=0x7f err=0x7f lsb=0x7f msb=0x7f ata2-master: stat=0x7f err=0x7f lsb=0x7f msb=0x7f ata2-master: stat=0x7f err=0x7f lsb=0x7f msb=0x7f ata2-master: stat=0x7f err=0x7f lsb=0x7f msb=0x7f ata2-master: stat=0x7f err=0x7f lsb=0x7f msb=0x7f ata2-master: stat=0x7f err=0x7f lsb=0x7f msb=0x7f ata2-master: stat=0x7f err=0x7f lsb=0x7f msb=0x7f ata2-master: stat=0x7f err=0x7f lsb=0x7f msb=0x7f ata2-master: stat=0x7f err=0x7f lsb=0x7f msb=0x7f ata2-master: stat=0x7f err=0x7f lsb=0x7f msb=0x7f ata2-master: stat=0x7f err=0x7f lsb=0x7f msb=0x7f ata2-master: stat=0x7f err=0x7f lsb=0x7f msb=0x7f ata2-master: stat=0x7f err=0x7f lsb=0x7f msb=0x7f ata2-master: stat=0x7f err=0x7f lsb=0x7f msb=0x7f ata2-master: stat=0x7f err=0x7f lsb=0x7f msb=0x7f ata2-master: stat=0x7f err=0x7f lsb=0x7f msb=0x7f ata2-master: stat=0x7f err=0x7f lsb=0x7f msb=0x7f ata2-master: stat=0x7f err=0x7f lsb=0x7f msb=0x7f ata2-master: stat=0x7f err=0x7f lsb=0x7f msb=0x7f ata2-master: stat=0x7f err=0x7f lsb=0x7f msb=0x7f ata2-master: stat=0x7f err=0x7f lsb=0x7f msb=0x7f ata2-slave: stat=0x00 err=0x01 lsb=0x14 msb=0xeb ata2: reset tp2 mask=02 stat0=ff stat1=00 devices=0x8 ata2: at 0xb400 on atapci1 ata2: [MPSAFE] %%% Here it takes 23 status reports to time out the master. I think 23 is from the magic 20 in the code (don't know why it is 3 more). These problems are missing in my version. It trusts the busy bits and decides that the nonexistent device is not there immediately after both the busy bits become clear, which happens after just 1 or 2 iterations of the loop (with a delay of 10 msec instead of 100 msec between the iterations). %%% ata1: reset tp1 mask=03 ostat0=50 ostat1=01 ata1: master @1.038311: d0 00 00 02; slave @1.038334: 01 00 00 00 [^^^^^^^^ uptime when we read the registers] ata1: master @1.038826: 00 01 14 eb; slave @1.038848: 01 00 00 00 ata1-master: stat=0x00 err=0x01 lsb=0x14 msb=0xeb ata1-slave: stat=0x01 err=0x00 lsb=0x00 msb=0x00 ata1: reset tp2 mask=03 stat0=00 stat1=01 devices=0x4 ^^ not adjusted since it doesn't affect the loop in my version ata1: at 0x170 irq 15 on atapci0 ata1: [MPSAFE] ... atapci1: port 0xbc00-0xbcff,0xb800-0xb803,0xb400-0xb407 irq 11 at device 19.0 on pci0 atapci1: [MPSAFE] ata2: reset tp1 mask=03 ostat0=7f ostat1=50 ata2: master @1.060667: 7f 7f 7f 7f; slave @1.060696: 00 01 14 eb ata2-master: stat=0x7f err=0x7f lsb=0x7f msb=0x7f ata2-slave: stat=0x00 err=0x01 lsb=0x14 msb=0xeb ata2: reset tp2 mask=03 stat0=7f stat1=00 devices=0x8 ata2: at 0xb400 on atapci1 ata2: [MPSAFE] %%% Bruce