[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.1807231444150.1328-100000@iolanthe.rowland.org>
Date: Mon, 23 Jul 2018 14:57:23 -0400 (EDT)
From: Alan Stern <stern@...land.harvard.edu>
To: "Matwey V. Kornilov" <matwey@....msu.ru>
cc: Tomasz Figa <tfiga@...omium.org>,
Ezequiel Garcia <ezequiel@...labora.com>,
Hans de Goede <hdegoede@...hat.com>,
Hans Verkuil <hverkuil@...all.nl>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Steven Rostedt <rostedt@...dmis.org>, <mingo@...hat.com>,
Mike Isely <isely@...ox.com>,
Bhumika Goyal <bhumirks@...il.com>,
Colin King <colin.king@...onical.com>,
Linux Media Mailing List <linux-media@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Kieran Bingham <kieran.bingham@...asonboard.com>,
<keiichiw@...omium.org>
Subject: Re: [PATCH 2/2] media: usb: pwc: Don't use coherent DMA buffers for
ISO transfer
On Mon, 23 Jul 2018, Matwey V. Kornilov wrote:
> I've tried to strategies:
>
> 1) Use dma_unmap and dma_map inside the handler (I suppose this is
> similar to how USB core does when there is no URB_NO_TRANSFER_DMA_MAP)
Yes.
> 2) Use sync_cpu and sync_device inside the handler (and dma_map only
> once at memory allocation)
>
> It is interesting that dma_unmap/dma_map pair leads to the lower
> overhead (+1us) than sync_cpu/sync_device (+2us) at x86_64 platform.
> At armv7l platform using dma_unmap/dma_map leads to ~50 usec in the
> handler, and sync_cpu/sync_device - ~65 usec.
>
> However, I am not sure is it mandatory to call
> dma_sync_single_for_device for FROM_DEVICE direction?
According to Documentation/DMA-API-HOWTO.txt, the CPU should not write
to a DMA_FROM_DEVICE-mapped area, so dma_sync_single_for_device() is
not needed.
Alan Stern
Powered by blists - more mailing lists