01 Jul, 2011

1 commit


30 Jun, 2011

9 commits


29 Jun, 2011

15 commits

  • pca954x power-on default is channel 0 connected. If multiple pca954x
    muxes are connected to the same physical I2C bus, the parent bus will
    see channel 0 devices behind both muxes by default. This is bad.

    Scenario:
    -- pca954x @ 0x70 -- ch 0 (I2C-bus-101) -- EEPROM @ 0x50
    |
    I2C-bus-1 ---
    |
    -- pca954x @ 0x71 -- ch 0 (I2C-bus-111) -- EEPROM @ 0x50

    1. Load I2C bus driver: creates I2C-bus-1
    2. Load pca954x driver: creates virtual I2C-bus-101 and I2C-bus-111
    3. Load eeprom driver
    4. Try to read EEPROM @ 0x50 on I2C-bus-101. The transaction will also bleed
    onto I2C-bus-111 because pca954x @ 0x71 channel 0 is connected by default.

    Fix: Initialize pca954x to disconnected state in pca954x_probe()

    Signed-off-by: Petri Gynther
    Signed-off-by: Jean Delvare
    Cc: stable@kernel.org

    Petri Gynther
     
  • * Print all error and information messages even when debugging is
    disabled.
    * Don't use adapter device to log messages before it is ready.

    Signed-off-by: Jean Delvare
    Cc: stable@kernel.org

    Jean Delvare
     
  • %rip-relative addressing is relative to the first byte of the next instruction,
    so we need to add %rip only after we've fetched any immediate bytes.

    Based on original patch by Li Xin .

    Signed-off-by: Avi Kivity
    Acked-by: Li Xin
    Signed-off-by: Marcelo Tosatti

    Avi Kivity
     
  • Since printk_ratelimit() shouldn't be used anymore (see comment in
    include/linux/printk.h), replace it with printk_ratelimited.

    Signed-off-by: Christian Dietrich
    Signed-off-by: Benjamin Herrenschmidt

    Christian Dietrich
     
  • Don't use printk_ratelimit() as an additional condition for returning
    on an error. Because when the ratelimit is reached, printk_ratelimit
    will return 0 and e.g. in rtas_get_boot_time won't check for an error
    condition.

    Signed-off-by: Christian Dietrich
    Signed-off-by: Benjamin Herrenschmidt

    Christian Dietrich
     
  • Remove duplicate assignment of SCSI_BNX2_ISCSI in pseries_defconfig
    introduced by:
    37e0c21e powerpc/pseries: Enable iSCSI support for a number of cards

    causes warning:
    arch/powerpc/configs/pseries_defconfig:151:warning: override: reassigning to symbol SCSI_BNX2_ISCSI

    Signed-off-by: Michael Neuling
    Signed-off-by: Benjamin Herrenschmidt

    Michael Neuling
     
  • * 'drm-intel-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/keithp/linux-2.6:
    drm/i915: Use chipset-specific irq installers
    drm/i915: forcewake fix after reset
    drm/i915: add Ivy Bridge page flip support
    drm/i915: split page flip queueing into per-chipset functions

    Linus Torvalds
     
  • …t/gregkh/driver-core-2.6

    * 'driver-core-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6:
    Connector: Correctly set the error code in case of success when dispatching receive callbacks
    Connector: Set the CN_NETLINK_USERS correctly
    pti: PTI semantics fix in pti_tty_cleanup.
    pti: ENXIO error case memory leak PTI fix.
    pti: double-free security PTI fix
    drivers:misc: ti-st: fix skipping of change remote baud
    drivers/base/platform.c: don't mark platform_device_register_resndata() as __init_or_module
    st_kim: Handle case of no device found for ID 0
    firmware: fix GOOGLE_SMI kconfig dependency warning

    Linus Torvalds
     
  • * 'usb-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6:
    MAINTAINERS: add myself as maintainer of USB/IP
    usb: r8a66597-hcd: fix cannot detect low/full speed device
    USB: ehci-ath79: fix a NULL pointer dereference
    USB: Add new FT232H chip to drivers/usb/serial/ftdi_sio.c
    usb/isp1760: Fix bug preventing the unlinking of control urbs
    USB: Fix up URB error codes to reflect implementation.
    xhci: Always set urb->status to zero for isoc endpoints.
    xhci: Add reset on resume quirk for asrock p67 host
    xHCI 1.0: Incompatible Device Error
    USB: don't let errors prevent system sleep
    USB: don't let the hub driver prevent system sleep
    USB: change maintainership of ohci-hcd and ehci-hcd
    xHCI 1.0: Force Stopped Event(FSE)
    xhci: Don't warn about zeroed bMaxBurst descriptor field.
    USB: Free bandwidth when usb_disable_device is called.
    xhci: Reject double add of active endpoints.
    USB: TI 3410/5052 USB Serial Driver: Fix mem leak when firmware is too big.
    usb: musb: gadget: clear TXPKTRDY flag when set FLUSHFIFO
    usb: musb: host: compare status for negative error values

    Linus Torvalds
     
  • * 'tty-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6:
    serial: bcm63xx_uart: fix irq storm after rx fifo overrun.
    amba pl011: platform data for reg lockup and glitch v2
    amba pl011: workaround for uart registers lockup
    tty: n_gsm: improper skb_pull() use was leaking framed data
    tty: n_gsm: Fixed logic to decode break signal from modem status
    TTY: ntty, add one more sanity check
    TTY: ldisc, do not close until there are readers
    8250: Fix capabilities when changing the port type
    8250_pci: Fix missing const from merges
    ARM: SAMSUNG: serial: Fix on handling of one clock source for UART
    serial: ioremap warning fix for jsm driver.
    8250_pci: add -ENODEV code for Intel EG20T PCH

    Linus Torvalds
     
  • * 'staging-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6:
    Staging: comedi: fix build breakages on some platforms
    Staging: brcm80211: disable drivers except for X86 or MIPS platforms
    Staging: brcm80211: disable drivers for PPC platforms
    Staging: iio: Make IIO depend on GENERIC_HARDIRQS
    Staging: mei: fix suspend failure
    Staging: fix iio builds when IIO_RING_BUFFER is not enabled
    Staging: Comedi: Build only on arches providing PAGE_KERNEL_NOCACHE
    Staging: fix more iio builds when IIO_RING_BUFFER is not enabled

    Linus Torvalds
     
  • * 'for-linus' of git://neil.brown.name/md:
    md: avoid endless recovery loop when waiting for fail device to complete.

    Linus Torvalds
     
  • Konstantin Belousov pointed out that 4697995b98417 replaced the generic
    i915_driver_irq_*install() functions with chipset specific routines
    accessible only through driver->irq_*install(). So update the sanity
    check in i915_request_wait() to match.

    Signed-off-by: Chris Wilson
    Signed-off-by: Keith Packard

    Chris Wilson
     
  • The failure is as follows:

    1. Userspace gets forcewake lock, lock count >=1
    2. GPU hang/reset occurs (forcewake bit is reset)
    3. count is now incorrect

    The failure can only occur when using the forcewake userspace lock.

    This has the unfortunate consequence of messing up the driver as well as
    userspace, unless userspace closes the debugfs file, the kernel will
    never end up waking the GT since the refcount will be > 1.

    The solution is to try to recover the correct forcewake state based on
    the refcount. There is a period of time where userspace reads/writes may
    occur after the reset, before the GT has been forcewaked. The interface
    was never designed to be a perfect solution for userspace reads/writes,
    and the kernel portion is fixed by this patch.

    Suggested-by: Chris Wilson
    Signed-off-by: Ben Widawsky
    Signed-off-by: Keith Packard

    Ben Widawsky
     
  • /proc/PID/io may be used for gathering private information. E.g. for
    openssh and vsftpd daemons wchars/rchars may be used to learn the
    precise password length. Restrict it to processes being able to ptrace
    the target process.

    ptrace_may_access() is needed to prevent keeping open file descriptor of
    "io" file, executing setuid binary and gathering io information of the
    setuid'ed process.

    Signed-off-by: Vasiliy Kulikov
    Signed-off-by: Linus Torvalds

    Vasiliy Kulikov
     

