16 May, 2014

2 commits

  • Not really the solution to the problem, but at least it confines the
    mess in the core code and allows to get rid of the create/destroy_irq
    variants from hell, i.e. 3 implementations with different semantics
    plus the x86 specific variants __create_irqs and create_irq_nr
    which have been invented in another circle of hell.

    x86 : x86 should be converted to irq domains and I'm deliberately
    making it impossible to do the multi-vector MSI support by
    adding more crap to the current mess. It's not that hard to do
    and I'm really tired of the trainwrecks which have been invented
    by baindaid engineering so far. Any attempt to do multi-vector
    MSI or ioapic hotplug without converting to irq domains is NAKed
    hereby.

    tile: Might use irq domains as well, but it has a very limited
    interrupt space, so handling it via this functionality might be
    the right thing to do even in the long run.

    ia64: That's an hopeless case, as I doubt that anyone has the stomach
    to rewrite the homebrewn dynamic allocation facilities. I stared
    at it for a couple of hours and gave up. The create/destroy_irq
    mess could be made private to itanic right away if there
    wouldn't be the iommu/dmar driver being shared with x86. So to
    do that I'm going to add a separate ia64 specific implementation
    later in order not to deep-six itanic right away.

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Grant Likely
    Cc: Tony Luck
    Cc: Peter Zijlstra
    Cc: Chris Metcalf
    Cc: Fenghua Yu
    Cc: x86@kernel.org
    Link: http://lkml.kernel.org/r/20140507154334.208629358@linutronix.de
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     
  • Reason: Get the upstream and urgent fixes before applying more complex
    changes.

    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     

10 May, 2014

