genodelabs/genode — Issue #92: ATAPI driver hangs when re-opening a block session
Author: nfeske
Created: 2012-01-25 11:52:39+00:00
State: open
Labels: bug

Currently, the ATAPI driver provides only one long-living block session but it does not support the consecutive opening and re-opening of the block session. This use case occurs in a scenario where the ATAPI driver is first used to probe for a boot medium (by looking for a special file on the block device). If the probing step succeeds, we want to pass a fresh block session to the actual iso9660 file system service.

At session-creation time, the driver acquires the needed I/O resources and probes for the ATAPI device. Because the I/O resources are not freed when closing the session, the second attempt to create a session (after having closed the original session) fails. The driver tries again to obtain the I/O resources from core, which fails because core does not hand out the same I/O resource twice.

A possible solution would be to do the ATAPI probing only once at the startup of the driver. But this eager approach may do the probing earlier in the boot process than really needed. Alternatively, we could do the probing lazily when the first session is requested but never probe again.