3648 Commits

Author SHA1 Message Date
qctecmdr Service
0a1341254d Merge "Merge android-4.14-p.103 (d38adba) into msm-4.14" 2019-03-06 04:22:49 -08:00
Blagovest Kolenichev
9ec70dd408 Merge android-4.14-p.102 (6d248da0) into msm-4.14
* refs/heads/tmp-6d248da0:
  Revert "sched, trace: Fix prev_state output in sched_switch tracepoint"
  Linux 4.14.102
  uapi/if_ether.h: move __UAPI_DEF_ETHHDR libc define
  pinctrl: msm: fix gpio-hog related boot issues
  futex: Cure exit race
  sched, trace: Fix prev_state output in sched_switch tracepoint
  drm/i915: Prevent a race during I915_GEM_MMAP ioctl with WC set
  dm thin: fix bug where bio that overwrites thin block ignores FUA
  dm crypt: don't overallocate the integrity tag space
  x86/a.out: Clear the dump structure initially
  md/raid1: don't clear bitmap bits on interrupted recovery.
  signal: Restore the stop PTRACE_EVENT_EXIT
  x86/platform/UV: Use efi_runtime_lock to serialise BIOS calls
  tracing/uprobes: Fix output for multiple string arguments
  alpha: Fix Eiger NR_IRQS to 128
  alpha: fix page fault handling for r16-r18 targets
  mm: proc: smaps_rollup: fix pss_locked calculation
  Input: elantech - enable 3rd button support on Fujitsu CELSIUS H780
  Input: bma150 - register input device after setting private data
  kvm: vmx: Fix entry number check for add_atomic_switch_msr()
  ALSA: usb-audio: Fix implicit fb endpoint setup by quirk
  ALSA: hda - Add quirk for HP EliteBook 840 G5
  perf/x86: Add check_period PMU callback
  perf/core: Fix impossible ring-buffer sizes warning
  Input: elan_i2c - add ACPI ID for touchpad in Lenovo V330-15ISK
  Revert "Input: elan_i2c - add ACPI ID for touchpad in ASUS Aspire F5-573G"
  cifs: Limit memory used by lock request calls to a page
  drm/nouveau/falcon: avoid touching registers if engine is off
  drm/nouveau: Don't disable polling in fallback mode
  gpio: pl061: handle failed allocations
  ARM: dts: kirkwood: Fix polarity of GPIO fan lines
  ARM: dts: da850-lcdk: Correct the sound card name
  ARM: dts: da850-evm: Correct the sound card name
  nvme-pci: use the same attributes when freeing host_mem_desc_bufs.
  drm/bridge: tc358767: fix output H/V syncs
  drm/bridge: tc358767: reject modes which require too much BW
  drm/bridge: tc358767: fix initial DP0/1_SRCCTRL value
  drm/bridge: tc358767: fix single lane configuration
  drm/bridge: tc358767: add defines for DP1_SRCCTRL & PHY_2LANE
  cpufreq: check if policy is inactive early in __cpufreq_get()
  perf test shell: Use a fallback to get the pathname in vfs_getname
  ACPI: NUMA: Use correct type for printing addresses on i386-PAE
  bnx2x: disable GSO where gso_size is too big for hardware
  net: create skb_gso_validate_mac_len()
  ARM: fix the cockup in the previous patch
  ARM: ensure that processor vtables is not lost after boot
  ARM: spectre-v2: per-CPU vtables to work around big.Little systems
  ARM: add PROC_VTABLE and PROC_TABLE macros
  ARM: clean up per-processor check_bugs method call
  ARM: split out processor lookup
  ARM: make lookup_processor_type() non-__init
  ARM: 8810/1: vfp: Fix wrong assignement to ufp_exc
  ARM: 8797/1: spectre-v1.1: harden __copy_to_user
  ARM: 8796/1: spectre-v1,v1.1: provide helpers for address sanitization
  ARM: 8795/1: spectre-v1.1: use put_user() for __put_user()
  ARM: 8794/1: uaccess: Prevent speculative use of the current addr_limit
  ARM: 8793/1: signal: replace __put_user_error with __put_user
  ARM: 8792/1: oabi-compat: copy oabi events using __copy_to_user()
  ARM: 8791/1: vfp: use __copy_to_user() when saving VFP state
  ARM: 8790/1: signal: always use __copy_to_user to save iwmmxt context
  ARM: 8789/1: signal: copy registers using __copy_to_user()
  uapi/if_ether.h: prevent redefinition of struct ethhdr
  blk-mq: fix a hung issue when fsync
  eeprom: at24: add support for 24c2048
  dt-bindings: eeprom: at24: add "atmel,24c2048" compatible string

Change-Id: I76266eef1ae49d35fb83938d82066e72be54bb2c
Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
2019-03-01 11:14:41 -08:00
Sahitya Tummala
bd59943ebc block: Handle error case when bdi_register_owner() fails
Fix the below issue observed when bdi_register_owner() fails
in device_add_disk().

Unable to handle kernel paging request at virtual address
pc : sysfs_do_create_link_sd+0x50/0x100
lr : sysfs_do_create_link_sd+0x40/0x100
...
Call trace:
 sysfs_do_create_link_sd+0x50/0x100
 sysfs_do_create_link+0x78/0x90
 sysfs_create_link+0x38/0x48
 device_add_disk+0x5b8/0xad8
 loop_add+0x4a0/0x6cc
 loop_control_ioctl+0x164/0x2b8
 vfs_ioctl+0x7c/0xb4
 do_vfs_ioctl+0x868/0x1384
 SyS_ioctl+0x6c/0xa4

Change-Id: Ibd814b207047537dacdca73a75299cbac3c361b7
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2019-02-26 12:20:28 +05:30
Jianchao Wang
883d561c49 blk-mq: fix a hung issue when fsync
[ Upstream commit 85bd6e61f34dffa8ec2dc75ff3c02ee7b2f1cbce ]

Florian reported a io hung issue when fsync(). It should be
triggered by following race condition.

data + post flush         a flush

blk_flush_complete_seq
  case REQ_FSEQ_DATA
    blk_flush_queue_rq
    issued to driver      blk_mq_dispatch_rq_list
                            try to issue a flush req
                            failed due to NON-NCQ command
                            .queue_rq return BLK_STS_DEV_RESOURCE

request completion
  req->end_io // doesn't check RESTART
  mq_flush_data_end_io
    case REQ_FSEQ_POSTFLUSH
      blk_kick_flush
        do nothing because previous flush
        has not been completed
     blk_mq_run_hw_queue
                              insert rq to hctx->dispatch
                              due to RESTART is still set, do nothing

To fix this, replace the blk_mq_run_hw_queue in mq_flush_data_end_io
with blk_mq_sched_restart to check and clear the RESTART flag.

Fixes: bd166ef1 (blk-mq-sched: add framework for MQ capable IO schedulers)
Reported-by: Florian Stecker <m19@florianstecker.de>
Tested-by: Florian Stecker <m19@florianstecker.de>
Signed-off-by: Jianchao Wang <jianchao.w.wang@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-02-20 10:20:44 +01:00
Blagovest Kolenichev
0927a7b7f2 Merge android-4.14-p.91 (eef4cf6) into msm-4.14
* refs/heads/tmp-eef4cf6:
  Revert "mmc: core: Allow BKOPS and CACHE ctrl even if no HPI support"
  Linux 4.14.91
  drm/ioctl: Fix Spectre v1 vulnerabilities
  proc/sysctl: don't return ENOMEM on lookup when a table is unregistering
  mm: don't miss the last page because of round-off error
  ubifs: Handle re-linking of inodes correctly while recovery
  spi: imx: mx51-ecspi: Move some initialisation to prepare_message hook.
  spi: imx: add a device specific prepare_message callback
  iwlwifi: add new cards for 9560, 9462, 9461 and killer series
  iwlwifi: mvm: don't send GEO_TX_POWER_LIMIT to old firmwares
  panic: avoid deadlocks in re-entrant console drivers
  x86/mtrr: Don't copy uninitialized gentry fields back to userspace
  Drivers: hv: vmbus: Return -EINVAL for the sys files for unopened channels
  KVM: Fix UAF in nested posted interrupt processing
  kvm: x86: Add AMD's EX_CFG to the list of ignored MSRs
  posix-timers: Fix division by zero bug
  gpiolib-acpi: Only defer request_irq for GpioInt ACPI event handlers
  gpio: max7301: fix driver for use with CONFIG_VMAP_STACK
  mmc: omap_hsmmc: fix DMA API warning
  mmc: core: Use a minimum 1600ms timeout when enabling CACHE ctrl
  mmc: core: Allow BKOPS and CACHE ctrl even if no HPI support
  mmc: core: Reset HPI enabled state during re-init and in case of errors
  scsi: sd: use mempool for discard special page
  USB: serial: option: add Telit LN940 series
  USB: serial: option: add Fibocom NL668 series
  USB: serial: option: add Simcom SIM7500/SIM7600 (MBIM mode)
  USB: serial: option: add HP lt4132
  USB: serial: option: add GosunCn ZTE WeLink ME3630
  USB: xhci: fix 'broken_suspend' placement in struct xchi_hcd
  xhci: Don't prevent USB2 bus suspend in state check intended for USB3 only
  USB: hso: Fix OOB memory access in hso_probe/hso_get_config_data
  cifs: integer overflow in in SMB2_ioctl()
  perf record: Synthesize features before events in pipe mode
  ib_srpt: Fix a use-after-free in __srpt_close_all_ch()
  ubifs: Fix directory size calculation for symlinks
  ASoC: sta32x: set ->component pointer in private struct
  block: fix infinite loop if the device loses discard capability
  block: break discard submissions into the user defined size

Conflicts:
	drivers/mmc/core/mmc.c

Change-Id: I1f0d24983198c7aa704dd334696e72dc8bf93b67
Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
2019-01-29 12:18:16 -08:00
Blagovest Kolenichev
1ed79e1650 Merge android-4.14-p.90 (a5e7b25) into msm-4.14
* refs/heads/tmp-a5e7b25:
  Linux 4.14.90
  bpf, arm: fix emit_ldx_r and emit_mov_i using TMP_REG_1
  rtc: snvs: Add timeouts to avoid kernel lockups
  nvmet-rdma: fix response use after free
  i2c: uniphier-f: fix violation of tLOW requirement for Fast-mode
  i2c: uniphier: fix violation of tLOW requirement for Fast-mode
  i2c: scmi: Fix probe error on devices with an empty SMB0001 ACPI device node
  i2c: axxia: properly handle master timeout
  mlxsw: spectrum_switchdev: Fix VLAN device deletion via ioctl
  vhost/vsock: fix reset orphans race with close timeout
  cifs: In Kconfig CONFIG_CIFS_POSIX needs depends on legacy (insecure cifs)
  drm/ast: Fix connector leak during driver unload
  ethernet: fman: fix wrong of_node_put() in probe function
  ARM: 8815/1: V7M: align v7m_dma_inv_range() with v7 counterpart
  ARM: 8814/1: mm: improve/fix ARM v7_dma_inv_range() unaligned address handling
  net/mlx4_en: Fix build break when CONFIG_INET is off
  mv88e6060: disable hardware level MAC learning
  libata: whitelist all SAMSUNG MZ7KM* solid-state disks
  Input: omap-keypad - fix keyboard debounce configuration
  Input: synaptics - enable SMBus for HP 15-ay000
  clk: mmp: Off by one in mmp_clk_add()
  clk: mvebu: Off by one bugs in cp110_of_clk_get()
  drm/msm: Fix error return checking
  ide: pmac: add of_node_put()
  drivers/tty: add missing of_node_put()
  drivers/sbus/char: add of_node_put()
  sbus: char: add of_node_put()
  SUNRPC: Fix a potential race in xprt_connect()
  nfs: don't dirty kernel pages read by direct-io
  bpf: Fix verifier log string check for bad alignment.
  bonding: fix 802.3ad state sent to partner when unbinding slave
  ARC: io.h: Implement reads{x}()/writes{x}()
  drm/msm: Grab a vblank reference when waiting for commit_done
  x86/earlyprintk/efi: Fix infinite loop on some screen widths
  scsi: vmw_pscsi: Rearrange code to avoid multiple calls to free_irq during unload
  scsi: libiscsi: Fix NULL pointer dereference in iscsi_eh_session_reset
  Input: hyper-v - fix wakeup from suspend-to-idle
  mac80211_hwsim: fix module init error paths for netlink
  locking/qspinlock: Fix build for anonymous union in older GCC compilers
  IB/hfi1: Remove race conditions in user_sdma send path
  mac80211: Fix condition validating WMM IE
  mac80211: don't WARN on bad WMM parameters from buggy APs
  netfilter: ipset: Fix wraparound in hash:*net* types
  elevator: lookup mq vs non-mq elevators
  locking/qspinlock, x86: Provide liveness guarantee
  locking/qspinlock/x86: Increase _Q_PENDING_LOOPS upper bound
  locking/qspinlock: Re-order code
  locking/qspinlock: Kill cmpxchg() loop when claiming lock from head of queue
  locking/qspinlock: Remove duplicate clear_pending() function from PV code
  locking/qspinlock: Remove unbounded cmpxchg() loop from locking slowpath
  locking/qspinlock: Merge 'struct __qspinlock' into 'struct qspinlock'
  locking/qspinlock: Bound spinning on pending->locked transition in slowpath
  locking/qspinlock: Ensure node is initialised before updating prev->next
  locking: Remove smp_read_barrier_depends() from queued_spin_lock_slowpath()
  x86/build: Fix compiler support check for CONFIG_RETPOLINE
  drm/amdgpu: update SMC firmware image for polaris10 variants
  drm/i915/execlists: Apply a full mb before execution for Braswell
  Revert "drm/rockchip: Allow driver to be shutdown on reboot/kexec"
  drm/nouveau/kms: Fix memory leak in nv50_mstm_del()
  powerpc/msi: Fix NULL pointer access in teardown code
  tracing: Fix memory leak of instance function hash filters
  tracing: Fix memory leak in set_trigger_filter()
  dm cache metadata: verify cache has blocks in blocks_are_clean_separate_dirty()
  dm thin: send event about thin-pool state change _after_ making it
  ARM: mmp/mmp2: fix cpu_is_mmp2() on mmp2-dt
  fuse: continue to send FUSE_RELEASEDIR when FUSE_OPEN returns ENOSYS
  mmc: sdhci: fix the timeout check window for clock and reset
  MMC: OMAP: fix broken MMC on OMAP15XX/OMAP5910/OMAP310
  arm64: dma-mapping: Fix FORCE_CONTIGUOUS buffer clearing
  userfaultfd: check VM_MAYWRITE was set after verifying the uffd is registered
  aio: fix spectre gadget in lookup_ioctx
  pinctrl: sunxi: a83t: Fix IRQ offset typo for PH11
  timer/debug: Change /proc/timer_list from 0444 to 0400

