18 Feb, 2019

10 commits

  • Remove unused but set variables to clean up the code and avoid
    warning.

    Signed-off-by: Lucas A. M. Magalhães
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Lucas A. M. Magalhães
     
  • The capture compose rectangle was not getting updated when setting
    the source subdevice's source pad format. This causes the compose window
    to be zero (or not updated) at stream start unless the capture device
    format was set explicitly at the capture device node.

    Fix by moving the calculation of the capture compose rectangle to
    imx_media_mbus_fmt_to_pix_fmt(), and pass the rectangle to
    imx_media_capture_device_set_format().

    Fixes: 439d8186fb23 ("media: imx: add capture compose rectangle")

    Signed-off-by: Steve Longerbeam
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Steve Longerbeam
     
  • Add VB2_USERPTR to the vimc capture device.

    Signed-off-by: Hans Verkuil
    Acked-by: Helen Koike
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • A merge conflict rised when merging from -rc7. Fix it.

    In this specific case, we don't need the if anymore, as the
    work_run was moved to its rightful place (struct vim2m_ctx).

    Fixes: b3e64e5b0778 ("media: vim2m: use per-file handler work queue")
    Fixes: 240809ef6630 ("media: vim2m: only cancel work if it is for right context")
    Reviewed-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • The linked commit changed s_fmt/try_fmt to fail if num_planes is bogus.
    This, however, is against the spec, which mandates drivers
    to return a proper num_planes value, without an error.

    Replace the num_planes check and instead clamp it to a sane value,
    so we still make sure we don't overflow the planes array by accident.

    Fixes: 9048b2e15b11c5 ("media: v4l: ioctl: Validate num_planes before using it")

    Signed-off-by: Ezequiel Garcia
    Reviewed-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Ezequiel Garcia
     
  • Linux 5.0-rc7

    * tag 'v5.0-rc7': (1667 commits)
    Linux 5.0-rc7
    Input: elan_i2c - add ACPI ID for touchpad in Lenovo V330-15ISK
    Input: st-keyscan - fix potential zalloc NULL dereference
    Input: apanel - switch to using brightness_set_blocking()
    powerpc/64s: Fix possible corruption on big endian due to pgd/pud_present()
    efi/arm: Revert "Defer persistent reservations until after paging_init()"
    arm64, mm, efi: Account for GICv3 LPI tables in static memblock reserve table
    sunrpc: fix 4 more call sites that were using stack memory with a scatterlist
    include/linux/module.h: copy __init/__exit attrs to init/cleanup_module
    Compiler Attributes: add support for __copy (gcc >= 9)
    lib/crc32.c: mark crc32_le_base/__crc32c_le_base aliases as __pure
    auxdisplay: ht16k33: fix potential user-after-free on module unload
    x86/platform/UV: Use efi_runtime_lock to serialise BIOS calls
    i2c: bcm2835: Clear current buffer pointers and counts after a transfer
    i2c: cadence: Fix the hold bit setting
    drm: Use array_size() when creating lease
    dm thin: fix bug where bio that overwrites thin block ignores FUA
    Revert "exec: load_script: don't blindly truncate shebang string"
    Revert "gfs2: read journal in large chunks to locate the head"
    net: ethernet: freescale: set FEC ethtool regs version
    ...

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • Pull EFI fixes from Ingo Molnar:
    "This tree reverts a GICv3 commit (which was broken) and fixes it in
    another way, by adding a memblock build-time entries quirk for ARM64"

    * 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    efi/arm: Revert "Defer persistent reservations until after paging_init()"
    arm64, mm, efi: Account for GICv3 LPI tables in static memblock reserve table

    Linus Torvalds
     
  • Pull x86 fixes from Ingo Molnar:
    "Three changes:

    - An UV fix/quirk to pull UV BIOS calls into the efi_runtime_lock
    locking regime. (This done by aliasing __efi_uv_runtime_lock to
    efi_runtime_lock, which should make the quirk nature obvious and
    maintain the general policy that the EFI lock (name...) isn't
    exposed to drivers.)

    - Our version of MAGA: Make a.out Great Again.

    - Add a new Intel model name enumerator to an upstream header to help
    reduce dependencies going forward"

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/platform/UV: Use efi_runtime_lock to serialise BIOS calls
    x86/CPU: Add Icelake model number
    x86/a.out: Clear the dump structure initially

    Linus Torvalds
     
  • Pull i2c fixes from Wolfram Sang:
    "Two more driver bugfixes"

    * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
    i2c: bcm2835: Clear current buffer pointers and counts after a transfer
    i2c: cadence: Fix the hold bit setting

    Linus Torvalds
     
  • Pull input fixes from Dmitry Torokhov:

    - tweaks to Elan drivers (both PS/2 and I2C) to support new devices.
    Also revert of one of IDs as that device should really be driven by
    i2c-hid + hid-multitouch

    - a few drivers have been switched to set_brightness_blocking() call
    because they either were sleeping the their set_brightness()
    implementation or used workqueue but were not canceling it on unbind.

    - ps2-gpio and matrix_keypad needed to [properly] flush their works to
    avoid potential use-after-free on unbind.

    - other miscellaneous fixes.

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
    Input: elan_i2c - add ACPI ID for touchpad in Lenovo V330-15ISK
    Input: st-keyscan - fix potential zalloc NULL dereference
    Input: apanel - switch to using brightness_set_blocking()
    Revert "Input: elan_i2c - add ACPI ID for touchpad in ASUS Aspire F5-573G"
    Input: qt2160 - switch to using brightness_set_blocking()
    Input: matrix_keypad - use flush_delayed_work()
    Input: ps2-gpio - flush TX work when closing port
    Input: cap11xx - switch to using set_brightness_blocking()
    Input: elantech - enable 3rd button support on Fujitsu CELSIUS H780
    Input: bma150 - register input device after setting private data
    Input: pwm-vibra - stop regulator after disabling pwm, not before
    Input: pwm-vibra - prevent unbalanced regulator
    Input: snvs_pwrkey - allow selecting driver for i.MX 7D

    Linus Torvalds
     

