Re: [patch 3/3] libata: handle AN interrupt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <kristen.c.accardi@xxxxxxxxx>
+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-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux