10 Jan, 2012

10 commits


11 Sep, 2011

6 commits

  • The code has the check for parts but it called after kmemdup,
    kmemdup(parts, sizeof(*parts) * nr_parts,...)
    if (!parts)
    return -ENOMEM

    In fact, we need check parts before safely using it.
    and we also need check the real_parts to make sure kmemdup
    allocation sucessfully.

    Signed-off-by: Jason Liu
    Signed-off-by: Artem Bityutskiy

    Jason Liu
     
  • Signed-off-by: Brian Norris
    Signed-off-by: Artem Bityutskiy

    Brian Norris
     
  • Start moving away from the MTD_DEBUG_LEVEL messages. The dynamic
    debugging feature is a generic kernel feature that provides more
    flexibility.

    (See Documentation/dynamic-debug-howto.txt)

    Also fix some punctuation, indentation, and capitalization that went
    along with the affected lines.

    Signed-off-by: Brian Norris
    Signed-off-by: Artem Bityutskiy

    Brian Norris
     
  • mtd_device_register() is a limited version of mtd_device_parse_register.
    Replace it with macro calling mtd_device_parse_register().

    Signed-off-by: Dmitry Eremin-Solenikov
    Signed-off-by: Artem Bityutskiy

    Dmitry Eremin-Solenikov
     
  • Encapsulate last MTD partition parser argument into a separate
    structure. Currently it holds only 'origin' field for RedBoot parser,
    but will be extended in future to contain at least device_node for OF
    devices.

    Amended commentary to make kerneldoc happy

    Signed-off-by: Dmitry Eremin-Solenikov
    Signed-off-by: Artem Bityutskiy

    Dmitry Eremin-Solenikov
     
  • Lots (nearly all) mtd drivers contain nearly the similar code that
    calls parse_mtd_partitions, provides some platform-default values, if
    parsing fails, and registers mtd device.

    This is an aim to provide single implementation of this scenario:
    mtd_device_parse_register() which will handle all this parsing and
    defaults.

    Artem: amended comments

    Signed-off-by: Dmitry Eremin-Solenikov
    Signed-off-by: Artem Bityutskiy

    Dmitry Eremin-Solenikov
     

25 May, 2011

6 commits

  • These symbols are replaced with mtd_device_register() (and removal with
    mtd_device_unregister()) for public registration.

    Signed-off-by: Jamie Iles
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Jamie Iles
     
  • To prepare for the removal of add_mtd_device and add_mtd_partitions(),
    introduce mtd_device_register(). This will create partitions if they
    are supplied or register the whole device if there are no partitions.

    Once all drivers are converted to use mtd_device_register(),
    add_mtd_device() and add_mtd_partitions() will be made internal only.

    v2: move kerneldoc to implementation file and fixup some kerneldoc
    warnings.

    Artem: tweak comments: remove junk tabs, use dots consistently.

    Signed-off-by: Jamie Iles
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Jamie Iles
     
  • Remove the spare spaces in the head of the lines.

    Signed-off-by: Wanlong Gao
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Wanlong Gao
     
  • 'get_mtd_device_nm()' has a piece of code which equivalent to what
    '__get_mtd_device()' does - remove this duplicated code and use
    ''__get_mtd_device()' instead.

    Artem: changed commit message.
    Artem: while on it, remove an unnecessary extra empty line

    Signed-off-by: Wanlong Gao
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Wanlong Gao
     
  • ->read_proc interface is going away, switch to seq_file.

    Signed-off-by: Alexey Dobriyan
    Acked-by: Mike Frysinger
    Signed-off-by: Andrew Morton
    Signed-off-by: David Woodhouse

    Alexey Dobriyan
     
  • Introduce a common function to handle large, contiguous kmalloc buffer
    allocations by exponentially backing off on the size of the requested
    kernel transfer buffer until it succeeds or until the requested
    transfer buffer size falls below the page size.

    This helps ensure the operation can succeed under low-memory, highly-
    fragmented situations albeit somewhat more slowly.

    Artem: so this patch solves the problem that the kernel tries to kmalloc too
    large buffers, which (a) may fail and does fail - people complain about this,
    and (b) slows down the system in case of high memory fragmentation, because
    the kernel starts dropping caches, writing back, swapping, etc. But we do not
    really have to allocate a lot of memory to do the I/O, we may do this even with
    as little as one min. I/O unit (NAND page) of RAM. So the idea of this patch is
    that if the user asks to read or write a lot, we try to kmalloc a lot, with GFP
    flags which make the kernel _not_ drop caches, etc. If we can allocate it - good,
    if not - we try to allocate twice as less, and so on, until we reach the min.
    I/O unit size, which is our last resort allocation and use the normal
    GFP_KERNEL flag.

    Artem: re-write the allocation function so that it makes sure the allocated
    buffer is aligned to the min. I/O size of the flash.

    Signed-off-by: Grant Erickson
    Tested-by: Ben Gardiner
    Tested-by: Stefano Babic
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Grant Erickson
     

11 Mar, 2011

1 commit


09 Aug, 2010

2 commits


20 May, 2010

1 commit


10 May, 2010

1 commit


27 Apr, 2010

2 commits


30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

27 Feb, 2010

2 commits


25 Feb, 2010

2 commits


30 Nov, 2009

1 commit


20 Sep, 2009

1 commit


16 Sep, 2009

1 commit


04 Sep, 2009

1 commit

  • Make mtd_group and mtd_groups static since they are only used in this
    file.

    [Amended by Artem Bityutskiy]

    Signed-off-by: H Hartley Sweeten
    Signed-off-by: Andrew Morton
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    H Hartley Sweeten
     

03 Aug, 2009

1 commit

  • The patch fixes a bug when converting dev to mtd_info by using the
    drvdata of the dev, the previous code used
    container_of(dev, struct mtd_info, dev), but won't work for the mtdXro
    devices as they created without being contained inside mtd_info structure.

    Signed-off-by: Saeed Bishara
    Signed-off-by: David Woodhouse

    Saeed Bishara
     

26 May, 2009

1 commit