Change-Id: I9c3c7020caccfea06edafeb33c2740560bb6cc12
Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
2019-01-28 06:16:26 -08:00
qctecmdr Service
3fb58534f1 Merge "block, ice, cfq: support back/front merges and update req->__dun" 2019-01-12 22:45:25 -08:00
Mikulas Patocka
07eae146f5 block: fix infinite loop if the device loses discard capability
[ Upstream commit b88aef36b87c9787a4db724923ec4f57dfd513f3 ]

If __blkdev_issue_discard is in progress and a device mapper device is
reloaded with a table that doesn't support discard,
q->limits.max_discard_sectors is set to zero. This results in infinite
loop in __blkdev_issue_discard.

This patch checks if max_discard_sectors is zero and aborts with
-EOPNOTSUPP.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Tested-by: Zdenek Kabelac <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-12-29 13:39:07 +01:00
Jens Axboe
1e9290ca9d block: break discard submissions into the user defined size
[ Upstream commit af097f5d199e2aa3ab3ef777f0716e487b8f7b08 ]

Don't build discards bigger than what the user asked for, if the
user decided to limit the size by writing to 'discard_max_bytes'.

Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-12-29 13:39:07 +01:00
Jens Axboe
2a35d21a4d elevator: lookup mq vs non-mq elevators
[ Upstream commit 2527d99789e248576ac8081530cd4fd88730f8c7 ]

If an IO scheduler is selected via elevator= and it doesn't match
the driver in question wrt blk-mq support, then we fail to boot.

The elevator= parameter is deprecated and only supported for
non-mq devices. Augment the elevator lookup API so that we
pass in if we're looking for an mq capable scheduler or not,
so that we only ever return a valid type for the queue in
question.

Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=196695
Reviewed-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-12-21 14:13:10 +01:00
Blagovest Kolenichev
6e592c7b95 Merge android-4.14-p.82 (82609b3) into msm-4.14
* remotes/origin/tmp-82609b3:
  Linux 4.14.82
  gpio: brcmstb: release the bgpio lock during irq handlers
  nvme-loop: fix kernel oops in case of unhandled command
  printk: Never set console_may_schedule in console_trylock()
  ovl: check whiteout in ovl_create_over_whiteout()
  CONFIG_XEN_PV breaks xen_create_contiguous_region on ARM
  drm/i915/execlists: Force write serialisation into context image vs execution
  drm/i915: Mark pin flags as u64
  drm/i915: Don't oops during modeset shutdown after lpe audio deinit
  drm/i915/hdmi: Add HDMI 2.0 audio clock recovery N values
  drm/i915: Large page offsets for pread/pwrite
  drm/i915: Skip vcpi allocation for MSTB ports that are gone
  drm/i915: Don't unset intel_connector->mst_port
  drm/i915: Restore vblank interrupts earlier
  drm/dp_mst: Check if primary mstb is null
  drm/nouveau: Check backlight IDs are >= 0, not > 0
  drm/amdgpu: add missing CHIP_HAINAN in amdgpu_ucode_get_load_type
  drm/rockchip: Allow driver to be shutdown on reboot/kexec
  efi/arm/libstub: Pack FDT after populating it
  mm/swapfile.c: use kvzalloc for swap_info_struct allocation
  hugetlbfs: fix kernel BUG at fs/hugetlbfs/inode.c:444!
  lib/ubsan.c: don't mark __ubsan_handle_builtin_unreachable as noreturn
  crypto: user - fix leaking uninitialized memory to userspace
  gfs2: Put bitmap buffers in put_super
  configfs: replace strncpy with memcpy
  fuse: fix leaked notify reply
  fuse: fix use-after-free in fuse_direct_IO()
  rtc: hctosys: Add missing range error reporting
  nfsd: COPY and CLONE operations require the saved filehandle to be set
  sunrpc: correct the computation for page_ptr when truncating
  kdb: print real address of pointers instead of hashed addresses
  kdb: use correct pointer when 'btc' calls 'btt'
  mount: Prevent MNT_DETACH from disconnecting locked mounts
  mount: Don't allow copying MNT_UNBINDABLE|MNT_LOCKED mounts
  mount: Retest MNT_LOCKED in do_umount
  ext4: fix buffer leak in __ext4_read_dirblock() on error path
  ext4: fix buffer leak in ext4_expand_extra_isize_ea() on error path
  ext4: fix buffer leak in ext4_xattr_move_to_block() on error path
  ext4: release bs.bh before re-using in ext4_xattr_block_find()
  ext4: fix buffer leak in ext4_xattr_get_block() on error path
  ext4: fix possible leak of s_journal_flag_rwsem in error path
  ext4: fix possible leak of sbi->s_group_desc_leak in error path
  ext4: avoid possible double brelse() in add_new_gdb() on error path
  ext4: fix missing cleanup if ext4_alloc_flex_bg_array() fails while resizing
  ext4: avoid buffer leak in ext4_orphan_add() after prior errors
  ext4: avoid buffer leak on shutdown in ext4_mark_iloc_dirty()
  ext4: fix possible inode leak in the retry loop of ext4_resize_fs()
  ext4: missing !bh check in ext4_xattr_inode_write()
  ext4: avoid potential extra brelse in setup_new_flex_group_blocks()
  ext4: add missing brelse() add_new_gdb_meta_bg()'s error path
  ext4: add missing brelse() in set_flexbg_block_bitmap()'s error path
  ext4: add missing brelse() update_backups()'s error path
  clockevents/drivers/i8253: Add support for PIT shutdown quirk
  Btrfs: fix data corruption due to cloning of eof block
  Btrfs: fix infinite loop on inode eviction after deduplication of eof block
  Btrfs: fix cur_offset in the error case for nocow
  btrfs: fix pinned underflow after transaction aborted
  watchdog/core: Add missing prototypes for weak functions
  arch/alpha, termios: implement BOTHER, IBSHIFT and termios2
  termios, tty/tty_baudrate.c: fix buffer overrun
  x86/hyper-v: Enable PIT shutdown quirk
  x86/cpu/vmware: Do not trace vmware_sched_clock()
  of, numa: Validate some distance map rules
  mtd: docg3: don't set conflicting BCH_CONST_PARAMS option
  ARM: 8809/1: proc-v7: fix Thumb annotation of cpu_v7_hvc_switch_mm
  netfilter: conntrack: fix calculation of next bucket number in early_drop
  mm: thp: relax __GFP_THISNODE for MADV_HUGEPAGE mappings
  ocfs2: free up write context when direct IO failed
  ocfs2: fix a misuse a of brelse after failing ocfs2_check_dir_entry
  soc: ti: QMSS: Fix usage of irq_set_affinity_hint
  SCSI: fix queue cleanup race before queue initialization is done
  scsi: qla2xxx: Initialize port speed to avoid setting lower speed
  vhost/scsi: truncate T10 PI iov_iter to prot_bytes
  reset: hisilicon: fix potential NULL pointer dereference
  mach64: fix image corruption due to reading accelerator registers
  mach64: fix display corruption on big endian machines
  thermal: enable broadcom menu for arm64 bcm2835
  Revert "ceph: fix dentry leak in splice_dentry()"
  libceph: bump CEPH_MSG_MAX_DATA_LEN
  media: ov7670: make "xclk" clock optional
  clk: mvebu: use correct bit for 98DX3236 NAND
  clk: rockchip: Fix static checker warning in rockchip_ddrclk_get_parent call
  clk: at91: Fix division by zero in PLL recalc_rate()
  clk: s2mps11: Fix matching when built as module and DT node contains compatible
  um: Drop own definition of PTRACE_SYSEMU/_SINGLESTEP
  xtensa: fix boot parameters address translation
  xtensa: make sure bFLT stack is 16 byte aligned
  xtensa: add NOTES section to the linker script
  MIPS: Loongson-3: Fix BRIDGE irq delivery problem
  MIPS: Loongson-3: Fix CPU UART irq delivery problem
  ovl: fix recursive oi->lock in ovl_link()
  fuse: set FR_SENT while locked
  fuse: fix blocked_waitq wakeup
  fuse: Fix use-after-free in fuse_dev_do_write()
  fuse: Fix use-after-free in fuse_dev_do_read()
  scsi: qla2xxx: Fix re-using LoopID when handle is in use
  scsi: qla2xxx: shutdown chip if reset fail
  scsi: qla2xxx: Remove stale debug trace message from tcm_qla2xxx
  scsi: qla2xxx: Fix process response queue for ISP26XX and above
  scsi: qla2xxx: Fix incorrect port speed being set for FC adapters
  ovl: fix error handling in ovl_verify_set_fh()
  cdrom: fix improper type cast, which can leat to information leak.
  9p: clear dangling pointers in p9stat_free
  9p locks: fix glock.client_id leak in do_lock
  staging:iio:ad7606: fix voltage scales
  powerpc/selftests: Wait all threads to join
  media: tvp5150: fix width alignment during set_selection()
  sc16is7xx: Fix for multi-channel stall
  MIPS/PCI: Call pcie_bus_configure_settings() to set MPS/MRRS
  powerpc/memtrace: Remove memory in chunks
  powerpc/boot: Ensure _zimage_start is a weak symbol
  MIPS: kexec: Mark CPU offline before disabling local IRQ
  media: coda: don't overwrite h.264 profile_idc on decoder instance
  media: pci: cx23885: handle adding to list failure
  drm/hisilicon: hibmc: Do not carry error code in HiBMC framebuffer pointer
  drm/omap: fix memory barrier bug in DMM driver
  powerpc/mm: Don't report hugepage tables as memory leaks when using kmemleak
  powerpc/nohash: fix undefined behaviour when testing page size support
  ARM: imx_v6_v7_defconfig: Select CONFIG_TMPFS_POSIX_ACL
  tty: check name length in tty_find_polling_driver()
  powerpc/eeh: Fix possible null deref in eeh_dump_dev_log()
  powerpc/mm: Fix page table dump to work on Radix
  powerpc/64/module: REL32 relocation range check
  powerpc/traps: restore recoverability of machine_check interrupts

Change-Id: Ic57d67a5d6d5d8873abb56a093fe5fd5255a9fb7
Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2018-12-17 10:56:34 -08:00
Jaegeuk Kim
408d8698c6 block, ice, cfq: support back/front merges and update req->__dun
<4>[136765.870673] c6   4967 ------------[ cut here ]------------
<4>[136765.870717] c6   4967 WARNING: at block/blk-core.c:1534
<4>[136765.871328] c6   4967 [<ffffff8aaceddec0>] bio_attempt_front_merge+0x23c/0x280
<4>[136765.871335] c6   4967 [<ffffff8aacedd16c>] blk_queue_bio+0x314/0xaa8
<4>[136765.871344] c6   4967 [<ffffff8aaced6f68>] generic_make_request+0xfc/0x330
<4>[136765.871351] c6   4967 [<ffffff8aaced6cec>] submit_bio+0x15c/0x2dc
<4>[136765.871362] c6   4967 [<ffffff8aacdfeaf8>] __submit_bio+0x46c/0x4e0
<4>[136765.871371] c6   4967 [<ffffff8aace0abe8>] f2fs_mpage_readpages+0x57c/0x7e4

Assuming that this encrypted bio is mergeable,

blk_queue_bio()
  blk_attempt_plug_merge() = false, given by blk_try_merge()=ELEVATOR_NO_MERGE
  el_ret = elv_merge()
      if (q->last_merge)
          elv_bio_merge_ok() = true
          blk_try_merge() = ELEVATOR_NO_MERGE;
      }
      __rq = elv_rqhash_find();
      if (__rq = false && elv_bio_merge_ok() = true)
      e->type->ops.elevator_merge_fn() -- cfq_merge()
          elv_bio_merge_ok() = true
      return ELEVATOR_FRONT_MERGE
  if (el_ret == ELEVATOR_FRONT_MERGE)
     bio_attempt_front_merge()
         WARN_ON(dun exists)

So, it should update req->__dun having correct ICE configuration.

Bug: 118824609
Bug: 119454809
Change-Id: Ic79f9474b56b2b911c9083c3a80f3e686bb432bd
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
[stummala@codeaurora.org: Fix merge conflicts]
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2018-12-12 09:07:26 +05:30
Ming Lei
a061395786 SCSI: fix queue cleanup race before queue initialization is done
commit 8dc765d438f1e42b3e8227b3b09fad7d73f4ec9a upstream.

c2856ae2f315d ("blk-mq: quiesce queue before freeing queue") has
already fixed this race, however the implied synchronize_rcu()
in blk_mq_quiesce_queue() can slow down LUN probe a lot, so caused
performance regression.

Then 1311326cf4755c7 ("blk-mq: avoid to synchronize rcu inside blk_cleanup_queue()")
tried to quiesce queue for avoiding unnecessary synchronize_rcu()
only when queue initialization is done, because it is usual to see
lots of inexistent LUNs which need to be probed.

However, turns out it isn't safe to quiesce queue only when queue
initialization is done. Because when one SCSI command is completed,
the user of sending command can be waken up immediately, then the
scsi device may be removed, meantime the run queue in scsi_end_request()
is still in-progress, so kernel panic can be caused.

In Red Hat QE lab, there are several reports about this kind of kernel
panic triggered during kernel booting.

This patch tries to address the issue by grabing one queue usage
counter during freeing one request and the following run queue.

