From owner-freebsd-current@FreeBSD.ORG Fri Aug 20 16:06:58 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B450C16A4CF; Fri, 20 Aug 2004 16:06:58 +0000 (GMT) Received: from blake.polstra.com (blake.polstra.com [64.81.189.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2EB6943D53; Fri, 20 Aug 2004 16:06:58 +0000 (GMT) (envelope-from jdp@polstra.com) Received: from strings.polstra.com (dsl081-189-067.sea1.dsl.speakeasy.net [64.81.189.67]) by blake.polstra.com (8.12.11/8.12.11) with ESMTP id i7KG6sIF015899 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 20 Aug 2004 09:06:54 -0700 (PDT) (envelope-from jdp@strings.polstra.com) Received: (from jdp@localhost) by strings.polstra.com (8.12.11/8.12.11/Submit) id i7KG6rsK023921; Fri, 20 Aug 2004 09:06:53 -0700 (PDT) (envelope-from jdp) Message-ID: X-Mailer: XFMail 1.5.5 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Fri, 20 Aug 2004 09:06:53 -0700 (PDT) From: John Polstra To: (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) X-Bogosity: No, tests=bogofilter, spamicity=0.102164, version=0.14.5 cc: freebsd-current@freebsd.org cc: Pawel Jakub Dawidek Subject: Re: Bogus usage of tsleep(9) in USB. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2004 16:06:58 -0000 On 20-Aug-2004 Dag-Erling Smørgrav wrote: > Pawel Jakub Dawidek writes: >> There are many calls to tsleep(9) with no timeout in our USB code. >> As you all know, it is not permitted and we have KASSERT() for this: >> >> KASSERT(timo != 0 || mtx_owned(&Giant) || mtx != NULL, >> ("sleeping without a mutex")); > > This panic message only applies to one of the three conditions the > KASSERT tests. It should probably be split into three separate > KASSERTs with three different panic messages. How would you do that? Those are "||" operators, not "&&". There is only one way to fail: by violating all three subconditions. John