atacontrol broken in 7.1-PR
Jeremy Chadwick
koitsu at FreeBSD.org
Mon Sep 29 00:36:08 UTC 2008
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 at 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);
More information about the freebsd-hackers
mailing list