From owner-freebsd-scsi Fri Jul 12 05:49:20 1996 Return-Path: owner-freebsd-scsi Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id FAA10011 for freebsd-scsi-outgoing; Fri, 12 Jul 1996 05:49:20 -0700 (PDT) Received: from soleil.uvsq.fr (soleil.uvsq.fr [193.51.24.1]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id FAA10006 for ; Fri, 12 Jul 1996 05:49:17 -0700 (PDT) Received: from guillotin.prism.uvsq.fr (guillotin.prism.uvsq.fr [193.51.25.1]) by soleil.uvsq.fr (8.7.5/jtpda-5.2) with ESMTP id OAA11529 for ; Fri, 12 Jul 1996 14:49:14 +0200 (METDST) Received: from angrand.prism.uvsq.fr (angrand.prism.uvsq.fr [193.51.25.85]) by guillotin.prism.uvsq.fr (8.7.5/jtpda-5.2) with ESMTP id OAA06857 for ; Fri, 12 Jul 1996 14:49:13 +0200 (MET DST) Received: from (son@localhost) by angrand.prism.uvsq.fr (8.7.5/jtpda-5.2) id PAA00186 ; Fri, 12 Jul 1996 15:51:58 +0200 (MET DST) Date: Fri, 12 Jul 1996 15:51:58 +0200 (MET DST) Message-Id: <199607121351.PAA00186@angrand.prism.uvsq.fr> From: Nicolas Souchu To: freebsd-scsi@freebsd.org Subject: TRY_AGAIN_LATER return value Sender: owner-freebsd-scsi@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >From /sys/scsi/scsi_base.c, /* * Do the transfer. If we are polling we will return: * COMPLETE, Was poll, and scsi_done has been called * TRY_AGAIN_LATER, Adapter short resources, try again ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ * * if under full steam (interrupts) it will return: * SUCCESSFULLY_QUEUED, will do a wakeup when complete * TRY_AGAIN_LATER, (as for polling) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ * * After the wakeup, we must still check if it succeeded * * If we have a bp however, all the error proccessing * and the buffer code both expect us to return straight * to them, so as soon as the command is queued, return */ After the last retry, the bp structure is updated like this: if (bp && retval) { bp->b_error = retval; bp->b_flags |= B_ERROR; biodone(bp); } then scsi_scsi_cmd() returns. Another possibility on short resources is to return HAD_ERROR with xs->error = XS_BUSY (XS_TIMEOUT is equivalent), then the bp structure is updated like this in sc_done() after the last retry: if (bp) { bp->b_error = 0; bp->b_flags |= B_ERROR; bp->b_error = code; bp->b_resid = bp->b_bcount; SC_DEBUG(xs->sc_link, SDEV_DB3, ("scsi_interpret_sense (bp) returned %d\n", code)); } and later... if (bp && retval) { bp->b_error = retval; bp->b_flags |= B_ERROR; biodone(bp); } then scsi_scsi_cmd() returns. Converting TRY_AGAIN_LATER to HAD_ERROR and XS_BUSY seem to correct the deadlock bug I previously posted. What about TRY_AGAIN_LATER then ? nicolas -- Nicolas.Souchu@prism.uvsq.fr Laboratoire PRiSM - Versailles, FRANCE