linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 4/4] libata: expose AN to user space
@ 2007-10-16 21:21 akpm
  2007-10-25  7:21 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2007-10-16 21:21 UTC (permalink / raw)
  To: jeff; +Cc: linux-ide, akpm, kristen.c.accardi, James.Bottomley, htejun

From: Kristen Carlson Accardi <kristen.c.accardi@intel.com>

If Asynchronous Notification of media change events is supported, pass that
information up to the SCSI layer.

Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Tejun Heo <htejun@gmail.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/ata/libata-scsi.c |    3 +++
 1 file changed, 3 insertions(+)

diff -puN drivers/ata/libata-scsi.c~libata-expose-an-to-user-space drivers/ata/libata-scsi.c
--- a/drivers/ata/libata-scsi.c~libata-expose-an-to-user-space
+++ a/drivers/ata/libata-scsi.c
@@ -773,6 +773,9 @@ static void ata_scsi_dev_config(struct s
 		blk_queue_max_hw_segments(q, q->max_hw_segments - 1);
 	}
 
+	if (dev->flags & ATA_DFLAG_AN)
+		sdev->media_change_notify = 1;
+
 	if (dev->flags & ATA_DFLAG_NCQ) {
 		int depth;
 
_

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch 4/4] libata: expose AN to user space
  2007-10-16 21:21 [patch 4/4] libata: expose AN to user space akpm
@ 2007-10-25  7:21 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2007-10-25  7:21 UTC (permalink / raw)
  To: akpm; +Cc: linux-ide, kristen.c.accardi, James.Bottomley, htejun

[-- Attachment #1: Type: text/plain, Size: 1184 bytes --]

akpm@linux-foundation.org wrote:
> From: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
> 
> If Asynchronous Notification of media change events is supported, pass that
> information up to the SCSI layer.
> 
> Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
> Cc: Jeff Garzik <jeff@garzik.org>
> Cc: Tejun Heo <htejun@gmail.com>
> Cc: James Bottomley <James.Bottomley@steeleye.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
> 
>  drivers/ata/libata-scsi.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff -puN drivers/ata/libata-scsi.c~libata-expose-an-to-user-space drivers/ata/libata-scsi.c
> --- a/drivers/ata/libata-scsi.c~libata-expose-an-to-user-space
> +++ a/drivers/ata/libata-scsi.c
> @@ -773,6 +773,9 @@ static void ata_scsi_dev_config(struct s
>  		blk_queue_max_hw_segments(q, q->max_hw_segments - 1);
>  	}
>  
> +	if (dev->flags & ATA_DFLAG_AN)
> +		sdev->media_change_notify = 1;
> +

Methinks this wasn't tested, as you missed removal of the crucial 
OTHER_AN_PATCHES_HAVE_BEEN_APPLIED ifdef-ery... :)

Anyway, I updated the patch for the media_event thingy in the last 
email, and applied the attached patch


[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 1146 bytes --]

commit 6ba2326c804e2d449c2f40a63ba0a9ea650bef47
Author: Jeff Garzik <jeff@garzik.org>
Date:   Thu Oct 25 03:20:05 2007 -0400

    [libata] Utilize new SCSI media event infrastructure
    
    Signed-off-by: Jeff Garzik <jgarzik@redhat.com>

 drivers/ata/libata-scsi.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

6ba2326c804e2d449c2f40a63ba0a9ea650bef47
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index f5d5420..65b6153 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -773,6 +773,9 @@ static void ata_scsi_dev_config(struct scsi_device *sdev,
 		blk_queue_max_hw_segments(q, q->max_hw_segments - 1);
 	}
 
+	if (dev->flags & ATA_DFLAG_AN)
+		sdev->media_events = 1;
+
 	if (dev->flags & ATA_DFLAG_NCQ) {
 		int depth;
 
@@ -3248,10 +3251,8 @@ static void ata_scsi_handle_link_detach(struct ata_link *link)
  */
 void ata_scsi_media_change_notify(struct ata_device *dev)
 {
-#ifdef OTHER_AN_PATCHES_HAVE_BEEN_APPLIED
 	if (dev->sdev)
-		scsi_device_event_notify(dev->sdev, SDEV_MEDIA_CHANGE);
-#endif
+		scsi_device_event_notify(dev->sdev, 1UL << SDEV_MEDIA_CHANGE);
 }
 
 /**

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-10-25  7:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-16 21:21 [patch 4/4] libata: expose AN to user space akpm
2007-10-25  7:21 ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).