17 Feb, 2019

5 commits

  • This adds ELAN0617 to the ACPI table to support Elan touchpad found in
    Lenovo V330-15ISK.

    Signed-off-by: Mauro Ciancio
    Cc: stable@vger.kernel.org
    Signed-off-by: Dmitry Torokhov

    Mauro Ciancio
     
  • This patch fixes the following static checker warning:

    drivers/input/keyboard/st-keyscan.c:156 keyscan_probe()
    error: potential zalloc NULL dereference: 'keypad_data->input_dev'

    Reported-by: Dan Carpenter
    Signed-off-by: Gabriel Fernandez
    Signed-off-by: Dmitry Torokhov

    Gabriel Fernandez
     
  • Now that LEDs core allows "blocking" flavor of "set brightness" method we
    can use it and get rid of private work item. As a bonus, we are no longer
    forgetting to cancel it when we unbind the driver.

    Reviewed-by: Sven Van Asbroeck
    Signed-off-by: Dmitry Torokhov

    Dmitry Torokhov
     
  • Pull ARM SoC fixes from Arnd Bergmann:
    "This week is a much smaller update, containing fixes only for TI OMAP,
    NXP i.MX and Rockchips platforms:

    omap:
    - omap4 had problems with lost timer interrupts
    - another IRQ handling issue with OMAP5
    - A workaround for a regression in the pwm-omap-dmtimer driver

    NXP i.MX:
    - eMMC was broken on the new imx8mq-evk board

    Rockchip:
    - a fix for new dtc graph warnings and a regulator fix for rock64
    - USB support broke on rk3328-rock64"

    * tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc:
    ARM: OMAP2+: fix lack of timer interrupts on CPU1 after hotplug
    arm64: dts: imx8mq: Fix boot from eMMC
    ARM: OMAP2+: Variable "reg" in function omap4_dsi_mux_pads() could be uninitialized
    ARM: dts: Configure clock parent for pwm vibra
    bus: ti-sysc: Fix timer handling with drop pm_runtime_irq_safe()
    arm64: dts: rockchip: enable usb-host regulators at boot on rk3328-rock64
    arm64: dts: rockchip: fix graph_port warning on rk3399 bob kevin and excavator
    ARM: OMAP5+: Fix inverted nirq pin interrupts with irq_set_type
    clocksource: timer-ti-dm: Fix pwm dmtimer usage of fck reparenting
    ARM: dts: rockchip: remove qos_cif1 from rk3188 power-domain

    Linus Torvalds
     
  • Pull auxdisplay fix from Miguel Ojeda:
    "Fix potential user-after-free on ht16k33 module unload. Reported by
    Sven Van Asbroeck"

    * tag 'auxdisplay-for-linus-v5.0-rc7' of git://github.com/ojeda/linux:
    auxdisplay: ht16k33: fix potential user-after-free on module unload

    Linus Torvalds
     

