07 Mar, 2010

40 commits

  • 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
     
  • And bring them back to 4-bit mode during resume.

    Signed-off-by: Daniel Drake
    Signed-off-by: Nicolas Pitre
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Daniel Drake
     
  • Some SDIO cards may suspend while keeping function interrupts active
    especially in the powered suspend case. Upon resume we need to kick the
    SDIO interrupt thread to check for pending interrupts and to restart card
    IRQ detection at the host controller level.

    Signed-off-by: Nicolas Pitre
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nicolas Pitre
     
  • Seen on a Marvell 8686 SDIO card and Via VX855 controller: we must avoid
    sending CMD3/5/7 on a resume where power has been maintained, because the
    8686 will refuse to respond to them and the MMC stack will give up on the
    card.

    Signed-off-by: Chris Ball
    Signed-off-by: Nicolas Pitre
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chris Ball
     
  • Tested with an XO v1.5 from OLPC.

    Signed-off-by: Nicolas Pitre
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nicolas Pitre
     
  • This patch series provides the core changes needed to allow SDIO cards to
    remain powered and active while the host system is suspended, and let them
    wake up the host system when needed. This is used to implement
    wake-on-lan with SDIO wireless cards at the moment. Patches to add that
    support to the libertas driver will be posted separately.

    This patch:

    Some SDIO cards have the ability to keep on running autonomously when the
    host system is suspended, and wake it up when needed. This however
    requires that the host controller preserve power to the card, and
    configure itself appropriately for wake-up.

    There is however 4 layers of abstractions involved: the host controller
    driver, the MMC core code, the SDIO card management code, and the actual
    SDIO function driver. To make things simple and manageable, host drivers
    must advertise their PM capabilities with a feature bitmask, then function
    drivers can query and set those features from their suspend method. Then
    each layer in the suspend call chain is expected to act upon those bits
    accordingly.

    [akpm@linux-foundation.org: fix typo in comment]
    Signed-off-by: Nicolas Pitre
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nicolas Pitre
     
  • sdhci_set_adma_desc() is using byte-writes to write data in a specified
    order into memory. Change to using __le16 for the two byte and __le32 for
    the four byte cases and use the cpu_to_{le16,le32} to do the conversion
    before writing.

    This will reduce the size of the code and the number of writes as we no
    longer need to chop the data up before writing.

    As an example on ARM S3C64XX SoC, in little-endian configuration:

    000000d4 :
    - d8: e1a0c423 lsr ip, r3, #8
    - dc: e1a0ec21 lsr lr, r1, #24
    - e0: e1a04821 lsr r4, r1, #16
    - e4: e1a05421 lsr r5, r1, #8
    - e8: e1a06442 asr r6, r2, #8
    - ec: e5c0c001 strb ip, [r0, #1]
    - f0: e5c0e007 strb lr, [r0, #7]
    - f4: e5c04006 strb r4, [r0, #6]
    - f8: e5c05005 strb r5, [r0, #5]
    - fc: e5c01004 strb r1, [r0, #4]
    - 100: e5c06003 strb r6, [r0, #3]
    - 104: e5c02002 strb r2, [r0, #2]
    - 108: e5c03000 strb r3, [r0]
    + d4: e5801004 str r1, [r0, #4]
    + d8: e1c030b0 strh r3, [r0]
    + dc: e1c020b2 strh r2, [r0, #2]

    Signed-off-by: Ben Dooks
    Cc: Pierre Ossman
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ben Dooks
     
  • The code to write the ADMA descriptor into memory is repeated several
    times throughout sdhci_adma_table_pre, and thus should be moved into a
    common function. This will also be useful if the patch to make the write
    more efficient is accepted.

    Signed-off-by: Ben Dooks
    Cc: Pierre Ossman
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ben Dooks
     
  • Some SDIO cards expect byte transfers not to exceed the configured block
    transfer size. Add a quirk to that effect.

    Patches to make use of this quirk will be sent separately.

    Signed-off-by: Bing Zhao
    Signed-off-by: Nicolas Pitre
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bing Zhao
     
  • The hardcoded value doesn't really work for all cards.

    Signed-off-by: Cliff Cai
    Signed-off-by: Mike Frysinger
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Cliff Cai
     
  • The host/Kconfig file is only included when MMC is selected.

    Signed-off-by: Mike Frysinger
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • The local sg variable is only used with BF54x code.

    Signed-off-by: Mike Frysinger
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • This prevents those without an Atmel chip having a line in kernel
    configuration which says "Atmel SD/MMC Driver" without any option.

    Signed-off-by: Jonathan Cameron
    Signed-off-by: Nicolas Ferre
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nicolas Ferre
     
  • Add support for 8bit MMC cards. The controller data width is configurable
    depending on the wires setting in the platform data structure.

    MMC 8bit is tested on OMAPL137 and MMC 4bit is tested on OMAPL138 EVM.

    Signed-off-by: Vipin Bhandari
    Cc: David Brownell
    Cc: Chaithrika U S
    Cc: Sudhakar Rajashekhara
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vipin Bhandari
     
  • This patch solves nasty problem original driver has.

    Original goal of the ricoh_mmc was to disable this device because then,
    mmc cards can be read using standard SDHCI controller, thus avoiding
    writing of yet another driver.

    However, the act of disablement, makes other pci functions that belong to
    this controller (xD and memstick) shift up one level, thus pci core has
    now wrong idea about these devices.

    To fix this issue, this patch moves the driver into the pci quirk section,
    thus it is executes before the pci is enumerated, and therefore solving
    that issue, also same sequence of commands is performed on resume for same
    reasons.

    Also regardless of the above, this way is cleaner. You still need to set
    CONFIG_MMC_RICOH_MMC to enable this quirk

    Signed-off-by: Maxim Levitsky
    Acked-by: Philip Langdale
    Acked-by: Wolfram Sang
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Maxim Levitsky
     
  • fs/compat_ioctl.c: In function 'do_ioctl_trans':
    fs/compat_ioctl.c:534: warning: 'karg' may be used uninitialized in this function
    fs/compat_ioctl.c:533: warning: 'kcmd' may be used uninitialized in this function
    fs/compat_ioctl.c:656: warning: 'ret' may be used uninitialized in this function

    Reduces text size by 44 bytes.

    If someone calls one of these functions with an unexpected argument, the
    code's buggy as-is.

    Amerigo Wang
    Cc: Alexander Viro
    Acked-by: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • Replace open-coded loop with for_each_set_bit().

    Signed-off-by: Akinobu Mita
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • The function name must be followed by a space, hypen, space, and a short
    description.

    Signed-off-by: Ben Hutchings
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ben Hutchings
     
  • Build list_sort() only for configs that need it -- those that don't save
    ~581 bytes (i386).

    Signed-off-by: Don Mullis
    Cc: Dave Airlie
    Cc: Andi Kleen
    Cc: Dave Chinner
    Cc: Artem Bityutskiy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Don Mullis
     
  • Clarify and correct header comment of list_sort().

    Signed-off-by: Don Mullis
    Cc: Dave Airlie
    Cc: Andi Kleen
    Cc: Dave Chinner
    Cc: Artem Bityutskiy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Don Mullis
     
  • XFS and UBIFS can pass long lists to list_sort(); this alternative
    implementation scales better, reaching ~3x performance gain when list
    length exceeds the L2 cache size.

    Stand-alone program timings were run on a Core 2 duo L1=32KB L2=4MB,
    gcc-4.4, with flags extracted from an Ubuntu kernel build. Object size is
    581 bytes compared to 455 for Mark J. Roberts' code.

    Worst case for either implementation is a list length just over a power of
    two, and to roughly the same degree, so here are timing results for a
    range of 2^N+1 lengths. List elements were 16 bytes each including malloc
    overhead; initial order was random.

    time (msec)
    Tatham-Roberts
    | generic-Mullis-v2
    loop_count length | | ratio
    4000000 2 206 294 1.427
    2000000 3 176 227 1.289
    1000000 5 199 172 0.864
    500000 9 235 178 0.757
    250000 17 243 182 0.748
    125000 33 261 196 0.750
    62500 65 277 209 0.754
    31250 129 292 219 0.75
    15625 257 317 235 0.741
    7812 513 340 252 0.741
    3906 1025 362 267 0.737
    1953 2049 388 283 0.729 ~ L1 size
    976 4097 556 323 0.580
    488 8193 678 361 0.532
    244 16385 773 395 0.510
    122 32769 844 418 0.495
    61 65537 917 454 0.495
    30 131073 1128 543 0.481
    15 262145 2355 869 0.369 ~ L2 size
    7 524289 5597 1714 0.306
    3 1048577 6218 2022 0.325

    Mark's code does not actually implement the usual or generic mergesort,
    but rather a variant from Simon Tatham described here:

    http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html

    Simon's algorithm performs O(log N) passes over the entire input list,
    doing merges of sublists that double in size on each pass. The generic
    algorithm instead merges pairs of equal length lists as early as possible,
    in recursive order. For either algorithm, the elements that extend the
    list beyond power-of-two length are a special case, handled as nearly as
    possible as a "rounding-up" to a full POT.

    Some intuition for the locality of reference implications of merge order
    may be gotten by watching this animation:

    http://www.sorting-algorithms.com/merge-sort

    Simon's algorithm requires only O(1) extra space rather than the generic
    algorithm's O(log N), but in my non-recursive implementation the actual
    O(log N) data is merely a vector of ~20 pointers, which I've put on the
    stack.

    Long-running list_sort() calls: If the list passed in may be long, or the
    client's cmp() callback function is slow, the client's cmp() may
    periodically invoke cond_resched() to voluntarily yield the CPU. All
    inner loops of list_sort() call back to cmp().

    Stability of the sort: distinct elements that compare equal emerge from
    the sort in the same order as with Mark's code, for simple test cases. A
    boot-time test is provided to verify this and other correctness
    requirements.

    A kernel that uses drm.ko appears to run normally with this change; I have
    no suitable hardware to similarly test the use by UBIFS.

    [akpm@linux-foundation.org: style tweaks, fix comment, make list_sort_test __init]
    Signed-off-by: Don Mullis
    Cc: Dave Airlie
    Cc: Andi Kleen
    Cc: Dave Chinner
    Cc: Artem Bityutskiy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Don Mullis
     
  • Signed-off-by: André Goddard Rosa
    Cc: Li Zefan
    Cc: Joe Perches
    Cc: Frederic Weisbecker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    André Goddard Rosa
     
  • Removes 32 bytes on core2 with gcc 4.4.1:
    text data bss dec hex filename
    3196 0 0 3196 c7c lib/string-BEFORE.o
    3164 0 0 3164 c5c lib/string-AFTER.o

    Signed-off-by: André Goddard Rosa
    Cc: Joe Perches
    Cc: Frederic Weisbecker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    André Goddard Rosa
     
  • Patchwork queues show the acceptance/rejection state of submitted patches
    for various MAINTAINER trees. Document their existence.

    Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • by commit 0234f84ebb00d36c48062befa5436eef36b71ccd
    Update patterns

    Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • by commit 955015bb0b42167d14f776ff5947ae2463a974dc

    Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches