04 Oct, 2017

7 commits

  • In testing I found handle passed to zs_map_object in __zram_bvec_read is
    NULL so eh kernel goes oops in pin_object().

    The reason is there is no routine to check the slot's freeing after
    getting the slot's lock. This patch fixes it.

    [minchan@kernel.org: v2]
    Link: http://lkml.kernel.org/r/1505887347-10881-1-git-send-email-minchan@kernel.org
    Link: http://lkml.kernel.org/r/1505788488-26723-1-git-send-email-minchan@kernel.org
    Fixes: 1f7319c74275 ("zram: partial IO refactoring")
    Signed-off-by: Minchan Kim
    Reviewed-by: Sergey Senozhatsky
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Minchan Kim
     
  • Locking of config and doorbell operations should be done only if the
    underlying hardware requires it.

    This patch removes the global spinlocks from the rapidio subsystem and
    moves them to the mport drivers (fsl_rio and tsi721), only to the
    necessary places. For example, local config space read and write
    operations (lcread/lcwrite) are atomic in all existing drivers, so there
    should be no need for locking, while the cread/cwrite operations which
    generate maintenance transactions need to be synchronized with a lock.

    Later, each driver could chose to use a per-port lock instead of a
    global one, or even more granular locking.

    Link: http://lkml.kernel.org/r/20170824113023.GD50104@nokia.com
    Signed-off-by: Ioan Nicu
    Signed-off-by: Frank Kunz
    Acked-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Michael Ellerman
    Cc: Nicholas Piggin
    Cc: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ioan Nicu
     
  • Drop the global lru lock in isolate callback before calling
    zap_page_range which calls cond_resched, and re-acquire the global lru
    lock before returning. Also change return code to LRU_REMOVED_RETRY.

    Use mmput_async when fail to acquire mmap sem in an atomic context.

    Fix "BUG: sleeping function called from invalid context"
    errors when CONFIG_DEBUG_ATOMIC_SLEEP is enabled.

    Also restore mmput_async, which was initially introduced in commit
    ec8d7c14ea14 ("mm, oom_reaper: do not mmput synchronously from the oom
    reaper context"), and was removed in commit 212925802454 ("mm: oom: let
    oom_reap_task and exit_mmap run concurrently").

    Link: http://lkml.kernel.org/r/20170914182231.90908-1-sherryy@android.com
    Fixes: f2517eb76f1f2 ("android: binder: Add global lru shrinker to binder")
    Signed-off-by: Sherry Yang
    Signed-off-by: Greg Kroah-Hartman
    Reported-by: Kyle Yan
    Acked-by: Arve Hjønnevåg
    Acked-by: Michal Hocko
    Cc: Martijn Coenen
    Cc: Todd Kjos
    Cc: Riley Andrews
    Cc: Ingo Molnar
    Cc: Vlastimil Babka
    Cc: Hillf Danton
    Cc: Peter Zijlstra
    Cc: Andrea Arcangeli
    Cc: Thomas Gleixner
    Cc: Andy Lutomirski
    Cc: Oleg Nesterov
    Cc: Hoeun Ryu
    Cc: Christopher Lameter
    Cc: Vegard Nossum
    Cc: Frederic Weisbecker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sherry Yang
     
  • Pull libata fixes from Tejun Heo:
    "Nothing too interesting.

    Arnd's gcc-7 warning fixes that slipped through the cracks for two
    release cycles (my bad), and two minor low level driver updates"

    * 'for-4.14-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata:
    ahci: don't ignore result code of ahci_reset_controller()
    ata_piix: Add Fujitsu-Siemens Lifebook S6120 to short cable IDs
    ata: avoid gcc-7 warning in ata_timing_quantize

    Linus Torvalds
     
  • Pull USB fixes from Greg KH:
    "Here are a number of USB fixes for 4.14-rc4 to resolved reported
    issues.

    There's a bunch of stuff in here based on the great work Andrey
    Konovalov is doing in fuzzing the USB stack. Lots of bug fixes when
    dealing with corrupted USB descriptors that we've never seen in
    "normal" operation, but is now ensuring the stack is much more
    hardened overall.

    There's also the usual XHCI and gadget driver fixes as well, and a
    build error fix, and a few other minor things, full details in the
    shortlog.

    All of these have been in linux-next with no reported issues"

    * tag 'usb-4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (38 commits)
    usb: dwc3: of-simple: Add compatible for Spreadtrum SC9860 platform
    usb: gadget: udc: atmel: set vbus irqflags explicitly
    usb: gadget: ffs: handle I/O completion in-order
    usb: renesas_usbhs: fix usbhsf_fifo_clear() for RX direction
    usb: renesas_usbhs: fix the BCLR setting condition for non-DCP pipe
    usb: gadget: udc: renesas_usb3: Fix return value of usb3_write_pipe()
    usb: gadget: udc: renesas_usb3: fix Pn_RAMMAP.Pn_MPKT value
    usb: gadget: udc: renesas_usb3: fix for no-data control transfer
    USB: dummy-hcd: Fix erroneous synchronization change
    USB: dummy-hcd: fix infinite-loop resubmission bug
    USB: dummy-hcd: fix connection failures (wrong speed)
    USB: cdc-wdm: ignore -EPIPE from GetEncapsulatedResponse
    USB: devio: Don't corrupt user memory
    USB: devio: Prevent integer overflow in proc_do_submiturb()
    USB: g_mass_storage: Fix deadlock when driver is unbound
    USB: gadgetfs: Fix crash caused by inadequate synchronization
    USB: gadgetfs: fix copy_to_user while holding spinlock
    USB: uas: fix bug in handling of alternate settings
    usb-storage: unusual_devs entry to fix write-access regression for Seagate external drives
    usb-storage: fix bogus hardware error messages for ATA pass-thru devices
    ...

    Linus Torvalds
     
  • Pull tty/serial fixes from Greg KH:
    "Here are a small number (5) of patches for some reported TTY and
    serial issues. Nothing major, a documentation update, timing fix,
    error handling fix, name reporting fix, and a timeout issue resolved.

    All of these have been in linux-next for a while with no reported
    issues"

    * tag 'tty-4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
    serial: sccnxp: Fix error handling in sccnxp_probe()
    tty: serial: lpuart: avoid report NULL interrupt
    serial: bcm63xx: fix timing issue.
    mxser: fix timeout calculation for low rates
    serial: sh-sci: document R8A77970 bindings

    Linus Torvalds
     
  • Pull staging/IIO fixes from Greg KH:
    "Here are some small staging/IIO driver fixes for 4.14-rc4

    Most of these have been in my tree for a while due to travels, sorry
    for the delay. They resolve a number of small issues reported by
    people, mostly for the iio drivers. Nothing major in here, full
    details are in the shortlog.

    All have been linux-next for a few weeks with no reported issues"

    * tag 'staging-4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (23 commits)
    staging: iio: ad7192: Fix - use the dedicated reset function avoiding dma from stack.
    iio: core: Return error for failed read_reg
    iio: ad7793: Fix the serial interface reset
    iio: ad_sigma_delta: Implement a dedicated reset function
    IIO: BME280: Updates to Humidity readings need ctrl_reg write!
    iio: adc: mcp320x: Fix readout of negative voltages
    iio: adc: mcp320x: Fix oops on module unload
    iio: adc: stm32: fix bad error check on max_channels
    iio: trigger: stm32-timer: fix a corner case to write preset
    iio: trigger: stm32-timer: preset shouldn't be buffered
    iio: adc: twl4030: Return an error if we can not enable the vusb3v1 regulator in 'twl4030_madc_probe()'
    iio: adc: twl4030: Disable the vusb3v1 rugulator in the error handling path of 'twl4030_madc_probe()'
    iio: adc: twl4030: Fix an error handling path in 'twl4030_madc_probe()'
    staging: rtl8723bs: avoid null pointer dereference on pmlmepriv
    staging: rtl8723bs: add missing range check on id
    staging: vchiq_2835_arm: Fix NULL ptr dereference in free_pagelist
    staging: speakup: fix speakup-r empty line lockup
    staging: pi433: Move limit check to switch default to kill warning
    staging: r8822be: fix null pointer dereferences with a null driver_adapter
    staging: mt29f_spinand: Enable the read ECC before program the page
    ...

    Linus Torvalds
     

03 Oct, 2017

3 commits

  • Pull driver core fixes from Greg KH:
    "Here are a few small fixes for 4.14-rc4.

    The removal of DRIVER_ATTR() was almost completed by 4.14-rc1, but one
    straggler made it in through some other tree (odds are, one of
    mine...) So there's a simple removal of the last user, and then
    finally the macro is removed from the tree.

    There's a fix for old crazy udev instances that insist on reloading a
    module when it is removed from the kernel due to the new uevents for
    bind/unbind. This fixes the reported regression, hopefully some year
    in the future we can drop the workaround, once users update to the
    latest version, but I'm not holding my breath.

    And then there's a build fix for a linker warning, and a buffer
    overflow fix to match the PCI fixes you took through the PCI tree in
    the same area.

    All of these have been in linux-next for a few weeks while I've been
    traveling, sorry for the delay"

    * tag 'driver-core-4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
    driver core: remove DRIVER_ATTR
    fpga: altera-cvp: remove DRIVER_ATTR() usage
    driver core: platform: Don't read past the end of "driver_override" buffer
    base: arch_topology: fix section mismatch build warnings
    driver core: suppress sending MODALIAS in UNBIND uevents

    Linus Torvalds
     
  • Pull char/misc fixes from Greg KH:
    "Here are a handful of char/misc driver fixes for 4.14-rc4.

    Nothing major, some binder fixups, hyperv fixes, and other tiny
    things.

    All of these have been sitting in my tree for way too long, sorry for
    the delay in getting them to you. All have been in linux-next for a
    few weeks, and despite some people's feeling about if linux-next
    actually tests things, I think it's a good "soak test" for patches"

    * tag 'char-misc-4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
    Drivers: hv: fcopy: restore correct transfer length
    vmbus: don't acquire the mutex in vmbus_hvsock_device_unregister()
    intel_th: pci: Add Lewisburg PCH support
    intel_th: pci: Add Cedar Fork PCH support
    stm class: Fix a use-after-free
    nvmem: add missing of_node_put() in of_nvmem_cell_get()
    nvmem: core: return EFBIG on out-of-range write
    auxdisplay: charlcd: properly restore atomic counter on error path
    binder: fix memory corruption in binder_transaction binder
    binder: fix an ret value override
    android: binder: fix type mismatch warning

    Linus Torvalds
     
  • ahci_pci_reset_controller() calls ahci_reset_controller(), which may
    fail, but ignores the result code and always returns success. This
    may result in failures like below

    ahci 0000:02:00.0: version 3.0
    ahci 0000:02:00.0: enabling device (0000 -> 0003)
    ahci 0000:02:00.0: SSS flag set, parallel bus scan disabled
    ahci 0000:02:00.0: controller reset failed (0xffffffff)
    ahci 0000:02:00.0: failed to stop engine (-5)
    ... repeated many times ...
    ahci 0000:02:00.0: failed to stop engine (-5)
    Unable to handle kernel paging request at virtual address ffff0000093f9018
    ...
    PC is at ahci_stop_engine+0x5c/0xd8 [libahci]
    LR is at ahci_deinit_port.constprop.12+0x1c/0xc0 [libahci]
    ...
    [] ahci_stop_engine+0x5c/0xd8 [libahci]
    [] ahci_deinit_port.constprop.12+0x1c/0xc0 [libahci]
    [] ahci_init_controller+0x80/0x168 [libahci]
    [] ahci_pci_init_controller+0x60/0x68 [ahci]
    [] ahci_init_one+0x75c/0xd88 [ahci]
    [] local_pci_probe+0x3c/0xb8
    [] pci_device_probe+0x138/0x170
    [] driver_probe_device+0x2dc/0x458
    [] __driver_attach+0x114/0x118
    [] bus_for_each_dev+0x60/0xa0
    [] driver_attach+0x20/0x28
    [] bus_add_driver+0x1f0/0x2a8
    [] driver_register+0x60/0xf8
    [] __pci_register_driver+0x3c/0x48
    [] ahci_pci_driver_init+0x1c/0x1000 [ahci]
    [] do_one_initcall+0x38/0x120

    where an obvious hardware level failure results in an unnecessary 15 second
    delay and a subsequent crash.

    So record the result code of ahci_reset_controller() and relay it, rather
    than ignoring it.

    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Tejun Heo

    Ard Biesheuvel
     

02 Oct, 2017

2 commits

  • Pull x86 fixes from Thomas Gleixner:
    "This contains the following fixes and improvements:

    - Avoid dereferencing an unprotected VMA pointer in the fault signal
    generation code

    - Fix inline asm call constraints for GCC 4.4

    - Use existing register variable to retrieve the stack pointer
    instead of forcing the compiler to create another indirect access
    which results in excessive extra 'mov %rsp, %' instructions

    - Disable branch profiling for the memory encryption code to prevent
    an early boot crash

    - Fix a sparse warning caused by casting the __user annotation in
    __get_user_asm_u64() away

    - Fix an off by one error in the loop termination of the error patch
    in the x86 sysfs init code

    - Add missing CPU IDs to various Intel specific drivers to enable the
    functionality on recent hardware

    - More (init) constification in the numachip code"

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/asm: Use register variable to get stack pointer value
    x86/mm: Disable branch profiling in mem_encrypt.c
    x86/asm: Fix inline asm call constraints for GCC 4.4
    perf/x86/intel/uncore: Correct num_boxes for IIO and IRP
    perf/x86/intel/rapl: Add missing CPU IDs
    perf/x86/msr: Add missing CPU IDs
    perf/x86/intel/cstate: Add missing CPU IDs
    x86: Don't cast away the __user in __get_user_asm_u64()
    x86/sysfs: Fix off-by-one error in loop termination
    x86/mm: Fix fault error path using unsafe vma pointer
    x86/numachip: Add const and __initconst to numachip2_clockevent

    Linus Torvalds
     
  • Pull irq fixes from Thomas Gleixner:

    - Add a missing NULL pointer check in free_irq()

    - Fix a memory leak/memory corruption in the generic irq chip

    - Add missing rcu annotations for radix tree access

    - Use ffs instead of fls when extracting data from a chip register in
    the MIPS GIC irq driver

    - Fix the unmasking of IPI interrupts in the MIPS GIC driver so they
    end up at the target CPU and not at CPU0

    * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    irq/generic-chip: Don't replace domain's name
    irqdomain: Add __rcu annotations to radix tree accessors
    irqchip/mips-gic: Use effective affinity to unmask
    irqchip/mips-gic: Fix shifts to extract register fields
    genirq: Check __free_irq() return value for NULL

    Linus Torvalds
     

01 Oct, 2017

2 commits

  • Pull mtd fixes from Boris Brezillon:

    - Fix partition alignment check in mtdcore.c

    - Fix a buffer overflow in the Atmel NAND driver

    * tag 'mtd/fixes-for-4.14-rc3' of git://git.infradead.org/linux-mtd:
    mtd: nand: atmel: fix buffer overflow in atmel_pmecc_user
    mtd: Fix partition alignment check on multi-erasesize devices

    Linus Torvalds
     
  • Pull SCSI fixes from James Bottomley:
    "Eight mostly minor fixes for recently discovered issues in drivers"

    * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
    scsi: ILLEGAL REQUEST + ASC==27 => target failure
    scsi: aacraid: Add a small delay after IOP reset
    scsi: scsi_transport_fc: Also check for NOTPRESENT in fc_remote_port_add()
    scsi: scsi_transport_fc: set scsi_target_id upon rescan
    scsi: scsi_transport_iscsi: fix the issue that iscsi_if_rx doesn't parse nlmsg properly
    scsi: aacraid: error: testing array offset 'bus' after use
    scsi: lpfc: Don't return internal MBXERR_ERROR code from probe function
    scsi: aacraid: Fix 2T+ drives on SmartIOC-2000

    Linus Torvalds
     

30 Sep, 2017

7 commits

  • Pull x86 platform drivers fix from Darren Hart:
    "Newly discovered species of fujitsu laptops break some assumptions
    about ACPI device pairings.

    fujitsu-laptop: Don't oops when FUJ02E3 is not present"

    * tag 'platform-drivers-x86-v4.14-2' of git://git.infradead.org/linux-platform-drivers-x86:
    platform/x86: fujitsu-laptop: Don't oops when FUJ02E3 is not presnt

    Linus Torvalds
     
  • …j.anaszewski/linux-leds

    Pull LED fixes from Jacek Anaszewski:
    "Four fixes for the as3645a LED flash controller and one update to
    MAINTAINERS"

    * tag 'led_fixes-4.14-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds:
    MAINTAINERS: Add entry for MediaTek PMIC LED driver
    as3645a: Unregister indicator LED on device unbind
    as3645a: Use integer numbers for parsing LEDs
    dt: bindings: as3645a: Use LED number to refer to LEDs
    as3645a: Use ams,input-max-microamp as documented in DT bindings

    Linus Torvalds
     
  • Pull MD fixes from Shaohua Li:
    "A few fixes for MD. Mainly fix a problem introduced in 4.13, which we
    retry bio for some code paths but not all in some situations"

    * tag 'md/4.14-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md:
    md/raid5: cap worker count
    dm-raid: fix a race condition in request handling
    md: fix a race condition for flush request handling
    md: separate request handling

    Linus Torvalds
     
  • Pull PCI fixes from Bjorn Helgaas:

    - fix CONFIG_PCI=n build error (introduced in v4.14-rc1) (Geert
    Uytterhoeven)

    - fix a race in sysfs driver_override store/show (Nicolai Stange)

    * tag 'pci-v4.14-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
    PCI: Fix race condition with driver_override
    PCI: Add dummy pci_acs_enabled() for CONFIG_PCI=n build

    Linus Torvalds
     
  • Pull drm fixes from Dave Airlie:
    "Regular fixes pull, some amdkfd, amdgpu, etnaviv, sun4i, qxl, tegra
    fixes.

    I've got an outstanding pull for i915 but it wasn't on an rc2 base so
    I wanted to ship these out first, I might get to it before rc3 or I
    might not"

    * tag 'drm-fixes-for-v4.14-rc3' of git://people.freedesktop.org/~airlied/linux:
    drm/tegra: trace: Fix path to include
    qxl: fix framebuffer unpinning
    drm/sun4i: cec: Enable back CEC-pin framework
    drm/amdkfd: Print event limit messages only once per process
    drm/amdkfd: Fix kernel-queue wrapping bugs
    drm/amdkfd: Fix incorrect destroy_mqd parameter
    drm/radeon: disable hard reset in hibernate for APUs
    drm/amdgpu: revert tile table update for oland
    etnaviv: fix gem object list corruption
    etnaviv: fix submit error path
    qxl: fix primary surface handling
    drm/amdkfd: check for null dev to avoid a null pointer dereference

    Linus Torvalds
     
  • Pull IOMMU fixes from Joerg Roedel:

    - A comment fix for 'struct iommu_ops'

    - Format string fixes for AMD IOMMU, unfortunatly I missed that during
    review.

    - Limit mediatek physical addresses to 32 bit for v7s to fix a warning
    triggered in io-page-table code.

    - Fix dma-sync in io-pgtable-arm-v7s code

    * tag 'iommu-fixes-v4.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
    iommu: Fix comment for iommu_ops.map_sg
    iommu/amd: pr_err() strings should end with newlines
    iommu/mediatek: Limit the physical address in 32bit for v7s
    iommu/io-pgtable-arm-v7s: Need dma-sync while there is no QUIRK_NO_DMA

    Linus Torvalds
     
  • Pull xen fixes from Juergen Gross:

    - avoid a warning when compiling with clang

    - consider read-only bits in xen-pciback when writing to a BAR

    - fix a boot crash of pv-domains

    * tag 'for-linus-4.14c-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
    xen/mmu: Call xen_cleanhighmap() with 4MB aligned for page tables mapping
    xen-pciback: relax BAR sizing write value check
    x86/xen: clean up clang build warning

    Linus Torvalds
     

29 Sep, 2017

6 commits

  • Driver Changes:
    - qxl: fix primary surface and fb unpinning (Gerd)
    - sun41: fix CEC_PIN config gate now that media has been merged (Hans)
    - tegra: fix TRACE_INCLUDE_PATH (Thierry)

    Cc: Thierry Reding
    Cc: Hans Verkuil
    Cc: Gerd Hoffmann

    * tag 'drm-misc-fixes-2017-09-28-1' of git://anongit.freedesktop.org/git/drm-misc:
    drm/tegra: trace: Fix path to include
    qxl: fix framebuffer unpinning
    drm/sun4i: cec: Enable back CEC-pin framework
    qxl: fix primary surface handling

    Dave Airlie
     
  • Pull ACPI fix from Rafael Wysocki:
    "This fixes an APEI problem that may cause a reported error to be
    missed due to a race condition"

    * tag 'acpi-4.14-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    ACPI / APEI: clear error status before acknowledging the error

    Linus Torvalds
     
  • Pull power management fixes from Rafael Wysocki:
    "These fix a deadlock in the operating performance points (OPP)
    framework introduced during the 4.11 cycle, more issues with duplicate
    device objects for cpufreq-dt and cpufreq documentation.

    Specifics:

    - Fix a deadlock in the operating performance points (OPP) framework
    caused by a notifier callback taking a lock that's already held by
    its caller (Viresh Kumar).

    - Prevent the ti-cpufreq and cpufreq-dt-platdev drivers from
    attempting to register conflicting device objects which triggers a
    warning from sysfs (Suniel Mahesh).

    - Drop a stale reference to a piece of intel_pstate documentation
    that's not in the tree any more (Rafael Wysocki)"

    * tag 'pm-4.14-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    cpufreq: docs: Drop intel-pstate.txt from index.txt
    cpufreq: dt: Fix sysfs duplicate filename creation for platform-device
    PM / OPP: Call notifier without holding opp_table->lock

    Linus Torvalds
     
  • * acpi-apei:
    ACPI / APEI: clear error status before acknowledging the error

    Rafael J. Wysocki
     
  • Pull rdma fixes from Doug Ledford:
    "Second -rc update for 4.14.

    Both Mellanox and Intel had a series of -rc fixes that landed this
    week. The Mellanox bunch is spread throughout the stack and not just
    in their driver, where as the Intel bunch was mostly in the hfi1
    driver. And, several of the fixes in the hfi1 driver were more than
    just simple 5 line fixes. As a result, the hfi1 driver fixes has a
    sizable LOC count.

    Everything else is as one would expect in an RC cycle in terms of LOC
    count. One item that might jump out and make you think "That's not an
    rc item" is the fix that corrects a typo. But, that change fixes a
    typo in a user visible API that was just added in this merge window,
    so if we fix it now, we can fix it. If we don't, the typo is in the
    API forever. Another that might not appear to be a fix at first glance
    is the Simplify mlx5_ib_cont_pages patch, but the simplification
    allows them to fix a bug in the existing function whenever the length
    of an SGE exceeded page size. We also had to revert one patch from the
    merge window that was wrong.

    Summary:

    - a few core fixes
    - a few ipoib fixes
    - a few mlx5 fixes
    - a 7-patch hfi1 related series"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma:
    IB/hfi1: Unsuccessful PCIe caps tuning should not fail driver load
    IB/hfi1: On error, fix use after free during user context setup
    Revert "IB/ipoib: Update broadcast object if PKey value was changed in index 0"
    IB/hfi1: Return correct value in general interrupt handler
    IB/hfi1: Check eeprom config partition validity
    IB/hfi1: Only reset QSFP after link up and turn off AOC TX
    IB/hfi1: Turn off AOC TX after offline substates
    IB/mlx5: Fix NULL deference on mlx5_ib_update_xlt failure
    IB/mlx5: Simplify mlx5_ib_cont_pages
    IB/ipoib: Fix inconsistency with free_netdev and free_rdma_netdev
    IB/ipoib: Fix sysfs Pkey createremove possible deadlock
    IB: Correct MR length field to be 64-bit
    IB/core: Fix qp_sec use after free access
    IB/core: Fix typo in the name of the tag-matching cap struct

    Linus Torvalds
     
  • * pm-opp:
    PM / OPP: Call notifier without holding opp_table->lock

    * pm-cpufreq:
    cpufreq: docs: Drop intel-pstate.txt from index.txt
    cpufreq: dt: Fix sysfs duplicate filename creation for platform-device

    Rafael J. Wysocki
     

28 Sep, 2017

13 commits

  • Just like done in d2bd05d88d ("xen-pciback: return proper values during
    BAR sizing") for the ROM BAR, ordinary ones also shouldn't compare the
    written value directly against ~0, but consider the r/o bits at the
    bottom (if any).

    Signed-off-by: Jan Beulich
    Reviewed-by: Juergen Gross
    Signed-off-by: Boris Ostrovsky

    Jan Beulich
     
  • Add compatible string to use this generic glue layer to support
    Spreadtrum SC9860 platform's dwc3 controller.

    Signed-off-by: Baolin Wang
    Signed-off-by: Felipe Balbi

    Baolin Wang
     
  • The driver triggers actions on both edges of the vbus signal.

    The former PIO controller was triggering IRQs on both falling and rising edges
    by default. Newer PIO controller don't, so it's better to set it explicitly to
    IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING.

    Without this patch we may trigger the connection with host but only on some
    bouncing signal conditions and thus lose connecting events.

    Acked-by: Ludovic Desroches
    Signed-off-by: Nicolas Ferre
    Cc: stable # v4.4+
    Signed-off-by: Felipe Balbi

    Nicolas Ferre
     
  • By submitting completed transfers to the system workqueue there is no
    guarantee that completion events will be queued up in the correct order,
    as in multi-processor systems there is a thread running for each
    processor and the work items are not bound to a particular core.

    This means that several completions are in the queue at the same time,
    they may be processed in parallel and complete out of order, resulting
    in data appearing corrupt when read by userspace.

    Create a single-threaded workqueue for FunctionFS so that data completed
    requests is passed to userspace in the order in which they complete.

    Acked-by: Michal Nazarewicz
    Signed-off-by: John Keeping
    Signed-off-by: Felipe Balbi

    John Keeping
     
  • This patch fixes an issue that the usbhsf_fifo_clear() is possible
    to cause 10 msec delay if the pipe is RX direction and empty because
    the FRDY bit will never be set to 1 in such case.

    Fixes: e8d548d54968 ("usb: renesas_usbhs: fifo became independent from pipe.")
    Cc: # v3.1+
    Signed-off-by: Yoshihiro Shimoda
    Signed-off-by: Felipe Balbi

    Yoshihiro Shimoda
     
  • This patch fixes an issue that the driver sets the BCLR bit of
    {C,Dn}FIFOCTR register to 1 even when it's non-DCP pipe and
    the FRDY bit of {C,Dn}FIFOCTR register is set to 1.

    Fixes: e8d548d54968 ("usb: renesas_usbhs: fifo became independent from pipe.")
    Cc: # v3.1+
    Signed-off-by: Yoshihiro Shimoda
    Signed-off-by: Felipe Balbi

    Yoshihiro Shimoda
     
  • This patch fixes an issue that this driver cannot go status stage
    in control read when the req.zero is set to 1 and the len in
    usb3_write_pipe() is set to 0. Otherwise, if we use g_ncm driver,
    usb enumeration takes long time (5 seconds or more).

    Fixes: 746bfe63bba3 ("usb: gadget: renesas_usb3: add support for Renesas USB3.0 peripheral controller")
    Cc: # v4.5+
    Signed-off-by: Yoshihiro Shimoda
    Signed-off-by: Felipe Balbi

    Yoshihiro Shimoda
     
  • According to the datasheet of R-Car Gen3, the Pn_RAMMAP.Pn_MPKT should
    be set to one of 8, 16, 32, 64, 512 and 1024. Otherwise, when a gadget
    driver uses an interrupt endpoint, unexpected behavior happens. So,
    this patch fixes it.

    Fixes: 746bfe63bba3 ("usb: gadget: renesas_usb3: add support for Renesas USB3.0 peripheral controller")
    Cc: # v4.5+
    Signed-off-by: Yoshihiro Shimoda
    Signed-off-by: Felipe Balbi

    Yoshihiro Shimoda
     
  • When bRequestType & USB_DIR_IN is false and req.length is 0 in control
    transfer, since it means non-data, this driver should not set the mode
    as control write. So, this patch fixes it.

    Fixes: 746bfe63bba3 ("usb: gadget: renesas_usb3: add support for Renesas USB3.0 peripheral controller")
    Cc: # v4.5+
    Signed-off-by: Yoshihiro Shimoda
    Signed-off-by: Felipe Balbi

    Yoshihiro Shimoda
     
  • A recent change to the synchronization in dummy-hcd was incorrect.
    The issue was that dummy_udc_stop() contained no locking and therefore
    could race with various gadget driver callbacks, and the fix was to
    add locking and issue the callbacks with the private spinlock held.

    UDC drivers aren't supposed to do this. Gadget driver callback
    routines are allowed to invoke functions in the UDC driver, and these
    functions will generally try to acquire the private spinlock. This
    would deadlock the driver.

    The correct solution is to drop the spinlock before issuing callbacks,
    and avoid races by emulating the synchronize_irq() call that all real
    UDC drivers must perform in their ->udc_stop() routines after
    disabling interrupts. This involves adding a flag to dummy-hcd's
    private structure to keep track of whether interrupts are supposed to
    be enabled, and adding a counter to keep track of ongoing callbacks so
    that dummy_udc_stop() can wait for them all to finish.

    A real UDC driver won't receive disconnect, reset, suspend, resume, or
    setup events once it has disabled interrupts. dummy-hcd will receive
    them but won't try to issue any gadget driver callbacks, which should
    be just as good.

    Signed-off-by: Alan Stern
    Fixes: f16443a034c7 ("USB: gadgetfs, dummy-hcd, net2280: fix locking for callbacks")
    CC:
    Signed-off-by: Felipe Balbi

    Alan Stern
     
  • The dummy-hcd HCD/UDC emulator tries not to do too much work during
    each timer interrupt. But it doesn't try very hard; currently all
    it does is limit the total amount of bulk data transferred. Other
    transfer types aren't limited, and URBs that transfer no data (because
    of an error, perhaps) don't count toward the limit, even though on a
    real USB bus they would consume at least a minimum overhead.

    This means it's possible to get the driver stuck in an infinite loop,
    for example, if the host class driver resubmits an URB every time it
    completes (which is common for interrupt URBs). Each time the URB is
    resubmitted it gets added to the end of the pending-URBs list, and
    dummy-hcd doesn't stop until that list is empty. Andrey Konovalov was
    able to trigger this failure mode using the syzkaller fuzzer.

    This patch fixes the infinite-loop problem by restricting the URBs
    handled during each timer interrupt to those that were already on the
    pending list when the interrupt routine started. Newly added URBs
    won't be processed until the next timer interrupt. The problem of
    properly accounting for non-bulk bandwidth (as well as packet and
    transaction overhead) is not addressed here.

    Signed-off-by: Alan Stern
    Reported-by: Andrey Konovalov
    Tested-by: Andrey Konovalov
    CC:
    Signed-off-by: Felipe Balbi

    Alan Stern
     
  • The dummy-hcd UDC driver is not careful about the way it handles
    connection speeds. It ignores the module parameter that is supposed
    to govern the maximum connection speed and it doesn't set the HCD
    flags properly for the case where it ends up running at full speed.

    The result is that in many cases, gadget enumeration over dummy-hcd
    fails because the bMaxPacketSize byte in the device descriptor is set
    incorrectly. For example, the default settings call for a high-speed
    connection, but the maxpacket value for ep0 ends up being set for a
    Super-Speed connection.

    This patch fixes the problem by initializing the gadget's max_speed
    and the HCD flags correctly.

    Signed-off-by: Alan Stern
    CC:
    Signed-off-by: Felipe Balbi

    Alan Stern
     
  • static checker reports a potential integer overflow. Cap the worker count to
    avoid the overflow.

    Reported:-by: Dan Carpenter
    Signed-off-by: Shaohua Li

    Shaohua Li