1 commit

  • Pull x86 fixes from Peter Anvin:
    "A somewhat unpleasantly large collection of small fixes. The big ones
    are the __visible tree sweep and a fix for 'earlyprintk=efi,keep'. It
    was using __init functions with predictably suboptimal results.

    Another key fix is a build fix which would produce output that simply
    would not decompress correctly in some configuration, due to the
    existing Makefiles picking up an unfortunate local label and mistaking
    it for the global symbol _end.

    Additional fixes include the handling of 64-bit numbers when setting
    the vdso data page (a latent bug which became manifest when i386
    started exporting a vdso with time functions), a fix to the new MSR
    manipulation accessors which would cause features to not get properly
    unblocked, a build fix for 32-bit userland, and a few new platform
    quirks"

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86, vdso, time: Cast tv_nsec to u64 for proper shifting in update_vsyscall()
    x86: Fix typo in MSR_IA32_MISC_ENABLE_LIMIT_CPUID macro
    x86: Fix typo preventing msr_set/clear_bit from having an effect
    x86/intel: Add quirk to disable HPET for the Baytrail platform
    x86/hpet: Make boot_hpet_disable extern
    x86-64, build: Fix stack protector Makefile breakage with 32-bit userland
    x86/reboot: Add reboot quirk for Certec BPC600
    asmlinkage: Add explicit __visible to drivers/*, lib/*, kernel/*
    asmlinkage, x86: Add explicit __visible to arch/x86/*
    asmlinkage: Revert "lto: Make asmlinkage __visible"
    x86, build: Don't get confused by local symbols
    x86/efi: earlyprintk=efi,keep fix

    Linus Torvalds
     

09 May, 2014

2 commits

  • …l/git/rostedt/linux-trace

    Pull tracing fixes from Steven Rostedt:
    "This contains two fixes.

    The first is a long standing bug that causes bogus data to show up in
    the refcnt field of the module_refcnt tracepoint. It was introduced
    by a merge conflict resolution back in 2.6.35-rc days.

    The result should be 'refcnt = incs - decs', but instead it did
    'refcnt = incs + decs'.

    The second fix is to a bug that was introduced in this merge window
    that allowed for a tracepoint funcs pointer to be used after it was
    freed. Moving the location of where the probes are released solved
    the problem"

    * tag 'trace-fixes-v3.15-rc4-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
    tracepoint: Fix use of tracepoint funcs after rcu free
    trace: module: Maintain a valid user count

    Linus Torvalds
     
  • Pull mmc/rtsx revert from Lee Jones.

    * tag 'mfd-mmc-fixes-3.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd:
    mmc: rtsx: Revert "mmc: rtsx: add support for pre_req and post_req"

    Linus Torvalds
     

08 May, 2014

4 commits

  • The replacement of the 'count' variable by two variables 'incs' and
    'decs' to resolve some race conditions during module unloading was done
    in parallel with some cleanup in the trace subsystem, and was integrated
    as a merge.

    Unfortunately, the formula for this replacement was wrong in the tracing
    code, and the refcount in the traces was not usable as a result.

    Use 'count = incs - decs' to compute the user count.

    Link: http://lkml.kernel.org/p/1393924179-9147-1-git-send-email-romain.izard.pro@gmail.com

    Acked-by: Ingo Molnar
    Cc: Rusty Russell
    Cc: Frederic Weisbecker
    Cc: stable@vger.kernel.org # 2.6.35
    Fixes: c1ab9cab7509 "merge conflict resolution"
    Signed-off-by: Romain Izard
    Signed-off-by: Steven Rostedt

    Romain Izard
     
  • This reverts commit c42deffd5b53c9e583d83c7964854ede2f12410d.

    commit did use
    mutex_unlock() in tasklet, but mutex_unlock() can't be used in
    tasklet(atomic context). The driver needs to use mutex to avoid
    concurrency, so we can't use tasklet here, the patch need to be
    removed.

    The spinlock host->lock and pcr->lock may deadlock, one way to solve
    the deadlock is remove host->lock in sd_isr_done_transfer(), but if
    using workqueue the we can avoid using the spinlock and also avoid
    the problem.

    Signed-off-by: Micky Ching
    Acked-by: Ulf Hansson
    Signed-off-by: Lee Jones

    Micky Ching
     
  • Pull radeon mullins support from Dave Airlie:
    "This is support for the new AMD mullins APU, it pretty much just adds
    support to the driver in the all the right places, and is pretty low
    risk wrt other GPUs"

    Oh well. I guess it ends up fitting under "support new hardware" for
    merging late.

    * 'drm-radeon-mullins' of git://people.freedesktop.org/~airlied/linux:
    drm/radeon: add pci ids for Mullins
    drm/radeon: add Mullins VCE support
    drm/radeon: modesetting updates for Mullins.
    drm/radeon: dpm updates for KV/KB
    drm/radeon: add Mullins dpm support.
    drm/radeon: add Mullins UVD support.
    drm/radeon: update cik init for Mullins.
    drm/radeon: add Mullins chip family

    Linus Torvalds
     
  • Pull drm fixes from Dave Airlie:
    "radeon, i915 and nouveau fixes, all fixes for regressions or black
    screens, or possible oopses"

    * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
    drm/radeon: lower the ref * post PLL maximum
    drm/radeon: check that we have a clock before PLL setup
    drm/radeon: drm/radeon: add missing radeon_semaphore_free to error path
    drm/radeon: Fix num_banks calculation for SI
    agp: info leak in agpioc_info_wrap()
    drm/gm107/gr: bump attrib cb size quite a bit
    drm/nouveau: fix another lock unbalance in nouveau_crtc_page_flip
    drm/nouveau/bios: fix shadowing from PROM on big-endian systems
    drm/nouveau/acpi: allow non-optimus setups to load vbios from acpi
    drm/radeon/dp: check for errors in dpcd reads
    drm/radeon: avoid high jitter with small frac divs
    drm/radeon: check buffer relocation offset
    drm/radeon: use pflip irq on R600+ v2
    drm/radeon/uvd: use lower clocks on old UVD to boot v2
    drm/i915: don't try DP_LINK_BW_5_4 on HSW ULX
    drm/i915: Sanitize the enable_ppgtt module option once
    drm/i915: Break encoder->crtc link separately in intel_sanitize_crtc()

    Linus Torvalds
     

07 May, 2014

9 commits

  • Add Mullins chips support.

    * 'mullins' of git://people.freedesktop.org/~deathsimple/linux:
    drm/radeon: add pci ids for Mullins
    drm/radeon: add Mullins VCE support
    drm/radeon: modesetting updates for Mullins.
    drm/radeon: dpm updates for KV/KB
    drm/radeon: add Mullins dpm support.
    drm/radeon: add Mullins UVD support.
    drm/radeon: update cik init for Mullins.
    drm/radeon: add Mullins chip family

    Dave Airlie
     
  • Some more i915 fixes. There's still some DP issues we are looking into,
    but wanted to get these moving.

    * tag 'topc/core-stuff-2014-05-05' of git://anongit.freedesktop.org/drm-intel:
    drm/i915: don't try DP_LINK_BW_5_4 on HSW ULX
    drm/i915: Sanitize the enable_ppgtt module option once
    drm/i915: Break encoder->crtc link separately in intel_sanitize_crtc()

    Dave Airlie
     
  • Patch 01f8fa4f01d "genirq: Allow forcing cpu affinity of interrupts" added
    an irq_force_affinity() function, and 30ccf03b4a6 "clocksource: Exynos_mct:
    Use irq_force_affinity() in cpu bringup" subsequently uses it. However, the
    driver can be used with CONFIG_SMP disabled, but the function declaration
    is only available for CONFIG_SMP, leading to this build error:

    drivers/clocksource/exynos_mct.c:431:3: error: implicit declaration of function 'irq_force_affinity' [-Werror=implicit-function-declaration]
    irq_force_affinity(mct_irqs[MCT_L0_IRQ + cpu], cpumask_of(cpu));

    This patch introduces a dummy helper function for the non-SMP case
    that always returns success, to get rid of the build error.
    Since the patches causing the problem are marked for stable backports,
    this one should be as well.

    Signed-off-by: Arnd Bergmann
    Cc: Krzysztof Kozlowski
    Acked-by: Kukjin Kim
    Cc: stable@vger.kernel.org
    Link: http://lkml.kernel.org/r/5619084.0zmrrIUZLV@wuerfel
    Signed-off-by: Thomas Gleixner

    Arnd Bergmann
     
  • Merge misc fixes from Andrew Morton:
    "13 fixes"

    * emailed patches from Andrew Morton :
    agp: info leak in agpioc_info_wrap()
    fs/affs/super.c: bugfix / double free
    fanotify: fix -EOVERFLOW with large files on 64-bit
    slub: use sysfs'es release mechanism for kmem_cache
    revert "mm: vmscan: do not swap anon pages just because free+file is low"
    autofs: fix lockref lookup
    mm: filemap: update find_get_pages_tag() to deal with shadow entries
    mm/compaction: make isolate_freepages start at pageblock boundary
    MAINTAINERS: zswap/zbud: change maintainer email address
    mm/page-writeback.c: fix divide by zero in pos_ratio_polynom
    hugetlb: ensure hugepage access is denied if hugepages are not supported
    slub: fix memcg_propagate_slab_attrs
    drivers/rtc/rtc-pcf8523.c: fix month definition

    Linus Torvalds
     
  • debugobjects warning during netfilter exit:

    ------------[ cut here ]------------
    WARNING: CPU: 6 PID: 4178 at lib/debugobjects.c:260 debug_print_object+0x8d/0xb0()
    ODEBUG: free active (active state 0) object type: timer_list hint: delayed_work_timer_fn+0x0/0x20
    Modules linked in:
    CPU: 6 PID: 4178 Comm: kworker/u16:2 Tainted: G W 3.11.0-next-20130906-sasha #3984
    Workqueue: netns cleanup_net
    Call Trace:
    dump_stack+0x52/0x87
    warn_slowpath_common+0x8c/0xc0
    warn_slowpath_fmt+0x46/0x50
    debug_print_object+0x8d/0xb0
    __debug_check_no_obj_freed+0xa5/0x220
    debug_check_no_obj_freed+0x15/0x20
    kmem_cache_free+0x197/0x340
    kmem_cache_destroy+0x86/0xe0
    nf_conntrack_cleanup_net_list+0x131/0x170
    nf_conntrack_pernet_exit+0x5d/0x70
    ops_exit_list+0x5e/0x70
    cleanup_net+0xfb/0x1c0
    process_one_work+0x338/0x550
    worker_thread+0x215/0x350
    kthread+0xe7/0xf0
    ret_from_fork+0x7c/0xb0

    Also during dcookie cleanup:

    WARNING: CPU: 12 PID: 9725 at lib/debugobjects.c:260 debug_print_object+0x8c/0xb0()
    ODEBUG: free active (active state 0) object type: timer_list hint: delayed_work_timer_fn+0x0/0x20
    Modules linked in:
    CPU: 12 PID: 9725 Comm: trinity-c141 Not tainted 3.15.0-rc2-next-20140423-sasha-00018-gc4ff6c4 #408
    Call Trace:
    dump_stack (lib/dump_stack.c:52)
    warn_slowpath_common (kernel/panic.c:430)
    warn_slowpath_fmt (kernel/panic.c:445)
    debug_print_object (lib/debugobjects.c:262)
    __debug_check_no_obj_freed (lib/debugobjects.c:697)
    debug_check_no_obj_freed (lib/debugobjects.c:726)
    kmem_cache_free (mm/slub.c:2689 mm/slub.c:2717)
    kmem_cache_destroy (mm/slab_common.c:363)
    dcookie_unregister (fs/dcookies.c:302 fs/dcookies.c:343)
    event_buffer_release (arch/x86/oprofile/../../../drivers/oprofile/event_buffer.c:153)
    __fput (fs/file_table.c:217)
    ____fput (fs/file_table.c:253)
    task_work_run (kernel/task_work.c:125 (discriminator 1))
    do_notify_resume (include/linux/tracehook.h:196 arch/x86/kernel/signal.c:751)
    int_signal (arch/x86/kernel/entry_64.S:807)

    Sysfs has a release mechanism. Use that to release the kmem_cache
    structure if CONFIG_SYSFS is enabled.

    Only slub is changed - slab currently only supports /proc/slabinfo and
    not /sys/kernel/slab/*. We talked about adding that and someone was
    working on it.

    [akpm@linux-foundation.org: fix CONFIG_SYSFS=n build]
    [akpm@linux-foundation.org: fix CONFIG_SYSFS=n build even more]
    Signed-off-by: Christoph Lameter
    Reported-by: Sasha Levin
    Tested-by: Sasha Levin
    Acked-by: Greg KH
    Cc: Thomas Gleixner
    Cc: Pekka Enberg
    Cc: Russell King
    Cc: Bart Van Assche
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     
  • Currently, I am seeing the following when I `mount -t hugetlbfs /none
    /dev/hugetlbfs`, and then simply do a `ls /dev/hugetlbfs`. I think it's
    related to the fact that hugetlbfs is properly not correctly setting
    itself up in this state?:

    Unable to handle kernel paging request for data at address 0x00000031
    Faulting instruction address: 0xc000000000245710
    Oops: Kernel access of bad area, sig: 11 [#1]
    SMP NR_CPUS=2048 NUMA pSeries
    ....

    In KVM guests on Power, in a guest not backed by hugepages, we see the
    following:

    AnonHugePages: 0 kB
    HugePages_Total: 0
    HugePages_Free: 0
    HugePages_Rsvd: 0
    HugePages_Surp: 0
    Hugepagesize: 64 kB

    HPAGE_SHIFT == 0 in this configuration, which indicates that hugepages
    are not supported at boot-time, but this is only checked in
    hugetlb_init(). Extract the check to a helper function, and use it in a
    few relevant places.

    This does make hugetlbfs not supported (not registered at all) in this
    environment. I believe this is fine, as there are no valid hugepages
    and that won't change at runtime.

    [akpm@linux-foundation.org: use pr_info(), per Mel]
    [akpm@linux-foundation.org: fix build when HPAGE_SHIFT is undefined]
    Signed-off-by: Nishanth Aravamudan
    Reviewed-by: Aneesh Kumar K.V
    Acked-by: Mel Gorman
    Cc: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nishanth Aravamudan
     
  • Pull vfs fixes from Al Viro:
    "dcache fixes + kvfree() (uninlined, exported by mm/util.c) + posix_acl
    bugfix from hch"

    The dcache fixes are for a subtle LRU list corruption bug reported by
    Miklos Szeredi, where people inside IBM saw list corruptions with the
    LTP/host01 test.

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    nick kvfree() from apparmor
    posix_acl: handle NULL ACL in posix_acl_equiv_mode
    dcache: don't need rcu in shrink_dentry_list()
    more graceful recovery in umount_collect()
    don't remove from shrink list in select_collect()
    dentry_kill(): don't try to remove from shrink list
    expand the call of dentry_lru_del() in dentry_kill()
    new helper: dentry_free()
    fold try_prune_one_dentry()
    fold d_kill() and d_free()
    fix races between __d_instantiate() and checks of dentry flags

    Linus Torvalds
     
  • too many places open-code it

    Signed-off-by: Al Viro

    Al Viro
     
  • Pull fuse fixes from Miklos Szeredi:
    "This adds ctime update in the new cached writeback mode and also
    fixes/simplifies the mtime update handling. Support for rename flags
    (aka renameat2) is also added to the userspace API"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
    fuse: add renameat2 support
    fuse: clear MS_I_VERSION
    fuse: clear FUSE_I_CTIME_DIRTY flag on setattr
    fuse: trust kernel i_ctime only
    fuse: remove .update_time
    fuse: allow ctime flushing to userspace
    fuse: fuse: add time_gran to INIT_OUT
    fuse: add .write_inode
    fuse: clean up fsync
    fuse: fuse: fallocate: use file_update_time()
    fuse: update mtime on open(O_TRUNC) in atomic_o_trunc mode
    fuse: update mtime on truncate(2)
    fuse: do not use uninitialized i_mode
    fuse: fix mtime update error in fsync
    fuse: check fallocate mode
    fuse: add __exit to fuse_ctl_cleanup

    Linus Torvalds
     

06 May, 2014

5 commits

  • Signed-off-by: Samuel Li
    Signed-off-by: Alex Deucher
    Signed-off-by: Christian König

    Samuel Li
     
  • As requested by Linus, revert adding __visible to asmlinkage.
    Instead we add __visible explicitely to all the symbols
    that need it.

    This reverts commit 128ea04a9885af9629059e631ddf0cab4815b589.

    Link: http://lkml.kernel.org/r/1398984278-29319-2-git-send-email-andi@firstfloor.org
    Signed-off-by: H. Peter Anvin

    Andi Kleen
     
  • Pull networking fixes from David Miller:

    1) e1000e computes header length incorrectly wrt vlans, fix from Vlad
    Yasevich.

    2) ns_capable() check in sock_diag netlink code, from Andrew
    Lutomirski.

    3) Fix invalid queue pairs handling in virtio_net, from Amos Kong.

    4) Checksum offloading busted in sxgbe driver due to incorrect
    descriptor layout, fix from Byungho An.

    5) Fix build failure with SMC_DEBUG set to 2 or larger, from Zi Shen
    Lim.

    6) Fix uninitialized A and X registers in BPF interpreter, from Alexei
    Starovoitov.

    7) Fix arch dependencies of candence driver.

    8) Fix netlink capabilities checking tree-wide, from Eric W Biederman.

    9) Don't dump IFLA_VF_PORTS if netlink request didn't ask for it in
    IFLA_EXT_MASK, from David Gibson.

    10) IPV6 FIB dump restart doesn't handle table changes that happen
    meanwhile, causing the code to loop forever or emit dups, fix from
    Kumar Sandararajan.

    11) Memory leak on VF removal in bnx2x, from Yuval Mintz.

    12) Bug fixes for new Altera TSE driver from Vince Bridgers.

    13) Fix route lookup key in SCTP, from Xugeng Zhang.

    14) Use BH blocking spinlocks in SLIP, as per a similar fix to CAN/SLCAN
    driver. From Oliver Hartkopp.

    15) TCP doesn't bump retransmit counters in some code paths, fix from
    Eric Dumazet.

    16) Clamp delayed_ack in tcp_cubic to prevent theoretical divides by
    zero. Fix from Liu Yu.

    17) Fix locking imbalance in error paths of HHF packet scheduler, from
    John Fastabend.

    18) Properly reference the transport module when vsock_core_init() runs,
    from Andy King.

    19) Fix buffer overflow in cdc_ncm driver, from Bjørn Mork.

    20) IP_ECN_decapsulate() doesn't see a correct SKB network header in
    ip_tunnel_rcv(), fix from Ying Cai.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (132 commits)
    net: macb: Fix race between HW and driver
    net: macb: Remove 'unlikely' optimization
    net: macb: Re-enable RX interrupt only when RX is done
    net: macb: Clear interrupt flags
    net: macb: Pass same size to DMA_UNMAP as used for DMA_MAP
    ip_tunnel: Set network header properly for IP_ECN_decapsulate()
    e1000e: Restrict MDIO Slow Mode workaround to relevant parts
    e1000e: Fix issue with link flap on 82579
    e1000e: Expand workaround for 10Mb HD throughput bug
    e1000e: Workaround for dropped packets in Gig/100 speeds on 82579
    net/mlx4_core: Don't issue PCIe speed/width checks for VFs
    net/mlx4_core: Load the Eth driver first
    net/mlx4_core: Fix slave id computation for single port VF
    net/mlx4_core: Adjust port number in qp_attach wrapper when detaching
    net: cdc_ncm: fix buffer overflow
    Altera TSE: ALTERA_TSE should depend on HAS_DMA
    vsock: Make transport the proto owner
    net: sched: lock imbalance in hhf qdisc
    net: mvmdio: Check for a valid interrupt instead of an error
    net phy: Check for aneg completion before setting state to PHY_RUNNING
    ...

    Linus Torvalds
     
  • Pull tty/serial fixes from Greg KH:
    "Here are some tty and serial driver fixes for things reported
    recently"

    * tag 'tty-3.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
    tty: Fix lockless tty buffer race
    Revert "tty: Fix race condition between __tty_buffer_request_room and flush_to_ldisc"
    drivers/tty/hvc: don't free hvc_console_setup after init
    n_tty: Fix n_tty_write crash when echoing in raw mode
    tty: serial: 8250_core.c Bug fix for Exar chips.

    Linus Torvalds
     
  • Right now the core vsock module is the owner of the proto family. This
    means there's nothing preventing the transport module from unloading if
    there are open sockets, which results in a panic. Fix that by allowing
    the transport to be the owner, which will refcount it properly.

    Includes version bump to 1.0.1.0-k

    Passes checkpatch this time, I swear...

    Acked-by: Dmitry Torokhov
    Signed-off-by: Andy King
    Signed-off-by: David S. Miller

    Andy King
     

05 May, 2014

1 commit

  • Pull arm64 fixes from Catalin Marinas:
    "These are mostly arm64 fixes with an additional arm(64) platform fix
    for the initialisation of vexpress clocks (the latter only affecting
    arm64; the arch/arm64 code is SoC agnostic and does not rely on early
    SoC-specific calls)

    - vexpress platform clocks initialisation moved earlier following the
    arm64 move of of_clk_init() call in a previous commit
    - Default DMA ops changed to non-coherent to preserve compatibility
    with 32-bit ARM DT files. The "dma-coherent" property can be used
    to explicitly mark a device coherent. The Applied Micro DT file
    has been updated to avoid DMA cache maintenance for the X-Gene SATA
    controller (the only arm64 related driver with such assumption in
    -rc mainline)
    - Fixmap correction for earlyprintk
    - kern_addr_valid() fix for huge pages"

    * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
    vexpress: Initialise the sysregs before setting up the clocks
    arm64: Mark the Applied Micro X-Gene SATA controller as DMA coherent
    arm64: Use bus notifiers to set per-device coherent DMA ops
    arm64: Make default dma_ops to be noncoherent
    arm64: fixmap: fix missing sub-page offset for earlyprintk
    arm64: Fix for the arm64 kern_addr_valid() function

    Linus Torvalds
     

04 May, 2014

3 commits

  • This reverts commit 6a20dbd6caa2358716136144bf524331d70b1e03.

    Although the commit correctly identifies an unsafe race condition
    between __tty_buffer_request_room() and flush_to_ldisc(), the commit
    fixes the race with an unnecessary spinlock in a lockless algorithm.

    The follow-on commit, "tty: Fix lockless tty buffer race" fixes
    the race locklessly.

    Signed-off-by: Peter Hurley
    Signed-off-by: Greg Kroah-Hartman

    Peter Hurley
     
  • Commit d57c33c5daa4 (add generic fixmap.h) added (among other
    similar things) set_fixmap_io to deal with early ioremap of devices.

    More recently, commit bf4b558eba92 (arm64: add early_ioremap support)
    converted the arm64 earlyprintk to use set_fixmap_io. A side effect of
    this conversion is that my virtual machines have stopped booting when
    I pass "earlyprintk=uart8250-8bit,0x3f8" to the guest kernel.

    Turns out that the new earlyprintk code doesn't care at all about
    sub-page offsets, and just assumes that the earlyprintk device will
    be page-aligned. Obviously, that doesn't play well with the above example.

    Further investigation shows that set_fixmap_io uses __set_fixmap instead
    of __set_fixmap_offset. A fix is to introduce a set_fixmap_offset_io that
    uses the latter, and to remove the superflous call to fix_to_virt
    (which only returns the value that set_fixmap_io has already given us).

    With this applied, my VMs are back in business. Tested on a Cortex-A57
    platform with kvmtool as platform emulation.

    Cc: Will Deacon
    Acked-by: Mark Salter
    Acked-by: Arnd Bergmann
    Signed-off-by: Marc Zyngier
    Signed-off-by: Catalin Marinas

    Marc Zyngier
     
  • Till reported that the spurious interrupt detection of threaded
    interrupts is broken in two ways:

    - note_interrupt() is called for each action thread of a shared
    interrupt line. That's wrong as we are only interested whether none
    of the device drivers felt responsible for the interrupt, but by
    calling multiple times for a single interrupt line we account
    IRQ_NONE even if one of the drivers felt responsible.

    - note_interrupt() when called from the thread handler is not
    serialized. That leaves the members of irq_desc which are used for
    the spurious detection unprotected.

    To solve this we need to defer the spurious detection of a threaded
    interrupt to the next hardware interrupt context where we have
    implicit serialization.

    If note_interrupt is called with action_ret == IRQ_WAKE_THREAD, we
    check whether the previous interrupt requested a deferred check. If
    not, we request a deferred check for the next hardware interrupt and
    return.

    If set, we check whether one of the interrupt threads signaled
    success. Depending on this information we feed the result into the
    spurious detector.

    If one primary handler of a shared interrupt returns IRQ_HANDLED we
    disable the deferred check of irq threads on the same line, as we have
    found at least one device driver who cared.

    Reported-by: Till Straumann
    Signed-off-by: Thomas Gleixner
    Tested-by: Austin Schuh
    Cc: Oliver Hartkopp
    Cc: Wolfgang Grandegger
    Cc: Pavel Pisa
    Cc: Marc Kleine-Budde
    Cc: linux-can@vger.kernel.org
    Cc: stable@vger.kernel.org
    Link: http://lkml.kernel.org/r/alpine.LFD.2.02.1303071450130.22263@ionos

    Thomas Gleixner
     

03 May, 2014

1 commit

  • Pull irq fixes from Thomas Gleixner:
    "This udpate delivers:

    - A fix for dynamic interrupt allocation on x86 which is required to
    exclude the GSI interrupts from the dynamic allocatable range.

    This was detected with the newfangled tablet SoCs which have GPIOs
    and therefor allocate a range of interrupts. The MSI allocations
    already excluded the GSI range, so we never noticed before.

    - The last missing set_irq_affinity() repair, which was delayed due
    to testing issues

    - A few bug fixes for the armada SoC interrupt controller

    - A memory allocation fix for the TI crossbar interrupt controller

    - A trivial kernel-doc warning fix"

    * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    irqchip: irq-crossbar: Not allocating enough memory
    irqchip: armanda: Sanitize set_irq_affinity()
    genirq: x86: Ensure that dynamic irq allocation does not conflict
    linux/interrupt.h: fix new kernel-doc warnings
    irqchip: armada-370-xp: Fix releasing of MSIs
    irqchip: armada-370-xp: implement the ->check_device() msi_chip operation
    irqchip: armada-370-xp: fix invalid cast of signed value into unsigned variable

    Linus Torvalds
     

02 May, 2014

1 commit


01 May, 2014

2 commits

  • This is simpler and cleaner. Depending on architecture, a smart
    compiler may or may not generate the same code.

    Acked-by: Will Deacon
    Signed-off-by: Linus Torvalds

    H. Peter Anvin
     
  • If the victim in on the shrink list, don't remove it from there.
    If shrink_dentry_list() manages to remove it from the list before
    we are done - fine, we'll just free it as usual. If not - mark
    it with new flag (DCACHE_MAY_FREE) and leave it there.

    Eventually, shrink_dentry_list() will get to it, remove the sucker
    from shrink list and call dentry_kill(dentry, 0). Which is where
    we'll deal with freeing.

    Since now dentry_kill(dentry, 0) may happen after or during
    dentry_kill(dentry, 1), we need to recognize that (by seeing
    DCACHE_DENTRY_KILLED already set), unlock everything
    and either free the sucker (in case DCACHE_MAY_FREE has been
    set) or leave it for ongoing dentry_kill(dentry, 1) to deal with.

    Signed-off-by: Al Viro

    Al Viro
     

30 Apr, 2014

1 commit


29 Apr, 2014

2 commits

  • …it/rostedt/linux-trace

    Pull ftrace bugfix from Steven Rostedt:
    "Takao Indoh reported that he was able to cause a ftrace bug while
    loading a module and enabling function tracing at the same time.

    He uncovered a race where the module when loaded will convert the
    calls to mcount into nops, and expects the module's text to be RW.
    But when function tracing is enabled, it will convert all kernel text
    (core and module) from RO to RW to convert the nops to calls to ftrace
    to record the function. After the convertion, it will convert all the
    text back from RW to RO.

    The issue is, it will also convert the module's text that is loading.
    If it converts it to RO before ftrace does its conversion, it will
    cause ftrace to fail and require a reboot to fix it again.

    This patch moves the ftrace module update that converts calls to
    mcount into nops to be done when the module state is still
    MODULE_STATE_UNFORMED. This will ignore the module when the text is
    being converted from RW back to RO"

    * tag 'trace-fixes-v3.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
    ftrace/module: Hardcode ftrace_module_init() call into load_module()

    Linus Torvalds
     
  • Pull devicetree bug fixes from Grant Likely:
    "These are some important bug fixes that need to get into v3.15.

    This branch contains a pair of important bug fixes for the DT code:

    - Fix some incorrect binding property names before they enter common
    usage

    - Fix bug where some platform devices will be unable to get their
    interrupt number when they depend on an interrupt controller that
    is not available at device creation time. This is a problem
    causing mainline to fail on a number of ARM platforms"

    * tag 'dt-for-linus' of git://git.secretlab.ca/git/linux:
    of/irq: do irq resolution in platform_get_irq
    of: selftest: add deferred probe interrupt test
    dt: Fix binding typos in clock-names and interrupt-names

    Linus Torvalds
     

28 Apr, 2014

6 commits

  • Support RENAME_EXCHANGE and RENAME_NOREPLACE flags on the userspace ABI.

    Signed-off-by: Miklos Szeredi

    Miklos Szeredi
     
  • A race exists between module loading and enabling of function tracer.

    CPU 1 CPU 2
    ----- -----
    load_module()
    module->state = MODULE_STATE_COMING

    register_ftrace_function()
    mutex_lock(&ftrace_lock);
    ftrace_startup()
    update_ftrace_function();
    ftrace_arch_code_modify_prepare()
    set_all_module_text_rw();

    ftrace_arch_code_modify_post_process()
    set_all_module_text_ro();

    [ here all module text is set to RO,
    including the module that is
    loading!! ]

    blocking_notifier_call_chain(MODULE_STATE_COMING);
    ftrace_init_module()

    [ tries to modify code, but it's RO, and fails!
    ftrace_bug() is called]

    When this race happens, ftrace_bug() will produces a nasty warning and
    all of the function tracing features will be disabled until reboot.

    The simple solution is to treate module load the same way the core
    kernel is treated at boot. To hardcode the ftrace function modification
    of converting calls to mcount into nops. This is done in init/main.c
    there's no reason it could not be done in load_module(). This gives
    a better control of the changes and doesn't tie the state of the
    module to its notifiers as much. Ftrace is special, it needs to be
    treated as such.

    The reason this would work, is that the ftrace_module_init() would be
    called while the module is in MODULE_STATE_UNFORMED, which is ignored
    by the set_all_module_text_ro() call.

    Link: http://lkml.kernel.org/r/1395637826-3312-1-git-send-email-indou.takao@jp.fujitsu.com

    Reported-by: Takao Indoh
    Acked-by: Rusty Russell
    Cc: stable@vger.kernel.org # 2.6.38+
    Signed-off-by: Steven Rostedt

    Steven Rostedt (Red Hat)
     
  • The patch extends fuse_setattr_in, and extends the flush procedure
    (fuse_flush_times()) called on ->write_inode() to send the ctime as well as
    mtime.

    Signed-off-by: Maxim Patlasov
    Signed-off-by: Miklos Szeredi

    Maxim Patlasov
     
  • Allow userspace fs to specify time granularity.

    This is needed because with writeback_cache mode the kernel is responsible
    for generating mtime and ctime, but if the underlying filesystem doesn't
    support nanosecond granularity then the cache will contain a different
    value from the one stored on the filesystem resulting in a change of times
    after a cache flush.

    Make the default granularity 1s.

    Signed-off-by: Miklos Szeredi

    Miklos Szeredi
     
  • On x86 the allocation of irq descriptors may allocate interrupts which
    are in the range of the GSI interrupts. That's wrong as those
    interrupts are hardwired and we don't have the irq domain translation
    like PPC. So one of these interrupts can be hooked up later to one of
    the devices which are hard wired to it and the io_apic init code for
    that particular interrupt line happily reuses that descriptor with a
    completely different configuration so hell breaks lose.

    Inside x86 we allocate dynamic interrupts from above nr_gsi_irqs,
    except for a few usage sites which have not yet blown up in our face
    for whatever reason. But for drivers which need an irq range, like the
    GPIO drivers, we have no limit in place and we don't want to expose
    such a detail to a driver.

    To cure this introduce a function which an architecture can implement
    to impose a lower bound on the dynamic interrupt allocations.

    Implement it for x86 and set the lower bound to nr_gsi_irqs, which is
    the end of the hardwired interrupt space, so all dynamic allocations
    happen above.

    That not only allows the GPIO driver to work sanely, it also protects
    the bogus callsites of create_irq_nr() in hpet, uv, irq_remapping and
    htirq code. They need to be cleaned up as well, but that's a separate
    issue.

    Reported-by: Jin Yao
    Signed-off-by: Thomas Gleixner
    Tested-by: Mika Westerberg
    Cc: Mathias Nyman
    Cc: Linus Torvalds
    Cc: Grant Likely
    Cc: H. Peter Anvin
    Cc: Rafael J. Wysocki
    Cc: Andy Shevchenko
    Cc: Krogerus Heikki
    Cc: Linus Walleij
    Link: http://lkml.kernel.org/r/alpine.DEB.2.02.1404241617360.28206@ionos.tec.linutronix.de
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     
  • Fix new kernel-doc warnings in :

    Warning(include/linux/interrupt.h:219): No description found for parameter 'cpumask'
    Warning(include/linux/interrupt.h:219): Excess function parameter 'mask' description in 'irq_set_affinity'
    Warning(include/linux/interrupt.h:236): No description found for parameter 'cpumask'
    Warning(include/linux/interrupt.h:236): Excess function parameter 'mask' description in 'irq_force_affinity'

    Signed-off-by: Randy Dunlap
    Link: http://lkml.kernel.org/r/535DD2FD.7030804@infradead.org
    Signed-off-by: Thomas Gleixner

    Randy Dunlap