diff options
author | Tejun Heo <tj@kernel.org> | 2011-04-21 17:43:59 (GMT) |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2011-04-21 17:43:59 (GMT) |
commit | 7eec77a1816a7042591a6cbdb4820e9e7ebffe0e (patch) | |
tree | 138c0ed198471151e2590fc3d35f56c5d57ba720 /drivers/ide/ide-cd_ioctl.c | |
parent | 7c88a168da8003fd4d8fb6ae103c4ecf29cb1130 (diff) | |
download | linux-7eec77a1816a7042591a6cbdb4820e9e7ebffe0e.tar.xz |
ide: unexport DISK_EVENT_MEDIA_CHANGE for ide-gd and ide-cd
check_events() implementations in both ide-gd and ide-cd are
inadequate for in-kernel event polling. Both generate media change
events continuously when certain conditions are met causing infinite
event loop between the driver and userland event handler.
As disk event now supports suppression of unlisted events, simply
de-listing DISK_EVENT_MEDIA_CHANGE from disk->events resolves the
problem. Internal handling around media revalidation will behave the
same while userland will fall back to userland event polling after
detecting the device doesn't support disk events.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Jens Axboe <jaxboe@fusionio.com>
Acked-by: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'drivers/ide/ide-cd_ioctl.c')
-rw-r--r-- | drivers/ide/ide-cd_ioctl.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/ide/ide-cd_ioctl.c b/drivers/ide/ide-cd_ioctl.c index 2a6bc50..02caa7d 100644 --- a/drivers/ide/ide-cd_ioctl.c +++ b/drivers/ide/ide-cd_ioctl.c @@ -79,6 +79,12 @@ int ide_cdrom_drive_status(struct cdrom_device_info *cdi, int slot_nr) return CDS_DRIVE_NOT_READY; } +/* + * ide-cd always generates media changed event if media is missing, which + * makes it impossible to use for proper event reporting, so disk->events + * is cleared to 0 and the following function is used only to trigger + * revalidation and never propagated to userland. + */ unsigned int ide_cdrom_check_events_real(struct cdrom_device_info *cdi, unsigned int clearing, int slot_nr) { |