ide-cd: temporary tray close fix

This one fixes http://bugzilla.kernel.org/show_bug.cgi?id=11602.

A more generic fix for drives which cannot autoclose tray will follow.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
[bart: add an extra parentheses for consistency with the rest of kernel code]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

authored by Borislav Petkov and committed by Bartlomiej Zolnierkiewicz f20f2586 fec6ed1d

+7 -2
+4 -1
drivers/ide/ide-cd.c
··· 1661 1661 cdi->mask &= ~CDC_PLAY_AUDIO; 1662 1662 1663 1663 mechtype = buf[8 + 6] >> 5; 1664 - if (mechtype == mechtype_caddy || mechtype == mechtype_popup) 1664 + if (mechtype == mechtype_caddy || 1665 + mechtype == mechtype_popup || 1666 + (drive->atapi_flags & IDE_AFLAG_NO_AUTOCLOSE)) 1665 1667 cdi->mask |= CDC_CLOSE_TRAY; 1666 1668 1667 1669 if (cdi->sanyo_slot > 0) { ··· 1861 1859 { "MATSHITADVD-ROM SR-8176", NULL, IDE_AFLAG_PLAY_AUDIO_OK }, 1862 1860 { "MATSHITADVD-ROM SR-8174", NULL, IDE_AFLAG_PLAY_AUDIO_OK }, 1863 1861 { "Optiarc DVD RW AD-5200A", NULL, IDE_AFLAG_PLAY_AUDIO_OK }, 1862 + { "Optiarc DVD RW AD-7543A", NULL, IDE_AFLAG_NO_AUTOCLOSE }, 1864 1863 { NULL, NULL, 0 } 1865 1864 }; 1866 1865
+3 -1
include/linux/ide.h
··· 366 366 /* Currently on a filemark */ 367 367 IDE_AFLAG_FILEMARK = (1 << 25), 368 368 /* 0 = no tape is loaded, so we don't rewind after ejecting */ 369 - IDE_AFLAG_MEDIUM_PRESENT = (1 << 26) 369 + IDE_AFLAG_MEDIUM_PRESENT = (1 << 26), 370 + 371 + IDE_AFLAG_NO_AUTOCLOSE = (1 << 27), 370 372 }; 371 373 372 374 struct ide_drive_s {