diff options
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/ide-cd_ioctl.c | 6 | ||||
-rw-r--r-- | drivers/ide/ide-gd.c | 7 |
2 files changed, 12 insertions, 1 deletions
diff --git a/drivers/ide/ide-cd_ioctl.c b/drivers/ide/ide-cd_ioctl.c index 2a6bc50e8a41..02caa7dd51c8 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) | |||
79 | return CDS_DRIVE_NOT_READY; | 79 | return CDS_DRIVE_NOT_READY; |
80 | } | 80 | } |
81 | 81 | ||
82 | /* | ||
83 | * ide-cd always generates media changed event if media is missing, which | ||
84 | * makes it impossible to use for proper event reporting, so disk->events | ||
85 | * is cleared to 0 and the following function is used only to trigger | ||
86 | * revalidation and never propagated to userland. | ||
87 | */ | ||
82 | unsigned int ide_cdrom_check_events_real(struct cdrom_device_info *cdi, | 88 | unsigned int ide_cdrom_check_events_real(struct cdrom_device_info *cdi, |
83 | unsigned int clearing, int slot_nr) | 89 | unsigned int clearing, int slot_nr) |
84 | { | 90 | { |
diff --git a/drivers/ide/ide-gd.c b/drivers/ide/ide-gd.c index c4ffd4888939..70ea8763567d 100644 --- a/drivers/ide/ide-gd.c +++ b/drivers/ide/ide-gd.c | |||
@@ -298,6 +298,12 @@ static unsigned int ide_gd_check_events(struct gendisk *disk, | |||
298 | return 0; | 298 | return 0; |
299 | } | 299 | } |
300 | 300 | ||
301 | /* | ||
302 | * The following is used to force revalidation on the first open on | ||
303 | * removeable devices, and never gets reported to userland as | ||
304 | * genhd->events is 0. This is intended as removeable ide disk | ||
305 | * can't really detect MEDIA_CHANGE events. | ||
306 | */ | ||
301 | ret = drive->dev_flags & IDE_DFLAG_MEDIA_CHANGED; | 307 | ret = drive->dev_flags & IDE_DFLAG_MEDIA_CHANGED; |
302 | drive->dev_flags &= ~IDE_DFLAG_MEDIA_CHANGED; | 308 | drive->dev_flags &= ~IDE_DFLAG_MEDIA_CHANGED; |
303 | 309 | ||
@@ -413,7 +419,6 @@ static int ide_gd_probe(ide_drive_t *drive) | |||
413 | if (drive->dev_flags & IDE_DFLAG_REMOVABLE) | 419 | if (drive->dev_flags & IDE_DFLAG_REMOVABLE) |
414 | g->flags = GENHD_FL_REMOVABLE; | 420 | g->flags = GENHD_FL_REMOVABLE; |
415 | g->fops = &ide_gd_ops; | 421 | g->fops = &ide_gd_ops; |
416 | g->events = DISK_EVENT_MEDIA_CHANGE; | ||
417 | add_disk(g); | 422 | add_disk(g); |
418 | return 0; | 423 | return 0; |
419 | 424 | ||