public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: linux1394-devel@lists.sourceforge.net
Cc: linux-scsi@vger.kernel.org
Subject: [PATCH] ieee1394: sbp2: enforce 32bit DMA mapping
Date: Sun, 4 Feb 2007 13:05:40 +0100 (CET)	[thread overview]
Message-ID: <tkrat.61995f33104845d9@s5r6.in-berlin.de> (raw)
In-Reply-To: <tkrat.e82713a8340840b3@s5r6.in-berlin.de>

In order to use OHCI physical DMA, all s/g elements, s/g tables, ORBs,
and response buffers have to reside within the first 4 GB of the
FireWire controller's physical address space.  Set the correct mask for
DMA mappings.

Also ensure that the memory allocated for command ORBs and s/g tables is
suitable for DMA.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
---
Should I use GFP_DMA32 instead of GFP_DMA?


 drivers/ieee1394/sbp2.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Index: linux-2.6.20-rc5/drivers/ieee1394/sbp2.c
===================================================================
--- linux-2.6.20-rc5.orig/drivers/ieee1394/sbp2.c
+++ linux-2.6.20-rc5/drivers/ieee1394/sbp2.c
@@ -477,7 +477,7 @@ static int sbp2util_create_command_orb_p
 
 	spin_lock_irqsave(&lu->cmd_orb_lock, flags);
 	for (i = 0; i < orbs; i++) {
-		cmd = kzalloc(sizeof(*cmd), GFP_ATOMIC);
+		cmd = kzalloc(sizeof(*cmd), GFP_ATOMIC | GFP_DMA);
 		if (!cmd) {
 			spin_unlock_irqrestore(&lu->cmd_orb_lock, flags);
 			return -ENOMEM;
@@ -757,6 +757,11 @@ static struct sbp2_lu *sbp2_alloc_device
 			SBP2_ERR("failed to register lower 4GB address range");
 			goto failed_alloc;
 		}
+#else
+		if (dma_set_mask(hi->host->device.parent, DMA_32BIT_MASK)) {
+			SBP2_ERR("failed to set 4GB DMA mask");
+			goto failed_alloc;
+		}
 #endif
 	}
 


-- 
Stefan Richter
-=====-=-=== --=- --=--
http://arcgraph.de/sr/


  reply	other threads:[~2007-02-04 12:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-14 18:45 [PATCH] ieee1394: sbp2: lower block queue alignment requirement Stefan Richter
2007-01-14 19:19 ` James Bottomley
2007-01-14 20:14   ` Stefan Richter
2007-01-15 19:39     ` Kristian Høgsberg
2007-01-15 19:50       ` Mike Christie
2007-01-15 20:02       ` Stefan Richter
2007-01-15 21:24         ` James Bottomley
2007-01-25 21:35   ` Stefan Richter
2007-02-04 12:04     ` [PATCH] ieee1394: sbp2: remove unnecessary alignments of struct members Stefan Richter
2007-02-04 12:05       ` Stefan Richter [this message]
2007-02-04 16:06         ` [PATCH] ieee1394: sbp2: enforce 32bit DMA mapping David Moore
2007-02-04 19:25           ` Stefan Richter

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=tkrat.61995f33104845d9@s5r6.in-berlin.de \
    --to=stefanr@s5r6.in-berlin.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.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