mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: LKML <linux-kernel@vger.kernel.org>,
	Linux-SCSI <linux-scsi@vger.kernel.org>
Cc: akpm@linux-foundation.org
Subject: [PATCH v4 2/2] libata: Utilize new SCSI event infrastructure
Date: Mon, 29 Oct 2007 10:42:09 -0400 (EDT)	[thread overview]
Message-ID: <20071029144209.AEE9F1F816B@havoc.gtf.org> (raw)
In-Reply-To: <15624bab8dc0206e384ac8314257a900e60127c1.1193668176.git.jeff@garzik.org>

An end to CD-ROM polling (if you have a device that supports AN)...
hooray!

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
---
 drivers/ata/libata-scsi.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index f752edd..e6d5627 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)
+		set_bit(SDEV_EVT_MEDIA_CHANGE, sdev->supported_events);
+
 	if (dev->flags & ATA_DFLAG_NCQ) {
 		int depth;
 
@@ -3225,10 +3228,11 @@ 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
+	if (dev->sdev) {
+		DECLARE_BITMAP(map, SDEV_EVT_MAXBITS);
+		__set_bit(SDEV_EVT_MEDIA_CHANGE, map);
+		sdev_evt_notify(dev->sdev, map);
+	}
 }
 
 /**
-- 
1.5.2.4


  parent reply	other threads:[~2007-10-29 14:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-29 14:42 [PATCH v4 0/2] [SCSI] Asynchronous event notification infrastructure Jeff Garzik
2007-10-29 14:42 ` [PATCH v4 1/2] SCSI: " Jeff Garzik
2007-10-29 15:51   ` James Bottomley
2007-10-29 16:07     ` Jeff Garzik
2007-10-29 16:17       ` James Bottomley
2007-10-29 16:29         ` Jeff Garzik
2007-10-29 17:01           ` James Bottomley
2007-10-29 21:31             ` [PATCH v5 0/2] SCSI asynchronous event notification API Jeff Garzik
2007-10-29 21:31             ` [PATCH v5 1/2] SCSI: add " Jeff Garzik
2007-10-29 21:31             ` [PATCH v5 2/2] libata: Utilize new SCSI event infrastructure Jeff Garzik
2007-10-29 14:42 ` Jeff Garzik [this message]
2007-10-29 15:43 ` [PATCH v4 0/2] [SCSI] Asynchronous event notification infrastructure James Bottomley
2007-10-29 15:58   ` Jeff Garzik
2007-10-29 16:10     ` James Bottomley
2007-10-29 16:24       ` Jeff Garzik
2007-10-29 16:34         ` James Bottomley
2007-10-29 16:48           ` Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071029144209.AEE9F1F816B@havoc.gtf.org \
    --to=jeff@garzik.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®