On Wed, May 19, 2010 at 15:23, Tejun Heo <tj@xxxxxxxxxx> wrote: > For new comers: A cdrom is smart enough to actually raise AN but at > the same time dumb enough to raise it again on each open leading to > infinite loop involving the drive, kernel and udev. > > On 05/18/2010 10:18 PM, Kay Sievers wrote: >> Tejun, the stuff in: >> drivers/ata/libata-eh.c::sata_async_notification() >> seems to send events for this device, even when there is no changed >> media. Any ideas how to debug this? Or to check if these events are >> really events we should put out to userspace? > > Hmmm... I've been looking through the standards and things look > somewhat dodgy. ATA ACS continuously refers to SerialATA 2.6 for > details on AN and SerialATA 2.6 standard in turn claims that it > describes the AN mechanism but doesn't define all the events AN can be > raised for and for those one should refer to command standards (in > this case ACS), *but* both list media change event as a "yeah can be > used like that" example. So, in the end, nobody clearly defines it. > Sweet. :-) > > That said, w/o issuing further commands, the driver can't tell what > the AN exactly means. There's no further information at all. It's a > simple notification from the device. For ATAPI devices, it would be > safe to assume that checking media status is the right action to take > although both ATA and SATA standards haven't been brave enough to > actually define it precisely; however, exposing it directly to > userland as a media change event seems quite naive. > > I think it's best to plug AN till we have proper media presence > detection inside kernel proper so that our behavior doesn't differ > from windows apparently is the only thing many vendors are verifying > their hardware against. Yeah, that sounds good, and we can probably explicitly check with the in-kernel polling if we really have a media change, and only then send stuff out to userspace. Sounds all good, and thanks a lot for the quick fix. Thanks, Kay -- To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html