All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stas Sergeev <stsp@aknet.ru>
To: Alexander Kern <alex.kern@gmx.de>
Cc: Linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: bug: cd-rom autoclose no longer works (fix attempt)
Date: Thu, 30 Dec 2004 23:35:03 +0300	[thread overview]
Message-ID: <41D46677.3020301@aknet.ru> (raw)
In-Reply-To: <200412302053.00850.alex.kern@gmx.de>

[-- Attachment #1: Type: text/plain, Size: 769 bytes --]

Hello.

Alexander Kern wrote:
> Can agree with you, but a modern cdrom should be able to konwn, is it open or 
> not. This patch change basic behaviour for all cdroms.
But I think those modern cdroms will
return 1 or 2 but not 0, in which case
my patch should not affect them. This
is of course something I can't say for
sure, just assuming.

> Old behaviour has another problems, and revert to 2.4.20 code base is a bad 
> solution.
Very probably. My patch was only "what
I did to get it to work again" kind of
thing.

> The patch must be minimal...
>	if (sense.sense_key == NOT_READY) {
OK, but the cdrom.c change is still needed
either. So attached is the new one. Does it
get us any closer to having this fixed?

> P.S. S Novym Godom!
OK, thanks, and to you too:)


[-- 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:[~2004-12-30 20:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200412301853.48677.alex.kern@gmx.de>
2004-12-30 18:26 ` bug: cd-rom autoclose no longer works (fix attempt) Stas Sergeev
2004-12-30 19:52   ` Alexander Kern
2004-12-30 20:35     ` Stas Sergeev [this message]
2004-12-29 18:12 Stas Sergeev

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=41D46677.3020301@aknet.ru \
    --to=stsp@aknet.ru \
    --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.