linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: Mark Lord <lkml@rtr.ca>
Cc: Sebastian Kemper <sebastian_ml@gmx.net>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: libata/PATA: GPCMD_SET_STREAMING via SG_IO does nothing
Date: Thu, 15 Nov 2007 21:55:30 +0100	[thread overview]
Message-ID: <200711152155.30719.bzolnier@gmail.com> (raw)
In-Reply-To: <473B2EAA.4090802@rtr.ca>


Hi,

On Wednesday 14 November 2007, Mark Lord wrote:
> Sebastian Kemper wrote:
> > Hi Mark!
> > 
> > On Wed, Nov 14, 2007 at 11:41:37AM -0500, Mark Lord wrote:
> >> Ahh.. got it.  The host_status returned (not checked by that code) was 7,
> >> which means "host error".
> >>
> >> In this case, that's because the cmd_len is (16), which is too large for 
> >> ATAPI.
> >> It needs to be changed to (12) instead.
> > 
> > I don't understand. You seem to use a cmd_len of 16 in hdparm yourself.
> ..
> 
> Really?  Where?
> 
> 
> > And why does it work with the "old" ATA driver and not with libata if
> > 16 is too large for ATAPI in general?
> ..
> 
> Now that *is* the question.
> And the answer appears to be that ide-cd.c ignores the passed-in cmd_len,
> and replaces it with:
> 
>    cmd_len = COMMAND_SIZE(rq->cmd[0]);
> 
> That's a SCSI macro to calculate the correct cmd_len based on the SCSI opcode,
> which is very appropriate here.   We should do that too (we don't) in libata.
> 
> But not exactly as IDE does it -- that's actually a bug:  the code needs to also
> check that the new cmd_len is no larger than the original, or we'll get an Oops.
> 
> I'll cook up a patch for that shortly and try it before posting it here.

Could you please also fix ide-cd while at it?

Thanks,
Bart

  reply	other threads:[~2007-11-15 20:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-13 16:43 libata/PATA: GPCMD_SET_STREAMING via SG_IO does nothing Sebastian Kemper
2007-11-13 21:22 ` Alan Cox
2007-11-13 23:28   ` Sebastian Kemper
2007-11-14 12:11     ` Sebastian Kemper
2007-11-14 15:09     ` Mark Lord
2007-11-14 15:38       ` Sebastian Kemper
2007-11-14 16:00         ` Mark Lord
2007-11-14 17:44           ` [PATCH] libata-scsi: be tolerant of 12-byte ATAPI commands in 16-byte CDBs Mark Lord
2007-11-14 17:50             ` Alan Cox
2007-11-15  2:26             ` Tejun Heo
2007-11-14 16:26     ` libata/PATA: GPCMD_SET_STREAMING via SG_IO does nothing Mark Lord
2007-11-14 16:41       ` Mark Lord
2007-11-14 17:11         ` Sebastian Kemper
2007-11-14 17:21           ` Mark Lord
2007-11-15 20:55             ` Bartlomiej Zolnierkiewicz [this message]
2007-11-15 20:59               ` Mark Lord
2007-11-14 17:16       ` Sebastian Kemper
2007-11-14 17:49         ` Mark Lord

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=200711152155.30719.bzolnier@gmail.com \
    --to=bzolnier@gmail.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkml@rtr.ca \
    --cc=sebastian_ml@gmx.net \
    /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;
as well as URLs for NNTP newsgroup(s).