From owner-freebsd-scsi Tue Jul 10 13:32:20 2001 Delivered-To: freebsd-scsi@freebsd.org Received: from beppo.feral.com (beppo.feral.com [192.67.166.79]) by hub.freebsd.org (Postfix) with ESMTP id DB6FA37B406 for ; Tue, 10 Jul 2001 13:32:15 -0700 (PDT) (envelope-from mjacob@feral.com) Received: from wonky.feral.com (wonky.feral.com [192.67.166.7]) by beppo.feral.com (8.11.3/8.11.3) with ESMTP id f6AKW6S94893; Tue, 10 Jul 2001 13:32:06 -0700 (PDT) (envelope-from mjacob@feral.com) Date: Tue, 10 Jul 2001 13:32:02 -0700 (PDT) From: Matthew Jacob Reply-To: To: Stephen McKay Cc: , Norman Czarczinski Subject: Re: Trouble with SCSI Streamer In-Reply-To: <200107101252.f6ACqMF26033@dungeon.home> Message-ID: <20010710132824.C99370-100000@wonky.feral.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Tue, 10 Jul 2001, Stephen McKay wrote: > On Wednesday, 4th July 2001, Matthew Jacob wrote: > > >On Wed, 4 Jul 2001, Norman Czarczinski wrote: > > > >> On Wednesday 04 July 2001 19:34, you wrote: > >> > Well, that's one theory shot down. Can you explicitly try changing the > >> > blocksize to 1k, test, back to 512 and test again? > >> > >> That was it. With 1k it works. After switching back to 512 the problem came > >> back. > > > >Okay- sounds like a bug in sa(4) then- and wierdness in the drive. It > >shouldn't allow you to set it to 512 bytes if that doesn't work. > > This is deja vu time! We had this discussion a couple of years ago, > if I recall correctly. QIC tapes in fixed block mode at densities of > QIC-320 and above are in 1k blocks, and below that they are 512 byte blocks. > It is not linked to a drive type, but to the tape density. > > Instead of getting to the bottom of this and making the sa driver know > everything there was to know about QIC drives, the resolution was to > use variable length blocks on QIC-320 and above. At the time, I had > some philosophical quibbles with this approach, but it seems quite > practical in retrospect. No, I don't agree. A lot of QIC tape drives don't get emulated (it has to be emulated because they cannot actually *do* variable blocksize) blocksizes right. > Indeed, checking the pre-cam st driver reveals the default is as I just > described. But checking the cam sa driver reveals quirks that set 1024 > byte fixed blocks on some drives, and more code that sets 512 byte > blocks for lots of densities, including ones that it shouldn't. That's > not right. Yes, this probably is true. Currently, if this code is exercised (which is rarer than it should be): switch (softc->media_density) { case SCSI_DENSITY_QIC_11_4TRK: case SCSI_DENSITY_QIC_11_9TRK: case SCSI_DENSITY_QIC_24: case SCSI_DENSITY_QIC_120: case SCSI_DENSITY_QIC_150: case SCSI_DENSITY_QIC_525_320: case SCSI_DENSITY_QIC_1320: case SCSI_DENSITY_QIC_3080: softc->quirks &= ~SA_QUIRK_2FM; softc->quirks |= SA_QUIRK_FIXED|SA_QUIRK_1FM; softc->last_media_blksize = 512; break; case SCSI_DENSITY_QIC_4GB: case SCSI_DENSITY_QIC_2GB: softc->quirks &= ~SA_QUIRK_2FM; softc->quirks |= SA_QUIRK_FIXED|SA_QUIRK_1FM; softc->last_media_blksize = 1024; break; This should probably be: switch (softc->media_density) { case SCSI_DENSITY_QIC_11_4TRK: case SCSI_DENSITY_QIC_11_9TRK: case SCSI_DENSITY_QIC_24: case SCSI_DENSITY_QIC_120: case SCSI_DENSITY_QIC_150: softc->quirks &= ~SA_QUIRK_2FM; softc->quirks |= SA_QUIRK_FIXED|SA_QUIRK_1FM; softc->last_media_blksize = 512; break; case SCSI_DENSITY_QIC_525_320: case SCSI_DENSITY_QIC_1320: case SCSI_DENSITY_QIC_3080: case SCSI_DENSITY_QIC_4GB: case SCSI_DENSITY_QIC_2GB: softc->quirks &= ~SA_QUIRK_2FM; softc->quirks |= SA_QUIRK_FIXED|SA_QUIRK_1FM; softc->last_media_blksize = 1024; break; It turns out, though, that this code path is rarely exercised because our beloved QIC manufactures often just report 'default' density (0). > > I think a useful exercise would be to copy more of the QIC heuristics from > the old st driver into the sa driver. Got patches? -matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message