From owner-freebsd-hackers Tue Sep 10 01:42:16 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id BAA01060 for hackers-outgoing; Tue, 10 Sep 1996 01:42:16 -0700 (PDT) Received: from ns.pa-consulting.com (ns.pa-consulting.com [193.118.224.1]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id BAA01041 for ; Tue, 10 Sep 1996 01:42:08 -0700 (PDT) Received: from SMTPGATE.PA-CONSULTING.COM by ns.pa-consulting.com (8.6.4) id JAA00454; Tue, 10 Sep 1996 09:52:02 +0100 Received: by SMTPGATE.PA-CONSULTING.COM with Microsoft Mail id <32359D14@SMTPGATE.PA-CONSULTING.COM>; Tue, 10 Sep 96 09:53:40 PDT From: Duncan Barclay To: freebsd-hackers Subject: FW: ft0 doesn't work with new motherboard Date: Tue, 10 Sep 96 09:41:00 PDT Message-ID: <32359D14@SMTPGATE.PA-CONSULTING.COM> Encoding: 293 TEXT X-Mailer: Microsoft Mail V3.0 Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk ---------- From: Duncan Barclay To: owner-freebsd-hackers Subject: RE: ft0 doesn't work with new motherboard Date: 09 September 1996 09:13 >Hi all, >Some month ago I upgraded to a Pentium motherboard for my FreeBSD system. >Prior to that change I had been using a Conner floppy tape drive with some >success. After the upgrade ft0 refuses to be recognized, originally I >thought the drive had been damaged in the swap and I took it back to the >store - imagine my embarrasment when the vendor said that it was working >fine, sure enough when I hooked it up and used DOS then the drive is >recognized OK.... FreeBSD is however a different story. >I played around with ft.c to try and dig some more info out, defining >DPRT gives me the following messages at boot. (I also forced a call to >ftreq_hwinfo , thus my comments about a hack...) I think I had a similar problem on my Connor drive. I managed to track the problem down to the seek code bit of the state machine. The time outs dont seem to be long enough for tapes with lots of tracks. My drive worked fine for tracks 0...6 but took longer to seek than the time out in the code. As you have gone a bit faster I guess the spin loops are shorter? The main problem is that the retry code for this event is a bit broken, ie. it doesnt retry! The following is some comments I posted (and sent to bugs using send-pr) a while back. All the diffs refer to 2.1R, but it hasnt changed in 2.1.5R so should work. Duncan After a while the machine appeared to hang (I was in single user mode at the time, however later tests shows the process to be waiting on bdone). As I had hacked /sbin/ft to print the segment number I continued to play a little seeking the tape to that segment and kept getting the hangs. Eventually I discovered that the drive took a little longer than the code waits for to respond when it moves the head a few tracks. Specifics: ACMD_BLOCKIO (or similar) calls ACMD_READID to find out where the head is. ACMD_READID issues read id commands to the drive. If the first read id command returns garbage then ACMD_READID then calls ACMD_SEEKSTS to stop the tape moving. ACMD_SEEKSTS waits for the tape to stop and to become ready, timing out after 10seconds. If this timeout occurs then control goes back to ACMD_READID and ACMD_READID should do a further 4 retries. It doesnot. It hangs. My fix for _my_ tape drive is to up the timeout specified by ACMD_READID in the call to ACMD_SEEKSTS to 90seconds. In fact by drive takes about 12seconds to become ready. THIS IS NOT A REAL FIX. I think that the retry stuff in ACMD_READID is broken (a comment in the header of ft.c seems to indicate that hangs did occur and may have been fixed). I am willing to have ago at fixing this, but: I have never written a device driver. I have no time for 6months. I have no idea how QIC tapes work at the s/w level. The state machine in ft.c is big and it would take a long time to trace out what I need to know. I seem to remember someone saying they were going to maintain this code a while back. Anyway, it seems to work and my backup is done. So tonight 2.1-R from my new CDROM (ATAPI Im afraid...:-)) Thanks Raggy PS., Non of the above is anything to do with whom I work for. *** ft.c Thu Apr 4 16:34:51 1996 --- /cdrom/usr/src/sys/i386/isa/ft.c Mon May 29 18:01:41 1995 *************** *** 91,97 **** /* Enable or disable debugging messages. */ #define FTDBGALL 0 /* 1 if you want everything */ ! /*#define DPRT(a) printf a */ #define DPRT(a) /* Constants private to the driver */ --- 91,97 ---- /* Enable or disable debugging messages. */ #define FTDBGALL 0 /* 1 if you want everything */ ! /*#define DPRT(a) printf a */ #define DPRT(a) /* Constants private to the driver */ *************** *** 161,168 **** { 3, 2, "QIC-500", "307.5/550", 0, 0, 0, 0, 0 }, /* ??? */ { 3, 3, "QIC-500", "295/900", 0, 0, 0, 0, 0 }, /* ??? */ { 3, 4, "QIC-500", "1100/550", 0, 0, 0, 0, 0 }, /* ??? */ ! { 3, 5, "QIC-500", "1100/900", 0, 0, 0, 0, 0 }, /* ??? */ ! { 2,11, "TR-1", "750/550", 36, 369, 11808, 128, 32640 } /* dmlb */ }; #define NGEOM (sizeof(ftgtbl) / sizeof(QIC_Geom)) --- 161,167 ---- { 3, 2, "QIC-500", "307.5/550", 0, 0, 0, 0, 0 }, /* ??? */ { 3, 3, "QIC-500", "295/900", 0, 0, 0, 0, 0 }, /* ??? */ { 3, 4, "QIC-500", "1100/550", 0, 0, 0, 0, 0 }, /* ??? */ ! { 3, 5, "QIC-500", "1100/900", 0, 0, 0, 0, 0 } /* ??? */ }; #define NGEOM (sizeof(ftgtbl) / sizeof(QIC_Geom)) *************** *** 766,772 **** CALL_ACMD(2, ACMD_STATUS, QC_STATUS, 8, 0); case 2: if ((async_ret & async_arg1) != 0) goto complete; - DPRT (("seeksts retry, %d left\n", async_retries-1)); if (--async_retries == 0) { DPRT(("ft%d: acmd_seeksts retries exceeded\n", ftu)); goto complete; --- 765,770 ---- *************** *** 807,813 **** * 4 microstep head back to 0 * 5 fail */ - DPRT (("readid retry number %d\n", errcnt+1)); if (++errcnt >= 5) { DPRT(("ft%d: acmd_readid errcnt exceeded\n", fdcu)); async_ret = -2; --- 805,810 ---- *************** *** 816,825 **** } if (errcnt == 1) { ft->moving = 0; ! CALL_ACMD(4, ACMD_SEEKSTS, QC_STOP, QS_READY, 90); } else { ft->moving = 0; ! CALL_ACMD(4, ACMD_SEEKSTS, QC_STPAUSE, QS_READY, 90); } DPRT(("readid retry %d...\n", errcnt)); async_state = 0; --- 813,822 ---- } if (errcnt == 1) { ft->moving = 0; ! CALL_ACMD(4, ACMD_SEEKSTS, QC_STOP, QS_READY, 0); } else { ft->moving = 0; ! CALL_ACMD(4, ACMD_SEEKSTS, QC_STPAUSE, QS_READY, 0); } DPRT(("readid retry %d...\n", errcnt)); async_state = 0; *************** *** 842,848 **** async_ret = retpos+1; goto complete; case 4: - DPRT (("readid state 4\n")); CALL_ACMD(5, ACMD_SEEK, QC_FORWARD, 0, 0); case 5: ft->moving = 1; --- 839,844 ---- *************** *** 1835,1844 **** * XXX - This doesn't seem to work on my Colorado Jumbo 250... * if it works on your drive, I'd sure like to hear about it. */ ! /* ! * dmlb - But it does work on my Connor Tapestore 800. ! */ ! #if 1 /* Report drive status */ for (sts = -1, tries = 0; sts < 0 && tries < 3; tries++) sts = qic_status(ftu, QC_TSTATUS, 8); --- 1831,1837 ---- * XXX - This doesn't seem to work on my Colorado Jumbo 250... * if it works on your drive, I'd sure like to hear about it. */ ! #if 0 /* Report drive status */ for (sts = -1, tries = 0; sts < 0 && tries < 3; tries++) sts = qic_status(ftu, QC_TSTATUS, 8); *** ftape.h Tue Apr 2 18:11:23 1996 --- /cdrom/usr/src/sys/sys/ftape.h Sat Aug 13 11:52:48 1994 *************** *** 39,45 **** #define QCV_ECCSIZE 3072 /* Bytes ecc eats */ #define QCV_ECCBLKS 3 /* Blocks ecc eats */ #define QCV_NFMT 3 /* Number of tape formats */ ! #define QCV_NLEN 11 /* Number of tape lengths */ #define QCV_HDRMAGIC 0xaa55aa55 /* Magic for header segment */ #define QCV_FSMAGIC 0x33cc33cc /* Magic for fileset */ --- 39,45 ---- #define QCV_ECCSIZE 3072 /* Bytes ecc eats */ #define QCV_ECCBLKS 3 /* Blocks ecc eats */ #define QCV_NFMT 3 /* Number of tape formats */ ! #define QCV_NLEN 5 /* Number of tape lengths */ #define QCV_HDRMAGIC 0xaa55aa55 /* Magic for header segment */ #define QCV_FSMAGIC 0x33cc33cc /* Magic for fileset */ ---------- From: owner-freebsd-hackers To: freebsd-hackers Subject: ft0 doesn't work with new motherboard Date: 07 September 1996 22:04 Hi all, Some month ago I upgraded to a Pentium motherboard for my FreeBSD system. Prior to that change I had been using a Conner floppy tape drive with some success. After the upgrade ft0 refuses to be recognized, originally I thought the drive had been damaged in the swap and I took it back to the store - imagine my embarrasment when the vendor said that it was working fine, sure enough when I hooked it up and used DOS then the drive is recognized OK.... FreeBSD is however a different story. I played around with ft.c to try and dig some more info out, defining DPRT gives me the following messages at boot. (I also forced a call to ftreq_hwinfo , thus my comments about a hack...) tape_start start tape_recal start tape_recal end tape_start end ===> tape_cmd: 6 ft0: bad seek in tape_cmd; pcn = 1 newcn = 6 ft0: bad seek in tape_cmd; pcn = 1 newcn = 6 ft0: bad seek in tape_cmd; pcn = 1 newcn = 6 ft0: bad seek in tape_cmd; pcn = 2 newcn = 6 ft0: bad seek in tape_cmd; pcn = 2 newcn = 6 ft0: tape_cmd seek failed! ft0: QIC status timeout ===> tape_cmd: 6 ft0: bad seek in tape_cmd; pcn = 2 newcn = 8 ft0: bad seek in tape_cmd; pcn = 2 newcn = 8 ft0: bad seek in tape_cmd; pcn = 2 newcn = 8 ft0: bad seek in tape_cmd; pcn = 2 newcn = 8 ft0: bad seek in tape_cmd; pcn = 2 newcn = 8 ft0: tape_cmd seek failed! ft0: QIC status timeout Entering Mark's ugly hack ===> tape_cmd: 9 ft0: bad seek in tape_cmd; pcn = 2 newcn = 11 ft0: bad seek in tape_cmd; pcn = 2 newcn = 11 ft0: bad seek in tape_cmd; pcn = 3 newcn = 11 ft0: bad seek in tape_cmd; pcn = 3 newcn = 11 ft0: bad seek in tape_cmd; pcn = 3 newcn = 11 ft0: tape_cmd seek failed! ft0: QIC status timeout Anybody now what this means?? From reading the code I can't really work it out. I would appreciate any ideas for how to go further. Regards/mark -- +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+ | Mark Hannon,| FreeBSD - Free Unix for your PC| mark@seeware.DIALix.oz.au| | Melbourne, | PGP key available by fingering | epamha@epa.ericsson.se | | Australia | seeware@melbourne.DIALix.oz.au | | +-=-=-=-=-=-=-+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+