From owner-freebsd-hackers Mon Jul 8 14:17:00 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id OAA09319 for hackers-outgoing; Mon, 8 Jul 1996 14:17:00 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id OAA09298 for ; Mon, 8 Jul 1996 14:16:55 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.12/8.6.9) id HAA17933; Tue, 9 Jul 1996 07:12:05 +1000 Date: Tue, 9 Jul 1996 07:12:05 +1000 From: Bruce Evans Message-Id: <199607082112.HAA17933@godzilla.zeta.org.au> To: Nicolas.Souchu@prism.uvsq.fr, hackers@FreeBSD.ORG Subject: Re: polling driver Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Surely, doing a tsleep() in a driver is a bad idea... I think >resources are not well locked before the drive-dependent scsi_cmd() >routine is called because the process is supposed to keep the CPU >during the call and return without being interrupted. Sleeping works (only) in process context (not in interrupt handlers including timeout handlers) . The SCSI_NOSLEEP flag is supposed to tell SCSI drivers when it is safe to sleep. >Timeouts are not good either because they interrupt the CPU at a high >level (>splbio) and the callback is executed at a very low level. Timeout handlers are always called at the same low level (splsoftclock) (