mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marco Stornelli <marco.stornelli@gmail.com>
To: Bryan Freed <bfreed@chromium.org>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	msb@chromium.org, seiji.aguchi@hds.com
Subject: Re: [PATCH] ramoops appears geared to not support ARM
Date: Mon, 31 Oct 2011 09:57:46 +0100	[thread overview]
Message-ID: <4EAE630A.6040309@gmail.com> (raw)
In-Reply-To: <CAEYUcX2yF1hw=D8XHMGE7p4Tty+G-vmVudNsFHXUOSTGGKoq=w@mail.gmail.com>

Il 31/10/2011 07:03, Bryan Freed ha scritto:
> On Sun, Oct 30, 2011 at 4:33 AM, Marco Stornelli
> <marco.stornelli@gmail.com>  wrote:
>>
>> Il 30/10/2011 03:07, Bryan Freed ha scritto:
>>>
>>> Right, and that is what I do to get ARM working.  The reserve() function
>>> calls memblock_reserve() to reserve the memory for RAMOOPS.  Keeping it
>>> part of main memory (by not using memblock_remove()) gets the memory
>>> properly mapped.
>>>
>>
>> According to Russell, it needs to use memblock_remove to exclude that piece of memory.
>>
>>> The problem I think we need to resolve is that this makes the ramoops
>>> driver messy.
>>
>> I agree. Indeed I think we don't need to do anything in the driver. The problem is only how to exclude a piece of memory from kernel main memory view. For x86 it's trivial, for ARM it doesn't, but it's still possible.
>>
>> Marco
>
> I will give that (using mem_remove()) a shot tomorrow.
> My recollection on using it in last week's investigation showed the
> ramoops driver ioremap() giving a mapping that did not correspond with
> what the /dev/mem expected to see.  I vaguely recall /dev/mem was
> effectively calling __va(0x02000000) which added a base address of
> 0xc0000000 giving 0xc2000000 as the resulting virtual address.  The
> ramoops ioremap(), however, gave some arbitrary virtual address for
> this memory.
> The result was that using /dev/mem to read 0x02000000 caused a panic.

I don't understand this point. We have different virtual addresses and 
then? The linear transformation with a fixed offset is the normal way 
for the kernel to have a virtual address from a physical one when you 
are using a memory address directly mapped. The virtual address returned 
by ioremap it can be an address not directly mapped, I mean it isn't a 
simple linear transformation of the physical address used in input.
It isn't normal to have a kernel panic, even if there is something 
wrong, you should receive EINVAL or something similar.

>
> Another problem was that removing just 512KiB of memory for ramoops
> screwed up the system memory initialization.  It appeared to me that
> the ARM memory code expected sections to be 1MiB aligned.  I could
> memblock_reserve anything, but I could only memblock_remove on a 1MiB
> boundary.
>

It's an arch problem not related to the driver.

> And I cannot shake the feeling that we have a fairly simple disconnect
> here.  Ramoops expects to use _device_ memory because it uses
> ioremap().  But the buffer itself is accessed through /dev/mem which
> (as we use it with no mmap() calls) expects to give access to _system_

no mmap calls?! I don't understand how you are using /dev/mem.

Marco

  reply	other threads:[~2011-10-31  9:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-28 23:21 Bryan Freed
2011-10-28 23:21 ` [PATCH] ramoops: Add support for ARM systems Bryan Freed
2011-10-29  8:39 ` [PATCH] ramoops appears geared to not support ARM Marco Stornelli
2011-10-29  9:34   ` Russell King - ARM Linux
2011-10-29 11:04     ` Marco Stornelli
2011-10-29 11:55       ` Russell King - ARM Linux
2011-10-29 12:42         ` Marco Stornelli
2011-10-29 12:53           ` Russell King - ARM Linux
2011-10-29 14:22 ` Marco Stornelli
     [not found]   ` <CAEYUcX1PUgniJLqYXKM5pf_9T06OPFg4q0ZUCFc8Deu1J_R9-A@mail.gmail.com>
2011-10-30 11:33     ` Marco Stornelli
2011-10-31  6:03       ` Bryan Freed
2011-10-31  8:57         ` Marco Stornelli [this message]
2011-10-31 23:03           ` Bryan Freed
2011-11-01  8:52             ` Marco Stornelli

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=4EAE630A.6040309@gmail.com \
    --to=marco.stornelli@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=bfreed@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=msb@chromium.org \
    --cc=seiji.aguchi@hds.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

Powered by JetHome