22 Jan, 2015

2 commits

  • When the timeout value passed to reservation_object_wait_timeout_rcu
    is zero, no wait should be done if the fences are not signaled.

    Return '1' for idle and '0' for busy if the specified timeout is '0'
    to keep consistent with the case of non-zero timeout.

    v2: call fence_put if not signaled in the case of timeout==0

    v3: switch to reservation_object_test_signaled_rcu

    Signed-off-by: Jammy Zhou
    Reviewed-by: Christian König
    Reviewed-by: Alex Deucher
    Reviewed-By: Maarten Lankhorst
    Signed-off-by: Sumit Semwal

    Jammy Zhou
     
  • Pull superh tracing fix from Steven Rostedt:
    "It's been reported that function tracing does not work on the sh
    architecture because gcc 4.8 for superH does not support -m32, and the
    recordmcount.pl script adds "-m32" when re-compiling the object files
    with the mcount locations.

    I was not able to reproduce this problem, as it seems that -m32 works
    fine for my cross compiler gcc 4.6.3, but I have to assume that -m32
    was deprecated somewhere between 4.6 and 4.8. As it still seems to
    compile fine without -m32, I have no reason not to add this patch, as
    having -m32 seems to cause trouble for others"

    * tag 'trace-sh-3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
    scripts/recordmcount.pl: There is no -m32 gcc option on Super-H anymore

    Linus Torvalds
     

21 Jan, 2015

