02 Oct, 2009

31 commits

  • irq is declared with size NR_CARDS (4), but the loop containing this
    segment runs up until NR_ISA_ADDRS (16), possibly reading from irq[i] (and
    trying to use the result)

    Identified by the Parfait static scanner.

    Signed-off-by: Roel Kluin
    Acked-by: Jiri Slaby
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roel Kluin
     
  • Convert spaces to tabs and remove wrong spaces

    Signed-off-by: Breno Leitao
    Cc: Scott Kilau
    Cc: Jiri Slaby
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Breno Leitao
     
  • Signed-off-by: Atsushi Nemoto
    Cc: Ralf Baechle
    Cc: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Atsushi Nemoto
     
  • Add better support for omitting either the card detect or the write
    protect GPIOs if the board does not support it. Add the fields
    no_wprotect and no_detect to the platform data which when set indicate the
    absence of the respective GPIOs.

    Note, this also fixes a minor bug where it tries to free IRQ0 if there is
    no detect gpio available.

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

    Ben Dooks
     
  • We have found a couple of boards where the SDIO IRQ hardware support has
    failed to work properly, and thus we should make it configurable whether
    or not to be included in the driver.

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

    Ben Dooks
     
  • Fixes for the DMA transfer mode of the driver to try and improve the state
    of the code:

    - Ensure that dma_complete is set during the end of the command phase
    so that transfers do not stall awaiting the completion

    - Update the DMA debugging to provide a bit more useful information
    such as how many DMA descriptors where not processed and print the
    DMA addresses in hexadecimal.

    - Fix the DMA channel request code to actually request DMA for the
    S3CMCI block instead of whatever '0' signified.

    - Add fallback to PIO if we cannot get the DMA channel, as many of the
    devices with this block only have a limited number of DMA channels.

    - Only try and claim and free the DMA channel if we are trying to use it.

    This improves the driver DMA code to the point where it can now identify a
    card and read the partition table. However the DMA can still stall when
    trying to move data between the host and memory.

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

    Ben Dooks
     
  • Add a selection for the data transfer mode of the s3cmci driver, allowing
    for either a configuration or rumtime selection of the use of the DMA or
    PIO transfer code.

    The PIO only mode is 476 bytes smaller than the driver with both methods
    compiled in.

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

    Ben Dooks
     
  • The controller supports SDIO IRQ detection so add support for hardware
    assisted SDIO interrupt detection for the SDIO core. This improves the
    response time for SDIO interrupts and thus the transfer rate from devices
    such as the Marvel 8686.

    As a note, it does seem that the controller will miss an IRQ than is held
    asserted, so there are some manual checks to see if the SDIO interrupt is
    active after a transfer.

    Major testing on the S3C2440.

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

    Ben Dooks
     
  • Export driver state and hardware register state via debugfs entries
    created under a directory formed from dev_name() on the probed device when
    CONFIG_DEBUG_FS is set.

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

    Ben Dooks
     
  • The clear_imask() call should be used to clear the interrupt mask
    register, as it may end up clearing the SDIO interrupt bit if this is
    enabled.

    Change all writes of zero to SDIIMSK register to use clear_imask() ready
    for the SDIO updates.

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

    Ben Dooks
     
  • Move to using dev_pm_ops for suspend and resume.

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

    Ben Dooks
     
  • Move to using gpiolib to access the card detect and write protect GPIO
    lines instead of using the platform speicifc s3c2410_gpio calls.

    Also ensure that the card lines are claimed the same way to avoid overlap
    with any other drivers.

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

    Ben Dooks
     
  • Use the platform id list to match the three different versions of the
    hardware block that this driver supports.

    This will change the prefix of the console messages produced by this
    driver to be prefixed by s3c-mci instead of the hardware block name, such
    as s3c2440-mci.

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

    Ben Dooks
     
  • Replace the local definition RESSIZE() with the standard resource_size()
    call for getting the size of a struct resource.

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

    Ben Dooks
     
  • In charge/uncharge/reclaim path, usage_in_excess is calculated repeatedly
    and it takes res_counter's spin_lock every time.

    This patch removes unnecessary calls for res_count_soft_limit_excess.

    Reviewed-by: Daisuke Nishimura
    Signed-off-by: KAMEZAWA Hiroyuki
    Cc: Paul Menage
    Cc: Li Zefan
    Cc: Balbir Singh
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KAMEZAWA Hiroyuki
     
  • This patch clean up/fixes for memcg's uncharge soft limit path.

    Problems:
    Now, res_counter_charge()/uncharge() handles softlimit information at
    charge/uncharge and softlimit-check is done when event counter per memcg
    goes over limit. Now, event counter per memcg is updated only when
    memory usage is over soft limit. Here, considering hierarchical memcg
    management, ancesotors should be taken care of.

    Now, ancerstors(hierarchy) are handled in charge() but not in uncharge().
    This is not good.

    Prolems:
    1. memcg's event counter incremented only when softlimit hits. That's bad.
    It makes event counter hard to be reused for other purpose.

    2. At uncharge, only the lowest level rescounter is handled. This is bug.
    Because ancesotor's event counter is not incremented, children should
    take care of them.

    3. res_counter_uncharge()'s 3rd argument is NULL in most case.
    ops under res_counter->lock should be small. No "if" sentense is better.

    Fixes:
    * Removed soft_limit_xx poitner and checks in charge and uncharge.
    Do-check-only-when-necessary scheme works enough well without them.

    * make event-counter of memcg incremented at every charge/uncharge.
    (per-cpu area will be accessed soon anyway)

    * All ancestors are checked at soft-limit-check. This is necessary because
    ancesotor's event counter may never be modified. Then, they should be
    checked at the same time.

    Reviewed-by: Daisuke Nishimura
    Signed-off-by: KAMEZAWA Hiroyuki
    Cc: Paul Menage
    Cc: Li Zefan
    Cc: Balbir Singh
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KAMEZAWA Hiroyuki
     
  • __css_put() doesn't check a bug as refcnt goes to minus.
    I think it should be caught. This patch adds a check for it.

    Signed-off-by: KAMEZAWA Hiroyuki
    Cc: Paul Menage
    Cc: Li Zefan
    Cc: Balbir Singh
    Cc: Daisuke Nishimura
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KAMEZAWA Hiroyuki
     
  • __mem_cgroup_largest_soft_limit_node() returns a mem_cgroup_per_zone "mz"
    with incremnted mz->mem->css's refcnt. Then, the caller of this function
    has to call css_put(mz->mem->css).

    But, mz can be !NULL even if "not found" i.e. without css_get(). By
    this, css->refcnt will go down to minus.

    This may cause various things...one of results will be
    initite-loop in css_tryget() as this.

    INFO: RCU detected CPU 0 stall (t=10000 jiffies)
    sending NMI to all CPUs:
    NMI backtrace for cpu 0
    CPU 0:

    <> [] trace_hardirqs_off+0xd/0x10
    [] flat_send_IPI_mask+0x90/0xb0
    [] flat_send_IPI_all+0x69/0x70
    [] arch_trigger_all_cpu_backtrace+0x62/0xa0
    [] __rcu_pending+0x7e/0x370
    [] rcu_check_callbacks+0x47/0x130
    [] update_process_times+0x46/0x70
    [] tick_sched_timer+0x60/0x160
    [] ? tick_sched_timer+0x0/0x160
    [] __run_hrtimer+0xba/0x150
    [] hrtimer_interrupt+0xd5/0x1b0
    [] ? trace_hardirqs_off_thunk+0x3a/0x3c
    [] smp_apic_timer_interrupt+0x6d/0x9b
    [] apic_timer_interrupt+0x13/0x20
    [] ? mem_cgroup_walk_tree+0x156/0x180
    [] ? mem_cgroup_walk_tree+0x73/0x180
    [] ? mem_cgroup_walk_tree+0x32/0x180
    [] ? mem_cgroup_get_local_stat+0x0/0x110
    [] ? mem_control_stat_show+0x14b/0x330
    [] ? cgroup_seqfile_show+0x3d/0x60

    Above shows CPU0 caught in css_tryget()'s inifinite loop because
    of bad refcnt.

    This is a fix to set mz=NULL at the top of retry path.

    Signed-off-by: KAMEZAWA Hiroyuki
    Acked-by: Paul Menage
    Cc: Li Zefan
    Cc: Balbir Singh
    Cc: Daisuke Nishimura
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KAMEZAWA Hiroyuki
     
  • Some configurations of the Timberdale FPGA has the uartlite
    included.

    Signed-off-by: Richard Röjfors
    Cc: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Röjfors
     
  • This patch size comment is like so last millenium. Update it to modern
    times.

    Signed-off-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • Some manufacturers provide vendor information in non-vendor specific CIS
    tuples. For example, Broadcom uses an Extended Function tuple to provide
    the MAC address on some of their network cards, as in the case of the
    Nintendo Wii WLAN daughter card.

    This patch allows passing whitelisted FUNCE tuples unknown to the SDIO
    core to a matching SDIO driver instead of rejecting them and failing.

    Signed-off-by: Albert Herranz
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Albert Herranz
     
  • The page_address_in_vma() is not only used in unuse_vma().

    Signed-off-by: Huang Shijie
    Acked-by: Hugh Dickins
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Huang Shijie
     
  • Just like ip_fast_csum, the assembly snippet in csum_ipv6_magic needs a
    memory clobber, as it is only passed the address of the buffer, not a
    memory reference to the buffer itself.

    This caused failures in Hurd's pfinetv4 when we tried to compile it with
    gcc-4.3 (bogus checksums).

    Signed-off-by: Samuel Thibault
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: "H. Peter Anvin"
    Acked-by: "David S. Miller"
    Cc: Andi Kleen
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Samuel Thibault
     
  • Fix some build failures when using gcc-4.x for MN10300.

    Firstly, __get_user() fails to build because the pointer points to a const and
    __gu_val ends up being read-only:

    In file included from include/linux/mempolicy.h:62,
    from init/main.c:50:
    include/linux/pagemap.h: In function 'fault_in_pages_readable':
    include/linux/pagemap.h:394: error: read-only variable '__gu_val' used as 'asm' output
    include/linux/pagemap.h:394: error: read-only variable '__gu_val' used as 'asm' output
    include/linux/pagemap.h:394: error: read-only variable '__gu_val' used as 'asm' output
    include/linux/pagemap.h:400: error: read-only variable '__gu_val' used as 'asm' output
    include/linux/pagemap.h:400: error: read-only variable '__gu_val' used as 'asm' output
    include/linux/pagemap.h:400: error: read-only variable '__gu_val' used as 'asm' output
    make[1]: *** [init/main.o] Error 1

    Secondly, gcc-4 doesn't allow casts of lvalues:

    UPD include/linux/compile.h
    arch/mn10300/kernel/rtc.c: In function 'calibrate_clock':
    arch/mn10300/kernel/rtc.c:170: error: lvalue required as left operand of assignment
    arch/mn10300/kernel/rtc.c:172: error: lvalue required as left operand of assignment
    make[1]: *** [arch/mn10300/kernel/rtc.o] Error 1

    These are seen with gcc 4.2.1.

    Signed-off-by: Mark Salter
    Signed-off-by: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mark Salter
     
  • Signed-off-by: Joe Perches
    Acked-by: Marek Vasut
    Acked-by: Tomas Cech
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Stanse found (again) a BKL imbalance in vt_ioctl.

    It's easily triggerable by ioctl(dev_tty_fd, VT_SETACTIVATE, NULL);

    Introduced by

    commit d3b5cffcf84a8bdc7073dce4745d67c72629af85 Author: Alan Cox
    Date: Sat Sep 19 13:13:26 2009 -0700

    vt: add an activate and lock

    Signed-off-by: Jiri Slaby
    Cc: Alan Cox
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Slaby
     
  • Revert 45d80eea87c9f8292d2d33173d6866c0ec57238a ("m68k: convert to
    asm-generic/hardirq.h") - it fails to compile due to an inclusion tangle:

    In file included from include/linux/irq.h:12,
    from include/asm-generic/hardirq.h:6,
    from /usr/src/devel/arch/m68k/include/asm/hardirq_mm.h:6,
    from /usr/src/devel/arch/m68k/include/asm/hardirq.h:4,
    from include/linux/hardirq.h:10,
    from /usr/src/devel/arch/m68k/include/asm/system_mm.h:69,
    from /usr/src/devel/arch/m68k/include/asm/system.h:4,
    from include/linux/list.h:7,
    from include/linux/preempt.h:11,
    from include/linux/spinlock.h:50,
    from include/linux/seqlock.h:29,
    from include/linux/time.h:8,
    from include/linux/timex.h:56,
    from include/linux/sched.h:56,
    from arch/m68k/kernel/asm-offsets.c:14:
    include/linux/smp.h:17: error: field 'list' has incomplete type

    Cc: Christoph Hellwig
    Cc: Geert Uytterhoeven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • The asm-generic/gpio.h header uses the might_sleep() macro but doesn't
    include the header for it, so any source code that might include
    linux/gpio.h before linux/kernel.h can easily lead to a build failure.

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

    Mike Frysinger
     
  • [akpm@linux-foundation.org: fix KVM]
    Signed-off-by: Alexey Dobriyan
    Acked-by: Mike Frysinger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • drivers/input/input.c:1277: warning: 'input_dev_reset' defined but not used

    Acked-by: Dmitry Torokhov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • Starting from commit 4a4962263f07d14660849ec134ee42b63e95ea9a "reduce
    symbol table for loaded modules (v2)", the kernel/module.c build is broken
    with CONFIG_KALLSYMS disabled.

    CC kernel/module.o
    kernel/module.c:1995: warning: type defaults to 'int' in declaration of 'Elf_Hdr'
    kernel/module.c:1995: error: expected ';', ',' or ')' before '*' token
    kernel/module.c: In function 'load_module':
    kernel/module.c:2203: error: 'strmap' undeclared (first use in this function)
    kernel/module.c:2203: error: (Each undeclared identifier is reported only once
    kernel/module.c:2203: error: for each function it appears in.)
    kernel/module.c:2239: error: 'symoffs' undeclared (first use in this function)
    kernel/module.c:2239: error: implicit declaration of function 'layout_symtab'
    kernel/module.c:2240: error: 'stroffs' undeclared (first use in this function)
    make[1]: *** [kernel/module.o] Error 1
    make: *** [kernel/module.o] Error 2

    There are three different issues:

    - layout_symtab() takes a const Elf_Ehdr

    - layout_symtab() needs to return a value

    - symoffs/stroffs/strmap are referenced by the load_module() code
    despite being ifdefed out, which seems unnecessary given the noop
    behaviour of layout_symtab()/add_kallsyms() in the case of
    CONFIG_KALLSYMS=n.

    Signed-off-by: Paul Mundt
    Acked-by: Jan Beulich
    Acked-by: Rusty Russell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paul Mundt
     

01 Oct, 2009

9 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
    ax25: Fix possible oops in ax25_make_new
    net: restore tx timestamping for accelerated vlans
    Phonet: fix mutex imbalance
    sit: fix off-by-one in ipip6_tunnel_get_prl
    net: Fix sock_wfree() race
    net: Make setsockopt() optlen be unsigned.

    Linus Torvalds
     
  • In ax25_make_new, if kmemdup of digipeat returns an error, there would
    be an oops in sk_free while calling sk_destruct, because sk_protinfo
    is NULL at the moment; move sk->sk_destruct initialization after this.

    BTW of reported-by: Bernard Pidoux F6BVP

    Signed-off-by: Jarek Poplawski
    Signed-off-by: David S. Miller

    Jarek Poplawski
     
  • Since commit 9b22ea560957de1484e6b3e8538f7eef202e3596
    ( net: fix packet socket delivery in rx irq handler )

    We lost rx timestamping of packets received on accelerated vlans.

    Effect is that tcpdump on real dev can show strange timings, since it gets rx timestamps
    too late (ie at skb dequeueing time, not at skb queueing time)

    14:47:26.986871 IP 192.168.20.110 > 192.168.20.141: icmp 64: echo request seq 1
    14:47:26.986786 IP 192.168.20.141 > 192.168.20.110: icmp 64: echo reply seq 1

    14:47:27.986888 IP 192.168.20.110 > 192.168.20.141: icmp 64: echo request seq 2
    14:47:27.986781 IP 192.168.20.141 > 192.168.20.110: icmp 64: echo reply seq 2

    14:47:28.986896 IP 192.168.20.110 > 192.168.20.141: icmp 64: echo request seq 3
    14:47:28.986780 IP 192.168.20.141 > 192.168.20.110: icmp 64: echo reply seq 3

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • From: Rémi Denis-Courmont

    port_mutex was unlocked twice.

    Signed-off-by: Rémi Denis-Courmont
    Signed-off-by: David S. Miller

    Rémi Denis-Courmont
     
  • When requesting all prl entries (kprl.addr == INADDR_ANY) and there are
    more prl entries than there is space passed from userspace, the existing
    code would always copy cmax+1 entries, which is more than can be handled.

    This patch makes the kernel copy only exactly cmax entries.

    Signed-off-by: Sascha Hlusiak
    Acked-By: Fred L. Templin
    Signed-off-by: David S. Miller

    Sascha Hlusiak
     
  • Commit 2b85a34e911bf483c27cfdd124aeb1605145dc80
    (net: No more expensive sock_hold()/sock_put() on each tx)
    opens a window in sock_wfree() where another cpu
    might free the socket we are working on.

    A fix is to call sk->sk_write_space(sk) while still
    holding a reference on sk.

    Reported-by: Jike Song
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • This provides safety against negative optlen at the type
    level instead of depending upon (sometimes non-trivial)
    checks against this sprinkled all over the the place, in
    each and every implementation.

    Based upon work done by Arjan van de Ven and feedback
    from Linus Torvalds.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • …l/git/tip/linux-2.6-tip

    * 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    sched_clock: Fix atomicity/continuity bug by using cmpxchg64()
    x86: Provide an alternative() based cmpxchg64()

    Linus Torvalds
     
  • Commit def0a9b2573 (sched_clock: Make it NMI safe) assumed
    cmpxchg() of 64bit values was available on X86_32.

    That is not so - and causes some subtle scheduler misbehavior due
    to incorrect timestamps off to up by ~4 seconds.

    Two symptoms are known right now:

    - interactivity problems seen by Arjan: up to 600 msecs
    latencies instead of the expected 20-40 msecs. These
    latencies are very visible on the desktop.

    - incorrect CPU stats: occasionally too high percentages in 'top',
    and crazy CPU usage stats.

    Reported-by: Martin Schwidefsky
    Signed-off-by: Eric Dumazet
    Signed-off-by: Arjan van de Ven
    Acked-by: Linus Torvalds
    Cc: John Stultz
    Cc: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Eric Dumazet