ide-cs drive detection for media check is broken

David Zeuthen david at fubar.dk
Mon Oct 25 07:34:50 PDT 2004


On Mon, 2004-10-25 at 11:31 +0200, Martin Pitt wrote:
> Hi!
> 
> I got several bug reports that the insertion of blank CDs is not
> recognized (i. e. nautilus-cd-burner does not open automatically).
> Some debugging revealed that the following code is broken:
> 

<snip>

> All reporters have a normal internal ATAPI IDE CD-ROM drive, the sysfs path for
> one is "/sys/devices/ide1/1.0". Above code compares that against
> /sys/devices/ide, which succeeds, decides (incorrectly) that the
> device is a PCMCIA interface and disables media check.
> 

Well, to be fair only the comments and debug output wrongfully conclude
the IDE interface stems from a PCMCIA interface. Anyway, that's odd, my
builtin IDE devices are not in that location, whereas my PCMCIA Compact
Flash adapter is:

[davidz at davidz ~]$ tree /sys/bus/ide/devices/
/sys/bus/ide/devices/
|-- 0.0 -> ../../../devices/pci0000:00/0000:00:1f.1/ide0/0.0
|-- 1.0 -> ../../../devices/pci0000:00/0000:00:1f.1/ide1/1.0
`-- 2.0 -> ../../../devices/ide2/2.0

> Since I don't have a PCMCIA interface, I cannot test this myself. What
> actually happens if media check is enabled for real PCMCIA devices? 

Bad things - see 

 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=130232

for details. 

Actually hal now works around that infinite loop since IDE doesn't
report any media changes anyway (only when the top-level block device
goes away) - you can verify this by observing that not hotplug events
are added to a fixed IDE disk when using fdisk. 

I'm still not keen on polling the drive or opening the device as it
still creates the infinite hotplug loop. That's why hal will report
volume.fstype as auto (we can live with one or two hotplug loops caused
by mount(1) opening the device).

> If
> nothing really breaks, above code should just be deleted. Otherwise,
> the detection must be refinded to only match real PCMCIA drives.
> 

Actually all IDE drives should have media check disabled per default
except for optical drives. One way to check for this without opening the
device (which causes the infinite loop) is to check
if /proc/ide/hd?/media says cdrom. You have a patch handy?

Btw, when someone fixes the IDE layer in the kernel we can remove this
special case stuff.

Thanks,
David

_______________________________________________
hal mailing list
hal at freedesktop.org
http://freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list