From owner-freebsd-current@FreeBSD.ORG Mon Mar 28 14:25:51 2005 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 9705516A4DD for ; Mon, 28 Mar 2005 14:25:51 +0000 (GMT) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id C190A43D5C for ; Mon, 28 Mar 2005 14:25:50 +0000 (GMT) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de (cicely5.cicely.de [10.1.1.7]) (authenticated bits=0)j2SEPdsf096410 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Mon, 28 Mar 2005 16:25:41 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [IPv6:3ffe:400:8d0:301::12]) by cicely5.cicely.de (8.12.10/8.12.10) with ESMTP id j2SEPPVK088033 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 28 Mar 2005 16:25:26 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.12.11/8.12.11) with ESMTP id j2SEPP40027692; Mon, 28 Mar 2005 16:25:25 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.11/8.12.11/Submit) id j2SEPOlf027691; Mon, 28 Mar 2005 16:25:24 +0200 (CEST) (envelope-from ticso) Date: Mon, 28 Mar 2005 16:25:24 +0200 From: Bernd Walter To: Vladimir Grebenschikov Message-ID: <20050328142523.GG14532@cicely12.cicely.de> References: <30956.1112011996@critter.freebsd.dk> <1112014711.1022.37.camel@localhost> <20050328130451.GB14532@cicely12.cicely.de> <1112015844.1022.44.camel@localhost> <20050328132801.GD14532@cicely12.cicely.de> <1112018770.1022.62.camel@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1112018770.1022.62.camel@localhost> X-Operating-System: FreeBSD cicely12.cicely.de 5.2-CURRENT alpha User-Agent: Mutt/1.5.6i X-Spam-Status: No, hits=-4.9 required=3.0 tests=BAYES_00 autolearn=no version=2.64 X-Spam-Report: * -4.9 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0015] X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on cicely12.cicely.de cc: "current@freebsd.org" cc: "Matthew N. Dodd" cc: freebsd-mobile@freebsd.org cc: Poul-Henning Kamp cc: Julian Elischer cc: ticso@cicely.de Subject: Re: Reattach/redetect allways connected umass device - is it possible ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ticso@cicely.de List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2005 14:25:51 -0000 On Mon, Mar 28, 2005 at 06:06:10PM +0400, Vladimir Grebenschikov wrote: > ? ??, 28/03/2005 ? 15:28 +0200, Bernd Walter ?????: > > On Mon, Mar 28, 2005 at 05:17:24PM +0400, Vladimir Grebenschikov wrote: > > > ? ??, 28/03/2005 ? 15:04 +0200, Bernd Walter ?????: > > > > On Mon, Mar 28, 2005 at 04:58:31PM +0400, Vladimir Grebenschikov wrote: > > > > > ? ??, 28/03/2005 ? 14:13 +0200, Poul-Henning Kamp ?????: > > > > > > In message <20050328114633.GZ14532@cicely12.cicely.de>, Bernd Walter writes: > > > > > > > > > > > > >> camcontrol detach da0; camcontrol rescan all > > > > > > >> helps, but, it should be much better if it will be issued automatically. > > > > > > > > > > > > > >Yes - GEOM seems to ignore media change signals from drives. > > > > > > >I've added PHK to the recipient list - maybe he has an idea about this > > > > > > >problem. > > > > > > > > > > > > No, GEOM doesn't ignore any such thing, because as far as I know > > > > > > GEOM doesn't get any such thing to ignore in the first place. > > > > > > > > > > So, let's imagine following situation: > > > > > > > > > > We get SCSI BUS with removable da device. > > > > > device detected as da0 and not mounted. > > > > > Device disconnected from SCSI bus. > > > > > And finally, another device with different geometry connected with same > > > > > SCIS ID. > > > > > > > > This ist not a *media* exchange - this is a *device* and in > > > > this case even a scbus exchange. > > > > > > Ok, so my case is media exchange, not device exchange. > > > > No - it is a device exchange. > > GEOM only has problems with media exchange. > > A new device is no problem for GEOM. > > Your problem is very likely not GEOM related. > > I guess, may bad example messed up discussion. sorry. > > >From begin: > I have USB-connected card-reader (Sony Memory Stick). > It connected as umass0 (ehci), then as da0. > It can't be unplugged. (on-board notebook device) OK - then I got you wrong here - so you are really exchanging just the media. Yes - the thread is very mixed - and I don't imagine a memory stick, which describes the physical design IMO, to be an onboard device. > Problem: > When I change card (it was not mounted) da0 device does not detect > media change and following mount fails. Ack. > Workarounds (I know three at this moment): > - kldunload umass; kldload umass - the ugliest, will affect other > umass devices. > - cat /dev/null > /dev/da0 before mount - GEOM hacking > (also I do not like do cat into device with data) I think this is currently the official way. It just does what is required to trigger a GEOM rescan. Everthing else removes the complete device, which is more than required. > - camcontrol detach da0; camcontrol rescan all - requires CAM patch > > So, I am asking about solution, how it is supposed to work, > I guess, like with CD, there is should not be special exercises after > card change. If I got Poul right then even for the CD case it just works because of some evilness. > Probably my card-read is too stupid to send any media change > notifications, how to test it ? You should see SCSI messages from the kernel for the first access after exchanging the media. But from what I know GEOM doesn't know how to handle exchange notifications from SCSI devices. What we IMHO really need is to make the da driver poll the device for media exchange notifications - and hoope that the drive is capable to do. I don't have an idea for drives that don't support notifications. > Another, probably related question, is there way to detect card > insertion/removal ? You can explizitly ask a SCSI device for media and readyness state. -- B.Walter BWCT http://www.bwct.de bernd@bwct.de info@bwct.de