06 May, 2012

4 commits

  • Instead of clearing I_DIRTY_PAGES and resetting it when we didn't succeed in
    writing them all, just clear the bit only when we succeeded writing all the
    pages. We also move the clearing of the bit close to other i_state handling to
    separate it from writeback list handling. This is desirable because list
    handling will differ for flusher thread and other writeback_single_inode()
    callers in future. No filesystem plays any tricks with I_DIRTY_PAGES (like
    checking it in ->writepages or ->write_inode implementation) so this movement
    is safe.

    Signed-off-by: Jan Kara
    Signed-off-by: Fengguang Wu

    Jan Kara
     
  • When writeback_single_inode() is called on inode which has I_SYNC already
    set while doing WB_SYNC_NONE, inode is moved to b_more_io list. However
    this makes sense only if the caller is flusher thread. For other callers of
    writeback_single_inode() it doesn't really make sense and may be even wrong
    - flusher thread may be doing WB_SYNC_ALL writeback in parallel.

    So we move requeueing from writeback_single_inode() to writeback_sb_inodes().

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Jan Kara
    Signed-off-by: Fengguang Wu

    Jan Kara
     
  • Move clearing of I_SYNC into inode_sync_complete(). It is more logical to have
    clearing of I_SYNC bit and waking of waiters in one place. Also later we will
    have two places needing to clear I_SYNC and wake up waiters so this allows them
    to use the common helper. Moving of I_SYNC clearing to a later stage of
    writeback_single_inode() is safe since we hold i_lock all the time.

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Jan Kara
    Signed-off-by: Fengguang Wu

    Jan Kara
     
  • This prevents global_dirty_limit from remaining 0 (the initial value)
    for long time, since it's only updated in update_dirty_limit() when
    above the dirty freerun area.

    It will avoid unexpected consequences when some random code use it as a
    convenient approximation of the global dirty threshold.

    Signed-off-by: Fengguang Wu

    Fengguang Wu
     

25 Apr, 2012

1 commit


14 Apr, 2012

16 commits

  • The function global_dirtyable_memory is only referenced in this file and
    should be marked static to prevent it from being exposed globally.

    This quiets the sparse warning:

    warning: symbol 'global_dirtyable_memory' was not declared. Should it be static?

    Signed-off-by: H Hartley Sweeten
    Signed-off-by: Fengguang Wu

    H Hartley Sweeten
     
  • Pull system.h fixups for less common arch's from Paul Gortmaker:
    "Here is what is hopefully the last of the system.h related fixups.

    The fixes for Alpha and ia64 are code relocations consistent with what
    was done for the more mainstream architectures. Note that the
    diffstat lines removed vs lines added are not the same since I've
    fixed some of the whitespace issues in the relocated code blocks.
    However they are functionally the same. Compile tested locally, plus
    these two have been in linux-next for a while.

    There is also a trivial one line system.h related fix for the Tilera
    arch from Chris Metcalf to fix an implict include.."

    * 'systemh-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux:
    irq_work: fix compile failure on tile from missing include
    ia64: populate the cmpxchg header with appropriate code
    alpha: fix build failures from system.h dismemberment

    Linus Torvalds
     
  • Pull fbdev fixes from Florian Tobias Schandinat:
    - a compile fix for au1*fb
    - a fix to make kyrofb usable on x86_64
    - a fix for uvesafb to prevent an oops due to NX-protection

    "The fix for kyrofb is a bit large but it's just replacing "unsigned
    long" by "u32" for 64 bit compatibility."

    * tag 'fbdev-fixes-for-3.4-1' of git://github.com/schandinat/linux-2.6:
    video:uvesafb: Fix oops that uvesafb try to execute NX-protected page
    fbdev: fix au1*fb builds
    kyrofb: fix on x86_64

    Linus Torvalds
     
  • Pull the minimal btrfs branch from Chris Mason:
    "We have a use-after-free in there, along with errors when mount -o
    discard is enabled, and a BUG_ON(we should compile with UP more
    often)."

    * 'for-linus-min' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
    Btrfs: use commit root when loading free space cache
    Btrfs: fix use-after-free in __btrfs_end_transaction
    Btrfs: check return value of bio_alloc() properly
    Btrfs: remove lock assert from get_restripe_target()
    Btrfs: fix eof while discarding extents
    Btrfs: fix uninit variable in repair_eb_io_failure
    Revert "Btrfs: increase the global block reserve estimates"

    Linus Torvalds
     
  • Pull block driver bits from Jens Axboe:

    - A series of fixes for mtip32xx. Most from Asai at Micron, but also
    one from Greg, getting rid of the dependency on PCIE_HOTPLUG.

    - A few bug fixes for xen-blkfront, and blkback.

    - A virtio-blk fix for Vivek, making resize actually work.

    - Two fixes from Stephen, making larger transfers possible on cciss.
    This is needed for tape drive support.

    * 'for-3.4/drivers' of git://git.kernel.dk/linux-block:
    block: mtip32xx: remove HOTPLUG_PCI_PCIE dependancy
    mtip32xx: dump tagmap on failure
    mtip32xx: fix handling of commands in various scenarios
    mtip32xx: Shorten macro names
    mtip32xx: misc changes
    mtip32xx: Add new sysfs entry 'status'
    mtip32xx: make setting comp_time as common
    mtip32xx: Add new bitwise flag 'dd_flag'
    mtip32xx: fix error handling in mtip_init()
    virtio-blk: Call revalidate_disk() upon online disk resize
    xen/blkback: Make optional features be really optional.
    xen/blkback: Squash the discard support for 'file' and 'phy' type.
    mtip32xx: fix incorrect value set for drv_cleanup_done, and re-initialize and start port in mtip_restart_port()
    cciss: Fix scsi tape io with more than 255 scatter gather elements
    cciss: Initialize scsi host max_sectors for tape drive support
    xen-blkfront: make blkif_io_lock spinlock per-device
    xen/blkfront: don't put bdev right after getting it
    xen-blkfront: use bitmap_set() and bitmap_clear()
    xen/blkback: Enable blkback on HVM guests
    xen/blkback: use grant-table.c hypercall wrappers

    Linus Torvalds
     
  • Pull block core bits from Jens Axboe:
    "It's a nice and quiet round this time, since most of the tricky stuff
    has been pushed to 3.5 to give it more time to mature. After a few
    hectic block IO core changes for 3.3 and 3.2, I'm quite happy with a
    slow round.

    Really minor stuff in here, the only real functional change is making
    the auto-unplug threshold a per-queue entity. The threshold is set so
    that it's low enough that we don't hold off IO for too long, but still
    big enough to get a nice benefit from the batched insert (and hence
    queue lock cost reduction). For raid configurations, this currently
    breaks down."

    * 'for-3.4/core' of git://git.kernel.dk/linux-block:
    block: make auto block plug flush threshold per-disk based
    Documentation: Add sysfs ABI change for cfq's target latency.
    block: Make cfq_target_latency tunable through sysfs.
    block: use lockdep_assert_held for queue locking
    block: blk_alloc_queue_node(): use caller's GFP flags instead of GFP_KERNEL

    Linus Torvalds
     
  • The OMAP driver needs a 'depends on ARCH_OMAP2PLUS' since it only
    builds for OMAP2+ platforms.

    This 'depends on' was in the original patch from Russell King, but was
    erroneously removed by me when making this option user-selectable in
    commit b09db45c (cpufreq: OMAP driver depends CPUfreq tables.) This
    patch remedies that.

    Apologies to Russell King for breaking his originally working patch.

    Also, thanks to Grazvydas Ignotas for reporting the same problem.

    Cc: Russell King
    Cc: Grazvydas Ignotas
    Signed-off-by: Kevin Hilman
    Signed-off-by: Linus Torvalds

    Kevin Hilman
     
  • Pull sparc fixes from David Miller.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
    sparc64: Eliminate obsolete __handle_softirq() function
    sparc64: Fix bootup crash on sun4v.

    Linus Torvalds
     
  • Pull hwmon patches from Guenter Roeck:
    "Fix build warnings in four drivers"

    * tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
    hwmon: (pmbus_core) Fix compiler warning
    hwmon: (smsc47m1) Fix compiler warning
    hwmon: (acpi_power_meter) Fix compiler warning seen in some configurations
    hwmon: (smsc47b397) Fix compiler warning

    Linus Torvalds
     
  • Pull GPIO bug fixes from Grant Likely:
    "Miscellaneous bug fixes to GPIO drivers and for a corner case in the
    gpio device tree parsing code."

    * tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux-2.6:
    gpio/exynos: Fix compiler warning in gpio-samsung.c file
    gpio: Fix range check in of_gpio_simple_xlate()
    gpio: Fix uninitialized variable bit in adp5588_irq_handler
    gpio/sodaville: Convert sodaville driver to new irqdomain API

    Linus Torvalds
     
  • Pull SPI bug fixes from Grant Likely:
    "Miscellaneous driver bug fixes. No major changes in this branch."

    * tag 'spi-for-linus' of git://git.secretlab.ca/git/linux-2.6:
    spi/imx: prevent NULL pointer dereference in spi_imx_probe()
    spi/imx: mark base member in spi_imx_data as __iomem
    spi/mpc83xx: fix NULL pdata dereference bug
    spi/davinci: Fix DMA API usage in davinci
    spi/pL022: include types.h to remove compilation warnings

    Linus Torvalds
     
  • The invocation of softirq is now handled by irq_exit(), so there is no
    need for sparc64 to invoke it on the trap-return path. In fact, doing so
    is a bug because if the trap occurred in the idle loop, this invocation
    can result in lockdep-RCU failures. The problem is that RCU ignores idle
    CPUs, and the sparc64 trap-return path to the softirq handlers fails to
    tell RCU that the CPU must be considered non-idle while those handlers
    are executing. This means that RCU is ignoring any RCU read-side critical
    sections in those handlers, which in turn means that RCU-protected data
    can be yanked out from under those read-side critical sections.

    The shiny new lockdep-RCU ability to detect RCU read-side critical sections
    that RCU is ignoring located this problem.

    The fix is straightforward: Make sparc64 stop manually invoking the
    softirq handlers.

    Reported-by: Meelis Roos
    Suggested-by: David Miller
    Signed-off-by: Paul E. McKenney
    Tested-by: Meelis Roos
    Cc: stable@vger.kernel.org
    Signed-off-by: David S. Miller

    Paul E. McKenney
     
  • The DS driver registers as a subsys_initcall() but this can be too
    early, in particular this risks registering before we've had a chance
    to allocate and setup module_kset in kernel/params.c which is
    performed also as a subsyts_initcall().

    Register DS using device_initcall() insteal.

    Signed-off-by: David S. Miller
    Cc: stable@vger.kernel.org

    David S. Miller
     
  • Building with IRQ_WORK configured results in

    kernel/irq_work.c: In function ‘irq_work_run’:
    kernel/irq_work.c:110: error: implicit declaration of function ‘irqs_disabled’

    The appropriate header just needs to be included.

    Signed-off-by: Chris Metcalf
    Signed-off-by: Paul Gortmaker

    Chris Metcalf
     
  • commit 93f378883cecb9dcb2cf5b51d9d24175906659da

    "Fix ia64 build errors (fallout from system.h disintegration)"

    introduced arch/ia64/include/asm/cmpxchg.h as a temporary
    build fix and stated:

    "... leave the migration of xchg() and cmpxchg() to this new
    header file for a future patch."

    Migrate the appropriate chunks from asm/intrinsics.h and fix
    the whitespace issues in the migrated chunk.

    Cc: Fenghua Yu
    Cc: David Howells
    Acked-by: Tony Luck
    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     
  • commit ec2212088c42ff7d1362629ec26dda4f3e8bdad3

    "Disintegrate asm/system.h for Alpha"

    combined with commit b4816afa3986704d1404fc48e931da5135820472

    "Move the asm-generic/system.h xchg() implementation to asm-generic/cmpxchg.h"

    introduced the concept of asm/cmpxchg.h but the alpha arch
    never got one. Fork the cmpxchg content out of the asm/atomic.h
    file to create one.

    Some minor whitespace fixups were done on the block of code that
    created the new file.

    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Matt Turner
    Cc: David Howells
    Acked-by: Matt Turner
    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     

