public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: r.sricharan@ti•com (R Sricharan)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH v4] ARM: LPAE: Fix mapping in alloc_init_pte for unaligned addresses
Date: Mon, 4 Feb 2013 16:40:36 +0530	[thread overview]
Message-ID: <510F972C.6020103@ti.com> (raw)
In-Reply-To: <510F3CA3.7080604@ti.com>

Hi,

On Monday 04 February 2013 10:14 AM, R Sricharan wrote:
> On Monday 04 February 2013 10:10 AM, R Sricharan wrote:
>> Hi Catalin,
>>
>> [ snip..]
>>>
>>> diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
>>> index 9f06102..47154f3 100644
>>> --- a/arch/arm/mm/mmu.c
>>> +++ b/arch/arm/mm/mmu.c
>>> @@ -581,34 +581,36 @@ static void __init alloc_init_section(pud_t
>>> *pud, unsigned long addr,
>>>                         const struct mem_type *type)
>>>   {
>>>       pmd_t *pmd = pmd_offset(pud, addr);
>>> +    unsigned long next;
>>>
>>> -    /*
>>> -     * Try a section mapping - end, addr and phys must all be aligned
>>> -     * to a section boundary.  Note that PMDs refer to the individual
>>> -     * L1 entries, whereas PGDs refer to a group of L1 entries making
>>> -     * up one logical pointer to an L2 table.
>>> -     */
>>> -    if (type->prot_sect && ((addr | end | phys) & ~SECTION_MASK) ==
>>> 0) {
>>> -        pmd_t *p = pmd;
>>> +    do {
>>> +        next = pmd_addr_end(addr, end);
>>> +
>>> +        /*
>>> +         * Try a section mapping - next, addr and phys must all be
>>> +         * aligned to a section boundary.  Note that PMDs refer to the
>>> +         * individual L1 entries, whereas PGDs refer to a group of L1
>>> +         * entries making up one logical pointer to an L2 table.
>>> +         */
>>> +        if (((addr | next | phys) & ~SECTION_MASK) == 0) {
>>> +            pmd_t *p = pmd;
>>>
>>     There is a  need to do page mappings even when all the addresses
>>     are aligned. This was added with CMA, which required the initial
>>     mappings to be set with 2 level tables.
>>
>     Sorry, i wanted to ask type->prot_sect is removed here and is that
>    intentional?
       Tested this patch on OMAP5. The type->prot_sect check is
       required, without which mappings are not even created for CMA.
       (ie) type->prot_sect is not set when this function is called
       in CMA context, thus no valid mapping is created.

       After fixing this, the LPAE + CMA enabled combination booted
       fine on OMAP5.

Regards,
  Sricharan

  reply	other threads:[~2013-02-04 11:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-29 15:07 [PATCH v4] ARM: LPAE: Fix mapping in alloc_init_pte for unaligned addresses R Sricharan
2013-02-01  6:21 ` Santosh Shilimkar
2013-02-01 16:26 ` Catalin Marinas
2013-02-01 16:32   ` Christoffer Dall
2013-02-01 16:37     ` Catalin Marinas
2013-02-01 16:40       ` Christoffer Dall
2013-02-01 17:42         ` Catalin Marinas
2013-02-01 18:37           ` Christoffer Dall
2013-02-04  4:40           ` R Sricharan
2013-02-04  4:44             ` R Sricharan
2013-02-04 11:10               ` R Sricharan [this message]
2013-02-06 12:15               ` Catalin Marinas
2013-02-06 12:22                 ` Russell King - ARM Linux
2013-02-06 12:33                   ` Catalin Marinas
2013-02-06 13:59                     ` R Sricharan
2013-02-06 13:56                 ` R Sricharan
2013-02-06 15:16                   ` Catalin Marinas
2013-02-06 15:25                     ` R Sricharan

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=510F972C.6020103@ti.com \
    --to=r.sricharan@ti$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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