10 commits

  • Pull sound fixes from Takashi Iwai:
    "This batch contains two fixes for FireWire lib module and a quirk for
    yet another Logitech WebCam. The former is the fixes for MIDI
    handling I forgot to pick up during the merge window. All the fixed
    code is pretty local and shouldn't give any regressions"

    * tag 'sound-3.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
    ALSA: usb-audio: Add mic volume fix quirk for Logitech Webcam C210
    ALSA: firewire-lib: limit the MIDI data rate
    ALSA: firewire-lib: remove rx_blocks_for_midi quirk

    Linus Torvalds
     
  • Pull drm fixes from Dave Airlie:
    "Just back from LCA + some days off, had some fixes from the past 2 weeks,

    Some amdkfd code removal for a feature that wasn't ready, otherwise
    just one fix for core helper sleeping, exynos, i915, and radeon fixes.

    I thought I had some sti fixes but they were already in, and it
    confused me for a few mins this morning"

    * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
    drm: fb helper should avoid sleeping in panic context
    drm/exynos: fix warning of vblank reference count
    drm/exynos: remove unnecessary runtime pm operations
    drm/exynos: fix reset codes for memory mapped hdmi phy
    drm/radeon: use rv515_ring_start on r5xx
    drm/radeon: add si dpm quirk list
    drm/radeon: don't print error on -ERESTARTSYS
    drm/i915: Fix mutex->owner inspection race under DEBUG_MUTEXES
    drm/i915: Ban Haswell from using RCS flips
    drm/i915: vlv: sanitize RPS interrupt mask during GPU idling
    drm/i915: fix HW lockup due to missing RPS IRQ workaround on GEN6
    drm/i915: gen9: fix RPS interrupt routing to CPU vs. GT
    drm/exynos: remove the redundant machine checking code
    drm/radeon: add a dpm quirk list
    drm/amdkfd: Fix sparse warning (different address space)
    drm/radeon: fix VM flush on CIK (v3)
    drm/radeon: fix VM flush on SI (v3)
    drm/radeon: fix VM flush on cayman/aruba (v3)
    drm/amdkfd: Drop interrupt SW ring buffer

    Linus Torvalds
     
  • Pull MFD fixes from Lee Jones:
    - Avoid platform ID collision in da9052
    - Skip caching volatile registers in tps65218
    - Use correct address base in tps65218
    - Repair deadlock on suspend in rtsx_usb

    * tag 'mfd-fixes-3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd:
    mfd: rtsx_usb: Fix runtime PM deadlock
    mfd: tps65218: Make INT1 our status_base register
    mfd: tps65218: Make INT[12] and STATUS registers volatile
    mfd: da9052-core: Fix platform-device id collision

    Linus Torvalds
     
  • …/linux into drm-fixes

    - Remove the interrupt SW ring buffer impl. as it is not used by any module
    in amdkfd.

    - Fix a sparse warning

    * tag 'drm-amdkfd-fixes-2015-01-13' of git://people.freedesktop.org/~gabbayo/linux:
    drm/amdkfd: Fix sparse warning (different address space)
    drm/amdkfd: Drop interrupt SW ring buffer

    Dave Airlie
     
  • misc i915 fixes

    * tag 'drm-intel-fixes-2015-01-15' of git://anongit.freedesktop.org/drm-intel:
    drm/i915: Fix mutex->owner inspection race under DEBUG_MUTEXES
    drm/i915: Ban Haswell from using RCS flips
    drm/i915: vlv: sanitize RPS interrupt mask during GPU idling
    drm/i915: fix HW lockup due to missing RPS IRQ workaround on GEN6
    drm/i915: gen9: fix RPS interrupt routing to CPU vs. GT

    Dave Airlie
     
  • There are still some places in the fb helper that need to avoid
    sleeping in panic context. Here's an example:

    [ 65.615496] bad: scheduling from the idle thread!
    [ 65.620747] CPU: 92 PID: 0 Comm: swapper/92 Tainted: G M E 3.18.0-rc4-7-default+ #20

    [ 65.630364] Hardware name: Intel Corporation BRICKLAND/BRICKLAND, BIOS
    BRHSXSD1.86B.0056.R01.1409242327 09/24/2014
    [ 65.641923] ffff88087f693d80 ffff88087f689878 ffffffff81566db9 0000000000000000
    [ 65.650226] ffff88087f693d80 ffff88087f689898 ffffffff810871ff ffff88046eb3e0d0
    [ 65.658527] ffff88087f693d80 ffff88087f6898c8 ffffffff8107c1fa 000000017f6898b8
    [ 65.666830] Call Trace:
    [ 65.669557] [] dump_stack+0x46/0x58
    [ 65.675994] [] dequeue_task_idle+0x2f/0x40
    [ 65.682412] [] dequeue_task+0x5a/0x80
    [ 65.688345] [] deactivate_task+0x23/0x30
    [ 65.694569] [] __schedule+0x580/0x7f0
    [ 65.700502] [] schedule_preempt_disabled+0x29/0x70
    [ 65.707696] [] __ww_mutex_lock_slowpath+0xb8/0x162
    [ 65.714891] [] __ww_mutex_lock+0x53/0x85
    [ 65.721125] [] drm_modeset_lock+0x3d/0x110 [drm]
    [ 65.728132] [] __drm_modeset_lock_all+0x8a/0x120 [drm]
    [ 65.735721] [] drm_modeset_lock_all+0x10/0x30 [drm]
    [ 65.743015] [] drm_fb_helper_pan_display+0x2f/0xf0 [drm_kms_helper]
    [ 65.751857] [] fb_pan_display+0xd1/0x1a0
    [ 65.758081] [] bit_update_start+0x20/0x50
    [ 65.764400] [] fbcon_switch+0x3a2/0x550
    [ 65.770528] [] redraw_screen+0x189/0x240
    [ 65.776750] [] fbcon_blank+0x20a/0x2d0
    [ 65.782778] [] ? erst_writer+0x209/0x330
    [ 65.789002] [] ? internal_add_timer+0x63/0x80
    [ 65.795710] [] ? mod_timer+0x127/0x1e0
    [ 65.801740] [] do_unblank_screen+0xa8/0x1d0
    [ 65.808255] [] unblank_screen+0x10/0x20
    [ 65.814381] [] bust_spinlocks+0x19/0x40
    [ 65.820508] [] panic+0x106/0x1f5
    [ 65.825955] [] mce_panic+0x2ac/0x2e0
    [ 65.831789] [] ? delay_tsc+0x4a/0x80
    [ 65.837625] [] do_machine_check+0xbaf/0xbf0
    [ 65.844138] [] ? intel_idle+0xc7/0x150
    [ 65.850166] [] machine_check+0x1f/0x30
    [ 65.856195] [] ? intel_idle+0xc7/0x150
    [ 65.862222] <> [] cpuidle_enter_state+0x55/0x170
    [ 65.869823] [] cpuidle_enter+0x17/0x20
    [ 65.875852] [] cpu_startup_entry+0x2d8/0x370
    [ 65.882467] [] start_secondary+0x159/0x180

    There's __drm_modeset_lock_all() which Daniel Vetter introduced for this
    purpose. We can leverage that without reinventing anything. This patch
    works with the latest kernel.

    Reviewed-by: Rob Clark
    Tested-by: Tony Luck
    Signed-off-by: Rui Wang
    Signed-off-by: Dave Airlie

    Rui Wang
     
  • …/daeinki/drm-exynos into drm-fixes

    This pull request includes below fixups,

    - Remove duplicated machine checking.
    . It seems that this code was added when you merged 'v3.18-rc7' into
    drm-next. commit id : e8115e79aa62b6ebdb3e8e61ca4092cc32938afc
    - Fix hdmiphy reset.
    . Exynos hdmi has two interfaces to control hdmyphy, one is I2C, other
    is APB bus - memory mapped I/O. So this patch makes hdmiphy reset
    to be done according to interfaces, I2C or APB bus.
    - And add some exception codes.

    * 'exynos-drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos:
    drm/exynos: fix warning of vblank reference count
    drm/exynos: remove unnecessary runtime pm operations
    drm/exynos: fix reset codes for memory mapped hdmi phy
    drm/exynos: remove the redundant machine checking code

    Dave Airlie
     
  • Some radeon fixes for 3.19:
    - GPUVM stability fixes
    - SI dpm quirks
    - Regression fixes

    * 'drm-fixes-3.19' of git://people.freedesktop.org/~agd5f/linux:
    drm/radeon: use rv515_ring_start on r5xx
    drm/radeon: add si dpm quirk list
    drm/radeon: don't print error on -ERESTARTSYS
    drm/radeon: add a dpm quirk list
    drm/radeon: fix VM flush on CIK (v3)
    drm/radeon: fix VM flush on SI (v3)
    drm/radeon: fix VM flush on cayman/aruba (v3)

    Dave Airlie
     
  • Pull libata fixes from Tejun Heo:

    - Bartlomiej will be co-maintaining PATA portion of libata. git
    workflow will stay the same.

    - sata_sil24 wasn't happy with tag ordered submission. An option to
    restore the old tag allocation behavior is implemented for sil24.

    - a very old race condition in PIO host state machine which can trigger
    BUG fixed.

    - other driver-specific changes

    * 'for-3.19-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata:
    libata: prevent HSM state change race between ISR and PIO
    libata: allow sata_sil24 to opt-out of tag ordered submission
    ata: pata_at91: depend on !ARCH_MULTIPLATFORM
    ahci: Remove Device ID for Intel Sunrise Point PCH
    ahci: Use dev_info() to inform about the lack of Device Sleep support
    libata: Whitelist SSDs that are known to properly return zeroes after TRIM
    sata_dwc_460ex: fix resource leak on error path
    ata: add MAINTAINERS entry for libata PATA drivers
    libata: clean up MAINTAINERS entries
    libata: export ata_get_cmd_descript()
    ahci_xgene: Fix the DMA state machine lockup for the ATA_CMD_PACKET PIO mode command.
    ahci_xgene: Fix the endianess issue in APM X-Gene SoC AHCI SATA controller driver.

    Linus Torvalds
     
  • Pull workqueue fix from Tejun Heo:
    "The xfs folks have been running into weird and very rare lockups for
    some time now. I didn't think this could have been from workqueue
    side because no one else was reporting it. This time, Eric had a
    kdump which we looked into and it turned out this actually was a
    workqueue bug and the bug has been there since the beginning of
    concurrency managed workqueue.

    A worker pool ensures forward progress of the workqueues associated
    with it by always having at least one worker reserved from executing
    work items. When the pool is under contention, the idle one tries to
    create more workers for the pool and if that doesn't succeed quickly
    enough, it calls the rescuers to the pool.

    This logic had a subtle race condition in an early exit path. When a
    worker invokes this manager function, the function may return %false
    indicating that the caller may proceed to executing work items either
    because another worker is already performing the role or conditions
    have changed and the pool is no longer under contention.

    The latter part depended on the assumption that whether more workers
    are necessary or not remains stable while the pool is locked; however,
    pool->nr_running (concurrency count) may change asynchronously and it
    getting bumped from zero asynchronously could send off the last idle
    worker to execute work items.

    The race window is fairly narrow, and, even when it gets triggered,
    the pool deadlocks iff if all work items get blocked on pending work
    items of the pool, which is highly unlikely but can be triggered by
    xfs.

    The patch removes the race window by removing the early exit path,
    which doesn't server any purpose anymore anyway"

    * 'for-3.19-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
    workqueue: fix subtle pool management issue which can stall whole worker_pool

    Linus Torvalds
     