13 Apr, 2012

19 commits

  • Pull infiniband fix from Roland Dreier:
    "Add a fix for a bug hit by Alexey Shvetsov in ib_srtp that hits on
    non-mlx4 hardware."

    * tag 'srpt-srq-type' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
    IB/srpt: Set srq_type to IB_SRQT_BASIC

    Linus Torvalds
     
  • We've now fixed IS_ENABLED() and friends to not require any special
    "__enabled_" prefixed versions of the normal Kconfig options, so delete
    the last traces of them being generated.

    Signed-off-by: Paul Gortmaker
    Signed-off-by: Linus Torvalds

    Paul Gortmaker
     
  • This reverts commit 953742c8fe8ac45be453fee959d7be40cd89f920.

    Dumping two lines into autoconf.h for all existing Kconfig options
    results in a giant file (~16k lines) we have to process each time we
    compile something. We've weaned IS_ENABLED() and similar off of
    requiring the __enabled_ definitions so now we can revert the change
    which caused all the extra lines.

    Signed-off-by: Paul Gortmaker
    Signed-off-by: Linus Torvalds

    Paul Gortmaker
     
  • Using IS_ENABLED() within C (vs. within CPP #if statements) in its
    current form requires us to actually define every possible bool/tristate
    Kconfig option twice (__enabled_* and __enabled_*_MODULE variants).

    This results in a huge autoconf.h file, on the order of 16k lines for a
    x86_64 defconfig.

    Fixing IS_ENABLED to be able to work on the smaller subset of just
    things that we really have defined is step one to fixing this. Which
    means it has to not choke when fed non-enabled options, such as:

    include/linux/netdevice.h:964:1: warning: "__enabled_CONFIG_FCOE_MODULE" is not defined [-Wundef]

    The original prototype of how to implement a C and preprocessor
    compatible way of doing this came from the Google+ user "comex ." in
    response to Linus' crowdsourcing challenge for a possible improvement on
    his earlier C specific solution:

    #define config_enabled(x) (__stringify(x)[0] == '1')

    In this implementation, I've chosen variable names that hopefully make
    how it works more understandable.

    Signed-off-by: Paul Gortmaker
    Signed-off-by: Linus Torvalds

    Paul Gortmaker
     
  • A user reported that booting his box up with btrfs root on 3.4 was way
    slower than on 3.3 because I removed the ideal caching code. It turns out
    that we don't load the free space cache if we're in a commit for deadlock
    reasons, but since we're reading the cache and it hasn't changed yet we are
    safe reading the inode and free space item from the commit root, so do that
    and remove all of the deadlock checks so we don't unnecessarily skip loading
    the free space cache. The user reported this fixed the slowness. Thanks,

    Tested-by: Calvin Walton
    Signed-off-by: Josef Bacik
    Signed-off-by: Chris Mason

    Josef Bacik
     
  • Pull USB fixes from Greg KH:
    "Here are a number of fixes for the USB core and drivers for 3.4-rc2

    Lots of tiny xhci fixes here, a few usb-serial driver fixes and new
    device ids, and a smattering of other minor fixes in different USB
    drivers.

    Signed-off-by: Greg Kroah-Hartman "

    * tag 'usb-3.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (30 commits)
    USB: update usbtmc api documentation
    xHCI: Correct the #define XHCI_LEGACY_DISABLE_SMI
    xHCI: use gfp flags from caller instead of GFP_ATOMIC
    xHCI: add XHCI_RESET_ON_RESUME quirk for VIA xHCI host
    USB: fix bug of device descriptor got from superspeed device
    xhci: Fix register save/restore order.
    xhci: Restore event ring dequeue pointer on resume.
    xhci: Don't write zeroed pointers to xHC registers.
    xhci: Warn when hosts don't halt.
    xhci: don't re-enable IE constantly
    usb: xhci: fix section mismatch in linux-next
    xHCI: correct to print the true HSEE of USBCMD
    USB: serial: fix race between probe and open
    UHCI: hub_status_data should indicate if ports are resuming
    EHCI: keep track of ports being resumed and indicate in hub_status_data
    USB: fix race between root-hub suspend and remote wakeup
    USB: sierra: add support for Sierra Wireless MC7710
    USB: ftdi_sio: fix race condition in TIOCMIWAIT, and abort of TIOCMIWAIT when the device is removed
    USB: ftdi_sio: fix status line change handling for TIOCMIWAIT and TIOCGICOUNT
    USB: don't ignore suspend errors for root hubs
    ...

    Linus Torvalds
     
  • Pull tty and serial fixes from Greg KH:
    "Here are some tty and serial fixes for 3.4-rc2.

    Most important here is the pl011 fix, which has been reported by about
    100 different people, which means more people use it than I expected
    :)

    There are also some 8250 driver reverts due to some problems reported
    by them. And other minor fixes as well.

    Signed-off-by: Greg Kroah-Hartman "

    * tag 'tty-3.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
    pch_uart: Add Kontron COMe-mTT10 uart clock quirk
    pch_uart: Fix MSI setting issue
    serial/8250_pci: add a "force background timer" flag and use it for the "kt" serial port
    Revert "serial/8250_pci: setup-quirk workaround for the kt serial controller"
    Revert "serial/8250_pci: init-quirk msi support for kt serial controller"
    tty/serial/omap: console can only be built-in
    serial: samsung: fix omission initialize ulcon in reset port fn()
    printk(): add KERN_CONT where needed in hpet and vt code
    tty/serial: atmel_serial: fix RS485 half-duplex problem
    tty: serial: altera_uart: Check for NULL platform_data in probe.
    isdn/gigaset: use gig_dbg() for debugging output
    omap-serial: Fix the error handling in the omap_serial probe
    serial: PL011: move interrupt clearing

    Linus Torvalds
     
  • Pull staging tree fixes from Greg KH:
    "Here are a number of bugfixes for the drivers/staging/ portion of the
    kernel that have been reported recently.

    Nothing major here, with maybe the exception of the ramster code can
    now be built so it is enabled in the build again, and lots of memory
    leaks that people like to have fixed on their systems.

    Signed-off-by: Greg Kroah-Hartman "

    * tag 'staging-3.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
    staging: android: fix mem leaks in __persistent_ram_init()
    staging: vt6656: Don't leak memory in drivers/staging/vt6656/ioctl.c::private_ioctl()
    staging: iio: hmc5843: Fix crash in probe function.
    staging/xgifb: fix display on XGI Volari Z11m cards
    Staging: android: timed_gpio: Fix resource leak in timed_gpio_probe error paths
    android: make persistent_ram based drivers depend on HAVE_MEMBLOCK
    staging: iio: ak8975: Remove i2c client data corruption
    staging: drm/omap: move where DMM driver is registered
    staging: zsmalloc: fix memory leak
    Staging: rts_pstor: off by one in for loop
    staging: ozwpan: Added new maintainer for ozwpan
    staging:rts_pstor:Avoid "Bad target number" message when probing driver
    staging:rts_pstor:Fix possible panic by NULL pointer dereference
    Staging: vt6655-6: check keysize before memcpy()
    staging/media/as102: Don't call release_firmware() on uninitialized variable
    staging:iio:core add missing increment of loop index in iio_map_array_unregister()
    staging: ramster: unbreak my heart
    staging/vme: Fix module parameters
    staging: sep: Fix sign of error

    Linus Torvalds
     
  • Pull driver core and kobject fixes from Greg KH:
    "Here are some minor fixes for the driver core and kobjects that people
    have reported recently.

    Signed-off-by: Greg Kroah-Hartman "

    * tag 'driver-core-3.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
    kobject: provide more diagnostic info for kobject_add_internal() failures
    sysfs: handle 'parent deleted before child added'
    sysfs: Prevent crash on unset sysfs group attributes
    sysfs: Update the name hash for an entry after changing the namespace
    drivers/base: fix compiler warning in SoC export driver - idr should be ida
    drivers/base: Remove unneeded spin_lock_init call for soc_lock

    Linus Torvalds
     
  • Pull a fix for the recent irqdomain bug fixes from Grant Likely:
    "I flubbed one patch in the last pull request which broke a format
    string on 64 bit platforms. Here's the fix."

    * tag 'irqdomain-for-linus' of git://git.secretlab.ca/git/linux-2.6:
    irq_domain: fix type mismatch in debugfs output format

    Linus Torvalds
     
  • sizeof(void*) returns an unsigned long, but it was being used as a width parameter to a "%-*s" format string which requires an int. On 64 bit platforms this causes a type mismatch:

    linux/kernel/irq/irqdomain.c:575: warning: field width should have type
    'int', but argument 6 has type 'long unsigned int'

    This change casts the size to an int so printf gets the right data type.

    Reported-by: Andreas Schwab
    Signed-off-by: Grant Likely
    Cc: David Daney

    Grant Likely
     
  • Pull trivial perf build failure fix from Thomas Gleixner.

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    perf tools: Fix getrusage() related build failure on glibc trunk

    Linus Torvalds
     
  • Pull timer fixes from Thomas Gleixner:
    "The itimer removal one is not strictly a fix, but I really wanted to
    avoid a rebase of the urgent ones."

    * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    Revert "clocksource: Load the ACPI PM clocksource asynchronously"
    clockevents: tTack broadcast device mode change in tick_broadcast_switch_to_oneshot()
    itimer: Use printk_once instead of WARN_ONCE
    nohz: Fix stale jiffies update in tick_nohz_restart()
    tick: Document TICK_ONESHOT config option
    proc: stats: Use arch_idle_time for idle and iowait times if available
    itimer: Schedule silent NULL pointer fixup in setitimer() for removal

    Linus Torvalds
     
  • Pull x86 fixes from Thomas Gleixner.

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86: Use correct byte-sized register constraint in __add()
    x86: Use correct byte-sized register constraint in __xchg_op()
    x86: vsyscall: Use NULL instead 0 for a pointer argument

    Linus Torvalds
     
  • If, in __persistent_ram_init(), the call to
    persistent_ram_buffer_init() fails or the call to
    persistent_ram_init_ecc() fails then we fail to free the memory we
    allocated to 'prz' with kzalloc() - thus leaking it.

    To prevent the leaks I consolidated all error exits from the function
    at a 'err:' label at the end and made all error cases jump to that
    label where we can then make sure we always free 'prz'. This is safe
    since all the situations where the code bails out happen before 'prz'
    has been stored anywhere and although we'll do a redundant kfree(NULL)
    call in the case of kzalloc() itself failing that's OK since kfree()
    deals gracefully with NULL pointers and I felt it was more important
    to keep all error exits at a single location than to avoid that one
    harmless/redundant kfree() on a error path.

    Signed-off-by: Jesper Juhl
    Acked-by: Colin Cross
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Jesper Juhl
     
  • If copy_to_user() fails in the WLAN_CMD_GET_NODE_LIST case of the
    switch in drivers/staging/vt6656/ioctl.c::private_ioctl() we'll leak
    the memory allocated to 'pNodeList'. Fix that by kfree'ing the memory
    in the failure case.
    Also remove a pointless cast (to type 'PSNodeList') of a kmalloc()
    return value - kmalloc() returns a void pointer that is implicitly
    converted, so there is no need for an explicit cast.

    Signed-off-by: Jesper Juhl
    Signed-off-by: Greg Kroah-Hartman

    Jesper Juhl
     
  • Fix crash after issuing:
    echo hmc5843 0x1e > /sys/class/i2c-dev/i2c-2/device/new_device

    [ 37.180999] device: '2-001e': device_add
    [ 37.188293] bus: 'i2c': add device 2-001e
    [ 37.194549] PM: Adding info for i2c:2-001e
    [ 37.200958] bus: 'i2c': driver_probe_device: matched device 2-001e with driver hmc5843
    [ 37.210815] bus: 'i2c': really_probe: probing driver hmc5843 with device 2-001e
    [ 37.224884] HMC5843 initialized
    [ 37.228759] ------------[ cut here ]------------
    [ 37.233612] kernel BUG at mm/slab.c:505!
    [ 37.237701] Internal error: Oops - BUG: 0 [#1] PREEMPT
    [ 37.243103] Modules linked in:
    [ 37.246337] CPU: 0 Not tainted (3.3.1-gta04+ #28)
    [ 37.251647] PC is at kfree+0x84/0x144
    [ 37.255493] LR is at kfree+0x20/0x144
    [ 37.259338] pc : [] lr : [] psr: 40000093
    [ 37.259368] sp : de249cd8 ip : 0000000c fp : 00000090
    [ 37.271362] r10: 0000000a r9 : de229eac r8 : c0236274
    [ 37.276855] r7 : c09d6490 r6 : a0000013 r5 : de229c00 r4 : de229c10
    [ 37.283691] r3 : c0f00218 r2 : 00000400 r1 : c0eea000 r0 : c00b4028
    [ 37.290527] Flags: nZcv IRQs off FIQs on Mode SVC_32 ISA ARM Segment user
    [ 37.298095] Control: 10c5387d Table: 9e1d0019 DAC: 00000015
    [ 37.304107] Process sh (pid: 91, stack limit = 0xde2482f0)
    [ 37.309844] Stack: (0xde249cd8 to 0xde24a000)
    [ 37.314422] 9cc0: de229c10 de229c00
    [ 37.322998] 9ce0: de229c10 ffffffea 00000005 c0236274 de140a80 c00b4798 dec00080 de140a80
    [ 37.331573] 9d00: c032f37c dec00080 000080d0 00000001 de229c00 de229c10 c048d578 00000005
    [ 37.340148] 9d20: de229eac 0000000a 00000090 c032fa40 00000001 00000000 00000001 de229c10
    [ 37.348724] 9d40: de229eac 00000029 c075b558 00000001 00000003 00000004 de229c10 c048d594
    [ 37.357299] 9d60: 00000000 60000013 00000018 205b0007 37332020 3432322e 5d343838 c0060020
    [ 37.365905] 9d80: de251600 00000001 00000000 de251600 00000001 c0065a84 de229c00 de229c48
    [ 37.374481] 9da0: 00000006 0048d62c de229c38 de229c00 de229c00 de1f6c00 de1f6c20 00000001
    [ 37.383056] 9dc0: 00000000 c048d62c 00000000 de229c00 de229c00 de1f6c00 de1f6c20 00000001
    [ 37.391632] 9de0: 00000000 c048d62c 00000000 c0330164 00000000 de1f6c20 c048d62c de1f6c00
    [ 37.400207] 9e00: c0330078 de1f6c04 c078d714 de189b58 00000000 c02ccfd8 de1f6c20 c0795f40
    [ 37.408782] 9e20: c0238330 00000000 00000000 c02381a8 de1b9fc0 de1f6c20 de1f6c20 de249e48
    [ 37.417358] 9e40: c0238330 c0236bb0 decdbed8 de7d0f14 de1f6c20 de1f6c20 de1f6c54 de1f6c20
    [ 37.425933] 9e60: 00000000 c0238030 de1f6c20 c078d7bc de1f6c20 c02377ec de1f6c20 de1f6c28
    [ 37.434509] 9e80: dee64cb0 c0236138 c047c554 de189b58 00000000 c004b45c de1f6c20 de1f6cd8
    [ 37.443084] 9ea0: c0edfa6c de1f6c00 dee64c68 de1f6c04 de1f6c20 dee64cb8 c047c554 de189b58
    [ 37.451690] 9ec0: 00000000 c02cd634 dee64c68 de249ef4 de23b008 dee64cb0 0000000d de23b000
    [ 37.460266] 9ee0: de23b007 c02cd78c 00000002 00000000 00000000 35636d68 00333438 00000000
    [ 37.468841] 9f00: 00000000 00000000 001e0000 00000000 00000000 00000000 00000000 0a10cec0
    [ 37.477416] 9f20: 00000002 de249f80 0000000d dee62990 de189b40 c0234d88 0000000d c010c354
    [ 37.485992] 9f40: 0000000d de210f28 000acc88 de249f80 0000000d de248000 00000000 c00b7bf8
    [ 37.494567] 9f60: de210f28 000acc88 de210f28 000acc88 00000000 00000000 0000000d c00b7ed8
    [ 37.503143] 9f80: 00000000 00000000 0000000d 00000000 0007fa28 0000000d 000acc88 00000004
    [ 37.511718] 9fa0: c000e544 c000e380 0007fa28 0000000d 00000001 000acc88 0000000d 00000000
    [ 37.520294] 9fc0: 0007fa28 0000000d 000acc88 00000004 00000001 00000020 00000002 00000000
    [ 37.528869] 9fe0: 00000000 beab8624 0000ea05 b6eaebac 600d0010 00000001 00000000 00000000
    [ 37.537475] [] (kfree+0x84/0x144) from [] (device_add+0x530/0x57c)
    [ 37.545806] [] (device_add+0x530/0x57c) from [] (iio_device_register+0x8c8/0x990)
    [ 37.555480] [] (iio_device_register+0x8c8/0x990) from [] (hmc5843_probe+0xec/0x114)
    [ 37.565338] [] (hmc5843_probe+0xec/0x114) from [] (i2c_device_probe+0xc4/0xf8)
    [ 37.574737] [] (i2c_device_probe+0xc4/0xf8) from [] (driver_probe_device+0x118/0x218)
    [ 37.584777] [] (driver_probe_device+0x118/0x218) from [] (bus_for_each_drv+0x4c/0x84)
    [ 37.594818] [] (bus_for_each_drv+0x4c/0x84) from [] (device_attach+0x78/0xa4)
    [ 37.604125] [] (device_attach+0x78/0xa4) from [] (bus_probe_device+0x28/0x9c)
    [ 37.613433] [] (bus_probe_device+0x28/0x9c) from [] (device_add+0x3f4/0x57c)
    [ 37.622650] [] (device_add+0x3f4/0x57c) from [] (i2c_new_device+0xf8/0x19c)
    [ 37.631805] [] (i2c_new_device+0xf8/0x19c) from [] (i2c_sysfs_new_device+0xb4/0x130)
    [ 37.641754] [] (i2c_sysfs_new_device+0xb4/0x130) from [] (dev_attr_store+0x18/0x24)
    [ 37.651611] [] (dev_attr_store+0x18/0x24) from [] (sysfs_write_file+0x10c/0x140)
    [ 37.661193] [] (sysfs_write_file+0x10c/0x140) from [] (vfs_write+0xb0/0x178)
    [ 37.670410] [] (vfs_write+0xb0/0x178) from [] (sys_write+0x3c/0x68)
    [ 37.678833] [] (sys_write+0x3c/0x68) from [] (ret_fast_syscall+0x0/0x3c)
    [ 37.687683] Code: 1593301c e5932000 e3120080 1a000000 (e7f001f2)
    [ 37.700775] ---[ end trace aaf805debdb69390 ]---

    Client data was assigned to iio_dev structure in probe but in
    hmc5843_init_client function casted to private driver data structure which
    is wrong. Possibly calling mutex_init(&data->lock); corrupt data
    which the lead to above crash.

    Signed-off-by: Marek Belisko
    Cc: stable
    Acked-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Marek BElisko
     
  • Merge fixes from Andrew Morton.

    * emailed from Andrew Morton : (14 patches)
    panic: fix stack dump print on direct call to panic()
    drivers/rtc/rtc-pl031.c: enable clock on all ST variants
    Revert "mm: vmscan: fix misused nr_reclaimed in shrink_mem_cgroup_zone()"
    hugetlb: fix race condition in hugetlb_fault()
    drivers/rtc/rtc-twl.c: use static register while reading time
    drivers/rtc/rtc-s3c.c: add placeholder for driver private data
    drivers/rtc/rtc-s3c.c: fix compilation error
    MAINTAINERS: add PCDP console maintainer
    memcg: do not open code accesses to res_counter members
    drivers/rtc/rtc-efi.c: fix section mismatch warning
    drivers/rtc/rtc-r9701.c: reset registers if invalid values are detected
    drivers/char/random.c: fix boot id uniqueness race
    memcg: fix broken boolen expression
    memcg: fix up documentation on global LRU

    Linus Torvalds
     
  • Pull networking fixes from David Miller:

    1) Fix bluetooth userland regression reported by Keith Packard, from
    Gustavo Padovan.

    2) Revert ath9k PS idle change, from Sujith Manoharan.

    3) Correct default TCP memory limits (again), from Eric Dumazet.

    4) Fix tcp_rcv_rtt_update() accidental use of unscaled RTT, from Neal
    Cardwell.

    5) We made a facility for layers like wireless to say how much tailroom
    they need in the SKB for link layer stuff such as wireless
    encryption etc., but TCP works hard to fill every SKB out to the end
    defeating this specification.

    This leads to every TCP packet getting reallocated by the wireless
    code in order to have the right amount of tailroom available.

    Fix TCP to only fill SKBs out to the real amount of data area it
    asked for during the allocation, this way it won't eat into the
    slack added for the device's tailroom needs.

    Reported by Marc Merlin and fixed by Eric Dumazet.

    6) Leaks, endian bugs, and new device IDs in bluetooth from Santosh
    Nayak, João Paulo Rechi Vita, Cho, Yu-Chen, Andrei Emeltchenko,
    AceLan Kao, and Andrei Emeltchenko.

    7) OOPS on tty_close fix in bluetooth's hci_ldisc from Johan Hovold.

    8) netfilter erroneously scales TCP window twice, fix from Changli Gao.

    9) Memleak fix in wext-core from Julia Lawall.

    10) Consistently handle invalid TCP packets in ipv4 vs. ipv6 conntrack,
    from Jozsef Kadlecsik.

    11) Validate IP header length properly in netfilter conntrack's
    ipv4_get_l4proto().

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (39 commits)
    NFC: Fix the LLCP Tx fragmentation loop
    rtlwifi: Add missing DMA buffer unmapping for PCI drivers
    rtlwifi: Preallocate USB read buffers and eliminate kalloc in read routine
    tcp: avoid order-1 allocations on wifi and tx path
    net: allow pskb_expand_head() to get maximum tailroom
    bridge: Do not send queries on multicast group leaves
    MAINTAINERS: Mark NATSEMI driver as orphan'd.
    tcp: fix tcp_rcv_rtt_update() use of an unscaled RTT sample
    tcp: restore correct limit
    Revert "ath9k: fix going to full-sleep on PS idle"
    rt2x00: Fix rfkill_polling register function.
    bcma: fix build error on MIPS; implicit pcibios_enable_device
    netfilter: nf_conntrack: fix incorrect logic in nf_conntrack_init_net
    netfilter: nf_ct_ipv4: packets with wrong ihl are invalid
    netfilter: nf_ct_ipv4: handle invalid IPv4 and IPv6 packets consistently
    net/wireless/wext-core.c: add missing kfree
    rtlwifi: Fix oops on rate-control failure
    mac80211: Convert WARN_ON to WARN_ON_ONCE
    rtlwifi: rtl8192de: Fix firmware initialization
    nl80211: ensure interface is up in various APIs
    ...

    Linus Torvalds