Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Jul 2007 13:47:16 +0300
From:      Nikolay Pavlov <quetzal@zone3000.net>
To:        "M. Warner Losh" <imp@bsdimp.com>
Cc:        current@freebsd.org, marck@rinet.ru, nate@root.org
Subject:   Re: GEOM weirdness with SD flash reader?
Message-ID:  <20070702104716.GB13720@zone3000.net>
In-Reply-To: <20070701.221911.1394573729.imp@bsdimp.com>
References:  <46880F1C.3020602@root.org> <20070701.215557.1373430453.imp@bsdimp.com> <4688791D.6050007@root.org> <20070701.221911.1394573729.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday,  1 July 2007 at 22:19:11 -0600, M. Warner Losh wrote:
> In message: <4688791D.6050007@root.org>
>             Nate Lawson <nate@root.org> writes:
> : M. Warner Losh wrote:
> : > In message: <46880F1C.3020602@root.org>
> : >             Nate Lawson <nate@root.org> writes:
> : > : Yes, you're exactly right.  However, shouldn't a read from a device
> : > : trigger a re-taste if the media is removable?
> : > 
> : > I don't think it does.  The driver is expected to poll, however...
> : > 
> : > : So the fdisk of da2
> : > : should have caused it to re-read the MBR and create /dev/da2s1.  I think
> : > : maybe there should be a flag set for devices with removable media that
> : > : causes the device to be re-tasted on every mount request.
> : > 
> : > Is there even a removable flag to disks?
> : 
> : In SCSI there is, removable flag combined with medium not present:
> : 
> : da2 at umass-sim1 bus 1 target 0 lun 2
> : da2: <Generic STORAGE DEVICE 0001> Removable Direct Access SCSI-0 device
> :                                    ^^^^^^^^^
> : da2: 40.000MB/s transfers
> : da2: Attempt to query device size failed: NOT READY, Medium not present
> 
> I think you've misunderstood my point.  I know that SCSI has this
> flag, but I can't find anything in GEOM that it would map to.  It
> seems a common enough situation that having such a flag in GEOM would
> be beneficial and easy to implement.
> 
> : What if we kicked off a thread to run every 3 seconds that did a quick
> : poll of such devices and sent a devd notify if they arrived (i.e. medium
> : present)?  It wouldn't work for floppy drives, but we could make this
> : part of the da driver or something in usermode like devd itself calling
> : camcontrol?
> 
> In the past, people have said that polling messes up multimedia
> access, so it hasn't happened.
> 
> But wouldn't a simple daemon in userland do the same thing?  Or
> parsing the output of camcontrol inquiry?  Camcontrol rescan is a nop
> for these devices.

Hald is using the same tactic. My dmesg is full of poll messages when i
am using cardreader with it.

-- 
======================================================================  
- Best regards, Nikolay Pavlov. <<<-----------------------------------    
======================================================================  




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070702104716.GB13720>