From owner-svn-src-head@FreeBSD.ORG Fri Dec 2 21:42:00 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C01AD1065670; Fri, 2 Dec 2011 21:42:00 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 20FB38FC0C; Fri, 2 Dec 2011 21:41:59 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id pB2Lfw1Y076181; Fri, 2 Dec 2011 22:41:58 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id pB2LfwTj076180; Fri, 2 Dec 2011 22:41:58 +0100 (CET) (envelope-from marius) Date: Fri, 2 Dec 2011 22:41:58 +0100 From: Marius Strobl To: John Baldwin Message-ID: <20111202214158.GE60194@alchemy.franken.de> References: <201112022119.pB2LJEqJ009294@svn.freebsd.org> <4ED94215.7030109@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4ED94215.7030109@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r228209 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2011 21:42:00 -0000 On Fri, Dec 02, 2011 at 04:24:37PM -0500, John Baldwin wrote: > On 12/2/11 4:19 PM, Marius Strobl wrote: > >Author: marius > >Date: Fri Dec 2 21:19:14 2011 > >New Revision: 228209 > >URL: http://svn.freebsd.org/changeset/base/228209 > > > >Log: > > - In device_probe_child(9) check the return value of > > device_set_driver(9) > > when actually setting a driver as especially ENOMEM is fatal in these > > cases. > > - Annotate other calls to device_set_devclass(9) and > > device_set_driver(9) > > without the return value being checked and that are okay to fail. > > > > Reviewed by: yongari (slightly earlier version) > > Hmm, I've always thought that new-bus overused M_NOWAIT. There are a > few places where M_NOWAIT might be appropriate (e.g. from pccbb's > interrupt routine when a cardbus card is inserted), but the boot time > probe can certainly use M_WAITOK instead. Even the pccbb case could use > M_WAITOK if it were simply deferred to a taskqueue (which it probably > should be anyway, probing and attaching a driver to a new card is far > too expensive to do directly from an interrupt handler). > In general the use of M_NOWAIT vs. M_WAITOK in bus methods is also very inconsistent across device drivers. We should decide how to handle the standard case, document it and fix things up accordingly ... I agree that M_WAITOK should be used in most of these cases. Marius