From owner-freebsd-scsi Sat Mar 4 15:10:59 2000 Delivered-To: freebsd-scsi@freebsd.org Received: from panzer.kdm.org (panzer.kdm.org [216.160.178.169]) by hub.freebsd.org (Postfix) with ESMTP id 5603837B89E; Sat, 4 Mar 2000 15:10:55 -0800 (PST) (envelope-from ken@panzer.kdm.org) Received: (from ken@localhost) by panzer.kdm.org (8.9.3/8.9.1) id QAA61325; Sat, 4 Mar 2000 16:10:55 -0700 (MST) (envelope-from ken) Date: Sat, 4 Mar 2000 16:10:54 -0700 From: "Kenneth D. Merry" To: Mike Smith Cc: scsi@FreeBSD.ORG, gibbs@FreeBSD.ORG Subject: Re: chio trap with not-ready changer Message-ID: <20000304161054.A61108@panzer.kdm.org> References: <20000301234434.A36537@panzer.kdm.org> <200003040302.TAA04334@mass.cdrom.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <200003040302.TAA04334@mass.cdrom.com>; from msmith@FreeBSD.ORG on Fri, Mar 03, 2000 at 07:02:25PM -0800 Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Fri, Mar 03, 2000 at 19:02:25 -0800, Mike Smith wrote: > > > > In any case, try putting a printf inside the SS_TUR case in > > > > cam_periph_error() in cam_periph.c, to see whether the quirk entry is > > > > getting matched correctly and therefore whether the test unit ready is > > > > getting issued. > > > > > > Hmm. Trying: > > > > > > if (((err_action & SS_MASK) == SS_TUR) > > > && save_ccb != NULL > > > && ccb->ccb_h.retry_count > 0) { > > > > > > printf("cam_periph_error: sending TUR\n"); > > > > > > I never see the above message. > > > > Okay, my guess is that I flubbed the quirk entry somehow. Anyway, try the > > attached patch for scsi_all.c. It makes the quirk entry much more generic > > in the hopes that it'll match. > > Still no joy. The quirk strings themselves are matching OK; I've added > debugging code sufficient to determine that (slightly reformatted for > clarity): > > (ch0:ahc0:0:3:0): MODE SENSE(06). CDB: 1a 0 1d 0 20 0 > (ch0:ahc0:0:3:0): UNIT ATTENTION asc:29,0 > cam_strmatch: compare 'SPECTRA STL-8000 1.940 0 0 ' > with ' SPECT*' > MATCH > cam_strmatch: compare 'STL-8000 1.940 0 0 ' > with ' *' > MATCH > cam_strmatch: compare '1.940 0 0 ' > with ' *' > MATCH > (ch0:ahc0:0:3:0): Power on, reset, or bus device reset occurred > > For what it's worth, I _only_ get these matches when it's in the middle > of printing the "UNIT ATTENTION" messages. scsi_sense_desc() is called from scsi_sense_print(), so that's why you're getting those messages. What this means is that scsi_error_action() isn't getting called from cam_periph_error(). Oooh, I think I know what may be going on here. I suspect you're hitting the following case in cam_periph_error(): } else { /* decrement the number of retries */ retry = ccb->ccb_h.retry_count > 0; if (retry) ccb->ccb_h.retry_count--; /* * If it was aborted with no * clue as to the reason, just * retry it again. */ error = ERESTART; } You hit that when there is a SCSI error, but autosense failed, and there are still retries left. That would explain why the retry count is getting decremented, and ERESTART is returned, and why you never get into scsi_error_action(). So this means that the request sense is failing, likely due to the unit attention condition. That's pretty lame. You might want to put a printf in the above piece of code in cam_periph_error() just to make sure that's what is happening. I don't have any ideas right off on how to solve this without a major kludge. (Like adding an additional probe state in the changer driver that sends a test unit ready before the mode sense..) I'll think about it and run it by Justin (CCed) as well. You might make an ideal beta tester for his error recovery code rewrite. :) (I don't know if it's ready for testers just yet, though.) One of the things I think he's planning on doing is issuing a request sense when autosense fails. I'm not sure how much that would help in this case, but it might. Ken -- Kenneth Merry ken@kdm.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message