From owner-freebsd-current@FreeBSD.ORG Mon Jul 2 04:48:55 2007 Return-Path: X-Original-To: current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7595016A41F for ; Mon, 2 Jul 2007 04:48:55 +0000 (UTC) (envelope-from nate@root.org) Received: from root.org (root.org [67.118.192.226]) by mx1.freebsd.org (Postfix) with ESMTP id 45B3B13C4AE for ; Mon, 2 Jul 2007 04:48:55 +0000 (UTC) (envelope-from nate@root.org) Received: (qmail 49077 invoked from network); 2 Jul 2007 04:48:57 -0000 Received: from ppp-71-139-42-13.dsl.snfc21.pacbell.net (HELO ?10.0.5.18?) (nate-mail@71.139.42.13) by root.org with ESMTPA; 2 Jul 2007 04:48:57 -0000 Message-ID: <468883AF.8040300@root.org> Date: Sun, 01 Jul 2007 21:48:47 -0700 From: Nate Lawson User-Agent: Thunderbird 2.0.0.4 (X11/20070617) MIME-Version: 1.0 To: Poul-Henning Kamp References: <42855.1183350086@critter.freebsd.dk> In-Reply-To: <42855.1183350086@critter.freebsd.dk> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: current@FreeBSD.org, "M. Warner Losh" Subject: Re: GEOM weirdness with SD flash reader? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 02 Jul 2007 04:48:55 -0000 Poul-Henning Kamp wrote: > In message <4688786F.5080408@root.org>, Nate Lawson writes: >> M. Warner Losh wrote: > >> Nope, dmarck is right. The reader was inserted "empty", then the media >> was added. It took a write to the device (maybe via the mount attempt >> of /dev/da2) to trigger a re-taste. > > Actually you only need to open it for write, I usually use: > > true > /dev/da2 Ok. > The problem here is, quite simply, that nobody tells GEOM that a card > has been inserted. > > opening for a write and then closing it forces a retaste because metadata > blocks could have been written. > > The correct fix for this is to have scsi_da tell geom that the card > was inserted. It doesn't get an interrupt or anything. The only way to find media is now present is through polling. I suggested in another reply how to do this from userland. I just tested that method and it works. -- Nate