Skip to contentSkip to conversation

Linux 4.12.4

DISCUSSION Greg KH 1 participant 2 messages Jul 28, 2017 Stable branch

lore
Share & tools
lore

Greg KH

author maintainer
#0 lore raw

I'm announcing the release of the 4.12.4 kernel.

All users of the 4.12 kernel series must upgrade.

The updated 4.12.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.12.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary

thanks,

greg k-h

------------

 Makefile                                               |    5 
 arch/mips/include/asm/branch.h                         |    5 
 arch/mips/kernel/branch.c                              |   71 +++----
 arch/mips/kernel/proc.c                                |    2 
 arch/mips/kernel/ptrace.c                              |    2 
 arch/mips/kernel/scall32-o32.S                         |    2 
 arch/mips/kernel/scall64-64.S                          |    2 
 arch/mips/kernel/scall64-n32.S                         |    2 
 arch/mips/kernel/scall64-o32.S                         |    2 
 arch/mips/kernel/syscall.c                             |   15 +
 arch/mips/math-emu/cp1emu.c                            |   38 ++++
 arch/powerpc/include/asm/atomic.h                      |    4 
 arch/powerpc/include/asm/reg.h                         |    2 
 arch/powerpc/lib/sstep.c                               |   19 +-
 arch/powerpc/mm/mmu_context_book3s64.c                 |   12 -
 arch/powerpc/mm/pgtable-radix.c                        |   15 +
 arch/powerpc/perf/isa207-common.c                      |    6 
 arch/powerpc/platforms/pseries/lpar.c                  |   11 +
 arch/s390/include/asm/syscall.h                        |    6 
 arch/x86/include/asm/xen/hypercall.h                   |    9 
 arch/x86/kernel/acpi/boot.c                            |    8 
 arch/x86/kernel/apic/io_apic.c                         |    2 
 arch/x86/pci/fixup.c                                   |   32 +++
 arch/x86/xen/smp_pv.c                                  |    3 
 drivers/acpi/ec.c                                      |   21 --
 drivers/acpi/nfit/core.c                               |   10 -
 drivers/base/power/domain.c                            |   20 +-
 drivers/char/ipmi/ipmi_msghandler.c                    |    5 
 drivers/char/ipmi/ipmi_ssif.c                          |    5 
 drivers/cpufreq/intel_pstate.c                         |   21 ++
 drivers/dax/device-dax.h                               |    2 
 drivers/dax/device.c                                   |   24 +-
 drivers/dax/pmem.c                                     |   12 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c                |    6 
 drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c          |    3 
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c                |   15 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c                |    3 
 drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c                  |   71 -------
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c         |    6 
 drivers/gpu/drm/drm_dp_mst_topology.c                  |   41 +++-
 drivers/gpu/drm/drm_framebuffer.c                      |    1 
 drivers/gpu/drm/etnaviv/etnaviv_drv.c                  |    1 
 drivers/gpu/drm/etnaviv/etnaviv_drv.h                  |    1 
 drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c            |    7 
 drivers/gpu/drm/i915/gvt/kvmgt.c                       |   14 -
 drivers/gpu/drm/i915/i915_debugfs.c                    |    2 
 drivers/gpu/drm/i915/i915_drv.c                        |    8 
 drivers/gpu/drm/i915/i915_perf.c                       |   12 -
 drivers/gpu/drm/i915/intel_cdclk.c                     |   20 ++
 drivers/gpu/drm/i915/intel_fbdev.c                     |   11 -
 drivers/gpu/drm/imx/parallel-display.c                 |    2 
 drivers/gpu/drm/radeon/atombios_encoders.c             |   13 +
 drivers/gpu/drm/radeon/ci_dpm.c                        |    6 
 drivers/gpu/drm/ttm/ttm_bo.c                           |    4 
 drivers/hid/hid-multitouch.c                           |   16 -
 drivers/hv/channel.c                                   |    2 
 drivers/infiniband/core/addr.c                         |    6 
 drivers/infiniband/core/cma.c                          |    2 
 drivers/infiniband/core/uverbs_cmd.c                   |    3 
 drivers/infiniband/hw/mlx5/mr.c                        |    2 
 drivers/infiniband/ulp/iser/iscsi_iser.c               |   11 +
 drivers/infiniband/ulp/isert/ib_isert.c                |    2 
 drivers/input/serio/i8042.c                            |   12 -
 drivers/iommu/arm-smmu.c                               |   16 +
 drivers/md/dm-raid.c                                   |   13 +
 drivers/md/faulty.c                                    |    5 
 drivers/md/linear.c                                    |    7 
 drivers/md/md.c                                        |   22 +-
 drivers/md/md.h                                        |    4 
 drivers/md/multipath.c                                 |    8 
 drivers/md/raid0.c                                     |    7 
 drivers/md/raid1.c                                     |   16 +
 drivers/md/raid10.c                                    |   10 -
 drivers/md/raid5.c                                     |   26 +-
 drivers/media/pci/cx88/cx88-cards.c                    |    9 
 drivers/media/pci/cx88/cx88-video.c                    |    2 
 drivers/media/platform/s5p-jpeg/jpeg-core.c            |    8 
 drivers/media/rc/imon.c                                |    2 
 drivers/media/rc/rc-main.c                             |   20 +-
 drivers/media/usb/dvb-usb-v2/mxl111sf-i2c.c            |    4 
 drivers/media/usb/dvb-usb-v2/mxl111sf.c                |   32 ++-
 drivers/media/usb/dvb-usb-v2/mxl111sf.h                |    8 
 drivers/misc/enclosure.c                               |   14 +
 drivers/mtd/nand/tango_nand.c                          |    2 
 drivers/net/ethernet/intel/igb/e1000_82575.c           |    1 
 drivers/net/wireless/ath/ath9k/ar9003_phy.c            |    2 
 drivers/net/wireless/ath/ath9k/rng.c                   |    4 
 drivers/net/wireless/ath/ath9k/tx99.c                  |   13 -
 drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c      |   32 ++-
 drivers/net/wireless/marvell/mwifiex/cfg80211.c        |   71 +++----
 drivers/net/wireless/ti/wlcore/spi.c                   |    6 
 drivers/nfc/nfcmrvl/fw_dnld.c                          |    7 
 drivers/nfc/nfcmrvl/main.c                             |   35 ++-
 drivers/nfc/nfcmrvl/uart.c                             |    8 
 drivers/nvdimm/btt.c                                   |    9 
 drivers/nvdimm/claim.c                                 |    3 
 drivers/nvdimm/core.c                                  |    7 
 drivers/nvme/host/rdma.c                               |   20 +-
 drivers/pci/host/pcie-rockchip.c                       |   13 -
 drivers/pci/host/vmd.c                                 |    2 
 drivers/pci/msi.c                                      |   14 -
 drivers/pci/pci-driver.c                               |    1 
 drivers/scsi/qla2xxx/qla_init.c                        |    7 
 drivers/scsi/scsi_lib.c                                |   47 +++--
 drivers/scsi/scsi_scan.c                               |    5 
 drivers/scsi/scsi_sysfs.c                              |    8 
 drivers/scsi/virtio_scsi.c                             |   13 +
 drivers/spi/spi-atmel.c                                |   24 ++
 drivers/spmi/spmi.c                                    |   12 +
 drivers/staging/comedi/drivers/ni_mio_common.c         |    3 
 drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c |   19 +-
 drivers/staging/rtl8188eu/os_dep/usb_intf.c            |    1 
 drivers/staging/sm750fb/sm750.c                        |   24 ++
 drivers/target/iscsi/iscsi_target_configfs.c           |    2 
 drivers/target/iscsi/iscsi_target_nego.c               |    6 
 drivers/target/iscsi/iscsi_target_parameters.c         |   41 +++-
 drivers/target/iscsi/iscsi_target_parameters.h         |    2 
 drivers/target/iscsi/iscsi_target_tpg.c                |   19 ++
 drivers/target/iscsi/iscsi_target_tpg.h                |    1 
 drivers/target/target_core_transport.c                 |    9 
 drivers/thermal/cpu_cooling.c                          |    4 
 drivers/thermal/max77620_thermal.c                     |   10 -
 drivers/tty/serial/sh-sci.c                            |   12 -
 drivers/tty/serial/st-asc.c                            |    1 
 drivers/usb/class/cdc-acm.c                            |    3 
 drivers/usb/host/pci-quirks.c                          |   54 +++++
 drivers/usb/host/pci-quirks.h                          |    2 
 drivers/usb/host/xhci-hub.c                            |    5 
 drivers/usb/host/xhci-pci.c                            |    6 
 drivers/usb/host/xhci-ring.c                           |   11 -
 drivers/usb/host/xhci.c                                |   10 -
 drivers/usb/host/xhci.h                                |    1 
 drivers/usb/renesas_usbhs/common.c                     |    4 
 drivers/usb/renesas_usbhs/mod_gadget.c                 |   31 ++-
 drivers/usb/storage/isd200.c                           |    5 
 drivers/vfio/vfio.c                                    |   84 ++++-----
 drivers/xen/xen-scsiback.c                             |   33 ---
 fs/btrfs/acl.c                                         |   13 -
 fs/btrfs/disk-io.c                                     |   12 -
 fs/btrfs/extent_io.c                                   |    6 
 fs/btrfs/file.c                                        |    5 
 fs/btrfs/inode.c                                       |    8 
 fs/btrfs/send.c                                        |    7 
 fs/ceph/dir.c                                          |    5 
 fs/cifs/cifsglob.h                                     |    2 
 fs/cifs/cifssmb.c                                      |    7 
 fs/cifs/connect.c                                      |    7 
 fs/cifs/smb2ops.c                                      |   23 ++
 fs/ext2/acl.c                                          |   36 ++-
 fs/f2fs/acl.c                                          |    2 
 fs/f2fs/checkpoint.c                                   |   11 -
 fs/f2fs/f2fs.h                                         |   18 +
 fs/f2fs/file.c                                         |    1 
 fs/f2fs/gc.c                                           |    9 
 fs/f2fs/inode.c                                        |    2 
 fs/f2fs/segment.c                                      |   37 ++-
 fs/f2fs/super.c                                        |   16 +
 fs/fs-writeback.c                                      |    8 
 fs/hfsplus/posix_acl.c                                 |   30 +--
 fs/nfs/dir.c                                           |   12 -
 fs/nfs/filelayout/filelayout.c                         |    3 
 fs/nfs/inode.c                                         |    4 
 fs/nfs/pagelist.c                                      |    1 
 fs/overlayfs/dir.c                                     |   22 +-
 fs/overlayfs/super.c                                   |    1 
 fs/pstore/platform.c                                   |    5 
 fs/reiserfs/xattr_acl.c                                |   12 -
 fs/ubifs/dir.c                                         |    1 
 fs/ubifs/journal.c                                     |   12 -
 fs/ubifs/tnc.c                                         |    2 
 fs/ubifs/ubifs.h                                       |    1 
 fs/ubifs/xattr.c                                       |   22 ++
 fs/udf/file.c                                          |    9 
 fs/udf/inode.c                                         |    4 
 fs/xfs/xfs_acl.c                                       |    6 
 fs/xfs/xfs_acl.h                                       |    1 
 fs/xfs/xfs_iops.c                                      |    4 
 fs/xfs/xfs_mount.c                                     |    4 
 include/linux/backing-dev.h                            |   26 --
 include/linux/blk-cgroup.h                             |    6 
 include/linux/init_task.h                              |    6 
 include/linux/interrupt.h                              |    4 
 include/linux/mman.h                                   |    2 
 include/linux/percpu_counter.h                         |    7 
 include/linux/sched.h                                  |   29 ++-
 include/linux/vfio.h                                   |    2 
 include/linux/vtime.h                                  |    9 
 include/net/inet_frag.h                                |    4 
 include/scsi/scsi_cmnd.h                               |    1 
 include/scsi/scsi_device.h                             |    1 
 include/target/iscsi/iscsi_target_core.h               |    9 
 kernel/cpu.c                                           |   38 ++--
 kernel/events/core.c                                   |   28 ---
 kernel/fork.c                                          |   22 --
 kernel/irq/affinity.c                                  |   13 +
 kernel/sched/cputime.c                                 |  158 ++++++++++-------
 kernel/sched/fair.c                                    |   32 ++-
 kernel/time/alarmtimer.c                               |    2 
 kernel/trace/ftrace.c                                  |    2 
 kernel/trace/trace.c                                   |    1 
 lib/flex_proportions.c                                 |    6 
 lib/percpu_counter.c                                   |   11 -
 mm/page-writeback.c                                    |   10 -
 net/bluetooth/smp.c                                    |   39 ++--
 net/nfc/core.c                                         |   31 +--
 net/nfc/llcp_sock.c                                    |    9 
 net/nfc/nci/core.c                                     |    3 
 net/nfc/netlink.c                                      |    4 
 net/sunrpc/auth_gss/gss_krb5_crypto.c                  |    3 
 net/sunrpc/xprtsock.c                                  |    2 
 sound/soc/atmel/tse850-pcm5142.c                       |    4 
 sound/soc/soc-compress.c                               |    6 
 sound/soc/zte/zx-i2s.c                                 |   10 -
 tools/perf/ui/browser.c                                |    2 
 tools/perf/util/intel-pt-decoder/intel-pt-decoder.c    |   78 ++++++--
 tools/testing/nvdimm/test/nfit.c                       |    2 
 virt/kvm/vfio.c                                        |   27 ++
 217 files changed, 1789 insertions(+), 951 deletions(-)

Adrian Hunter (8):
perf intel-pt: Move decoder error setting into one condition perf intel-pt: Improve sample timestamp
perf intel-pt: Fix missing stack clear
perf intel-pt: Ensure IP is zero when state is INTEL_PT_STATE_NO_IP perf intel-pt: Fix last_ip usage
perf intel-pt: Ensure never to set 'last_ip' when packet 'count' is zero perf intel-pt: Use FUP always when scanning for an IP
perf intel-pt: Clear FUP flag on error

Alex Deucher (4):
drm/amdgpu/gfx8: drop per-APU CU limits
drm/amdgpu: fix vblank_time when displays are off drm/amdgpu/cgs: always set reference clock in mode_info drm/radeon/ci: disable mclk switching for high refresh rates (v2)

Alex Williamson (3):
vfio: Fix group release deadlock
vfio: New external user group/file match
vfio: Remove unnecessary uses of vfio_container.group_lock

Alexander Shishkin (1):
perf/core: Fix scheduling regression of pinned groups

Amir Goldstein (2):
ovl: mark parent impure on ovl_link()
ovl: fix random return value on mount

Ankit Kumar (1):
pstore: Don't warn if data is uncompressed and type is not PSTORE_TYPE_DMESG

Anton Blanchard (2):
powerpc: Fix emulation of mcrf in emulate_step()
powerpc: Fix emulation of mfocrf in emulate_step()

Arnd Bergmann (3):
ir-core: fix gcc-7 warning on bool arithmetic
wlcore: fix 64K page support
staging: lustre: ko2iblnd: check copy_from_iter/copy_to_iter return code

Balbir Singh (2):
powerpc/pseries: Fix passing of pp0 in updatepp() and updateboltedpp() powerpc/mm/radix: Fix execute permissions for interrupt_vectors

Bart Van Assche (3):
scsi: Avoid that scsi_exit_rq() triggers a use-after-free xen/scsiback: Fix a TMR related use-after-free
mlx5: Avoid that mlx5_ib_sg_to_klms() overflows the klms[] array

Benjamin Coddington (1):

      NFS: Fix initialization of nfs_page_array->npages

Benjamin Herrenschmidt (1):
powerpc/mm/radix: Properly clear process table entry

Bjorn Andersson (1):
spmi: Include OF based modalias in device uevent

Bjorn Helgaas (1):
PCI: Work around poweroff & suspend-to-RAM issue on Macbook Pro 11

Boris Brezillon (1):
mtd: nand: tango: Fix incorrect use of SEQIN command

Brian Norris (1):
mwifiex: fixup error cases in mwifiex_add_virtual_intf()

Chao Yu (2):
f2fs: wake up all waiters in f2fs_submit_discard_endio
f2fs: use spin_{,un}lock_irq{save,restore}

Chen Hong (1):
Input: i8042 - fix crash at boot time

Chen Yu (1):
PCI/PM: Restore the status of PCI devices across hibernation

Chris Wilson (1):

      drm/i915/fbdev: Check for existence of ifbdev->vma before operations

Christoph Lameter (1):
kernel/fork.c: virtually mapped stacks: do not disable interrupts

Chuanxiao Dong (1):
drm/i915/gvt: Fix inconsistent locks holding sequence

Chunyu Hu (1):
tracing: Fix kmemleak in instance_rmdir

Colin Ian King (1):
usb: storage: return on error to avoid a null pointer dereference

Corey Minyard (1):
ipmi:ssif: Add missing unlock in error branch

Cyrille Pitchen (1):
spi: atmel: fix corrupted data issue on SAM9 family SoCs

Damien Le Moal (1):
f2fs: Do not issue small discards in LFS mode

Dan Carpenter (3):
serial: st-asc: Potential error pointer dereference
serial: sh-sci: Uninitialized variables in sysfs files
ftrace: Fix uninitialized variable in match_records()

Dan Williams (1):
device-dax: fix sysfs duplicate warnings

David Gstir (1):
ubifs: Don't encrypt special files on creation

David Härdeman (1):
rc-core: fix input repeat handling

Devin Heitmueller (2):
mxl111sf: Fix driver to use heap allocate buffers for USB messages
cx88: Fix regression in initial video standard setting

Dmitry Torokhov (1):
HID: multitouch: do not blindly set EV_KEY or EV_ABS bits

Emmanuel Grumbach (1):
iwlwifi: mvm: fix the recovery flow while connecting

Eric Anholt (1):
drm/etnaviv: Expose our reservation object when exporting a dmabuf.

Ewan D. Milne (1):
scsi: Add STARGET_CREATED_REMOVE state to scsi_target_state

Filipe Manana (2):
Btrfs: fix invalid extent maps due to hole punching
Btrfs: incremental send, fix invalid memory access

Frederic Weisbecker (4):
vtime, sched/cputime: Remove vtime_account_user() sched/cputime: Always set tsk->vtime_snap_whence after accounting vtime sched/cputime: Rename vtime fields
sched/cputime: Move the vtime task fields to their own struct

Gabriel Krisman Bertazi (1):
drm/i915: reintroduce VLV/CHV PFI programming power domain workaround

Greg Hackmann (1):
alarmtimer: don't rate limit one-shot timers

Greg Kroah-Hartman (1):

      Linux 4.12.4

Hawking Zhang (1):
drm/amd/powerplay: fix memory leak in cz_hwmgr backend

Heinz Mauelshagen (1):
dm raid: stop using BUG() in __rdev_sectors()

Huang Rui (1):
drm/amdgpu: fix the memory corruption on S3

Ian Abbott (1):
staging: comedi: ni_mio_common: fix AO timer off-by-one regression

Imre Deak (3):
drm/mst: Fix error handling during MST sideband message reception drm/mst: Avoid dereferencing a NULL mstb in drm_dp_mst_handle_up_req() drm/mst: Avoid processing partially received up/down message transactions

Ingo Molnar (1):
Revert "perf/core: Drop kernel samples even though :u is specified"

Ismail, Mustafa (2):
RDMA/uverbs: Fix the check for port number
RDMA/core: Initialize port_num in qp_attr

Jaegeuk Kim (3):
f2fs: load inode's flag from disk
f2fs: try to freeze in gc and discard threads
f2fs: Don't clear SGID when inheriting ACLs

James Hogan (4):
MIPS: Fix mips_atomic_set() retry condition
MIPS: Fix mips_atomic_set() with EVA
MIPS: Negate error syscall return in trace
MIPS: Save static registers before sysmips

Jan Kara (7):
btrfs: Don't clear SGID when inheriting ACLs
ext2: Don't clear SGID when inheriting ACLs
xfs: Don't clear SGID when inheriting ACLs
udf: Fix races with i_size changes during readpage
udf: Fix deadlock between writeback and udf_setsize()
hfsplus: Don't clear SGID when inheriting ACLs
reiserfs: Don't clear SGID when inheriting ACLs

Jason A. Donenfeld (2):
Bluetooth: use constant time memory comparison for secret values
sunrpc: use constant time memory comparison for mac

Jeffrey Hugo (1):
sched/fair: Fix load_balance() affinity redo path

Jiahau Chang (1):
xhci: Bad Ethernet performance plugged in ASM1042A host

Jiang Yi (1):
target: Fix COMPARE_AND_WRITE caw_sem leak during se_cmd quiesce

Jin Qian (2):
f2fs: sanity check checkpoint segno and blkoff
f2fs: sanity check size of nat and sit cache

Jin Yao (1):
perf annotate: Fix broken arrow at row 0 connecting jmp instruction to its target

Jiri Olsa (1):
s390/syscalls: Fix out of bounds arguments access

