From owner-freebsd-current@FreeBSD.ORG Mon Jan 5 01:02:32 2004 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 6275016A4CE for ; Mon, 5 Jan 2004 01:02:32 -0800 (PST) Received: from eva.fit.vutbr.cz (eva.fit.vutbr.cz [147.229.10.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1A16643D2F for ; Mon, 5 Jan 2004 01:02:30 -0800 (PST) (envelope-from xdivac02@stud.fit.vutbr.cz) Received: from eva.fit.vutbr.cz (localhost [127.0.0.1]) by eva.fit.vutbr.cz (8.12.10/8.12.9) with ESMTP id i0592RYH045179 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 5 Jan 2004 10:02:27 +0100 (CET) Received: (from xdivac02@localhost) by eva.fit.vutbr.cz (8.12.10/8.12.5/Submit) id i0592RLo045178 for current@freebsd.org; Mon, 5 Jan 2004 10:02:27 +0100 (CET) Date: Mon, 5 Jan 2004 10:02:27 +0100 From: Divacky Roman To: current@freebsd.org Message-ID: <20040105090227.GA44306@stud.fit.vutbr.cz> References: <20031229160809.I2822@gamplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031229160809.I2822@gamplex.bde.org> User-Agent: Mutt/1.4.1i X-Scanned-By: MIMEDefang 2.16 (www . roaringpenguin . com / mimedefang) Subject: Re: 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, 05 Jan 2004 09:02:32 -0000 On Mon, Dec 29, 2003 at 04:36:13PM +1100, Bruce Evans wrote: > 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 I have something similar but with different numbers of stat and error stat=0x50 err=0x50 lsb=0x50 msb=0x50 something should be added to ata_reset to understand this