20 Jan, 2015

20 commits

  • sd_set_power_mode() in derived module drivers/mmc/host/rtsx_usb_sdmmc.c
    acquires dev_mutex and then calls pm_runtime_get_sync() to make sure the
    device is awake while initializing a newly inserted card. Once it is
    called during suspending state and explicitly before rtsx_usb_suspend()
    acquires the same dev_mutex, both routine deadlock and further hang the
    driver because pm_runtime_get_sync() waits the pending PM operations.

    Fix this by using an empty suspend method. mmc_core always turns the
    LED off after a request is done and thus it is ok to remove the only
    rtsx_usb_turn_off_led() here.

    Cc: # v3.16+
    Fixes: 730876be2566 ("mfd: Add realtek USB card reader driver")
    Signed-off-by: Roger Tseng
    [Lee: Removed newly unused variable]
    Signed-off-by: Lee Jones

    Roger Tseng
     
  • If we don't tell regmap-irq that our first status
    register is at offset 1, it will try to read offset
    zero, which is the chipid register.

    Fixes: 44b4dc6 mfd: tps65218: Add driver for the TPS65218 PMIC
    Cc: # v3.15+
    Signed-off-by: Felipe Balbi
    Signed-off-by: Lee Jones

    Felipe Balbi
     
  • STATUS register can be modified by the HW, so we
    should bypass cache because of that.

    In the case of INT[12] registers, they are the ones
    that actually clear the IRQ source at the time they
    are read. If we rely on the cache for them, we will
    never be able to clear the interrupt, which will cause
    our IRQ line to be disabled due to IRQ throttling.

    Fixes: 44b4dc6 mfd: tps65218: Add driver for the TPS65218 PMIC
    Cc: # v3.15+
    Signed-off-by: Felipe Balbi
    Signed-off-by: Lee Jones

    Felipe Balbi
     
  • Allow multiple DA9052 regulators be registered by registering with
    PLATFORM_DEVID_AUTO instead of PLATFORM_DEVID_NONE.

    The subdevices are currently registered with PLATFORM_DEVID_NONE, which
    will cause a name collision on the platform bus when multiple regulators
    are registered:

    [ 0.128855] da9052-regulator da9052-regulator: invalid regulator ID specified
    [ 0.128973] da9052-regulator: probe of da9052-regulator failed with error -22
    [ 0.129148] ------------[ cut here ]------------
    [ 0.129200] WARNING: CPU: 0 PID: 1 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x5c/0x7c()
    [ 0.129233] sysfs: cannot create duplicate filename '/devices/platform/soc/60000000.aips/63fc8000.i2c/i2c-0/0-0048/da9052-regulator
    ...
    [ 0.132891] ------------[ cut here ]------------
    [ 0.132924] WARNING: CPU: 0 PID: 1 at lib/kobject.c:240 kobject_add_internal+0x24c/0x2cc()
    [ 0.132957] kobject_add_internal failed for da9052-regulator with -EEXIST, don't try to register things with the same name in the same directory.
    ...
    [ 0.137000] da9052 0-0048: mfd_add_devices failed: -17
    [ 0.138486] da9052: probe of 0-0048 failed with error -17

    Based on the fix done by Johan Hovold at commit b6684228726cc255 ("mfd:
    viperboard: Fix platform-device id collision").

    Tested on a imx53-qsb board, where multiple DA9053 regulators can be
    successfully probed.

    Signed-off-by: Fabio Estevam
    Signed-off-by: Lee Jones

    Fabio Estevam
     
  • Pull pin control fixes from Linus Walleij:
    "Here is a (hopefully final) slew of pin control fixes for the v3.19
    series. The deadlock fix is kind of serious and tagged for stable,
    the rest is business as usual.

    - Fix two deadlocks around the pin control mutexes, a long-standing
    issue that manifest itself in plug/unplug of pin controllers.
    (Tagged for stable.)

    - Handle an error path with zero functions in the Qualcomm pin
    controller.

    - Drop a bogus second GPIO chip added in the Lantiq driver.

    - Fix sudden IRQ loss on Rockchip pin controllers.

    - Register the GIT tree in MAINTAINERS"

    * tag 'pinctrl-v3.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
    pinctrl: MAINTAINERS: add git tree reference
    pinctrl: qcom: Don't iterate past end of function array
    pinctrl: lantiq: remove bogus of_gpio_chip_add
    pinctrl: Fix two deadlocks
    pinctrl: rockchip: Avoid losing interrupts when supporting both edges

    Linus Torvalds
     
  • Pull networking fixes from David Miller:

    1) Socket addresses returned in the error queue need to be fully
    initialized before being passed on to userspace, fix from Willem de
    Bruijn.

    2) Interrupt handling fixes to davinci_emac driver from Tony Lindgren.

    3) Fix races between receive packet steering and cpu hotplug, from Eric
    Dumazet.

    4) Allowing netlink sockets to subscribe to unknown multicast groups
    leads to crashes, don't allow it. From Johannes Berg.

    5) One to many socket races in SCTP fixed by Daniel Borkmann.

    6) Put in a guard against the mis-use of ipv6 atomic fragments, from
    Hagen Paul Pfeifer.

    7) Fix promisc mode and ethtool crashes in sh_eth driver, from Ben
    Hutchings.

    8) NULL deref and double kfree fix in sxgbe driver from Girish K.S and
    Byungho An.

    9) cfg80211 deadlock fix from Arik Nemtsov.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (36 commits)
    s2io: use snprintf() as a safety feature
    r8152: remove sram_read
    r8152: remove generic_ocp_read before writing
    bgmac: activate irqs only if there is nothing to poll
    bgmac: register napi before the device
    sh_eth: Fix ethtool operation crash when net device is down
    sh_eth: Fix promiscuous mode on chips without TSU
    ipv6: stop sending PTB packets for MTU < 1280
    net: sctp: fix race for one-to-many sockets in sendmsg's auto associate
    genetlink: synchronize socket closing and family removal
    genetlink: disallow subscribing to unknown mcast groups
    genetlink: document parallel_ops
    net: rps: fix cpu unplug
    net: davinci_emac: Add support for emac on dm816x
    net: davinci_emac: Fix ioremap for devices with MDIO within the EMAC address space
    net: davinci_emac: Fix incomplete code for getting the phy from device tree
    net: davinci_emac: Free clock after checking the frequency
    net: davinci_emac: Fix runtime pm calls for davinci_emac
    net: davinci_emac: Fix hangs with interrupts
    ip: zero sockaddr returned on error queue
    ...

    Linus Torvalds
     
  • Pull crypto fix from Herbert Xu:
    "This fixes a regression that arose from the change to add a crypto
    prefix to module names which was done to prevent the loading of
    arbitrary modules through the Crypto API.

    In particular, a number of modules were missing the crypto prefix
    which meant that they could no longer be autoloaded"

    * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
    crypto: add missing crypto module aliases

    Linus Torvalds
     
  • "sp->desc[i]" has 25 characters. "dev->name" has 15 characters. If we
    used all 15 characters then the sprintf() would overflow.

    I changed the "sprintf(sp->name, "%s Neterion %s"" to snprintf(), as
    well, even though it can't overflow just to be consistent.

    Signed-off-by: Dan Carpenter
    Signed-off-by: David S. Miller

    Dan Carpenter
     
  • Hayes Wang says:

    ====================
    r8152: couldn't read OCP_SRAM_DATA

    Read OCP_SRAM_DATA would read additional bytes and may let
    the hw abnormal.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Read OCP register 0xa43a~0xa43b would clear some flags which the hw
    would use, and it may let the device lost. However, the unit of
    reading is 4 bytes. That is, it would read 0xa438~0xa43b when calling
    sram_read() to read OCP_SRAM_DATA.

    Signed-off-by: Hayes Wang
    Signed-off-by: David S. Miller

    hayeswang
     
  • For ocp_write_word() and ocp_write_byte(), there is a generic_ocp_read()
    which is used to read the whole 4 byte data, keep the unchanged bytes,
    and modify the expected bytes. However, the "byen" could be used to
    determine which bytes of the 4 bytes to write, so the action could be
    removed.

    Signed-off-by: Hayes Wang
    Signed-off-by: David S. Miller

    hayeswang
     
  • Hauke Mehrtens says:

    ====================
    bgmac: some fixes to napi usage

    I compared the napi documentation with the bgmac driver and found some
    problems in that driver. These two patches should fix the problems.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • IRQs should only get activated when there is nothing to poll in the
    queue any more and to after every poll.

    Signed-off-by: Hauke Mehrtens
    Signed-off-by: David S. Miller

    Hauke Mehrtens
     
  • napi should get registered before the netdev and not after.

    Signed-off-by: Hauke Mehrtens
    Signed-off-by: David S. Miller

    Hauke Mehrtens
     
  • Ben Hutchings says:

    ====================
    sh_eth fixes

    I'm currently looking at Ethernet support on the R-Car H2 chip,
    reviewing and testing the sh_eth driver. Here are fixes for two fairly
    obvious bugs in the driver; I will probably have some more later.

    These are not tested on any of the other supported chips.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • The driver connects and disconnects the PHY device whenever the
    net device is brought up and down. The ethtool get_settings,
    set_settings and nway_reset operations will dereference a null
    or dangling pointer if called while it is down.

    I think it would be preferable to keep the PHY connected, but there
    may be good reasons not to.

    As an immediate fix for this bug:
    - Set the phydev pointer to NULL after disconnecting the PHY
    - Change those three operations to return -ENODEV while the PHY is
    not connected

    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Ben Hutchings
     
  • Currently net_device_ops::set_rx_mode is only implemented for
    chips with a TSU (multiple address table). However we do need
    to turn the PRM (promiscuous) flag on and off for other chips.

    - Remove the unlikely() from the TSU functions that we may safely
    call for chips without a TSU
    - Make setting of the MCT flag conditional on the tsu capability flag
    - Rename sh_eth_set_multicast_list() to sh_eth_set_rx_mode() and plumb
    it into both net_device_ops structures
    - Remove the previously-unreachable branch in sh_eth_rx_mode() that
    would otherwise reset the flags to defaults for non-TSU chips

    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Ben Hutchings
     
  • Reduce the attack vector and stop generating IPv6 Fragment Header for
    paths with an MTU smaller than the minimum required IPv6 MTU
    size (1280 byte) - called atomic fragments.

    See IETF I-D "Deprecating the Generation of IPv6 Atomic Fragments" [1]
    for more information and how this "feature" can be misused.

    [1] https://tools.ietf.org/html/draft-ietf-6man-deprecate-atomfrag-generation-00

    Signed-off-by: Fernando Gont
    Signed-off-by: Hagen Paul Pfeifer
    Acked-by: Hannes Frederic Sowa
    Signed-off-by: David S. Miller

    Hagen Paul Pfeifer
     
  • It is possible for ata_sff_flush_pio_task() to set ap->hsm_task_state to
    HSM_ST_IDLE in between the time __ata_sff_port_intr() checks for HSM_ST_IDLE
    and before it calls ata_sff_hsm_move() causing ata_sff_hsm_move() to BUG().

    This problem is hard to reproduce making this patch hard to verify, but this
    fix will prevent the race.

    I have not been able to reproduce the problem, but here is a crash dump from
    a 2.6.32 kernel.

    On examining the ata port's state, its hsm_task_state field has a value of HSM_ST_IDLE:

    crash> struct ata_port.hsm_task_state ffff881c1121c000
    hsm_task_state = 0

    Normally, this should not be possible as ata_sff_hsm_move() was called from ata_sff_host_intr(),
    which checks hsm_task_state and won't call ata_sff_hsm_move() if it has a HSM_ST_IDLE value.

    PID: 11053 TASK: ffff8816e846cae0 CPU: 0 COMMAND: "sshd"
    #0 [ffff88008ba03960] machine_kexec at ffffffff81038f3b
    #1 [ffff88008ba039c0] crash_kexec at ffffffff810c5d92
    #2 [ffff88008ba03a90] oops_end at ffffffff8152b510
    #3 [ffff88008ba03ac0] die at ffffffff81010e0b
    #4 [ffff88008ba03af0] do_trap at ffffffff8152ad74
    #5 [ffff88008ba03b50] do_invalid_op at ffffffff8100cf95
    #6 [ffff88008ba03bf0] invalid_op at ffffffff8100bf9b
    [exception RIP: ata_sff_hsm_move+317]
    RIP: ffffffff813a77ad RSP: ffff88008ba03ca0 RFLAGS: 00010097
    RAX: 0000000000000000 RBX: ffff881c1121dc60 RCX: 0000000000000000
    RDX: ffff881c1121dd10 RSI: ffff881c1121dc60 RDI: ffff881c1121c000
    RBP: ffff88008ba03d00 R8: 0000000000000000 R9: 000000000000002e
    R10: 000000000001003f R11: 000000000000009b R12: ffff881c1121c000
    R13: 0000000000000000 R14: 0000000000000050 R15: ffff881c1121dd78
    ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018
    #7 [ffff88008ba03d08] ata_sff_host_intr at ffffffff813a7fbd
    #8 [ffff88008ba03d38] ata_sff_interrupt at ffffffff813a821e
    #9 [ffff88008ba03d78] handle_IRQ_event at ffffffff810e6ec0
    --- ---
    [exception RIP: pipe_poll+48]
    RIP: ffffffff81192780 RSP: ffff880f26d459b8 RFLAGS: 00000246
    RAX: 0000000000000000 RBX: ffff880f26d459c8 RCX: 0000000000000000
    RDX: 0000000000000001 RSI: 0000000000000000 RDI: ffff881a0539fa80
    RBP: ffffffff8100bb8e R8: ffff8803b23324a0 R9: 0000000000000000
    R10: ffff880f26d45dd0 R11: 0000000000000008 R12: ffffffff8109b646
    R13: ffff880f26d45948 R14: 0000000000000246 R15: 0000000000000246
    ORIG_RAX: ffffffffffffff10 CS: 0010 SS: 0018
    RIP: 00007f26017435c3 RSP: 00007fffe020c420 RFLAGS: 00000206
    RAX: 0000000000000017 RBX: ffffffff8100b072 RCX: 00007fffe020c45c
    RDX: 00007f2604a3f120 RSI: 00007f2604a3f140 RDI: 000000000000000d
    RBP: 0000000000000000 R8: 00007fffe020e570 R9: 0101010101010101
    R10: 0000000000000000 R11: 0000000000000246 R12: 00007fffe020e5f0
    R13: 00007fffe020e5f4 R14: 00007f26045f373c R15: 00007fffe020e5e0
    ORIG_RAX: 0000000000000017 CS: 0033 SS: 002b

    Somewhere between the ata_sff_hsm_move() check and the ata_sff_host_intr() check, the value changed.
    On examining the other cpus to see what else was running, another cpu was running the error handler
    routines:

    PID: 326 TASK: ffff881c11014aa0 CPU: 1 COMMAND: "scsi_eh_1"
    #0 [ffff88008ba27e90] crash_nmi_callback at ffffffff8102fee6
    #1 [ffff88008ba27ea0] notifier_call_chain at ffffffff8152d515
    #2 [ffff88008ba27ee0] atomic_notifier_call_chain at ffffffff8152d57a
    #3 [ffff88008ba27ef0] notify_die at ffffffff810a154e
    #4 [ffff88008ba27f20] do_nmi at ffffffff8152b1db
    #5 [ffff88008ba27f50] nmi at ffffffff8152aaa0
    [exception RIP: _spin_lock_irqsave+47]
    RIP: ffffffff8152a1ff RSP: ffff881c11a73aa0 RFLAGS: 00000006
    RAX: 0000000000000001 RBX: ffff881c1121deb8 RCX: 0000000000000000
    RDX: 0000000000000246 RSI: 0000000000000020 RDI: ffff881c122612d8
    RBP: ffff881c11a73aa0 R8: ffff881c17083800 R9: 0000000000000000
    R10: 0000000000000000 R11: 0000000000000000 R12: ffff881c1121c000
    R13: 000000000000001f R14: ffff881c1121dd50 R15: ffff881c1121dc60
    ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0000
    --- ---
    #6 [ffff881c11a73aa0] _spin_lock_irqsave at ffffffff8152a1ff
    #7 [ffff881c11a73aa8] ata_exec_internal_sg at ffffffff81396fb5
    #8 [ffff881c11a73b58] ata_exec_internal at ffffffff81397109
    #9 [ffff881c11a73bd8] atapi_eh_request_sense at ffffffff813a34eb

    Before it tried to acquire a spinlock, ata_exec_internal_sg() called ata_sff_flush_pio_task().
    This function will set ap->hsm_task_state to HSM_ST_IDLE, and has no locking around setting this
    value. ata_sff_flush_pio_task() can then race with the interrupt handler and potentially set
    HSM_ST_IDLE at a fatal moment, which will trigger a kernel BUG.

    v2: Fixup comment in ata_sff_flush_pio_task()

    tj: Further updated comment. Use ap->lock instead of shost lock and
    use the [un]lock_irq variant instead of the irqsave/restore one.

    Signed-off-by: David Milburn
    Signed-off-by: Tejun Heo
    Cc: stable@vger.kernel.org

    David Jeffery
     
  • Compiling SH with gcc-4.8 fails due to the -m32 option not being
    supported.

    From http://buildd.debian-ports.org/status/fetch.php?pkg=linux&arch=sh4&ver=3.16.7-ckt4-1&stamp=1421425783

    CC init/main.o
    gcc-4.8: error: unrecognized command line option '-m32'
    ld: cannot find init/.tmp_mc_main.o: No such file or directory
    objcopy: 'init/.tmp_mx_main.o': No such file
    rm: cannot remove 'init/.tmp_mx_main.o': No such file or directory
    rm: cannot remove 'init/.tmp_mc_main.o': No such file or directory

    Link: http://lkml.kernel.org/r/1421537778-29001-1-git-send-email-kernel@mkarcher.dialup.fu-berlin.de
    Link: http://lkml.kernel.org/r/54BCBDD4.10102@physik.fu-berlin.de

    Cc: stable@vger.kernel.org
    Cc: Matt Fleming
    Reported-by: John Paul Adrian Glaubitz
    Signed-off-by: Michael Karcher
    Signed-off-by: Steven Rostedt

    Michael Karcher
     