Johan Hovold (7):
thermal: max77620: fix device-node reference imbalance
NFC: fix broken device allocation
NFC: nfcmrvl_uart: add missing tty-device sanity check
NFC: nfcmrvl: do not use device-managed resources
NFC: nfcmrvl: use nfc-device for firmware download
NFC: nfcmrvl: fix firmware-management initialisation
USB: cdc-acm: add device-id for quirky printer

John Brooks (2):
drm/amdgpu: Don't call amd_powerplay_destroy() if we don't have powerplay drm/ttm: Fix use-after-free in ttm_bo_clean_mm

Jon Derrick (1):
PCI: vmd: Move SRCU cleanup after bus, child device removal

Juergen Gross (1):
xen/x86: fix cpu hotplug

Krzysztof Kozlowski (3):
PM / Domains: Fix unsafe iteration over modified list of device links PM / Domains: Fix unsafe iteration over modified list of domain providers PM / Domains: Fix unsafe iteration over modified list of domains

Linus Torvalds (1):
disable new gcc-7.1.1 warnings for now

Lv Zheng (2):
ACPI / EC: Drop EC noirq hooks to fix a regression Revert "ACPI / EC: Enable event freeze mode..." to fix a regression

Maarten Lankhorst (2):
drm/atomic: Add missing drm_atomic_state_clear to atomic_remove_fb drm/i915: Make DP-MST connector info work

Maciej W. Rozycki (9):
MIPS: Fix MIPS I ISA /proc/cpuinfo reporting
MIPS: Actually decode JALX in `__compute_return_epc_for_insn'
MIPS: Fix unaligned PC interpretation in `compute_return_epc'
MIPS: math-emu: Prevent wrong ISA mode instruction emulation
MIPS: Send SIGILL for BPOSGE32 in `__compute_return_epc_for_insn'
MIPS: Rename sigill_r6' to sigill_r2r6' in `__compute_return_epc_for_insn'
MIPS: Send SIGILL for linked branches in `__compute_return_epc_for_insn'
MIPS: Send SIGILL for R6 branches in `__compute_return_epc_for_insn'
MIPS: Fix a typo: s/preset/present/ in r2-to-r6 emulation error message

Madhavan Srinivasan (1):
powerpc/perf: Fix SDAR_MODE value for continous sampling on Power9

Marek Marczykowski-Górecki (1):
x86/xen: allow userspace access during hypercalls

Mario Kleiner (1):
drm/radeon: Fix eDP for single-display iMac10,1 (v2)

Marta Rybczynska (1):
nvme-rdma: remove race conditions from IB signalling

Mateusz Jurczyk (3):
nfc: Ensure presence of required attributes in the activate_target handler
nfc: Fix the sockaddr length sanitization in llcp_sock_connect
NFC: Add sockaddr length checks before accessing sa_family in bind handlers

Mathias Nyman (2):
xhci: fix 20000ms port resume timeout
xhci: Fix NULL pointer dereference when cleaning up streams for removed host

Matwey V Kornilov (1):
igb: Explicitly select page 0 at initialization

Maurizio Lombardi (1):
scsi: ses: do not add a device to an enclosure if enclosure_add_links() fails.

Mauro Carvalho Chehab (1):
s5p-jpeg: don't return a random width/height

Miaoqing Pan (3):
ath9k: fix tx99 use after free
ath9k: fix tx99 bus error
ath9k: fix an invalid pointer dereference in ath9k_rng_stop()

Michael Ellerman (2):
powerpc/mm/radix: Only add X for pages overlapping kernel text powerpc/64: Fix atomic64_inc_not_zero() to return an int

Michael Gugino (1):
staging: rtl8188eu: add TL-WN722N v2 support

Michael Hernandez (1):
PCI/MSI: Ignore affinity if pre/post vector count is more than min_vecs

Mikulas Patocka (1):
md: don't use flush_signals in userspace processes

Moni Shoua (1):
IB/core: Namespace is mandatory input for address resolution

NeilBrown (3):
md: fix deadlock between mddev_suspend() and md_write_start() net/sunrpc/xprt_sock: fix regression in connection error reporting.
NFS: only invalidate dentrys that are clearly invalid.

Nicholas Bellinger (2):
iscsi-target: Add login_keys_workaround attribute for non RFC initiators
iser-target: Avoid isert_conn->cm_id dereference in isert_login_recv_done

Nikolay Borisov (2):
percpu_counter: Rename __percpu_counter_add to percpu_counter_add_batch
writeback: rework wb_[dec|inc]_stat family of functions

Olga Kornievskaia (1):
PNFS fix EACCESS on commit to DS handling

Oliver O'Halloran (1):
powerpc/asm: Mark cr0 as clobbered in mftb()

Paolo Bonzini (2):
scsi: virtio_scsi: let host do exception handling
scsi: virtio_scsi: always read VPD pages for multiqueue too

Pavel Shilovsky (1):
CIFS: Reconnect expired SMB sessions

Peter Chen (1):
usb: xhci: fix spinlock recursion for USB2 test mode

Peter Rosin (1):
ASoC: atmel: tse850: fix off-by-one in the "ANA" enumeration count

Philipp Zabel (1):
drm/imx: parallel-display: Accept drm_of_find_panel_or_bridge failure

Prarit Bhargava (1):
acpi/nfit: Fix memory corruption/Unregister mce decoder on failure

Quinn Tran (1):
scsi: qla2xxx: Allow ABTS, PURX, RIDA on ATIOQ for ISP83XX/27XX

Richard Weinberger (3):
ubifs: Correctly evict xattr inodes
ubifs: Don't leak kernel memory to the MTD
ubifs: Set double hash cookie also for RENAME_EXCHANGE

Robin Murphy (1):
iommu/arm-smmu: Plumb in new ACPI identifiers

Satish Babu Patakokila (1):
ASoC: compress: Derive substream from stream based on direction

Seunghun Han (2):
x86/acpi: Prevent out of bound access caused by broken ACPI tables x86/ioapic: Pass the correct data to unmask_ioapic_irq()

Shawn Guo (1):
ASoC: zx-i2s: flip I2S master/slave mode

Shawn Lin (1):
PCI: rockchip: Use normal register bank for config accessors

Shu Wang (1):
xhci: fix memleak in xhci_run()

Srinivas Pandruvada (1):
cpufreq: intel_pstate: Correct the busy calculation for KNL

Stephen Hemminger (1):
vmbus: re-enable channel tasklet

Sudeep Holla (1):

      PM / Domains: defer dev_pm_domain_set() until genpd->attach_dev succeeds if present

Teddy Wang (1):
staging: sm750fb: avoid conflicting vesafb

Thomas Gleixner (2):
smp/hotplug: Move unparking of percpu threads to the control CPU smp/hotplug: Replace BUG_ON and react useful

Tom St Denis (1):
drm/amd/amdgpu: Return error if initiating read out of range on vram

Tony Camuso (1):

      ipmi: use rcu lock around call to intf->handlers->sender()

Toshi Kani (1):
libnvdimm: fix badblock range handling of ARS range

Ville Syrjälä (1):
drm/i915: Disable MSI for all pre-gen5

Viresh Kumar (1):
thermal: cpu_cooling: Avoid accessing potentially freed structures

Vishal Verma (2):
libnvdimm, btt: fix btt_rw_page not returning errors
libnvdimm: fix the clear-error check in nsio_rw_bytes

Vladimir Neyelov (1):
IB/iser: Fix connection teardown race condition

Wanpeng Li (2):
sched/cputime: Accumulate vtime on top of nsec clocksource sched/cputime: Don't use smp_processor_id() in preemptible context

Xiao Ni (1):

      Raid5 should update rdev->sectors after reshape

Yan, Zheng (1):
ceph: fix race in concurrent readdir

Yasunori Goto (1):
tools/testing/nvdimm: fix nfit_test buffer overflow

Yoshihiro Shimoda (2):
usb: renesas_usbhs: fix usbhsc_resume() for !USBHSF_RUNTIME_PWCTRL
usb: renesas_usbhs: gadget: disable all eps when the driver stops

[email protected] (1):
drm/i915: Hold RPM wakelock while initializing OA buffer

author maintainer
#1 lore raw
Makefile +4 -1
index f5bbee480317..bfdc92c2e47a 100644
@@ -1,6 +1,6 @@
 VERSION = 4
 PATCHLEVEL = 12
-SUBLEVEL = 3
+SUBLEVEL = 4
 EXTRAVERSION =
 NAME = Fearless Coyote
 
@@ -631,6 +631,9 @@ include arch/$(SRCARCH)/Makefile
 
 KBUILD_CFLAGS	+= $(call cc-option,-fno-delete-null-pointer-checks,)
 KBUILD_CFLAGS	+= $(call cc-disable-warning,frame-address,)
+KBUILD_CFLAGS	+= $(call cc-disable-warning, format-truncation)
+KBUILD_CFLAGS	+= $(call cc-disable-warning, format-overflow)
+KBUILD_CFLAGS	+= $(call cc-disable-warning, int-in-bool-context)
 
 ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
 KBUILD_CFLAGS	+= $(call cc-option,-Oz,-Os)
arch/mips/include/asm/branch.h +1 -4
index de781cf54bc7..da80878f2c0d 100644
@@ -74,10 +74,7 @@ static inline int compute_return_epc(struct pt_regs *regs)
 			return __microMIPS_compute_return_epc(regs);
 		if (cpu_has_mips16)
 			return __MIPS16e_compute_return_epc(regs);
-		return regs->cp0_epc;
-	}
-
-	if (!delay_slot(regs)) {
+	} else if (!delay_slot(regs)) {
 		regs->cp0_epc += 4;
 		return 0;
 	}
arch/mips/kernel/branch.c +32 -39

170 lines not on this page · raw message

arch/mips/kernel/proc.c +1 -1
index 4eff2aed7360..4c01ee5b88c9 100644
@@ -83,7 +83,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 	}
 
 	seq_printf(m, "isa\t\t\t:"); 
-	if (cpu_has_mips_r1)
+	if (cpu_has_mips_1)
 		seq_printf(m, " mips1");
 	if (cpu_has_mips_2)
 		seq_printf(m, "%s", " mips2");
arch/mips/kernel/ptrace.c +1 -1
index 6931fe722a0b..8c99ff1d8c3c 100644
@@ -895,7 +895,7 @@ asmlinkage void syscall_trace_leave(struct pt_regs *regs)
 	audit_syscall_exit(regs);
 
 	if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
-		trace_sys_exit(regs, regs->regs[2]);
+		trace_sys_exit(regs, regs_return_value(regs));
 
 	if (test_thread_flag(TIF_SYSCALL_TRACE))
 		tracehook_report_syscall_exit(regs, 0);
arch/mips/kernel/scall32-o32.S +1 -1
index 80ed68b2c95e..27c2f90eeb21 100644
@@ -371,7 +371,7 @@ EXPORT(sys_call_table)
 	PTR	sys_writev
 	PTR	sys_cacheflush
 	PTR	sys_cachectl
-	PTR	sys_sysmips
+	PTR	__sys_sysmips
 	PTR	sys_ni_syscall			/* 4150 */
 	PTR	sys_getsid
 	PTR	sys_fdatasync
arch/mips/kernel/scall64-64.S +1 -1
index 49765b44aa9b..65d5aeeb9bdb 100644
@@ -311,7 +311,7 @@ EXPORT(sys_call_table)
 	PTR	sys_sched_getaffinity
 	PTR	sys_cacheflush
 	PTR	sys_cachectl
-	PTR	sys_sysmips
+	PTR	__sys_sysmips
 	PTR	sys_io_setup			/* 5200 */
 	PTR	sys_io_destroy
 	PTR	sys_io_getevents
arch/mips/kernel/scall64-n32.S +1 -1
index 90bad2d1b2d3..cbf190ef9e8a 100644
@@ -302,7 +302,7 @@ EXPORT(sysn32_call_table)
 	PTR	compat_sys_sched_getaffinity
 	PTR	sys_cacheflush
 	PTR	sys_cachectl
-	PTR	sys_sysmips
+	PTR	__sys_sysmips
 	PTR	compat_sys_io_setup			/* 6200 */
 	PTR	sys_io_destroy
 	PTR	compat_sys_io_getevents
arch/mips/kernel/scall64-o32.S +1 -1
index 2dd70bd104e1..c30bc520885f 100644
@@ -371,7 +371,7 @@ EXPORT(sys32_call_table)
 	PTR	compat_sys_writev
 	PTR	sys_cacheflush
 	PTR	sys_cachectl
-	PTR	sys_sysmips
+	PTR	__sys_sysmips
 	PTR	sys_ni_syscall			/* 4150 */
 	PTR	sys_getsid
 	PTR	sys_fdatasync
arch/mips/kernel/syscall.c +12 -3
index 1dfa7f5796c7..863f958c126c 100644
@@ -29,6 +29,7 @@
 #include <linux/sched/task_stack.h>
 
 #include <asm/asm.h>
+#include <asm/asm-eva.h>
 #include <asm/branch.h>
 #include <asm/cachectl.h>
 #include <asm/cacheflush.h>
@@ -131,10 +132,12 @@ static inline int mips_atomic_set(unsigned long addr, unsigned long new)
 		__asm__ __volatile__ (
 		"	.set	"MIPS_ISA_ARCH_LEVEL"			\n"
 		"	li	%[err], 0				\n"
-		"1:	ll	%[old], (%[addr])			\n"
+		"1:							\n"
+		user_ll("%[old]", "(%[addr])")
 		"	move	%[tmp], %[new]				\n"
-		"2:	sc	%[tmp], (%[addr])			\n"
-		"	bnez	%[tmp], 4f				\n"
+		"2:							\n"
+		user_sc("%[tmp]", "(%[addr])")
+		"	beqz	%[tmp], 4f				\n"
 		"3:							\n"
 		"	.insn						\n"
 		"	.subsection 2					\n"
@@ -192,6 +195,12 @@ static inline int mips_atomic_set(unsigned long addr, unsigned long new)
 	unreachable();
 }
 
+/*
+ * mips_atomic_set() normally returns directly via syscall_exit potentially
+ * clobbering static registers, so be sure to preserve them.
+ */
+save_static_function(sys_sysmips);
+
 SYSCALL_DEFINE3(sysmips, long, cmd, long, arg1, long, arg2)
 {
 	switch (cmd) {
arch/mips/math-emu/cp1emu.c +38 -0
index f12fde10c8ad..261915265942 100644
@@ -2524,6 +2524,35 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
 	return 0;
 }
 
+/*
+ * Emulate FPU instructions.
+ *
+ * If we use FPU hardware, then we have been typically called to handle
+ * an unimplemented operation, such as where an operand is a NaN or
+ * denormalized.  In that case exit the emulation loop after a single
+ * iteration so as to let hardware execute any subsequent instructions.
+ *
+ * If we have no FPU hardware or it has been disabled, then continue
+ * emulating floating-point instructions until one of these conditions
+ * has occurred:
+ *
+ * - a non-FPU instruction has been encountered,
+ *
+ * - an attempt to emulate has ended with a signal,
+ *
+ * - the ISA mode has been switched.
+ *
+ * We need to terminate the emulation loop if we got switched to the
+ * MIPS16 mode, whether supported or not, so that we do not attempt
+ * to emulate a MIPS16 instruction as a regular MIPS FPU instruction.
+ * Similarly if we got switched to the microMIPS mode and only the
+ * regular MIPS mode is supported, so that we do not attempt to emulate
+ * a microMIPS instruction as a regular MIPS FPU instruction.  Or if
+ * we got switched to the regular MIPS mode and only the microMIPS mode
+ * is supported, so that we do not attempt to emulate a regular MIPS
+ * instruction that should cause an Address Error exception instead.
+ * For simplicity we always terminate upon an ISA mode switch.
+ */
 int fpu_emulator_cop1Handler(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
 	int has_fpu, void *__user *fault_addr)
 {
@@ -2609,6 +2638,15 @@ int fpu_emulator_cop1Handler(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
 			break;
 		if (sig)
 			break;
+		/*
+		 * We have to check for the ISA bit explicitly here,
+		 * because `get_isa16_mode' may return 0 if support
+		 * for code compression has been globally disabled,
+		 * or otherwise we may produce the wrong signal or
+		 * even proceed successfully where we must not.
+		 */
+		if ((xcp->cp0_epc ^ prevepc) & 0x1)
+			break;
 
 		cond_resched();
 	} while (xcp->cp0_epc > prevepc);
arch/powerpc/include/asm/atomic.h +2 -2
index 2b90335194a7..a2cc8010cd72 100644
@@ -560,7 +560,7 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
  * Atomically increments @v by 1, so long as @v is non-zero.
  * Returns non-zero if @v was non-zero, and zero otherwise.
  */
-static __inline__ long atomic64_inc_not_zero(atomic64_t *v)
+static __inline__ int atomic64_inc_not_zero(atomic64_t *v)
 {
 	long t1, t2;
 
@@ -579,7 +579,7 @@ static __inline__ long atomic64_inc_not_zero(atomic64_t *v)
 	: "r" (&v->counter)
 	: "cc", "xer", "memory");
 
-	return t1;
+	return t1 != 0;
 }
 
 #endif /* __powerpc64__ */
arch/powerpc/include/asm/reg.h +1 -1
index 7e50e47375d6..a3b6575c7842 100644
@@ -1303,7 +1303,7 @@ static inline void msr_check_and_clear(unsigned long bits)
 				"	.llong 0\n"			\
 				".previous"				\
 			: "=r" (rval) \
-			: "i" (CPU_FTR_CELL_TB_BUG), "i" (SPRN_TBRL)); \
+			: "i" (CPU_FTR_CELL_TB_BUG), "i" (SPRN_TBRL) : "cr0"); \
 			rval;})
 #else
 #define mftb()		({unsigned long rval;	\
