Kristen Carlson Accardi wrote:
When we get an SDB FIS with the 'N' bit set, we should send
an event to user space to indicate that there has been a
media change.  The ahci host controller will send the
event via KOBJ_CHANGE uevent.

Signed-off-by: Kristen Carlson Accardi <[EMAIL PROTECTED]>
+static void async_notify_thread(struct work_struct *work)
+{
+       struct ata_device *atadev =
+               container_of(work, struct ata_device, async_notify);
+
+       /*
+        * TBD - who should send this event?  I couldn't find an
+        * easy way to map an ata_device to a genhd device, so
+        * decided maybe the ata host should send the event and
+        * allow user space to figure out what happened?
+        */
+       kobject_uevent(&atadev->ap->host->dev->kobj, KOBJ_CHANGE);
+}

I don't think this is right. If you're gonna make media_change_event capability generic, you gotta make event delivery generic too. You can make it a genhd event and make genhd supply the interface function, say, genhd_notify_media_change() which is then forwarded by SCSI layer.

Thanks.

--
tejun
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to