Fixes: 1311326cf4755c7 ("blk-mq: avoid to synchronize rcu inside blk_cleanup_queue()")
Cc: Andrew Jones <drjones@redhat.com>
Cc: Bart Van Assche <bart.vanassche@wdc.com>
Cc: linux-scsi@vger.kernel.org
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: James E.J. Bottomley <jejb@linux.vnet.ibm.com>
Cc: stable <stable@vger.kernel.org>
Cc: jianchao.wang <jianchao.w.wang@oracle.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-21 09:24:09 +01:00
Blagovest Kolenichev
ce2f7fefc5 Merge android-4.14-p.81 (b435b51) into msm-4.14
* refs/heads/tmp-b435b51:
  Linux 4.14.81
  MD: fix invalid stored role for a disk - try2
  bpf: wait for running BPF programs when updating map-in-map
  net: sched: Remove TCA_OPTIONS from policy
  Btrfs: fix fsync after hole punching when using no-holes feature
  Btrfs: fix use-after-free when dumping free space
  Btrfs: fix use-after-free during inode eviction
  btrfs: move the dio_sem higher up the callchain
  btrfs: don't run delayed_iputs in commit
  btrfs: only free reserved extent if we didn't insert it
  btrfs: don't use ctl->free_space for max_extent_size
  btrfs: set max_extent_size properly
  Btrfs: fix assertion on fsync of regular file when using no-holes feature
  Btrfs: fix null pointer dereference on compressed write path error
  btrfs: qgroup: Dirty all qgroups before rescan
  Btrfs: fix wrong dentries after fsync of file that got its parent replaced
  Btrfs: fix warning when replaying log after fsync of a tmpfile
  btrfs: make sure we create all new block groups
  btrfs: reset max_extent_size on clear in a bitmap
  btrfs: protect space cache inode alloc with GFP_NOFS
  btrfs: wait on caching when putting the bg cache
  btrfs: don't attempt to trim devices that don't support it
  btrfs: iterate all devices during trim, instead of fs_devices::alloc_list
  btrfs: Ensure btrfs_trim_fs can trim the whole filesystem
  btrfs: Enhance btrfs_trim_fs function to handle error better
  btrfs: fix error handling in free_log_tree
  btrfs: locking: Add extra check in btrfs_init_new_buffer() to avoid deadlock
  btrfs: Handle owner mismatch gracefully when walking up tree
  btrfs: qgroup: Avoid calling qgroup functions if qgroup is not enabled
  selftests/powerpc: Fix ptrace tm failure
  soc/tegra: pmc: Fix child-node lookup
  arm64: dts: stratix10: Correct System Manager register size
  ARM: dts: socfpga: Fix SDRAM node address for Arria10
  Cramfs: fix abad comparison when wrap-arounds occur
  rpmsg: smd: fix memory leak on channel create
  arm64: lse: remove -fcall-used-x0 flag
  media: media colorspaces*.rst: rename AdobeRGB to opRGB
  media: em28xx: make v4l2-compliance happier by starting sequence on zero
  media: em28xx: fix input name for Terratec AV 350
  media: tvp5150: avoid going past array on v4l2_querymenu()
  media: em28xx: use a default format if TRY_FMT fails
  xen-blkfront: fix kernel panic with negotiate_mq error path
  xen: fix xen_qlock_wait()
  kgdboc: Passing ekgdboc to command line causes panic
  media: v4l2-tpg: fix kernel oops when enabling HFLIP and OSD
  TC: Set DMA masks for devices
  iommu/arm-smmu: Ensure that page-table updates are visible before TLBI
  MIPS: OCTEON: fix out of bounds array access on CN68XX
  powerpc/msi: Fix compile error on mpc83xx
  dm zoned: fix various dmz_get_mblock() issues
  dm zoned: fix metadata block ref counting
  dm ioctl: harden copy_params()'s copy_from_user() from malicious users
  lockd: fix access beyond unterminated strings in prints
  nfsd: Fix an Oops in free_session()
  nfs: Fix a missed page unlock after pg_doio()
  NFSv4.1: Fix the r/wsize checking
  genirq: Fix race on spurious interrupt detection
  printk: Fix panic caused by passing log_buf_len to command line
  smb3: on kerberos mount if server doesn't specify auth type use krb5
  smb3: do not attempt cifs operation in smb3 query info error path
  smb3: allow stats which track session and share reconnects to be reset
  w1: omap-hdq: fix missing bus unregister at removal
  iio: adc: at91: fix wrong channel number in triggered buffer mode
  iio: adc: at91: fix acking DRDY irq on simple conversions
  iio: adc: imx25-gcq: Fix leak of device_node in mx25_gcq_setup_cfgs()
  iio: ad5064: Fix regulator handling
  kbuild: fix kernel/bounds.c 'W=1' warning
  KVM: arm64: Fix caching of host MDCR_EL2 value
  mm/rmap: map_pte() was not handling private ZONE_DEVICE page properly
  hugetlbfs: dirty pages as they are added to pagecache
  ima: fix showing large 'violations' or 'runtime_measurements_count'
  mm: /proc/pid/smaps_rollup: fix NULL pointer deref in smaps_pte_range()
  crypto: tcrypt - fix ghash-generic speed test
  crypto: lrw - Fix out-of bounds access on counter overflow
  signal: Guard against negative signal numbers in copy_siginfo_from_user32
  signal/GenWQE: Fix sending of SIGKILL
  PCI: vmd: White list for fast interrupt handlers
  PCI: Add Device IDs for Intel GPU "spurious interrupt" quirk
  PCI/ASPM: Fix link_state teardown on device removal
  ARM: dts: dra7: Fix up unaligned access setting for PCIe EP
  EDAC, skx_edac: Fix logical channel intermediate decoding
  EDAC, {i7core,sb,skx}_edac: Fix uncorrected error counting
  EDAC, amd64: Add Family 17h, models 10h-2fh support
  HID: hiddev: fix potential Spectre v1
  ext4: fix use-after-free race in ext4_remount()'s error path
  ext4: propagate error from dquot_initialize() in EXT4_IOC_FSSETXATTR
  ext4: fix setattr project check in fssetxattr ioctl
  ext4: initialize retries variable in ext4_da_write_inline_data_begin()
  gfs2_meta: ->mount() can get NULL dev_name
  jbd2: fix use after free in jbd2_log_do_checkpoint()
  IB/mlx5: Fix MR cache initialization
  ASoC: intel: skylake: Add missing break in skl_tplg_get_token()
  libnvdimm, region: Fail badblocks listing for inactive regions
  libnvdimm: Hold reference on parent while scheduling async init
  dmaengine: stm32-dma: fix incomplete configuration in cyclic mode
  dmaengine: ppc4xx: fix off-by-one build failure
  net/ipv4: defensive cipso option parsing
  iwlwifi: mvm: check return value of rs_rate_from_ucode_rate()
  usb: gadget: udc: renesas_usb3: Fix b-device mode for "workaround"
  usbip:vudc: BUG kmalloc-2048 (Not tainted): Poison overwritten
  libertas: don't set URB_ZERO_PACKET on IN USB transfer
  xen/pvh: don't try to unplug emulated devices
  xen/pvh: increase early stack size
  xen: make xen_qlock_wait() nestable
  xen: fix race in xen_qlock_wait()
  xen/balloon: Support xend-based toolstack
  xen/blkfront: avoid NULL blkfront_info dereference on device removal
  tpm: Restore functionality to xen vtpm driver.
  xen-swiotlb: use actually allocated size on check physical continuous
  ARM: dts: exynos: Mark 1 GHz CPU OPP as suspend OPP on Exynos5250
  ARM: dts: exynos: Convert exynos5250.dtsi to opp-v2 bindings
  arm: dts: exynos: Add missing cooling device properties for CPUs
  ARM: dts: exynos: Remove "cooling-{min|max}-level" for CPU nodes
  f2fs: fix to account IO correctly
  Revert "f2fs: fix to clear PG_checked flag in set_page_dirty()"
  cpupower: Fix AMD Family 0x17 msr_pstate size
  ALSA: hda: Check the non-cached stream buffers more explicitly
  IB/rxe: fix for duplicate request processing and ack psns
  dmaengine: dma-jz4780: Return error if not probed from DT
  mfd: menelaus: Fix possible race condition and leak
  signal: Always deliver the kernel's SIGKILL and SIGSTOP to a pid namespace init
  f2fs: report error if quota off error during umount
  scsi: lpfc: Correct race with abort on completion path
  scsi: lpfc: Correct soft lockup when running mds diagnostics
  uio: ensure class is registered before devices
  driver/dma/ioat: Call del_timer_sync() without holding prep_lock
  usb: chipidea: Prevent unbalanced IRQ disable
  crypto: caam - fix implicit casts in endianness helpers
  PCI: dwc: pci-dra7xx: Enable errata i870 for both EP and RC mode
  coresight: etb10: Fix handling of perf mode
  PCI/MSI: Warn and return error if driver enables MSI/MSI-X twice
  f2fs: fix to recover inode's i_flags during POR
  MD: fix invalid stored role for a disk
  ext4: fix argument checking in EXT4_IOC_MOVE_EXT
  usb: gadget: udc: atmel: handle at91sam9rl PMC
  PCI / ACPI: Enable wake automatically for power managed bridges
  VMCI: Resource wildcard match fixed
  Drivers: hv: vmbus: Use cpumask_var_t for on-stack cpu mask
  tpm: suppress transmit cmd error logs when TPM 1.2 is disabled/deactivated
  PCI: mediatek: Fix mtk_pcie_find_port() endpoint/port matching logic
  usb: host: ohci-at91: fix request of irq for optional gpio
  RDMA/bnxt_re: Fix recursive lock warning in debug kernel
  IB/ipoib: Clear IPCB before icmp_send
  RDMA/core: Do not expose unsupported counters
  scsi: megaraid_sas: fix a missing-check bug
  KVM: nVMX: Clear reserved bits of #DB exit qualification
  UAPI: ndctl: Fix g++-unsupported initialisation in headers
  scsi: esp_scsi: Track residual for PIO transfers
  cgroup, netclassid: add a preemption point to write_classid
  thermal: da9062/61: Prevent hardware access during system suspend
  ath10k: schedule hardware restart if WMI command times out
  ixgbevf: VF2VF TCP RSS
  iwlwifi: mvm: fix BAR seq ctrl reporting
  net: dsa: mv88e6xxx: Fix writing to a PHY page.
  pinctrl: ssbi-gpio: Fix pm8xxx_pin_config_get() to be compliant
  pinctrl: spmi-mpp: Fix pmic_mpp_config_get() to be compliant
  pinctrl: qcom: spmi-mpp: Fix drive strength setting
  ACPI / LPSS: Add alternative ACPI HIDs for Cherry Trail DMA controllers
  kprobes: Return error if we fail to reuse kprobe instead of BUG_ON()
  block, bfq: correctly charge and reset entity service in all cases
  net: phy: phylink: ensure the carrier is off when starting phylink
  brcmfmac: fix for proper support of 160MHz bandwidth
  pinctrl: qcom: spmi-mpp: Fix err handling of pmic_mpp_set_mux
  x86: boot: Fix EFI stub alignment
  Bluetooth: btbcm: Add entry for BCM4335C0 UART bluetooth
  signal: Introduce COMPAT_SIGMINSTKSZ for use in compat_sys_sigaltstack
  mtd: rawnand: atmel: Fix potential NULL pointer dereference
  cpufreq: dt: Try freeing static OPPs only if we have added them
  ACPI / processor: Fix the return value of acpi_processor_ids_walk()
  x86/olpc: Indicate that legacy PC XO-1 platform should not register RTC
  iwlwifi: mvm: clear HW_RESTART_REQUESTED when stopping the interface
  iwlwifi: pcie: avoid empty free RB queue
  mmc: sdhci-pci-o2micro: Add quirk for O2 Micro dev 0x8620 rev 0x01
  cpupower: Fix coredump on VMWare
  perf strbuf: Match va_{add,copy} with va_end
  perf tools: Cleanup trace-event-info 'tdata' leak
  perf tools: Free temporary 'sys' string in read_event_files()
  spi: spi-ep93xx: Use dma_data_direction for ep93xx_spi_dma_{finish,prepare}
  lightnvm: pblk: fix two sleep-in-atomic-context bugs
  hwmon: (pwm-fan) Set fan speed to 0 on suspend
  s390/sthyi: Fix machine name validity indication
  tun: Consistently configure generic netdev params via rtnetlink
  nfp: devlink port split support for 1x100G CXP NIC
  swim: fix cleanup on setup error
  ataflop: fix error handling during setup
  locking/lockdep: Fix debug_locks off performance problem
  i2c: rcar: cleanup DMA for all kinds of failure
  selftests: ftrace: Add synthetic event syntax testcase
  net: qla3xxx: Remove overflowing shift statement
  x86/fpu: Remove second definition of fpu in __fpu__restore_sig()
  perf cpu_map: Align cpu map synthesized events properly.
  perf tools: Fix use of alternatives to find JDIR
  sched/fair: Fix the min_vruntime update logic in dequeue_entity()
  sparc64: Make proc_id signed.
  sparc: Throttle perf events properly.
  sparc: Fix single-pcr perf event counter management.
  perf vendor events intel: Fix wrong filter_band* values for uncore events
  xfrm: policy: use hlist rcu variants on insert
  Revert "perf tools: Fix PMU term format max value calculation"
  bpf: do not blindly change rlimit in reuseport net selftest
  ARM: dts: exynos: Disable pull control for MAX8997 interrupts on Origen
  x86/speculation: Support Enhanced IBRS on future CPUs
  x86/mm/pat: Disable preemption around __flush_tlb_all()
  x86/corruption-check: Fix panic in memory_corruption_check() when boot option without value is provided
  x86/xen: Fix boot loader version reported for PVH guests
  x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation
  ALSA: ca0106: Disable IZD on SB0570 DAC to fix audio pops
  ALSA: hda - Add mic quirk for the Lenovo G50-30 (17aa:3905)
  ALSA: hda/realtek - Fix the problem of the front MIC on the Lenovo M715
  ALSA: hda - Fix headphone pin config for ASUS G751
  ALSA: hda - Add quirk for ASUS G751 laptop
  parisc: Fix exported address of os_hpmc handler
  parisc: Fix map_pages() to not overwrite existing pte entries
  parisc: Fix address in HPMC IVA
  ipmi: Fix timer race with module unload
  pcmcia: Implement CLKRUN protocol disabling for Ricoh bridges
  cpufreq: conservative: Take limits changes into account properly
  jffs2: free jffs2_sb_info through jffs2_kill_sb()
  hwmon: (pmbus) Fix page count auto-detection.
  bcache: fix miss key refill->end in writeback
  bcache: trace missed reading by cache_missed
  spi: bcm-qspi: switch back to reading flash using smaller chunks
  mtd: spi-nor: fsl-quadspi: fix read error for flash size larger than 16MB

Conflicts:
	drivers/iommu/arm-smmu.c

Change-Id: I639fbf255e1ad1533d0018bfeb1a6b88109aa970
Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
2018-11-15 03:21:14 -08:00
Paolo Valente
d4d73f1fd8 block, bfq: correctly charge and reset entity service in all cases
[ Upstream commit cbeb869a3d1110450186b738199963c5e68c2a71 ]

BFQ schedules entities (which represent either per-process queues or
groups of queues) as a function of their timestamps. In particular, as
a function of their (virtual) finish times. The finish time of an
entity is computed as a function of the budget assigned to the entity,
assuming, tentatively, that the entity, once in service, will receive
an amount of service equal to its budget. Then, when the entity is
expired because it finishes to be served, this finish time is updated
as a function of the actual service received by the entity. This
allows the entity to be correctly charged with only the service
received, and then to be correctly re-scheduled.

Yet an entity may receive service also while not being the entity in
service (in the scheduling environment of its parent entity), for
several reasons. If the entity remains with no backlog while receiving
this 'unofficial' service, then it is expired. Also on such an
expiration, the finish time of the entity should be updated to account
for only the service actually received by the entity. Unfortunately,
such an update is not performed for an entity expiring without being
the entity in service.

In a similar vein, the service counter of the entity in service is
reset when the entity is expired, to be ready to be used for next
service cycle. This reset too should be performed also in case an
entity is expired because it remains empty after receiving service
while not being the entity in service. But in this case the reset is
not performed.

This commit performs the above update of the finish time and reset of
the service received, also for an entity expiring while not being the
entity in service.

