Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758635AbXJ2Omu (ORCPT ); Mon, 29 Oct 2007 10:42:50 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755430AbXJ2OmO (ORCPT ); Mon, 29 Oct 2007 10:42:14 -0400 Received: from havoc.gtf.org ([69.61.125.42]:47293 "EHLO havoc.gtf.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753768AbXJ2OmK (ORCPT ); Mon, 29 Oct 2007 10:42:10 -0400 To: LKML , Linux-SCSI In-Reply-To: <15624bab8dc0206e384ac8314257a900e60127c1.1193668176.git.jeff@garzik.org> References: <15624bab8dc0206e384ac8314257a900e60127c1.1193668176.git.jeff@garzik.org> From: Jeff Garzik Cc: akpm@linux-foundation.org Subject: [PATCH v4 2/2] libata: Utilize new SCSI event infrastructure Message-Id: <20071029144209.AEE9F1F816B@havoc.gtf.org> Date: Mon, 29 Oct 2007 10:42:09 -0400 (EDT) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1366 Lines: 46 An end to CD-ROM polling (if you have a device that supports AN)... hooray! Signed-off-by: Jeff Garzik --- 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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/