Re: bug: cd-rom autoclose no longer works (fix attempt)

From: Alexander Kern (alex.kern_at_gmx.de)
Date: 12/30/04

  • Next message: Richard McCreedy: "Compile error in 2.6.10-bk3 in floppy.c"
    To: Stas Sergeev <stsp@aknet.ru>
    Date:	Thu, 30 Dec 2004 20:52:57 +0100
    
    

    Am Donnerstag, 30. Dezember 2004 19:26 schrieb Stas Sergeev:
    > Hello.
    Hello,
    >
    > Alexander Kern wrote:
    > >> The ide-cd.c change is as per 2.4.20
    > >> which works. For some reasons
    > >> sense.ascq == 0 for me when the tray
    > >> is opened.
    > >
    > > ascq = 0 is legal.
    > > According to mmc3r10g
    > > asc 3a
    > > ascq 0 is MEDIUM NOT PRESENT
    > > ascq 1 is MEDIUM NOT PRESENT - TRAY CLOSED
    > > ascq 2 is MEDIUM NOT PRESENT - TRAY OPEN
    > > What in my eyes means, your drive is impossible to determine is tray open
    > > or closed.
    >
    > I think so too, this is the problem most
    > likely. However, my cd-roms are not that
    > ancient, I expect there are millions of
    > the like ones around. Breaking autoclose
    > for all of them after it worked for ages,
    > is no good IMO.
    >
    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.
    > > Linux assumes if not known tray is closed. That is better default, it
    > > avoids infinate trying to close.
    >
    > I don't think so. It is safe to assume the
    > tray is opened, at least it worked in the
    > past (or were there the real problems with
    > this?) You can always try to close it only
    > once, and if that still returns 0, then
    > bail out. One extra closing attempt should
    > not do any harm I suppose. That's exactly
    > what my patch does (I hope). And that's most
    > likely how it used to work before. I'll be
    > disappointed if autoclose will remain broken -
    > it was the very usefull feature, it will be
    > missed. Unless there are the real technical
    > reasons against the old behaviour, of course.
    Old behaviour has another problems, and revert to 2.4.20 code base is a bad
    solution. I have nothing against changing the default.
    The patch must be minimal...
             
            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;
                    }
             }

    Regards Alex

    P.S. S Novym Godom!
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Richard McCreedy: "Compile error in 2.6.10-bk3 in floppy.c"

    Relevant Pages

    • [PATCH] fix page->count discrepancy for zero page
      ... So, each time there's a COW fault on the zero-page, you ... In any case, it the bug doesn't cause any real problems, but it is a bit ... Attached patch is against 2.6.7 and applies to -mm3 properly. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • bug: cd-rom autoclose no longer works (fix attempt)
      ... Attached is the patch that fixes it ... rigth after the tray closed, ... With this patch autoclose works again. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] silence spinlock/rwlock uninitialized break_lock member warnings
      ... > so there's less to sift through when looking for real problems with this ... to add the patch himself. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: keyboard - was: Re: Linux 2.6.0-test4
      ... >> I was able to get the key unstuck by switching back and forth between ... I rebuild my kernel including your patch; ... I'll get back to you once I verify that the problem doesn't occur ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [parisc-linux] Re: [PATCH 3/9] mm: parisc pte atomicity
      ... using your own tmpalias area sounds much better than getting ... I've simply not wrapped my head around the races, ... it looks like we agree that my patch is necessary and valid as is; ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)