All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luben Tuikov <ltuikov@yahoo.com>
To: linux-scsi <linux-scsi@vger.kernel.org>
Cc: Douglas Gilbert <dougg@torque.net>
Subject: [PATCH] [SCSI] sg.c: SG_DXFER_TO_FROM_DEV mean DMA_BIDIRECTIONAL
Date: Sat, 4 Nov 2006 11:58:15 -0800 (PST)	[thread overview]
Message-ID: <20465.60059.qm@web31801.mail.mud.yahoo.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 248 bytes --]

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.

     Luben

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 2098548068-sg2.txt --]
[-- Type: text/inline; name="sg2.txt", Size: 1272 bytes --]

diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 5a0a193..3f81477 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -608,12 +608,11 @@ sg_write(struct file *filp, const char _
 	if (hp->dxfer_direction == SG_DXFER_TO_FROM_DEV)
 		if (printk_ratelimit())
 			printk(KERN_WARNING
-			       "sg_write: data in/out %d/%d bytes for SCSI command 0x%x--"
-			       "guessing data in;\n" KERN_WARNING "   "
-			       "program %s not setting count and/or reply_len properly\n",
+			       "sg_write: program %s: data in/out %d/%d bytes for SCSI command 0x%x--"
+			       "bidirectional;\n",
+			       current->comm,
 			       old_hdr.reply_len - (int)SZ_SG_HEADER,
-			       input_size, (unsigned int) cmnd[0],
-			       current->comm);
+			       input_size, (unsigned int) cmnd[0]);
 	k = sg_common_write(sfp, srp, cmnd, sfp->timeout, blocking);
 	return (k < 0) ? k : count;
 }
@@ -724,13 +723,13 @@ sg_common_write(Sg_fd * sfp, Sg_request
 	}
 
 	switch (hp->dxfer_direction) {
-	case SG_DXFER_TO_FROM_DEV:
 	case SG_DXFER_FROM_DEV:
 		data_dir = DMA_FROM_DEVICE;
 		break;
 	case SG_DXFER_TO_DEV:
 		data_dir = DMA_TO_DEVICE;
 		break;
+	case SG_DXFER_TO_FROM_DEV:
 	case SG_DXFER_UNKNOWN:
 		data_dir = DMA_BIDIRECTIONAL;
 		break;
-- 
1.4.3.3.g8478


             reply	other threads:[~2006-11-04 19:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-04 19:58 Luben Tuikov [this message]
2006-11-05  3:56 ` [PATCH] [SCSI] sg.c: SG_DXFER_TO_FROM_DEV mean DMA_BIDIRECTIONAL Jeff Garzik
2006-11-05 14:34 ` Douglas Gilbert
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=20465.60059.qm@web31801.mail.mud.yahoo.com \
    --to=ltuikov@yahoo.com \
    --cc=dougg@torque.net \
    --cc=linux-scsi@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.