19 Jan, 2015

5 commits

  • Ronny reports: https://bugzilla.kernel.org/show_bug.cgi?id=87101
    "Since commit 8a4aeec8d "libata/ahci: accommodate tag ordered
    controllers" the access to the harddisk on the first SATA-port is
    failing on its first access. The access to the harddisk on the
    second port is working normal.

    When reverting the above commit, access to both harddisks is working
    fine again."

    Maintain tag ordered submission as the default, but allow sata_sil24 to
    continue with the old behavior.

    Cc:
    Cc: Tejun Heo
    Reported-by: Ronny Hegewald
    Signed-off-by: Dan Williams
    Signed-off-by: Tejun Heo

    Dan Williams
     
  • Reference my pinctrl GIT tree @kernel.org

    Reported-by: Sergei Shtylyov
    Signed-off-by: Linus Walleij

    Linus Walleij
     
  • Timur reports that this code crashes if nfunctions is 0. Fix the
    loop iteration to only consider valid elements of the functions
    array.

    Reported-by: Timur Tabi
    Cc: Pramod Gurav
    Cc: Bjorn Andersson
    Cc: Ivan T. Ivanov
    Cc: Andy Gross
    Fixes: 327455817a92 "pinctrl: qcom: Add support for reset for apq8064"
    Signed-off-by: Stephen Boyd
    Signed-off-by: Linus Walleij

    Stephen Boyd
     
  • Pull GPIO fixes from Linus Walleij:
    "Here is a set of fixes that mainly appeared when Johan Hovold started
    exercising the removal path of the GPIO library, dealing with
    hotplugging of GPIO controllers. Details from tag:

    A slew of fixes dealing with some irritating bugs (non-regressions)
    that have been around forever in the GPIO subsystem, most of them also
    tagged for stable:

    - A large slew of fixes from Johan Hovold who is finally testing and
    reviewing the removal path of the GPIO drivers.

    - Fix of_get_named_gpiod_flags() so it works as expected.

    - Fix an IRQ handling bug in the crystalcove driver"

    * tag 'gpio-v3.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
    gpiolib: of: Correct error handling in of_get_named_gpiod_flags
    gpio: sysfs: fix gpio attribute-creation race
    gpio: sysfs: fix gpio device-attribute leak
    gpio: sysfs: fix gpio-chip device-attribute leak
    gpio: unregister gpiochip device before removing it
    gpio: fix sleep-while-atomic in gpiochip_remove
    gpio: fix memory leak and sleep-while-atomic
    gpio: clean up gpiochip_add error handling
    gpio: fix gpio-chip list corruption
    gpio: fix memory and reference leaks in gpiochip_add error path
    gpio: crystalcove: use handle_nested_irq

    Linus Torvalds
     
  • Pull input subsystem fixes from Dmitry Torokhov.

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
    Input: uinput - fix ioctl nr overflow for UI_GET_SYSNAME/VERSION
    Input: I8042 - add Acer Aspire 7738 to the nomux list
    Input: elantech - support new ICs types for version 4
    Input: i8042 - reset keyboard to fix Elantech touchpad detection
    MAINTAINERS: remove Dmitry Torokhov's alternate address

    Linus Torvalds
     

