04 Feb, 2017

6 commits

  • [ Upstream commit ea7a80858f57d8878b1499ea0f1b8a635cc48de7 ]

    Handle failure in lwtunnel_fill_encap adding attributes to skb.

    Fixes: 571e722676fe ("ipv4: support for fib route lwtunnel encap attributes")
    Fixes: 19e42e451506 ("ipv6: support for fib route lwtunnel encap attributes")
    Signed-off-by: David Ahern
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    David Ahern
     
  • [ Upstream commit 28e46a0f2e03ab4ed0e23cace1ea89a68c8c115b ]

    The event_data starts from address 0x00-0x0C and not from 0x08-0x014. This
    leads to duplication with other fields in the Event Queue Element such as
    sub-type, cqn and owner.

    Fixes: eda6500a987a0 ("mlxsw: Add PCI bus implementation")
    Signed-off-by: Elad Raz
    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Elad Raz
     
  • [ Upstream commit 400fc0106dd8c27ed84781c929c1a184785b9c79 ]

    During transmission the skb is checked for headroom in order to
    add vendor specific header. In case the skb needs to be re-allocated,
    skb_realloc_headroom() is called to make a private copy of the original,
    but doesn't release it. Current code assumes that the original skb is
    released during reallocation and only releases it at the error path
    which causes a memory leak.

    Fix this by adding the original skb release to the main path.

    Fixes: d003462a50de ("mlxsw: Simplify mlxsw_sx_port_xmit function")
    Signed-off-by: Arkadi Sharshevsky
    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Arkadi Sharshevsky
     
  • [ Upstream commit 36bf38d158d3482119b3e159c0619b3c1539b508 ]

    During transmission the skb is checked for headroom in order to
    add vendor specific header. In case the skb needs to be re-allocated,
    skb_realloc_headroom() is called to make a private copy of the original,
    but doesn't release it. Current code assumes that the original skb is
    released during reallocation and only releases it at the error path
    which causes a memory leak.

    Fix this by adding the original skb release to the main path.

    Fixes: 56ade8fe3fe1 ("mlxsw: spectrum: Add initial support for Spectrum ASIC")
    Signed-off-by: Arkadi Sharshevsky
    Reviewed-by: Ido Schimmel
    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Arkadi Sharshevsky
     
  • [ Upstream commit 0719e72ccb801829a3d735d187ca8417f0930459 ]

    The receive callback (in tasklet context) is using RCU to get reference
    to associated VF network device but this is not safe. RCU read lock
    needs to be held. Found by running with full lockdep debugging
    enabled.

    Fixes: f207c10d9823 ("hv_netvsc: use RCU to protect vf_netdev")
    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    stephen hemminger
     
  • [ Upstream commit 19c0f40d4fca3a47b8f784a627f0467f0138ccc8 ]

    Fix the hw rx checksum is always enabled, and the user couldn't switch
    it to sw rx checksum.

    Note that the RTL_VER_01 only support sw rx checksum only. Besides,
    the hw rx checksum for RTL_VER_02 is disabled after
    commit b9a321b48af4 ("r8152: Fix broken RX checksums."). Re-enable it.

    Signed-off-by: Hayes Wang
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    hayeswang
     

01 Feb, 2017

