mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: linux1394-devel@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org, "Kristian Høgsberg" <krh@redhat.com>
Subject: Re: [PATCH corrected] firewire: fw-ohci: fix DMA mapping for ar context
Date: Tue, 16 Oct 2007 21:49:44 +0200	[thread overview]
Message-ID: <471515D8.8040703@s5r6.in-berlin.de> (raw)
In-Reply-To: <tkrat.c21e564719351bc6@s5r6.in-berlin.de>

I wrote:
> The CPU must not touch the buffer after it was DMA-mapped.
> 
> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
> ---
>  drivers/firewire/fw-ohci.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> Index: linux/drivers/firewire/fw-ohci.c
> ===================================================================
> --- linux.orig/drivers/firewire/fw-ohci.c
> +++ linux/drivers/firewire/fw-ohci.c
> @@ -258,6 +258,7 @@ static int ar_context_add_page(struct ar
>  		free_page((unsigned long) ab);
>  		return -ENOMEM;
>  	}
> +	dma_sync_single_for_cpu(dev, ab_bus, PAGE_SIZE, DMA_BIDIRECTIONAL);
>  
>  	memset(&ab->descriptor, 0, sizeof(ab->descriptor));
>  	ab->descriptor.control        = cpu_to_le16(DESCRIPTOR_INPUT_MORE |
> 

This is still not complete:

in ar_context_add_page():
	ctx->last_buffer->descriptor.branch_address = ...;

in ar_context_tasklet():
	dma_unmap_single(ohci->card.device,
		le32_to_cpu(ab->descriptor.data_address) - offset,
		PAGE_SIZE, DMA_BIDIRECTIONAL);

They both access DMA-mapped areas.
-- 
Stefan Richter
-=====-=-=== =-=- =----
http://arcgraph.de/sr/

      parent reply	other threads:[~2007-10-16 19:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-16 17:25 [PATCH] " Stefan Richter
2007-10-16 17:35 ` Stefan Richter
2007-10-16 17:40   ` [PATCH corrected] " Stefan Richter
2007-10-16 17:58     ` [PATCH] firewire: fw-ohci: optimize initialization of " Stefan Richter
2007-10-16 18:30       ` [PATCH] firewire: fw-ohci: avoid an atomic allocation Stefan Richter
2007-10-16 19:49     ` Stefan Richter [this message]

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=471515D8.8040703@s5r6.in-berlin.de \
    --to=stefanr@s5r6.in-berlin.de \
    --cc=krh@redhat.com \
    --cc=linux-kernel@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®