From: Tim Nordell <tim.nordell@logicpd.com>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
linux-media@vger.kernel.org, iommu@lists.linux-foundation.org
Subject: Re: [PATCH v2 25/26] omap3isp: Move to videobuf2
Date: Wed, 18 Mar 2015 17:43:41 -0500 [thread overview]
Message-ID: <5509FF9D.8060106@logicpd.com> (raw)
In-Reply-To: <20150318214425.GL11954@valkosipuli.retiisi.org.uk>
On 03/18/15 16:44, Sakari Ailus wrote:
>
> I don't think omap3isp has been using this very long. A few minor versions
> perhaps.
>
>> Do you know if this common code is supposed to guarantee a
>> physically contiguous memory region? The documentation for the
>> function doesn't indicate that it should, and it certainly doesn't
>> as-is. It seems like hitting this issue is highly dependent on the
>> size of the buffer one is allocating.
>
> I guess there aren't too many drivers that may map large areas of memory
> pinned using get_user_pages() to IOMMU. If dma_map_sg() couldn't be used to
> allocate virtually contiguous memory, then what could be? This looks like a
> bug in __iommu_map_sg() to me.
>
> Cc the iommu list.
>
After staring at this for a while, I realized that the mm/dma-mapping.c
is doing exactly what it's supposed to (and works similarly to how I was
starting to refactor the outer function) and that the omap3isp driver
needs to do one further step in initialization.
There is a call dma_set_max_seg_size(...) that defines how the code in
dma-mapping.c chunks things up. If it's set larger, the dma-mapping
routine will allocate larger physically contiguous chunks in the virtual
memory space. Any clue where the best place in omap3isp to set this is?
At least it's a short patch to omap3isp to fix this behavior. I'll be
sending a patch along shortly.
- Tim
WARNING: multiple messages have this Message-ID (diff)
From: Tim Nordell <tim.nordell@logicpd.com>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
<linux-media@vger.kernel.org>, <iommu@lists.linux-foundation.org>
Subject: Re: [PATCH v2 25/26] omap3isp: Move to videobuf2
Date: Wed, 18 Mar 2015 17:43:41 -0500 [thread overview]
Message-ID: <5509FF9D.8060106@logicpd.com> (raw)
In-Reply-To: <20150318214425.GL11954@valkosipuli.retiisi.org.uk>
On 03/18/15 16:44, Sakari Ailus wrote:
>
> I don't think omap3isp has been using this very long. A few minor versions
> perhaps.
>
>> Do you know if this common code is supposed to guarantee a
>> physically contiguous memory region? The documentation for the
>> function doesn't indicate that it should, and it certainly doesn't
>> as-is. It seems like hitting this issue is highly dependent on the
>> size of the buffer one is allocating.
>
> I guess there aren't too many drivers that may map large areas of memory
> pinned using get_user_pages() to IOMMU. If dma_map_sg() couldn't be used to
> allocate virtually contiguous memory, then what could be? This looks like a
> bug in __iommu_map_sg() to me.
>
> Cc the iommu list.
>
After staring at this for a while, I realized that the mm/dma-mapping.c
is doing exactly what it's supposed to (and works similarly to how I was
starting to refactor the outer function) and that the omap3isp driver
needs to do one further step in initialization.
There is a call dma_set_max_seg_size(...) that defines how the code in
dma-mapping.c chunks things up. If it's set larger, the dma-mapping
routine will allocate larger physically contiguous chunks in the virtual
memory space. Any clue where the best place in omap3isp to set this is?
At least it's a short patch to omap3isp to fix this behavior. I'll be
sending a patch along shortly.
- Tim
next prev parent reply other threads:[~2015-03-18 22:43 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-21 12:28 [PATCH v2 00/26] OMAP3 ISP: Move to videobuf2 Laurent Pinchart
2014-04-21 12:28 ` [PATCH v2 01/26] omap3isp: stat: Rename IS_COHERENT_BUF to ISP_STAT_USES_DMAENGINE Laurent Pinchart
2014-04-30 22:45 ` Sakari Ailus
2014-04-30 22:48 ` Laurent Pinchart
2014-05-01 11:15 ` Sakari Ailus
2014-05-01 16:08 ` Laurent Pinchart
2014-04-21 12:28 ` [PATCH v2 02/26] omap3isp: stat: Remove impossible WARN_ON Laurent Pinchart
2014-04-21 12:28 ` [PATCH v2 03/26] omap3isp: stat: Share common code for buffer allocation Laurent Pinchart
2014-04-21 12:28 ` [PATCH v2 04/26] omap3isp: stat: Merge dma_addr and iommu_addr fields Laurent Pinchart
2014-04-21 12:28 ` [PATCH v2 05/26] omap3isp: stat: Store sg table in ispstat_buffer Laurent Pinchart
2014-04-21 12:28 ` [PATCH v2 06/26] omap3isp: stat: Use the DMA API Laurent Pinchart
2014-04-21 12:28 ` [PATCH v2 07/26] omap3isp: ccdc: Use the DMA API for LSC Laurent Pinchart
2014-04-21 12:28 ` [PATCH v2 08/26] omap3isp: ccdc: Use the DMA API for FPC Laurent Pinchart
2014-04-21 12:28 ` [PATCH v2 09/26] omap3isp: video: Set the buffer bytesused field at completion time Laurent Pinchart
2014-04-21 12:28 ` [PATCH v2 10/26] omap3isp: queue: Move IOMMU handling code to the queue Laurent Pinchart
2014-04-21 12:28 ` [PATCH v2 11/26] omap3isp: queue: Use sg_table structure Laurent Pinchart
2014-04-21 12:28 ` [PATCH v2 12/26] omap3isp: queue: Merge the prepare and sglist functions Laurent Pinchart
2014-04-21 12:28 ` [PATCH v2 13/26] omap3isp: queue: Inline the ispmmu_v(un)map functions Laurent Pinchart
2014-04-21 12:29 ` [PATCH v2 14/26] omap3isp: queue: Allocate kernel buffers with dma_alloc_coherent Laurent Pinchart
2014-04-21 12:29 ` [PATCH v2 15/26] omap3isp: queue: Fix the dma_map_sg() return value check Laurent Pinchart
2014-04-21 12:29 ` [PATCH v2 16/26] omap3isp: queue: Map PFNMAP buffers to device Laurent Pinchart
2014-04-21 12:29 ` [PATCH v2 17/26] omap3isp: queue: Use sg_alloc_table_from_pages() Laurent Pinchart
2014-04-21 12:29 ` [PATCH v2 18/26] omap3isp: Use the ARM DMA IOMMU-aware operations Laurent Pinchart
2014-04-21 12:29 ` [PATCH v2 19/26] omap3isp: queue: Don't build scatterlist for kernel buffer Laurent Pinchart
2014-04-21 12:29 ` [PATCH v2 20/26] omap3isp: Move queue mutex to isp_video structure Laurent Pinchart
2014-04-21 12:29 ` [PATCH v2 21/26] omap3isp: Move queue irqlock " Laurent Pinchart
2014-04-21 12:29 ` [PATCH v2 22/26] omap3isp: Move buffer irqlist to isp_buffer structure Laurent Pinchart
2014-04-21 12:29 ` [PATCH v2 23/26] omap3isp: Cancel all queued buffers when stopping the video stream Laurent Pinchart
2014-04-21 12:29 ` [PATCH v2 24/26] v4l: vb2: Add a function to discard all DONE buffers Laurent Pinchart
2014-04-21 12:29 ` [PATCH v2 25/26] omap3isp: Move to videobuf2 Laurent Pinchart
2015-03-17 22:57 ` Tim Nordell
2015-03-18 12:39 ` Laurent Pinchart
2015-03-18 14:54 ` Tim Nordell
2015-03-18 14:59 ` Laurent Pinchart
2015-03-18 15:19 ` Tim Nordell
2015-03-18 15:21 ` Laurent Pinchart
2015-03-18 19:49 ` Tim Nordell
2015-03-18 20:58 ` Tim Nordell
2015-03-18 21:44 ` Sakari Ailus
2015-03-18 22:43 ` Tim Nordell [this message]
2015-03-18 22:43 ` Tim Nordell
2014-04-21 12:29 ` [PATCH v2 26/26] omap3isp: Rename isp_buffer isp_addr field to dma Laurent Pinchart
2014-05-01 17:37 ` [PATCH v2 00/26] OMAP3 ISP: Move to videobuf2 Sakari Ailus
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=5509FF9D.8060106@logicpd.com \
--to=tim.nordell@logicpd.com \
--cc=iommu@lists.linux-foundation.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=sakari.ailus@iki.fi \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.