arch/powerpc/lib/sstep.c +17 -2
index 33117f8a0882..ee33327686ae 100644
@@ -683,8 +683,10 @@ int analyse_instr(struct instruction_op *op, struct pt_regs *regs,
 	case 19:
 		switch ((instr >> 1) & 0x3ff) {
 		case 0:		/* mcrf */
-			rd = (instr >> 21) & 0x1c;
-			ra = (instr >> 16) & 0x1c;
+			rd = 7 - ((instr >> 23) & 0x7);
+			ra = 7 - ((instr >> 18) & 0x7);
+			rd *= 4;
+			ra *= 4;
 			val = (regs->ccr >> ra) & 0xf;
 			regs->ccr = (regs->ccr & ~(0xfUL << rd)) | (val << rd);
 			goto instr_done;
@@ -964,6 +966,19 @@ int analyse_instr(struct instruction_op *op, struct pt_regs *regs,
 #endif
 
 		case 19:	/* mfcr */
+			if ((instr >> 20) & 1) {
+				imm = 0xf0000000UL;
+				for (sh = 0; sh < 8; ++sh) {
+					if (instr & (0x80000 >> sh)) {
+						regs->gpr[rd] = regs->ccr & imm;
+						break;
+					}
+					imm >>= 4;
+				}
+
+				goto instr_done;
+			}
+
 			regs->gpr[rd] = regs->ccr;
 			regs->gpr[rd] &= 0xffffffffUL;
 			goto instr_done;
arch/powerpc/mm/mmu_context_book3s64.c +9 -3
index a3edf813d455..51303f8af015 100644
@@ -223,9 +223,15 @@ void destroy_context(struct mm_struct *mm)
 	mm->context.cop_lockp = NULL;
 #endif /* CONFIG_PPC_ICSWX */
 
-	if (radix_enabled())
-		process_tb[mm->context.id].prtb1 = 0;
-	else
+	if (radix_enabled()) {
+		/*
+		 * Radix doesn't have a valid bit in the process table
+		 * entries. However we know that at least P9 implementation
+		 * will avoid caching an entry with an invalid RTS field,
+		 * and 0 is invalid. So this will do.
+		 */
+		process_tb[mm->context.id].prtb0 = 0;
+	} else
 		subpage_prot_free(mm);
 	destroy_pagetable_page(mm);
 	__destroy_context(mm->context.id);
arch/powerpc/mm/pgtable-radix.c +12 -3
index c28165d8970b..af3b552b5f8d 100644
@@ -19,6 +19,7 @@
 #include <asm/mmu.h>
 #include <asm/firmware.h>
 #include <asm/powernv.h>
+#include <asm/sections.h>
 
 #include <trace/events/thp.h>
 
@@ -121,7 +122,8 @@ static inline void __meminit print_mapping(unsigned long start,
 static int __meminit create_physical_mapping(unsigned long start,
 					     unsigned long end)
 {
-	unsigned long addr, mapping_size = 0;
+	unsigned long vaddr, addr, mapping_size = 0;
+	pgprot_t prot;
 
 	start = _ALIGN_UP(start, PAGE_SIZE);
 	for (addr = start; addr < end; addr += mapping_size) {
@@ -145,8 +147,15 @@ static int __meminit create_physical_mapping(unsigned long start,
 			start = addr;
 		}
 
-		rc = radix__map_kernel_page((unsigned long)__va(addr), addr,
-					    PAGE_KERNEL_X, mapping_size);
+		vaddr = (unsigned long)__va(addr);
+
+		if (overlaps_kernel_text(vaddr, vaddr + mapping_size) ||
+		    overlaps_interrupt_vector_text(vaddr, vaddr + mapping_size))
+			prot = PAGE_KERNEL_X;
+		else
+			prot = PAGE_KERNEL;
+
+		rc = radix__map_kernel_page(vaddr, addr, prot, mapping_size);
 		if (rc)
 			return rc;
 	}
arch/powerpc/perf/isa207-common.c +4 -2
index 8125160be7bc..3f3aa9a7063a 100644
@@ -90,13 +90,15 @@ static void mmcra_sdar_mode(u64 event, unsigned long *mmcra)
 	 *	MMCRA[SDAR_MODE] will be set to 0b01
 	 * For rest
 	 *	MMCRA[SDAR_MODE] will be set from event code.
+	 *      If sdar_mode from event is zero, default to 0b01. Hardware
+	 *      requires that we set a non-zero value.
 	 */
 	if (cpu_has_feature(CPU_FTR_ARCH_300)) {
 		if (is_event_marked(event) || (*mmcra & MMCRA_SAMPLE_ENABLE))
 			*mmcra &= MMCRA_SDAR_MODE_NO_UPDATES;
-		else if (!cpu_has_feature(CPU_FTR_POWER9_DD1))
+		else if (!cpu_has_feature(CPU_FTR_POWER9_DD1) && p9_SDAR_MODE(event))
 			*mmcra |=  p9_SDAR_MODE(event) << MMCRA_SDAR_MODE_SHIFT;
-		else if (cpu_has_feature(CPU_FTR_POWER9_DD1))
+		else
 			*mmcra |= MMCRA_SDAR_MODE_TLB;
 	} else
 		*mmcra |= MMCRA_SDAR_MODE_TLB;
arch/powerpc/platforms/pseries/lpar.c +10 -1
index 6541d0b03e4c..495ba4e7336d 100644
@@ -301,7 +301,7 @@ static long pSeries_lpar_hpte_updatepp(unsigned long slot,
 				       int ssize, unsigned long inv_flags)
 {
 	unsigned long lpar_rc;
-	unsigned long flags = (newpp & 7) | H_AVPN;
+	unsigned long flags;
 	unsigned long want_v;
 
 	want_v = hpte_encode_avpn(vpn, psize, ssize);
@@ -309,6 +309,11 @@ static long pSeries_lpar_hpte_updatepp(unsigned long slot,
 	pr_devel("    update: avpnv=%016lx, hash=%016lx, f=%lx, psize: %d ...",
 		 want_v, slot, flags, psize);
 
+	flags = (newpp & 7) | H_AVPN;
+	if (mmu_has_feature(MMU_FTR_KERNEL_RO))
+		/* Move pp0 into bit 8 (IBM 55) */
+		flags |= (newpp & HPTE_R_PP0) >> 55;
+
 	lpar_rc = plpar_pte_protect(flags, slot, want_v);
 
 	if (lpar_rc == H_NOT_FOUND) {
@@ -380,6 +385,10 @@ static void pSeries_lpar_hpte_updateboltedpp(unsigned long newpp,
 	BUG_ON(slot == -1);
 
 	flags = newpp & 7;
+	if (mmu_has_feature(MMU_FTR_KERNEL_RO))
+		/* Move pp0 into bit 8 (IBM 55) */
+		flags |= (newpp & HPTE_R_PP0) >> 55;
+
 	lpar_rc = plpar_pte_protect(flags, slot, 0);
 
 	BUG_ON(lpar_rc != H_SUCCESS);
arch/s390/include/asm/syscall.h +6 -0
index 6ba0bf928909..6bc941be6921 100644
@@ -64,6 +64,12 @@ static inline void syscall_get_arguments(struct task_struct *task,
 {
 	unsigned long mask = -1UL;
 
+	/*
+	 * No arguments for this syscall, there's nothing to do.
+	 */
+	if (!n)
+		return;
+
 	BUG_ON(i + n > 6);
 #ifdef CONFIG_COMPAT
 	if (test_tsk_thread_flag(task, TIF_31BIT))
arch/x86/include/asm/xen/hypercall.h +8 -1
index f6d20f6cca12..32b74a8fa6b7 100644
@@ -43,6 +43,7 @@
 
 #include <asm/page.h>
 #include <asm/pgtable.h>
+#include <asm/smap.h>
 
 #include <xen/interface/xen.h>
 #include <xen/interface/sched.h>
@@ -214,10 +215,12 @@ privcmd_call(unsigned call,
 	__HYPERCALL_DECLS;
 	__HYPERCALL_5ARG(a1, a2, a3, a4, a5);
 
+	stac();
 	asm volatile("call *%[call]"
 		     : __HYPERCALL_5PARAM
 		     : [call] "a" (&hypercall_page[call])
 		     : __HYPERCALL_CLOBBER5);
+	clac();
 
 	return (long)__res;
 }
@@ -476,7 +479,11 @@ static inline int
 HYPERVISOR_dm_op(
 	domid_t dom, unsigned int nr_bufs, void *bufs)
 {
-	return _hypercall3(int, dm_op, dom, nr_bufs, bufs);
+	int ret;
+	stac();
+	ret = _hypercall3(int, dm_op, dom, nr_bufs, bufs);
+	clac();
+	return ret;
 }
 
 static inline void
arch/x86/kernel/acpi/boot.c +8 -0
index 6bb680671088..7491e73d9253 100644
@@ -347,6 +347,14 @@ static void __init mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger,
 	struct mpc_intsrc mp_irq;
 
 	/*
+	 * Check bus_irq boundary.
+	 */
+	if (bus_irq >= NR_IRQS_LEGACY) {
+		pr_warn("Invalid bus_irq %u for legacy override\n", bus_irq);
+		return;
+	}
+
+	/*
 	 * Convert 'gsi' to 'ioapic.pin'.
 	 */
 	ioapic = mp_find_ioapic(gsi);
arch/x86/kernel/apic/io_apic.c +1 -1
index 347bb9f65737..6d779095ed01 100644
@@ -2115,7 +2115,7 @@ static inline void __init check_timer(void)
 			int idx;
 			idx = find_irq_entry(apic1, pin1, mp_INT);
 			if (idx != -1 && irq_trigger(idx))
-				unmask_ioapic_irq(irq_get_chip_data(0));
+				unmask_ioapic_irq(irq_get_irq_data(0));
 		}
 		irq_domain_deactivate_irq(irq_data);
 		irq_domain_activate_irq(irq_data);
arch/x86/pci/fixup.c +32 -0
index 6d52b94f4bb9..20fa7c84109d 100644
@@ -571,3 +571,35 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2fc0, pci_invalid_bar);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x6f60, pci_invalid_bar);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x6fa0, pci_invalid_bar);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x6fc0, pci_invalid_bar);
+
+/*
+ * Apple MacBook Pro: Avoid [mem 0x7fa00000-0x7fbfffff]
+ *
+ * Using the [mem 0x7fa00000-0x7fbfffff] region, e.g., by assigning it to
+ * the 00:1c.0 Root Port, causes a conflict with [io 0x1804], which is used
+ * for soft poweroff and suspend-to-RAM.
+ *
+ * As far as we know, this is related to the address space, not to the Root
+ * Port itself.  Attaching the quirk to the Root Port is a convenience, but
+ * it could probably also be a standalone DMI quirk.
+ *
+ * https://bugzilla.kernel.org/show_bug.cgi?id=103211
+ */
+static void quirk_apple_mbp_poweroff(struct pci_dev *pdev)
+{
+	struct device *dev = &pdev->dev;
+	struct resource *res;
+
+	if ((!dmi_match(DMI_PRODUCT_NAME, "MacBookPro11,4") &&
+	     !dmi_match(DMI_PRODUCT_NAME, "MacBookPro11,5")) ||
+	    pdev->bus->number != 0 || pdev->devfn != PCI_DEVFN(0x1c, 0))
+		return;
+
+	res = request_mem_region(0x7fa00000, 0x200000,
+				 "MacBook Pro poweroff workaround");
+	if (res)
+		dev_info(dev, "claimed %s %pR\n", res->name, res);
+	else
+		dev_info(dev, "can't work around MacBook Pro poweroff issue\n");
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x8c10, quirk_apple_mbp_poweroff);
arch/x86/xen/smp_pv.c +2 -1
index aae32535f4ec..3e71246da5fe 100644
@@ -19,6 +19,7 @@
 #include <linux/irq_work.h>
 #include <linux/tick.h>
 #include <linux/nmi.h>
+#include <linux/cpuhotplug.h>
 
 #include <asm/paravirt.h>
 #include <asm/desc.h>
@@ -417,7 +418,7 @@ static void xen_pv_play_dead(void) /* used only with HOTPLUG_CPU */
 	 */
 	tick_nohz_idle_enter();
 
-	cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
+	cpuhp_online_idle(CPUHP_AP_ONLINE_IDLE);
 }
 
 #else /* !CONFIG_HOTPLUG_CPU */
drivers/acpi/ec.c +1 -20
index c24235d8fb52..cfad5d9a22f3 100644
@@ -147,7 +147,7 @@ static unsigned int ec_storm_threshold  __read_mostly = 8;
 module_param(ec_storm_threshold, uint, 0644);
 MODULE_PARM_DESC(ec_storm_threshold, "Maxim false GPE numbers not considered as GPE storm");
 
-static bool ec_freeze_events __read_mostly = true;
+static bool ec_freeze_events __read_mostly = false;
 module_param(ec_freeze_events, bool, 0644);
 MODULE_PARM_DESC(ec_freeze_events, "Disabling event handling during suspend/resume");
 
@@ -1812,24 +1812,6 @@ int __init acpi_ec_ecdt_probe(void)
 }
 
 #ifdef CONFIG_PM_SLEEP
-static int acpi_ec_suspend_noirq(struct device *dev)
-{
-	struct acpi_ec *ec =
-		acpi_driver_data(to_acpi_device(dev));
-
-	acpi_ec_enter_noirq(ec);
-	return 0;
-}
-
-static int acpi_ec_resume_noirq(struct device *dev)
-{
-	struct acpi_ec *ec =
-		acpi_driver_data(to_acpi_device(dev));
-
-	acpi_ec_leave_noirq(ec);
-	return 0;
-}
-
 static int acpi_ec_suspend(struct device *dev)
 {
 	struct acpi_ec *ec =
@@ -1851,7 +1833,6 @@ static int acpi_ec_resume(struct device *dev)
 #endif
 
 static const struct dev_pm_ops acpi_ec_pm = {
-	SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(acpi_ec_suspend_noirq, acpi_ec_resume_noirq)
 	SET_SYSTEM_SLEEP_PM_OPS(acpi_ec_suspend, acpi_ec_resume)
 };
 
drivers/acpi/nfit/core.c +9 -1
index 656acb5d7166..f3c3e9d4563c 100644
@@ -3043,6 +3043,8 @@ static struct acpi_driver acpi_nfit_driver = {
 
 static __init int nfit_init(void)
 {
+	int ret;
+
 	BUILD_BUG_ON(sizeof(struct acpi_table_nfit) != 40);
 	BUILD_BUG_ON(sizeof(struct acpi_nfit_system_address) != 56);
 	BUILD_BUG_ON(sizeof(struct acpi_nfit_memory_map) != 48);
@@ -3070,8 +3072,14 @@ static __init int nfit_init(void)
 		return -ENOMEM;
 
 	nfit_mce_register();
+	ret = acpi_bus_register_driver(&acpi_nfit_driver);
+	if (ret) {
+		nfit_mce_unregister();
+		destroy_workqueue(nfit_wq);
+	}
+
+	return ret;
 
-	return acpi_bus_register_driver(&acpi_nfit_driver);
 }
 
 static __exit void nfit_exit(void)
drivers/base/power/domain.c +10 -10
index da49a8383dc3..d417ad1e639c 100644
@@ -1168,8 +1168,6 @@ static struct generic_pm_domain_data *genpd_alloc_dev_data(struct device *dev,
 
 	spin_unlock_irq(&dev->power.lock);
 
-	dev_pm_domain_set(dev, &genpd->domain);
-
 	return gpd_data;
 
  err_free:
@@ -1183,8 +1181,6 @@ static struct generic_pm_domain_data *genpd_alloc_dev_data(struct device *dev,
 static void genpd_free_dev_data(struct device *dev,
 				struct generic_pm_domain_data *gpd_data)
 {
-	dev_pm_domain_set(dev, NULL);
-
 	spin_lock_irq(&dev->power.lock);
 
 	dev->power.subsys_data->domain_data = NULL;
@@ -1221,6 +1217,8 @@ static int genpd_add_device(struct generic_pm_domain *genpd, struct device *dev,
 	if (ret)
 		goto out;
 
+	dev_pm_domain_set(dev, &genpd->domain);
+
 	genpd->device_count++;
 	genpd->max_off_time_changed = true;
 
@@ -1282,6 +1280,8 @@ static int genpd_remove_device(struct generic_pm_domain *genpd,
 	if (genpd->detach_dev)
 		genpd->detach_dev(genpd, dev);
 
+	dev_pm_domain_set(dev, NULL);
+
 	list_del_init(&pdd->list_node);
 
 	genpd_unlock(genpd);
@@ -1393,7 +1393,7 @@ EXPORT_SYMBOL_GPL(pm_genpd_add_subdomain);
 int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
 			      struct generic_pm_domain *subdomain)
 {
-	struct gpd_link *link;
+	struct gpd_link *l, *link;
 	int ret = -EINVAL;
 
 	if (IS_ERR_OR_NULL(genpd) || IS_ERR_OR_NULL(subdomain))
@@ -1409,7 +1409,7 @@ int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
 		goto out;
 	}
 
-	list_for_each_entry(link, &genpd->master_links, master_node) {
+	list_for_each_entry_safe(link, l, &genpd->master_links, master_node) {
 		if (link->slave != subdomain)
 			continue;
 
@@ -1780,12 +1780,12 @@ EXPORT_SYMBOL_GPL(of_genpd_add_provider_onecell);
  */
 void of_genpd_del_provider(struct device_node *np)
 {
-	struct of_genpd_provider *cp;
+	struct of_genpd_provider *cp, *tmp;
 	struct generic_pm_domain *gpd;
 
 	mutex_lock(&gpd_list_lock);
 	mutex_lock(&of_genpd_mutex);
-	list_for_each_entry(cp, &of_genpd_providers, link) {
+	list_for_each_entry_safe(cp, tmp, &of_genpd_providers, link) {
 		if (cp->node == np) {
 			/*
 			 * For each PM domain associated with the
@@ -1925,14 +1925,14 @@ EXPORT_SYMBOL_GPL(of_genpd_add_subdomain);
  */
 struct generic_pm_domain *of_genpd_remove_last(struct device_node *np)
 {
-	struct generic_pm_domain *gpd, *genpd = ERR_PTR(-ENOENT);
+	struct generic_pm_domain *gpd, *tmp, *genpd = ERR_PTR(-ENOENT);
 	int ret;
 
 	if (IS_ERR_OR_NULL(np))
 		return ERR_PTR(-EINVAL);
 
 	mutex_lock(&gpd_list_lock);
-	list_for_each_entry(gpd, &gpd_list, gpd_list_node) {
+	list_for_each_entry_safe(gpd, tmp, &gpd_list, gpd_list_node) {
 		if (gpd->provider == &np->fwnode) {
 			ret = genpd_remove(gpd);
 			genpd = ret ? ERR_PTR(ret) : gpd;
drivers/char/ipmi/ipmi_msghandler.c +5 -0
index 9f699951b75a..49a7e9685e77 100644
@@ -3878,6 +3878,9 @@ static void smi_recv_tasklet(unsigned long val)
 	 * because the lower layer is allowed to hold locks while calling
 	 * message delivery.
 	 */
+
+	rcu_read_lock();
+
 	if (!run_to_completion)
 		spin_lock_irqsave(&intf->xmit_msgs_lock, flags);
 	if (intf->curr_msg == NULL && !intf->in_shutdown) {
@@ -3900,6 +3903,8 @@ static void smi_recv_tasklet(unsigned long val)
 	if (newmsg)
 		intf->handlers->sender(intf->send_info, newmsg);
 
+	rcu_read_unlock();
+
 	handle_new_recv_msgs(intf);
 }
 
drivers/char/ipmi/ipmi_ssif.c +5 -0
index 0b22a9be5029..12d15212f0b2 100644
@@ -761,6 +761,11 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result,
 			       result, len, data[2]);
 		} else if (data[0] != (IPMI_NETFN_APP_REQUEST | 1) << 2
 			   || data[1] != IPMI_GET_MSG_FLAGS_CMD) {
+			/*
+			 * Don't abort here, maybe it was a queued
+			 * response to a previous command.
+			 */
+			ipmi_ssif_unlock_cond(ssif_info, flags);
 			pr_warn(PFX "Invalid response getting flags: %x %x\n",
 				data[0], data[1]);
 		} else {
drivers/cpufreq/intel_pstate.c +19 -2
index eb1158532de3..0d82f3302df6 100644
@@ -225,6 +225,9 @@ struct global_params {
  * @vid:		Stores VID limits for this CPU
  * @pid:		Stores PID parameters for this CPU
  * @last_sample_time:	Last Sample time
+ * @aperf_mperf_shift:	Number of clock cycles after aperf, merf is incremented
+ *			This shift is a multiplier to mperf delta to
+ *			calculate CPU busy.
  * @prev_aperf:		Last APERF value read from APERF MSR
  * @prev_mperf:		Last MPERF value read from MPERF MSR
  * @prev_tsc:		Last timestamp counter (TSC) value
@@ -261,6 +264,7 @@ struct cpudata {
 
 	u64	last_update;
 	u64	last_sample_time;
+	u64	aperf_mperf_shift;
 	u64	prev_aperf;
 	u64	prev_mperf;
 	u64	prev_tsc;
@@ -323,6 +327,7 @@ struct pstate_funcs {
 	int (*get_min)(void);
 	int (*get_turbo)(void);
 	int (*get_scaling)(void);
+	int (*get_aperf_mperf_shift)(void);
 	u64 (*get_val)(struct cpudata*, int pstate);
 	void (*get_vid)(struct cpudata *);
 	void (*update_util)(struct update_util_data *data, u64 time,
@@ -1485,6 +1490,11 @@ static u64 core_get_val(struct cpudata *cpudata, int pstate)
 	return val;
 }
 
+static int knl_get_aperf_mperf_shift(void)
+{
+	return 10;
+}
+
 static int knl_get_turbo_pstate(void)
 {
 	u64 value;
@@ -1543,6 +1553,9 @@ static void intel_pstate_get_cpu_pstates(struct cpudata *cpu)
 	cpu->pstate.max_freq = cpu->pstate.max_pstate * cpu->pstate.scaling;
 	cpu->pstate.turbo_freq = cpu->pstate.turbo_pstate * cpu->pstate.scaling;
 
+	if (pstate_funcs.get_aperf_mperf_shift)
+		cpu->aperf_mperf_shift = pstate_funcs.get_aperf_mperf_shift();
+
 	if (pstate_funcs.get_vid)
 		pstate_funcs.get_vid(cpu);
 
@@ -1619,7 +1632,8 @@ static inline int32_t get_target_pstate_use_cpu_load(struct cpudata *cpu)
 	if (cpu->policy == CPUFREQ_POLICY_PERFORMANCE)
 		return cpu->pstate.turbo_pstate;
 
-	busy_frac = div_fp(sample->mperf, sample->tsc);
+	busy_frac = div_fp(sample->mperf << cpu->aperf_mperf_shift,
+			   sample->tsc);
 
 	boost = cpu->iowait_boost;
 	cpu->iowait_boost >>= 1;
@@ -1681,7 +1695,8 @@ static inline int32_t get_target_pstate_use_performance(struct cpudata *cpu)
 		sample_ratio = div_fp(pid_params.sample_rate_ns, duration_ns);
 		perf_scaled = mul_fp(perf_scaled, sample_ratio);
 	} else {
-		sample_ratio = div_fp(100 * cpu->sample.mperf, cpu->sample.tsc);
+		sample_ratio = div_fp(100 * (cpu->sample.mperf << cpu->aperf_mperf_shift),
+				      cpu->sample.tsc);
 		if (sample_ratio < int_tofp(1))
 			perf_scaled = 0;
 	}
@@ -1824,6 +1839,7 @@ static const struct pstate_funcs knl_funcs = {
 	.get_max_physical = core_get_max_pstate_physical,
 	.get_min = core_get_min_pstate,
 	.get_turbo = knl_get_turbo_pstate,
+	.get_aperf_mperf_shift = knl_get_aperf_mperf_shift,
 	.get_scaling = core_get_scaling,
 	.get_val = core_get_val,
 	.update_util = intel_pstate_update_util_pid,
@@ -2408,6 +2424,7 @@ static void __init copy_cpu_funcs(struct pstate_funcs *funcs)
 	pstate_funcs.get_val   = funcs->get_val;
 	pstate_funcs.get_vid   = funcs->get_vid;
 	pstate_funcs.update_util = funcs->update_util;
+	pstate_funcs.get_aperf_mperf_shift = funcs->get_aperf_mperf_shift;
 
 	intel_pstate_use_acpi_profile();
 }
drivers/dax/device-dax.h +1 -1
index fdcd9769ffde..688b051750bd 100644
@@ -21,5 +21,5 @@ struct dax_region *alloc_dax_region(struct device *parent,
 		int region_id, struct resource *res, unsigned int align,
 		void *addr, unsigned long flags);
 struct dev_dax *devm_create_dev_dax(struct dax_region *dax_region,
-		struct resource *res, int count);
+		int id, struct resource *res, int count);
 #endif /* __DEVICE_DAX_H__ */
drivers/dax/device.c +16 -8
index 006e657dfcb9..a54188e7c04a 100644
@@ -528,7 +528,8 @@ static void dev_dax_release(struct device *dev)
 	struct dax_region *dax_region = dev_dax->region;
 	struct dax_device *dax_dev = dev_dax->dax_dev;
 
-	ida_simple_remove(&dax_region->ida, dev_dax->id);
+	if (dev_dax->id >= 0)
+		ida_simple_remove(&dax_region->ida, dev_dax->id);
 	dax_region_put(dax_region);
 	put_dax(dax_dev);
 	kfree(dev_dax);
@@ -558,7 +559,7 @@ static void unregister_dev_dax(void *dev)
 }
 
 struct dev_dax *devm_create_dev_dax(struct dax_region *dax_region,
-		struct resource *res, int count)
+		int id, struct resource *res, int count)
 {
 	struct device *parent = dax_region->dev;
 	struct dax_device *dax_dev;
@@ -586,10 +587,16 @@ struct dev_dax *devm_create_dev_dax(struct dax_region *dax_region,
 	if (i < count)
 		goto err_id;
 
-	dev_dax->id = ida_simple_get(&dax_region->ida, 0, 0, GFP_KERNEL);
-	if (dev_dax->id < 0) {
-		rc = dev_dax->id;
-		goto err_id;
+	if (id < 0) {
+		id = ida_simple_get(&dax_region->ida, 0, 0, GFP_KERNEL);
+		dev_dax->id = id;
+		if (id < 0) {
+			rc = id;
+			goto err_id;
+		}
+	} else {
+		/* region provider owns @id lifetime */
+		dev_dax->id = -1;
 	}
 
 	/*
@@ -619,7 +626,7 @@ struct dev_dax *devm_create_dev_dax(struct dax_region *dax_region,
 	dev->parent = parent;
 	dev->groups = dax_attribute_groups;
 	dev->release = dev_dax_release;
-	dev_set_name(dev, "dax%d.%d", dax_region->id, dev_dax->id);
+	dev_set_name(dev, "dax%d.%d", dax_region->id, id);
 
 	rc = cdev_device_add(cdev, dev);
 	if (rc) {
@@ -635,7 +642,8 @@ struct dev_dax *devm_create_dev_dax(struct dax_region *dax_region,
 	return dev_dax;
 
  err_dax:
-	ida_simple_remove(&dax_region->ida, dev_dax->id);
+	if (dev_dax->id >= 0)
+		ida_simple_remove(&dax_region->ida, dev_dax->id);
  err_id:
 	kfree(dev_dax);
 
drivers/dax/pmem.c +7 -5
index 9f2a0b4fd801..8d8c852ba8f2 100644
@@ -58,13 +58,12 @@ static void dax_pmem_percpu_kill(void *data)
 
 static int dax_pmem_probe(struct device *dev)
 {
-	int rc;
 	void *addr;
 	struct resource res;
+	int rc, id, region_id;
 	struct nd_pfn_sb *pfn_sb;
 	struct dev_dax *dev_dax;
 	struct dax_pmem *dax_pmem;
-	struct nd_region *nd_region;
 	struct nd_namespace_io *nsio;
 	struct dax_region *dax_region;
 	struct nd_namespace_common *ndns;
@@ -123,14 +122,17 @@ static int dax_pmem_probe(struct device *dev)
 	/* adjust the dax_region resource to the start of data */
 	res.start += le64_to_cpu(pfn_sb->dataoff);
 
-	nd_region = to_nd_region(dev->parent);
-	dax_region = alloc_dax_region(dev, nd_region->id, &res,
+	rc = sscanf(dev_name(&ndns->dev), "namespace%d.%d", &region_id, &id);
+	if (rc != 2)
+		return -EINVAL;
+
+	dax_region = alloc_dax_region(dev, region_id, &res,
 			le32_to_cpu(pfn_sb->align), addr, PFN_DEV|PFN_MAP);
 	if (!dax_region)
 		return -ENOMEM;
 
 	/* TODO: support for subdividing a dax region... */
-	dev_dax = devm_create_dev_dax(dax_region, &res, 1);
+	dev_dax = devm_create_dev_dax(dax_region, id, &res, 1);
 
 	/* child dev_dax instances now own the lifetime of the dax_region */
 	dax_region_put(dax_region);
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +6 -0
index c6dba1eaefbd..c0a806280257 100644
@@ -838,6 +838,12 @@ static int amdgpu_cgs_get_active_displays_info(struct cgs_device *cgs_device,
 		return -EINVAL;
 
 	mode_info = info->mode_info;
+	if (mode_info) {
+		/* if the displays are off, vblank time is max */
+		mode_info->vblank_time_us = 0xffffffff;
+		/* always set the reference clock */
+		mode_info->ref_clock = adev->clock.spll.reference_freq;
+	}
 
 	if (adev->mode_info.num_crtc && adev->mode_info.mode_config_initialized) {
 		list_for_each_entry(crtc,
drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c +2 -1
index f5ae871aa11c..9c9d39018bd6 100644
@@ -208,7 +208,8 @@ static void amdgpu_pp_late_fini(void *handle)
 	if (adev->pp_enabled && adev->pm.dpm_enabled)
 		amdgpu_pm_sysfs_fini(adev);
 
-	amd_powerplay_destroy(adev->powerplay.pp_handle);
+	if (adev->pp_enabled)
+		amd_powerplay_destroy(adev->powerplay.pp_handle);
 }
 
 static int amdgpu_pp_suspend(void *handle)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +7 -8
index ac5e92e5d59d..99f575070943 100644
@@ -319,14 +319,11 @@ static int psp_load_fw(struct amdgpu_device *adev)
 {
 	int ret;
 	struct psp_context *psp = &adev->psp;
-	struct psp_gfx_cmd_resp *cmd;
 
-	cmd = kzalloc(sizeof(struct psp_gfx_cmd_resp), GFP_KERNEL);
-	if (!cmd)
+	psp->cmd = kzalloc(sizeof(struct psp_gfx_cmd_resp), GFP_KERNEL);
+	if (!psp->cmd)
 		return -ENOMEM;
 
-	psp->cmd = cmd;
-
 	ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG,
 				      AMDGPU_GEM_DOMAIN_GTT,
 				      &psp->fw_pri_bo,
@@ -365,8 +362,6 @@ static int psp_load_fw(struct amdgpu_device *adev)
 	if (ret)
 		goto failed_mem;
 
-	kfree(cmd);
-
 	return 0;
 
 failed_mem:
@@ -376,7 +371,8 @@ static int psp_load_fw(struct amdgpu_device *adev)
 	amdgpu_bo_free_kernel(&psp->fw_pri_bo,
 			      &psp->fw_pri_mc_addr, &psp->fw_pri_buf);
 failed:
-	kfree(cmd);
+	kfree(psp->cmd);
+	psp->cmd = NULL;
 	return ret;
 }
 
@@ -436,6 +432,9 @@ static int psp_hw_fini(void *handle)
 		amdgpu_bo_free_kernel(&psp->fence_buf_bo,
 				      &psp->fence_buf_mc_addr, &psp->fence_buf);
 
+	kfree(psp->cmd);
+	psp->cmd = NULL;
+
 	return 0;
 }
 
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +3 -0
index 5db0230e45c6..e06c8a718310 100644
@@ -1462,6 +1462,9 @@ static ssize_t amdgpu_ttm_vram_read(struct file *f, char __user *buf,
 	if (size & 0x3 || *pos & 0x3)
 		return -EINVAL;
 
+	if (*pos >= adev->mc.mc_vram_size)
+		return -ENXIO;
+
 	while (size) {
 		unsigned long flags;
 		uint32_t value;
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +2 -69

83 lines not on this page · raw message

drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +6 -0
index 7aa5ca815a3a..0b74da3dca8b 100644
@@ -1224,6 +1224,12 @@ static int cz_hwmgr_backend_fini(struct pp_hwmgr *hwmgr)
 		phm_destroy_table(hwmgr, &(hwmgr->disable_dynamic_state_management));
 		phm_destroy_table(hwmgr, &(hwmgr->power_down_asic));
 		phm_destroy_table(hwmgr, &(hwmgr->setup_asic));
+
+		if (NULL != hwmgr->dyn_state.vddc_dep_on_dal_pwrl) {
+			kfree(hwmgr->dyn_state.vddc_dep_on_dal_pwrl);
+			hwmgr->dyn_state.vddc_dep_on_dal_pwrl = NULL;
+		}
+
 		kfree(hwmgr->backend);
 		hwmgr->backend = NULL;
 	}
drivers/gpu/drm/drm_dp_mst_topology.c +33 -8

93 lines not on this page · raw message

drivers/gpu/drm/drm_framebuffer.c +1 -0
index fc8ef42203ec..b3ef4f1c2630 100644
@@ -832,6 +832,7 @@ static int atomic_remove_fb(struct drm_framebuffer *fb)
 		drm_atomic_clean_old_fb(dev, plane_mask, ret);
 
 	if (ret == -EDEADLK) {
+		drm_atomic_state_clear(state);
 		drm_modeset_backoff(&ctx);
 		goto retry;
 	}
drivers/gpu/drm/etnaviv/etnaviv_drv.c +1 -0
index 5255278dde56..91e17aeee1da 100644
@@ -495,6 +495,7 @@ static struct drm_driver etnaviv_drm_driver = {
 	.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
 	.gem_prime_export   = drm_gem_prime_export,
 	.gem_prime_import   = drm_gem_prime_import,
+	.gem_prime_res_obj  = etnaviv_gem_prime_res_obj,
 	.gem_prime_pin      = etnaviv_gem_prime_pin,
 	.gem_prime_unpin    = etnaviv_gem_prime_unpin,
 	.gem_prime_get_sg_table = etnaviv_gem_prime_get_sg_table,
drivers/gpu/drm/etnaviv/etnaviv_drv.h +1 -0
index e41f38667c1c..058389f93b69 100644
@@ -80,6 +80,7 @@ void *etnaviv_gem_prime_vmap(struct drm_gem_object *obj);
 void etnaviv_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr);
 int etnaviv_gem_prime_mmap(struct drm_gem_object *obj,
 			   struct vm_area_struct *vma);
+struct reservation_object *etnaviv_gem_prime_res_obj(struct drm_gem_object *obj);
 struct drm_gem_object *etnaviv_gem_prime_import_sg_table(struct drm_device *dev,
 	struct dma_buf_attachment *attach, struct sg_table *sg);
 int etnaviv_gem_prime_pin(struct drm_gem_object *obj);
drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c +7 -0
index 62b47972a52e..abed6f781281 100644
@@ -150,3 +150,10 @@ struct drm_gem_object *etnaviv_gem_prime_import_sg_table(struct drm_device *dev,
 
 	return ERR_PTR(ret);
 }
+
+struct reservation_object *etnaviv_gem_prime_res_obj(struct drm_gem_object *obj)
+{
+	struct etnaviv_gem_object *etnaviv_obj = to_etnaviv_bo(obj);
+
+	return etnaviv_obj->resv;
+}
drivers/gpu/drm/i915/gvt/kvmgt.c +9 -5
index 1ae0b4083ce1..fd0c85f9ef3c 100644
@@ -232,16 +232,20 @@ static void gvt_cache_destroy(struct intel_vgpu *vgpu)
 	struct device *dev = mdev_dev(vgpu->vdev.mdev);
 	unsigned long gfn;
 
-	mutex_lock(&vgpu->vdev.cache_lock);
-	while ((node = rb_first(&vgpu->vdev.cache))) {
+	for (;;) {
+		mutex_lock(&vgpu->vdev.cache_lock);
+		node = rb_first(&vgpu->vdev.cache);
+		if (!node) {
+			mutex_unlock(&vgpu->vdev.cache_lock);
+			break;
+		}
 		dma = rb_entry(node, struct gvt_dma, node);
 		gvt_dma_unmap_iova(vgpu, dma->iova);
 		gfn = dma->gfn;
-
-		vfio_unpin_pages(dev, &gfn, 1);
 		__gvt_cache_remove_entry(vgpu, dma);
+		mutex_unlock(&vgpu->vdev.cache_lock);
+		vfio_unpin_pages(dev, &gfn, 1);
 	}
-	mutex_unlock(&vgpu->vdev.cache_lock);
 }
 
 static struct intel_vgpu_type *intel_gvt_find_vgpu_type(struct intel_gvt *gvt,
drivers/gpu/drm/i915/i915_debugfs.c +1 -1
index 4bd1467c17b1..0341061fbb34 100644
@@ -3018,7 +3018,7 @@ static void intel_connector_info(struct seq_file *m,
 			   connector->display_info.cea_rev);
 	}
 
-	if (!intel_encoder || intel_encoder->type == INTEL_OUTPUT_DP_MST)
+	if (!intel_encoder)
 		return;
 
 	switch (connector->connector_type) {
drivers/gpu/drm/i915/i915_drv.c +5 -3
index 48428672fc6e..6ac8d37e7ab8 100644
@@ -1087,10 +1087,12 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv)
 	 * and the registers being closely associated.
 	 *
 	 * According to chipset errata, on the 965GM, MSI interrupts may
-	 * be lost or delayed, but we use them anyways to avoid
-	 * stuck interrupts on some machines.
+	 * be lost or delayed, and was defeatured. MSI interrupts seem to
+	 * get lost on g4x as well, and interrupt delivery seems to stay
+	 * properly dead afterwards. So we'll just disable them for all
+	 * pre-gen5 chipsets.
 	 */
-	if (!IS_I945G(dev_priv) && !IS_I945GM(dev_priv)) {
+	if (INTEL_GEN(dev_priv) >= 5) {
 		if (pci_enable_msi(pdev) < 0)
 			DRM_DEBUG_DRIVER("can't enable MSI");
 	}
drivers/gpu/drm/i915/i915_perf.c +6 -6
index 060b171480d5..aac84dda532c 100644
@@ -1210,10 +1210,6 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream,
 			return ret;
 	}
 
-	ret = alloc_oa_buffer(dev_priv);
-	if (ret)
-		goto err_oa_buf_alloc;
-
 	/* PRM - observability performance counters:
 	 *
 	 *   OACONTROL, performance counter enable, note:
@@ -1229,6 +1225,10 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream,
 	intel_runtime_pm_get(dev_priv);
 	intel_uncore_forcewake_get(dev_priv, FORCEWAKE_ALL);
 
+	ret = alloc_oa_buffer(dev_priv);
+	if (ret)
+		goto err_oa_buf_alloc;
+
 	ret = dev_priv->perf.oa.ops.enable_metric_set(dev_priv);
 	if (ret)
 		goto err_enable;
@@ -1240,11 +1240,11 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream,
 	return 0;
 
 err_enable:
-	intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL);
-	intel_runtime_pm_put(dev_priv);
 	free_oa_buffer(dev_priv);
 
 err_oa_buf_alloc:
+	intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL);
+	intel_runtime_pm_put(dev_priv);
 	if (stream->ctx)
 		oa_put_render_ctx_id(stream);
 
drivers/gpu/drm/i915/intel_cdclk.c +20 -0
index f29a226e24d8..6808f82ffb5d 100644
@@ -491,6 +491,14 @@ static void vlv_set_cdclk(struct drm_i915_private *dev_priv,
 	int cdclk = cdclk_state->cdclk;
 	u32 val, cmd;
 
+	/* There are cases where we can end up here with power domains
+	 * off and a CDCLK frequency other than the minimum, like when
+	 * issuing a modeset without actually changing any display after
+	 * a system suspend.  So grab the PIPE-A domain, which covers
+	 * the HW blocks needed for the following programming.
+	 */
+	intel_display_power_get(dev_priv, POWER_DOMAIN_PIPE_A);
+
 	if (cdclk >= 320000) /* jump to highest voltage for 400MHz too */
 		cmd = 2;
 	else if (cdclk == 266667)
@@ -549,6 +557,8 @@ static void vlv_set_cdclk(struct drm_i915_private *dev_priv,
 	intel_update_cdclk(dev_priv);
 
 	vlv_program_pfi_credits(dev_priv);
+
+	intel_display_power_put(dev_priv, POWER_DOMAIN_PIPE_A);
 }
 
 static void chv_set_cdclk(struct drm_i915_private *dev_priv,
@@ -568,6 +578,14 @@ static void chv_set_cdclk(struct drm_i915_private *dev_priv,
 		return;
 	}
 
+	/* There are cases where we can end up here with power domains
+	 * off and a CDCLK frequency other than the minimum, like when
+	 * issuing a modeset without actually changing any display after
+	 * a system suspend.  So grab the PIPE-A domain, which covers
+	 * the HW blocks needed for the following programming.
+	 */
+	intel_display_power_get(dev_priv, POWER_DOMAIN_PIPE_A);
+
 	/*
 	 * Specs are full of misinformation, but testing on actual
 	 * hardware has shown that we just need to write the desired
@@ -590,6 +608,8 @@ static void chv_set_cdclk(struct drm_i915_private *dev_priv,
 	intel_update_cdclk(dev_priv);
 
 	vlv_program_pfi_credits(dev_priv);
+
+	intel_display_power_put(dev_priv, POWER_DOMAIN_PIPE_A);
 }
 
 static int bdw_calc_cdclk(int max_pixclk)
drivers/gpu/drm/i915/intel_fbdev.c +6 -5
index 332254a8eebe..e09f3690e299 100644
@@ -535,13 +535,14 @@ static void intel_fbdev_destroy(struct intel_fbdev *ifbdev)
 
 	drm_fb_helper_fini(&ifbdev->helper);
 
-	if (ifbdev->fb) {
+	if (ifbdev->vma) {
 		mutex_lock(&ifbdev->helper.dev->struct_mutex);
 		intel_unpin_fb_vma(ifbdev->vma);
 		mutex_unlock(&ifbdev->helper.dev->struct_mutex);
+	}
 
+	if (ifbdev->fb)
 		drm_framebuffer_remove(&ifbdev->fb->base);
-	}
 
 	kfree(ifbdev);
 }
@@ -765,7 +766,7 @@ void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronous
 	struct intel_fbdev *ifbdev = dev_priv->fbdev;
 	struct fb_info *info;
 
-	if (!ifbdev || !ifbdev->fb)
+	if (!ifbdev || !ifbdev->vma)
 		return;
 
 	info = ifbdev->helper.fbdev;
@@ -812,7 +813,7 @@ void intel_fbdev_output_poll_changed(struct drm_device *dev)
 {
 	struct intel_fbdev *ifbdev = to_i915(dev)->fbdev;
 
-	if (ifbdev && ifbdev->fb)
+	if (ifbdev && ifbdev->vma)
 		drm_fb_helper_hotplug_event(&ifbdev->helper);
 }
 
@@ -824,7 +825,7 @@ void intel_fbdev_restore_mode(struct drm_device *dev)
 		return;
 
 	intel_fbdev_sync(ifbdev);
-	if (!ifbdev->fb)
+	if (!ifbdev->vma)
 		return;
 
 	if (drm_fb_helper_restore_fbdev_mode_unlocked(&ifbdev->helper) == 0)
drivers/gpu/drm/imx/parallel-display.c +1 -1
index 636031a30e17..8aca20209cb8 100644
@@ -237,7 +237,7 @@ static int imx_pd_bind(struct device *dev, struct device *master, void *data)
 
 	/* port@1 is the output port */
 	ret = drm_of_find_panel_or_bridge(np, 1, 0, &imxpd->panel, &imxpd->bridge);
-	if (ret)
+	if (ret && ret != -ENODEV)
 		return ret;
 
 	imxpd->dev = dev;
drivers/gpu/drm/radeon/atombios_encoders.c +11 -2
index fa4f8f008e4d..e67ed383e11b 100644
@@ -31,6 +31,7 @@
 #include "radeon_asic.h"
 #include "atom.h"
 #include <linux/backlight.h>
+#include <linux/dmi.h>
 
 extern int atom_debug;
 
@@ -2184,9 +2185,17 @@ int radeon_atom_pick_dig_encoder(struct drm_encoder *encoder, int fe_idx)
 		goto assigned;
 	}
 
-	/* on DCE32 and encoder can driver any block so just crtc id */
+	/*
+	 * On DCE32 any encoder can drive any block so usually just use crtc id,
+	 * but Apple thinks different at least on iMac10,1, so there use linkb,
+	 * otherwise the internal eDP panel will stay dark.
+	 */
 	if (ASIC_IS_DCE32(rdev)) {
-		enc_idx = radeon_crtc->crtc_id;
+		if (dmi_match(DMI_PRODUCT_NAME, "iMac10,1"))
+			enc_idx = (dig->linkb) ? 1 : 0;
+		else
+			enc_idx = radeon_crtc->crtc_id;
+
 		goto assigned;
 	}
 
drivers/gpu/drm/radeon/ci_dpm.c +6 -0
index ea36dc4dd5d2..24810492d2c1 100644
@@ -782,6 +782,12 @@ bool ci_dpm_vblank_too_short(struct radeon_device *rdev)
 	if (r600_dpm_get_vrefresh(rdev) > 120)
 		return true;
 
+	/* disable mclk switching if the refresh is >120Hz, even if the
+        * blanking period would allow it
+        */
+	if (r600_dpm_get_vrefresh(rdev) > 120)
+		return true;
+
 	if (vblank_time < switch_limit)
 		return true;
 	else
drivers/gpu/drm/ttm/ttm_bo.c +3 -1
index a6d7fcb99c0b..22b57020790d 100644
@@ -1353,7 +1353,6 @@ int ttm_bo_clean_mm(struct ttm_bo_device *bdev, unsigned mem_type)
 		       mem_type);
 		return ret;
 	}
-	dma_fence_put(man->move);
 
 	man->use_type = false;
 	man->has_type = false;
@@ -1369,6 +1368,9 @@ int ttm_bo_clean_mm(struct ttm_bo_device *bdev, unsigned mem_type)
 		ret = (*man->func->takedown)(man);
 	}
 
+	dma_fence_put(man->move);
+	man->move = NULL;
+
 	return ret;
 }
 EXPORT_SYMBOL(ttm_bo_clean_mm);
drivers/hid/hid-multitouch.c +4 -12
index 24d5b6deb571..be5bea15ce52 100644
@@ -595,16 +595,6 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 	return 0;
 }
 
-static int mt_touch_input_mapped(struct hid_device *hdev, struct hid_input *hi,
-		struct hid_field *field, struct hid_usage *usage,
-		unsigned long **bit, int *max)
-{
-	if (usage->type == EV_KEY || usage->type == EV_ABS)
-		set_bit(usage->type, hi->input->evbit);
-
-	return -1;
-}
-
 static int mt_compute_slot(struct mt_device *td, struct input_dev *input)
 {
 	__s32 quirks = td->mtclass.quirks;
@@ -905,8 +895,10 @@ static int mt_input_mapped(struct hid_device *hdev, struct hid_input *hi,
 		return 0;
 
 	if (field->application == HID_DG_TOUCHSCREEN ||
-	    field->application == HID_DG_TOUCHPAD)
-		return mt_touch_input_mapped(hdev, hi, field, usage, bit, max);
+	    field->application == HID_DG_TOUCHPAD) {
+		/* We own these mappings, tell hid-input to ignore them */
+		return -1;
+	}
 
 	/* let hid-core decide for the others */
 	return 0;
drivers/hv/channel.c +2 -0
index 736ac76d2a6a..3cea1216754e 100644
@@ -606,6 +606,8 @@ static int vmbus_close_internal(struct vmbus_channel *channel)
 		get_order(channel->ringbuffer_pagecount * PAGE_SIZE));
 
 out:
+	/* re-enable tasklet for use on re-open */
+	tasklet_enable(&channel->callback_event);
 	return ret;
 }
 
drivers/infiniband/core/addr.c +5 -1
index ece6926fa2e6..5da2ac7cf61a 100644
@@ -510,6 +510,11 @@ static int addr_resolve(struct sockaddr *src_in,
 	struct dst_entry *dst;
 	int ret;
 
+	if (!addr->net) {
+		pr_warn_ratelimited("%s: missing namespace\n", __func__);
+		return -EINVAL;
+	}
+
 	if (src_in->sa_family == AF_INET) {
 		struct rtable *rt = NULL;
 		const struct sockaddr_in *dst_in4 =
@@ -547,7 +552,6 @@ static int addr_resolve(struct sockaddr *src_in,
 	}
 
 	addr->bound_dev_if = ndev->ifindex;
-	addr->net = dev_net(ndev);
 	dev_put(ndev);
 
 	return ret;
drivers/infiniband/core/cma.c +2 -0
index 31bb82d8ecd7..d65a09317719 100644
@@ -1044,6 +1044,8 @@ int rdma_init_qp_attr(struct rdma_cm_id *id, struct ib_qp_attr *qp_attr,
 		} else
 			ret = iw_cm_init_qp_attr(id_priv->cm_id.iw, qp_attr,
 						 qp_attr_mask);
+		qp_attr->port_num = id_priv->id.port_num;
+		*qp_attr_mask |= IB_QP_PORT;
 	} else
 		ret = -ENOSYS;
 
drivers/infiniband/core/uverbs_cmd.c +2 -1
index e63f2a13c5e1..f3f9d0b5dce0 100644
@@ -1931,7 +1931,8 @@ static int modify_qp(struct ib_uverbs_file *file,
 		goto out;
 	}
 
-	if (!rdma_is_port_valid(qp->device, cmd->base.port_num)) {
+	if ((cmd->base.attr_mask & IB_QP_PORT) &&
+	    !rdma_is_port_valid(qp->device, cmd->base.port_num)) {
 		ret = -EINVAL;
 		goto release_qp;
 	}
drivers/infiniband/hw/mlx5/mr.c +1 -1
index 366433f71b58..08512d4c8e89 100644
@@ -1779,7 +1779,7 @@ mlx5_ib_sg_to_klms(struct mlx5_ib_mr *mr,
 	mr->ndescs = sg_nents;
 
 	for_each_sg(sgl, sg, sg_nents, i) {
-		if (unlikely(i > mr->max_descs))
+		if (unlikely(i >= mr->max_descs))
 			break;
 		klms[i].va = cpu_to_be64(sg_dma_address(sg) + sg_offset);
 		klms[i].bcount = cpu_to_be32(sg_dma_len(sg) - sg_offset);
drivers/infiniband/ulp/iser/iscsi_iser.c +11 -0
index 5a887efb4bdf..37b33d708c2d 100644
@@ -83,6 +83,7 @@ static struct scsi_host_template iscsi_iser_sht;
 static struct iscsi_transport iscsi_iser_transport;
 static struct scsi_transport_template *iscsi_iser_scsi_transport;
 static struct workqueue_struct *release_wq;
+static DEFINE_MUTEX(unbind_iser_conn_mutex);
 struct iser_global ig;
 
 int iser_debug_level = 0;
@@ -550,12 +551,14 @@ iscsi_iser_conn_stop(struct iscsi_cls_conn *cls_conn, int flag)
 	 */
 	if (iser_conn) {
 		mutex_lock(&iser_conn->state_mutex);
+		mutex_lock(&unbind_iser_conn_mutex);
 		iser_conn_terminate(iser_conn);
 		iscsi_conn_stop(cls_conn, flag);
 
 		/* unbind */
 		iser_conn->iscsi_conn = NULL;
 		conn->dd_data = NULL;
+		mutex_unlock(&unbind_iser_conn_mutex);
 
 		complete(&iser_conn->stop_completion);
 		mutex_unlock(&iser_conn->state_mutex);
@@ -977,13 +980,21 @@ static int iscsi_iser_slave_alloc(struct scsi_device *sdev)
 	struct iser_conn *iser_conn;
 	struct ib_device *ib_dev;
 
+	mutex_lock(&unbind_iser_conn_mutex);
+
 	session = starget_to_session(scsi_target(sdev))->dd_data;
 	iser_conn = session->leadconn->dd_data;
+	if (!iser_conn) {
+		mutex_unlock(&unbind_iser_conn_mutex);
+		return -ENOTCONN;
+	}
 	ib_dev = iser_conn->ib_conn.device->ib_device;
 
 	if (!(ib_dev->attrs.device_cap_flags & IB_DEVICE_SG_GAPS_REG))
 		blk_queue_virt_boundary(sdev->request_queue, ~MASK_4K);
 
+	mutex_unlock(&unbind_iser_conn_mutex);
+
 	return 0;
 }
 
drivers/infiniband/ulp/isert/ib_isert.c +1 -1
index fcbed35e95a8..0e662656ef42 100644
@@ -1452,7 +1452,7 @@ static void
 isert_login_recv_done(struct ib_cq *cq, struct ib_wc *wc)
 {
 	struct isert_conn *isert_conn = wc->qp->qp_context;
-	struct ib_device *ib_dev = isert_conn->cm_id->device;
+	struct ib_device *ib_dev = isert_conn->device->ib_device;
 
 	if (unlikely(wc->status != IB_WC_SUCCESS)) {
 		isert_print_wc(wc, "login recv");
drivers/input/serio/i8042.c +9 -3
index c52da651269b..824f4c1c1f31 100644
@@ -436,8 +436,10 @@ static int i8042_start(struct serio *serio)
 {
 	struct i8042_port *port = serio->port_data;
 
+	spin_lock_irq(&i8042_lock);
 	port->exists = true;
-	mb();
+	spin_unlock_irq(&i8042_lock);
+
 	return 0;
 }
 
@@ -450,16 +452,20 @@ static void i8042_stop(struct serio *serio)
 {
 	struct i8042_port *port = serio->port_data;
 
+	spin_lock_irq(&i8042_lock);
 	port->exists = false;
+	port->serio = NULL;
+	spin_unlock_irq(&i8042_lock);
 
 	/*
+	 * We need to make sure that interrupt handler finishes using
+	 * our serio port before we return from this function.
 	 * We synchronize with both AUX and KBD IRQs because there is
 	 * a (very unlikely) chance that AUX IRQ is raised for KBD port
 	 * and vice versa.
 	 */
 	synchronize_irq(I8042_AUX_IRQ);
 	synchronize_irq(I8042_KBD_IRQ);
-	port->serio = NULL;
 }
 
 /*
@@ -576,7 +582,7 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id)
 
 	spin_unlock_irqrestore(&i8042_lock, flags);
 
-	if (likely(port->exists && !filtered))
+	if (likely(serio && !filtered))
 		serio_interrupt(serio, data, dfl);
 
  out:
drivers/iommu/arm-smmu.c +16 -0
index 7ec30b08b3bd..7ecd1a0b8419 100644
@@ -312,6 +312,14 @@ enum arm_smmu_implementation {
 	CAVIUM_SMMUV2,
 };
 
+/* Until ACPICA headers cover IORT rev. C */
+#ifndef ACPI_IORT_SMMU_CORELINK_MMU401
+#define ACPI_IORT_SMMU_CORELINK_MMU401	0x4
+#endif
+#ifndef ACPI_IORT_SMMU_CAVIUM_THUNDERX
+#define ACPI_IORT_SMMU_CAVIUM_THUNDERX	0x5
+#endif
+
 struct arm_smmu_s2cr {
 	struct iommu_group		*group;
 	int				count;
@@ -2073,6 +2081,10 @@ static int acpi_smmu_get_data(u32 model, struct arm_smmu_device *smmu)
 		smmu->version = ARM_SMMU_V1;
 		smmu->model = GENERIC_SMMU;
 		break;
+	case ACPI_IORT_SMMU_CORELINK_MMU401:
+		smmu->version = ARM_SMMU_V1_64K;
+		smmu->model = GENERIC_SMMU;
+		break;
 	case ACPI_IORT_SMMU_V2:
 		smmu->version = ARM_SMMU_V2;
 		smmu->model = GENERIC_SMMU;
@@ -2081,6 +2093,10 @@ static int acpi_smmu_get_data(u32 model, struct arm_smmu_device *smmu)
 		smmu->version = ARM_SMMU_V2;
 		smmu->model = ARM_MMU500;
 		break;
+	case ACPI_IORT_SMMU_CAVIUM_THUNDERX:
+		smmu->version = ARM_SMMU_V2;
+		smmu->model = CAVIUM_SMMUV2;
+		break;
 	default:
 		ret = -ENODEV;
 	}
drivers/md/dm-raid.c +10 -3
index b4b75dad816a..2e10c2f13a34 100644
@@ -1571,7 +1571,7 @@ static sector_t __rdev_sectors(struct raid_set *rs)
 			return rdev->sectors;
 	}
 
-	BUG(); /* Constructor ensures we got some. */
+	return 0;
 }
 
 /* Calculate the sectors per device and per array used for @rs */
@@ -2941,7 +2941,7 @@ static int raid_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 	bool resize;
 	struct raid_type *rt;
 	unsigned int num_raid_params, num_raid_devs;
-	sector_t calculated_dev_sectors;
+	sector_t calculated_dev_sectors, rdev_sectors;
 	struct raid_set *rs = NULL;
 	const char *arg;
 	struct rs_layout rs_layout;
@@ -3017,7 +3017,14 @@ static int raid_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 	if (r)
 		goto bad;
 
-	resize = calculated_dev_sectors != __rdev_sectors(rs);
+	rdev_sectors = __rdev_sectors(rs);
+	if (!rdev_sectors) {
+		ti->error = "Invalid rdev size";
+		r = -EINVAL;
+		goto bad;
+	}
+
+	resize = calculated_dev_sectors != rdev_sectors;
 
 	INIT_WORK(&rs->md.event_work, do_table_event);
 	ti->private = rs;
drivers/md/faulty.c +3 -2
index b0536cfd8e17..06a64d5d8c6c 100644
@@ -170,7 +170,7 @@ static void add_sector(struct faulty_conf *conf, sector_t start, int mode)
 		conf->nfaults = n+1;
 }
 
-static void faulty_make_request(struct mddev *mddev, struct bio *bio)
+static bool faulty_make_request(struct mddev *mddev, struct bio *bio)
 {
 	struct faulty_conf *conf = mddev->private;
 	int failit = 0;
@@ -182,7 +182,7 @@ static void faulty_make_request(struct mddev *mddev, struct bio *bio)
 			 * just fail immediately
 			 */
 			bio_io_error(bio);
-			return;
+			return true;
 		}
 
 		if (check_sector(conf, bio->bi_iter.bi_sector,
@@ -224,6 +224,7 @@ static void faulty_make_request(struct mddev *mddev, struct bio *bio)
 		bio->bi_bdev = conf->rdev->bdev;
 
 	generic_make_request(bio);
+	return true;
 }
 
 static void faulty_status(struct seq_file *seq, struct mddev *mddev)
drivers/md/linear.c +4 -3
index df6f2c98eca7..5f1eb9189542 100644
@@ -245,7 +245,7 @@ static void linear_free(struct mddev *mddev, void *priv)
 	kfree(conf);
 }
 
-static void linear_make_request(struct mddev *mddev, struct bio *bio)
+static bool linear_make_request(struct mddev *mddev, struct bio *bio)
 {
 	char b[BDEVNAME_SIZE];
 	struct dev_info *tmp_dev;
@@ -254,7 +254,7 @@ static void linear_make_request(struct mddev *mddev, struct bio *bio)
 
 	if (unlikely(bio->bi_opf & REQ_PREFLUSH)) {
 		md_flush_request(mddev, bio);
-		return;
+		return true;
 	}
 
 	tmp_dev = which_dev(mddev, bio_sector);
@@ -292,7 +292,7 @@ static void linear_make_request(struct mddev *mddev, struct bio *bio)
 		mddev_check_write_zeroes(mddev, bio);
 		generic_make_request(bio);
 	}
-	return;
+	return true;
 
 out_of_bounds:
 	pr_err("md/linear:%s: make_request: Sector %llu out of bounds on dev %s: %llu sectors, offset %llu\n",
@@ -302,6 +302,7 @@ static void linear_make_request(struct mddev *mddev, struct bio *bio)
 	       (unsigned long long)tmp_dev->rdev->sectors,
 	       (unsigned long long)start_sector);
 	bio_io_error(bio);
+	return true;
 }
 
 static void linear_status (struct seq_file *seq, struct mddev *mddev)
drivers/md/md.c +17 -5
index 87edc342ccb3..d7847014821a 100644
@@ -277,7 +277,7 @@ static blk_qc_t md_make_request(struct request_queue *q, struct bio *bio)
 		bio_endio(bio);
 		return BLK_QC_T_NONE;
 	}
-	smp_rmb(); /* Ensure implications of  'active' are visible */
+check_suspended:
 	rcu_read_lock();
 	if (mddev->suspended) {
 		DEFINE_WAIT(__wait);
@@ -302,7 +302,11 @@ static blk_qc_t md_make_request(struct request_queue *q, struct bio *bio)
 	sectors = bio_sectors(bio);
 	/* bio could be mergeable after passing to underlayer */
 	bio->bi_opf &= ~REQ_NOMERGE;
-	mddev->pers->make_request(mddev, bio);
+	if (!mddev->pers->make_request(mddev, bio)) {
+		atomic_dec(&mddev->active_io);
+		wake_up(&mddev->sb_wait);
+		goto check_suspended;
+	}
 
 	cpu = part_stat_lock();
 	part_stat_inc(cpu, &mddev->gendisk->part0, ios[rw]);
@@ -327,6 +331,7 @@ void mddev_suspend(struct mddev *mddev)
 	if (mddev->suspended++)
 		return;
 	synchronize_rcu();
+	wake_up(&mddev->sb_wait);
 	wait_event(mddev->sb_wait, atomic_read(&mddev->active_io) == 0);
 	mddev->pers->quiesce(mddev, 1);
 
@@ -7950,12 +7955,14 @@ EXPORT_SYMBOL(md_done_sync);
  * If we need to update some array metadata (e.g. 'active' flag
  * in superblock) before writing, schedule a superblock update
  * and wait for it to complete.
+ * A return value of 'false' means that the write wasn't recorded
+ * and cannot proceed as the array is being suspend.
  */
-void md_write_start(struct mddev *mddev, struct bio *bi)
+bool md_write_start(struct mddev *mddev, struct bio *bi)
 {
 	int did_change = 0;
 	if (bio_data_dir(bi) != WRITE)
-		return;
+		return true;
 
 	BUG_ON(mddev->ro == 1);
 	if (mddev->ro == 2) {
@@ -7987,7 +7994,12 @@ void md_write_start(struct mddev *mddev, struct bio *bi)
 	if (did_change)
 		sysfs_notify_dirent_safe(mddev->sysfs_state);
 	wait_event(mddev->sb_wait,
-		   !test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags));
+		   !test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags) && !mddev->suspended);
+	if (test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags)) {
+		percpu_ref_put(&mddev->writes_pending);
+		return false;
+	}
+	return true;
 }
 EXPORT_SYMBOL(md_write_start);
 
drivers/md/md.h +2 -2
index 0fa1de42c42b..63d342d560b8 100644
@@ -510,7 +510,7 @@ struct md_personality
 	int level;
 	struct list_head list;
 	struct module *owner;
-	void (*make_request)(struct mddev *mddev, struct bio *bio);
+	bool (*make_request)(struct mddev *mddev, struct bio *bio);
 	int (*run)(struct mddev *mddev);
 	void (*free)(struct mddev *mddev, void *priv);
 	void (*status)(struct seq_file *seq, struct mddev *mddev);
@@ -649,7 +649,7 @@ extern void md_wakeup_thread(struct md_thread *thread);
 extern void md_check_recovery(struct mddev *mddev);
 extern void md_reap_sync_thread(struct mddev *mddev);
 extern int mddev_init_writes_pending(struct mddev *mddev);
-extern void md_write_start(struct mddev *mddev, struct bio *bi);
+extern bool md_write_start(struct mddev *mddev, struct bio *bi);
 extern void md_write_inc(struct mddev *mddev, struct bio *bi);
 extern void md_write_end(struct mddev *mddev);
 extern void md_done_sync(struct mddev *mddev, int blocks, int ok);
drivers/md/multipath.c +4 -4
index e95d521d93e9..c8d985ba008d 100644
@@ -106,7 +106,7 @@ static void multipath_end_request(struct bio *bio)
 	rdev_dec_pending(rdev, conf->mddev);
 }
 
-static void multipath_make_request(struct mddev *mddev, struct bio * bio)
+static bool multipath_make_request(struct mddev *mddev, struct bio * bio)
 {
 	struct mpconf *conf = mddev->private;
 	struct multipath_bh * mp_bh;
@@ -114,7 +114,7 @@ static void multipath_make_request(struct mddev *mddev, struct bio * bio)
 
 	if (unlikely(bio->bi_opf & REQ_PREFLUSH)) {
 		md_flush_request(mddev, bio);
-		return;
+		return true;
 	}
 
 	mp_bh = mempool_alloc(conf->pool, GFP_NOIO);
@@ -126,7 +126,7 @@ static void multipath_make_request(struct mddev *mddev, struct bio * bio)
 	if (mp_bh->path < 0) {
 		bio_io_error(bio);
 		mempool_free(mp_bh, conf->pool);
-		return;
+		return true;
 	}
 	multipath = conf->multipaths + mp_bh->path;
 
@@ -141,7 +141,7 @@ static void multipath_make_request(struct mddev *mddev, struct bio * bio)
 	mddev_check_writesame(mddev, &mp_bh->bio);
 	mddev_check_write_zeroes(mddev, &mp_bh->bio);
 	generic_make_request(&mp_bh->bio);
-	return;
+	return true;
 }
 
 static void multipath_status(struct seq_file *seq, struct mddev *mddev)
drivers/md/raid0.c +4 -3
index d6c0bc76e837..94d9ae9b0fd0 100644
@@ -548,7 +548,7 @@ static void raid0_handle_discard(struct mddev *mddev, struct bio *bio)
 	bio_endio(bio);
 }
 
-static void raid0_make_request(struct mddev *mddev, struct bio *bio)
+static bool raid0_make_request(struct mddev *mddev, struct bio *bio)
 {
 	struct strip_zone *zone;
 	struct md_rdev *tmp_dev;
@@ -559,12 +559,12 @@ static void raid0_make_request(struct mddev *mddev, struct bio *bio)
 
 	if (unlikely(bio->bi_opf & REQ_PREFLUSH)) {
 		md_flush_request(mddev, bio);
-		return;
+		return true;
 	}
 
 	if (unlikely((bio_op(bio) == REQ_OP_DISCARD))) {
 		raid0_handle_discard(mddev, bio);
-		return;
+		return true;
 	}
 
 	bio_sector = bio->bi_iter.bi_sector;
@@ -599,6 +599,7 @@ static void raid0_make_request(struct mddev *mddev, struct bio *bio)
 	mddev_check_writesame(mddev, bio);
 	mddev_check_write_zeroes(mddev, bio);
 	generic_make_request(bio);
+	return true;
 }
 
 static void raid0_status(struct seq_file *seq, struct mddev *mddev)
drivers/md/raid1.c +11 -5
index e1a7e3d4c5e4..7866563338fa 100644
@@ -1321,7 +1321,6 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio,
 	 * Continue immediately if no resync is active currently.
 	 */
 
-	md_write_start(mddev, bio); /* wait on superblock update early */
 
 	if ((bio_end_sector(bio) > mddev->suspend_lo &&
 	    bio->bi_iter.bi_sector < mddev->suspend_hi) ||
@@ -1335,7 +1334,7 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio,
 		 */
 		DEFINE_WAIT(w);
 		for (;;) {
-			flush_signals(current);
+			sigset_t full, old;
 			prepare_to_wait(&conf->wait_barrier,
 					&w, TASK_INTERRUPTIBLE);
 			if (bio_end_sector(bio) <= mddev->suspend_lo ||
@@ -1345,7 +1344,10 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio,
 				     bio->bi_iter.bi_sector,
 				     bio_end_sector(bio))))
 				break;
+			sigfillset(&full);
+			sigprocmask(SIG_BLOCK, &full, &old);
 			schedule();
+			sigprocmask(SIG_SETMASK, &old, NULL);
 		}
 		finish_wait(&conf->wait_barrier, &w);
 	}
@@ -1550,13 +1552,13 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio,
 	wake_up(&conf->wait_barrier);
 }
 
-static void raid1_make_request(struct mddev *mddev, struct bio *bio)
+static bool raid1_make_request(struct mddev *mddev, struct bio *bio)
 {
 	sector_t sectors;
 
 	if (unlikely(bio->bi_opf & REQ_PREFLUSH)) {
 		md_flush_request(mddev, bio);
-		return;
+		return true;
 	}
 
 	/*
@@ -1571,8 +1573,12 @@ static void raid1_make_request(struct mddev *mddev, struct bio *bio)
 
 	if (bio_data_dir(bio) == READ)
 		raid1_read_request(mddev, bio, sectors, NULL);
-	else
+	else {
+		if (!md_write_start(mddev,bio))
+			return false;
 		raid1_write_request(mddev, bio, sectors);
+	}
+	return true;
 }
 
 static void raid1_status(struct seq_file *seq, struct mddev *mddev)
drivers/md/raid10.c +6 -4
index 797ed60abd5e..52acffa7a06a 100644
@@ -1303,8 +1303,6 @@ static void raid10_write_request(struct mddev *mddev, struct bio *bio,
 	sector_t sectors;
 	int max_sectors;
 
-	md_write_start(mddev, bio);
-
 	/*
 	 * Register the new request and wait if the reconstruction
 	 * thread has put up a bar for new requests.
@@ -1525,7 +1523,7 @@ static void __make_request(struct mddev *mddev, struct bio *bio, int sectors)
 		raid10_write_request(mddev, bio, r10_bio);
 }
 
-static void raid10_make_request(struct mddev *mddev, struct bio *bio)
+static bool raid10_make_request(struct mddev *mddev, struct bio *bio)
 {
 	struct r10conf *conf = mddev->private;
 	sector_t chunk_mask = (conf->geo.chunk_mask & conf->prev.chunk_mask);
@@ -1534,9 +1532,12 @@ static void raid10_make_request(struct mddev *mddev, struct bio *bio)
 
 	if (unlikely(bio->bi_opf & REQ_PREFLUSH)) {
 		md_flush_request(mddev, bio);
-		return;
+		return true;
 	}
 
+	if (!md_write_start(mddev, bio))
+		return false;
+
 	/*
 	 * If this request crosses a chunk boundary, we need to split
 	 * it.
@@ -1553,6 +1554,7 @@ static void raid10_make_request(struct mddev *mddev, struct bio *bio)
 
 	/* In case raid10d snuck in to freeze_array */
 	wake_up(&conf->wait_barrier);
+	return true;
 }
 
 static void raid10_status(struct seq_file *seq, struct mddev *mddev)
drivers/md/raid5.c +14 -12
index ec0f951ae19f..d524daddc630 100644
@@ -5479,7 +5479,6 @@ static void make_discard_request(struct mddev *mddev, struct bio *bi)
 	last_sector = bi->bi_iter.bi_sector + (bi->bi_iter.bi_size>>9);
 
 	bi->bi_next = NULL;
-	md_write_start(mddev, bi);
 
 	stripe_sectors = conf->chunk_sectors *
 		(conf->raid_disks - conf->max_degraded);
@@ -5549,11 +5548,10 @@ static void make_discard_request(struct mddev *mddev, struct bio *bi)
 		release_stripe_plug(mddev, sh);
 	}
 
-	md_write_end(mddev);
 	bio_endio(bi);
 }
 
-static void raid5_make_request(struct mddev *mddev, struct bio * bi)
+static bool raid5_make_request(struct mddev *mddev, struct bio * bi)
 {
 	struct r5conf *conf = mddev->private;
 	int dd_idx;
@@ -5569,10 +5567,10 @@ static void raid5_make_request(struct mddev *mddev, struct bio * bi)
 		int ret = r5l_handle_flush_request(conf->log, bi);
 
 		if (ret == 0)
-			return;
+			return true;
 		if (ret == -ENODEV) {
 			md_flush_request(mddev, bi);
-			return;
+			return true;
 		}
 		/* ret == -EAGAIN, fallback */
 		/*
@@ -5582,6 +5580,8 @@ static void raid5_make_request(struct mddev *mddev, struct bio * bi)
 		do_flush = bi->bi_opf & REQ_PREFLUSH;
 	}
 
+	if (!md_write_start(mddev, bi))
+		return false;
 	/*
 	 * If array is degraded, better not do chunk aligned read because
 	 * later we might have to read it again in order to reconstruct
@@ -5591,18 +5591,18 @@ static void raid5_make_request(struct mddev *mddev, struct bio * bi)
 	    mddev->reshape_position == MaxSector) {
 		bi = chunk_aligned_read(mddev, bi);
 		if (!bi)
-			return;
+			return true;
 	}
 
 	if (unlikely(bio_op(bi) == REQ_OP_DISCARD)) {
 		make_discard_request(mddev, bi);
-		return;
+		md_write_end(mddev);
+		return true;
 	}
 
 	logical_sector = bi->bi_iter.bi_sector & ~((sector_t)STRIPE_SECTORS-1);
 	last_sector = bio_end_sector(bi);
 	bi->bi_next = NULL;
-	md_write_start(mddev, bi);
 
 	prepare_to_wait(&conf->wait_for_overlap, &w, TASK_UNINTERRUPTIBLE);
 	for (;logical_sector < last_sector; logical_sector += STRIPE_SECTORS) {
@@ -5693,12 +5693,15 @@ static void raid5_make_request(struct mddev *mddev, struct bio * bi)
 				 * userspace, we want an interruptible
 				 * wait.
 				 */
-				flush_signals(current);
 				prepare_to_wait(&conf->wait_for_overlap,
 						&w, TASK_INTERRUPTIBLE);
 				if (logical_sector >= mddev->suspend_lo &&
 				    logical_sector < mddev->suspend_hi) {
+					sigset_t full, old;
+					sigfillset(&full);
+					sigprocmask(SIG_BLOCK, &full, &old);
 					schedule();
+					sigprocmask(SIG_SETMASK, &old, NULL);
 					do_prepare = true;
 				}
 				goto retry;
@@ -5740,6 +5743,7 @@ static void raid5_make_request(struct mddev *mddev, struct bio * bi)
 	if (rw == WRITE)
 		md_write_end(mddev);
 	bio_endio(bi);
+	return true;
 }
 
 static sector_t raid5_size(struct mddev *mddev, sector_t sectors, int raid_disks);
@@ -7947,12 +7951,10 @@ static void end_reshape(struct r5conf *conf)
 {
 
 	if (!test_bit(MD_RECOVERY_INTR, &conf->mddev->recovery)) {
-		struct md_rdev *rdev;
 
 		spin_lock_irq(&conf->device_lock);
 		conf->previous_raid_disks = conf->raid_disks;
-		rdev_for_each(rdev, conf->mddev)
-			rdev->data_offset = rdev->new_data_offset;
+		md_finish_reshape(conf->mddev);
 		smp_wmb();
 		conf->reshape_progress = MaxSector;
 		conf->mddev->reshape_position = MaxSector;
drivers/media/pci/cx88/cx88-cards.c +8 -1
index 73cc7a67a8bc..6df21b29ea17 100644
@@ -3681,7 +3681,14 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr)
 	core->nr = nr;
 	sprintf(core->name, "cx88[%d]", core->nr);
 
-	core->tvnorm = V4L2_STD_NTSC_M;
+	/*
+	 * Note: Setting initial standard here would cause first call to
+	 * cx88_set_tvnorm() to return without programming any registers.  Leave
+	 * it blank for at this point and it will get set later in
+	 * cx8800_initdev()
+	 */
+	core->tvnorm  = 0;
+
 	core->width   = 320;
 	core->height  = 240;
 	core->field   = V4L2_FIELD_INTERLACED;
drivers/media/pci/cx88/cx88-video.c +1 -1
index c7d4e87ccb64..3c529dd4f333 100644
@@ -1435,7 +1435,7 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
 
 	/* initial device configuration */
 	mutex_lock(&core->lock);
-	cx88_set_tvnorm(core, core->tvnorm);
+	cx88_set_tvnorm(core, V4L2_STD_NTSC_M);
 	v4l2_ctrl_handler_setup(&core->video_hdl);
 	v4l2_ctrl_handler_setup(&core->audio_hdl);
 	cx88_video_mux(core, 0);
drivers/media/platform/s5p-jpeg/jpeg-core.c +4 -4
index 52dc7941db65..1da2c94e1dca 100644
@@ -1099,10 +1099,10 @@ static bool s5p_jpeg_parse_hdr(struct s5p_jpeg_q_data *result,
 			       struct s5p_jpeg_ctx *ctx)
 {
 	int c, components = 0, notfound, n_dht = 0, n_dqt = 0;
-	unsigned int height, width, word, subsampling = 0, sos = 0, sof = 0,
-		     sof_len = 0;
-	unsigned int dht[S5P_JPEG_MAX_MARKER], dht_len[S5P_JPEG_MAX_MARKER],
-		     dqt[S5P_JPEG_MAX_MARKER], dqt_len[S5P_JPEG_MAX_MARKER];
+	unsigned int height = 0, width = 0, word, subsampling = 0;
+	unsigned int sos = 0, sof = 0, sof_len = 0;
+	unsigned int dht[S5P_JPEG_MAX_MARKER], dht_len[S5P_JPEG_MAX_MARKER];
+	unsigned int dqt[S5P_JPEG_MAX_MARKER], dqt_len[S5P_JPEG_MAX_MARKER];
 	long length;
 	struct s5p_jpeg_buffer jpeg_buffer;
 
drivers/media/rc/imon.c +1 -1
index 3489010601b5..bd76534a2749 100644
@@ -1722,7 +1722,7 @@ static void imon_incoming_scancode(struct imon_context *ictx,
 	if (kc == KEY_KEYBOARD && !ictx->release_code) {
 		ictx->last_keycode = kc;
 		if (!nomouse) {
-			ictx->pad_mouse = ~(ictx->pad_mouse) & 0x1;
+			ictx->pad_mouse = !ictx->pad_mouse;
 			dev_dbg(dev, "toggling to %s mode\n",
 				ictx->pad_mouse ? "mouse" : "keyboard");
 			spin_unlock_irqrestore(&ictx->kc_lock, flags);
drivers/media/rc/rc-main.c +10 -10
index 6ec73357fa47..802e559cc30e 100644
@@ -1703,6 +1703,16 @@ static int rc_setup_rx_device(struct rc_dev *dev)
 	if (dev->close)
 		dev->input_dev->close = ir_close;
 
+	dev->input_dev->dev.parent = &dev->dev;
+	memcpy(&dev->input_dev->id, &dev->input_id, sizeof(dev->input_id));
+	dev->input_dev->phys = dev->input_phys;
+	dev->input_dev->name = dev->input_name;
+
+	/* rc_open will be called here */
+	rc = input_register_device(dev->input_dev);
+	if (rc)
+		goto out_table;
+
 	/*
 	 * Default delay of 250ms is too short for some protocols, especially
 	 * since the timeout is currently set to 250ms. Increase it to 500ms,
@@ -1718,16 +1728,6 @@ static int rc_setup_rx_device(struct rc_dev *dev)
 	 */
 	dev->input_dev->rep[REP_PERIOD] = 125;
 
-	dev->input_dev->dev.parent = &dev->dev;
-	memcpy(&dev->input_dev->id, &dev->input_id, sizeof(dev->input_id));
-	dev->input_dev->phys = dev->input_phys;
-	dev->input_dev->name = dev->input_name;
-
-	/* rc_open will be called here */
-	rc = input_register_device(dev->input_dev);
-	if (rc)
-		goto out_table;
-
 	return 0;
 
 out_table:
drivers/media/usb/dvb-usb-v2/mxl111sf-i2c.c +2 -2
index ffb49c28b15a..0eb33e043079 100644
@@ -316,7 +316,7 @@ static int mxl111sf_i2c_sw_xfer_msg(struct mxl111sf_state *state,
 static int mxl111sf_i2c_send_data(struct mxl111sf_state *state,
 				  u8 index, u8 *wdata)
 {
-	int ret = mxl111sf_ctrl_msg(state->d, wdata[0],
+	int ret = mxl111sf_ctrl_msg(state, wdata[0],
 				    &wdata[1], 25, NULL, 0);
 	mxl_fail(ret);
 
@@ -326,7 +326,7 @@ static int mxl111sf_i2c_send_data(struct mxl111sf_state *state,
 static int mxl111sf_i2c_get_data(struct mxl111sf_state *state,
 				 u8 index, u8 *wdata, u8 *rdata)
 {
-	int ret = mxl111sf_ctrl_msg(state->d, wdata[0],
+	int ret = mxl111sf_ctrl_msg(state, wdata[0],
 				    &wdata[1], 25, rdata, 24);
 	mxl_fail(ret);
 
drivers/media/usb/dvb-usb-v2/mxl111sf.c +19 -13
index abf69d8fa469..b0d5904a4ea6 100644
@@ -24,9 +24,6 @@
 #include "lgdt3305.h"
 #include "lg2160.h"
 
-/* Max transfer size done by I2C transfer functions */
-#define MAX_XFER_SIZE  64
-
 int dvb_usb_mxl111sf_debug;
 module_param_named(debug, dvb_usb_mxl111sf_debug, int, 0644);
 MODULE_PARM_DESC(debug, "set debugging level (1=info, 2=xfer, 4=i2c, 8=reg, 16=adv (or-able)).");
@@ -55,27 +52,34 @@ MODULE_PARM_DESC(rfswitch, "force rf switch position (0=auto, 1=ext, 2=int).");
 
 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
 
-int mxl111sf_ctrl_msg(struct dvb_usb_device *d,
+int mxl111sf_ctrl_msg(struct mxl111sf_state *state,
 		      u8 cmd, u8 *wbuf, int wlen, u8 *rbuf, int rlen)
 {
+	struct dvb_usb_device *d = state->d;
 	int wo = (rbuf == NULL || rlen == 0); /* write-only */
 	int ret;
-	u8 sndbuf[MAX_XFER_SIZE];
 
-	if (1 + wlen > sizeof(sndbuf)) {
+	if (1 + wlen > MXL_MAX_XFER_SIZE) {
 		pr_warn("%s: len=%d is too big!\n", __func__, wlen);
 		return -EOPNOTSUPP;
 	}
 
 	pr_debug("%s(wlen = %d, rlen = %d)\n", __func__, wlen, rlen);
 
-	memset(sndbuf, 0, 1+wlen);
+	mutex_lock(&state->msg_lock);
+	memset(state->sndbuf, 0, 1+wlen);
+	memset(state->rcvbuf, 0, rlen);
+
+	state->sndbuf[0] = cmd;
+	memcpy(&state->sndbuf[1], wbuf, wlen);
 
-	sndbuf[0] = cmd;
-	memcpy(&sndbuf[1], wbuf, wlen);
+	ret = (wo) ? dvb_usbv2_generic_write(d, state->sndbuf, 1+wlen) :
+		dvb_usbv2_generic_rw(d, state->sndbuf, 1+wlen, state->rcvbuf,
+				     rlen);
+
+	memcpy(rbuf, state->rcvbuf, rlen);
+	mutex_unlock(&state->msg_lock);
 
-	ret = (wo) ? dvb_usbv2_generic_write(d, sndbuf, 1+wlen) :
-		dvb_usbv2_generic_rw(d, sndbuf, 1+wlen, rbuf, rlen);
 	mxl_fail(ret);
 
 	return ret;
@@ -91,7 +95,7 @@ int mxl111sf_read_reg(struct mxl111sf_state *state, u8 addr, u8 *data)
 	u8 buf[2];
 	int ret;
 
-	ret = mxl111sf_ctrl_msg(state->d, MXL_CMD_REG_READ, &addr, 1, buf, 2);
+	ret = mxl111sf_ctrl_msg(state, MXL_CMD_REG_READ, &addr, 1, buf, 2);
 	if (mxl_fail(ret)) {
 		mxl_debug("error reading reg: 0x%02x", addr);
 		goto fail;
@@ -117,7 +121,7 @@ int mxl111sf_write_reg(struct mxl111sf_state *state, u8 addr, u8 data)
 
 	pr_debug("W: (0x%02x, 0x%02x)\n", addr, data);
 
-	ret = mxl111sf_ctrl_msg(state->d, MXL_CMD_REG_WRITE, buf, 2, NULL, 0);
+	ret = mxl111sf_ctrl_msg(state, MXL_CMD_REG_WRITE, buf, 2, NULL, 0);
 	if (mxl_fail(ret))
 		pr_err("error writing reg: 0x%02x, val: 0x%02x", addr, data);
 	return ret;
@@ -926,6 +930,8 @@ static int mxl111sf_init(struct dvb_usb_device *d)
 		  .len = sizeof(eeprom), .buf = eeprom },
 	};
 
+	mutex_init(&state->msg_lock);
+
 	ret = get_chip_info(state);
 	if (mxl_fail(ret))
 		pr_err("failed to get chip info during probe");
drivers/media/usb/dvb-usb-v2/mxl111sf.h +7 -1
index 846260e0eec0..3e6f5880bd1e 100644
@@ -19,6 +19,9 @@
 #include <media/tveeprom.h>
 #include <media/media-entity.h>
 
+/* Max transfer size done by I2C transfer functions */
+#define MXL_MAX_XFER_SIZE  64
+
 #define MXL_EP1_REG_READ     1
 #define MXL_EP2_REG_WRITE    2
 #define MXL_EP3_INTERRUPT    3
@@ -86,6 +89,9 @@ struct mxl111sf_state {
 	struct mutex fe_lock;
 	u8 num_frontends;
 	struct mxl111sf_adap_state adap_state[3];
+	u8 sndbuf[MXL_MAX_XFER_SIZE];
+	u8 rcvbuf[MXL_MAX_XFER_SIZE];
+	struct mutex msg_lock;
 #ifdef CONFIG_MEDIA_CONTROLLER_DVB
 	struct media_entity tuner;
 	struct media_pad tuner_pads[2];
@@ -108,7 +114,7 @@ int mxl111sf_ctrl_program_regs(struct mxl111sf_state *state,
 
 /* needed for hardware i2c functions in mxl111sf-i2c.c:
  * mxl111sf_i2c_send_data / mxl111sf_i2c_get_data */
-int mxl111sf_ctrl_msg(struct dvb_usb_device *d,
+int mxl111sf_ctrl_msg(struct mxl111sf_state *state,
 		      u8 cmd, u8 *wbuf, int wlen, u8 *rbuf, int rlen);
 
 #define mxl_printk(kern, fmt, arg...) \
drivers/misc/enclosure.c +10 -4
index d3fe3ea902d4..eb29113e0bac 100644
@@ -375,6 +375,7 @@ int enclosure_add_device(struct enclosure_device *edev, int component,
 			 struct device *dev)
 {
 	struct enclosure_component *cdev;
+	int err;
 
 	if (!edev || component >= edev->components)
 		return -EINVAL;
@@ -384,12 +385,17 @@ int enclosure_add_device(struct enclosure_device *edev, int component,
 	if (cdev->dev == dev)
 		return -EEXIST;
 
-	if (cdev->dev)
+	if (cdev->dev) {
 		enclosure_remove_links(cdev);
-
-	put_device(cdev->dev);
+		put_device(cdev->dev);
+	}
 	cdev->dev = get_device(dev);
-	return enclosure_add_links(cdev);
+	err = enclosure_add_links(cdev);
+	if (err) {
+		put_device(cdev->dev);
+		cdev->dev = NULL;
+	}
+	return err;
 }
 EXPORT_SYMBOL_GPL(enclosure_add_device);
 
drivers/mtd/nand/tango_nand.c +1 -1
index 49b286c6c10f..022e3d494741 100644
@@ -340,7 +340,7 @@ static void aux_write(struct nand_chip *chip, const u8 **buf, int len, int *pos)
 
 	if (!*buf) {
 		/* skip over "len" bytes */
-		chip->cmdfunc(mtd, NAND_CMD_SEQIN, *pos, -1);
+		chip->cmdfunc(mtd, NAND_CMD_RNDIN, *pos, -1);
 	} else {
 		tango_write_buf(mtd, *buf, len);
 		*buf += len;
drivers/net/ethernet/intel/igb/e1000_82575.c +1 -0
index ee443985581f..4a50870e0fa7 100644
@@ -257,6 +257,7 @@ static s32 igb_init_phy_params_82575(struct e1000_hw *hw)
 	}
 
 	/* Set phy->phy_addr and phy->id. */
+	igb_write_phy_reg_82580(hw, I347AT4_PAGE_SELECT, 0);
 	ret_val = igb_get_phy_id_82575(hw);
 	if (ret_val)
 		return ret_val;
drivers/net/wireless/ath/ath9k/ar9003_phy.c +0 -2
index ae3043559b6d..fe5102ca5010 100644
@@ -1821,8 +1821,6 @@ static void ar9003_hw_spectral_scan_wait(struct ath_hw *ah)
 static void ar9003_hw_tx99_start(struct ath_hw *ah, u32 qnum)
 {
 	REG_SET_BIT(ah, AR_PHY_TEST, PHY_AGC_CLR);
-	REG_SET_BIT(ah, 0x9864, 0x7f000);
-	REG_SET_BIT(ah, 0x9924, 0x7f00fe);
 	REG_CLR_BIT(ah, AR_DIAG_SW, AR_DIAG_RX_DIS);
 	REG_WRITE(ah, AR_CR, AR_CR_RXD);
 	REG_WRITE(ah, AR_DLCL_IFS(qnum), 0);
drivers/net/wireless/ath/ath9k/rng.c +3 -1
index 568b1c6c2b2b..73f46fb3e83a 100644
@@ -120,6 +120,8 @@ void ath9k_rng_start(struct ath_softc *sc)
 
 void ath9k_rng_stop(struct ath_softc *sc)
 {
-	if (sc->rng_task)
+	if (sc->rng_task) {
 		kthread_stop(sc->rng_task);
+		sc->rng_task = NULL;
+	}
 }
drivers/net/wireless/ath/ath9k/tx99.c +9 -4
index 16aca9e28b77..1fa7f844b5da 100644
@@ -189,22 +189,27 @@ static ssize_t write_file_tx99(struct file *file, const char __user *user_buf,
 	if (strtobool(buf, &start))
 		return -EINVAL;
 
+	mutex_lock(&sc->mutex);
+
 	if (start == sc->tx99_state) {
 		if (!start)
-			return count;
+			goto out;
 		ath_dbg(common, XMIT, "Resetting TX99\n");
 		ath9k_tx99_deinit(sc);
 	}
 
 	if (!start) {
 		ath9k_tx99_deinit(sc);
-		return count;
+		goto out;
 	}
 
 	r = ath9k_tx99_init(sc);
-	if (r)
+	if (r) {
+		mutex_unlock(&sc->mutex);
 		return r;
-
+	}
+out:
+	mutex_unlock(&sc->mutex);
 	return count;
 }
 
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +25 -7
index a67aa1f5a51c..db5ad222e5ea 100644
@@ -1974,14 +1974,32 @@ static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm,
 			WARN_ONCE(iwl_mvm_sf_update(mvm, vif, false),
 				  "Failed to update SF upon disassociation\n");
 
-			/* remove AP station now that the MAC is unassoc */
-			ret = iwl_mvm_rm_sta_id(mvm, vif, mvmvif->ap_sta_id);
-			if (ret)
-				IWL_ERR(mvm, "failed to remove AP station\n");
+			/*
+			 * If we get an assert during the connection (after the
+			 * station has been added, but before the vif is set
+			 * to associated), mac80211 will re-add the station and
+			 * then configure the vif. Since the vif is not
+			 * associated, we would remove the station here and
+			 * this would fail the recovery.
+			 */
+			if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART,
+				      &mvm->status)) {
+				/*
+				 * Remove AP station now that
+				 * the MAC is unassoc
+				 */
+				ret = iwl_mvm_rm_sta_id(mvm, vif,
+							mvmvif->ap_sta_id);
+				if (ret)
+					IWL_ERR(mvm,
+						"failed to remove AP station\n");
+
+				if (mvm->d0i3_ap_sta_id == mvmvif->ap_sta_id)
+					mvm->d0i3_ap_sta_id =
+						IWL_MVM_INVALID_STA;
+				mvmvif->ap_sta_id = IWL_MVM_INVALID_STA;
+			}
 
-			if (mvm->d0i3_ap_sta_id == mvmvif->ap_sta_id)
-				mvm->d0i3_ap_sta_id = IWL_MVM_INVALID_STA;
-			mvmvif->ap_sta_id = IWL_MVM_INVALID_STA;
 			/* remove quota for this interface */
 			ret = iwl_mvm_update_quotas(mvm, false, NULL);
 			if (ret)
drivers/net/wireless/marvell/mwifiex/cfg80211.c +35 -36

120 lines not on this page · raw message

drivers/net/wireless/ti/wlcore/spi.c +3 -3
index f949ad2bd898..fa3547e06424 100644
@@ -70,10 +70,10 @@
 #define WSPI_MAX_CHUNK_SIZE    4092
 
 /*
- * wl18xx driver aggregation buffer size is (13 * PAGE_SIZE) compared to
- * (4 * PAGE_SIZE) for wl12xx, so use the larger buffer needed for wl18xx
+ * wl18xx driver aggregation buffer size is (13 * 4K) compared to
+ * (4 * 4K) for wl12xx, so use the larger buffer needed for wl18xx
  */
-#define SPI_AGGR_BUFFER_SIZE (13 * PAGE_SIZE)
+#define SPI_AGGR_BUFFER_SIZE (13 * SZ_4K)
 
 /* Maximum number of SPI write chunks */
 #define WSPI_MAX_NUM_OF_CHUNKS \
drivers/nfc/nfcmrvl/fw_dnld.c +5 -2
index c38bdd6a5a82..a47af81e0fc3 100644
@@ -458,7 +458,7 @@ int	nfcmrvl_fw_dnld_init(struct nfcmrvl_private *priv)
 
 	INIT_WORK(&priv->fw_dnld.rx_work, fw_dnld_rx_work);
 	snprintf(name, sizeof(name), "%s_nfcmrvl_fw_dnld_rx_wq",
-		 dev_name(priv->dev));
+		 dev_name(&priv->ndev->nfc_dev->dev));
 	priv->fw_dnld.rx_wq = create_singlethread_workqueue(name);
 	if (!priv->fw_dnld.rx_wq)
 		return -ENOMEM;
@@ -495,6 +495,7 @@ int nfcmrvl_fw_dnld_start(struct nci_dev *ndev, const char *firmware_name)
 {
 	struct nfcmrvl_private *priv = nci_get_drvdata(ndev);
 	struct nfcmrvl_fw_dnld *fw_dnld = &priv->fw_dnld;
+	int res;
 
 	if (!priv->support_fw_dnld)
 		return -ENOTSUPP;
@@ -510,7 +511,9 @@ int nfcmrvl_fw_dnld_start(struct nci_dev *ndev, const char *firmware_name)
 	 */
 
 	/* Retrieve FW binary */
-	if (request_firmware(&fw_dnld->fw, firmware_name, priv->dev) < 0) {
+	res = request_firmware(&fw_dnld->fw, firmware_name,
+			       &ndev->nfc_dev->dev);
+	if (res < 0) {
 		nfc_err(priv->dev, "failed to retrieve FW %s", firmware_name);
 		return -ENOENT;
 	}
drivers/nfc/nfcmrvl/main.c +20 -15
index 51c8240a1672..a446590a71ca 100644
@@ -124,12 +124,13 @@ struct nfcmrvl_private *nfcmrvl_nci_register_dev(enum nfcmrvl_phy phy,
 	memcpy(&priv->config, pdata, sizeof(*pdata));
 
 	if (priv->config.reset_n_io) {
-		rc = devm_gpio_request_one(dev,
-					   priv->config.reset_n_io,
-					   GPIOF_OUT_INIT_LOW,
-					   "nfcmrvl_reset_n");
-		if (rc < 0)
+		rc = gpio_request_one(priv->config.reset_n_io,
+				      GPIOF_OUT_INIT_LOW,
+				      "nfcmrvl_reset_n");
+		if (rc < 0) {
+			priv->config.reset_n_io = 0;
 			nfc_err(dev, "failed to request reset_n io\n");
+		}
 	}
 
 	if (phy == NFCMRVL_PHY_SPI) {
@@ -154,7 +155,13 @@ struct nfcmrvl_private *nfcmrvl_nci_register_dev(enum nfcmrvl_phy phy,
 	if (!priv->ndev) {
 		nfc_err(dev, "nci_allocate_device failed\n");
 		rc = -ENOMEM;
-		goto error;
+		goto error_free_gpio;
+	}
+
+	rc = nfcmrvl_fw_dnld_init(priv);
+	if (rc) {
+		nfc_err(dev, "failed to initialize FW download %d\n", rc);
+		goto error_free_dev;
 	}
 
 	nci_set_drvdata(priv->ndev, priv);
@@ -162,24 +169,22 @@ struct nfcmrvl_private *nfcmrvl_nci_register_dev(enum nfcmrvl_phy phy,
 	rc = nci_register_device(priv->ndev);
 	if (rc) {
 		nfc_err(dev, "nci_register_device failed %d\n", rc);
-		goto error_free_dev;
+		goto error_fw_dnld_deinit;
 	}
 
 	/* Ensure that controller is powered off */
 	nfcmrvl_chip_halt(priv);
 
-	rc = nfcmrvl_fw_dnld_init(priv);
-	if (rc) {
-		nfc_err(dev, "failed to initialize FW download %d\n", rc);
-		goto error_free_dev;
-	}
-
 	nfc_info(dev, "registered with nci successfully\n");
 	return priv;
 
+error_fw_dnld_deinit:
+	nfcmrvl_fw_dnld_deinit(priv);
 error_free_dev:
 	nci_free_device(priv->ndev);
-error:
+error_free_gpio:
+	if (priv->config.reset_n_io)
+		gpio_free(priv->config.reset_n_io);
 	kfree(priv);
 	return ERR_PTR(rc);
 }
@@ -195,7 +200,7 @@ void nfcmrvl_nci_unregister_dev(struct nfcmrvl_private *priv)
 	nfcmrvl_fw_dnld_deinit(priv);
 
 	if (priv->config.reset_n_io)
-		devm_gpio_free(priv->dev, priv->config.reset_n_io);
+		gpio_free(priv->config.reset_n_io);
 
 	nci_unregister_device(ndev);
 	nci_free_device(ndev);
drivers/nfc/nfcmrvl/uart.c +4 -4
index 83a99e38e7bd..6c0c301611c4 100644
@@ -109,6 +109,7 @@ static int nfcmrvl_nci_uart_open(struct nci_uart *nu)
 	struct nfcmrvl_private *priv;
 	struct nfcmrvl_platform_data *pdata = NULL;
 	struct nfcmrvl_platform_data config;
+	struct device *dev = nu->tty->dev;
 
 	/*
 	 * Platform data cannot be used here since usually it is already used
@@ -116,9 +117,8 @@ static int nfcmrvl_nci_uart_open(struct nci_uart *nu)
 	 * and check if DT entries were added.
 	 */
 
-	if (nu->tty->dev->parent && nu->tty->dev->parent->of_node)
-		if (nfcmrvl_uart_parse_dt(nu->tty->dev->parent->of_node,
-					  &config) == 0)
+	if (dev && dev->parent && dev->parent->of_node)
+		if (nfcmrvl_uart_parse_dt(dev->parent->of_node, &config) == 0)
 			pdata = &config;
 
 	if (!pdata) {
@@ -131,7 +131,7 @@ static int nfcmrvl_nci_uart_open(struct nci_uart *nu)
 	}
 
 	priv = nfcmrvl_nci_register_dev(NFCMRVL_PHY_UART, nu, &uart_ops,
-					nu->tty->dev, pdata);
+					dev, pdata);
 	if (IS_ERR(priv))
 		return PTR_ERR(priv);
 
drivers/nvdimm/btt.c +6 -3
index 983718b8fd9b..3cd58143d468 100644
@@ -1248,10 +1248,13 @@ static int btt_rw_page(struct block_device *bdev, sector_t sector,
 		struct page *page, bool is_write)
 {
 	struct btt *btt = bdev->bd_disk->private_data;
+	int rc;
 
-	btt_do_bvec(btt, NULL, page, PAGE_SIZE, 0, is_write, sector);
-	page_endio(page, is_write, 0);
-	return 0;
+	rc = btt_do_bvec(btt, NULL, page, PAGE_SIZE, 0, is_write, sector);
+	if (rc == 0)
+		page_endio(page, is_write, 0);
+
+	return rc;
 }
 
 
drivers/nvdimm/claim.c +1 -2
index 7ceb5fa4f2a1..4baa4ce825ab 100644
@@ -260,8 +260,7 @@ static int nsio_rw_bytes(struct nd_namespace_common *ndns,
 		 * work around this collision.
 		 */
 		if (IS_ALIGNED(offset, 512) && IS_ALIGNED(size, 512)
-				&& !(flags & NVDIMM_IO_ATOMIC)
-				&& !ndns->claim) {
+				&& !(flags & NVDIMM_IO_ATOMIC)) {
 			long cleared;
 
 			cleared = nvdimm_clear_poison(&ndns->dev,
drivers/nvdimm/core.c +4 -3
index 2dee908e4bae..932c3994ac52 100644
@@ -421,14 +421,15 @@ static void set_badblock(struct badblocks *bb, sector_t s, int num)
 static void __add_badblock_range(struct badblocks *bb, u64 ns_offset, u64 len)
 {
 	const unsigned int sector_size = 512;
-	sector_t start_sector;
+	sector_t start_sector, end_sector;
 	u64 num_sectors;
 	u32 rem;
 
 	start_sector = div_u64(ns_offset, sector_size);
-	num_sectors = div_u64_rem(len, sector_size, &rem);
+	end_sector = div_u64_rem(ns_offset + len, sector_size, &rem);
 	if (rem)
-		num_sectors++;
+		end_sector++;
+	num_sectors = end_sector - start_sector;
 
 	if (unlikely(num_sectors > (u64)INT_MAX)) {
 		u64 remaining = num_sectors;
drivers/nvme/host/rdma.c +10 -10
index 24397d306d53..cab0cd8b7273 100644
@@ -88,7 +88,7 @@ enum nvme_rdma_queue_flags {
 
 struct nvme_rdma_queue {
 	struct nvme_rdma_qe	*rsp_ring;
-	u8			sig_count;
+	atomic_t		sig_count;
 	int			queue_size;
 	size_t			cmnd_capsule_len;
 	struct nvme_rdma_ctrl	*ctrl;
@@ -553,6 +553,7 @@ static int nvme_rdma_init_queue(struct nvme_rdma_ctrl *ctrl,
 		queue->cmnd_capsule_len = sizeof(struct nvme_command);
 
 	queue->queue_size = queue_size;
+	atomic_set(&queue->sig_count, 0);
 
 	queue->cm_id = rdma_create_id(&init_net, nvme_rdma_cm_handler, queue,
 			RDMA_PS_TCP, IB_QPT_RC);
@@ -1040,17 +1041,16 @@ static void nvme_rdma_send_done(struct ib_cq *cq, struct ib_wc *wc)
 		nvme_rdma_wr_error(cq, wc, "SEND");
 }
 
-static inline int nvme_rdma_queue_sig_limit(struct nvme_rdma_queue *queue)
+/*
+ * We want to signal completion at least every queue depth/2.  This returns the
+ * largest power of two that is not above half of (queue size + 1) to optimize
+ * (avoid divisions).
+ */
+static inline bool nvme_rdma_queue_sig_limit(struct nvme_rdma_queue *queue)
 {
-	int sig_limit;
+	int limit = 1 << ilog2((queue->queue_size + 1) / 2);
 
-	/*
-	 * We signal completion every queue depth/2 and also handle the
-	 * degenerated case of a  device with queue_depth=1, where we
-	 * would need to signal every message.
-	 */
-	sig_limit = max(queue->queue_size / 2, 1);
-	return (++queue->sig_count % sig_limit) == 0;
+	return (atomic_inc_return(&queue->sig_count) & (limit - 1)) == 0;
 }
 
 static int nvme_rdma_post_send(struct nvme_rdma_queue *queue,
drivers/pci/host/pcie-rockchip.c +9 -4
index 0e020b6e0943..4590eb95d5d8 100644
@@ -139,6 +139,7 @@
 		 PCIE_CORE_INT_CT | PCIE_CORE_INT_UTC | \
 		 PCIE_CORE_INT_MMVC)
 
+#define PCIE_RC_CONFIG_NORMAL_BASE	0x800000
 #define PCIE_RC_CONFIG_BASE		0xa00000
 #define PCIE_RC_CONFIG_RID_CCR		(PCIE_RC_CONFIG_BASE + 0x08)
 #define   PCIE_RC_CONFIG_SCC_SHIFT		16
@@ -295,7 +296,9 @@ static int rockchip_pcie_valid_device(struct rockchip_pcie *rockchip,
 static int rockchip_pcie_rd_own_conf(struct rockchip_pcie *rockchip,
 				     int where, int size, u32 *val)
 {
-	void __iomem *addr = rockchip->apb_base + PCIE_RC_CONFIG_BASE + where;
+	void __iomem *addr;
+
+	addr = rockchip->apb_base + PCIE_RC_CONFIG_NORMAL_BASE + where;
 
 	if (!IS_ALIGNED((uintptr_t)addr, size)) {
 		*val = 0;
@@ -319,11 +322,13 @@ static int rockchip_pcie_wr_own_conf(struct rockchip_pcie *rockchip,
 				     int where, int size, u32 val)
 {
 	u32 mask, tmp, offset;
+	void __iomem *addr;
 
 	offset = where & ~0x3;
+	addr = rockchip->apb_base + PCIE_RC_CONFIG_NORMAL_BASE + offset;
 
 	if (size == 4) {
-		writel(val, rockchip->apb_base + PCIE_RC_CONFIG_BASE + offset);
+		writel(val, addr);
 		return PCIBIOS_SUCCESSFUL;
 	}
 
@@ -334,9 +339,9 @@ static int rockchip_pcie_wr_own_conf(struct rockchip_pcie *rockchip,
 	 * corrupt RW1C bits in adjacent registers.  But the hardware
 	 * doesn't support smaller writes.
 	 */
-	tmp = readl(rockchip->apb_base + PCIE_RC_CONFIG_BASE + offset) & mask;
+	tmp = readl(addr) & mask;
 	tmp |= val << ((where & 0x3) * 8);
-	writel(tmp, rockchip->apb_base + PCIE_RC_CONFIG_BASE + offset);
+	writel(tmp, addr);
 
 	return PCIBIOS_SUCCESSFUL;
 }
drivers/pci/host/vmd.c +1 -1
index e27ad2a3bd33..642a182893ce 100644
@@ -733,10 +733,10 @@ static void vmd_remove(struct pci_dev *dev)
 	struct vmd_dev *vmd = pci_get_drvdata(dev);
 
 	vmd_detach_resources(vmd);
-	vmd_cleanup_srcu(vmd);
 	sysfs_remove_link(&vmd->dev->dev.kobj, "domain");
 	pci_stop_root_bus(vmd->bus);
 	pci_remove_root_bus(vmd->bus);
+	vmd_cleanup_srcu(vmd);
 	vmd_teardown_dma_ops(vmd);
 	irq_domain_remove(vmd->irq_domain);
 }
drivers/pci/msi.c +2 -12
index ba44fdfda66b..9e1569107cd6 100644
@@ -1058,7 +1058,7 @@ static int __pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec,
 
 	for (;;) {
 		if (affd) {
-			nvec = irq_calc_affinity_vectors(nvec, affd);
+			nvec = irq_calc_affinity_vectors(minvec, nvec, affd);
 			if (nvec < minvec)
 				return -ENOSPC;
 		}
@@ -1097,7 +1097,7 @@ static int __pci_enable_msix_range(struct pci_dev *dev,
 
 	for (;;) {
 		if (affd) {
-			nvec = irq_calc_affinity_vectors(nvec, affd);
+			nvec = irq_calc_affinity_vectors(minvec, nvec, affd);
 			if (nvec < minvec)
 				return -ENOSPC;
 		}
@@ -1165,16 +1165,6 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs,
 	if (flags & PCI_IRQ_AFFINITY) {
 		if (!affd)
 			affd = &msi_default_affd;
-
-		if (affd->pre_vectors + affd->post_vectors > min_vecs)
-			return -EINVAL;
-
-		/*
-		 * If there aren't any vectors left after applying the pre/post
-		 * vectors don't bother with assigning affinity.
-		 */
-		if (affd->pre_vectors + affd->post_vectors == min_vecs)
-			affd = NULL;
 	} else {
 		if (WARN_ON(affd))
 			affd = NULL;
drivers/pci/pci-driver.c +1 -0
index 192e7b681b96..b399fa31e0a2 100644
@@ -964,6 +964,7 @@ static int pci_pm_thaw_noirq(struct device *dev)
 		return pci_legacy_resume_early(dev);
 
 	pci_update_current_state(pci_dev, PCI_D0);
+	pci_restore_state(pci_dev);
 
 	if (drv && drv->pm && drv->pm->thaw_noirq)
 		error = drv->pm->thaw_noirq(dev);
drivers/scsi/qla2xxx/qla_init.c +5 -2
index 0391fc317003..f6130e8b1ca1 100644
@@ -2946,7 +2946,8 @@ qla24xx_update_fw_options(scsi_qla_host_t *vha)
 	}
 
 	/* Move PUREX, ABTS RX & RIDA to ATIOQ */
-	if (ql2xmvasynctoatio) {
+	if (ql2xmvasynctoatio &&
+	    (IS_QLA83XX(ha) || IS_QLA27XX(ha))) {
 		if (qla_tgt_mode_enabled(vha) ||
 		    qla_dual_mode_enabled(vha))
 			ha->fw_options[2] |= BIT_11;
@@ -2958,7 +2959,9 @@ qla24xx_update_fw_options(scsi_qla_host_t *vha)
 		"%s, add FW options 1-3 = 0x%04x 0x%04x 0x%04x mode %x\n",
 		__func__, ha->fw_options[1], ha->fw_options[2],
 		ha->fw_options[3], vha->host->active_mode);
-	qla2x00_set_fw_options(vha, ha->fw_options);
+
+	if (ha->fw_options[1] || ha->fw_options[2] || ha->fw_options[3])
+		qla2x00_set_fw_options(vha, ha->fw_options);
 
 	/* Update Serial Link options. */
 	if ((le16_to_cpu(ha->fw_seriallink_options24[0]) & BIT_0) == 0)
drivers/scsi/scsi_lib.c +29 -18

133 lines not on this page · raw message

drivers/scsi/scsi_scan.c +3 -2
index 6f7128f49c30..27a6d3c6cb7c 100644
@@ -384,11 +384,12 @@ static void scsi_target_reap_ref_release(struct kref *kref)
 		= container_of(kref, struct scsi_target, reap_ref);
 
 	/*
-	 * if we get here and the target is still in the CREATED state that
+	 * if we get here and the target is still in a CREATED state that
 	 * means it was allocated but never made visible (because a scan
 	 * turned up no LUNs), so don't call device_del() on it.
 	 */
-	if (starget->state != STARGET_CREATED) {
+	if ((starget->state != STARGET_CREATED) &&
+	    (starget->state != STARGET_CREATED_REMOVE)) {
 		transport_remove_device(&starget->dev);
 		device_del(&starget->dev);
 	}
drivers/scsi/scsi_sysfs.c +6 -2
index 82dfe07b1d47..3a6f557ec128 100644
@@ -1370,11 +1370,15 @@ void scsi_remove_target(struct device *dev)
 	spin_lock_irqsave(shost->host_lock, flags);
 	list_for_each_entry(starget, &shost->__targets, siblings) {
 		if (starget->state == STARGET_DEL ||
-		    starget->state == STARGET_REMOVE)
+		    starget->state == STARGET_REMOVE ||
+		    starget->state == STARGET_CREATED_REMOVE)
 			continue;
 		if (starget->dev.parent == dev || &starget->dev == dev) {
 			kref_get(&starget->reap_ref);
-			starget->state = STARGET_REMOVE;
+			if (starget->state == STARGET_CREATED)
+				starget->state = STARGET_CREATED_REMOVE;
+			else
+				starget->state = STARGET_REMOVE;
 			spin_unlock_irqrestore(shost->host_lock, flags);
 			__scsi_remove_target(starget);
 			scsi_target_reap(starget);
drivers/scsi/virtio_scsi.c +13 -0
index f8dbfeee6c63..b2d80d449244 100644
@@ -796,6 +796,16 @@ static int virtscsi_map_queues(struct Scsi_Host *shost)
 	return blk_mq_virtio_map_queues(&shost->tag_set, vscsi->vdev, 2);
 }
 
+/*
+ * The host guarantees to respond to each command, although I/O
+ * latencies might be higher than on bare metal.  Reset the timer
+ * unconditionally to give the host a chance to perform EH.
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

drivers/spi/spi-atmel.c +23 -1
index 1eb83c9613d5..78c885d80c96 100644

Lines of this file are not shown. View the raw message.

drivers/spmi/spmi.c +12 -0
index 2b9b0941d9eb..6d23226e5f69 100644

Lines of this file are not shown. View the raw message.

drivers/staging/comedi/drivers/ni_mio_common.c +1 -2
index b2e382888981..2f7bfc1c59e5 100644

Lines of this file are not shown. View the raw message.

drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c +15 -4
index 0db662d6abdd..4fb55e4d7483 100644

Lines of this file are not shown. View the raw message.

drivers/staging/rtl8188eu/os_dep/usb_intf.c +1 -0
index 963235fd7292..d283341cfe43 100644

Lines of this file are not shown. View the raw message.

drivers/staging/sm750fb/sm750.c +24 -0
index 386d4adcd91d..fa557e89f340 100644

Lines of this file are not shown. View the raw message.

drivers/target/iscsi/iscsi_target_configfs.c +2 -0
index 535a8e06a401..0dd4c45f7575 100644

Lines of this file are not shown. View the raw message.

drivers/target/iscsi/iscsi_target_nego.c +4 -2
index 6f88b31242b0..8b957b8072b9 100644

Lines of this file are not shown. View the raw message.

drivers/target/iscsi/iscsi_target_parameters.c +28 -13

41 lines not on this page · raw message

drivers/target/iscsi/iscsi_target_parameters.h +1 -1
index 9962ccf0ccd7..c47b73f57528 100644

Lines of this file are not shown. View the raw message.

drivers/target/iscsi/iscsi_target_tpg.c +19 -0
index 2e7e08dbda48..89813a162c34 100644

Lines of this file are not shown. View the raw message.

drivers/target/iscsi/iscsi_target_tpg.h +1 -0
index ceba29851167..59fd3cabe89d 100644

Lines of this file are not shown. View the raw message.

drivers/target/target_core_transport.c +9 -0
index f1b3a46bdcaf..019763561e52 100644

Lines of this file are not shown. View the raw message.

drivers/thermal/cpu_cooling.c +3 -1
index 69d0f430b2d1..be29489dd247 100644

Lines of this file are not shown. View the raw message.

drivers/thermal/max77620_thermal.c +8 -2
index e9a1fe342760..71d35f3c9215 100644

Lines of this file are not shown. View the raw message.

drivers/tty/serial/sh-sci.c +8 -4
index 71707e8e6e3f..9f1bc67e66ae 100644

Lines of this file are not shown. View the raw message.

drivers/tty/serial/st-asc.c +1 -0
index f5335be344f6..6b0ca65027d0 100644

Lines of this file are not shown. View the raw message.

drivers/usb/class/cdc-acm.c +3 -0
index 5357d83bbda2..5e056064259c 100644

Lines of this file are not shown. View the raw message.

drivers/usb/host/pci-quirks.c +54 -0

54 lines not on this page · raw message

drivers/usb/host/pci-quirks.h +2 -0
index 0222195bd5b0..655994480198 100644

Lines of this file are not shown. View the raw message.

drivers/usb/host/xhci-hub.c +5 -0
index 1adae9eab831..00ad677d8ec7 100644

Lines of this file are not shown. View the raw message.

drivers/usb/host/xhci-pci.c +6 -0
index 0965bae95a7b..1ef622ededfd 100644

Lines of this file are not shown. View the raw message.

drivers/usb/host/xhci-ring.c +7 -4
index 03f63f50afb6..bbb1536ce86b 100644

Lines of this file are not shown. View the raw message.

drivers/usb/host/xhci.c +9 -1
index 30f47d92a610..dd29dda6479b 100644

Lines of this file are not shown. View the raw message.

drivers/usb/host/xhci.h +1 -0
index dcd9649808c0..cca87fdbec2c 100644

Lines of this file are not shown. View the raw message.

drivers/usb/renesas_usbhs/common.c +3 -1
index 623c51300393..f0ce304c5aaf 100644

Lines of this file are not shown. View the raw message.

drivers/usb/renesas_usbhs/mod_gadget.c +24 -7
index 5bc7a6138855..93fba9033b00 100644

Lines of this file are not shown. View the raw message.

drivers/usb/storage/isd200.c +4 -1
index fba4005dd737..6a7720e66595 100644

Lines of this file are not shown. View the raw message.

drivers/vfio/vfio.c +45 -39

84 lines not on this page · raw message

drivers/xen/xen-scsiback.c +9 -24
index d6950e0802b7..980f32817305 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/acl.c +7 -6
index 247b8dfaf6e5..8d8370ddb6b2 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/disk-io.c +6 -6
index 5f678dcb20e6..db58d06c4e75 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/extent_io.c +3 -3
index d3619e010005..3ef90e91d8be 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/file.c +4 -1
index da1096eb1a40..5da85b080368 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/inode.c +4 -4
index ef3c98c527c1..a760b8d8e39c 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/send.c +4 -3
index fc496a6f842a..17557b952846 100644

Lines of this file are not shown. View the raw message.

fs/ceph/dir.c +5 -0
index e071d23f6148..ef7240ace576 100644

Lines of this file are not shown. View the raw message.

fs/cifs/cifsglob.h +2 -0
index bcc7d9acad64..fb482515a64b 100644

Lines of this file are not shown. View the raw message.

fs/cifs/cifssmb.c +7 -0
index fbb0d4cbda41..72a53bd19865 100644

Lines of this file are not shown. View the raw message.

fs/cifs/connect.c +7 -0
index 9365c0cf77ad..c59d77f64f74 100644

Lines of this file are not shown. View the raw message.

fs/cifs/smb2ops.c +23 -0
index 7e48561abd29..67f9b1445043 100644

Lines of this file are not shown. View the raw message.

fs/ext2/acl.c +22 -14
index 79dafa71effd..069c0dceda01 100644

Lines of this file are not shown. View the raw message.

fs/f2fs/acl.c +1 -1
index 8f487692c21f..8ac67d547826 100644

Lines of this file are not shown. View the raw message.

fs/f2fs/checkpoint.c +6 -5
index ea9c317b5916..06f7854d4e52 100644

Lines of this file are not shown. View the raw message.

fs/f2fs/f2fs.h +12 -6
index fd2e651bad6d..99271b76e05d 100644

Lines of this file are not shown. View the raw message.

fs/f2fs/file.c +1 -0
index 61af721329fa..666edc49e852 100644

Lines of this file are not shown. View the raw message.

fs/f2fs/gc.c +5 -4
index 026522107ca3..3af905ce6c27 100644

Lines of this file are not shown. View the raw message.

fs/f2fs/inode.c +1 -1
index 518f49643092..e53c784ab11e 100644

Lines of this file are not shown. View the raw message.

fs/f2fs/segment.c +26 -11
index 96845854e7ee..fca7577d31d1 100644

Lines of this file are not shown. View the raw message.

fs/f2fs/super.c +16 -0
index 83355ec4a92c..397b1e816b36 100644

Lines of this file are not shown. View the raw message.

fs/fs-writeback.c +4 -4
index 63ee2940775c..309364aab2a5 100644

Lines of this file are not shown. View the raw message.

fs/hfsplus/posix_acl.c +18 -12
index 9b92058a1240..6bb5d7c42888 100644

Lines of this file are not shown. View the raw message.

fs/nfs/dir.c +8 -4
index 2ac00bf4ecf1..5f0d08b2e1e5 100644

Lines of this file are not shown. View the raw message.

fs/nfs/filelayout/filelayout.c +2 -1
index 1cf85d65b748..3e486cd01caf 100644

Lines of this file are not shown. View the raw message.

fs/nfs/inode.c +2 -2
index 1de93ba78dc9..8c465d3c7e05 100644

Lines of this file are not shown. View the raw message.

fs/nfs/pagelist.c +1 -0
index ad92b401326c..7ddba5022948 100644

Lines of this file are not shown. View the raw message.

fs/overlayfs/dir.c +18 -4
index a63a71656e9b..bacb1809e941 100644

Lines of this file are not shown. View the raw message.

fs/overlayfs/super.c +1 -0
index 4882ffb37bae..04d0c7ed645e 100644

Lines of this file are not shown. View the raw message.

fs/pstore/platform.c +4 -1
index 9defe98ff8b1..4c5cd9368460 100644

Lines of this file are not shown. View the raw message.

fs/reiserfs/xattr_acl.c +7 -5
index 3d2256a425ee..d92a1dc6ee70 100644

Lines of this file are not shown. View the raw message.

fs/ubifs/dir.c +1 -0
index 566079d9b402..c67f6a3a606c 100644

Lines of this file are not shown. View the raw message.

fs/ubifs/journal.c +7 -5
index 294519b98874..df1aff716fab 100644

Lines of this file are not shown. View the raw message.

fs/ubifs/tnc.c +2 -0
index 709aa098dd46..96374a39ffba 100644

Lines of this file are not shown. View the raw message.

fs/ubifs/ubifs.h +1 -0
index 298b4d89eee9..f9db88c775c7 100644

Lines of this file are not shown. View the raw message.

fs/ubifs/xattr.c +22 -0
index 6c9e62c2ef55..98f11257d66c 100644

Lines of this file are not shown. View the raw message.

fs/udf/file.c +7 -2
index f5eb2d5b3bac..e06d2c15749a 100644

Lines of this file are not shown. View the raw message.

fs/udf/inode.c +2 -2
index 98c510e17203..18fdb9d90812 100644

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_acl.c +3 -3
index b468e041f207..7034e17535de 100644

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_acl.h +1 -0
index 286fa89217f5..04327318ef67 100644

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_iops.c +2 -2
index ebfc13350f9a..077e2b2ac773 100644

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_mount.c +2 -2
index 2eaf81859166..7147d4a8d207 100644

Lines of this file are not shown. View the raw message.

include/linux/backing-dev.h +3 -23
index 557d84063934..e9c967b86054 100644

Lines of this file are not shown. View the raw message.

include/linux/blk-cgroup.h +3 -3
index 01b62e7bac74..7104bea8dab1 100644

Lines of this file are not shown. View the raw message.

include/linux/init_task.h +3 -3
index e049526bc188..a2f6707e9fc0 100644

Lines of this file are not shown. View the raw message.

include/linux/interrupt.h +2 -2
index a6fba4804672..0991f973f8ca 100644

Lines of this file are not shown. View the raw message.

include/linux/mman.h +1 -1
index 634c4c51fe3a..c8367041fafd 100644

Lines of this file are not shown. View the raw message.

include/linux/percpu_counter.h +4 -3
index 84a109449610..ec065387f443 100644

Lines of this file are not shown. View the raw message.

include/linux/sched.h +19 -10
index 2b69fc650201..7f2a1eff2997 100644

Lines of this file are not shown. View the raw message.

include/linux/vfio.h +2 -0
index edf9b2cad277..9b34d0af5d27 100644

Lines of this file are not shown. View the raw message.

include/linux/vtime.h +1 -8
index 0681fe25abeb..18b405e3cd93 100644

Lines of this file are not shown. View the raw message.

include/net/inet_frag.h +2 -2
index 5894730ec82a..5932e6de8fc0 100644

Lines of this file are not shown. View the raw message.

include/scsi/scsi_cmnd.h +1 -0
index b379f93a2c48..16351de31243 100644

Lines of this file are not shown. View the raw message.

include/scsi/scsi_device.h +1 -0
index 05641aebd181..148e6511ee0c 100644

Lines of this file are not shown. View the raw message.

include/target/iscsi/iscsi_target_core.h +9 -0
index 5f17fb770477..1628cc34b357 100644

Lines of this file are not shown. View the raw message.

kernel/cpu.c +20 -18
index cb5103413bd8..cea4d7f1885a 100644

Lines of this file are not shown. View the raw message.

kernel/events/core.c +7 -21
index 6c4e523dc1e2..d7f726747341 100644

Lines of this file are not shown. View the raw message.

kernel/fork.c +8 -14
index e53770d2bf95..6440e0b70cad 100644

Lines of this file are not shown. View the raw message.

kernel/irq/affinity.c +12 -1
index e2d356dd7581..9b71406d2eec 100644

Lines of this file are not shown. View the raw message.

kernel/sched/cputime.c +97 -61

158 lines not on this page · raw message

kernel/sched/fair.c +20 -12
index bafa4e04b850..5f8c91bdac3c 100644

Lines of this file are not shown. View the raw message.

kernel/time/alarmtimer.c +1 -1
index ee2f4202d82a..11e70a38497c 100644

Lines of this file are not shown. View the raw message.

kernel/trace/ftrace.c +1 -1
index b308be30dfb9..28e980d2851b 100644

Lines of this file are not shown. View the raw message.

kernel/trace/trace.c +1 -0
index 091e801145c9..5764318357de 100644

Lines of this file are not shown. View the raw message.

lib/flex_proportions.c +3 -3
index a71cf1bdd4c9..2cc1f94e03a1 100644

Lines of this file are not shown. View the raw message.

lib/percpu_counter.c +9 -2
index 9c21000df0b5..3bf4a9984f4c 100644

Lines of this file are not shown. View the raw message.

mm/page-writeback.c +5 -5
index 143c1c25d680..b7451891959a 100644

Lines of this file are not shown. View the raw message.

net/bluetooth/smp.c +20 -19
index 14585edc9439..a0ef89772c36 100644

Lines of this file are not shown. View the raw message.

net/nfc/core.c +18 -13
index 122bb81da918..5cf33df888c3 100644

Lines of this file are not shown. View the raw message.

net/nfc/llcp_sock.c +5 -4
index 2ffb18e73df6..fb7afcaa3004 100644

Lines of this file are not shown. View the raw message.

net/nfc/nci/core.c +1 -2
index 61fff422424f..85a3d9ed4c29 100644

Lines of this file are not shown. View the raw message.

net/nfc/netlink.c +3 -1
index 6b0850e63e09..b251fb936a27 100644

Lines of this file are not shown. View the raw message.

net/sunrpc/auth_gss/gss_krb5_crypto.c +2 -1
index fb39284ec174..12649c9fedab 100644

Lines of this file are not shown. View the raw message.

net/sunrpc/xprtsock.c +2 -0
index d5b54c020dec..4f154d388748 100644

Lines of this file are not shown. View the raw message.

sound/soc/atmel/tse850-pcm5142.c +2 -2
index a72c7d642026..3a1393283156 100644

Lines of this file are not shown. View the raw message.

sound/soc/soc-compress.c +4 -2
index bfd71b873ca2..206f36bf43e8 100644

Lines of this file are not shown. View the raw message.

sound/soc/zte/zx-i2s.c +6 -4
index a865f37c2a56..580902fd9030 100644

Lines of this file are not shown. View the raw message.

tools/perf/ui/browser.c +1 -1
index a4d3762cd825..83874b0e266c 100644

Lines of this file are not shown. View the raw message.

tools/perf/util/intel-pt-decoder/intel-pt-decoder.c +60 -18

78 lines not on this page · raw message

tools/testing/nvdimm/test/nfit.c +1 -1
index c2187178fb13..548b6d4ee1be 100644

Lines of this file are not shown. View the raw message.

virt/kvm/vfio.c +19 -8
index 6e002d0f3191..d99850c462a1 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.