From owner-freebsd-current@FreeBSD.ORG Sun Oct 10 20:55:20 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B9A9106564A; Sun, 10 Oct 2010 20:55:20 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id EED5A8FC15; Sun, 10 Oct 2010 20:55:18 +0000 (UTC) Received: by fxm12 with SMTP id 12so458003fxm.13 for ; Sun, 10 Oct 2010 13:55:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=hLEH8lVjiftOSjZYVk+Rje3Mg8/6K75AxntWjOn5DBE=; b=LQmUuhtLm5X19uqQ4hR14hcwIk1LbWcN2DcUce3HjV9X1Cc32Jxn/nPpGyeZm3k07R 21Z3qeBG1WlmerC4Y/Y3QMVkeHNnaMUXoz0qkztjPVijOAg0eRfx8iP6ta1neBUxkh15 T7NoY5mm+kgvwUdRK0e6fkbaRksR41LGHxc+U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=GzR7fEYLw7cSUVWle5FI0tcXuBof/dlPy6w3HgOINtMDw7dyuIBEv7IE/pg6IYQHV/ oGPI6qnxnrCY5/Ascoo5FvXH16Ul6KS5aS2pM50sely+lXwdGsi/ZLqZGgZ2GGdf0/g1 OgcvqD9H3thmythRuSm0AxmygxvKbjBQtZdLk= Received: by 10.223.86.80 with SMTP id r16mr1025394fal.42.1286744117105; Sun, 10 Oct 2010 13:55:17 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (1.eurobsdcon.punkt.de [217.29.34.225]) by mx.google.com with ESMTPS id z19sm2090551fam.40.2010.10.10.13.55.15 (version=SSLv3 cipher=RC4-MD5); Sun, 10 Oct 2010 13:55:15 -0700 (PDT) Sender: Alexander Motin Message-ID: <4CB22833.70304@FreeBSD.org> Date: Sun, 10 Oct 2010 22:55:15 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.24 (X11/20100402) MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <4CA3BD7C.9080306@feral.com> <4CA4CCE3.9060408@FreeBSD.org> <20101010155340.GQ1733@garage.freebsd.pl> In-Reply-To: <20101010155340.GQ1733@garage.freebsd.pl> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: sos@FreeBSD.org, FreeBSD-Current , Andriy Gapon , phk@FreeBSD.org Subject: Re: letting glabel recognise a media change 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: Sun, 10 Oct 2010 20:55:20 -0000 Pawel Jakub Dawidek wrote: > On Thu, Sep 30, 2010 at 08:46:11PM +0300, Alexander Motin wrote: >> Andriy Gapon wrote: >>> on 30/09/2010 01:28 Matthew Jacob said the following: >>>> If something like that was in place, I assure you that things would start to use >>>> it very quickly. >>> I am not sure about this. >>> Because, e.g. I don't see an easy way to know that media is changed in scsi_cd >>> driver. That is, without polling. I don't consider polling to be an easy way for >>> a number of reasons. >> SATA specification defines concept of Asynchronous Notification. It is >> already used by port multipliers to report about PHY events. It is also >> supposed to be used by CD drives to report media change. I haven't seen >> such devices yet, but hope they may appear sometimes. >> >> And even without AN support it would be nice to implement proper >> handling for SCSI "UA - media changed" errors within CAM. It still won't >> be perfect without using polling, but probably still something. > > I'd like to know the original reason why CD device is represented by > GEOM provider and not CD media. For my naive thinking CD media should be > GEOM provider that we taste once the media is inserted and orphan once > the media is removed. I don't see any reasons for CD device to be useful > GEOM provider, but maybe I'm overlooking something. > > Poul-Henning or Soren, do you remember who made and why this design choice? SCSI drivers receive no notification on media insertion. Somebody should poll device. At this moment it is handled by consumers. Indeed not sure it is the best idea. If we want driver to bother with this polling - we may do as you propose. Actually in sdhci(4) driver I am doing this way - mmcsdX device appears when card inserted and disappears on removal. I think first thing that may brake if there will be no cdX device - loading the media with some commands. Also it may be non-intuitive that drive is present, but disk is not registered in GEOM. -- Alexander Motin