From: Stas Sergeev <stsp@aknet.ru>
To: Andrew Morton <akpm@osdl.org>
Cc: Linux kernel <linux-kernel@vger.kernel.org>,
Alexander Kern <alex.kern@gmx.de>
Subject: [patch] fix cdrom autoclose
Date: Thu, 06 Jan 2005 00:57:50 +0300 [thread overview]
Message-ID: <41DC62DE.6000907@aknet.ru> (raw)
[-- Attachment #1: Type: text/plain, Size: 403 bytes --]
Hi Andrew.
The attached patch fixes the CD-ROM
autoclose. It is broken in recent
kernels for CD-ROMs that do not properly
report that the tray is opened.
Now on such a drives the kernel will do
one close attempt and check for the disc
again. This is how it used to work in the
past.
Can this please be applied?
Acked-by: Alexander Kern <alex.kern@gmx.de>
Signed-off-by: Stas Sergeev <stsp@aknet.ru>
[-- Attachment #2: cd_clo1.diff --]
[-- Type: text/x-patch, Size: 842 bytes --]
--- linux/drivers/cdrom/cdrom.c 2004-12-28 14:49:56.000000000 +0300
+++ linux/drivers/cdrom/cdrom.c 2004-12-28 14:55:09.228038640 +0300
@@ -1076,6 +1076,8 @@
}
cdinfo(CD_OPEN, "the tray is now closed.\n");
}
+ /* the door should be closed now, check for the disc */
+ ret = cdo->drive_status(cdi, CDSL_CURRENT);
if (ret!=CDS_DISC_OK) {
ret = -ENOMEDIUM;
goto clean_up_and_return;
--- linux/drivers/ide/ide-cd.c 2004-12-28 09:15:40.000000000 +0300
+++ linux/drivers/ide/ide-cd.c 2004-12-28 14:46:44.119826760 +0300
@@ -2744,9 +2744,9 @@
*/
if (sense.sense_key == NOT_READY) {
if (sense.asc == 0x3a) {
- if (sense.ascq == 0 || sense.ascq == 1)
+ if (sense.ascq == 1)
return CDS_NO_DISC;
- else if (sense.ascq == 2)
+ else if (sense.ascq == 0 || sense.ascq == 2)
return CDS_TRAY_OPEN;
}
}
reply other threads:[~2005-01-05 21:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=41DC62DE.6000907@aknet.ru \
--to=stsp@aknet.ru \
--cc=akpm@osdl.org \
--cc=alex.kern@gmx.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.