Signed-off-by: Paolo Valente <paolo.valente@linaro.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-13 11:14:55 -08:00
qctecmdr Service
9aaa4fce66 Merge "Merge android-4.14-p.76 (864aacf) into msm-4.14" 2018-10-27 00:23:47 -07:00
Blagovest Kolenichev
107b1944f7 Merge android-4.14-p.76 (864aacf) into msm-4.14
* refs/heads/tmp-864aacf:
  Linux 4.14.76
  ath10k: fix scan crash due to incorrect length calculation
  virtio_balloon: fix increment of vb->num_pfns in fill_balloon()
  virtio_balloon: fix deadlock on OOM
  rds: rds_ib_recv_alloc_cache() should call alloc_percpu_gfp() instead
  ubifs: Check for name being NULL while mounting
  ucma: fix a use-after-free in ucma_resolve_ip()
  f2fs: fix invalid memory access
  perf utils: Move is_directory() to path.h
  crypto: chelsio - Fix memory corruption in DMA Mapped buffers.
  ARC: clone syscall to setp r25 as thread pointer
  powerpc/lib: fix book3s/32 boot failure due to code patching
  powerpc: Avoid code patching freed init sections
  powerpc/lib/code-patching: refactor patch_instruction()
  nvme_fc: fix ctrl create failures racing with workq items
  ath10k: fix kernel panic issue during pci probe
  ath10k: fix use-after-free in ath10k_wmi_cmd_send_nowait
  perf tools: Fix python extension build for gcc 8
  perf annotate: Use asprintf when formatting objdump command line
  of: unittest: Disable interrupt node tests for old world MAC systems
  tty: Drop tty->count on tty_reopen() failure
  usb: cdc_acm: Do not leak URB buffers
  USB: serial: simple: add Motorola Tetra MTP6550 id
  usb: xhci-mtk: resume USB3 roothub first
  xhci: Add missing CAS workaround for Intel Sunrise Point xHCI
  dm cache: fix resize crash if user doesn't reload cache table
  dm cache metadata: ignore hints array being too small during resize
  PM / core: Clear the direct_complete flag on errors
  mac80211: fix setting IEEE80211_KEY_FLAG_RX_MGMT for AP mode keys
  PCI: Reprogram bridge prefetch registers on resume
  x86/vdso: Fix vDSO syscall fallback asm constraint regression
  x86/vdso: Only enable vDSO retpolines when enabled and supported
  selftests/x86: Add clock_gettime() tests to test_vdso
  x86/vdso: Fix asm constraints on vDSO syscall fallbacks
  drm/syncobj: Don't leak fences when WAIT_FOR_SUBMIT is set
  drm/amdgpu: Fix vce work queue was not cancelled when suspend
  xen-netback: fix input validation in xenvif_set_hash_mapping()
  fbdev/omapfb: fix omapfb_memory_read infoleak
  clocksource/drivers/timer-atmel-pit: Properly handle error cases
  blk-mq: I/O and timer unplugs are inverted in blktrace
  KVM: x86: fix L1TF's MMIO GFN calculation
  mm/vmstat.c: skip NR_TLB_REMOTE_FLUSH* properly
  mm, thp: fix mlocking THP page with migration enabled
  mm: migration: fix migration of huge PMD shared pages
  perf/core: Add sanity check to deal with pinned event failure

Change-Id: I254c41b5b31bf3c5c305eaf87eb47196c3b3d088
Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
2018-10-19 00:19:46 -07:00
Jaegeuk Kim
8dbee71a2a fscrypt: pfk: ice: cover ICE-related data structures in CONFIG_PFK
This patch makes CONFIG_PFK cover all the per-file key structures.
Otherwise, for example, f2fs will set DUN, resulting in IO fragmentation,
even if PFK is not set.

Bug: 68721442
Change-Id: I93808db0b00feae53888fd9ae6c91fc2727ffca9
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
[neersoni@codeaurora.org: Removed redundant assignment operation.]
Signed-off-by: Neeraj Soni <neersoni@codeaurora.org>
2018-10-19 01:11:58 +05:30
qctecmdr Service
6618be6f36 Merge "Merge android-4.14-p.74 (91ff1d1) into msm-4.14" 2018-10-17 21:12:24 -07:00
qctecmdr Service
2330aa6c4c Merge "Merge android-4.14-p.70 (e601ab6) into msm-4.14" 2018-10-17 13:06:42 -07:00
Ilya Dryomov
8e2e2192eb blk-mq: I/O and timer unplugs are inverted in blktrace
commit 587562d0c7cd6861f4f90a2eb811cccb1a376f5f upstream.

trace_block_unplug() takes true for explicit unplugs and false for
implicit unplugs.  schedule() unplugs are implicit and should be
reported as timer unplugs.  While correct in the legacy code, this has
been inverted in blk-mq since 4.11.

