From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: grundler@google.com, linux1394-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: Re: [PATCH update] ieee1394: sbp2: enforce s/g segment size limit
Date: Thu, 14 Aug 2008 09:12:01 +0200 (CEST) [thread overview]
Message-ID: <tkrat.84add1a51a966d30@s5r6.in-berlin.de> (raw)
In-Reply-To: <20080814095549S.fujita.tomonori@lab.ntt.co.jp>
On 14 Aug, FUJITA Tomonori wrote:
> On Wed, 13 Aug 2008 12:19:59 +0200 (CEST)
> Stefan Richter <stefanr@s5r6.in-berlin.de> wrote:
>> I keep the original scsi_sg_count to call dma_unmap_sg with it
>> later.
>
> You need to keep it? You can access to it via scsi_sg_count when
> calling dma_unmap_sg? Seems that firewire code does.
Yes, I can easily do it this way; fixed below.
[...nents in dma_unmap_sg...]
> This is from Documentation/DMA-mapping.txt
Right. How did I forget about that?
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
Subject: ieee1394: sbp2: remove redundant struct members
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
---
drivers/ieee1394/sbp2.c | 14 +++++---------
drivers/ieee1394/sbp2.h | 4 ----
2 files changed, 5 insertions(+), 13 deletions(-)
Index: linux/drivers/ieee1394/sbp2.c
===================================================================
--- linux.orig/drivers/ieee1394/sbp2.c
+++ linux/drivers/ieee1394/sbp2.c
@@ -656,11 +656,11 @@ static struct sbp2_command_info *sbp2uti
static void sbp2util_mark_command_completed(struct sbp2_lu *lu,
struct sbp2_command_info *cmd)
{
- if (cmd->sg_buffer) {
- dma_unmap_sg(lu->ud->ne->host->device.parent, cmd->sg_buffer,
- cmd->sg_count, cmd->sg_dir);
- cmd->sg_buffer = NULL;
- }
+ if (scsi_sg_count(cmd->Current_SCpnt) > 0)
+ dma_unmap_sg(lu->ud->ne->host->device.parent,
+ scsi_sglist(cmd->Current_SCpnt),
+ scsi_sg_count(cmd->Current_SCpnt),
+ cmd->Current_SCpnt->sc_data_direction);
list_move_tail(&cmd->list, &lu->cmd_orb_completed);
}
@@ -1505,10 +1505,6 @@ static int sbp2_prep_command_orb_sg(stru
if (n == 0)
return -ENOMEM;
- cmd->sg_buffer = sg;
- cmd->sg_count = sg_count;
- cmd->sg_dir = dma_dir;
-
orb->data_descriptor_hi = ORB_SET_NODE_ID(hi->host->node_id);
orb->misc |= ORB_SET_DIRECTION(orb_direction);
Index: linux/drivers/ieee1394/sbp2.h
===================================================================
--- linux.orig/drivers/ieee1394/sbp2.h
+++ linux/drivers/ieee1394/sbp2.h
@@ -252,10 +252,6 @@ struct sbp2_command_info {
struct sbp2_unrestricted_page_table
scatter_gather_element[SG_ALL] __attribute__((aligned(8)));
dma_addr_t sge_dma;
-
- struct scatterlist *sg_buffer;
- int sg_count;
- enum dma_data_direction sg_dir;
};
/* Per FireWire host */
--
Stefan Richter
-=====-==--- =--- -===-
http://arcgraph.de/sr/
next prev parent reply other threads:[~2008-08-14 7:12 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-08 19:44 Scatter-gather segment merges by IOMMU? Stefan Richter
2008-08-08 20:25 ` Grant Grundler
2008-08-08 21:21 ` Stefan Richter
2008-08-08 21:31 ` FUJITA Tomonori
2008-08-08 21:58 ` Stefan Richter
2008-08-08 22:17 ` FUJITA Tomonori
2008-08-09 18:20 ` [PATCH] ieee1394: sbp2: enforce s/g segment size limit Stefan Richter
2008-08-09 18:21 ` [PATCH] firewire: fw-sbp2: " Stefan Richter
2008-08-11 19:52 ` Grant Grundler
2008-08-13 9:38 ` Stefan Richter
2008-08-12 17:04 ` [PATCH] ieee1394: sbp2: " Grant Grundler
2008-08-12 23:44 ` FUJITA Tomonori
2008-08-13 10:19 ` [PATCH update] " Stefan Richter
2008-08-13 10:20 ` [PATCH update] firewire: fw-sbp2: " Stefan Richter
2008-08-13 10:27 ` [PATCH update] ieee1394: sbp2: " Stefan Richter
2008-08-14 0:55 ` FUJITA Tomonori
2008-08-14 7:12 ` Stefan Richter [this message]
2008-08-14 7:21 ` FUJITA Tomonori
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.84add1a51a966d30@s5r6.in-berlin.de \
--to=stefanr@s5r6.in-berlin.de \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=grundler@google.com \
--cc=linux-kernel@vger.kernel.org \
--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
all inboxes | Powered by JetHome®