16 Feb, 2019

9 commits

  • This reverts commit eff896288872d687d9662000ec9ae11b6d61766f, which
    deferred the processing of persistent memory reservations to a point
    where the memory may have already been allocated and overwritten,
    defeating the purpose.

    Signed-off-by: Ard Biesheuvel
    Acked-by: Will Deacon
    Cc: Linus Torvalds
    Cc: Marc Zyngier
    Cc: Mike Rapoport
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/20190215123333.21209-3-ard.biesheuvel@linaro.org
    Signed-off-by: Ingo Molnar

    Ard Biesheuvel
     
  • Pull SCSI fixes from James Bottomley:
    "Two fairly small fixes: the qla one is a panic inducing use after free
    and the entropy fix may seem minor but it has had huge userspace
    impact thanks to an unrelated change in openssl that causes sshd to
    refuse logins until it has enough entropy for the session keys, which
    causes tens of minutes delay before the affected systems allow logins
    after reboot"

    * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
    scsi: qla2xxx: Fix panic from use after free in qla2x00_async_tm_cmd
    scsi: sd: fix entropy gathering for most rotational disks

    Linus Torvalds
     
  • On module unload/remove, we need to ensure that work does not run
    after we have freed resources. Concretely, cancel_delayed_work()
    may return while the callback function is still running.

    From kernel/workqueue.c:

    The work callback function may still be running on return,
    unless it returns true and the work doesn't re-arm itself.
    Explicitly flush or use cancel_delayed_work_sync() to wait on it.

    Link: https://lore.kernel.org/lkml/20190204220952.30761-1-TheSven73@googlemail.com/
    Reported-by: Sven Van Asbroeck
    Reviewed-by: Dmitry Torokhov
    Reviewed-by: Sven Van Asbroeck
    Acked-by: Robin van der Gracht
    Signed-off-by: Miguel Ojeda

    Miguel Ojeda
     
  • Pull block fixes from Jens Axboe:

    - Ensure we insert into the hctx dispatch list, if a request is marked
    as DONTPREP (Jianchao)

    - NVMe pull request, single missing unlock on error fix (Keith)

    - MD pull request, single fix for a potentially data corrupting issue
    (Nate)

    - Floppy check_events regression fix (Yufen)

    * tag 'for-linus-20190215' of git://git.kernel.dk/linux-block:
    md/raid1: don't clear bitmap bits on interrupted recovery.
    floppy: check_events callback should not return a negative number
    nvme-pci: add missing unlock for reset error
    blk-mq: insert rq with DONTPREP to hctx dispatch list when requeue

    Linus Torvalds
     
  • …device-mapper/linux-dm

    Pull device mapper fixes from Mike Snitzer:

    - Fix bug in DM crypt's sizing of its block integrity tag space,
    resulting in less memory use when DM crypt layers on DM integrity.

    - Fix a long-standing DM thinp crash consistency bug that was due to
    improper handling of FUA. This issue is specific to writes that fill
    an entire thinp block which needs to be allocated.

    * tag 'for-5.0/dm-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
    dm thin: fix bug where bio that overwrites thin block ignores FUA
    dm crypt: don't overallocate the integrity tag space

    Linus Torvalds
     
  • Pull MMC fixes from Ulf Hansson:
    "A couple of MMC fixes intended for v5.0-rc7.

    MMC core:
    - Fix deadlock bug for block I/O requests

    MMC host:
    - sunxi: Disable broken HS-DDR mode for H5 by default
    - sunxi: Avoid unsupported speed modes declared via DT
    - meson-gx: Restore interrupt name"

    * tag 'mmc-v5.0-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
    mmc: meson-gx: fix interrupt name
    mmc: block: handle complete_work on separate workqueue
    mmc: sunxi: Filter out unsupported modes declared in the device tree
    mmc: sunxi: Disable HS-DDR mode for H5 eMMC controller by default

    Linus Torvalds
     
  • Pull drm fixes from Dave Airlie:
    "Usual pull request, little larger than I'd like but nothing too
    strange in it. Willy found an bug in the lease ioctl calculations, but
    it's a drm master only ioctl which makes it harder to mess with.

    i915:
    - combo phy programming fix
    - opregion version check fix for VBT RVDA lookup
    - gem mmap ioctl race fix
    - fbdev hpd during suspend fix
    - array size bounds check fix in pmu

    amdgpu:
    - Vega20 psp fix
    - Add vrr range to debugfs for freesync debugging

    sched:
    - Scheduler race fix

    vkms:
    - license header fixups

    imx:
    - Fix CSI register offsets for i.MX51 and i.MX53.
    - Fix delayed page flip completion events on i.MX6QP due to
    unexpected behaviour of the PRE when issuing NOP buffer updates to
    the same buffer address.
    - Stop throwing errors for plane updates on disabled CRTCs when a
    userspace process is killed while a plane update is pending.
    - Add missing of_node_put cleanup in imx_ldb_bind"

    * tag 'drm-fixes-2019-02-15-1' of git://anongit.freedesktop.org/drm/drm:
    drm: Use array_size() when creating lease
    drm/amdgpu/psp11: TA firmware is optional (v3)
    drm/i915/opregion: rvda is relative from opregion base in opregion 2.1+
    drm/i915/opregion: fix version check
    drm/i915: Prevent a race during I915_GEM_MMAP ioctl with WC set
    drm/i915: Block fbdev HPD processing during suspend
    drm/i915/pmu: Fix enable count array size and bounds checking
    drm/i915/cnl: Fix CNL macros for Voltage Swing programming
    drm/i915/icl: combo port vswing programming changes per BSPEC
    drm/vkms: Fix license inconsistent
    drm/amd/display: Expose connector VRR range via debugfs
    drm/sched: Always trace the dependencies we wait on, to fix a race.
    gpu: ipu-v3: pre: don't trigger update if buffer address doesn't change
    gpu: ipu-v3: Fix CSI offsets for imx53
    drm/imx: imx-ldb: add missing of_node_puts
    gpu: ipu-v3: Fix i.MX51 CSI control registers offset
    drm/imx: ignore plane updates on disabled crtcs

    Linus Torvalds
     
  • Pull crypto fix from Herbert Xu:
    "This fixes a crash on resume in the ccree driver"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
    crypto: ccree - fix resume race condition on init

    Linus Torvalds
     
  • Pull networking fixes from David Miller:

    1) Fix MAC address setting in mac80211 pmsr code, from Johannes Berg.

    2) Probe SFP modules after being attached, from Russell King.

    3) Byte ordering bug in SMC rx_curs_confirmed code, from Ursula Braun.

    4) Revert some r8169 changes that are causing regressions, from Heiner
    Kallweit.

    5) Fix spurious connection timeouts in netfilter nat code, from Florian
    Westphal.

    6) SKB leak in tipc, from Hoang Le.

    7) Short packet checkum issue in mlx4, similar to a previous mlx5
    change, from Saeed Mahameed. The issue is that whilst padding bytes
    are usually zero, it is not guarateed and the hardware doesn't take
    the padding bytes into consideration when generating the checksum.

    8) Fix various races in cls_tcindex, from Cong Wang.

    9) Need to set stream ext to NULL before freeing in SCTP code, from Xin
    Long.

    10) Fix locking in phy_is_started, from Heiner Kallweit.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (54 commits)
    net: ethernet: freescale: set FEC ethtool regs version
    net: hns: Fix object reference leaks in hns_dsaf_roce_reset()
    mm: page_alloc: fix ref bias in page_frag_alloc() for 1-byte allocs
    net: phy: fix potential race in the phylib state machine
    net: phy: don't use locking in phy_is_started
    selftests: fix timestamping Makefile
    net: dsa: bcm_sf2: potential array overflow in bcm_sf2_sw_suspend()
    net: fix possible overflow in __sk_mem_raise_allocated()
    dsa: mv88e6xxx: Ensure all pending interrupts are handled prior to exit
    net: phy: fix interrupt handling in non-started states
    sctp: set stream ext to NULL after freeing it in sctp_stream_outq_migrate
    sctp: call gso_reset_checksum when computing checksum in sctp_gso_segment
    net/mlx5e: XDP, fix redirect resources availability check
    net/mlx5: Fix a compilation warning in events.c
    net/mlx5: No command allowed when command interface is not ready
    net/mlx5e: Fix NULL pointer derefernce in set channels error flow
    netfilter: nft_compat: use-after-free when deleting targets
    team: avoid complex list operations in team_nl_cmd_options_set()
    net_sched: fix two more memory leaks in cls_tcindex
    net_sched: fix a memory leak in cls_tcindex
    ...

    Linus Torvalds
     

