From owner-freebsd-bugs Thu Dec 12 02:20:06 1996 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id CAA04036 for bugs-outgoing; Thu, 12 Dec 1996 02:20:06 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id CAA04012; Thu, 12 Dec 1996 02:20:02 -0800 (PST) Resent-Date: Thu, 12 Dec 1996 02:20:02 -0800 (PST) Resent-Message-Id: <199612121020.CAA04012@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, akiyama@kme.mei.co.jp Received: from vcgate2.mei.co.jp (vcgate2.mei.co.jp [202.32.14.52]) by freefall.freebsd.org (8.8.4/8.8.4) with ESMTP id CAA03852 for ; Thu, 12 Dec 1996 02:13:21 -0800 (PST) Received: by vcgate2.mei.co.jp (8.7.5+2.6Wbeta7/5.9:4.9:vcgate0:961204) id TAA06276; Thu, 12 Dec 1996 19:13:08 +0900 (JST) Received: by vcmei.vanc.mei.co.jp (5.65mei1.1/5.9:4.9:vcmei:961209) id AA13111; Thu, 12 Dec 96 19:13:01 +0900 Received: by kmegate.kme.mei.co.jp (4.1/5.5:4.6:kmegate:961205) id AA01873; Thu, 12 Dec 96 19:12:50 JST Message-Id: <9612121012.AA01873@kmegate.kme.mei.co.jp> Date: Thu, 12 Dec 96 19:12:50 JST From: akiyama@kme.mei.co.jp Reply-To: akiyama@kme.mei.co.jp To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/2199: Got a lots of "Target Busy" messages with od. Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Number: 2199 >Category: kern >Synopsis: Got a lots of "Target Busy" messages with od. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Dec 12 02:20:01 PST 1996 >Last-Modified: >Originator: Shunsuke Akiyama >Organization: Kyushu Matsushita Electric Co., LTD. >Release: FreeBSD 2.2-ALPHA i386 >Environment: FreeBSD 2.2-ALPHA kernel configured with "od". Adaptec AHA-2940 SCSI Adapter and Matsushita LF-3200 MO drive. >Description: I've got a lots of "Target Busy" messages when mounting MO while drive reading media DMA information. In this case, MO drive returns busy status to SCSI adapter. SCSI subsystem retry the I/O operation, and prints "Target Busy" message. Then I got many messages on the console. >How-To-Repeat: mount MO media, while drive reading media DMA information. >Fix: =================================================================== --- sys/scsi/od.c 1996/11/06 19:12:01 +++ sys/scsi/od.c 1996/12/07 12:13:04 @@ -52,6 +52,7 @@ * WARNING! Use at your own risk. Joerg's ancient SONY SMO drive * groks it fine, while Shunsuke's Fujitsu chokes on it and times * out. + * #define OD_AUTO_TURNOFF */ @@ -309,22 +310,24 @@ dev, unit, PARTITION(dev))); /* - * Try to start the drive, and try to clear "Unit Attention" - * condition, when media had been changed before. + * Try to clear "Unit Attention" condition, when media had + * been changed before. * This operation also clears the SDEV_MEDIA_LOADED flag in its * error handling routine. + * And MUST be a first SCSI I/O operation in od_open(). */ - scsi_start_unit(sc_link, SCSI_SILENT); - scsi_prevent(sc_link, PR_PREVENT, SCSI_ERR_OK | SCSI_SILENT); + scsi_test_unit_ready(sc_link, SCSI_SILENT); /* - * Make sure the drive is ready. + * Try to start the drive (ignore failure). */ - scsi_test_unit_ready(sc_link, 0); + scsi_start_unit(sc_link, SCSI_ERR_OK | SCSI_SILENT); + scsi_prevent(sc_link, PR_PREVENT, SCSI_ERR_OK | SCSI_SILENT); SC_DEBUG(sc_link, SDEV_DB3, ("'start' attempted ")); sc_link->flags |= SDEV_OPEN; /* unit attn becomes an err now */ + /* * If it's been invalidated, then forget the label. */ @@ -458,6 +461,11 @@ bp->b_error = EIO; goto bad; } + + /* + * Check it's not too big a transfer for our adapter + */ + odminphys(bp); /* * Odd number of bytes or negative offset >Audit-Trail: >Unformatted: