Skip to contentSkip to conversation

Changes to ide-cd for 2.4.1 are broken?

DISCUSSION [email protected] 3 participants 3 messages Feb 18, 2001 – Feb 22, 2001

lore
Share & tools
lore
#0 lore raw

From: Jens Axboe <[email protected]>

On Sat, Feb 17 2001, John Fremlin wrote:
> Specifically, this part:
>
> @@ -2324,11 +2309,17 @@
> sense.ascq == 0x04)
> return CDS_DISC_OK;
>
> +
> + /*
> + * If not using Mt Fuji extended media tray reports,
> + * just return TRAY_OPEN since ATAPI doesn't provide
> + * any other way to detect this...
> + */
> if (sense.sense_key == NOT_READY) {
> - /* ATAPI doesn't have anything that can help
> - us decide whether the drive is really
> - emtpy or the tray is just open. irk. */
> - return CDS_TRAY_OPEN;
> + if (sense.asc == 0x3a && (!sense.ascq||sense.ascq == 1))
> + return CDS_NO_DISC;
> + else
> + return CDS_TRAY_OPEN;
> }
>
> My tray is open as I type, and it is misreported as CDS_NO_DISC. In > 2.4.0 it worked fine.

Your drive is broken, the only other valid combination is 0x3a/0x02 which means no media and tray open. You could try and dump the asc and ascq to see what your drive reports for the different states.

Ha Jens - must we disagree twice on one evening?
You know all about this stuff, so probably I am mistaken. However, my copy of SFF8020-r2.6 everywhere has "Sense 02 ASC 3A: Medium not present" without giving subcodes to distinguish Tray Open from No Disc.
So, it seems to me that drives built to this spec will not have nonzero ASCQ.

Andries

#1 lore raw
Quoted 16 lines · On Sun, Feb 18 2001, [email protected] wrote:
Quoted 16 lines
(quoted diff) +9 -4
+               /*
+                * If not using Mt Fuji extended media tray reports,
+                * just return TRAY_OPEN since ATAPI doesn't provide
+                * any other way to detect this...
+                */
                if (sense.sense_key == NOT_READY) {
-                       /* ATAPI doesn't have anything that can help
-                          us decide whether the drive is really
-                          emtpy or the tray is just open. irk. */
-                       return CDS_TRAY_OPEN;
+                       if (sense.asc == 0x3a && (!sense.ascq||sense.ascq == 1))
+                               return CDS_NO_DISC;
+                       else
+                               return CDS_TRAY_OPEN;
                }
Quoted 8 lines
Quoted 2 lines

My tray is open as I type, and it is misreported as CDS_NO_DISC. In 2.4.0 it worked fine.

Your drive is broken, the only other valid combination is 0x3a/0x02 which means no media and tray open. You could try and dump the asc and ascq to see what your drive reports for the different states.

Ha Jens - must we disagree twice on one evening?

:-)

Quoted 6 lines

You know all about this stuff, so probably I am mistaken. However, my copy of SFF8020-r2.6 everywhere has "Sense 02 ASC 3A: Medium not present" without giving subcodes to distinguish Tray Open from No Disc.
So, it seems to me that drives built to this spec will not have nonzero ASCQ.

Right, old ATAPI has 3a/02 as the only possible condition, so we can't really tell between no disc and tray open. I guess the safest is to just keep the old behaviour for !ascq and report open.

Signature · 1 line
Jens Axboe
#2 lore raw
In reply to [email protected]

Jens Axboe <[email protected]> writes:

[...]

Quoted 10 lines
Quoted 6 lines

You know all about this stuff, so probably I am mistaken. However, my copy of SFF8020-r2.6 everywhere has "Sense 02 ASC 3A: Medium not present" without giving subcodes to distinguish Tray Open from No Disc.
So, it seems to me that drives built to this spec will not have nonzero ASCQ.

Right, old ATAPI has 3a/02 as the only possible condition, so we can't really tell between no disc and tray open. I guess the safest is to just keep the old behaviour for !ascq and report open.

Jens, you are maintainer? Could you ask Linus or Alan to revert the change below?

drivers/ide/ide-cd.c Sun Jan 28 13:37:50 2001 renamed from linux/drivers/ide/ide-cd.c Tue Jan 2 16:59:17 2001 +9 -4
diff -u --recursive --new-file v2.4.0/linux/drivers/ide/ide-cd.c linux/drivers/ide/ide-cd.c
@@ -2324,11 +2309,17 @@
                    sense.ascq == 0x04)
                        return CDS_DISC_OK;
 
+
+               /*
+                * If not using Mt Fuji extended media tray reports,
+                * just return TRAY_OPEN since ATAPI doesn't provide
+                * any other way to detect this...
+                */
                if (sense.sense_key == NOT_READY) {
-                       /* ATAPI doesn't have anything that can help
-                          us decide whether the drive is really
-                          emtpy or the tray is just open. irk. */
-                       return CDS_TRAY_OPEN;
+                       if (sense.asc == 0x3a && (!sense.ascq||sense.ascq == 1))+                               return CDS_NO_DISC;
+                       else
+                               return CDS_TRAY_OPEN;
                }
 
 
Signature · 1 line
	http://www.penguinpowered.com/~vii