From owner-svn-src-head@FreeBSD.ORG Thu Sep 3 13:46:43 2009 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 918AC1065676; Thu, 3 Sep 2009 13:46:43 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-bw0-f206.google.com (mail-bw0-f206.google.com [209.85.218.206]) by mx1.freebsd.org (Postfix) with ESMTP id BC4828FC34; Thu, 3 Sep 2009 13:46:42 +0000 (UTC) Received: by bwz2 with SMTP id 2so1475552bwz.43 for ; Thu, 03 Sep 2009 06:46:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=YeJ/IoyUwhlb9bOwjwMiZ5PPvCrwykPSYsvapkBZLbc=; b=njojjo9XZUdtXO+UJofUkJJxVQxuyTxm5Zg1YGt9nrXK4rjdlklti6uJsFSGBS8jAr DLjhItAx1OPFQsLSwwuBdAQLdLgb7vH5T3JtK69AtVj/u/J+crUhgS/z9V3Rv7UPRqjZ 6bswzDkq2AgSnhfuvKRPoUo03P60BE7lL91Xo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=HynY4BqrO9c9Gvnj5/6miPtHc2qMS4MgnxOuYgSa0XcsMMf6l9CxzYxIqgWwbo5/Oq U2IxuD7d6zDDONqq4k95Dny5rp+BkjWxYgqXBeePILymX3ne4K2E0O2u1iQlZNUh8Wpc Wr4C7pdBbSGhvSZtX2y+PEdF1KJWEf1639gWA= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.223.58.139 with SMTP id g11mr4110290fah.43.1251985601616; Thu, 03 Sep 2009 06:46:41 -0700 (PDT) In-Reply-To: <200909031340.n83Defkv034013@svn.freebsd.org> References: <200909031340.n83Defkv034013@svn.freebsd.org> Date: Thu, 3 Sep 2009 15:46:41 +0200 X-Google-Sender-Auth: 5214872fbe78e966 Message-ID: <3bbf2fe10909030646o2dc30166r303ee646572c741b@mail.gmail.com> From: Attilio Rao To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Cc: Subject: Re: svn commit: r196779 - in head/sys: kern sys 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: Thu, 03 Sep 2009 13:46:43 -0000 2009/9/3 Attilio Rao : > Author: attilio > Date: Thu Sep 3 13:40:41 2009 > New Revision: 196779 > URL: http://svn.freebsd.org/changeset/base/196779 > > Log: > Add intermediate states for attaching and detaching that will be > reused by the enhached newbus locking once it is checked in. > This change can be easilly MFCed to STABLE_8 at the appropriate moment. About this commit, there are a few of things which worths nothing: - This has been committed separately from the new-bus locking because it is planned to be MFCed before 8.0 goes out in order to offer the correct ABI compatibility for merging, while 8.1-REL, the newbus locking - Probabilly what we really wanted here is just a transitioning state instead than both DS_ATTACHING and DS_DETACHING. Some consumers would eventually understand what of the 2 is that and one of these consumers is device_is_attached(). That function is used improperly by many detach handlers in a construct like: int foo_attach(device_t dev) { ... if (error != 0) foo_detach(dev); ... } int foo_detach(device_dev) { ... if (device_is_attached(dev)) { /* do some handover */ } ... } That is an incorrect behaviour which needs to be discouraged and that will be fixed during 9.0. In the while this semantic (used by many drivers) makes the single-transition state impraticable and so we will need to stick with that device states also in 9.0. Attilio -- Peace can only be achieved by understanding - A. Einstein