34 commits

  • Greg Kroah-Hartman
     
  • commit 4fc020d864647ea3ae8cb8f17d63e48e87ebd0bf upstream.

    The WaDisableLSQCROPERFforOCL workaround has the side effect of
    disabling an L3SQ optimization that has huge performance implications
    and is unlikely to be necessary for the correct functioning of usual
    graphic workloads. Userspace is free to re-enable the workaround on
    demand, and is generally in a better position to determine whether the
    workaround is necessary than the DRM is (e.g. only during the
    execution of compute kernels that rely on both L3 fences and HDC R/W
    requests).

    The same workaround seems to apply to BDW (at least to production
    stepping G1) and SKL as well (the internal workaround database claims
    that it does for all steppings, while the BSpec workaround table only
    mentions pre-production steppings), but the DRM doesn't do anything
    beyond whitelisting the L3SQCREG4 register so userspace can enable it
    when it sees fit. Do the same on KBL platforms.

    Improves performance of the GFXBench4 gl_manhattan31 benchmark by 60%,
    and gl_4 (AKA car chase) by 14% on a KBL GT2 running Mesa master --
    This is followed by a regression of 35% and 10% respectively for the
    same benchmarks and platform caused by my recent patch series
    switching userspace to use the dataport constant cache instead of the
    sampler to implement uniform pull constant loads, which caused us to
    hit more heavily the L3 cache (and on platforms other than KBL had the
    opposite effect of improving performance of the same two benchmarks).
    The overall effect on KBL of this change combined with the recent
    userspace change is respectively 4.6% and 2.6%. SynMark2 OglShMapPcf
    was affected by the constant cache changes (though it improved as it
    did on other platforms rather than regressing), but is not
    significantly affected by this patch (with statistical significance of
    5% and sample size 20).

    v2: Drop some more code to avoid unused variable warning.

    Fixes: 738fa1b3123f ("drm/i915/kbl: Add WaDisableLSQCROPERFforOCL")
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99256
    Signed-off-by: Francisco Jerez
    Cc: Matthew Auld
    Cc: Eero Tamminen
    Cc: Jani Nikula
    Cc: Mika Kuoppala
    Cc: beignet@lists.freedesktop.org
    Reviewed-by: Mika Kuoppala
    [Removed double Fixes tag]
    Signed-off-by: Mika Kuoppala
    Link: http://patchwork.freedesktop.org/patch/msgid/1484217894-20505-1-git-send-email-mika.kuoppala@intel.com
    (cherry picked from commit 8726f2faa371514fba2f594d799db95203dfeee0)
    Signed-off-by: Jani Nikula
    [ Francisco Jerez: Rebase on v4.9 branch. ]
    Signed-off-by: Francisco Jerez
    Signed-off-by: Greg Kroah-Hartman

    Francisco Jerez
     
  • commit 321027c1fe77f892f4ea07846aeae08cefbbb290 upstream.

    Di Shen reported a race between two concurrent sys_perf_event_open()
    calls where both try and move the same pre-existing software group
    into a hardware context.

    The problem is exactly that described in commit:

    f63a8daa5812 ("perf: Fix event->ctx locking")

    ... where, while we wait for a ctx->mutex acquisition, the event->ctx
    relation can have changed under us.

    That very same commit failed to recognise sys_perf_event_context() as an
    external access vector to the events and thereby didn't apply the
    established locking rules correctly.

    So while one sys_perf_event_open() call is stuck waiting on
    mutex_lock_double(), the other (which owns said locks) moves the group
    about. So by the time the former sys_perf_event_open() acquires the
    locks, the context we've acquired is stale (and possibly dead).

    Apply the established locking rules as per perf_event_ctx_lock_nested()
    to the mutex_lock_double() for the 'move_group' case. This obviously means
    we need to validate state after we acquire the locks.

    Reported-by: Di Shen (Keen Lab)
    Tested-by: John Dias
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Alexander Shishkin
    Cc: Arnaldo Carvalho de Melo
    Cc: Arnaldo Carvalho de Melo
    Cc: Jiri Olsa
    Cc: Kees Cook
    Cc: Linus Torvalds
    Cc: Min Chong
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Thomas Gleixner
    Cc: Vince Weaver
    Fixes: f63a8daa5812 ("perf: Fix event->ctx locking")
    Link: http://lkml.kernel.org/r/20170106131444.GZ3174@twins.programming.kicks-ass.net
    Signed-off-by: Ingo Molnar
    Signed-off-by: Greg Kroah-Hartman

    Peter Zijlstra
     
  • commit 3674534b775354516e5c148ea48f51d4d1909a78 upstream.

    When memory.move_charge_at_immigrate is enabled and precharges are
    depleted during move, mem_cgroup_move_charge_pte_range() will attempt to
    increase the size of the precharge.

    Prevent precharges from ever looping by setting __GFP_NORETRY. This was
    probably the intention of the GFP_KERNEL & ~__GFP_NORETRY, which is
    pointless as written.

    Fixes: 0029e19ebf84 ("mm: memcontrol: remove explicit OOM parameter in charge path")
    Link: http://lkml.kernel.org/r/alpine.DEB.2.10.1701130208510.69402@chino.kir.corp.google.com
    Signed-off-by: David Rientjes
    Acked-by: Michal Hocko
    Cc: Johannes Weiner
    Cc: Vladimir Davydov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    David Rientjes
     
  • commit 5a00b6c2438460b870a451f14593fc40d3c7edf6 upstream.

    The commit 1c6c69525b40 ("genirq: Reject bogus threaded irq requests")
    starts refusing misconfigured interrupt handlers. This makes
    intel_mid_powerbtn not working anymore.

    Add a mandatory flag to a threaded IRQ request in the driver.

    Fixes: 1c6c69525b40 ("genirq: Reject bogus threaded irq requests")
    Signed-off-by: Andy Shevchenko
    Signed-off-by: Greg Kroah-Hartman

    Andy Shevchenko
     
  • commit 63d762b88cb5510f2bfdb5112ced18cde867ae61 upstream.

    There is an off-by-one error so we don't unregister priv->pdev_mux[0].
    Also it's slightly simpler as a while loop instead of a for loop.

    Fixes: 58cbbee2391c ("x86/platform/mellanox: Introduce support for Mellanox systems platform")
    Signed-off-by: Dan Carpenter
    Acked-by: Vadim Pasternak
    Signed-off-by: Andy Shevchenko
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     
  • commit f7f6634d23830ff74335734fbdb28ea109c1f349 upstream.

    Once DMA API usage is enabled, it becomes apparent that virtio-mmio is
    inadvertently relying on the default 32-bit DMA mask, which leads to
    problems like rapidly exhausting SWIOTLB bounce buffers.

    Ensure that we set the appropriate 64-bit DMA mask whenever possible,
    with the coherent mask suitably limited for the legacy vring as per
    a0be1db4304f ("virtio_pci: Limit DMA mask to 44 bits for legacy virtio
    devices").

    Cc: Andy Lutomirski
    Cc: Michael S. Tsirkin
    Reported-by: Jean-Philippe Brucker
    Fixes: b42111382f0e ("virtio_mmio: Use the DMA API if enabled")
    Signed-off-by: Robin Murphy
    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Greg Kroah-Hartman

    Robin Murphy
     
  • commit 8a1f780e7f28c7c1d640118242cf68d528c456cd upstream.

    online_{kernel|movable} is used to change the memory zone to
    ZONE_{NORMAL|MOVABLE} and online the memory.

    To check that memory zone can be changed, zone_can_shift() is used.
    Currently the function returns minus integer value, plus integer
    value and 0. When the function returns minus or plus integer value,
    it means that the memory zone can be changed to ZONE_{NORNAL|MOVABLE}.

    But when the function returns 0, there are two meanings.

    One of the meanings is that the memory zone does not need to be changed.
    For example, when memory is in ZONE_NORMAL and onlined by online_kernel
    the memory zone does not need to be changed.

    Another meaning is that the memory zone cannot be changed. When memory
    is in ZONE_NORMAL and onlined by online_movable, the memory zone may
    not be changed to ZONE_MOVALBE due to memory online limitation(see
    Documentation/memory-hotplug.txt). In this case, memory must not be
    onlined.

    The patch changes the return type of zone_can_shift() so that memory
    online operation fails when memory zone cannot be changed as follows:

    Before applying patch:
    # grep -A 35 "Node 2" /proc/zoneinfo
    Node 2, zone Normal

    node_scanned 0
    spanned 8388608
    present 7864320
    managed 7864320
    # echo online_movable > memory4097/state
    # grep -A 35 "Node 2" /proc/zoneinfo
    Node 2, zone Normal

    node_scanned 0
    spanned 8388608
    present 8388608
    managed 8388608

    online_movable operation succeeded. But memory is onlined as
    ZONE_NORMAL, not ZONE_MOVABLE.

    After applying patch:
    # grep -A 35 "Node 2" /proc/zoneinfo
    Node 2, zone Normal

    node_scanned 0
    spanned 8388608
    present 7864320
    managed 7864320
    # echo online_movable > memory4097/state
    bash: echo: write error: Invalid argument
    # grep -A 35 "Node 2" /proc/zoneinfo
    Node 2, zone Normal

    node_scanned 0
    spanned 8388608
    present 7864320
    managed 7864320

    online_movable operation failed because of failure of changing
    the memory zone from ZONE_NORMAL to ZONE_MOVABLE

    Fixes: df429ac03936 ("memory-hotplug: more general validation of zone during online")
    Link: http://lkml.kernel.org/r/2f9c3837-33d7-b6e5-59c0-6ca4372b2d84@gmail.com
    Signed-off-by: Yasuaki Ishimatsu
    Reviewed-by: Reza Arbab
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Yasuaki Ishimatsu
     
  • commit 04ff5a095d662e0879f0eb04b9247e092210aeff upstream.

    The commit 658b476c742f ("pinctrl: baytrail: Add debounce configuration")
    implements debounce for Baytrail pin control, but seems wasn't tested properly.

    The register which keeps debounce value is separated from the configuration
    one. Writing wrong values to the latter will guarantee wrong behaviour of the
    driver and even might break something physically.

    Besides above there is missed case how to disable it, which is actually done
    through the bit in configuration register.

    Rectify implementation here by using proper register for debounce value.

    Fixes: 658b476c742f ("pinctrl: baytrail: Add debounce configuration")
    Cc: Cristina Ciocan
    Signed-off-by: Andy Shevchenko
    Acked-by: Mika Westerberg
    Signed-off-by: Linus Walleij
    Signed-off-by: Greg Kroah-Hartman

    Andy Shevchenko
     
  • commit df1539c25cce98e2ac69881958850c6535240707 upstream.

    Fix the pin-mux values for the MDC, MDIO, MDIO_INTL, PHYRSTL pins.

    Fixes: 1e359ab1285e ("pinctrl: uniphier: add Ethernet pin-mux settings")
    Signed-off-by: Masahiro Yamada
    Signed-off-by: Linus Walleij
    Signed-off-by: Greg Kroah-Hartman

    Masahiro Yamada
     
  • commit ecc8995363ee6231b32dad61c955b371b79cc4cf upstream.

    PADCFGLOCK (and PADCFGLOCK_TX) offset in Broxton actually starts at 0x060
    and not 0x090 as used in the driver. Fix it to use the correct offset.

    Signed-off-by: Mika Westerberg
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Linus Walleij
    Signed-off-by: Greg Kroah-Hartman

    Mika Westerberg
     
  • commit c739c0a7c3c2472d7562b8f802cdce44d2597c8b upstream.

    A rare randconfig build failure shows up in this driver when
    the CRC32 helper is not there:

    drivers/media/built-in.o: In function `s5k4ecgx_s_power':
    s5k4ecgx.c:(.text+0x9eb4): undefined reference to `crc32_le'

    This adds the 'select' that all other users of this function have.

    Fixes: 8b99312b7214 ("[media] Add v4l2 subdev driver for S5K4ECGX sensor")

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • commit 2d4b21e0a2913612274a69a3ba1bfee4cffc6e77 upstream.

    On UD QP completer tasklet is scheduled for each packet sent.

    If it is followed by a destroy_qp(), the kernel panic will
    happen as the completer tries to operate on a destroyed QP.

    Fixes: 8700e3e7c485 ("Soft RoCE driver")
    Signed-off-by: Yonatan Cohen
    Reviewed-by: Moni Shoua
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Doug Ledford
    Signed-off-by: Greg Kroah-Hartman

    Yonatan Cohen
     
  • commit f39f775218a7520e3700de2003c84a042c3b5972 upstream.

    The first argument of list_add_tail is the new item and the second
    is the head of the list. Fix the code to pass arguments in the
    right order, otherwise not all the rxe devices will be removed
    during teardown.

    Fixes: 8700e3e7c4857 ('Soft RoCE driver')
    Signed-off-by: Maor Gottlieb
    Reviewed-by: Moni Shoua
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Doug Ledford
    Signed-off-by: Greg Kroah-Hartman

    Maor Gottlieb
     
  • commit 828f6fa65ce7e80f77f5ab12942e44eb3d9d174e upstream.

    1. Release pid before enter odp flow
    2. Release pid when fail to allocate memory

    Fixes: 87773dd56d54 ("IB: ib_umem_release() should decrement mm->pinned_vm from ib_umem_get")
    Fixes: 8ada2c1c0c1d ("IB/core: Add support for on demand paging regions")
    Signed-off-by: Kenneth Lee
    Reviewed-by: Haggai Eran
    Reviewed-by: Leon Romanovsky
    Signed-off-by: Doug Ledford
    Signed-off-by: Greg Kroah-Hartman

    Kenneth Lee
     
  • commit 6d1d427a4e24c403b4adf928d61994bdaa0ca03a upstream.

    In intel_crtc_disable_noatomic(), bail on a failure to allocate an
    atomic state to avoid a NULL pointer dereference.

    Fixes: 4a80655827af ("drm/i915: Pass atomic state to crtc enable/disable functions")
    Cc: Maarten Lankhorst
    Cc: Daniel Vetter
    Cc: Daniel Vetter
    Cc: Jani Nikula
    Cc: intel-gfx@lists.freedesktop.org
    Signed-off-by: Ander Conselvan de Oliveira
    Reviewed-by: Ville Syrjälä
    Link: http://patchwork.freedesktop.org/patch/msgid/1484922525-6131-4-git-send-email-ander.conselvan.de.oliveira@intel.com
    (cherry picked from commit 31bb2ef97ea9db343348f9b5ccaa9bb6f48fc655)
    Signed-off-by: Jani Nikula
    Signed-off-by: Greg Kroah-Hartman

    Ander Conselvan de Oliveira
     
  • commit 3781bd6e7d64d5f5bea9fdee11ab9460a700c0e4 upstream.

    Parameters tile_size, tile_width and tile_height were passed in the
    wrong order to _intel_adjust_tile_offset() when calculating the rotated
    offsets.

    This doesn't fix any user visible bug, since for packed formats new
    and old offset are the same and the rotated offsets are within a tile
    before they are fed to _intel_adjust_tile_offset(). In that case, the
    offsets are unchanged. That is not true for planar formats, but those
    are currently not supported.

    Fixes: 66a2d927cb0e ("drm/i915: Make intel_adjust_tile_offset() work for linear buffers")
    Cc: Ville Syrjälä
    Cc: Sivakumar Thulasimani
    Cc: Daniel Vetter
    Cc: Jani Nikula
    Cc: intel-gfx@lists.freedesktop.org
    Signed-off-by: Ander Conselvan de Oliveira
    Reviewed-by: Ville Syrjälä
    Link: http://patchwork.freedesktop.org/patch/msgid/1484922525-6131-3-git-send-email-ander.conselvan.de.oliveira@intel.com
    (cherry picked from commit 46a1bd289507dfcc428fb9daf65421ed6be6af8b)
    Signed-off-by: Jani Nikula
    Signed-off-by: Greg Kroah-Hartman

    Ander Conselvan de Oliveira
     
  • commit 21d6e0bde50713922a6520ef84e5fd245b05d468 upstream.

    An error in the condition for avoiding the call to intel_hpd_poll_init()
    for valleyview and cherryview from intel_runtime_suspend() caused it to
    be called unconditionally. Fix it.

    Fixes: 19625e85c6ec ("drm/i915: Enable polling when we don't have hpd")
    Cc: Ville Syrjälä
    Cc: Daniel Vetter
    Cc: Lyude
    Cc: Daniel Vetter
    Cc: Jani Nikula
    Cc: intel-gfx@lists.freedesktop.org
    Signed-off-by: Ander Conselvan de Oliveira
    Reviewed-by: Ville Syrjälä
    Link: http://patchwork.freedesktop.org/patch/msgid/1484922525-6131-2-git-send-email-ander.conselvan.de.oliveira@intel.com
    (cherry picked from commit 04313b00b79405f86d815100f85c47a2ee5b8ca0)
    Signed-off-by: Jani Nikula
    Signed-off-by: Greg Kroah-Hartman

    Ander Conselvan de Oliveira
     
  • commit c34f078675f505c4437919bb1897b1351f16a050 upstream.

    In the path where intel_crt_detect_ddc() detects a CRT, if would return
    true without freeing the edid.

    Fixes: a2bd1f541f19 ("drm/i915: check whether we actually received an edid in detect_ddc")
    Cc: Chris Wilson
    Cc: Daniel Vetter
    Cc: Daniel Vetter
    Cc: Jani Nikula
    Cc: intel-gfx@lists.freedesktop.org
    Signed-off-by: Ander Conselvan de Oliveira
    Reviewed-by: Ville Syrjälä
    Reviewed-by: Jani Nikula
    Link: http://patchwork.freedesktop.org/patch/msgid/1484922525-6131-1-git-send-email-ander.conselvan.de.oliveira@intel.com
    (cherry picked from commit c96b63a6a7ac4bd670ec2e663793a9a31418b790)
    Signed-off-by: Jani Nikula
    Signed-off-by: Greg Kroah-Hartman

    Ander Conselvan de Oliveira
     
  • commit 27892bbdc9233f33bf0f44e08aab8f12e0dec142 upstream.

    The .disable_display parameter was causing a fatal crash when fbdev
    was dereferenced during driver init.

    V1: protection in i915_drv.c
    V2: Moved protection to intel_fbdev.c

    Fixes: 43cee314345a ("drm/i915/fbdev: Limit the global async-domain synchronization")
    Testcase: igt/drv_module_reload/basic-no-display
    Cc: Chris Wilson
    Signed-off-by: Clint Taylor
    Link: http://patchwork.freedesktop.org/patch/msgid/1484775523-29428-1-git-send-email-clinton.a.taylor@intel.com
    Reviewed-by: Chris Wilson
    Cc: Lukas Wunner
    Cc: Daniel Vetter
    Cc: Jani Nikula
    Signed-off-by: Chris Wilson
    (cherry picked from commit 5b8cd0755f8a06a851c436a013e7be0823fb155a)
    Signed-off-by: Jani Nikula
    Signed-off-by: Greg Kroah-Hartman

    Clint Taylor
     
  • commit e88893fea17996018b2d68a22e677ea04f3baadf upstream.

    Missed when rebasing patches, I failed to set ret to zero before
    starting the unbind loop (which depends upon ret being zero).

    Reported-by: Matthew Auld
    Fixes: 9332f3b1b99a ("drm/i915: Combine loops within i915_gem_evict_something")
    Signed-off-by: Chris Wilson
    Cc: Matthew Auld
    Link: http://patchwork.freedesktop.org/patch/msgid/20170105155940.10033-1-chris@chris-wilson.co.uk
    Reviewed-by: Matthew Auld
    (cherry picked from commit 121dfbb2a2ef1c5f49e15c38ccc47ff0beb59446)
    Signed-off-by: Jani Nikula
    Signed-off-by: Greg Kroah-Hartman

    Chris Wilson
     
  • commit 79d6205a3f741c9fb89cfc47dfa0eddb1526726d upstream.

    The s_stream() handler incorrectly writes the whole MISC_CTL register to
    enable or disable the outputs, overriding the output pinmuxing
    configuration. Fix it to only touch the output enable bits.

    The CONF_SHARED_PIN register is also written by the same function,
    resulting in muxing the INTREQ signal instead of the VBLK/GPCL signal on
    the INTREQ/GPCL/VBLK pin. As the driver doesn't support interrupts this
    is obviously incorrect, and breaks operation on other devices. Fix it by
    removing the write.

    Signed-off-by: Laurent Pinchart
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Laurent Pinchart
     
  • commit b4b2de386bbb6589d81596999d4a924928dc119b upstream.

    The FID/GLCO/VLK/HVLK and INTREQ/GPCL/VBLK pins are muxed differently
    depending on whether the input is an S-Video or composite signal. The
    comment that explains the logic doesn't reflect the code. It appears
    that the comment is incorrect, as disabling the output data bus in
    composite mode makes no sense. Update the comment to match the code.

    While at it define macros for the MISC_CTL register bits, the code is
    too confusing with numerical values.

    Signed-off-by: Laurent Pinchart
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Laurent Pinchart
     
  • commit aff808e813fc2d311137754165cf53d4ee6ddcc2 upstream.

    The tvp5150 doesn't support format setting through the subdev pad API
    and thus implements the set format handler as a get format operation.
    The single handler, tvp5150_fill_fmt(), resets the device by calling
    tvp5150_reset(). This causes malfunction as the device can be reset at
    will, possibly from userspace when the subdev userspace API is enabled.

    The reset call was added in commit ec2c4f3f93cb ("[media] media:
    tvp5150: Add mbus_fmt callbacks"), probably as an attempt to set the
    device to a known state before detecting the current TV standard.
    However, the get format handler doesn't access the hardware to get the
    TV standard since commit 963ddc63e20d ("[media] media: tvp5150: Add
    cropping support"). There is thus no need to reset the device when
    getting the format.

    However, removing the tvp5150_reset() from the get/set format handlers
    results in the function not being called at all if the bridge driver
    doesn't use the .reset() operation. The operation is nowadays abused and
    shouldn't be used, so shouldn't expect bridge drivers to call it. To
    make sure the device is properly initialize, move the reset call from
    the format handlers to the probe function.

    Signed-off-by: Laurent Pinchart
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Laurent Pinchart
     
  • commit 48775cb73c2e26b7ca9d679875a6e570c8b8e124 upstream.

    commit 73d5c5c864f4 ("[media] pctv452e: don't do DMA on stack") caused
    a NULL pointer dereference which occurs when dvb_usb_init()
    calls dvb_usb_device_power_ctrl() for the first time, before the
    frontend has been attached. It also caused a recursive deadlock because
    tt3650_ci_msg_locked() has already locked the mutex.

    So, partially revert it, but move the buffer to the heap
    (DMA capable), not to the stack (may not be DMA capable).
    Instead of sharing one buffer which needs mutex protection,
    do a new heap allocation for each call.

    Fixes: commit 73d5c5c864f4 ("[media] pctv452e: don't do DMA on stack")

    Signed-off-by: Max Kellermann
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Max Kellermann
     
  • commit c12a67fec8d99bb554e8d4e99120d418f1a39c87 upstream.

    Commit ad61a4c7a9b7 ("iw_cxgb4: don't block in destroy_qp awaiting
    the last deref") introduced a bug where the RDMA QP EQ queue memory
    (and QIDs) are possibly freed before the underlying connection has been
    fully shutdown. The result being a possible DMA read issued by HW after
    the queue memory has been unmapped and freed. This results in possible
    WR corruption in the worst case, system bus errors if an IOMMU is in use,
    and SGE "bad WR" errors reported in the very least. The fix is to defer
    unmap/free of queue memory and QID resources until the QP struct has
    been fully dereferenced. To do this, the c4iw_ucontext must also be kept
    around until the last QP that references it is fully freed. In addition,
    since the last QP deref can happen in an IRQ disabled context, we need
    a new workqueue thread to do the final unmap/free of the EQ queue memory.

    Fixes: ad61a4c7a9b7 ("iw_cxgb4: don't block in destroy_qp awaiting the last deref")
    Signed-off-by: Steve Wise
    Signed-off-by: Doug Ledford
    Signed-off-by: Greg Kroah-Hartman

    Steve Wise
     
  • commit c929ea0b910355e1876c64431f3d5802f95b3d75 upstream.

    After removing sunrpc module, I get many kmemleak information as,
    unreferenced object 0xffff88003316b1e0 (size 544):
    comm "gssproxy", pid 2148, jiffies 4294794465 (age 4200.081s)
    hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    backtrace:
    [] kmemleak_alloc+0x4a/0xa0
    [] kmem_cache_alloc+0x15e/0x1f0
    [] ida_pre_get+0xaa/0x150
    [] ida_simple_get+0xad/0x180
    [] nlmsvc_lookup_host+0x4ab/0x7f0 [lockd]
    [] lockd+0x4d/0x270 [lockd]
    [] param_set_timeout+0x55/0x100 [lockd]
    [] svc_defer+0x114/0x3f0 [sunrpc]
    [] svc_defer+0x2d7/0x3f0 [sunrpc]
    [] rpc_show_info+0x8a/0x110 [sunrpc]
    [] proc_reg_write+0x7f/0xc0
    [] __vfs_write+0xdf/0x3c0
    [] vfs_write+0xef/0x240
    [] SyS_write+0xad/0x130
    [] entry_SYSCALL_64_fastpath+0x1a/0xa9
    [] 0xffffffffffffffff

    I found, the ida information (dynamic memory) isn't cleanup.

    Signed-off-by: Kinglong Mee
    Fixes: 2f048db4680a ("SUNRPC: Add an identifier for struct rpc_clnt")
    Signed-off-by: Trond Myklebust
    Signed-off-by: Greg Kroah-Hartman

    Kinglong Mee
     
  • commit a430607b2ef7c3be090f88c71cfcb1b3988aa7c0 upstream.

    Some nfsv4.0 servers may return a mode for the verifier following an open
    with EXCLUSIVE4 createmode, but this does not mean the client should skip
    setting the mode in the following SETATTR. It should only do that for
    EXCLUSIVE4_1 or UNGAURDED createmode.

    Fixes: 5334c5bdac92 ("NFS: Send attributes in OPEN request for NFS4_CREATE_EXCLUSIVE4_1")
    Signed-off-by: Benjamin Coddington
    Signed-off-by: Trond Myklebust
    Signed-off-by: Greg Kroah-Hartman

    Benjamin Coddington
     
  • commit 8ac092519ad91931c96d306c4bfae2c6587c325f upstream.

    We cannot call nfs4_handle_exception() without first ensuring that the
    slot has been freed. If not, we end up deadlocking with the process
    waiting for recovery to complete, and recovery waiting for the slot
    table to drain.

    Fixes: 2e80dbe7ac51 ("NFSv4.1: Close callback races for OPEN, LAYOUTGET...")
    Signed-off-by: Trond Myklebust
    Signed-off-by: Greg Kroah-Hartman

    Trond Myklebust
     
  • commit 059aa734824165507c65fd30a55ff000afd14983 upstream.

    Xuan Qi reports that the Linux NFSv4 client failed to lock a file
    that was migrated. The steps he observed on the wire:

    1. The client sent a LOCK request to the source server
    2. The source server replied NFS4ERR_MOVED
    3. The client switched to the destination server
    4. The client sent the same LOCK request to the destination
    server with a bumped lock sequence ID
    5. The destination server rejected the LOCK request with
    NFS4ERR_BAD_SEQID

    RFC 3530 section 8.1.5 provides a list of NFS errors which do not
    bump a lock sequence ID.

    However, RFC 3530 is now obsoleted by RFC 7530. In RFC 7530 section
    9.1.7, this list has been updated by the addition of NFS4ERR_MOVED.

    Reported-by: Xuan Qi
    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust
    Signed-off-by: Greg Kroah-Hartman

    Chuck Lever
     
  • commit 2ad5d52d42810bed95100a3d912679d8864421ec upstream.

    In swab.h the "#if BITS_PER_LONG > 32" breaks compiling userspace programs if
    BITS_PER_LONG is #defined by userspace with the sizeof() compiler builtin.

    Solve this problem by using __BITS_PER_LONG instead. Since we now
    #include asm/bitsperlong.h avoid further potential userspace pollution
    by moving the #define of SHIFT_PER_LONG to bitops.h which is not
    exported to userspace.

    This patch unbreaks compiling qemu on hppa/parisc.

    Signed-off-by: Helge Deller
    Signed-off-by: Greg Kroah-Hartman

    Helge Deller
     
  • commit 9aed02feae57bf7a40cb04ea0e3017cb7a998db4 upstream.

    After emulating an unaligned access in delay slot of a branch, we
    pretend as the delay slot never happened - so return back to actual
    branch target (or next PC if branch was not taken).

    Curently we did this by handling STATUS32.DE, we also need to clear the
    BTA.T bit, which is disregarded when returning from original misaligned
    exception, but could cause weirdness if it took the interrupt return
    path (in case interrupt was acive too)

    One ARC700 customer ran into this when enabling unaligned access fixup
    for kernel mode accesses as well

    Signed-off-by: Vineet Gupta
    Signed-off-by: Greg Kroah-Hartman

    Vineet Gupta
     
  • commit 36425cd67052e3becf325fd4d3ba5691791ef7e4 upstream.

    commit 3c7c7a2fc8811bc ("ARC: Don't use "+l" inline asm constraint")
    modified the inline assembly to setup LP_COUNT register manually and NOT
    rely on gcc to do it (with the +l inline assembler contraint hint, now
    being retired in the compiler)

    However the fix was flawed as we didn't add LP_COUNT to asm clobber list,
    meaning gcc doesn't know that LP_COUNT or zero-delay-loops are in action
    in the inline asm.

    This resulted in some fun - as nested ZOL loops were being generared

    | mov lp_count,250000 ;16 # tmp235,
    | lp .L__GCC__LP14 #
    Signed-off-by: Greg Kroah-Hartman

    Vineet Gupta
     
  • commit befa60113ce7ea270cb51eada28443ca2756f480 upstream.

    In order to make the driver work with the common clock framework, this
    patch converts the clk_enable()/clk_disable() to
    clk_prepare_enable()/clk_disable_unprepare().

    Also add error checking for clk_prepare_enable().

    Signed-off-by: Yegor Yefremov
    Signed-off-by: Marc Kleine-Budde
    Signed-off-by: Greg Kroah-Hartman

    Yegor Yefremov