From: Felipe Contreras <felipe.contreras@gmail.com>
To: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Cc: linux-omap@vger.kernel.org, h-kanigeri2@ti.com,
vimarsh.zutshi@nokia.com, Sakari.Ailus@nokia.com,
david.cohen@nokia.com
Subject: Re: [PATCH 2/5] omap iommu: Fix superpage unalignment at allocation of iovm areas
Date: Fri, 7 May 2010 10:19:33 +0300 [thread overview]
Message-ID: <n2u94a0d4531005070019o7c40e334rde44fcc636bf2a2b@mail.gmail.com> (raw)
In-Reply-To: <1273215364-15098-2-git-send-email-Hiroshi.DOYU@nokia.com>
On Fri, May 7, 2010 at 9:56 AM, Hiroshi DOYU <Hiroshi.DOYU@nokia.com> wrote:
> From: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
>
> Superpage addresses should be aligned on mapping size of 4KB, 64KB,
> 1MB and 16MB respectively both for physical and device virtual
> addresses.
>
> Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
> ---
> arch/arm/plat-omap/iovmm.c | 122 +++++++++++++++++++++++++------------------
> 1 files changed, 71 insertions(+), 51 deletions(-)
> @@ -127,13 +100,8 @@ static struct sg_table *sgtable_alloc(const size_t bytes, u32 flags)
> if (!IS_ALIGNED(bytes, PAGE_SIZE))
> return ERR_PTR(-EINVAL);
>
> - /* FIXME: IOVMF_DA_FIXED should support 'superpages' */
> - if ((flags & IOVMF_LINEAR) && (flags & IOVMF_DA_ANON)) {
> - nr_entries = sgtable_nents(bytes);
> - if (!nr_entries)
> - return ERR_PTR(-EINVAL);
> - } else
> - nr_entries = bytes / PAGE_SIZE;
> + /* FIXME: Maximam number of entries are always prepared. */
Typo: maximum.
> +static void alloc_area_by_size(u32 start, u32 end, u32 unit,
> + struct scatterlist **_sg)
> +{
> + u32 addr;
> +
> + if (unit == 0)
> + return;
> +
> + if (start == end)
> + return;
> +
> + addr = ALIGN(start, unit);
> + if (addr > end) {
> + /* retry with smaller granularity */
> + alloc_area_by_size(start, end, iopgsz_max(unit - 1), _sg);
> + return;
> + }
> + /* lower chuck with smaller granularity */
Typo: chunk (I guess).
> + alloc_area_by_size(start, addr, iopgsz_max(unit - 1), _sg);
> +
> + addr = __alloc_area_by_size(addr, end, unit, _sg);
> + if (addr < end)
> + /* higher chuck with smaller granularity */
Another typo?
--
Felipe Contreras
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2010-05-07 7:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-07 6:56 [PATCH 1/5] omap iommu: Reject unaligned physical address at setting page table entry Hiroshi DOYU
2010-05-07 6:56 ` [PATCH 2/5] omap iommu: Fix superpage unalignment at allocation of iovm areas Hiroshi DOYU
2010-05-07 7:19 ` Felipe Contreras [this message]
2010-05-07 6:56 ` [PATCH 3/5] omap iommu: Make CONFIG_OMAP_IOMMU_DEBUG selectable Hiroshi DOYU
2010-05-07 6:56 ` [PATCH 4/5] omap iommu: Insert a gap page between IOVMAs against override Hiroshi DOYU
2010-05-07 6:56 ` [PATCH 5/5] omap iommu: Exit iteration if no possibility of available area Hiroshi DOYU
2010-05-07 11:45 ` [PATCH 1/5] omap iommu: Reject unaligned physical address at setting page table entry Kanigeri, Hari
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=n2u94a0d4531005070019o7c40e334rde44fcc636bf2a2b@mail.gmail.com \
--to=felipe.contreras@gmail.com \
--cc=Hiroshi.DOYU@nokia.com \
--cc=Sakari.Ailus@nokia.com \
--cc=david.cohen@nokia.com \
--cc=h-kanigeri2@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=vimarsh.zutshi@nokia.com \
/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;
as well as URLs for NNTP newsgroup(s).