Date: Sun, 28 Sep 2008 17:36:03 -0700 From: Jeremy Chadwick <koitsu@FreeBSD.org> To: Bruce Cran <bruce@cran.org.uk> Cc: freebsd-hackers@freebsd.org, Andrey Elsukov <bu7cher@yandex.ru>, Pegasus McCleaft <ken@hercules.mthelicon.com>, sos@freebsd.org Subject: Re: atacontrol broken in 7.1-PR Message-ID: <20080929003603.GA92998@icarus.home.lan> In-Reply-To: <20080929000226.GA92057@icarus.home.lan> References: <20080928103937.U51561@hercules.mthelicon.com> <20080928232438.5d0c4a55@tau.draftnet> <20080929000226.GA92057@icarus.home.lan>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <ken@hercules.mthelicon.com> 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: <SiI SiI 3132 SATA300 controller> > > > atapci1: <JMicron JMB363 SATA300 controller> > > > > I'm also seeing this problem on my amd64 7.1-PRERELEASE system: > > > > > atacontrol list > > ATA channel 0: > > Master: acd0 <HL-DT-ST DVD+/-RW GSA-T11N/A102> 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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080929003603.GA92998>