mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Lord <lkml@rtr.ca>
To: Mark Lord <liml@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: Wed, 14 Nov 2007 11:41:37 -0500	[thread overview]
Message-ID: <473B2541.10409@rtr.ca> (raw)
In-Reply-To: <473B219E.5060508@rtr.ca>

Mark Lord wrote:
> Sebastian Kemper wrote:
>> Hi Alan!
>>
>> On Tue, Nov 13, 2007 at 09:22:30PM +0000, Alan Cox wrote:
>>> It isn't a known issue, and it suprises me as SG_IO basically passes
>>> commands through to the drive. We don't support speed change via 
>>> xfermode
>>> setting but GPCMD_SET_STREAMING sohuld behave.
>>>
>>> Do you have a simple code example that shows the problem ?
>>
>> http://svn.mplayerhq.hu/mplayer/trunk/stream/stream_dvd.c?view=markup
> ..
> 
> That code is riddled with bugs, by the way.
> It fails to close/clean-up on just about every exit path.
> But apart from that, it does appear to issue the command.
> 
> Another way to the same thing is with "hdparm -E",
> which contrary to my earlier posting actually does
> seem to work already with libata.
> 
>> See dvd_set_speed(). The drive I'm using is an Optiarc DVD RW AD-7170A.
>> With the "old" ATA driver dvd_set_speed() works, with libata it doesn't.
> ..
> 
> Can you define "doesn't work" for me?
> How can I test this to see if it works one way or another ?
> 
> The command issue (ioctl) is not returning -1.
..

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.

So this line:  sghdr.cmd_len = 12;
The code (apart from totally mishandling any kinds of errors) works after that.

-ml

  reply	other threads:[~2007-11-14 16:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-13 16:43 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 [this message]
2007-11-14 17:11         ` Sebastian Kemper
2007-11-14 17:21           ` Mark Lord
2007-11-15 20:55             ` Bartlomiej Zolnierkiewicz
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=473B2541.10409@rtr.ca \
    --to=lkml@rtr.ca \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=liml@rtr.ca \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®