Cc: stable@vger.kernel.org
Fixes: bd166ef183c2 ("blk-mq-sched: add framework for MQ capable IO schedulers")
Reviewed-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-13 09:27:22 +02:00
qctecmdr Service
1a0bb389ca Merge "Merge android-4.14-p.66 (d48d275) into msm-4.14" 2018-10-10 02:10:35 -07:00
Blagovest Kolenichev
7b3b13d255 Merge android-4.14-p.72 (f4819c2) into msm-4.14
* refs/heads/tmp-f4819c2:
  Linux 4.14.72
  e1000e: Fix check_for_link return value with autoneg off
  e1000e: Fix link check race condition
  Revert "e1000e: Separate signaling for link check/link up"
  e1000e: Avoid missed interrupts following ICR read
  e1000e: Fix queue interrupt re-raising in Other interrupt
  Partial revert "e1000e: Avoid receiver overrun interrupt bursts"
  e1000e: Remove Other from EIAC
  net/ipv6: prevent use after free in ip6_route_mpath_notify
  drm/i915: Apply the GTT write flush for all !llc machines
  ASoC: samsung: Fix invalid argument when devm_gpiod_get is called
  ASoC: samsung: i2s: Fix error handling path in i2s_set_sysclk()
  earlycon: Remove hardcoded port->uartclk initialization in of_setup_earlycon
  earlycon: Initialize port->uartclk based on clock-frequency property
  mei: bus: type promotion bug in mei_nfc_if_version()
  clk: tegra: bpmp: Don't crash when a clock fails to register
  pinctrl: qcom: spmi-gpio: Fix pmic_gpio_config_get() to be compliant
  pinctrl: msm: Fix msm_config_group_get() to be compliant
  blk-mq: avoid to synchronize rcu inside blk_cleanup_queue()
  blk-mq: only attempt to merge bio if there is rq in sw queue
  drm/panel: type promotion bug in s6e8aa0_read_mtp_id()
  selftest: timers: Tweak raw_skew to SKIP when ADJ_OFFSET/other clock adjustments are in progress
  scsi: libfc: fixup 'sleeping function called from invalid context'
  ALSA: pcm: Fix snd_interval_refine first/last with open min/max
  rtc: bq4802: add error handling for devm_ioremap
  drm/amdkfd: Fix error codes in kfd_get_process
  input: rohm_bu21023: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT)
  mfd: 88pm860x-i2c: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT)
  gpiolib: Mark gpio_suffixes array with __maybe_unused
  gpio: pxa: Fix potential NULL dereference
  staging: bcm2835-audio: Don't leak workqueue if open fails
  coresight: ETM: Add support for Arm Cortex-A73 and Cortex-A35
  coresight: tpiu: Fix disabling timeouts
  coresight: Handle errors in finding input/output ports
  sched/fair: Fix util_avg of new tasks for asymmetric systems
  parport: sunbpp: fix error return code
  drm/nouveau: tegra: Detach from ARM DMA/IOMMU mapping
  drm/nouveau/debugfs: Wake up GPU before doing any reclocking
  drm/nouveau: Fix runtime PM leak in drm_open()
  mmc: sdhci: do not try to use 3.3V signaling if not supported
  mmc: tegra: prevent HS200 on Tegra 3
  mmc: sdhci-of-esdhc: set proper dma mask for ls104x chips
  tty: fix termios input-speed encoding
  tty: fix termios input-speed encoding when using BOTHER
  gpu: ipu-v3: csi: pass back mbus_code_to_bus_cfg error codes
  liquidio: fix hang when re-binding VF host drv after running DPDK VF driver
  ARM: hisi: check of_iomap and fix missing of_node_put
  ARM: hisi: fix error handling and missing of_node_put
  ARM: hisi: handle of_iomap and fix missing of_node_put
  efi/esrt: Only call efi_mem_reserve() for boot services memory
  sched/core: Use smp_mb() in wake_woken_function()
  pinctrl: rza1: Fix selector use for groups and functions
  configfs: fix registered group removal
  MIPS: loongson64: cs5536: Fix PCI_OHCI_INT_REG reads
  security: check for kstrdup() failure in lsm_append()
  KVM: PPC: Book3S HV: Add of_node_put() in success path
  evm: Don't deadlock if a crypto algorithm is unavailable
  Bluetooth: Use lock_sock_nested in bt_accept_enqueue
  vfs: fix freeze protection in mnt_want_write_file() for overlayfs
  mtdchar: fix overflows in adjustment of `count`
  audit: fix use-after-free in audit_add_watch
  arm64: dts: uniphier: Add missing cooling device properties for CPUs
  net/mlx5: Add missing SET_DRIVER_VERSION command translation
  binfmt_elf: Respect error return from `regset->active'
  NFSv4.1 fix infinite loop on I/O.
  x86/EISA: Don't probe EISA bus for Xen PV guests
  perf/core: Force USER_DS when recording user stack data
  xtensa: ISS: don't allocate memory in platform_setup
  CIFS: fix wrapping bugs in num_entries()
  cifs: prevent integer overflow in nxt_dir_entry()
  Revert "cdc-acm: implement put_char() and flush_chars()"
  usb: cdc-wdm: Fix a sleep-in-atomic-context bug in service_outstanding_interrupt()
  USB: yurex: Fix buffer over-read in yurex_write()
  USB: serial: ti_usb_3410_5052: fix array underflow in completion handler
  usb: misc: uss720: Fix two sleep-in-atomic-context bugs
  USB: serial: io_ti: fix array underflow in completion handler
  USB: net2280: Fix erroneous synchronization change
  usb: gadget: udc: renesas_usb3: fix maxpacket size of ep0
  USB: add quirk for WORLDE Controller KS49 or Prodipe MIDI 49C USB controller
  usb: host: u132-hcd: Fix a sleep-in-atomic-context bug in u132_get_frame()
  usb: Avoid use-after-free by flushing endpoints early in usb_set_interface()
  usb: uas: add support for more quirk flags
  USB: Add quirk to support DJI CineSSD
  mei: bus: need to unlink client before freeing
  mei: ignore not found client in the enumeration
  usb: Don't die twice if PCI xhci host is not responding in resume
  xhci: Fix use after free for URB cancellation on a reallocated endpoint
  misc: hmc6352: fix potential Spectre v1
  Tools: hv: Fix a bug in the key delete code
  ipmi: Fix I2C client removal in the SSIF driver
  mmc: omap_hsmmc: fix wakeirq handling on removal
  s390/crypto: Fix return code checking in cbc_paes_crypt()
  IB/ipoib: Avoid a race condition between start_xmit and cm_rep_handler
  xen/netfront: fix waiting for xenbus state change
  pstore: Fix incorrect persistent ram buffer mapping
  RDMA/cma: Protect cma dev list with lock
  xen-netfront: fix warn message as irq device name has '/'
  x86/mm/pti: Add an overflow check to pti_clone_pmds()
  x86/pti: Check the return value of pti_user_pagetable_walk_pmd()
  x86/pti: Check the return value of pti_user_pagetable_walk_p4d()
  crypto: sharah - Unregister correct algorithms for SAHARA 3
  dmaengine: mv_xor_v2: kill the tasklets upon exit
  i2c: aspeed: Fix initial values of master and slave state
  drivers/base: stop new probing during shutdown
  KVM: arm/arm64: Fix vgic init race
  platform/x86: toshiba_acpi: Fix defined but not used build warnings
  s390/qeth: reset layer2 attribute on layer switch
  s390/qeth: fix race in used-buffer accounting
  ARM: dts: qcom: msm8974-hammerhead: increase load on l20 for sdhci
  arm64: dts: qcom: db410c: Fix Bluetooth LED trigger
  xen-netfront: fix queue name setting
  nfp: avoid buffer leak when FW communication fails
  efi/arm: preserve early mapping of UEFI memory map longer for BGRT
  reset: imx7: Fix always writing bits as 0
  arm64: fix possible spectre-v1 write in ptrace_hbp_set_event()
  wan/fsl_ucc_hdlc: use IS_ERR_VALUE() to check return value of qe_muram_alloc
  Smack: Fix handling of IPv4 traffic received by PF_INET6 sockets
  mac80211: restrict delayed tailroom needed decrement
  MIPS: jz4740: Bump zload address
  ASoC: rt5514: Fix the issue of the delay volume applied
  staging: bcm2835-camera: handle wait_for_completion_timeout return properly
  staging: bcm2835-camera: fix timeout handling in wait_for_completion_timeout
  powerpc/powernv: opal_put_chars partial write fix
  KVM: arm/arm64: vgic: Fix possible spectre-v1 write in vgic_mmio_write_apr()
  nvme-rdma: unquiesce queues when deleting the controller
  perf powerpc: Fix callchain ip filtering
  ARM: exynos: Clear global variable on init error path
  fbdev: Distinguish between interlaced and progressive modes
  video: fbdev: pxafb: clear allocated memory for video modes
  perf powerpc: Fix callchain ip filtering when return address is in a register
  fbdev/via: fix defined but not used warning
  video: goldfishfb: fix memory leak on driver remove
  perf tools: Fix struct comm_str removal crash
  fbdev: omapfb: off by one in omapfb_register_client()
  perf tools: Synthesize GROUP_DESC feature in pipe mode
  gfs2: Don't reject a supposedly full bitmap if we have blocks reserved
  perf test: Fix subtest number when showing results
  media: ov5645: Supported external clock is 24MHz
  mtd/maps: fix solutionengine.c printk format warnings
  IB/ipoib: Fix error return code in ipoib_dev_init()
  block: allow max_discard_segments to be stacked
  IB/rxe: Drop QP0 silently
  media: videobuf2-core: check for q->error in vb2_core_qbuf()
  MIPS: ath79: fix system restart
  dmaengine: pl330: fix irq race with terminate_all
  media: tw686x: Fix oops on buffer alloc failure
  kbuild: add .DELETE_ON_ERROR special target
  clk: clk-fixed-factor: Clear OF_POPULATED flag in case of failure
  clk: core: Potentially free connection id
  clk: imx6ul: fix missing of_node_put()
  gfs2: Special-case rindex for gfs2_grow
  amd-xgbe: use dma_mapping_error to check map errors
  xfrm: fix 'passing zero to ERR_PTR()' warning
  ALSA: usb-audio: Fix multiple definitions in AU0828_DEVICE() macro
  ALSA: msnd: Fix the default sample sizes
  iommu/io-pgtable-arm-v7s: Abort allocation when table address overflows the PTE
  iommu/arm-smmu-v3: sync the OVACKFLG to PRIQ consumer register
  usb: dwc3: change stream event enable bit back to 13
  hv/netvsc: Fix NULL dereference at single queue mode fallback
  tcp: really ignore MSG_ZEROCOPY if no SO_ZEROCOPY
  erspan: return PACKET_REJECT when the appropriate tunnel is not found
  erspan: fix error handling for erspan tunnel
  net/tls: Set count of SG entries if sk_alloc_sg returns -ENOSPC
  net/mlx5: E-Switch, Fix memory leak when creating switchdev mode FDB tables
  net/mlx5: Fix debugfs cleanup in the device init/remove flow
  net/mlx5: Check for error in mlx5_attach_interface
  rds: fix two RCU related problems
  net: qca_spi: Fix race condition in spi transfers
  net/mlx5: Fix use-after-free in self-healing flow
  be2net: Fix memory leak in be_cmd_get_profile_config()

Conflicts:
	drivers/hwtracing/coresight/coresight-etm4x.c

Change-Id: I6e4f93f183ffe672a82e56e53bcd89a2234e40be
Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
2018-10-05 14:59:29 -07:00
Blagovest Kolenichev
e75d96f9f2 Merge android-4.14-p.71 (58b620f) into msm-4.14
* refs/heads/tmp-58b620f:
  Linux 4.14.71
  mm: get rid of vmacache_flush_all() entirely
  autofs: fix autofs_sbi() does not check super block type
  tuntap: fix use after free during release
  tun: fix use after free for ptr_ring
  mtd: ubi: wl: Fix error return code in ubi_wl_init()
  ip: frags: fix crash in ip_do_fragment()
  ip: process in-order fragments efficiently
  ip: add helpers to process in-order fragments faster.
  ipv4: frags: precedence bug in ip_expire()
  net: sk_buff rbnode reorg
  net: add rb_to_skb() and other rb tree helpers
  net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends
  ipv6: defrag: drop non-last frags smaller than min mtu
  net: modify skb_rbtree_purge to return the truesize of all purged skbs.
  net: speed up skb_rbtree_purge()
  ip: discard IPv4 datagrams with overlapping segments.
  inet: frags: fix ip6frag_low_thresh boundary
  inet: frags: get rid of ipfrag_skb_cb/FRAG_CB
  inet: frags: reorganize struct netns_frags
  rhashtable: reorganize struct rhashtable layout
  ipv6: frags: rewrite ip6_expire_frag_queue()
  inet: frags: do not clone skb in ip_expire()
  inet: frags: break the 2GB limit for frags storage
  inet: frags: remove inet_frag_maybe_warn_overflow()
  inet: frags: get rif of inet_frag_evicting()
  inet: frags: remove some helpers
  inet: frags: use rhashtables for reassembly units
  rhashtable: add schedule points
  ipv6: export ip6 fragments sysctl to unprivileged users
  inet: frags: refactor lowpan_net_frag_init()
  inet: frags: refactor ipv6_frag_init()
  inet: frags: Convert timers to use timer_setup()
  inet: frags: refactor ipfrag_init()
  inet: frags: add a pointer to struct netns_frags
  inet: frags: change inet_frags_init_net() return value
  drm/i915: set DP Main Stream Attribute for color range on DDI platforms
  RDMA/cma: Do not ignore net namespace for unbound cm_id
  MIPS: WARN_ON invalid DMA cache maintenance, not BUG_ON
  NFSv4.1: Fix a potential layoutget/layoutrecall deadlock
  f2fs: fix to do sanity check with {sit,nat}_ver_bitmap_bytesize
  mfd: ti_am335x_tscadc: Fix struct clk memory leak
  iommu/ipmmu-vmsa: Fix allocation in atomic context
  f2fs: Fix uninitialized return in f2fs_ioc_shutdown()
  f2fs: fix to wait on page writeback before updating page
  media: helene: fix xtal frequency setting at power on
  partitions/aix: fix usage of uninitialized lv_info and lvname structures
  partitions/aix: append null character to print data from disk
  media: s5p-mfc: Fix buffer look up in s5p_mfc_handle_frame_{new, copy_time} functions
  Input: atmel_mxt_ts - only use first T9 instance
  dm cache: only allow a single io_mode cache feature to be requested
  net: dcb: For wild-card lookups, use priority -1, not 0
  MIPS: generic: fix missing of_node_put()
  MIPS: Octeon: add missing of_node_put()
  f2fs: fix to do sanity check with reserved blkaddr of inline inode
  tpm/tpm_i2c_infineon: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT)
  tpm_tis_spi: Pass the SPI IRQ down to the driver
  f2fs: fix to skip GC if type in SSA and SIT is inconsistent
  pktcdvd: Fix possible Spectre-v1 for pkt_devs
  f2fs: try grabbing node page lock aggressively in sync scenario
  net: mvneta: fix mtu change on port without link
  pinctrl/amd: only handle irq if it is pending and unmasked
  gpio: ml-ioh: Fix buffer underwrite on probe error path
  pinctrl: imx: off by one in imx_pinconf_group_dbg_show()
  x86/mm: Remove in_nmi() warning from vmalloc_fault()
  Bluetooth: hidp: Fix handling of strncpy for hid->name information
  ath10k: disable bundle mgmt tx completion event support
  tools/testing/nvdimm: kaddr and pfn can be NULL to ->direct_access()
  scsi: 3ware: fix return 0 on the error path of probe
  ata: libahci: Correct setting of DEVSLP register
  ata: libahci: Allow reconfigure of DEVSLP register
  MIPS: Fix ISA virt/bus conversion for non-zero PHYS_OFFSET
  rpmsg: core: add support to power domains for devices
  wlcore: Set rx_status boottime_ns field on rx
  ath10k: prevent active scans on potential unusable channels
  ath9k_hw: fix channel maximum power level test
  ath9k: report tx status on EOSP
  macintosh/via-pmu: Add missing mmio accessors
  perf evlist: Fix error out while applying initial delay and LBR
  perf c2c report: Fix crash for empty browser
  NFSv4.0 fix client reference leak in callback
  perf tools: Allow overriding MAX_NR_CPUS at compile time
  f2fs: fix defined but not used build warnings
  f2fs: do not set free of current section
  f2fs: fix to active page in lru list for read path
  tty: rocket: Fix possible buffer overwrite on register_PCI
  Drivers: hv: vmbus: Cleanup synic memory free path
  firmware: vpd: Fix section enabled flag on vpd_section_destroy
  uio: potential double frees if __uio_register_device() fails
  misc: ti-st: Fix memory leak in the error path of probe()
  gpu: ipu-v3: default to id 0 on missing OF alias
  media: camss: csid: Configure data type and decode format properly
  timers: Clear timer_base::must_forward_clk with timer_base::lock held
  md/raid5: fix data corruption of replacements after originals dropped
  scsi: target: fix __transport_register_session locking
  blk-mq: fix updating tags depth
  net: phy: Fix the register offsets in Broadcom iProc mdio mux driver
  media: dw2102: Fix memleak on sequence of probes
  media: davinci: vpif_display: Mix memory leak on probe error path
  selftests/bpf: fix a typo in map in map test
  powerpc/powernv: Fix concurrency issue with npu->mmio_atsd_usage
  gpio: tegra: Move driver registration to subsys_init level
  Bluetooth: h5: Fix missing dependency on BT_HCIUART_SERDEV
  i2c: aspeed: Add an explicit type casting for *get_clk_reg_val
  ethtool: Remove trailing semicolon for static inline
  misc: mic: SCIF Fix scif_get_new_port() error handling
  ARC: [plat-axs*]: Enable SWAP
  tpm: separate cmd_ready/go_idle from runtime_pm
  crypto: aes-generic - fix aes-generic regression on powerpc
  switchtec: Fix Spectre v1 vulnerability
  x86/microcode: Update the new microcode revision unconditionally
  x86/microcode: Make sure boot_cpu_data.microcode is up-to-date
  cpu/hotplug: Prevent state corruption on error rollback
  cpu/hotplug: Adjust misplaced smb() in cpuhp_thread_fun()
  ALSA: hda - Fix cancel_work_sync() stall from jackpoll work
  KVM: VMX: Do not allow reexecute_instruction() when skipping MMIO instr
  KVM: s390: vsie: copy wrapping keys to right place
  Btrfs: fix data corruption when deduplicating between different files
  smb3: check for and properly advertise directory lease support
  SMB3: Backup intent flag missing for directory opens with backupuid mounts
  MIPS: VDSO: Match data page cache colouring when D$ aliases
  android: binder: fix the race mmap and alloc_new_buf_locked
  block: bfq: swap puts in bfqg_and_blkg_put
  nbd: don't allow invalid blocksize settings
  scsi: lpfc: Correct MDS diag and nvmet configuration
  i2c: i801: fix DNV's SMBCTRL register offset
  i2c: xiic: Make the start and the byte count write atomic

Conflicts:
	include/linux/mm_types.h

Change-Id: I6d5ca1fc3e58d896127ca7a4a7ec6f662d9ab634
Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
2018-10-05 14:59:24 -07:00
Blagovest Kolenichev
9cf1fbab82 Merge android-4.14-p.70 (e601ab6) into msm-4.14
* refs/heads/tmp-e601ab6:
  Linux 4.14.70
  arm64: Handle mismatched cache type
  arm64: Fix mismatched cache line size detection
  ASoC: wm8994: Fix missing break in switch
  arm64: cpu_errata: include required headers
  x86: kvm: avoid unused variable warning
  kvm: x86: Set highest physical address bits in non-present/reserved SPTEs
  Revert "ARM: imx_v6_v7_defconfig: Select ULPI support"
  irda: Only insert new objects into the global database via setsockopt
  irda: Fix memory leak caused by repeated binds of irda socket
  s390/lib: use expoline for all bcr instructions
  kbuild: make missing $DEPMOD a Warning instead of an Error
  drm/i915: Increase LSPCON timeout
  x86/xen: don't write ptes directly in 32-bit PV guests
  x86/pae: use 64 bit atomic xchg function in native_ptep_get_and_clear
  usb: dwc3: core: Fix ULPI PHYs and prevent phy_get/ulpi_init during suspend/resume
  HID: add quirk for another PIXART OEM mouse used by HP
  mm: Fix devm_memremap_pages() collision handling
  lightnvm: pblk: free padded entries in write buffer
  sched/deadline: Fix switching to -deadline
  debugobjects: Make stack check warning more informative
  uapi/linux/keyctl.h: don't use C++ reserved keyword as a struct member name
  drm/amdgpu:add VCN booting with firmware loaded by PSP
  drm/amdgpu:add VCN support in PSP driver
  drm/amdgpu:add new firmware id for VCN
  drm/amdgpu:add tmr mc address into amdgpu_firmware_info
  drm/amdgpu: update tmr mc address
  drm/edid: Add 6 bpc quirk for SDC panel in Lenovo B50-80
  drm/amd/pp/Polaris12: Fix a chunk of registers missed to program
  drm/amdgpu: Fix RLC safe mode test in gfx_v9_0_enter_rlc_safe_mode
  drm/i915/lpe: Mark LPE audio runtime pm as "no callbacks"
  ARM: rockchip: Force CONFIG_PM on Rockchip systems
  arm64: rockchip: Force CONFIG_PM on Rockchip systems
  btrfs: Don't remove block group that still has pinned down bytes
  btrfs: relocation: Only remove reloc rb_trees if reloc control has been initialized
  btrfs: replace: Reset on-disk dev stats value after replace
  btrfs: Exit gracefully when chunk map cannot be inserted to the tree
  kvm: nVMX: Fix fault vector for VMX operation at CPL > 0
  KVM: vmx: track host_state.loaded using a loaded_vmcs pointer
  clk: rockchip: Add pclk_rkpwm_pmu to PMU critical clocks in rk3399
  powerpc/pseries: Avoid using the size greater than RTAS_ERROR_LOG_MAX.
  powerpc/64s: Make rfi_flush_fallback a little more robust
  powerpc/platforms/85xx: fix t1042rdb_diu.c build errors & warning
  SMB3: Number of requests sent should be displayed for SMB3 not just CIFS
  smb3: fix reset of bytes read and written stats
  cfq: Suppress compiler warnings about comparisons
  RDS: IB: fix 'passing zero to ERR_PTR()' warning
  selftests/powerpc: Kill child processes on SIGINT
  iommu/omap: Fix cache flushes on L2 table entries
  ASoC: rt5677: Fix initialization of rt5677_of_match.data
  staging: comedi: ni_mio_common: fix subdevice flags for PFI subdevice
  dm kcopyd: avoid softlockup in run_complete_job
  PCI: mvebu: Fix I/O space end address calculation
  xen/balloon: fix balloon initialization for PVH Dom0
  Input: do not use WARN() in input_alloc_absinfo()
  NFSv4: Fix error handling in nfs4_sp4_select_mode()
  scsi: aic94xx: fix an error code in aic94xx_init()
  ACPI / scan: Initialize status to ACPI_STA_DEFAULT
  s390/dasd: fix panic for failed online processing
  s390/dasd: fix hanging offline processing due to canceled worker
  block: bvec_nr_vecs() returns value for wrong slab
  perf probe powerpc: Fix trace event post-processing
  powerpc: Fix size calculation using resource_size()
  powerpc/uaccess: Enable get_user(u64, *p) on 32-bit
  f2fs: fix to clear PG_checked flag in set_page_dirty()
  net/9p: fix error path of p9_virtio_probe
  net/9p/trans_fd.c: fix race by holding the lock
  irqchip/bcm7038-l1: Hide cpu offline callback when building for !SMP
  perf tools: Check for null when copying nsinfo.
  net: hns3: Fix for phy link issue when using marvell phy driver
  net: hns3: Fix for command format parsing error in hclge_is_all_function_id_zero
  RDMA/hns: Fix usage of bitmap allocation functions return values
  tcp, ulp: add alias for all ulp modules
  netfilter: fix memory leaks on netlink_dump_start error
  platform/x86: asus-nb-wmi: Add keymap entry for lid flip action on UX360
  mfd: sm501: Set coherent_dma_mask when creating subdevices
  ipvs: fix race between ip_vs_conn_new() and ip_vs_del_dest()
  s390/kdump: Fix memleak in nt_vmcoreinfo
  netfilter: ip6t_rpfilter: set F_IFACE for linklocal addresses
  platform/x86: intel_punit_ipc: fix build errors
  fs/dcache.c: fix kmemcheck splat at take_dentry_name_snapshot()
  mm/fadvise.c: fix signed overflow UBSAN complaint
  pwm: meson: Fix mux clock names
  IB/hfi1: Invalid NUMA node information can cause a divide by zero
  x86/mce: Add notifier_block forward declaration
  virtio: pci-legacy: Validate queue pfn
  scripts: modpost: check memory allocation results
  fat: validate ->i_start before using
  fs/proc/kcore.c: use __pa_symbol() for KCORE_TEXT list entries
  hfsplus: fix NULL dereference in hfsplus_lookup()
  reiserfs: change j_timestamp type to time64_t
  fork: don't copy inconsistent signal handler state to child
  sunrpc: Don't use stack buffer with scatterlist
  hfs: prevent crash on exit from failed search
  hfsplus: don't return 0 when fill_super() failed
  cifs: check if SMB2 PDU size has been padded and suppress the warning
  net: sched: action_ife: take reference to meta module
  act_ife: fix a potential deadlock
  act_ife: move tcfa_lock down to where necessary
  hv_netvsc: Fix a deadlock by getting rtnl lock earlier in netvsc_probe()
  hv_netvsc: ignore devices that are not PCI
  vhost: correctly check the iova range when waking virtqueue
  mlxsw: spectrum_switchdev: Do not leak RIFs when removing bridge
  sctp: hold transport before accessing its asoc in sctp_transport_get_next
  nfp: wait for posted reconfigs when disabling the device
  tipc: fix a missing rhashtable_walk_exit()
  net/sched: act_pedit: fix dump of extended layered op
  vti6: remove !skb->ignore_df check from vti6_xmit()
  tcp: do not restart timewait timer on rst reception
  r8169: add support for NCube 8168 network card
  qlge: Fix netdev features configuration.
  net: sched: Fix memory exposure from short TCA_U32_SEL
  net: macb: do not disable MDIO bus at open/close time
  net: bcmgenet: use MAC link status for fixed phy
  ipv4: tcp: send zero IPID for RST and ACK sent in SYN-RECV and TIME-WAIT state
  act_ife: fix a potential use-after-free

Conflicts:
	arch/arm64/include/asm/cpucaps.h
	arch/arm64/kernel/cpu_errata.c
	drivers/usb/dwc3/core.c

Change-Id: If27731291adb25e780b5eb7f202762f6ea065cd8
Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
2018-10-05 14:59:19 -07:00
Blagovest Kolenichev
3c38b3e52e Merge android-4.14-p.69 (c535ee7) into msm-4.14
* refs/heads/tmp-c535ee7:
  Linux 4.14.69
  arm64: mm: always enable CONFIG_HOLES_IN_ZONE
  fs/quota: Fix spectre gadget in do_quotactl
  crypto: caam/qi - fix error path in xts setkey
  crypto: caam/jr - fix descriptor DMA unmapping
  crypto: caam - fix DMA mapping direction for RSA forms 2 & 3
  crypto: vmx - Fix sleep-in-atomic bugs
  perf auxtrace: Fix queue resize
  cap_inode_getsecurity: use d_find_any_alias() instead of d_find_alias()
  bcache: release dc->writeback_lock properly in bch_writeback_thread()
  libnvdimm: fix ars_status output length calculation
  getxattr: use correct xattr length
  udlfb: set optimal write delay
  fb: fix lost console when the user unplugs a USB adapter
  pwm: tiehrpwm: Fix disabling of output of PWMs
  pwm: tiehrpwm: Don't use emulation mode bits to control PWM output
  ubifs: Fix synced_i_size calculation for xattr inodes
  ubifs: xattr: Don't operate on deleted inodes
  ubifs: Check data node size before truncate
  Revert "UBIFS: Fix potential integer overflow in allocation"
  ubifs: Fix memory leak in lprobs self-check
  userns: move user access out of the mutex
  sys: don't hold uts_sem while accessing userspace memory
  iommu/vt-d: Fix dev iotlb pfsid use
  iommu/vt-d: Add definitions for PFSID
  mm/tlb: Remove tlb_remove_table() non-concurrent condition
  ARM: tegra: Fix Tegra30 Cardhu PCA954x reset
  NFSv4: Fix a sleep in atomic context in nfs4_callback_sequence()
  NFSv4: Fix locking in pnfs_generic_recover_commit_reqs
  NFSv4 client live hangs after live data migration recovery
  pnfs/blocklayout: off by one in bl_map_stripe()
  block, bfq: return nbytes and not zero from struct cftype .write() method
  xtensa: increase ranges in ___invalidate_{i,d}cache_all
  xtensa: limit offsets in __loop_cache_{all,page}
  KVM: PPC: Book3S: Fix guest DMA when guest partially backed by THP pages
  KVM: VMX: fixes for vmentry_l1d_flush module parameter
  PM / sleep: wakeup: Fix build error caused by missing SRCU support
  cpufreq: governor: Avoid accessing invalid governor_data
  drivers/block/zram/zram_drv.c: fix bug storing backing_dev
  ovl: fix wrong use of impure dir cache in ovl_iterate()
  mfd: hi655x: Fix regmap area declared size for hi655x
  uprobes: Use synchronize_rcu() not synchronize_sched()
  livepatch: Validate module/old func name length
  printk/tracing: Do not trace printk_nmi_enter()
  tracing/blktrace: Fix to allow setting same value
  tracing: Do not call start/stop() functions when tracing_on does not change
  rtc: omap: fix potential crash on power off
  vmw_balloon: fix VMCI use when balloon built into kernel
  vmw_balloon: VMCI_DOORBELL_SET does not check status
  vmw_balloon: do not use 2MB without batching
  vmw_balloon: fix inflation of 64-bit GFNs
  extcon: Release locking when sending the notification of connector state
  iio: ad9523: Fix return value for ad952x_store()
  iio: ad9523: Fix displayed phase
  iio: sca3000: Fix missing return in switch
  Drivers: hv: vmbus: Reset the channel callback in vmbus_onoffer_rescind()
  uart: fix race between uart_put_char() and uart_shutdown()
  dm crypt: don't decrease device limits
  dm cache metadata: set dirty on all cache blocks after a crash
  dm cache metadata: save in-core policy_hint_size to on-disk superblock
  dm thin: stop no_space_timeout worker when switching to write-mode
  dm integrity: change 'suspending' variable from bool to int
  net/9p/trans_fd.c: fix race-condition by flushing workqueue before the kfree()
  net/9p/client.c: version pointer uninitialized
  9p/virtio: fix off-by-one error in sg list bounds check
  fs/9p/xattr.c: catch the error of p9_client_clunk when setting xattr failed
  9p: fix multiple NULL-pointer-dereferences
  RDMA/rxe: Set wqe->status correctly if an unexpected response is received
  ib_srpt: Fix a use-after-free in srpt_close_ch()
  cxl: Fix wrong comparison in cxl_adapter_context_get()
  powerpc/powernv/pci: Work around races in PCI bridge enabling
  PCI: Add wrappers for dev_printk()
  powerpc/pseries: Fix endianness while restoring of r3 in MCE handler.
  powerpc/fadump: handle crash memory ranges array index overflow
  Fix kexec forbidding kernels signed with keys in the secondary keyring to boot
  Replace magic for trusting the secondary keyring with #define
  mailbox: xgene-slimpro: Fix potential NULL pointer dereference
  media: Revert "[media] tvp5150: fix pad format frame height"
  libertas: fix suspend and resume for SDIO connected cards
  drm/i915/userptr: reject zero user_size
  block: really disable runtime-pm for blk-mq
  block: blk_init_allocated_queue() set q->fq as NULL in the fail case
  readahead: stricter check for bdi io_pages
  mmc: renesas_sdhi_internal_dmac: fix #define RST_RESERVED_BITS
  spi: cadence: Change usleep_range() to udelay(), for atomic context
  spi: spi-fsl-dspi: Fix imprecise abort on VF500 during probe
  spi: pxa2xx: Add support for Intel Ice Lake
  spi: davinci: fix a NULL pointer dereference
  9p/net: Fix zero-copy path in the 9p virtio transport
  net: mac802154: tx: expand tailroom if necessary
  net: 6lowpan: fix reserved space for single frames
  ANDROID: squashfs: resolve merge conflict with 4.14.68

Change-Id: I547b8351069d9529aa81d673f0a20e666618a74c
Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
2018-10-05 14:59:14 -07:00
Blagovest Kolenichev
da15d88574 Merge android-4.14-p.67 (75ac55a) into msm-4.14
* refs/heads/tmp-75ac55a:
  Linux 4.14.67
  reiserfs: fix broken xattr handling (heap corruption, bad retval)
  i2c: imx: Fix race condition in dma read
  i2c: core: ACPI: Properly set status byte to 0 for multi-byte writes
  PCI: pciehp: Fix unprotected list iteration in IRQ handler
  PCI: pciehp: Fix use-after-free on unplug
  PCI: Skip MPS logic for Virtual Functions (VFs)
  PCI: hotplug: Don't leak pci_slot on registration failure
  parisc: Remove unnecessary barriers from spinlock.h
  net/smc: no shutdown in state SMC_LISTEN
  packet: refine ring v3 block size test to hold one frame
  netfilter: conntrack: dccp: treat SYNC/SYNCACK as invalid if no prior state
  xfrm_user: prevent leaking 2 bytes of kernel memory
  parisc: Remove ordered stores from syscall.S
  f2fs: sanity check for total valid node blocks
  f2fs: return error during fill_super
  KVM: irqfd: fix race between EPOLLHUP and irq_bypass_register_consumer
  nvme: fix handling of metadata_len for NVME_IOCTL_IO_CMD
  ARM: dts: imx6: RDU2: fix irq type for mv88e6xxx switch
  ACPI / EC: Use ec_no_wakeup on more Thinkpad X1 Carbon 6th systems
  soc: imx: gpc: restrict register range for regmap access
  tcp: identify cryptic messages as TCP seq # bugs
  net: qca_spi: Fix log level if probe fails
  net: qca_spi: Make sure the QCA7000 reset is triggered
  net: qca_spi: Avoid packet drop during initial sync
  PCI: versatile: Fix I/O space page leak
  PCI: OF: Fix I/O space page leak
  kvmclock: fix TSC calibration for nested guests
  net: usb: rtl8150: demote allmulti message to dev_dbg()
  octeon_mgmt: Fix MIX registers configuration on MTU setup
  btrfs: scrub: Don't use inode page cache in scrub_handle_errored_block()
  ibmvnic: Fix error recovery on login failure
  net/ethernet/freescale/fman: fix cross-build error
  hv/netvsc: fix handling of fallback to single queue mode
  drm/nouveau/gem: off by one bugs in nouveau_gem_pushbuf_reloc_apply()
  pinctrl: nsp: Fix potential NULL dereference
  pinctrl: nsp: off by ones in nsp_pinmux_enable()
  pinctrl: ingenic: Fix inverted direction for < JZ4770
  tcp: remove DELAYED ACK events in DCTCP
  qlogic: check kstrtoul() for errors
  packet: reset network header if packet shorter than ll reserved space
  kbuild: suppress warnings from 'getconf LFS_*'
  tools: build: Use HOSTLDFLAGS with fixdep
  ixgbe: Be more careful when modifying MAC filters
  ARM: dts: am3517.dtsi: Disable reference to OMAP3 OTG controller
  ARM: DRA7/OMAP5: Enable ACTLR[0] (Enable invalidates of BTB) for secondary cores
  ARM: 8780/1: ftrace: Only set kernel memory back to read-only after boot
  RDMA/mlx5: Fix memory leak in mlx5_ib_create_srq() error path
  nfit: fix unchecked dereference in acpi_nfit_ctl
  perf script python: Fix dict reference counting
  perf tools: Fix compilation errors on gcc8
  perf llvm-utils: Remove bashism from kernel include fetch script
  scsi: qedi: Send driver state to MFW
  scsi: qedf: Send the driver state to MFW
  bnxt_en: Fix for system hang if request_irq fails
  bnxt_en: Always set output parameters in bnxt_get_max_rings().
  bnxt_en: Fix inconsistent BNXT_FLAG_AGG_RINGS logic.
  ARC: Improve cmpxchg syscall implementation
  netfilter: nf_conntrack: Fix possible possible crash on module loading.
  netfilter: nft_compat: explicitly reject ERROR and standard target
  drm/armada: fix irq handling
  drm/armada: fix colorkey mode property
  drm/tegra: Fix comparison operator for buffer size
  gpu: host1x: Check whether size of unpin isn't 0
  ieee802154: fakelb: switch from BUG_ON() to WARN_ON() on problem
  ieee802154: at86rf230: use __func__ macro for debug messages
  ieee802154: at86rf230: switch from BUG_ON() to WARN_ON() on problem
  nvmem: Don't let a NULL cell_id for nvmem_cell_get() crash us
  net/sched: act_tunnel_key: fix NULL dereference when 'goto chain' is used
  ARM: pxa: irq: fix handling of ICMR registers in suspend/resume
  ravb: fix invalid context bug while changing link options by ethtool
  ravb: fix invalid context bug while calling auto-negotiation by ethtool
  sh_eth: fix invalid context bug while changing link options by ethtool
  sh_eth: fix invalid context bug while calling auto-negotiation by ethtool
  net: qrtr: Broadcast messages only from control port
  ipv6: make ipv6_renew_options() interrupt/kernel safe
  netfilter: x_tables: set module owner for icmp(6) matches
  ieee802154: 6lowpan: set IFLA_LINK
  samples/bpf: Check the error of write() and read()
  samples/bpf: Check the result of system()
  samples/bpf: add missing <linux/if_vlan.h>
  drm/bridge/sii8620: Fix display of packed pixel modes
  smsc75xx: Add workaround for gigabit link up hardware errata.
  kasan: fix shadow_size calculation error in kasan_module_alloc
  tracing: Use __printf markup to silence compiler
  bpf: hash map: decrement counter on error
  ARM: imx_v4_v5_defconfig: Select ULPI support
  ARM: imx_v6_v7_defconfig: Select ULPI support
  HID: wacom: Correct touch maximum XY of 2nd-gen Intuos
  x86/mm/32: Initialize the CR4 shadow before __flush_tlb_all()
  drm/amdgpu: fix swapped emit_ib_size in vce3
  ipvlan: call dev_change_flags when ipvlan mode is reset
  objtool: Support GCC 8 '-fnoreorder-functions'
  m68k: fix "bad page state" oops on ColdFire boot
  openrisc: entry: Fix delay slot exception detection
  acpi/nfit: fix cmd_rc for acpi_nfit_ctl to always return a value
  dpaa_eth: DPAA SGT needs to be 256B
  fsl/fman: fix parser reporting bad checksum on short frames
  bnx2x: Fix receiving tx-timeout in error or recovery state.
  PCI: faraday: Add missing of_node_put()
  PCI: xilinx-nwl: Add missing of_node_put()
  PCI: xilinx: Add missing of_node_put()
  bpf, s390: fix potential memleak when later bpf_jit_prog fails
  drbd: Fix drbd_request_prepare() discard handling
  drm/exynos: decon5433: Fix WINCONx reset value
  drm/exynos: decon5433: Fix per-plane global alpha for XRGB modes
  drm/exynos: gsc: Fix support for NV16/61, YUV420/YVU420 and YUV422 modes
  nl80211: check nla_parse_nested() return values
  nl80211: relax ht operation checks for mesh
  dev-dax: check_vma: ratelimit dev_info-s
  md/raid10: fix that replacement cannot complete recovery after reassemble
  ath10k: update the phymode along with bandwidth change request
  dmaengine: k3dma: Off by one in k3_of_dma_simple_xlate()
  dmaengine: pl330: report BURST residue granularity
  ARM64: dts: meson-gxl: fix Mali GPU compatible string
  ARM: dts: da850: Fix interrups property for gpio
  selftests/x86/sigreturn: Do minor cleanups
  selftests/x86/sigreturn/64: Fix spurious failures on AMD CPUs
  nfp: cast sizeof() to int when comparing with error code
  net/mlx5: E-Switch, Disallow vlan/spoofcheck setup if not being esw manager
  ceph: fix dentry leak in splice_dentry()
  netfilter: nf_log: fix uninit read in nf_log_proc_dostring
  ARM: davinci: board-da850-evm: fix WP pin polarity for MMC/SD
  perf bench: Fix numa report output code
  perf tools: Fix a clang 7.0 compilation error
  perf report powerpc: Fix crash if callchain is empty
  perf test session topology: Fix test on s390
  perf record: Support s390 random socket_id assignment
  kconfig: fix line numbers for if-entries in menu tree
  typec: tcpm: Fix a msecs vs jiffies bug
  NFC: pn533: Fix wrong GFP flag usage
  usb: xhci: increase CRS timeout value
  usb: xhci: remove the code build warning
  ALSA: seq: Fix UBSAN warning at SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT ioctl
  ARM: dts: am437x: make edt-ft5x06 a wakeup source
  brcmfmac: stop watchdog before detach and free everything
  iio: pressure: bmp280: fix relative humidity unit
  cxgb4: when disabling dcb set txq dcb priority to 0
  batman-adv: Fix multicast TT issues with bogus ROAM flags
  batman-adv: Avoid storing non-TT-sync flags on singular entries too
  batman-adv: Fix bat_v best gw refcnt after netlink dump
  batman-adv: Fix bat_ogm_iv best gw refcnt after netlink dump
  arm64: dts: msm8916: fix Coresight ETF graph connections
  Smack: Mark inode instant in smack_task_to_inode
  ipv6: mcast: fix unsolicited report interval after receiving querys
  x86/microcode/intel: Fix memleak in save_microcode_patch()
  mtd: dataflash: Use ULL suffix for 64-bit constants
  selftests: bpf: notification about privilege required to run test_kmod.sh testing script
  locking/lockdep: Do not record IRQ state within lockdep code
  drm/bridge/sii8620: fix display of packed pixel modes in MHL2
  KVM: arm/arm64: Drop resource size check for GICV window
  sctp: fix erroneous inc of snmp SctpFragUsrMsgs
  net: davinci_emac: match the mdio device against its compatible if possible
  nbd: Add the nbd NBD_DISCONNECT_ON_CLOSE config flag.
  ARC: Enable machine_desc->init_per_cpu for !CONFIG_SMP
  block: sed-opal: Fix a couple off by one bugs
  nvmet: reset keep alive timer in controller enable
  net: stmmac: socfpga: add additional ocp reset line for Stratix10
  net: propagate dev_get_valid_name return code
  net: hamradio: use eth_broadcast_addr
  enic: initialize enic->rfs_h.lock in enic_probe
  qed: Do not advertise DCBX_LLD_MANAGED capability.
  qed: Add sanity check for SIMD fastpath handler.
  qed: Fix possible memory leak in Rx error path handling.
  arm64: make secondary_start_kernel() notrace
  arm64: dma-mapping: clear buffers allocated with FORCE_CONTIGUOUS flag
  xen/scsiback: add error handling for xenbus_printf
  scsi: xen-scsifront: add error handling for xenbus_printf
  pNFS: Always free the session slot on error in nfs4_layoutget_handle_exception
  xen: add error handling for xenbus_printf
  dwc2: gadget: Fix ISOC IN DDMA PID bitfield value calculation
  usb: gadget: dwc2: fix memory leak in gadget_init()
  usb: gadget: composite: fix delayed_status race condition when set_interface
  usb: dwc2: fix isoc split in transfer with no data
  usb: dwc2: alloc dma aligned buffer for isoc split in
  libahci: Fix possible Spectre-v1 pmp indexing in ahci_led_store()
  IB/rxe: Fix missing completion for mem_reg work requests
  drm/arm/malidp: Preserve LAYER_FORMAT contents when setting format
  drm: mali-dp: Enable Global SE interrupts mask for DP500
  drivers/perf: xgene_pmu: Fix IOB SLOW PMU parser error
  arm64: dts: Stingray: Fix I2C controller interrupt type
  arm64: dts: ns2: Fix PCIe controller interrupt type
  arm64: dts: ns2: Fix I2C controller interrupt type
  arm64: dts: specify 1.8V EMMC capabilities for bcm958742t
  arm64: dts: specify 1.8V EMMC capabilities for bcm958742k
  ARM: dts: Cygnus: Fix PCIe controller interrupt type
  ARM: dts: Cygnus: Fix I2C controller interrupt type
  ARM: dts: BCM5301x: Fix i2c controller interrupt type
  ARM: dts: NSP: Fix PCIe controllers interrupt types
  ARM: dts: NSP: Fix i2c controller interrupt type
  selftests: sync: add config fragment for testing sync framework
  selftests: vm: return Kselftest Skip code for skipped tests
  selftests: zram: return Kselftest Skip code for skipped tests
  selftests: user: return Kselftest Skip code for skipped tests
  selftests: sysctl: return Kselftest Skip code for skipped tests
  selftests: static_keys: return Kselftest Skip code for skipped tests
  selftests: pstore: return Kselftest Skip code for skipped tests
  netfilter: nf_ct_helper: Fix possible panic after nf_conntrack_helper_unregister
  netfilter: ipv6: nf_defrag: reduce struct net memory waste
  ACPI / EC: Use ec_no_wakeup on Thinkpad X1 Carbon 6th
  usb: dwc3: of-simple: fix use-after-free on remove
  usb: dwc2: gadget: Fix issue in dwc2_gadget_start_isoc()
  usb: gadget: ffs: Fix BUG when userland exits with submitted AIO transfers
  usb: dwc3: pci: add support for Intel IceLake
  soc: imx: gpcv2: correct PGC offset
  hwmon: (nct6775) Fix loop limit
  ARC: Explicitly add -mmedium-calls to CFLAGS
  drm/bridge/sii8620: fix potential buffer overflow
  drm/bridge/sii8620: fix loops in EDID fetch logic
  IB/mlx4: Fix an error handling path in 'mlx4_ib_rereg_user_mr()'
  Input: synaptics-rmi4 - fix axis-swap behavior
  perf tools: Fix error index for pmu event parser
  vfio: ccw: fix error return in vfio_ccw_sch_event
  arm: dts: armada: Fix "#cooling-cells" property's name
  pty: fix O_CLOEXEC for TIOCGPTPEER
  EDAC: Add missing MEM_LRDDR4 entry in edac_mem_types[]
  drm/i915/kvmgt: Fix potential Spectre v1
  ext4: fix spectre gadget in ext4_mb_regular_allocator()

Conflicts:
	drivers/usb/gadget/function/f_fs.c
	net/qrtr/qrtr.c

Change-Id: I52226cb0e1405455b7e11255f1620d5e5fdfe916
Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
2018-10-05 14:52:04 -07:00
qctecmdr Service
9b12b8133e Merge "block: ratelimit the IO errors" 2018-10-03 22:16:34 -07:00
qctecmdr Service
942ab60077 Merge "security: pfk: use page_mapping to avoid wrong memory access" 2018-10-03 17:44:17 -07:00
Ankit Jain
3413c7f0bf block: ratelimit the IO errors
In case of card is removed by low-level driver on removing
the card physically, IO errors are expected for already
queued IO requests.

Ratelimit those errors with the default ratelimit to
avoid watchdog bark issue in some cases.

Change-Id: I74403db46b5149291ef596188d24ed7353342219
Signed-off-by: Ankit Jain <jankit@codeaurora.org>
2018-09-28 15:56:36 +05:30
Jaegeuk Kim
4d613c93e4 f2fs/fscrypt-ice: disallow bio merged into request
This fixes wrong bio merge into request which breaks encrypted ICE blocks.

Bug: 71554412
Change-Id: I65b5936add01aa62449d46791a736b734022a48c
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Signed-off-by: Neeraj Soni <neersoni@codeaurora.org>
2018-09-26 00:10:48 -07:00
Ming Lei
b520f00da4 blk-mq: avoid to synchronize rcu inside blk_cleanup_queue()
[ Upstream commit 1311326cf4755c7ffefd20f576144ecf46d9906b ]

SCSI probing may synchronously create and destroy a lot of request_queues
for non-existent devices. Any synchronize_rcu() in queue creation or
destroy path may introduce long latency during booting, see detailed
description in comment of blk_register_queue().

This patch removes one synchronize_rcu() inside blk_cleanup_queue()
for this case, commit c2856ae2f315d75(blk-mq: quiesce queue before freeing queue)
needs synchronize_rcu() for implementing blk_mq_quiesce_queue(), but
when queue isn't initialized, it isn't necessary to do that since
only pass-through requests are involved, no original issue in
scsi_execute() at all.

Without this patch and previous one, it may take more 20+ seconds for
virtio-scsi to complete disk probe. With the two patches, the time becomes
less than 100ms.

Fixes: c2856ae2f315d75 ("blk-mq: quiesce queue before freeing queue")
Reported-by: Andrew Jones <drjones@redhat.com>
Cc: Omar Sandoval <osandov@fb.com>
Cc: Bart Van Assche <bart.vanassche@wdc.com>
Cc: linux-scsi@vger.kernel.org
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>
Tested-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-26 08:38:13 +02:00
Ming Lei
07a252b478 blk-mq: only attempt to merge bio if there is rq in sw queue
[ Upstream commit b04f50ab8a74129b3041a2836c33c916be3c6667 ]

Only attempt to merge bio iff the ctx->rq_list isn't empty, because:

1) for high-performance SSD, most of times dispatch may succeed, then
there may be nothing left in ctx->rq_list, so don't try to merge over
sw queue if it is empty, then we can save one acquiring of ctx->lock

2) we can't expect good merge performance on per-cpu sw queue, and missing
one merge on sw queue won't be a big deal since tasks can be scheduled from
one CPU to another.

Cc: Laurence Oberman <loberman@redhat.com>
Cc: Omar Sandoval <osandov@fb.com>
Cc: Bart Van Assche <bart.vanassche@wdc.com>
Tested-by: Kashyap Desai <kashyap.desai@broadcom.com>
Reported-by: Kashyap Desai <kashyap.desai@broadcom.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-26 08:38:13 +02:00
Mike Snitzer
030f2ad6ce block: allow max_discard_segments to be stacked
[ Upstream commit 42c9cdfe1e11e083dceb0f0c4977b758cf7403b9 ]

Set max_discard_segments to USHRT_MAX in blk_set_stacking_limits() so
that blk_stack_limits() can stack up this limit for stacked devices.

before:

$ cat /sys/block/nvme0n1/queue/max_discard_segments
256
$ cat /sys/block/dm-0/queue/max_discard_segments
1

after:

$ cat /sys/block/nvme0n1/queue/max_discard_segments
256
$ cat /sys/block/dm-0/queue/max_discard_segments
256

Fixes: 1e739730c5b9e ("block: optionally merge discontiguous discard bios into a single request")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-26 08:38:00 +02:00
Neeraj Soni
115fa68bd3 block: Clone crypt key while cloning bioset
This change was missed during integration of
'commit 1ba4ba6f6a99
("Enable hardware based FBE on f2fs and adapt ext4 fs")'
and without this dun setting might not be correct.
This will lead to data corruption with Hardware
based File Encryption.

Change-Id: I5274e9d9debe5e76915fdc04663a524f88f480f1
Signed-off-by: Neeraj Soni <neersoni@codeaurora.org>
2018-09-22 21:27:40 +05:30
Mauricio Faria de Oliveira
5deea7d63b partitions/aix: fix usage of uninitialized lv_info and lvname structures
[ Upstream commit 14cb2c8a6c5dae57ee3e2da10fa3db2b9087e39e ]

The if-block that sets a successful return value in aix_partition()
uses 'lvip[].pps_per_lv' and 'n[].name' potentially uninitialized.

For example, if 'numlvs' is zero or alloc_lvn() fails, neither is
initialized, but are used anyway if alloc_pvd() succeeds after it.

So, make the alloc_pvd() call conditional on their initialization.

This has been hit when attaching an apparently corrupted/stressed
AIX LUN, misleading the kernel to pr_warn() invalid data and hang.

    [...] partition (null) (11 pp's found) is not contiguous
    [...] partition (null) (2 pp's found) is not contiguous
    [...] partition (null) (3 pp's found) is not contiguous
    [...] partition (null) (64 pp's found) is not contiguous

Fixes: 6ceea22bbbc8 ("partitions: add aix lvm partition support files")
Signed-off-by: Mauricio Faria de Oliveira <mfo@canonical.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-19 22:43:44 +02:00
Mauricio Faria de Oliveira
f3677a5c7d partitions/aix: append null character to print data from disk
[ Upstream commit d43fdae7bac2def8c4314b5a49822cb7f08a45f1 ]

Even if properly initialized, the lvname array (i.e., strings)
is read from disk, and might contain corrupt data (e.g., lack
the null terminating character for strings).

So, make sure the partition name string used in pr_warn() has
the null terminating character.

Fixes: 6ceea22bbbc8 ("partitions: add aix lvm partition support files")
Suggested-by: Daniel J. Axtens <daniel.axtens@canonical.com>
Signed-off-by: Mauricio Faria de Oliveira <mfo@canonical.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-19 22:43:44 +02:00
Ming Lei
3ddbcd49bb blk-mq: fix updating tags depth
[ Upstream commit 75d6e175fc511e95ae3eb8f708680133bc211ed3 ]

The passed 'nr' from userspace represents the total depth, meantime
inside 'struct blk_mq_tags', 'nr_tags' stores the total tag depth,
and 'nr_reserved_tags' stores the reserved part.

There are two issues in blk_mq_tag_update_depth() now:

1) for growing tags, we should have used the passed 'nr', and keep the
number of reserved tags not changed.

2) the passed 'nr' should have been used for checking against
'tags->nr_tags', instead of number of the normal part.

This patch fixes the above two cases, and avoids kernel crash caused
by wrong resizing sbitmap queue.

Cc: "Ewan D. Milne" <emilne@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Omar Sandoval <osandov@fb.com>
Tested by: Marco Patalano <mpatalan@redhat.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-19 22:43:39 +02:00
Konstantin Khlebnikov
381992bccc block: bfq: swap puts in bfqg_and_blkg_put
commit d5274b3cd6a814ccb2f56d81ee87cbbf51bd4cf7 upstream.

Fix trivial use-after-free. This could be last reference to bfqg.

Fixes: 8f9bebc33dd7 ("block, bfq: access and cache blkg data only when safe")
Acked-by: Paolo Valente <paolo.valente@linaro.org>
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-19 22:43:35 +02:00
Bart Van Assche
9dd38052a3 cfq: Suppress compiler warnings about comparisons
[ Upstream commit f7ecb1b109da1006a08d5675debe60990e824432 ]

This patch does not change any functionality but avoids that gcc
reports the following warnings when building with W=1:

block/cfq-iosched.c: In function ?cfq_back_seek_max_store?:
block/cfq-iosched.c:4741:13: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
  if (__data < (MIN))      \
             ^
block/cfq-iosched.c:4756:1: note: in expansion of macro ?STORE_FUNCTION?
 STORE_FUNCTION(cfq_back_seek_max_store, &cfqd->cfq_back_max, 0, UINT_MAX, 0);
 ^~~~~~~~~~~~~~
block/cfq-iosched.c: In function ?cfq_slice_idle_store?:
block/cfq-iosched.c:4741:13: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
  if (__data < (MIN))      \
             ^
block/cfq-iosched.c:4759:1: note: in expansion of macro ?STORE_FUNCTION?
 STORE_FUNCTION(cfq_slice_idle_store, &cfqd->cfq_slice_idle, 0, UINT_MAX, 1);
 ^~~~~~~~~~~~~~
block/cfq-iosched.c: In function ?cfq_group_idle_store?:
block/cfq-iosched.c:4741:13: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
  if (__data < (MIN))      \
             ^
block/cfq-iosched.c:4760:1: note: in expansion of macro ?STORE_FUNCTION?
 STORE_FUNCTION(cfq_group_idle_store, &cfqd->cfq_group_idle, 0, UINT_MAX, 1);
 ^~~~~~~~~~~~~~
block/cfq-iosched.c: In function ?cfq_low_latency_store?:
block/cfq-iosched.c:4741:13: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
  if (__data < (MIN))      \
             ^
block/cfq-iosched.c:4765:1: note: in expansion of macro ?STORE_FUNCTION?
 STORE_FUNCTION(cfq_low_latency_store, &cfqd->cfq_latency, 0, 1, 0);
 ^~~~~~~~~~~~~~
block/cfq-iosched.c: In function ?cfq_slice_idle_us_store?:
block/cfq-iosched.c:4775:13: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
  if (__data < (MIN))      \
             ^
block/cfq-iosched.c:4782:1: note: in expansion of macro ?USEC_STORE_FUNCTION?
 USEC_STORE_FUNCTION(cfq_slice_idle_us_store, &cfqd->cfq_slice_idle, 0, UINT_MAX);
 ^~~~~~~~~~~~~~~~~~~
block/cfq-iosched.c: In function ?cfq_group_idle_us_store?:
block/cfq-iosched.c:4775:13: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
  if (__data < (MIN))      \
             ^
block/cfq-iosched.c:4783:1: note: in expansion of macro ?USEC_STORE_FUNCTION?
 USEC_STORE_FUNCTION(cfq_group_idle_us_store, &cfqd->cfq_group_idle, 0, UINT_MAX);
 ^~~~~~~~~~~~~~~~~~~

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-15 09:45:31 +02:00
Greg Edwards
d67c7c9dd1 block: bvec_nr_vecs() returns value for wrong slab
[ Upstream commit d6c02a9beb67f13d5f14f23e72fa9981e8b84477 ]

In commit ed996a52c868 ("block: simplify and cleanup bvec pool
handling"), the value of the slab index is incremented by one in
bvec_alloc() after the allocation is done to indicate an index value of
0 does not need to be later freed.

bvec_nr_vecs() was not updated accordingly, and thus returns the wrong
value.  Decrement idx before performing the lookup.

Fixes: ed996a52c868 ("block: simplify and cleanup bvec pool handling")
Signed-off-by: Greg Edwards <gedwards@ddn.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-15 09:45:30 +02:00
Blagovest Kolenichev
c92598725f Merge android-4.14-p.64 (be62923) into msm-4.14
* refs/heads/tmp-be62923:
  Linux 4.14.64
  x86/mm: Add TLB purge to free pmd/pte page interfaces
  ioremap: Update pgtable free interfaces with addr
  Bluetooth: hidp: buffer overflow in hidp_process_report
  ASoC: Intel: cht_bsw_max98090_ti: Fix jack initialization
  ASoC: msm8916-wcd-digital: fix RX2 MIX1 and RX3 MIX1
  block, bfq: fix wrong init of saved start time for weight raising
  clk: sunxi-ng: Fix missing CLK_SET_RATE_PARENT in ccu-sun4i-a10.c
  ASoC: rsnd: fix ADG flags
  fw_cfg: fix driver remove
  sched/debug: Fix task state recording/printout
  ACPI / APEI: Remove ghes_ioremap_area
  crypto: skcipher - fix crash flushing dcache in error path
  crypto: skcipher - fix aligning block size in skcipher_copy_iv()
  crypto: ablkcipher - fix crash flushing dcache in error path
  crypto: blkcipher - fix crash flushing dcache in error path
  crypto: vmac - separate tfm and request context
  crypto: vmac - require a block cipher with 128-bit block size
  crypto: x86/sha256-mb - fix digest copy in sha256_mb_mgr_get_comp_job_avx2()
  kbuild: verify that $DEPMOD is installed
  x86/mm: Disable ioremap free page handling on x86-PAE
  x86: i8259: Add missing include file
  x86/l1tf: Fix build error seen if CONFIG_KVM_INTEL is disabled

Change-Id: Ibcc52690b00298747a05d7d4ac0dfa23b858e8c7
Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
2018-09-10 07:29:42 -07:00
Maciej S. Szmigiero
ed480f2b9e block, bfq: return nbytes and not zero from struct cftype .write() method
commit fc8ebd01deeb12728c83381f6ec923e4a192ffd3 upstream.

The value that struct cftype .write() method returns is then directly
returned to userspace as the value returned by write() syscall, so it
should be the number of bytes actually written (or consumed) and not zero.

Returning zero from write() syscall makes programs like /bin/echo or bash
spin.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Fixes: e21b7a0b9887 ("block, bfq: add full hierarchical scheduling and cgroups support")
Cc: stable@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-09 19:55:59 +02:00
Ming Lei
1e26989768 block: really disable runtime-pm for blk-mq
commit b233f127042dba991229e3882c6217c80492f6ef upstream.

Runtime PM isn't ready for blk-mq yet, and commit 765e40b675a9 ("block:
disable runtime-pm for blk-mq") tried to disable it. Unfortunately,
it can't take effect in that way since user space still can switch
it on via 'echo auto > /sys/block/sdN/device/power/control'.

This patch disables runtime-pm for blk-mq really by pm_runtime_disable()
and fixes all kinds of PM related kernel crash.

Cc: Tomas Janousek <tomi@nomi.cz>
Cc: Przemek Socha <soprwa@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: <stable@vger.kernel.org>
Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Tested-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-09 19:55:53 +02:00
xiao jin
0affbaece6 block: blk_init_allocated_queue() set q->fq as NULL in the fail case
commit 54648cf1ec2d7f4b6a71767799c45676a138ca24 upstream.

We find the memory use-after-free issue in __blk_drain_queue()
on the kernel 4.14. After read the latest kernel 4.18-rc6 we
think it has the same problem.

Memory is allocated for q->fq in the blk_init_allocated_queue().
If the elevator init function called with error return, it will
run into the fail case to free the q->fq.

Then the __blk_drain_queue() uses the same memory after the free
of the q->fq, it will lead to the unpredictable event.

The patch is to set q->fq as NULL in the fail case of
blk_init_allocated_queue().

Fixes: commit 7c94e1c157a2 ("block: introduce blk_flush_queue to drive flush machinery")
Cc: <stable@vger.kernel.org>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: xiao jin <jin.xiao@intel.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-09 19:55:53 +02:00
qctecmdr Service
9f234b8c51 Merge "Merge android-4.14-p.62 (366527f) into msm-4.14" 2018-08-25 09:20:43 -07:00
Jaegeuk Kim
af4ef71b89 dm-default-key, f2fs, ICE: support dm-default-key with f2fs/ICE
This patch fixes assigning bi_crypt_key for moving data which was previously
encrypted by f2fs.

Note that, dm-default-key should not assign bi_crypt_key, if bi_crypt_skip is
set.

The bug sceanrios is:

1. write data with user key by f2fs
  -  ENC(KU, IVU, DATA)
2. log out user key
3. read data #1 w/o user key from LBA #a
4. dm-default-key assigns default key
  - DEC(KD, LBA#a, ENC(KU, IVU, DATA))
5. write data #1 w/o user key into LBA #b
6. dm-default-key assigns default key
  - ENC(KD, LBA#b, DEC(KD, LBA#a, ENC(KU, IVU, DATA)))
7. Read DATA out with valid logged-in user key
  - DEC(KU, IVU, ENC(KD, LBA#b, DEC(KD, LBA#a, ENC(KU, IVU, DATA))))

So, this patch introduces bi_crypt_skip to avoid 4. ~ 6 with right flow:
1. write data with user key by f2fs
  -  ENC(KU, IVU, DATA)
2. log out user key
3. read data #1 w/o user key from LBA #a
4. dm-default-key skip to assign default key
  - ENC(KU, IVU, DATA)
5. write data #1 w/o user key into LBA #b
6. dm-default-key skips to assign default key
  - ENC(KU, IVU, DATA)
7. Try to read DATA with valid logged-in user key
  - DEC(KU, IVU, ENC(KU, IVU, DATA))

Bug: 68721442
Change-Id: Icefe85f608b7c3c84beb2bfa4267efd0f3787453
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Signed-off-by: Shivaprasad Hongal <shongal@codeaurora.org>
2018-08-24 10:36:55 -07:00
Dan Carpenter
6d2b87505f block: sed-opal: Fix a couple off by one bugs
[ Upstream commit ce042c183bcb94eb2919e8036473a1fc203420f9 ]

resp->num is the number of tokens in resp->tok[].  It gets set in
response_parse().  So if n == resp->num then we're reading beyond the
end of the data.

Fixes: 455a7b238cd6 ("block: Add Sed-opal library")
Reviewed-by: Scott Bauer <scott.bauer@intel.com>
Tested-by: Scott Bauer <scott.bauer@intel.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-24 13:09:03 +02:00
Shivaprasad Hongal
367c46b11c Enable hardware based FBE on f2fs and adapt ext4 fs
Hardware File Based Encryption (FBE) uses inline crypto
engine to encrypt the user data.
1. security/pfk: changes to support per file
   encryption for f2fs using hardware crypto engine.
2. fs/ext4: adapted crypto APIs for generic crypto layer.
3. fs/f2fs: support hardware crypto engine based per file
   encryption.
4. fs/crypto: export APIs to support hardware crypto
   engine based per file encryption.
5. security/pfe: added wrapped key support based on
   upstream changes.
Other changes made to provide support framework for per
file encryption.

Reverting commit e02a4e21f640 ("ext4: Add HW File Based
Encryption on ext4 file system") and adding changes to
have FBE in sync with upstream implementation of FBE.

Change-Id: I17f9909c43ba744eb874f6d237745fbf88a2b848
Signed-off-by: Shivaprasad Hongal <shongal@codeaurora.org>
2018-08-22 10:56:07 -07:00
Paolo Valente
1a2d99218d block, bfq: fix wrong init of saved start time for weight raising
commit 4baa8bb13f41307f3eb62fe91f93a1a798ebef53 upstream.

This commit fixes a bug that causes bfq to fail to guarantee a high
responsiveness on some drives, if there is heavy random read+write I/O
in the background. More precisely, such a failure allowed this bug to
be found [1], but the bug may well cause other yet unreported
anomalies.

BFQ raises the weight of the bfq_queues associated with soft real-time
applications, to privilege the I/O, and thus reduce latency, for these
applications. This mechanism is named soft-real-time weight raising in
BFQ. A soft real-time period may happen to be nested into an
interactive weight raising period, i.e., it may happen that, when a
bfq_queue switches to a soft real-time weight-raised state, the
bfq_queue is already being weight-raised because deemed interactive
too. In this case, BFQ saves in a special variable
wr_start_at_switch_to_srt, the time instant when the interactive
weight-raising period started for the bfq_queue, i.e., the time
instant when BFQ started to deem the bfq_queue interactive. This value
is then used to check whether the interactive weight-raising period
would still be in progress when the soft real-time weight-raising
period ends.  If so, interactive weight raising is restored for the
bfq_queue. This restore is useful, in particular, because it prevents
bfq_queues from losing their interactive weight raising prematurely,
as a consequence of spurious, short-lived soft real-time
weight-raising periods caused by wrong detections as soft real-time.

If, instead, a bfq_queue switches to soft-real-time weight raising
while it *is not* already in an interactive weight-raising period,
then the variable wr_start_at_switch_to_srt has no meaning during the
following soft real-time weight-raising period. Unfortunately the
handling of this case is wrong in BFQ: not only the variable is not
flagged somehow as meaningless, but it is also set to the time when
the switch to soft real-time weight-raising occurs. This may cause an
interactive weight-raising period to be considered mistakenly as still
in progress, and thus a spurious interactive weight-raising period to
start for the bfq_queue, at the end of the soft-real-time
weight-raising period. In particular the spurious interactive
weight-raising period will be considered as still in progress, if the
soft-real-time weight-raising period does not last very long. The
bfq_queue will then be wrongly privileged and, if I/O bound, will
unjustly steal bandwidth to truly interactive or soft real-time
bfq_queues, harming responsiveness and low latency.

This commit fixes this issue by just setting wr_start_at_switch_to_srt
to minus infinity (farthest past time instant according to jiffies
macros): when the soft-real-time weight-raising period ends, certainly
no interactive weight-raising period will be considered as still in
progress.

[1] Background I/O Type: Random - Background I/O mix: Reads and writes
- Application to start: LibreOffice Writer in
http://www.phoronix.com/scan.php?page=news_item&px=Linux-4.13-IO-Laptop

Signed-off-by: Paolo Valente <paolo.valente@linaro.org>
Signed-off-by: Angelo Ruocco <angeloruocco90@gmail.com>
Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name>
Tested-by: Lee Tibbert <lee.tibbert@gmail.com>
Tested-by: Mirko Montanari <mirkomontanari91@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-17 21:01:11 +02:00