28 Jun, 2011

15 commits

  • If a device fails in a way that causes pending request to take a while
    to complete, md will not be able to immediately remove it from the
    array in remove_and_add_spares.
    It will then incorrectly look like a spare device and md will try to
    recover it even though it is failed.
    This leads to a recovery process starting and instantly aborting over
    and over again.

    We should check if the device is faulty before considering it to be a
    spare. This will avoid trying to start a recovery that cannot
    proceed.

    This bug was introduced in 2.6.26 so that patch is suitable for any
    kernel since then.

    Cc: stable@kernel.org
    Reported-by: Jim Paradis
    Signed-off-by: NeilBrown

    NeilBrown
     
  • Linus Torvalds
     
  • When auditing the locking in i915_gem.c (for a prospective change which
    I then abandoned), I noticed two places where struct_mutex is not held
    across GEM object manipulations that would usually require it.

    Since one is in initial setup and the other in driver unload, I'm
    guessing the mutex is not required for either; but post a patch in case
    it is.

    Signed-off-by: Hugh Dickins
    Cc: Chris Wilson
    Cc: Keith Packard
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     
  • The interface to ->truncate_range is changing very slightly: once "tmpfs:
    take control of its truncate_range" has been applied, this can be applied.
    For now there is only a slight inefficiency while this remains unapplied,
    but it will soon become essential for managing shmem's use of swap.

    Change i915_gem_object_truncate() to use shmem_truncate_range() directly:
    which should also spare i915 later change if we switch from
    inode_operations->truncate_range to file_operations->fallocate.

    Signed-off-by: Hugh Dickins
    Cc: Christoph Hellwig
    Cc: Chris Wilson
    Cc: Keith Packard
    Cc: Dave Airlie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     
  • Soon tmpfs will stop supporting ->readpage and read_cache_page_gfp(): once
    "tmpfs: add shmem_read_mapping_page_gfp" has been applied, this patch can
    be applied to ease the transition.

    Make i915_gem_object_get_pages_gtt() use shmem_read_mapping_page_gfp() in
    the one place it's needed; elsewhere use shmem_read_mapping_page(), with
    the mapping's gfp_mask properly initialized.

    Forget about __GFP_COLD: since tmpfs initializes its pages with memset,
    asking for a cold page is counter-productive.

    Include linux/shmem_fs.h also in drm_gem.c: with shmem_file_setup() now
    declared there too, we shall remove the prototype from linux/mm.h later.

    Signed-off-by: Hugh Dickins
    Cc: Christoph Hellwig
    Cc: Chris Wilson
    Cc: Keith Packard
    Cc: Dave Airlie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     
  • Soon tmpfs will stop supporting ->readpage and read_mapping_page(): once
    "tmpfs: add shmem_read_mapping_page_gfp" has been applied, this patch can
    be applied to ease the transition.

    ttm_tt_swapin() and ttm_tt_swapout() use shmem_read_mapping_page() in
    place of read_mapping_page(), since their swap_space has been created with
    shmem_file_setup().

    Signed-off-by: Hugh Dickins
    Cc: Christoph Hellwig
    Cc: Thomas Hellstrom
    Cc: Dave Airlie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     
  • Fis the warning

    drivers/tty/serial/8250_pci.c:1457: warning: initialization from incompatible pointer type

    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • Fix this section mismatch:

    WARNING: drivers/misc/ioc4.o(.data+0x144): Section mismatch in reference from the variable ioc4_load_modules_work to the function .devinit.text:ioc4_load_modules()
    The variable ioc4_load_modules_work references
    the function __devinit ioc4_load_modules()
    If the reference is valid then annotate the
    variable with __init* or __refdata (see linux/init.h) or name the variable:
    *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

    This one is potentially fatal; by the time ioc4_load_modules is invoked
    it may already have been freed. For that reason ioc4_load_modules_work
    can't be turned to __devinitdata but also because it's referenced in
    ioc4_exit.

    Signed-off-by: Ralf Baechle
    Acked-by: Brent Casavant
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ralf Baechle
     
  • Fix this section mismatch:

    WARNING: drivers/leds/leds-lp5523.o(.text+0x12f4): Section mismatch in reference from the function lp5523_probe() to the function .init.text:lp5523_init_led()
    The function lp5523_probe() references
    the function __init lp5523_init_led().
    This is often because lp5523_probe lacks a __init
    annotation or the annotation of lp5523_init_led is wrong.

    Fixing this one triggers one more mismatch, fix that one as well.

    Signed-off-by: Ralf Baechle
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ralf Baechle
     
  • Fix this section mismatch:

    WARNING: drivers/leds/leds-lp5521.o(.text+0xf2c): Section mismatch in reference from the function lp5521_probe() to the function .init.text:lp5521_init_led()
    The function lp5521_probe() references
    the function __init lp5521_init_led().
    This is often because lp5521_probe lacks a __init
    annotation or the annotation of lp5521_init_led is wrong.

    Fixing this mismatch triggers one more mismatch, fix that one as well.

    Signed-off-by: Ralf Baechle
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ralf Baechle
     
  • Commit d149e3b25d7c ("memcg: add the soft_limit reclaim in global direct
    reclaim") adds a softlimit hook to shrink_zones(). By this, soft limit
    is called as

    try_to_free_pages()
    do_try_to_free_pages()
    shrink_zones()
    mem_cgroup_soft_limit_reclaim()

    Then, direct reclaim is memcg softlimit hint aware, now.

    But, the memory cgroup's "limit" path can call softlimit shrinker.

    try_to_free_mem_cgroup_pages()
    do_try_to_free_pages()
    shrink_zones()
    mem_cgroup_soft_limit_reclaim()

    This will cause a global reclaim when a memcg hits limit.

    This is bug. soft_limit_reclaim() should be called when
    scanning_global_lru(sc) == true.

    And the commit adds a variable "total_scanned" for counting softlimit
    scanned pages....it's not "total". This patch removes the variable and
    update sc->nr_scanned instead of it. This will affect shrink_slab()'s
    scan condition but, global LRU is scanned by softlimit and I think this
    change makes sense.

    TODO: avoid too much scanning of a zone when softlimit did enough work.

    Signed-off-by: KAMEZAWA Hiroyuki
    Cc: Daisuke Nishimura
    Cc: Ying Han
    Cc: Michal Hocko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KAMEZAWA Hiroyuki
     
  • Currently a single process may register exit handlers unlimited times.
    It may lead to a bloated listeners chain and very slow process
    terminations.

    Eg after 10KK sent TASKSTATS_CMD_ATTR_REGISTER_CPUMASKs ~300 Mb of
    kernel memory is stolen for the handlers chain and "time id" shows 2-7
    seconds instead of normal 0.003. It makes it possible to exhaust all
    kernel memory and to eat much of CPU time by triggerring numerous exits
    on a single CPU.

    The patch limits the number of times a single process may register
    itself on a single CPU to one.

    One little issue is kept unfixed - as taskstats_exit() is called before
    exit_files() in do_exit(), the orphaned listener entry (if it was not
    explicitly deregistered) is kept until the next someone's exit() and
    implicit deregistration in send_cpu_listeners(). So, if a process
    registered itself as a listener exits and the next spawned process gets
    the same pid, it would inherit taskstats attributes.

    Signed-off-by: Vasiliy Kulikov
    Cc: Balbir Singh
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vasiliy Kulikov
     
  • Under heavy memory and filesystem load, users observe the assertion
    mapping->nrpages == 0 in end_writeback() trigger. This can be caused by
    page reclaim reclaiming the last page from a mapping in the following
    race:

    CPU0 CPU1
    ...
    shrink_page_list()
    __remove_mapping()
    __delete_from_page_cache()
    radix_tree_delete()
    evict_inode()
    truncate_inode_pages()
    truncate_inode_pages_range()
    pagevec_lookup() - finds nothing
    end_writeback()
    mapping->nrpages != 0 -> BUG
    page->mapping = NULL
    mapping->nrpages--

    Fix the problem by doing a reliable check of mapping->nrpages under
    mapping->tree_lock in end_writeback().

    Analyzed by Jay , lost in LKML, and dug out
    by Miklos Szeredi .

    Cc: Jay
    Cc: Miklos Szeredi
    Signed-off-by: Jan Kara
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Kara
     
  • We cannot take a mutex while holding a spinlock, so flip the order and
    fix the locking documentation.

    Signed-off-by: Peter Zijlstra
    Acked-by: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Zijlstra
     
  • We observed the crash point count going negative in cases where the
    crash point is hit multiple times before the check of "count == 0" is
    done. Because of this we never call lkdtm_do_action(). This patch just
    adds a spinlock to protect count.

    Reported-by: Tapan Dhimant
    Signed-off-by: Josh Hunt
    Acked-by: Ankita Garg
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Josh Hunt