From owner-freebsd-scsi Wed Mar 1 22:44:40 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 E9CA137C189; Wed, 1 Mar 2000 22:44:35 -0800 (PST) (envelope-from ken@panzer.kdm.org) Received: (from ken@localhost) by panzer.kdm.org (8.9.3/8.9.1) id XAA36646; Wed, 1 Mar 2000 23:44:35 -0700 (MST) (envelope-from ken) Date: Wed, 1 Mar 2000 23:44:34 -0700 From: "Kenneth D. Merry" To: Mike Smith Cc: scsi@FreeBSD.ORG Subject: Re: chio trap with not-ready changer Message-ID: <20000301234434.A36537@panzer.kdm.org> References: <20000301012528.A29274@panzer.kdm.org> <200003010841.AAA05125@mass.cdrom.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="xHFwDpU9dbj6ez1V" X-Mailer: Mutt 1.0i In-Reply-To: <200003010841.AAA05125@mass.cdrom.com>; from msmith@FreeBSD.ORG on Wed, Mar 01, 2000 at 12:41:33AM -0800 Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org --xHFwDpU9dbj6ez1V Content-Type: text/plain; charset=us-ascii On Wed, Mar 01, 2000 at 00:41:33 -0800, Mike Smith wrote: > > > I tried with both 1 and also 100. With the latter, I get a lot of > > > repeats, ending in: > > > > > > (ch0:ahc0:0:4:0): CAM status = 0x4c, retry count = 1 > > > (ch0:ahc0:0:4:0): MODE SENSE(06). CDB: 1a 8 1d 0 20 0 > > > (ch0:ahc0:0:4:0): UNIT ATTENTION asc:29,0 > > > (ch0:ahc0:0:4:0): Power on, reset, or bus device reset occurred > > > (ch0:ahc0:0:4:0): CAM status = 0x4c, retry count = 0 > > > (ch0:ahc0:0:4:0): MODE SENSE(06). CDB: 1a 8 1d 0 20 0 > > > (ch0:ahc0:0:4:0): UNIT ATTENTION asc:29,0 > > > (ch0:ahc0:0:4:0): Power on, reset, or bus device reset occurred > > > (ch0:ahc0:0:4:0): CAM status = 0x4c, retry count = 0 > > > (ch0:ahc0:0:4:0): MODE SENSE(06). CDB: 1a 0 1d 0 20 0 > > > (ch0:ahc0:0:4:0): UNIT ATTENTION asc:29,0 > > > (ch0:ahc0:0:4:0): Power on, reset, or bus device reset occurred > > > (ch0:ahc0:0:4:0): MODE SENSE(06). CDB: 1a 0 1d 0 20 0 > > > (ch0:ahc0:0:4:0): UNIT ATTENTION asc:29,0 > > > (ch0:ahc0:0:4:0): Power on, reset, or bus device reset occurred > > > (ch0:ahc0:0:4:0): fatal error, failed to attach to device > > > (ch0:ahc0:0:4:0): lost device > > > (ch0:ahc0:0:4:0): removing device entry > > > > > > (Note two there with a retry count of 0. Weird.) > > > > Note that one has the SMS_DBD flag set in the second byte of the CDB, > > the other has it cleared. > > I'm not sure what the significance of that is, actually. Well, the changer probe code will try doing a mode sense without block descriptors disabled. That's because some changers don't like it when you disable block descriptors. The comment on rev 1.2 of scsi_ch.c describes the problem. > > > With 1, there's obviously a lot less, but the same result. > > > > Can you include a little more of the retries? The disable block > > descriptors flag is getting cleared mighty late if the above is the tail > > end of the output from the 100 retries. [ ... ] > (ch0:ahc0:0:4:0): Power on, reset, or bus device reset occurred > (ch0:ahc0:0:4:0): CAM status = 0x4c, retry count = 4 > (ch0:ahc0:0:4:0): MODE SENSE(06). CDB: 1a 8 1d 0 20 0 > (ch0:ahc0:0:4:0): UNIT ATTENTION asc:29,0 > (ch0:ahc0:0:4:0): Power on, reset, or bus device reset occurred > (ch0:ahc0:0:4:0): CAM status = 0x4c, retry count = 3 > (ch0:ahc0:0:4:0): MODE SENSE(06). CDB: 1a 8 1d 0 20 0 > (ch0:ahc0:0:4:0): UNIT ATTENTION asc:29,0 > (ch0:ahc0:0:4:0): Power on, reset, or bus device reset occurred > (ch0:ahc0:0:4:0): CAM status = 0x4c, retry count = 2 > (ch0:ahc0:0:4:0): MODE SENSE(06). CDB: 1a 8 1d 0 20 0 > (ch0:ahc0:0:4:0): UNIT ATTENTION asc:29,0 > (ch0:ahc0:0:4:0): Power on, reset, or bus device reset occurred > > As far as I can see, they all look the same as the count=1 case. Yep, thanks. > > 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. Ken -- Kenneth Merry ken@kdm.org --xHFwDpU9dbj6ez1V Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="scsi_all.c.spectra.20000301" ==== //depot/FreeBSD-ken/src/sys/cam/scsi/scsi_all.c#4 - /a/ken/perforce/FreeBSD-ken/src/sys/cam/scsi/scsi_all.c ==== *** /tmp/tmp.36576.0 Wed Mar 1 23:33:51 2000 --- /a/ken/perforce/FreeBSD-ken/src/sys/cam/scsi/scsi_all.c Wed Mar 1 23:33:31 2000 *************** *** 725,730 **** --- 725,748 ---- * WARNING: You must update the num_ascs field below for this quirk table * entry if you add more entries. */ + static struct asc_table_entry spectra_8000_entries[] = { + {SST(0x29, 0x00, SS_TUR|SSQ_DECREMENT_COUNT|ENXIO, + "Power on, reset, or bus device reset occurred")} + }; + + /* + * WARNING: You must update the num_ascs field below for this quirk table + * entry if you add more entries. + */ + static struct asc_table_entry sony_mo_entries[] = { + {SST(0x04, 0x00, SS_START|SSQ_DECREMENT_COUNT|ENXIO, + "Logical unit not ready, cause not reportable")} + }; + + /* + * WARNING: You must update the num_ascs field below for this quirk table + * entry if you add more entries. + */ static struct asc_table_entry quantum_fireball_entries[] = { {SST(0x04, 0x0b, SS_START|SSQ_DECREMENT_COUNT|ENXIO, "Logical unit not ready, initializing cmd. required")} *************** *** 741,746 **** --- 759,786 ---- {T_DIRECT, SIP_MEDIA_FIXED, "QUANTUM", "FIREBALL S*", "*"}, 1, /* number of vendor-specific sense codes for this entry */ quantum_fireball_entries + }, + { + /* + * This Sony MO drive likes to return 0x04, 0x00 when it + * isn't spun up. + * Reported by: Joerg Wunsch + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "SONY", "SMO-C501-09*", "*"}, + 1, /* number of vendor-specific sense codes for this entry */ + sony_mo_entries + }, + { + /* + * The apparantly doesn't clear + * unit attention conditions when a mode sense is issued. + * So we have to issue test unit readies until the unit + * attention condition has been cleared. + * Reported by: Mike Smith + */ + {T_CHANGER, SIP_MEDIA_REMOVABLE, "SPECT*", "*", "*"}, + 1, /* number of vendor-specific sense codes for this entry */ + spectra_8000_entries } }; --xHFwDpU9dbj6ez1V-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message