1. 14 Jan, 2012 11 commits
    • Linus Torvalds's avatar
      Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus · 4964e066
      Linus Torvalds authored
      * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (119 commits)
        MIPS: Delete unused function add_temporary_entry.
        MIPS: Set default pci cache line size.
        MIPS: Flush huge TLB
        MIPS: Octeon: Remove SYS_SUPPORTS_HIGHMEM.
        MIPS: Octeon: Add support for OCTEON II PCIe
        MIPS: Octeon: Update PCI Latency timer and enable more error reporting.
        MIPS: Alchemy: Update cpu-feature-overrides
        MIPS: Alchemy: db1200: Improve PB1200 detection.
        MIPS: Alchemy: merge Au1000 and Au1300-style IRQ controller code.
        MIPS: Alchemy: chain IRQ controllers to MIPS IRQ controller
        MIPS: Alchemy: irq: register pm at irq init time
        MIPS: Alchemy: Touchscreen support on DB1100
        MIPS: Alchemy: Hook up IrDA on DB1000/DB1100
        net/irda: convert au1k_ir to platform driver.
        MIPS: Alchemy: remove unused board headers
        MTD: nand: make au1550nd.c a platform_driver
        MIPS: Netlogic: Mark Netlogic chips as SMT capable
        MIPS: Netlogic: Add support for XLP 3XX cores
        MIPS: Netlogic: Merge some of XLR/XLP wakup code
        MIPS: Netlogic: Add default XLP config.
        ...
      
      Fix up trivial conflicts in arch/mips/kernel/{perf_event_mipsxx.c,
      traps.c} and drivers/tty/serial/Makefile
      4964e066
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://github.com/rustyrussell/linux · 0a80939b
      Linus Torvalds authored
      Autogenerated GPG tag for Rusty D1ADB8F1: 15EE 8D6C AB0E 7F0C F999  BFCB D920 0E6C D1AD B8F1
      
      * tag 'for-linus' of git://github.com/rustyrussell/linux:
        module_param: check that bool parameters really are bool.
        intelfbdrv.c: bailearly is an int module_param
        paride/pcd: fix bool verbose module parameter.
        module_param: make bool parameters really bool (drivers & misc)
        module_param: make bool parameters really bool (arch)
        module_param: make bool parameters really bool (core code)
        kernel/async: remove redundant declaration.
        printk: fix unnecessary module_param_name.
        lirc_parallel: fix module parameter description.
        module_param: avoid bool abuse, add bint for special cases.
        module_param: check type correctness for module_param_array
        modpost: use linker section to generate table.
        modpost: use a table rather than a giant if/else statement.
        modules: sysfs - export: taint, coresize, initsize
        kernel/params: replace DEBUGP with pr_debug
        module: replace DEBUGP with pr_debug
        module: struct module_ref should contains long fields
        module: Fix performance regression on modules with large symbol tables
        module: Add comments describing how the "strmap" logic works
      
      Fix up conflicts in scripts/mod/file2alias.c due to the new linker-
      generated table approach to adding __mod_*_device_table entries.  The
      ARM sa11x0 mcp bus needed to be converted to that too.
      0a80939b
    • Linus Torvalds's avatar
      Merge branch 'for-3.3' of git://linux-nfs.org/~bfields/linux · 0b48d422
      Linus Torvalds authored
      * 'for-3.3' of git://linux-nfs.org/~bfields/linux: (31 commits)
        nfsd4: nfsd4_create_clid_dir return value is unused
        NFSD: Change name of extended attribute containing junction
        svcrpc: don't revert to SVC_POOL_DEFAULT on nfsd shutdown
        svcrpc: fix double-free on shutdown of nfsd after changing pool mode
        nfsd4: be forgiving in the absence of the recovery directory
        nfsd4: fix spurious 4.1 post-reboot failures
        NFSD: forget_delegations should use list_for_each_entry_safe
        NFSD: Only reinitilize the recall_lru list under the recall lock
        nfsd4: initialize special stateid's at compile time
        NFSd: use network-namespace-aware cache registering routines
        SUNRPC: create svc_xprt in proper network namespace
        svcrpc: update outdated BKL comment
        nfsd41: allow non-reclaim open-by-fh's in 4.1
        svcrpc: avoid memory-corruption on pool shutdown
        svcrpc: destroy server sockets all at once
        svcrpc: make svc_delete_xprt static
        nfsd: Fix oops when parsing a 0 length export
        nfsd4: Use kmemdup rather than duplicating its implementation
        nfsd4: add a separate (lockowner, inode) lookup
        nfsd4: fix CONFIG_NFSD_FAULT_INJECTION compile error
        ...
      0b48d422
    • Linus Torvalds's avatar
      Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc · 8e63dd6e
      Linus Torvalds authored
      * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
        powerpc: Fix unpaired __trace_hcall_entry and __trace_hcall_exit
        powerpc: Fix RCU idle and hcall tracing
      8e63dd6e
    • Linus Torvalds's avatar
      Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging · f88609a0
      Linus Torvalds authored
      * 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
        MAINTAINERS: List i2c-omap and i2c-davinci drivers
        MAINTAINERS: i2c: Add third maintainer
        i2c/gpio-i2cmux: Convert to use module_platform_driver()
        i2c/busses: Use module_platform_driver()
        i2c-dev: Use memdup_user
        i2c: Convert to DEFINE_PCI_DEVICE_TABLE
        i2c-ali1535: enable SPARC support
        i2c: Fix error value returned by several bus drivers
      f88609a0
    • Linus Torvalds's avatar
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · 2145199c
      Linus Torvalds authored
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
        dma-buf: Documentation update for Kconfig select
        nouveau: Support Optimus models for vga_switcheroo
        nouveau: properly check for _DSM function support
        dma-buf: drop option text so users don't select it.
        radeon: Call pci_clear_master() instead of open-coding it.
        gma500: Discard modes that don't fit in stolen memory
        drm: bump DRM_CONNECTOR_MAX_ENCODER from 2 to 3
        drm/radeon/kms: Fix module parameter description format
        drm/radeon/kms/ni: fix packet2 handling for VM IB parser
        ttm/dma: Remove the WARN() which is not useful.
      2145199c
    • Linus Torvalds's avatar
      Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6 · 21ebd6c6
      Linus Torvalds authored
      * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (59 commits)
        rtc: max8925: Add function to work as wakeup source
        mfd: Add pm ops to max8925
        mfd: Convert aat2870 to dev_pm_ops
        mfd: Still check other interrupts if we get a wm831x touchscreen IRQ
        mfd: Introduce missing kfree in 88pm860x probe routine
        mfd: Add S5M series configuration
        mfd: Add s5m series irq driver
        mfd: Add S5M core driver
        mfd: Improve mc13xxx dt binding document
        mfd: Fix stmpe section mismatch
        mfd: Fix stmpe build warning
        mfd: Fix STMPE I2c build failure
        mfd: Constify aat2870-core i2c_device_id table
        gpio: Add support for stmpe variant 801
        mfd: Add support for stmpe variant 801
        mfd: Add support for stmpe variant 610
        mfd: Add support for STMPE SPI interface
        mfd: Separate out STMPE controller and interface specific code
        misc: Remove max8997-muic sysfs attributes
        mfd: Remove unused wm831x_irq_data_to_mask_reg()
        ...
      
      Fix up trivial conflict in drivers/leds/Kconfig due to addition of
      LEDS_MAX8997 and LEDS_TCA6507 next to each other.
      21ebd6c6
    • Linus Torvalds's avatar
      Merge tag 'mmc-merge-for-3.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc · 4b8be38c
      Linus Torvalds authored
      MMC highlights for 3.3:
      
      Core:
       * Support for the HS200 high-speed eMMC mode.
       * Support SDIO 3.0 Ultra High Speed cards.
       * Kill pending block requests immediately if card is removed.
       * Enable the eMMC feature for locking boot partitions read-only
         until next power on, exposed via sysfs.
      
      Drivers:
       * Runtime PM support for Intel Medfield SDIO.
       * Suspend/resume support for sdhci-spear.
       * sh-mmcif now processes requests asynchronously.
      
      * tag 'mmc-merge-for-3.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc: (58 commits)
        mmc: fix a deadlock between system suspend and MMC block IO
        mmc: sdhci: restore the enabled dma when do reset all
        mmc: dw_mmc: miscaculated the fifo-depth with wrong bit operation
        mmc: host: Adds support for eMMC 4.5 HS200 mode
        mmc: core: HS200 mode support for eMMC 4.5
        mmc: dw_mmc: fixed wrong bit operation for SDMMC_GET_FCNT()
        mmc: core: Separate the timeout value for cache-ctrl
        mmc: sdhci-spear: Fix compilation error
        mmc: sdhci: Deal with failure case in sdhci_suspend_host
        mmc: dw_mmc: Clear the DDR mode for non-DDR
        mmc: sd: Fix SDR12 timing regression
        mmc: sdhci: Fix tuning timer incorrect setting when suspending host
        mmc: core: Add option to prevent eMMC sleep command
        mmc: omap_hsmmc: use threaded irq handler for card-detect.
        mmc: sdhci-pci: enable runtime PM for Medfield SDIO
        mmc: sdhci: Always pass clock request value zero to set_clock host op
        mmc: sdhci-pci: remove SDHCI_QUIRK2_OWN_CARD_DETECTION
        mmc: sdhci-pci: get gpio numbers from platform data
        mmc: sdhci-pci: add platform data
        mmc: sdhci: prevent card detection activity for non-removable cards
        ...
      4b8be38c
    • Linus Torvalds's avatar
    • Gleb Natapov's avatar
      Unused iocbs in a batch should not be accounted as active. · 69e4747e
      Gleb Natapov authored
      Since commit 080d676d ("aio: allocate kiocbs in batches") iocbs are
      allocated in a batch during processing of first iocbs.  All iocbs in a
      batch are automatically added to ctx->active_reqs list and accounted in
      ctx->reqs_active.
      
      If one (not the last one) of iocbs submitted by an user fails, further
      iocbs are not processed, but they are still present in ctx->active_reqs
      and accounted in ctx->reqs_active.  This causes process to stuck in a D
      state in wait_for_all_aios() on exit since ctx->reqs_active will never
      go down to zero.  Furthermore since kiocb_batch_free() frees iocb
      without removing it from active_reqs list the list become corrupted
      which may cause oops.
      
      Fix this by removing iocb from ctx->active_reqs and updating
      ctx->reqs_active in kiocb_batch_free().
      Signed-off-by: default avatarGleb Natapov <gleb@redhat.com>
      Reviewed-by: default avatarJeff Moyer <jmoyer@redhat.com>
      Cc: stable@kernel.org   # 3.2
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      69e4747e
    • Srivatsa S. Bhat's avatar
      x86/mce: Fix CPU hotplug and suspend regression related to MCE · a3301b75
      Srivatsa S. Bhat authored
      Commit 8a25a2fd ("cpu: convert 'cpu' and 'machinecheck' sysdev_class
      to a regular subsystem") changed how things are dealt with in the MCE
      subsystem.  Some of the things that got broken due to this are CPU
      hotplug and suspend/hibernate.
      
      MCE uses per_cpu allocations of struct device.  So, when a CPU goes
      offline and comes back online, in order to ensure that we start from a
      clean slate with respect to the MCE subsystem, zero out the entire
      per_cpu device structure to 0 before using it.
      Signed-off-by: default avatarSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a3301b75
  2. 13 Jan, 2012 29 commits
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-next · 96e80a78
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-next:
        Squashfs: fix i_blocks calculation with extended regular files
        Squashfs: fix mount time sanity check for corrupted superblock
        Squashfs: optimise squashfs_cache_get entry search
        Squashfs: Update documentation to include xattrs
        Squashfs: add missing block release on error condition
      96e80a78
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-3.0-nmw · 57e6a7dd
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-3.0-nmw:
        GFS2: Fix nlink setting on inode creation
        GFS2: fail mount if journal recovery fails
        GFS2: let spectator mount do read only recovery
        GFS2: Fix a use-after-free that coverity spotted
        GFS2: dlm based recovery coordination
      57e6a7dd
    • Linus Torvalds's avatar
      Merge branch 'linux-next' of git://git.infradead.org/ubifs-2.6 · 94b1984a
      Linus Torvalds authored
      * 'linux-next' of git://git.infradead.org/ubifs-2.6:
        UBIFS: fix key printing
        UBIFS: use snprintf instead of sprintf when printing keys
        UBIFS: fix debugging messages
        UBIFS: make debugging messages light again
        UBI: fix debugging messages
        UBI: make vid_hdr non-static
      94b1984a
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client · 1a52bb0b
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
        ceph: ensure prealloc_blob is in place when removing xattr
        rbd: initialize snap_rwsem in rbd_add()
        ceph: enable/disable dentry complete flags via mount option
        vfs: export symbol d_find_any_alias()
        ceph: always initialize the dentry in open_root_dentry()
        libceph: remove useless return value for osd_client __send_request()
        ceph: avoid iput() while holding spinlock in ceph_dir_fsync
        ceph: avoid useless dget/dput in encode_fh
        ceph: dereference pointer after checking for NULL
        crush: fix force for non-root TAKE
        ceph: remove unnecessary d_fsdata conditional checks
        ceph: Use kmemdup rather than duplicating its implementation
      
      Fix up conflicts in fs/ceph/super.c (d_alloc_root() failure handling vs
      always initialize the dentry in open_root_dentry)
      1a52bb0b
    • Ian Kent's avatar
      autofs4 - fix deal with autofs4_write races · 8638094e
      Ian Kent authored
      I don't know how I missed this obvious mistake when I
      reviewed Als' patches, sorry.
      
      [ Quoting Al:
      
      	Grr...  Note to self: do git status *and* git stash show -p
      	before git push.  Nothing like "WTF? I'd fixed that braino"
      	feeling ;-/
      
        Al sent the same patch - it got broken in commit d668dc56:
        "autofs4: deal with autofs4_write/autofs4_write races". ]
      Reported-and-tested-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarIan Kent <raven@themaw.net>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8638094e
    • Artem Bityutskiy's avatar
      UBIFS: fix key printing · 515315a1
      Artem Bityutskiy authored
      Before commit 56e46742 we have had locking
      around all printing macros and we could use static buffers for creating
      key strings and printing them. However, now we do not have that locking and
      we cannot use static buffers. This commit removes the old DBGKEY() macros
      and introduces few new helper macros for printing debugging messages plus
      a key at the end. Thankfully, all the messages are already structures in
      a way that the key is printed in the end.
      Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      515315a1
    • Artem Bityutskiy's avatar
      UBIFS: use snprintf instead of sprintf when printing keys · beba0060
      Artem Bityutskiy authored
      Switch to 'snprintf()' which is more secure and reliable. This is also a
      preparation to the subsequent key printing fixes.
      Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      beba0060
    • Sumit Semwal's avatar
      dma-buf: Documentation update for Kconfig select · 08179456
      Sumit Semwal authored
      As per Linus' comment, dma-buf Kconfig entry shouldn't have an option
      text, but should be selected by the subsystems that use it.
      
      Add this information in the documentation as well.
      Signed-off-by: default avatarSumit Semwal <sumit.semwal@ti.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      08179456
    • Peter Lekensteyn's avatar
      nouveau: Support Optimus models for vga_switcheroo · d099230c
      Peter Lekensteyn authored
      Newer nVidia cards with Optimus do not support/use the DSM switching functions.
      Instead, it require a DSM function to be called prior to bringing a device into
      D3 state. No other _DSM calls are necessary before/after enabling/disabling a
      device. Switching between discrete and integrated GPU is not supported by
      this Optimus _DSM call, therefore return on the switching method.
      Signed-off-by: default avatarPeter Lekensteyn <lekensteyn@gmail.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      d099230c
    • Peter Lekensteyn's avatar
      nouveau: properly check for _DSM function support · 9075e85f
      Peter Lekensteyn authored
      According to the ACPI spec version 4, section 9.14.1, _DSM functions
      must return a value with the first bit enabled if any DSM functions are
      supported for the given UUID and revision ID. For a given function index n
      to be marked supported, bit n must be enabled.
      Signed-off-by: default avatarPeter Lekensteyn <lekensteyn@gmail.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      9075e85f
    • Dave Airlie's avatar
      dma-buf: drop option text so users don't select it. · 3b32a592
      Dave Airlie authored
      This is going to be used by other subsystems so they should select it.
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      3b32a592
    • Michel Dänzer's avatar
    • Alan Cox's avatar
      gma500: Discard modes that don't fit in stolen memory · 9f821c67
      Alan Cox authored
      [This fixes a crash on boot if the system is plugged into an HDTV so it's
       probably appropriate to push even though it didn't make the window. We could
       be cleverer about this but the simple version seems to be the safe one]
      
      From: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
      
      At the moment we cannot allocate more than stolen memory size for framebuffers.
      To get around that issues we discard modes that doesn't fit. This is a temporary
      solution until we can freely allocate framebuffer memory.
      
      [Currently the framebuffer needs to be linear in kernel space due to limits
       in the kernel fb layer - AC]
      Signed-off-by: default avatarPatrik Jakobsson <patrik.r.jakobsson@gmail.com>
      Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      9f821c67
    • Ben Skeggs's avatar
      drm: bump DRM_CONNECTOR_MAX_ENCODER from 2 to 3 · afe887df
      Ben Skeggs authored
      There exists at least one NVIDIA GPU (Quadro NVS 300) that has a DMS-59
      connector which is capable of supporting DisplayPort, TMDS and VGA on
      a single connector.
      
      We need to bump the allowed encoder limit to support all three configs.
      Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      afe887df
    • Jean Delvare's avatar
      drm/radeon/kms: Fix module parameter description format · 27d4d052
      Jean Delvare authored
      Module parameter descriptions don't take a trailing \n, otherwise it
      breaks formatting of modinfo's output. Also add missing space after
      comma.
      Signed-off-by: default avatarJean Delvare <jdelvare@suse.de>
      Cc: David Airlie <airlied@linux.ie>
      Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: Jerome Glisse <jglisse@redhat.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      27d4d052
    • Alex Deucher's avatar
      drm/radeon/kms/ni: fix packet2 handling for VM IB parser · 0b41da60
      Alex Deucher authored
      Packet2 is only one dword.
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: default avatarJerome Glisse <jglisse@redhat.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      0b41da60
    • Konrad Rzeszutek Wilk's avatar
      ttm/dma: Remove the WARN() which is not useful. · 0e113315
      Konrad Rzeszutek Wilk authored
      . It was useful during development, but now on a production system
      we can get this (if the user forgot to upload the firmware):
      
      [drm] radeon: irq initialized.
      [drm] GART: num cpu pages 131072, num gpu pages 131072
      [drm] radeon: ib pool ready.
      [drm] Loading SUMO Microcode
      r600_cp: Failed to load firmware "radeon/SUMO_pfp.bin"
      atl1c 0000:03:00.0: version 1.0.1.0-NAPI.213057] [drm:evergreen_startup] *ERROR* Failed to load firmware!
      radeon 0000:00:01.0: disabling GPU acceleration
      88] radeon 0000:00:01.0: ffff8801bb782400 unpin not necessary
      ------------[ cut here ]------------
      WARNING: at /home/konrad/linux-linus/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c:956 ttm_dma_unpopulate+0x79/0x300 [ttm]()
      Hardware name: System Product Name
      Modules linked in: e1000e atl1c radeon(+) ahci libahci libata scsi_mod fbcon tileblit font ttm bitblit softcursor drm_kms_helper wmi xen_blkfront xen_netfront fb_sys_fops sysimgblt sysfillrect syscopyarea xenfs xen_privcmd
      Pid: 1600, comm: modprobe Not tainted 3.2.0-06100-ge343a895 #1
      Call Trace:
       [<ffffffff8108973a>] warn_slowpath_common+0x7a/0xb0
       [<ffffffff81089785>] warn_slowpath_null+0x15/0x20
       [<ffffffffa0060309>] ttm_dma_unpopulate+0x79/0x300 [ttm]
       [<ffffffffa01341c0>] radeon_ttm_tt_unpopulate+0x120/0x130 [radeon]
       [<ffffffffa0056e0c>] ttm_tt_destroy+0x2c/0x70 [ttm]
       [<ffffffffa0057a4e>] ttm_bo_cleanup_memtype_use+0x3e/0x80 [ttm]
       [<ffffffffa00595a1>] ttm_bo_release+0x251/0x280 [ttm]
       [<ffffffffa0059610>] ttm_bo_unref+0x40/0x60 [ttm]
       [<ffffffffa0134d02>] radeon_bo_unref+0x42/0x80 [radeon]
       [<ffffffffa0186dfb>] radeon_sa_bo_manager_fini+0x6b/0x80 [radeon]
       [<ffffffffa0146b8f>] radeon_ib_pool_fini+0x6f/0x90 [radeon]
       [<ffffffffa014be49>] r100_ib_fini+0x19/0x20 [radeon]
       [<ffffffffa017b47e>] evergreen_init+0x1ee/0x2d0 [radeon]
      
      The big WARN() has nothing to do with the culprit - which is that
      the firmware was not loaded. So lets remove the WARN() from the TTM DMA code.
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Reviewed-by: default avatarJerome Glisse <jglisse@redhat.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      0e113315
    • Linus Torvalds's avatar
      Merge branch 'akpm' (aka "Andrew's patch-bomb, take two") · 09946950
      Linus Torvalds authored
      Andrew explains:
      
       - various misc stuff
      
       - Most of the rest of MM: memcg, threaded hugepages, others.
      
       - cpumask
      
       - kexec
      
       - kdump
      
       - some direct-io performance tweaking
      
       - radix-tree optimisations
      
       - new selftests code
      
         A note on this: often people will develop a new userspace-visible
         feature and will develop userspace code to exercise/test that
         feature.  Then they merge the patch and the selftest code dies.
         Sometimes we paste it into the changelog.  Sometimes the code gets
         thrown into Documentation/(!).
      
         This saddens me.  So this patch creates a bare-bones framework which
         will henceforth allow me to ask people to include their test apps in
         the kernel tree so we can keep them alive.  Then when people enhance
         or fix the feature, I can ask them to update the test app too.
      
         The infrastruture is terribly trivial at present - let's see how it
         evolves.
      
       - checkpoint/restart feature work.
      
         A note on this: this is a project by various mad Russians to perform
         c/r mainly from userspace, with various oddball helper code added
         into the kernel where the need is demonstrated.
      
         So rather than some large central lump of code, what we have is
         little bits and pieces popping up in various places which either
         expose something new or which permit something which is normally
         kernel-private to be modified.
      
         The overall project is an ongoing thing.  I've judged that the size
         and scope of the thing means that we're more likely to be successful
         with it if we integrate the support into mainline piecemeal rather
         than allowing it all to develop out-of-tree.
      
         However I'm less confident than the developers that it will all
         eventually work! So what I'm asking them to do is to wrap each piece
         of new code inside CONFIG_CHECKPOINT_RESTORE.  So if it all
         eventually comes to tears and the project as a whole fails, it should
         be a simple matter to go through and delete all trace of it.
      
      This lot pretty much wraps up the -rc1 merge for me.
      
      * akpm: (96 commits)
        unlzo: fix input buffer free
        ramoops: update parameters only after successful init
        ramoops: fix use of rounddown_pow_of_two()
        c/r: prctl: add PR_SET_MM codes to set up mm_struct entries
        c/r: procfs: add start_data, end_data, start_brk members to /proc/$pid/stat v4
        c/r: introduce CHECKPOINT_RESTORE symbol
        selftests: new x86 breakpoints selftest
        selftests: new very basic kernel selftests directory
        radix_tree: take radix_tree_path off stack
        radix_tree: remove radix_tree_indirect_to_ptr()
        dio: optimize cache misses in the submission path
        vfs: cache request_queue in struct block_device
        fs/direct-io.c: calculate fs_count correctly in get_more_blocks()
        drivers/parport/parport_pc.c: fix warnings
        panic: don't print redundant backtraces on oops
        sysctl: add the kernel.ns_last_pid control
        kdump: add udev events for memory online/offline
        include/linux/crash_dump.h needs elf.h
        kdump: fix crash_kexec()/smp_send_stop() race in panic()
        kdump: crashk_res init check for /sys/kernel/kexec_crash_size
        ...
      09946950
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 7c17d86a
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (69 commits)
        pptp: Accept packet with seq zero
        RDS: Remove some unused iWARP code
        net: fsl: fec: handle 10Mbps speed in RMII mode
        drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c: add missing iounmap
        drivers/net/ethernet/tundra/tsi108_eth.c: add missing iounmap
        ksz884x: fix mtu for VLAN
        net_sched: sfq: add optional RED on top of SFQ
        dp83640: Fix NOHZ local_softirq_pending 08 warning
        gianfar: Fix invalid TX frames returned on error queue when time stamping
        gianfar: Fix missing sock reference when processing TX time stamps
        phylib: introduce mdiobus_alloc_size()
        net: decrement memcg jump label when limit, not usage, is changed
        net: reintroduce missing rcu_assign_pointer() calls
        inet_diag: Rename inet_diag_req_compat into inet_diag_req
        inet_diag: Rename inet_diag_req into inet_diag_req_v2
        bond_alb: don't disable softirq under bond_alb_xmit
        mac80211: fix rx->key NULL pointer dereference in promiscuous mode
        nl80211: fix old station flags compatibility
        mdio-octeon: use an unique MDIO bus name.
        mdio-gpio: use an unique MDIO bus name.
        ...
      7c17d86a
    • Sascha Hauer's avatar
      unlzo: fix input buffer free · 35f15268
      Sascha Hauer authored
      unlzo modifies the pointer to in_buf, so we have to free the original
      buffer, not the modified pointer.
      Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
      Cc: Lasse Collin <lasse.collin@tukaani.org>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      35f15268
    • Kees Cook's avatar
      ramoops: update parameters only after successful init · c755201e
      Kees Cook authored
      If a platform device exists on the system, but ramoops fails to attach to
      it, the module parameters are overridden before ramoops can fall back and
      try to use passed module parameters.  Move update to end of init routine.
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Cc: Marco Stornelli <marco.stornelli@gmail.com>
      Cc: Sergiu Iordache <sergiu@chromium.org>
      Cc: Seiji Aguchi <seiji.aguchi@hds.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c755201e
    • Marco Stornelli's avatar
      ramoops: fix use of rounddown_pow_of_two() · fdb59507
      Marco Stornelli authored
      The return value of rounddown_pow_of_two wasn't evaluated, so the
      operation was a no-op.
      Signed-off-by: default avatarMarco Stornelli <marco.stornelli@gmail.com>
      Reported-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Reviewed-by: default avatarWANG Cong <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fdb59507
    • Cyrill Gorcunov's avatar
      c/r: prctl: add PR_SET_MM codes to set up mm_struct entries · 028ee4be
      Cyrill Gorcunov authored
      When we restore a task we need to set up text, data and data heap sizes
      from userspace to the values a task had at checkpoint time.  This patch
      adds auxilary prctl codes for that.
      
      While most of them have a statistical nature (their values are involved
      into calculation of /proc/<pid>/statm output) the start_brk and brk values
      are used to compute an allowed size of program data segment expansion.
      Which means an arbitrary changes of this values might be dangerous
      operation.  So to restrict access the following requirements applied to
      prctl calls:
      
       - The process has to have CAP_SYS_ADMIN capability granted.
       - For all opcodes except start_brk/brk members an appropriate
         VMA area must exist and should fit certain VMA flags,
         such as:
         - code segment must be executable but not writable;
         - data segment must not be executable.
      
      start_brk/brk values must not intersect with data segment and must not
      exceed RLIMIT_DATA resource limit.
      
      Still the main guard is CAP_SYS_ADMIN capability check.
      
      Note the kernel should be compiled with CONFIG_CHECKPOINT_RESTORE support
      otherwise these prctl calls will return -EINVAL.
      
      [akpm@linux-foundation.org: cache current->mm in a local, saving 200 bytes text]
      Signed-off-by: default avatarCyrill Gorcunov <gorcunov@openvz.org>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Andrew Vagin <avagin@openvz.org>
      Cc: Serge Hallyn <serge.hallyn@canonical.com>
      Cc: Pavel Emelyanov <xemul@parallels.com>
      Cc: Vasiliy Kulikov <segoon@openwall.com>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: Michael Kerrisk <mtk.manpages@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      028ee4be
    • Cyrill Gorcunov's avatar
      c/r: procfs: add start_data, end_data, start_brk members to /proc/$pid/stat v4 · b3f7f573
      Cyrill Gorcunov authored
      The mm->start_code/end_code, mm->start_data/end_data, mm->start_brk are
      involved into calculation of program text/data segment sizes (which might
      be seen in /proc/<pid>/statm) and into brk() call final address.
      
      For restore we need to know all these values.  While
      mm->start_code/end_code already present in /proc/$pid/stat, the rest
      members are not, so this patch brings them in.
      
      The restore procedure of these members is addressed in another patch using
      prctl().
      Signed-off-by: default avatarCyrill Gorcunov <gorcunov@openvz.org>
      Acked-by: default avatarSerge Hallyn <serge.hallyn@canonical.com>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Reviewed-by: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Andrew Vagin <avagin@openvz.org>
      Cc: Vasiliy Kulikov <segoon@openwall.com>
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b3f7f573
    • Cyrill Gorcunov's avatar
      c/r: introduce CHECKPOINT_RESTORE symbol · 067bce1a
      Cyrill Gorcunov authored
      For checkpoint/restore we need auxilary features being compiled into the
      kernel, such as additional prctl codes, /proc/<pid>/map_files and etc...
      but same time these features are not mandatory for a regular kernel so
      CHECKPOINT_RESTORE config symbol should bring a way to disable them all at
      once if one wish to get rid of additional functionality.
      Signed-off-by: default avatarCyrill Gorcunov <gorcunov@openvz.org>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Andrew Vagin <avagin@openvz.org>
      Cc: Serge Hallyn <serge.hallyn@canonical.com>
      Cc: Vasiliy Kulikov <segoon@openwall.com>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      067bce1a
    • Frederic Weisbecker's avatar
      selftests: new x86 breakpoints selftest · 85bbddc3
      Frederic Weisbecker authored
      Bring a first selftest in the relevant directory.  This tests several
      combinations of breakpoints and watchpoints in x86, as well as icebp traps
      and int3 traps.  Given the amount of breakpoint regressions we raised
      after we merged the generic breakpoint infrastructure, such selftest
      became necessary and can still serve today as a basis for new patches that
      touch the do_debug() path.
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Jason Wessel <jason.wessel@windriver.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Michal Marek <mmarek@suse.cz>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      85bbddc3
    • Frederic Weisbecker's avatar
      selftests: new very basic kernel selftests directory · 274343ad
      Frederic Weisbecker authored
      Bring a new kernel selftests directory in tools/testing/selftests.  To
      add a new selftest, create a subdirectory with the sources and a
      makefile that creates a target named "run_test" then add the
      subdirectory name to the TARGET var in tools/testing/selftests/Makefile
      and tools/testing/selftests/run_tests script.
      
      This can help centralizing and maintaining any useful selftest that
      developers usually tend to let rust in peace on some random server.
      Suggested-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Jason Wessel <jason.wessel@windriver.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Michal Marek <mmarek@suse.cz>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      274343ad
    • Hugh Dickins's avatar
      radix_tree: take radix_tree_path off stack · e2bdb933
      Hugh Dickins authored
      Down, down in the deepest depths of GFP_NOIO page reclaim, we have
      shrink_page_list() calling __remove_mapping() calling __delete_from_
      swap_cache() or __delete_from_page_cache().
      
      You would not expect those to need much stack, but in fact they call
      radix_tree_delete(): which declares a 192-byte radix_tree_path array on
      its stack (to record the node,offsets it visits when descending, in case
      it needs to ascend to update them).  And if any tag is still set [1],
      that calls radix_tree_tag_clear(), which declares a further such
      192-byte radix_tree_path array on the stack.  (At least we have
      interrupts disabled here, so won't then be pushing registers too.)
      
      That was probably a good choice when most users were 32-bit (array of
      half the size), and adding fields to radix_tree_node would have bloated
      it unnecessarily.  But nowadays many are 64-bit, and each
      radix_tree_node contains a struct rcu_head, which is only used when
      freeing; whereas the radix_tree_path info is only used for updating the
      tree (deleting, clearing tags or setting tags if tagged) when a lock
      must be held, of no interest when accessing the tree locklessly.
      
      So add a parent pointer to the radix_tree_node, in union with the
      rcu_head, and remove all uses of the radix_tree_path.  There would be
      space in that union to save the offset when descending as before (we can
      argue that a lock must already be held to exclude other users), but
      recalculating it when ascending is both easy (a constant shift and a
      constant mask) and uncommon, so it seems better just to do that.
      
      Two little optimizations: no need to decrement height when descending,
      adjusting shift is enough; and once radix_tree_tag_if_tagged() has set
      tag on a node and its ancestors, it need not ascend from that node
      again.
      
      perf on the radix tree test harness reports radix_tree_insert() as 2%
      slower (now having to set parent), but radix_tree_delete() 24% faster.
      Surely that's an exaggeration from rtth's artificially low map shift 3,
      but forcing it back to 6 still rates radix_tree_delete() 8% faster.
      
      [1] Can a pagecache tag (dirty, writeback or towrite) actually still be
      set at the time of radix_tree_delete()? Perhaps not if the filesystem is
      well-behaved.  But although I've not tracked any stack overflow down to
      this cause, I have observed a curious case in which a dirty tag is set
      and left set on tmpfs: page migration's migrate_page_copy() happens to
      use __set_page_dirty_nobuffers() to set PageDirty on the newpage, and
      that sets PAGECACHE_TAG_DIRTY as a side-effect - harmless to a
      filesystem which doesn't use tags, except for this stack depth issue.
      Signed-off-by: default avatarHugh Dickins <hughd@google.com>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Dave Chinner <david@fromorbit.com>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Nai Xia <nai.xia@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e2bdb933
    • Xiao Guangrong's avatar
      928da837