15 Feb, 2019

13 commits

  • Calls into UV firmware must be protected against concurrency, expose the
    efi_runtime_lock to the UV platform, and use it to serialise UV BIOS
    calls.

    Signed-off-by: Hedi Berriche
    Signed-off-by: Borislav Petkov
    Reviewed-by: Ard Biesheuvel
    Reviewed-by: Russ Anderson
    Reviewed-by: Dimitri Sivanich
    Reviewed-by: Mike Travis
    Cc: Andy Shevchenko
    Cc: Bhupesh Sharma
    Cc: Darren Hart
    Cc: "H. Peter Anvin"
    Cc: Ingo Molnar
    Cc: linux-efi
    Cc: platform-driver-x86@vger.kernel.org
    Cc: stable@vger.kernel.org # v4.9+
    Cc: Steve Wahl
    Cc: Thomas Gleixner
    Cc: x86-ml
    Link: https://lkml.kernel.org/r/20190213193413.25560-5-hedi.berriche@hpe.com

    Hedi Berriche
     
  • …/git/tmlind/linux-omap into fixes

    SoC fixes for omaps for v5.0-rc cycle

    This series contains two SoC regression fixes and one uninitialized
    variable fix:

    - Fix inverted nirq pin handling for omap5 that started producing
    warnings with earlier GIC direction checks and took a while to
    understand and confirm. Basically there are two sys_nirq pins
    that are bypassing peripheral modules and inverted automatically
    by the SoC and need to be handled with a custom irq_set_type()

    - Recent ti-sysc changes caused a regression to the pwm-omap-dmtimer
    code where the device tree handling code for timer source clock
    gets confused. It looks like we can remove that code eventually,
    but for now we just drop a bogus pm_runtime_irq_safe() for the
    timers with the related quirks caused by pm_runtime_irq_safe(),
    and have the standard assigned-clocks and assigned-clock-parents
    deal with setting the source clock

    - Fix potentially uninitialized value for display init code if
    regmap_read() fails

    * tag 'omap-for-v5.0/fixes-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
    ARM: OMAP2+: Variable "reg" in function omap4_dsi_mux_pads() could be uninitialized
    ARM: dts: Configure clock parent for pwm vibra
    bus: ti-sysc: Fix timer handling with drop pm_runtime_irq_safe()
    ARM: OMAP5+: Fix inverted nirq pin interrupts with irq_set_type
    clocksource: timer-ti-dm: Fix pwm dmtimer usage of fck reparenting

    Arnd Bergmann
     
  • The driver's interrupt handler checks whether a message is currently
    being handled with the curr_msg pointer. When it is NULL, the interrupt
    is considered to be unexpected. Similarly, the i2c_start_transfer
    routine checks for the remaining number of messages to handle in
    num_msgs.

    However, these values are never cleared and always keep the message and
    number relevant to the latest transfer (which might be done already and
    the underlying message memory might have been freed).

    When an unexpected interrupt hits with the DONE bit set, the isr will
    then try to access the flags field of the curr_msg structure, leading
    to a fatal page fault.

    The msg_buf and msg_buf_remaining fields are also never cleared at the
    end of the transfer, which can lead to similar pitfalls.

    Fix these issues by introducing a cleanup function and always calling
    it after a transfer is finished.

    Fixes: e2474541032d ("i2c: bcm2835: Fix hang for writing messages larger than 16 bytes")
    Signed-off-by: Paul Kocialkowski
    Acked-by: Stefan Wahren
    Signed-off-by: Wolfram Sang

    Paul Kocialkowski
     
  • In case the hold bit is not needed we are carrying the old values.
    Fix the same by resetting the bit when not needed.

    Fixes the sporadic i2c bus lockups on National Instruments
    Zynq-based devices.

    Fixes: df8eb5691c48 ("i2c: Add driver for Cadence I2C controller")
    Reported-by: Kyle Roeschley
    Acked-by: Michal Simek
    Signed-off-by: Shubhrajyoti Datta
    Tested-by: Kyle Roeschley
    Signed-off-by: Wolfram Sang

    Shubhrajyoti Datta
     
  • Passing an object_count of sufficient size will make
    object_count * 4 wrap around to be very small, then a later function
    will happily iterate off the end of the object_ids array. Using
    array_size() will saturate at SIZE_MAX, the kmalloc() will fail and
    we'll return an -ENOMEM to the norty userspace.

    Fixes: 62884cd386b8 ("drm: Add four ioctls for managing drm mode object leases [v7]")
    Signed-off-by: Matthew Wilcox
    Acked-by: Kees Cook
    Acked-by: Daniel Vetter
    Cc: # v4.15+
    Signed-off-by: Dave Airlie

    Matthew Wilcox
     
  • amdgpu:
    - Vega20 psp fix
    - Add vrr range to debugfs for freesync debugging

    sched:
    - Scheduler race fix

    Signed-off-by: Dave Airlie
    From: Alex Deucher
    Link: https://patchwork.freedesktop.org/patch/msgid/20190213202958.3336-1-alexander.deucher@amd.com

    Dave Airlie
     
  • drm/i915 fixes for v5.0-rc7:
    - combo phy programming fix
    - opregion version check fix for VBT RVDA lookup
    - gem mmap ioctl race fix
    - fbdev hpd during suspend fix
    - array size bounds check fix in pmu

    Signed-off-by: Dave Airlie

    From: Jani Nikula
    Link: https://patchwork.freedesktop.org/patch/msgid/877ee3504b.fsf@intel.com

    Dave Airlie
     
  • drm-misc-fixes for v5.0:
    - Fix license inconsistency in vkms.

    Signed-off-by: Dave Airlie

    From: Maarten Lankhorst
    Link: https://patchwork.freedesktop.org/patch/msgid/812e2f53-d72a-8fba-6c8c-fde8f44cf141@linux.intel.com

    Dave Airlie
     
  • When provisioning a new data block for a virtual block, either because
    the block was previously unallocated or because we are breaking sharing,
    if the whole block of data is being overwritten the bio that triggered
    the provisioning is issued immediately, skipping copying or zeroing of
    the data block.

    When this bio completes the new mapping is inserted in to the pool's
    metadata by process_prepared_mapping(), where the bio completion is
    signaled to the upper layers.

    This completion is signaled without first committing the metadata. If
    the bio in question has the REQ_FUA flag set and the system crashes
    right after its completion and before the next metadata commit, then the
    write is lost despite the REQ_FUA flag requiring that I/O completion for
    this request must only be signaled after the data has been committed to
    non-volatile storage.

    Fix this by deferring the completion of overwrite bios, with the REQ_FUA
    flag set, until after the metadata has been committed.

    Cc: stable@vger.kernel.org
    Signed-off-by: Nikos Tsironis
    Acked-by: Joe Thornber
    Acked-by: Mikulas Patocka
    Signed-off-by: Mike Snitzer

    Nikos Tsironis
     
  • Currently the ethtool_regs version is set to 0 for FEC devices.

    Use this field to store the register dump version exposed by the
    kernel. The choosen version 2 corresponds to the kernel compile test:

    #if defined(CONFIG_M523x) || defined(CONFIG_M527x)
    || defined(CONFIG_M528x) || defined(CONFIG_M520x)
    || defined(CONFIG_M532x) || defined(CONFIG_ARM)
    || defined(CONFIG_ARM64) || defined(CONFIG_COMPILE_TEST)

    and version 1 corresponds to the opposite. Binaries of ethtool unaware
    of this version will dump the whole set as usual.

    Signed-off-by: Vivien Didelot
    Signed-off-by: David S. Miller

    Vivien Didelot
     
  • The of_find_device_by_node() takes a reference to the underlying device
    structure, we should release that reference.

    Signed-off-by: Huang Zijiang
    Signed-off-by: David S. Miller

    Huang Zijiang
     
  • Russell reported the following race in the phylib state machine
    (quoting from his mail):

    if (phy_polling_mode(phydev) && phy_is_started(phydev))
    phy_queue_state_machine(phydev, PHY_STATE_TIME);

    state = PHY_UP
    thread 0 thread 1
    phy_disconnect()
    +-phy_is_started()
    phy_is_started() |
    `-phy_stop()
    +-phydev->state = PHY_HALTED
    `-phy_stop_machine()
    `-cancel_delayed_work_sync()
    phy_queue_state_machine()
    `-mod_delayed_work()

    At this point, the phydev->state_queue() has been added back onto the
    system workqueue despite phy_stop_machine() having been called and
    cancel_delayed_work_sync() called on it.

    Fix this by protecting the complete operation in thread 0.

    Fixes: 2b3e88ea6528 ("net: phy: improve phy state checking")
    Reported-by: Russell King - ARM Linux admin
    Signed-off-by: Heiner Kallweit
    Reviewed-by: Florian Fainelli
    Signed-off-by: David S. Miller

    Heiner Kallweit
     
  • Russell suggested to remove the locking from phy_is_started() because
    the read is atomic anyway and actually the locking may be more
    misleading.

    Fixes: 2b3e88ea6528 ("net: phy: improve phy state checking")
    Suggested-by: Russell King - ARM Linux admin
    Signed-off-by: Heiner Kallweit
    Reviewed-by: Florian Fainelli
    Signed-off-by: David S. Miller

    Heiner Kallweit
     

