public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Douglas Gilbert <dougg@torque.net>
To: ltuikov@yahoo.com
Cc: linux-scsi <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] [SCSI] sg.c: SG_DXFER_TO_FROM_DEV mean DMA_BIDIRECTIONAL
Date: Sun, 05 Nov 2006 09:34:01 -0500	[thread overview]
Message-ID: <454DF659.6050608@torque.net> (raw)
In-Reply-To: <20465.60059.qm@web31801.mail.mud.yahoo.com>

Luben Tuikov wrote:
> SG_DXFER_TO_FROM_DEV means DMA_BIDIRECTIONAL, not
> DMA_FROM_DEVICE.
> 
> Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
> ---
>  drivers/scsi/sg.c |   11 +++++------
>  1 files changed, 5 insertions(+), 6 deletions(-)
> 
> This patch is 8 months old.

While this patch is sensible, it breaks a very arcane
usage that I inherited with the sg driver in 1998.
At that time there was no resid, so application clients
(e.g. cdrecord) had no way of knowing if the amount of
data they requested to be read, was actually read.
So, as indirect IO was the only game in town, the
hack used was to prefill the kernel buffer prior to
a read, and then check if it had been overwritten
after the read operation.
Hence SG_DXFER_TO_FROM_DEV was actually a read from
the device.

Some LLDs still do not implement resid (properly).

I'm happy to accept the change as long as people are
prepared to wear the breakage.

Doug Gilbert

  parent reply	other threads:[~2006-11-05 14:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-04 19:58 [PATCH] [SCSI] sg.c: SG_DXFER_TO_FROM_DEV mean DMA_BIDIRECTIONAL Luben Tuikov
2006-11-05  3:56 ` Jeff Garzik
2006-11-05 14:34 ` Douglas Gilbert [this message]
2006-11-05 22:54   ` 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=454DF659.6050608@torque.net \
    --to=dougg@torque.net \
    --cc=linux-scsi@vger.kernel.org \
    --cc=ltuikov@yahoo.com \
    /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