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
prev parent reply other threads:[~2015-03-18 22:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1398083352-8451-1-git-send-email-laurent.pinchart@ideasonboard.com>
[not found] ` <2315546.eR07gyadH5@avalon>
[not found] ` <55099773.2010809@logicpd.com>
[not found] ` <2250003.9yO29CjKoc@avalon>
[not found] ` <5509D6BC.6080006@logicpd.com>
[not found] ` <5509E6DF.4080900@logicpd.com>
2015-03-18 21:44 ` [PATCH v2 25/26] omap3isp: Move to videobuf2 Sakari Ailus
2015-03-18 22:43 ` Tim Nordell [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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox