From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 29 00:36:08 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52C34106568E for ; Mon, 29 Sep 2008 00:36:08 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from QMTA07.westchester.pa.mail.comcast.net (qmta07.westchester.pa.mail.comcast.net [76.96.62.64]) by mx1.freebsd.org (Postfix) with ESMTP id EEE3F8FC17 for ; Mon, 29 Sep 2008 00:36:07 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from OMTA14.westchester.pa.mail.comcast.net ([76.96.62.60]) by QMTA07.westchester.pa.mail.comcast.net with comcast id LMKz1a00M1HzFnQ57Qc7WA; Mon, 29 Sep 2008 00:36:07 +0000 Received: from koitsu.dyndns.org ([67.180.253.227]) by OMTA14.westchester.pa.mail.comcast.net with comcast id LQc41a0034v8bD73aQc6NC; Mon, 29 Sep 2008 00:36:07 +0000 X-Authority-Analysis: v=1.0 c=1 a=QycZ5dHgAAAA:8 a=LQHkYGk4adzdkpo2lpcA:9 a=GWd5yspbnJxFYAxDkecA:7 a=UzX7D9WwCzImeTTZ7PUdjpkvkzMA:4 a=EoioJ0NPDVgA:10 a=LY0hPdMaydYA:10 Received: by icarus.home.lan (Postfix, from userid 1000) id BFE4CC9432; Sun, 28 Sep 2008 17:36:03 -0700 (PDT) Date: Sun, 28 Sep 2008 17:36:03 -0700 From: Jeremy Chadwick To: Bruce Cran Message-ID: <20080929003603.GA92998@icarus.home.lan> References: <20080928103937.U51561@hercules.mthelicon.com> <20080928232438.5d0c4a55@tau.draftnet> <20080929000226.GA92057@icarus.home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080929000226.GA92057@icarus.home.lan> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-hackers@freebsd.org, Andrey Elsukov , Pegasus McCleaft , sos@freebsd.org Subject: Re: atacontrol broken in 7.1-PR X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Sep 2008 00:36:08 -0000 On Sun, Sep 28, 2008 at 05:02:26PM -0700, Jeremy Chadwick wrote: > On Sun, Sep 28, 2008 at 11:24:38PM +0100, Bruce Cran wrote: > > On Sun, 28 Sep 2008 10:43:58 +0000 (UTC) > > Pegasus McCleaft wrote: > > > > > Hello everyone. > > > > > > I was wondering if anyone else is experiencing this problem. > > > I have recently reloaded my machine (due to a meltdown of my primary > > > boot drive) and noticed that under 7.0-rel the atacontrol command > > > seems to work great, however, under 7.1 I get and error > > > > > > atacontrol: ioctl(IOCATADEVICES): Device not configured > > > > > > Has anyone else seen this error. I wouldent be conserned if > > > it wasent for the fact that it worked under 7.0-rel but now dosent. > > > The machine is using both the: > > > > > > atapci0: > > > atapci1: > > > > I'm also seeing this problem on my amd64 7.1-PRERELEASE system: > > > > > atacontrol list > > ATA channel 0: > > Master: acd0 ATA/ATAPI revision 5 > > Slave: no device present > > atacontrol: ioctl(IOCATADEVICES): Device not configured > > > > I've attached the dmesg, and truss output from "atacontrol list". > > Your dmesg output implies you're not using atapicam, while Pegasus is. > So I believe that rules that out. > > Are you using ATA_STATIC_ID? If not, then I'm out of "simple" ideas as > to what could be causing this. > > > open("/dev/ata",O_RDWR,037777766320) = 3 (0x3) > > ioctl(3,IOCATAGMAXCHANNEL,0xffffec20) = 0 (0x0) > > ioctl(3,IOCATADEVICES,0xffffe590) = 0 (0x0) > > fstat(1,{ mode=-rw-r--r-- ,inode=307828,size=2281,blksize=4096 }) = 0 (0x0) > > __sysctl(0x7fffffffdba0,0x2,0x800845b48,0x7fffffffdbb8,0x0,0x0) = 0 (0x0) > > __sysctl(0x7fffffffd6f0,0x2,0x8008547d8,0x7fffffffd6e8,0x0,0x0) = 0 (0x0) > > __sysctl(0x7fffffffd730,0x2,0x7fffffffd74c,0x7fffffffd740,0x0,0x0) = 0 (0x0) > > readlink("/etc/malloc.conf",0x7fffffffd790,1024) ERR#2 'No such file or directory' > > issetugid(0x80071c2aa,0x7fffffffd790,0xffffffffffffffff,0x0,0xffffffff80ac1c40,0x7fffffffd768) = 0 (0x0) > > break(0x600000) = 0 (0x0) > > break(0x700000) = 0 (0x0) > > ioctl(3,IOCATADEVICES,0xffffe590) ERR#6 'Device not configured' > > I've snipped the truss output to the relevant piece. > > fd 3 points to /dev/ata, and there are no man pages which document > the IOCATADEVICES ioctl. I'll have to look at the source. Bruce and Pegasus, Can you please apply the below patch to src/sbin/atacontrol.c and let me know what the output is when doing "atacontrol list"? This won't solve the problem, but it will help in determining which piece of code in src/sys/dev/ata/ata-all.c is returning an error to ioctl() (different pieces of the code return different errors, either ENXIO, ENODEV, or another error depending upon what gets returned from ata_raid_ioctl_func()). Thanks. -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB | --- atacontrol.c.orig 2008-04-08 03:48:20.000000000 -0700 +++ atacontrol.c 2008-09-28 17:32:39.000000000 -0700 @@ -261,12 +261,14 @@ static void info_print(int fd, int channel, int prchan) { + int ret; struct ata_ioc_devices devices; devices.channel = channel; - if (ioctl(fd, IOCATADEVICES, &devices) < 0) - err(1, "ioctl(IOCATADEVICES)"); + if ((ret = ioctl(fd, IOCATADEVICES, &devices)) < 0) { + err(1, "ioctl(IOCATADEVICES) returned %d", ret); + } if (prchan) printf("ATA channel %d:\n", channel);