Date: Fri, 12 Jul 1996 15:51:58 +0200 (MET DST) From: Nicolas Souchu <Nicolas.Souchu@prism.uvsq.fr> To: freebsd-scsi@freebsd.org Subject: TRY_AGAIN_LATER return value Message-ID: <199607121351.PAA00186@angrand.prism.uvsq.fr>
next in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199607121351.PAA00186>