15 May, 2012

20 commits


14 May, 2012

7 commits

  • A corresponding function to persistent_ram_new().

    Signed-off-by: Anton Vorontsov
    Signed-off-by: Greg Kroah-Hartman

    Anton Vorontsov
     
  • This includes devices' memory (e.g. framebuffers or memory mapped
    EEPROMs on a local bus), as well as the normal RAM that we don't use
    for the main memory.

    For the normal (but unused) ram we could use kmaps, but this assumes
    highmem support, so we don't bother and just use the memory via
    ioremap.

    As a side effect, the following hack is possible: when used together
    with pstore_ram (new ramoops) module, we can limit the normal RAM region
    with mem= and then point ramoops to use the rest of the memory, e.g.

    mem=128M ramoops.mem_address=0x8000000

    Sure, we could just reserve the region with memblock_reserve() early in
    the arch/ code, and then register a pstore_ram platform device pointing
    to the reserved region. It's still a viable option if platform wants
    to do so.

    Also, we might want to use IO accessors in case of a real device,
    but for now we don't bother (the old ramoops wasn't using it either, so
    at least we don't make things worse).

    Signed-off-by: Anton Vorontsov
    Signed-off-by: Greg Kroah-Hartman

    Anton Vorontsov
     
  • Factor out vmap logic out of persistent_ram_buffer_map(), this will
    make the code a bit more understandable when we'll add support for
    non-bootmem memory.

    Signed-off-by: Anton Vorontsov
    Signed-off-by: Greg Kroah-Hartman

    Anton Vorontsov
     
  • The routine just creates a persistent ram zone at a specified address.

    For persistent_ram_init_ringbuffer() we'd need to add a
    'struct persistent_ram' to the global list, and associate it with a
    device. We don't need all this complexity in pstore_ram, so we introduce
    the simple function.

    Signed-off-by: Anton Vorontsov
    Signed-off-by: Greg Kroah-Hartman

    Anton Vorontsov
     
  • Factor post init logic out of __persistent_ram_init(), we'll need
    it for the new persistent_ram_new() routine.

    Signed-off-by: Anton Vorontsov
    Signed-off-by: Greg Kroah-Hartman

    Anton Vorontsov
     
  • This is a longstanding bug, almost unnoticeable when calling
    persistent_ram_write() for small buffers.

    But when called for large data buffers, the write routine behaves
    incorrectly, as the size may never update: instead of clamping
    the size to the maximum buffer size, buffer_size_add_clamp() returns
    an error (which is never checked by the write routine, btw).

    To fix this, we now use buffer_size_add() that actually clamps the
    size to the max value.

    Also remove buffer_size_add_clamp(), it is no longer needed.

    Signed-off-by: Anton Vorontsov
    Acked-by: Colin Cross
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Anton Vorontsov
     
  • The 'node' struct member is unused, so remove it.

    Signed-off-by: Anton Vorontsov
    Signed-off-by: Greg Kroah-Hartman

    Anton Vorontsov
     

11 May, 2012

13 commits