From: Erik Andersen <andersen@codepoet.org>
To: Marcelo Tosatti <marcelo@conectiva.com.br>
Cc: lkml <linux-kernel@vger.kernel.org>, Jens Axboe <axboe@suse.de>
Subject: Re: [PATCH] cdrom sane fallback vs 2.4.20-pre1
Date: Mon, 12 Aug 2002 22:12:44 -0600 [thread overview]
Message-ID: <20020813041243.GA23433@codepoet.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0208122357590.3620-100000@freak.distro.conectiva>
On Mon Aug 12, 2002 at 11:58:26PM -0300, Marcelo Tosatti wrote:
>
>
> On Sun, 11 Aug 2002, Erik Andersen wrote:
>
> > --- drivers/cdrom/cdrom.c~ Sun Aug 11 15:37:20 2002
> > +++ drivers/cdrom/cdrom.c Sun Aug 11 15:37:24 2002
> > @@ -1916,6 +1916,7 @@
> > {
> > struct cdrom_device_ops *cdo = cdi->ops;
> > struct cdrom_generic_command cgc;
> > + struct request_sense sense;
> > kdev_t dev = cdi->dev;
> > char buffer[32];
> > int ret = 0;
> > @@ -1951,9 +1952,11 @@
> > cgc.buffer = (char *) kmalloc(blocksize, GFP_KERNEL);
> > if (cgc.buffer == NULL)
> > return -ENOMEM;
> > + memset(&sense, 0, sizeof(sense));
> > + cgc.sense = &sense;
> > cgc.data_direction = CGC_DATA_READ;
> > ret = cdrom_read_block(cdi, &cgc, lba, 1, format, blocksize);
> > - if (ret) {
> > + if (ret && sense.sense_key==0x05 && sense.asc==0x20 && sense.ascq==0x00) {
>
> Do you really need to hardcode this values ?
This allows it to falls back to READ_10 only when the drive
reports "Hey! You gave me an invalid command!" which is the one
and only case when a fall back to READ_10 is appropriate. I am
not aware of any other reason for which a fallback to READ_10 is
useful.
-Erik
--
Erik B. Andersen http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--
next prev parent reply other threads:[~2002-08-13 4:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-11 21:59 [PATCH] cdrom sane fallback vs 2.4.20-pre1 Erik Andersen
2002-08-13 2:58 ` Marcelo Tosatti
2002-08-13 4:12 ` Erik Andersen [this message]
2002-08-16 3:12 ` Oliver Xymoron
2002-08-13 8:42 ` Jens Axboe
-- strict thread matches above, loose matches on Subject: below --
2002-08-13 14:13 James Bottomley
2002-08-13 15:48 ` Randy.Dunlap
2002-08-13 16:14 ` Jens Axboe
2002-08-13 16:21 ` James Bottomley
2002-08-13 16:25 ` Randy.Dunlap
2002-08-13 16:37 ` Jens Axboe
2002-08-13 17:10 ` James Bottomley
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=20020813041243.GA23433@codepoet.org \
--to=andersen@codepoet.org \
--cc=axboe@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@conectiva.com.br \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox