On Thu, Mar 29, 2012 at 9:50 PM, Aaron Lu <aaron.lu@xxxxxxx> wrote: [.....] > For the ODD to be put into suspend state, the conditions should be: > 1 tray closed > 2 no media inside > I think we missed the condition 1 check now. > > And if we follow the two conditions, the events can be safely ignored. > > What do you think of blocking events for it when going to suspend and unblocking > when resume? This could erase the unnecessary calls of the check events function > when ODD is suspended. Good idea. Will try this. > But disk_(un)block_events are not exported and can't be used in sr > module. So I'm > not sure how to do this. We can simply export it. > > Another thing to consider is, user might want to eject the tray by > software like the > eject /dev/sr0 command or some UI mouse clicks against the cdrom icon. I'm still > thinking how to do this correctly. Assume eject /dev/sr0 is implemented as: int fd = open("/dev/sr0", ...) ioctl(fd, CDROMEJECT) We may need to resume ODD in the ioctl handler(scsi_cmd_ioctl). Thanks, Lin Ming -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html