14 Feb, 2019

3 commits

  • The value of ->num_ports comes from bcm_sf2_sw_probe() and it is less
    than or equal to DSA_MAX_PORTS. The ds->ports[] array is used inside
    the dsa_is_user_port() and dsa_is_cpu_port() functions. The ds->ports[]
    array is allocated in dsa_switch_alloc() and it has ds->num_ports
    elements so this leads to a static checker warning about a potential out
    of bounds read.

    Fixes: 8cfa94984c9c ("net: dsa: bcm_sf2: add suspend/resume callbacks")
    Signed-off-by: Dan Carpenter
    Reviewed-by: Vivien Didelot
    Signed-off-by: David S. Miller

    Dan Carpenter
     
  • The GPIO interrupt controller on the espressobin board only supports edge interrupts.
    If one enables the use of hardware interrupts in the device tree for the 88E6341, it is
    possible to miss an edge. When this happens, the INTn pin on the Marvell switch is
    stuck low and no further interrupts occur.

    I found after adding debug statements to mv88e6xxx_g1_irq_thread_work() that there is
    a race in handling device interrupts (e.g. PHY link interrupts). Some interrupts are
    directly cleared by reading the Global 1 status register. However, the device interrupt
    flag, for example, is not cleared until all the unmasked SERDES and PHY ports are serviced.
    This is done by reading the relevant SERDES and PHY status register.

    The code only services interrupts whose status bit is set at the time of reading its status
    register. If an interrupt event occurs after its status is read and before all interrupts
    are serviced, then this event will not be serviced and the INTn output pin will remain low.

    This is not a problem with polling or level interrupts since the handler will be called
    again to process the event. However, it's a big problem when using level interrupts.

    The fix presented here is to add a loop around the code servicing switch interrupts. If
    any pending interrupts remain after the current set has been handled, we loop and process
    the new set. If there are no pending interrupts after servicing, we are sure that INTn has
    gone high and we will get an edge when a new event occurs.

    Tested on espressobin board.

    Fixes: dc30c35be720 ("net: dsa: mv88e6xxx: Implement interrupt support.")
    Signed-off-by: John David Anglin
    Tested-by: Andrew Lunn
    Signed-off-by: David S. Miller

    John David Anglin
     
  • phylib enables interrupts before phy_start() has been called, and if
    we receive an interrupt in a non-started state, the interrupt handler
    returns IRQ_NONE. This causes problems with at least one Marvell chip
    as reported by Andrew.
    Fix this by handling interrupts the same as in phy_mac_interrupt(),
    basically always running the phylib state machine. It knows when it
    has to do something and when not.
    This change allows to handle interrupts gracefully even if they
    occur in a non-started state.

    Fixes: 2b3e88ea6528 ("net: phy: improve phy state checking")
    Reported-by: Andrew Lunn
    Signed-off-by: Heiner Kallweit
    Reviewed-by: Andrew Lunn
    Reviewed-by: Florian Fainelli
    Signed-off-by: David S. Miller

    Heiner Kallweit