Re: [PATCH] 2.3.14 leaves CDROM drive door locked

Jens Axboe (axboe@image.dk)
Thu, 26 Aug 1999 22:48:07 +0200


On Thu, Aug 26 1999, Andries.Brouwer@cwi.nl wrote:
> Explanation:
>
> At various points the driver does a check media change,
> which calls cdrom_check_status, which does a TEST_UNIT_READY.
> However, the routine cdrom_queue_packet_command will always
> lock the door unless called with one of a few commands,
> and TEST_UNIT_READY is not one of those. So, each
> cdrom_check_status, and each check media change will
> lock the door. (Even after an eject the tray is withdrawn
> and the door is closed again.)
> This behaviour is avoided by making TEST_UNIT_READY one
> of the exceptions in cdrom_queue_packet_command.
>
> Patch:
>
> --- /g1/linux/linux-2.3.14/linux/drivers/block/ide-cd.c Mon Aug 9 21:34:22 1999
> +++ ide-cd.c Thu Aug 26 02:26:10 1999
> @@ -1392,8 +1392,10 @@
> and we think that the door is presently, lock it again.
> (The door was probably unlocked via an explicit
> CDROMEJECT ioctl.) */
> - if (CDROM_STATE_FLAGS (drive)->door_locked == 0 && drive->usage &&
> - (pc->c[0] != REQUEST_SENSE &&
> + if (CDROM_STATE_FLAGS (drive)->door_locked == 0 &&
> + drive->usage &&
> + (pc->c[0] != TEST_UNIT_READY &&
> + pc->c[0] != REQUEST_SENSE &&
> pc->c[0] != ALLOW_MEDIUM_REMOVAL &&
> pc->c[0] != START_STOP &&
> pc->c[0] != MODE_SENSE_10 &&

Yes, I have recently added a couple more and I'll put TEST_UNIT_READY
in there as well. Thanks.

-- 
*  Jens Axboe <axboe@image.dk>
*  Linux CD-ROM Maintainer
*  http://www.kernel.dk

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/