public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [SCSI] sg.c: SG_DXFER_TO_FROM_DEV mean DMA_BIDIRECTIONAL
@ 2006-11-04 19:58 Luben Tuikov
  2006-11-05  3:56 ` Jeff Garzik
  2006-11-05 14:34 ` Douglas Gilbert
  0 siblings, 2 replies; 4+ messages in thread
From: Luben Tuikov @ 2006-11-04 19:58 UTC (permalink / raw)
  To: linux-scsi; +Cc: Douglas Gilbert

[-- 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-11-05 22:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2006-11-05 22:54   ` James Bottomley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox