From owner-freebsd-questions Tue Nov 25 15:54:27 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id PAA18349 for questions-outgoing; Tue, 25 Nov 1997 15:54:27 -0800 (PST) (envelope-from owner-freebsd-questions) Received: from cygnet.camelot.com (cygnet.camelot.com [192.55.203.137] (may be forged)) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id PAA18341 for ; Tue, 25 Nov 1997 15:54:22 -0800 (PST) (envelope-from cjohnson@camelot.com) Received: from localhost (cjohnson@localhost) by cygnet.camelot.com (8.8.5/8.8.5) with SMTP id TAA05462; Tue, 25 Nov 1997 19:03:39 -0500 (EST) Date: Tue, 25 Nov 1997 19:03:38 -0500 (EST) From: "Christopher T. Johnson" To: "Christopher T. Johnson" cc: questions@freebsd.org Subject: Re: NCR 810a breaks AMANDA, help please In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Tue, 25 Nov 1997, Christopher T. Johnson wrote: > Date: Tue, 25 Nov 1997 15:29:54 -0500 (EST) > From: "Christopher T. Johnson" > To: questions@freebsd.org > Subject: NCR 810a breaks AMANDA, help please > > Because one of our new computers needs an ISA scsi card, on Friday I > decided to upgrade my computer from an Adaptec 1542CP to an NCR > controller. The controller I ended up with is an ASUS SC-200 which is > recogonized as an NCR 53c810a. All well and good. > > I'm running FreeBSD Current as of Monday night. > > Once I installed the 810, disk response seemed to be much more responsive > but my amflush died. There are days when it does not pay to get up in the morning... The error or is: rewinding...[input/output error.] or equivlent. errno=5 on the IOCTL to do the rewind after the O_WRONLY Chris > > The following test code will cause the same error to occur: > ---------------------------------- > #include > #include > #include > > main() > { > struct mtop mt; > int result; > int tapefd; > #define BUFFER_SIZE (32*1024) > char buffer[BUFFER_SIZE]; > > fprintf(stderr,"We is here.\n"); > > tapefd = open("/dev/nrst0", O_RDONLY); > if (tapefd < 0) { > perror("open"); > } > printstatus(tapefd); > > fprintf(stderr,"Rewind 1.\n"); > mt.mt_op = MTREW; > mt.mt_count = 1; > result = ioctl(tapefd, MTIOCTOP, &mt); > if (result < 0) { > perror("rewind 1"); > } > > printstatus(tapefd); > result = close(tapefd); > if (result) { > perror("close 1"); > } > > fprintf(stdout,"closed, now opening WRONLY\n"); > > tapefd = open("/dev/nrst0", O_WRONLY); > if (tapefd < 0) { > perror("open 2"); > } > printstatus(tapefd); > fprintf(stderr,"Rewind 1.\n"); > mt.mt_op = MTREW; > mt.mt_count = 1; > result = ioctl(tapefd, MTIOCTOP, &mt); > if (result < 0) { > perror("rewind 1"); > } > printstatus(tapefd); > > memset(buffer, '\0', BUFFER_SIZE); > sprintf(buffer, "AMANDA: TAPESTART DATE %s TAPE %s\n\014\n", > "X", "NET024"); > result = write(tapefd, buffer, BUFFER_SIZE); > if (result != BUFFER_SIZE) { > if (result > 0) { > perror("short write"); > } > } > printstatus(tapefd); > result = close(tapefd); > if (result) { > perror("close"); > } > fprintf(stderr,"We're out of here....\n"); > return 0; > } > printstatus(int fd) > { > struct mtget status; > int result; > result = ioctl(fd, MTIOCGET, &status); > if (result) { > perror("ioctl MTIOCGET"); > } > fprintf(stdout,"mt_type = 0x%x\nmt_dsreg = 0x%x\nmt_erreg = 0x%x\n", > status.mt_type, status.mt_dsreg, status.mt_erreg); > } > > ------------------------ > > I replaced the NCR card with the 1542 and the problem went away. Went > back to the NCR for more debugging. > > Here is what scsi says is the sense status after a rewind failure. > > ------------------------- > scsi -f /dev/rst0.ctl -c "03 00 00 00 20 00" -i 32 - |\ > hexdump -C > 00000000 70 00 00 00 00 7f ff 12 00 00 00 00 00 00 00 00 |p...............| > 00000010 00 00 00 00 00 00 00 22 f3 b1 00 00 00 00 00 00 |......."........| > -------------------------- > The command has also responeded as: > 00000000 70 00 00 00 ff ff ff 12 00 00 00 00 00 00 00 00 |p...............| > 00000010 00 00 00 00 00 00 00 22 f3 b1 00 00 00 00 00 00 |......."........| > > > Here is the results of the inquire: > scsi -f /dev/rst0.ctl -c "12 0 0 0 40 0" -i 64 "s8 z8 z16 z4" > EXABYTE EXB-8200 252X > > ------------ > > For grins, I modified the NCR driver so that the 53c810a was treated > just like it was a 53c810 as far as features was concerned, this made > no difference. > > ------------------- > > > Oh, the other reason I want to get away from the ADAPTEC card, it > gives me DMA beyond ISA range error messages often. > > Often enough that I'm willing to take a few dumps of the system for > anybody that wants to debug the aha driver. > > Thanks in advance... > Christopher T. Johnson > P.S. I'm running 3 weeks behind on my freebsd lists, please cc a copy > of any response to my e-mail address, thanks. > >