07 Mar, 2010

40 commits

  • The C99 specification states in section 6.11.5:

    The placement of a storage-class specifier other than at the beginning of
    the declaration specifiers in a declaration is an obsolescent feature.

    Signed-off-by: Tobias Klauser
    Signed-off-by: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tobias Klauser
     
  • Memset should be given the size of the structure, not the size of the
    pointer.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    type T;
    T *x;
    expression E;
    @@

    memset(x, E, sizeof(
    + *
    x))
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Julia Lawall
     
  • The function pcf2123_remove is used only wrapped by __devexit_p so define
    it using __devexit.

    Signed-off-by: Uwe Kleine-König
    Signed-off-by: Alessandro Zummo
    Cc: Christian Pellegrin
    Cc: Chris Verges
    Cc: Paul Gortmaker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Uwe Kleine-König
     
  • Fix issue with rtc device not getting unregistered in probe error path.

    Use the devres managed resource functions in the probe routine to cleanup
    the error path.

    Use sysfs_{create/remove}_group to add/remove the sysfs files.

    Reduces the text size by 132 bytes, increases data by 12 bytes:
    text data bss dec hex filename
    - 937 124 0 1061 425 rtc-ep93xx.o
    + 805 136 0 941 3ad rtc-ep93xx.o

    Signed-off-by: H Hartley Sweeten
    Acked-by: Alessandro Zummo
    Cc: Paul Gortmaker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    H Hartley Sweeten
     
  • Free pdata before exit. Found by cppcheck.

    [yuasa@linux-mips.org: add missing iounmap()]
    Signed-off-by: Alexander Beregalov
    Reviewed-by: WANG Cong
    Acked-by: Daniel Mack
    Acked-by: Alessandro Zummo
    Cc Yoichi Yuasa
    Cc: Paul Gortmaker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Beregalov
     
  • Currently the xen support drivers are displayed in the main Device Drivers
    menu of the config tools instead of in their own sub-menu, so move them to
    their own sub-menu, like the rest of the driver world uses.

    This keeps the main Device Drivers menu from becoming messy.

    Signed-off-by: Randy Dunlap
    Cc: Jeremy Fitzhardinge
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • warning: symbol 'vgacon_text_mode_force' was not declared. Should it be static?

    Signed-off-by: Thiago Farina
    Acked-by: Matthew Garrett
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Thiago Farina
     
  • BuraphaLinux reported that we will trigger a mm warning when we
    CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=65536, this is because mm cann't
    allocate so many pages. We should limit the range of
    CONFIG_VGACON_SOFT_SCROLLBACK_SIZE, don't give a user any chance to
    trigger that.

    Reported-by: BuraphaLinux Server
    Tested-by: BuraphaLinux Server
    Signed-off-by: WANG Cong
    Cc: David S. Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Amerigo Wang
     
  • Modify uid check in do_coredump so as to not apply it in the case of
    pipes.

    This just got noticed in testing. The end of do_coredump validates the
    uid of the inode for the created file against the uid of the crashing
    process to ensure that no one can pre-create a core file with different
    ownership and grab the information contained in the core when they
    shouldn' tbe able to. This causes failures when using pipes for a core
    dumps if the crashing process is not root, which is the uid of the pipe
    when it is created.

    The fix is simple. Since the check for matching uid's isn't relevant for
    pipes (a process can't create a pipe that the uermodehelper code will open
    anyway), we can just just skip it in the event ispipe is non-zero

    Reverts a pipe-affecting change which was accidentally made in

    : commit c46f739dd39db3b07ab5deb4e3ec81e1c04a91af
    : Author: Ingo Molnar
    : AuthorDate: Wed Nov 28 13:59:18 2007 +0100
    : Commit: Linus Torvalds
    : CommitDate: Wed Nov 28 10:58:01 2007 -0800
    :
    : vfs: coredumping fix

    Signed-off-by: Neil Horman
    Cc: Andi Kleen
    Cc: Oleg Nesterov
    Cc: Alan Cox
    Cc: Al Viro
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Neil Horman
     
  • User visible change.

    do_coredump() kills all threads which share the same ->mm but only the
    coredumping process gets the proper exit_code. Other tasks which share
    the same ->mm die "silently" and return status == 0 to parent.

    This is historical behaviour, not actually a bug. But I think Frank
    Heckenbach rightly dislikes the current behaviour. Simple test-case:

    #include
    #include
    #include
    #include

    int main(void)
    {
    int stat;

    if (!fork()) {
    if (!vfork())
    kill(getpid(), SIGQUIT);
    }

    wait(&stat);
    printf("stat=%x\n", stat);
    return 0;
    }

    Before this patch it prints "stat=0" despite the fact the child was killed
    by SIGQUIT. After this patch the output is "stat=3" which obviously makes
    more sense.

    Even with this patch, only the task which originates the coredumping gets
    "|= 0x80" if the core was actually dumped, but at least the coredumping
    signal is visible to do_wait/etc.

    Reported-by: Frank Heckenbach
    Signed-off-by: Oleg Nesterov
    Acked-by: WANG Cong
    Cc: Roland McGrath
    Cc: Neil Horman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • Pass mm->flags as a coredump parameter for consistency.

    ---
    1787 if (mm->core_state || !get_dumpable(mm)) { mmap_sem);
    1789 put_cred(cred);
    1790 goto fail;
    1791 }
    1792
    [...]
    1798 if (get_dumpable(mm) == 2) { /* Setuid core dump mode */ fsuid = 0; /* Dump root private */
    1801 }
    ---

    Since dumpable bits are not protected by lock, there is a chance to change
    these bits between (1) and (2).

    To solve this issue, this patch copies mm->flags to
    coredump_params.mm_flags at the beginning of do_coredump() and uses it
    instead of get_dumpable() while dumping core.

    This copy is also passed to binfmt->core_dump, since elf*_core_dump() uses
    dump_filter bits in mm->flags.

    [akpm@linux-foundation.org: fix merge]
    Signed-off-by: Masami Hiramatsu
    Acked-by: Roland McGrath
    Cc: Hidehiro Kawai
    Cc: Oleg Nesterov
    Cc: Ingo Molnar
    Reviewed-by: KOSAKI Motohiro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masami Hiramatsu
     
  • The current ELF dumper implementation can produce broken corefiles if
    program headers exceed 65535. This number is determined by the number of
    vmas which the process have. In particular, some extreme programs may use
    more than 65535 vmas. (If you google max_map_count, you can find some
    users facing this problem.) This kind of program never be able to generate
    correct coredumps.

    This patch implements ``extended numbering'' that uses sh_info field of
    the first section header instead of e_phnum field in order to represent
    upto 4294967295 vmas.

    This is supported by
    AMD64-ABI(http://www.x86-64.org/documentation.html) and
    Solaris(http://docs.sun.com/app/docs/doc/817-1984/).
    Of course, we are preparing patches for gdb and binutils.

    Signed-off-by: Daisuke HATAYAMA
    Cc: "Luck, Tony"
    Cc: Jeff Dike
    Cc: David Howells
    Cc: Greg Ungerer
    Cc: Roland McGrath
    Cc: Oleg Nesterov
    Cc: Ingo Molnar
    Cc: Alexander Viro
    Cc: Andi Kleen
    Cc: Alan Cox
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Daisuke HATAYAMA
     
  • By the next patch, elf_core_dump() and elf_fdpic_core_dump() will support
    extended numbering and so will produce the corefiles with section header
    table in a special case.

    The problem is the process of writing a file header offset of the section
    header table into e_shoff field of the ELF header. ELF header is
    positioned at the beginning of the corefile, while section header at the
    end. So, we need to take which of the following ways:

    1. Seek backward to retry writing operation for ELF header
    after writing process for a whole part

    2. Make offset calculation process and writing process
    totally sequential

    The clause 1. is not always possible: one cannot assume that file system
    supports seek function. Consider the no_llseek case.

    Therefore, this patch adopts the clause 2.

    Signed-off-by: Daisuke HATAYAMA
    Cc: "Luck, Tony"
    Cc: Jeff Dike
    Cc: David Howells
    Cc: Greg Ungerer
    Cc: Roland McGrath
    Cc: Oleg Nesterov
    Cc: Ingo Molnar
    Cc: Alexander Viro
    Cc: Andi Kleen
    Cc: Alan Cox
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Daisuke HATAYAMA
     
  • elf_core_dump() and elf_fdpic_core_dump() use #ifdef and the corresponding
    macro for hiding _multiline_ logics in functions. This patch removes
    #ifdef and replaces ELF_CORE_EXTRA_* by corresponding functions. For
    architectures not implemeonting ELF_CORE_EXTRA_*, we use weak functions in
    order to reduce a range of modification.

    This cleanup is for my next patches, but I think this cleanup itself is
    worth doing regardless of my firnal purpose.

    Signed-off-by: Daisuke HATAYAMA
    Cc: "Luck, Tony"
    Cc: Jeff Dike
    Cc: David Howells
    Cc: Greg Ungerer
    Cc: Roland McGrath
    Cc: Oleg Nesterov
    Cc: Ingo Molnar
    Cc: Alexander Viro
    Cc: Andi Kleen
    Cc: Alan Cox
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Daisuke HATAYAMA
     
  • My next patch will replace ELF_CORE_EXTRA_* macros by functions, putting
    them into other newly created *.c files. Then, each files will contain
    dump_write(), where each pair of binfmt_*.c and elfcore.c should be the
    same. So, this patch moves them into a header file with dump_seek().
    Also, the patch deletes confusing DUMP_WRITE macros in each files.

    Signed-off-by: Daisuke HATAYAMA
    Cc: "Luck, Tony"
    Cc: Jeff Dike
    Cc: David Howells
    Cc: Greg Ungerer
    Cc: Roland McGrath
    Cc: Oleg Nesterov
    Cc: Ingo Molnar
    Cc: Alexander Viro
    Cc: Andi Kleen
    Cc: Alan Cox
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Daisuke HATAYAMA
     
  • The current ELF dumper can produce broken corefiles if program headers
    exceed 65535. In particular, the program in 64-bit environment often
    demands more than 65535 mmaps. If you google max_map_count, then you can
    find many users facing this problem.

    Solaris has already dealt with this issue, and other OSes have also
    adopted the same method as in Solaris. Currently, Sun's document and AMD
    64 ABI include the description for the extension, where they call the
    extension Extended Numbering. See Reference for further information.

    I believe that linux kernel should adopt the same way as they did, so I've
    written this patch.

    I am also preparing for patches of GDB and binutils.

    How to fix
    ==========

    In new dumping process, there are two cases according to weather or
    not the number of program headers is equal to or more than 65535.

    - if less than 65535, the produced corefile format is exactly the same
    as the ordinary one.

    - if equal to or more than 65535, then e_phnum field is set to newly
    introduced constant PN_XNUM(0xffff) and the actual number of program
    headers is set to sh_info field of the section header at index 0.

    Compatibility Concern
    =====================

    * As already mentioned in Summary, Sun and AMD64 has already adopted
    this. See Reference.

    * There are four combinations according to whether kernel and userland
    tools are respectively modified or not. The next table summarizes
    shortly for each combination.

    ---------------------------------------------
    Original Kernel | Modified Kernel
    ---------------------------------------------
    < 65535 | >= 65535 | < 65535 | >= 65535
    -------------------------------------------------------------
    Original Tools | OK | broken | OK | broken (#)
    -------------------------------------------------------------
    Modified Tools | OK | broken | OK | OK
    -------------------------------------------------------------

    Note that there is no case that `OK' changes to `broken'.

    (#) Although this case remains broken, O-M behaves better than
    O-O. That is, while in O-O case e_phnum field would be extremely
    small due to integer overflow, in O-M case it is guaranteed to be at
    least 65535 by being set to PN_XNUM(0xFFFF), much closer to the
    actual correct value than the O-O case.

    Test Program
    ============

    Here is a test program mkmmaps.c that is useful to produce the
    corefile with many mmaps. To use this, please take the following
    steps:

    $ ulimit -c unlimited
    $ sysctl vm.max_map_count=70000 # default 65530 is too small
    $ sysctl fs.file-max=70000
    $ mkmmaps 65535

    Then, the program will abort and a corefile will be generated.

    If failed, there are two cases according to the error message
    displayed.

    * ``out of memory'' means vm.max_map_count is still smaller

    * ``too many open files'' means fs.file-max is still smaller

    So, please change it to a larger value, and then retry it.

    mkmmaps.c
    ==
    #include
    #include
    #include
    #include
    #include
    int main(int argc, char **argv)
    {
    int maps_num;
    if (argc < 2) {
    fprintf(stderr, "mkmmaps [number of maps to be created]\n");
    exit(1);
    }
    if (sscanf(argv[1], "%d", &maps_num) == EOF) {
    perror("sscanf");
    exit(2);
    }
    if (maps_num < 0) {
    fprintf(stderr, "%d is invalid\n", maps_num);
    exit(3);
    }
    for (; maps_num > 0; --maps_num) {
    if (MAP_FAILED == mmap((void *)NULL, (size_t) 1, PROT_READ,
    MAP_SHARED | MAP_ANONYMOUS, (int) -1,
    (off_t) NULL)) {
    perror("mmap");
    exit(4);
    }
    }
    abort();
    {
    char buffer[128];
    sprintf(buffer, "wc -l /proc/%u/maps", getpid());
    system(buffer);
    }
    return 0;
    }

    Tested on i386, ia64 and um/sys-i386.
    Built on sh4 (which covers fs/binfmt_elf_fdpic.c)

    References
    ==========

    - Sun microsystems: Linker and Libraries.
    Part No: 817-1984-17, September 2008.
    URL: http://docs.sun.com/app/docs/doc/817-1984

    - System V ABI AMD64 Architecture Processor Supplement
    Draft Version 0.99., May 11, 2009.
    URL: http://www.x86-64.org/

    This patch:

    There are three different definitions for dump_seek() functions in
    binfmt_aout.c, binfmt_elf.c and binfmt_elf_fdpic.c, respectively. The
    only for binfmt_elf.c.

    My next patch will move dump_seek() into a header file in order to share
    the same implementations for dump_write() and dump_seek(). As the first
    step, this patch unify these three definitions for dump_seek() by applying
    the past commits that have been applied only for binfmt_elf.c.

    Specifically, the modification made here is part of the following commits:

    * d025c9db7f31fc0554ce7fb2dfc78d35a77f3487
    * 7f14daa19ea36b200d237ad3ac5826ae25360461

    This patch does not change a shape of corefiles.

    Signed-off-by: Daisuke HATAYAMA
    Cc: "Luck, Tony"
    Cc: Jeff Dike
    Cc: David Howells
    Cc: Greg Ungerer
    Cc: Roland McGrath
    Cc: Oleg Nesterov
    Cc: Ingo Molnar
    Cc: Alexander Viro
    Cc: Andi Kleen
    Cc: Alan Cox
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Daisuke HATAYAMA
     
  • * warn if creation goes on to non-existent directory
    * warn if removal goes on from non-existing directory
    * warn if non-existing proc entry is removed

    Signed-off-by: Alexey Dobriyan
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • remove_proc_entry() does

    lock
    lookup parent
    unlock
    lock
    unlink proc entry from lists
    unlock

    which can be made bit more correct by doing parent translation + unlink
    without dropping lock.

    Signed-off-by: Alexey Dobriyan
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • While testing an ADC121S021 in an embedded board with a S3C2142 SoC (ARM
    core), I have found that the 'adcxx' driver does not handle correctly
    single channel ADCs from this chip family. For single channel chips you
    must only issue one read transfer for correct measurement.

    Signed-off-by: Jose Miguel Goncalves
    Cc: Marc Pignat
    Cc: Anton Vorontsov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    José Miguel Gonçalves
     
  • String constants that are continued on subsequent lines with \ will cause
    spurious whitespace in the resulting output.

    Signed-off-by: Joe Perches
    Cc: Roger Lucas
    Cc: Jean Delvare
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Signed-off-by: Joakim Tjernlund
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joakim Tjernlund
     
  • Signed-off-by: Joe Perches
    Cc: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Signed-off-by: Alberto Panizzo
    Cc: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alberto Panizzo
     
  • Based on Arjan's suggestion, extend the list of ops structures that should
    be const.

    Signed-off-by: Emese Revfy
    Cc: Andy Whitcroft
    Cc: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Emese Revfy
     
  • Here is a small code snippet, which will be complained about by
    checkpatch.pl:

    #define __STRUCT_KFIFO_COMMON(recsize, ptrtype) \
    union { \
    struct { \
    unsigned int in; \
    unsigned int out; \
    }; \
    char rectype[recsize]; \
    ptrtype *ptr; \
    const ptrtype *ptr_const; \
    };

    This construct is legal and safe, so checkpatch.pl should accept this. It
    should be also true for struct defined in a macro.

    Add the `struct' and `union' keywords to the exceptions list of the
    checkpatch.pl script, to prevent error message "Macros with multiple
    statements should be enclosed in a do - while loop". Otherwise it is not
    possible to build a struct or union with a macro.

    Signed-off-by: Stefani Seibold
    Cc: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stefani Seibold
     
  • checkpatch falsely complained about '__initconst' because it thought the
    'const' needed a space before. Fix this by changing the list of
    attributes:

    - add '__initconst'
    - force plain 'init' to contain a word-boundary at the end

    Signed-off-by: Wolfram Sang
    Cc: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wolfram Sang
     
  • Signed-off-by: Joe Perches
    Cc: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • In case if the statement and the conditional are in one line, the line
    appears in the report doubly.

    And items of this check have no blank line before the next item.

    This patch fixes these trivial problems, to improve readability of the
    report.

    [sample.c]
    > if (cond1
    > && cond2
    > && cond3) func_foo();
    >
    > if (cond4) func_bar();

    Before:
    > ERROR: trailing statements should be on next line
    > #1: FILE: sample.c:1:
    > +if (cond1
    > [...]
    > + && cond3) func_foo();
    > ERROR: trailing statements should be on next line
    > #5: FILE: sample.c:5:
    > +if (cond4) func_bar();
    > +if (cond4) func_bar();
    > total: 2 errors, 0 warnings, 5 lines checked

    After:
    > ERROR: trailing statements should be on next line
    > #1: FILE: sample.c:1:
    > +if (cond1
    > [...]
    > + && cond3) func_foo();
    >
    > ERROR: trailing statements should be on next line
    > #5: FILE: sample.c:5:
    > +if (cond4) func_bar();
    >
    > total: 2 errors, 0 warnings, 5 lines checked

    Signed-off-by: Hidetoshi Seto
    Cc: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hidetoshi Seto
     
  • sizeof(&foo) is frequently an error. Warn on its use.

    Signed-off-by: Joe Perches
    Cc: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • This card reader doesn't advertise, however DMA works well. Probably
    windows SDHCI driver assumes that all readers support DMA and thus we see
    that bug.

    Signed-off-by: Vasily Khoruzhick
    Tested-by: Maxim Levitsky
    Signed-off-by: Maxim Levitsky
    Cc: Harald Welte
    Cc: Norbert Preining
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vasily Khoruzhick
     
  • kunmap_atomic() accepts a pointer to any location in the page so we do not
    need the subtraction and cast.

    Signed-off-by: Nicolas Ferre
    Cc: Wolfgang Muees
    Cc: Andrew Victor
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nicolas Ferre
     
  • We used to manage features and differences on a per-cpu basis. As several
    cpus share the same mci revision, this patch aggregates cpus that have the
    same IP revision in one defined constant. We use the
    at91mci_is_mci1rev2xx() funtion name not to mess with newer Atmel sd/mmc
    IP called "MCI2". _rev2 naming could have been confusing...

    Signed-off-by: Nicolas Ferre
    Cc: Wolfgang Muees
    Cc: Andrew Victor
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nicolas Ferre
     
  • According to the datasheets AT91SAM9261 does not support SDIO interrupts,
    and AT91SAM9260/9263 have an erratum requiring 4bit mode while using slot
    B for the interrupt to work.

    Signed-off-by: Nicolas Ferre
    Cc: Wolfgang Muees
    Cc: Andrew Victor
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nicolas Ferre
     
  • This patch is setting some max_ variables for the IO elevator, so the
    elevator will put requests for large data blocks to the driver. This is
    critical for

    a) speed

    and

    b) wear leveling of the flash chip controller: Otherwise the controller
    will treat the SD card badly with millions of single 4 KByte write
    commands. This will lead to a shorter life time for the SD cards.

    Signed-off-by: Wolfgang Muees
    Signed-off-by: Nicolas Ferre
    Cc: Andrew Victor
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wolfgang Muees
     
  • Convert the read to use the DMA buffer as well. The old code was doing
    double-buffering DMA with the PDC; no way to make it work. Replace it
    with a single-PDC approach. It also simplify things removing the need for
    a pre_dma_read() function.

    [nicolas.ferre@atmel.com coding style modifications]
    Signed-off-by: Wolfgang Muees
    Signed-off-by: Nicolas Ferre
    Cc: Andrew Victor
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wolfgang Muees
     
  • The TX DMA buffer is allocated only once, because the
    allocation/deallocation of the buffer for EACH chunk of data is
    time-consuming and prone to memory fragmentation.

    Using a coherent DMA buffer avoids extra data cache calls.

    [nicolas.ferre@atmel.com: coding style modifications]
    Signed-off-by: Wolfgang Muees
    Signed-off-by: Nicolas Ferre
    Cc: Andrew Victor
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wolfgang Muees
     
  • Fix two timeout errors, one for slow SDHC cards and one for slow users
    while inserting SD cards.

    Signed-off-by: Wolfgang Muees
    Signed-off-by: Nicolas Ferre
    Cc: Andrew Victor
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wolfgang Muees
     
  • Fixes two pointer errors, one which leads to memory overwrites if used
    with large chunks of data.

    Signed-off-by: Wolfgang Muees
    Signed-off-by: Nicolas Ferre
    Cc: Andrew Victor
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wolfgang Muees
     
  • Signed-off-by: Lars-Peter Clausen
    Cc: Ben Dooks
    Cc:
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lars-Peter Clausen
     
  • If no platform_data was givin to the device it's going to use it's default
    platform data struct which has all fields initialized to zero. As a
    result the driver is going to try to request gpio0 both as write protect
    and card detect pin. Which of course will fail and makes the driver
    unusable

    Previously to the introduction of no_wprotect and no_detect the behavior
    was to assume that if no platform data was given there is no write protect
    or card detect pin. This patch restores that behavior.

    Signed-off-by: Lars-Peter Clausen
    Cc: Ben Dooks
    Cc:
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lars-Peter Clausen