From owner-freebsd-hackers@FreeBSD.ORG Sun Jun 4 10:42:22 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B343516A420 for ; Sun, 4 Jun 2006 10:42:22 +0000 (UTC) (envelope-from fierykylin@gmail.com) Received: from wx-out-0102.google.com (wx-out-0102.google.com [66.249.82.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id 35C1943D60 for ; Sun, 4 Jun 2006 10:42:21 +0000 (GMT) (envelope-from fierykylin@gmail.com) Received: by wx-out-0102.google.com with SMTP id i31so577840wxd for ; Sun, 04 Jun 2006 03:42:20 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=RFIToweJELwXupPTREiWiCkIMfbu08035cMGw+czfqcGsKJWrk1JF32C3vIs5AwLrGQqBoYGVPqfNVBBfq7HvEV/3yBfelbcASv6GSKdH3mxKl94a1EhB/EIAz9fvZzmT6a0qhgYYkBYsoxfNwo5VdWOl2f8vQPVJ6vRb/nsdxk= Received: by 10.70.102.11 with SMTP id z11mr4722357wxb; Sun, 04 Jun 2006 03:42:20 -0700 (PDT) Received: by 10.70.43.11 with HTTP; Sun, 4 Jun 2006 03:42:20 -0700 (PDT) Message-ID: <87ab37ab0606040342y55ef91baje8f07d68e1a70464@mail.gmail.com> Date: Sun, 4 Jun 2006 18:42:20 +0800 From: "william wallace" Sender: fierykylin@gmail.com To: "M. Warner Losh" In-Reply-To: <20060604.043725.778152499.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <87ab37ab0605192239n73b7fcdbtbdd5dbd3f1099fc3@mail.gmail.com> <20060520.013546.104050983.imp@bsdimp.com> <87ab37ab0606040029u67edc35ende0b34e39e80bd37@mail.gmail.com> <20060604.043725.778152499.imp@bsdimp.com> X-Google-Sender-Auth: 3624d08cee681785 Cc: freebsd-hackers@freebsd.org Subject: Re: misc questions about the device&driver arch X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jun 2006 10:42:22 -0000 On 6/4/06, M. Warner Losh wrote: > In message: <87ab37ab0606040029u67edc35ende0b34e39e80bd37@mail.gmail.com> > : > > > Warner > : Prior to removing a card from the system, two things must occur: > : > : The device's driver must cease accessing the card. > : > : The card must cease generation transaction and interrupts. > : > : How this is accomplished is OS-specific, but the following must take place: > : > : The OS must stop issuing new requests to the device's driver or must > : instruct the driver to stop accepting new requests. > : > : The driver must terminate or complete all outstanding requests. > : > : The card must be disabled from generating interrupts or transactions. > : > : When the OS commands the driver to quiesce itself and its device, the > : OS must not expect the device to remain in the system (in other words, > : it could be removed and not replaced with a similar card). > : > : How to design and implement quiescing in freebsd? > > device_quiesce? I have it in a p4 tree right now. Specifically, it > hooks up to the MOD_UNLOAD with a QUIESCE flag. The driver's > device_quiesce routine gets called, the driver sleeps there until it > knows that it is good, then returns to the caller. Then the driver's > detach routine can be called. > > Warner > where can i get the p4 tree read ,sir -- we who r about to die,salute u!