18 Jan, 2015

3 commits

  • Signed-off-by: Jason Lee Cragg
    Cc:
    Signed-off-by: Takashi Iwai

    Jason Lee Cragg
     
  • Prevented re-enabling the vblank interrupt by drm_vblank_off and
    drm_vblank_get from mixer_wait_for_vblank returns error after
    drm_vblank_off. We get below warnings without this error handling
    because vblank reference count is mismatched by above sequence.

    setting mode 1920x1080-60Hz@XR24 on connectors 16, crtc 13
    [ 19.900793] ------------[ cut here ]------------
    [ 19.903959] WARNING: CPU: 0 PID: 0 at drivers/gpu/drm/drm_irq.c:1072 exynos_drm_crtc_finish_pageflip+0xac/0xdc()
    [ 19.914076] Modules linked in:
    [ 19.917116] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.19.0-rc4-00040-g3d729789-dirty #46
    [ 19.925342] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
    [ 19.931437] [] (unwind_backtrace) from [] (show_stack+0x10/0x14)
    [ 19.939131] [] (show_stack) from [] (dump_stack+0x84/0xc4)
    [ 19.946329] [] (dump_stack) from [] (warn_slowpath_common+0x80/0xb0)
    [ 19.954382] [] (warn_slowpath_common) from [] (warn_slowpath_null+0x1c/0x24)
    [ 19.963132] [] (warn_slowpath_null) from [] (exynos_drm_crtc_finish_pageflip+0xac/0xdc)
    [ 19.972841] [] (exynos_drm_crtc_finish_pageflip) from [] (mixer_irq_handler+0xdc/0x104)
    [ 19.982546] [] (mixer_irq_handler) from [] (handle_irq_event_percpu+0x78/0x134)
    [ 19.991555] [] (handle_irq_event_percpu) from [] (handle_irq_event+0x3c/0x5c)
    [ 20.000395] [] (handle_irq_event) from [] (handle_fasteoi_irq+0xe0/0x1ac)
    [ 20.008885] [] (handle_fasteoi_irq) from [] (generic_handle_irq+0x2c/0x3c)
    [ 20.017463] [] (generic_handle_irq) from [] (__handle_domain_irq+0x7c/0xec)
    [ 20.026128] [] (__handle_domain_irq) from [] (gic_handle_irq+0x30/0x68)
    [ 20.034449] [] (gic_handle_irq) from [] (__irq_svc+0x40/0x74)
    [ 20.041893] Exception stack(0xc06fff68 to 0xc06fffb0)
    [ 20.046923] ff60: 00000000 00000000 000052f6 c001b460 c06fe000 c07064e8
    [ 20.055070] ff80: c04d743c c07392a2 c0739440 c06da340 ef7fca80 00000000 01000000 c06fffb0
    [ 20.063212] ffa0: c000f24c c000f250 60000013 ffffffff
    [ 20.068245] [] (__irq_svc) from [] (arch_cpu_idle+0x38/0x3c)
    [ 20.075611] [] (arch_cpu_idle) from [] (cpu_startup_entry+0x108/0x16c)
    [ 20.083846] [] (cpu_startup_entry) from [] (start_kernel+0x3a0/0x3ac)
    [ 20.091980] ---[ end trace 2c76ee0500489d1b ]---

    Signed-off-by: Joonyoung Shim
    Signed-off-by: Inki Dae

    Joonyoung Shim
     
  • In booting, we can see a below message.

    [ 3.241728] exynos-mixer 14450000.mixer: Unbalanced pm_runtime_enable!

    Already pm_runtime_enable is called by probe function. Remove
    pm_runtime_enable/disable from mixer_bind and mixer_unbind.

    Signed-off-by: Joonyoung Shim
    Signed-off-by: Inki Dae

    Joonyoung Shim