All of lore.kernel.org
 help / color / mirror / Atom feed
From: Murali Nalajala <mnalajal@codeaurora.org>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Trilok Soni <tsoni@codeaurora.org>,
	Laura Abbott <lauraa@codeaurora.org>,
	"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	nico@linaro.org
Subject: Re: ioremap() fail on physical address 0x0 in 3.4 kernel
Date: Wed, 22 Aug 2012 17:33:41 +0530	[thread overview]
Message-ID: <5034CA9D.1070001@codeaurora.org> (raw)
In-Reply-To: <20120822095302.GX18957@n2100.arm.linux.org.uk>

On 8/22/2012 3:23 PM, Russell King - ARM Linux wrote:
> On Wed, Aug 22, 2012 at 12:16:08PM +0530, Trilok Soni wrote:
>> Thanks for the patch, but how about just checking pmd_none on such
>> addresses and since there won't be any mapping created for such gaps? We
>> need to check if this is fine for all, since I remember that Nico
>> added these functions for the OMAP boot issue I guess.
>
> A better solution would be as below - this requires no changes to the
> existing ioremap code, we just mark these differently.
>
> diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h
> index 2e8a1ef..87fa3f2 100644
> --- a/arch/arm/mm/mm.h
> +++ b/arch/arm/mm/mm.h
> @@ -55,6 +55,9 @@ extern void __flush_dcache_page(struct address_space *mapping, struct page *page
>   /* permanent static mappings from iotable_init() */
>   #define VM_ARM_STATIC_MAPPING	0x40000000
>
> +/* empty mapping */
> +#define VM_ARM_EMPTY_MAPPING	0x20000000
> +
>   /* mapping type (attributes) for permanent static mappings */
>   #define VM_ARM_MTYPE(mt)		((mt)<<  20)
>   #define VM_ARM_MTYPE_MASK	(0x1f<<  20)
> diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
> index cf4528d..da90ef1 100644
> --- a/arch/arm/mm/mmu.c
> +++ b/arch/arm/mm/mmu.c
> @@ -813,7 +813,7 @@ static void __init pmd_empty_section_gap(unsigned long addr)
>   	vm = early_alloc_aligned(sizeof(*vm), __alignof__(*vm));
>   	vm->addr = (void *)addr;
>   	vm->size = SECTION_SIZE;
> -	vm->flags = VM_IOREMAP | VM_ARM_STATIC_MAPPING;
> +	vm->flags = VM_IOREMAP | VM_ARM_EMPTY_MAPPING;
>   	vm->caller = pmd_empty_section_gap;
>   	vm_area_add_early(vm);
>   }
> @@ -826,7 +826,7 @@ static void __init fill_pmd_gaps(void)
>
>   	/* we're still single threaded hence no lock needed here */
>   	for (vm = vmlist; vm; vm = vm->next) {
> -		if (!(vm->flags&  VM_ARM_STATIC_MAPPING))
> +		if (!(vm->flags&  (VM_ARM_STATIC_MAPPING | VM_ARM_EMPTY_MAPPING))
>   			continue;
>   		addr = (unsigned long)vm->addr;
>   		if (addr<  next)
>
Tested on MSM platform

Tested-by: Murali Nalajala <mnalajal@codeaurora.org>

Thanks,
Murali N

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

WARNING: multiple messages have this Message-ID (diff)
From: mnalajal@codeaurora.org (Murali Nalajala)
To: linux-arm-kernel@lists.infradead.org
Subject: ioremap() fail on physical address 0x0 in 3.4 kernel
Date: Wed, 22 Aug 2012 17:33:41 +0530	[thread overview]
Message-ID: <5034CA9D.1070001@codeaurora.org> (raw)
In-Reply-To: <20120822095302.GX18957@n2100.arm.linux.org.uk>

On 8/22/2012 3:23 PM, Russell King - ARM Linux wrote:
> On Wed, Aug 22, 2012 at 12:16:08PM +0530, Trilok Soni wrote:
>> Thanks for the patch, but how about just checking pmd_none on such
>> addresses and since there won't be any mapping created for such gaps? We
>> need to check if this is fine for all, since I remember that Nico
>> added these functions for the OMAP boot issue I guess.
>
> A better solution would be as below - this requires no changes to the
> existing ioremap code, we just mark these differently.
>
> diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h
> index 2e8a1ef..87fa3f2 100644
> --- a/arch/arm/mm/mm.h
> +++ b/arch/arm/mm/mm.h
> @@ -55,6 +55,9 @@ extern void __flush_dcache_page(struct address_space *mapping, struct page *page
>   /* permanent static mappings from iotable_init() */
>   #define VM_ARM_STATIC_MAPPING	0x40000000
>
> +/* empty mapping */
> +#define VM_ARM_EMPTY_MAPPING	0x20000000
> +
>   /* mapping type (attributes) for permanent static mappings */
>   #define VM_ARM_MTYPE(mt)		((mt)<<  20)
>   #define VM_ARM_MTYPE_MASK	(0x1f<<  20)
> diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
> index cf4528d..da90ef1 100644
> --- a/arch/arm/mm/mmu.c
> +++ b/arch/arm/mm/mmu.c
> @@ -813,7 +813,7 @@ static void __init pmd_empty_section_gap(unsigned long addr)
>   	vm = early_alloc_aligned(sizeof(*vm), __alignof__(*vm));
>   	vm->addr = (void *)addr;
>   	vm->size = SECTION_SIZE;
> -	vm->flags = VM_IOREMAP | VM_ARM_STATIC_MAPPING;
> +	vm->flags = VM_IOREMAP | VM_ARM_EMPTY_MAPPING;
>   	vm->caller = pmd_empty_section_gap;
>   	vm_area_add_early(vm);
>   }
> @@ -826,7 +826,7 @@ static void __init fill_pmd_gaps(void)
>
>   	/* we're still single threaded hence no lock needed here */
>   	for (vm = vmlist; vm; vm = vm->next) {
> -		if (!(vm->flags&  VM_ARM_STATIC_MAPPING))
> +		if (!(vm->flags&  (VM_ARM_STATIC_MAPPING | VM_ARM_EMPTY_MAPPING))
>   			continue;
>   		addr = (unsigned long)vm->addr;
>   		if (addr<  next)
>
Tested on MSM platform

Tested-by: Murali Nalajala <mnalajal@codeaurora.org>

Thanks,
Murali N

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

  parent reply	other threads:[~2012-08-22 12:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-21 14:28 ioremap() fail on physical address 0x0 in 3.4 kernel Murali Nalajala
2012-08-21 14:28 ` Murali Nalajala
2012-08-21 17:23 ` Laura Abbott
2012-08-21 17:23   ` Laura Abbott
2012-08-22  6:41   ` Murali Nalajala
2012-08-22  6:41     ` Murali Nalajala
2012-08-22  6:46   ` Trilok Soni
2012-08-22  6:46     ` Trilok Soni
2012-08-22  9:53     ` Russell King - ARM Linux
2012-08-22  9:53       ` Russell King - ARM Linux
2012-08-22 11:23       ` Russell King - ARM Linux
2012-08-22 11:23         ` Russell King - ARM Linux
2012-08-22 13:19         ` Nicolas Pitre
2012-08-22 13:19           ` Nicolas Pitre
2012-08-22 12:03       ` Murali Nalajala [this message]
2012-08-22 12:03         ` Murali Nalajala

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=5034CA9D.1070001@codeaurora.org \
    --to=mnalajal@codeaurora.org \
    --cc=lauraa@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=nico@linaro.org \
    --cc=tsoni@codeaurora.org \
    /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.