Skip to contentSkip to conversation

Linux 3.16.48

PATCH Ben Hutchings 1 participant 1 message Sep 15, 2017 Stable branch

lore
Share & tools
lore
#0 lore raw

I'm announcing the release of the 3.16.48 kernel.

All users of the 3.16 kernel series should upgrade.

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

The diff from 3.16.47 is attached to this message.

Ben.

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

 Makefile                                           |   2 +-
 arch/alpha/kernel/osf_sys.c                        |   6 +-
 arch/arm/kvm/init.S                                |   5 +-
 arch/arm/kvm/mmu.c                                 |  23 ++-
 arch/arm/mm/mmu.c                                  |   8 +-
 arch/arm64/include/asm/kvm_arm.h                   |   5 +
 arch/arm64/kvm/hyp-init.S                          |  11 +-
 arch/mips/include/asm/kprobes.h                    |   3 +-
 arch/mips/kernel/entry.S                           |   3 +
 arch/mips/kernel/pm-cps.c                          |   9 +-
 arch/mips/kernel/traps.c                           |   2 +
 arch/powerpc/include/asm/page.h                    |  12 ++
 arch/powerpc/include/asm/topology.h                |  14 ++
 arch/powerpc/kernel/kprobes.c                      |  11 ++
 arch/powerpc/kernel/setup_64.c                     |  32 +++-
 arch/powerpc/kvm/book3s_hv.c                       |  37 ++++
 arch/powerpc/platforms/cell/spufs/coredump.c       |   2 +
 arch/x86/Kconfig                                   |   2 +-
 arch/x86/kernel/i387.c                             |   1 +
 arch/x86/kernel/kvm.c                              |   2 +-
 arch/x86/kvm/cpuid.c                               |  20 +-
 arch/x86/kvm/mmu.c                                 |   7 +-
 arch/x86/kvm/mmu.h                                 |   1 +
 arch/x86/kvm/vmx.c                                 |   2 +-
 arch/x86/kvm/x86.c                                 |  38 ++--
 block/partition-generic.c                          |   4 +-
 crypto/gcm.c                                       |   6 +-
 drivers/ata/ahci.c                                 |  38 ++++
 drivers/char/mem.c                                 |   5 +
 drivers/cpufreq/cpufreq_conservative.c             |   4 +-
 drivers/dma/ep93xx_dma.c                           |   2 +
 drivers/gpu/drm/gma500/psb_intel_lvds.c            |  18 +-
 drivers/gpu/drm/radeon/ci_dpm.c                    |   6 +
 drivers/gpu/drm/radeon/cik.c                       |   2 +-
 drivers/gpu/drm/radeon/evergreen.c                 |   2 +-
 drivers/gpu/drm/radeon/r600.c                      |   2 +-
 drivers/gpu/drm/radeon/radeon_combios.c            |   7 +
 drivers/gpu/drm/radeon/radeon_device.c             |   4 +
 drivers/gpu/drm/radeon/si.c                        |   2 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c               |   2 +
 drivers/hid/hid-core.c                             |  20 +-
 drivers/hid/hid-ids.h                              |  71 ++++++-
 drivers/hid/hid-kye.c                              | 140 ++++++++++++++
 drivers/hid/hid-microsoft.c                        |  14 +-
 drivers/hid/hid-sjoy.c                             |   3 +
 drivers/hid/hid-uclogic.c                          |  27 +++
 drivers/hid/usbhid/hid-quirks.c                    |  63 +++++--
 drivers/i2c/busses/i2c-imx.c                       |   4 +-
 drivers/i2c/busses/i2c-ismt.c                      |   2 +-
 drivers/i2c/busses/i2c-tiny-usb.c                  |  25 ++-
 drivers/iio/proximity/as3935.c                     |  14 +-
 drivers/infiniband/ulp/ipoib/ipoib_vlan.c          |   7 +-
 drivers/input/mouse/elantech.c                     |  16 ++
 drivers/input/serio/i8042-x86ia64io.h              |   7 +
 drivers/md/dm-thin-metadata.c                      |   4 +-
 drivers/md/persistent-data/dm-space-map-disk.c     |  15 +-
 drivers/media/rc/ir-raw.c                          |  13 +-
 drivers/media/v4l2-core/videobuf2-core.c           |   2 +-
 drivers/net/can/usb/gs_usb.c                       |   2 +
 drivers/net/ethernet/8390/ax88796.c                |   7 +-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c    |   2 +-
 drivers/net/ethernet/ethoc.c                       |   3 +-
 drivers/net/ethernet/ibm/emac/core.c               |  26 ++-
 .../net/ethernet/qlogic/netxen/netxen_nic_ctx.c    |   2 +-
 drivers/net/ethernet/renesas/sh_eth.c              |   2 +-
 drivers/net/irda/irda-usb.c                        |   2 +-
 drivers/net/phy/dp83640.c                          |   2 +-
 drivers/net/phy/marvell.c                          |  68 ++++---
 .../net/wireless/brcm80211/brcmfmac/wl_cfg80211.c  |   5 +
 drivers/of/fdt.c                                   |   3 +
 drivers/pinctrl/pinctrl-mxs.c                      |  16 +-
 drivers/powercap/powercap_sys.c                    |   1 +
 drivers/s390/net/qeth_core.h                       |   4 +
 drivers/s390/net/qeth_core_main.c                  |  21 ++-
 drivers/s390/net/qeth_core_sys.c                   |  24 ++-
 drivers/s390/net/qeth_l2.h                         |   2 +
 drivers/s390/net/qeth_l2_main.c                    |  16 +-
 drivers/s390/net/qeth_l2_sys.c                     |   8 +
 drivers/s390/net/qeth_l3_main.c                    |   6 +-
 drivers/scsi/qla2xxx/qla_os.c                      |   8 +-
 drivers/staging/lustre/lustre/lov/lov_pack.c       |   9 -
 drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c     |  24 ++-
 drivers/staging/usbip/vhci_hcd.c                   |  11 +-
 drivers/target/iscsi/iscsi_target.c                |  31 ++-
 drivers/target/iscsi/iscsi_target_core.h           |   1 +
 drivers/target/iscsi/iscsi_target_erl0.c           |   6 +-
 drivers/target/iscsi/iscsi_target_erl0.h           |   2 +-
 drivers/target/iscsi/iscsi_target_login.c          |   4 +
 drivers/target/iscsi/iscsi_target_nego.c           | 208 ++++++++++++++-------
 drivers/target/target_core_internal.h              |   2 +-
 drivers/target/target_core_tmr.c                   |  16 +-
 drivers/target/target_core_transport.c             |   9 +-
 drivers/tty/serial/efm32-uart.c                    |  11 +-
 drivers/tty/serial/ifx6x60.c                       |   6 +-
 drivers/uio/uio.c                                  |  24 ++-
 drivers/usb/chipidea/debug.c                       |   3 +-
 drivers/usb/chipidea/udc.c                         |   8 +-
 drivers/usb/core/devio.c                           |   4 +-
 drivers/usb/core/hcd.c                             |   4 +-
 drivers/usb/core/hub.c                             |  27 ++-
 drivers/usb/core/urb.c                             |   2 +-
 drivers/usb/dwc3/gadget.c                          |   9 +
 drivers/usb/gadget/dummy_hcd.c                     |   6 +-
 drivers/usb/gadget/f_mass_storage.c                |  13 +-
 drivers/usb/host/r8a66597-hcd.c                    |   6 +-
 drivers/usb/host/xhci-mem.c                        |   2 +-
 drivers/usb/host/xhci-pci.c                        |  10 +-
 drivers/usb/host/xhci-plat.c                       |   2 +-
 drivers/usb/host/xhci-ring.c                       |  37 ++--
 drivers/usb/misc/iowarrior.c                       |   2 +-
 drivers/usb/musb/tusb6010_omap.c                   |  13 +-
 drivers/usb/serial/ftdi_sio.c                      |  10 +-
 drivers/usb/serial/ftdi_sio_ids.h                  |   2 +
 drivers/usb/serial/io_ti.c                         |   5 +-
 drivers/usb/serial/ir-usb.c                        |  21 ++-
 drivers/usb/serial/mct_u232.c                      |   2 +-
 drivers/usb/serial/option.c                        |   8 +
 drivers/usb/serial/qcserial.c                      |   2 +
 drivers/usb/storage/ene_ub6250.c                   |  90 +++++----
 drivers/uwb/i1480/dfu/usb.c                        |   5 +-
 drivers/watchdog/bcm_kona_wdt.c                    |   3 +-
 drivers/watchdog/pcwd_usb.c                        |   3 +
 drivers/xen/biomerge.c                             |   3 +-
 fs/autofs4/dev-ioctl.c                             |   2 +-
 fs/btrfs/extent-tree.c                             |   1 +
 fs/btrfs/extent_io.c                               |   2 +-
 fs/btrfs/inode.c                                   |   4 +-
 fs/cifs/smb1ops.c                                  |   9 +-
 fs/cifs/smb2ops.c                                  |   4 +-
 fs/cifs/smb2pdu.c                                  |  14 +-
 fs/configfs/symlink.c                              |   3 +-
 fs/ext4/extents.c                                  |   3 +
 fs/ext4/file.c                                     |  50 ++---
 fs/ext4/inode.c                                    |  25 ++-
 fs/ext4/mballoc.c                                  |  70 ++++---
 fs/proc/array.c                                    |   2 +-
 fs/proc/base.c                                     |  21 ++-
 fs/proc/namespaces.c                               |   4 +-
 fs/proc/task_mmu.c                                 |   4 +-
 fs/proc/task_nommu.c                               |   2 +-
 fs/stat.c                                          |   1 +
 fs/ufs/balloc.c                                    |  26 ++-
 fs/ufs/inode.c                                     |   5 +-
 fs/ufs/super.c                                     |  23 ++-
 fs/ufs/truncate.c                                  |   6 -
 fs/ufs/util.h                                      |  10 +-
 fs/xfs/xfs_file.c                                  |  31 +--
 include/linux/kprobes.h                            |   4 +-
 include/linux/ptrace.h                             |  24 ++-
 include/linux/srcu.h                               |   3 +-
 include/net/addrconf.h                             |   2 +
 include/net/ip6_route.h                            |   1 +
 include/net/ipv6.h                                 |   1 +
 include/net/xfrm.h                                 |  10 -
 include/uapi/linux/usb/ch11.h                      |   3 +
 kernel/events/core.c                               |   2 +-
 kernel/fork.c                                      |   8 +-
 kernel/futex.c                                     |   2 +-
 kernel/futex_compat.c                              |   2 +-
 kernel/irq/manage.c                                |   4 +-
 kernel/kcmp.c                                      |   4 +-
 kernel/kprobes.c                                   |   2 +-
 kernel/pid_namespace.c                             |   2 +-
 kernel/ptrace.c                                    |  39 +++-
 kernel/rcu/srcu.c                                  |  12 +-
 kernel/signal.c                                    |  20 +-
 kernel/time/alarmtimer.c                           |  14 +-
 kernel/trace/trace_kprobe.c                        |  18 +-
 lib/cmdline.c                                      |   6 +-
 mm/huge_memory.c                                   |   9 +-
 mm/memory-failure.c                                |  13 +-
 mm/migrate.c                                       |  11 +-
 mm/mlock.c                                         |   5 +-
 mm/page_cgroup.c                                   |   3 +
 mm/process_vm_access.c                             |   2 +-
 mm/slub.c                                          |   6 +-
 net/batman-adv/distributed-arp-table.c             |   5 +-
 net/ceph/osdmap.c                                  |   1 +
 net/core/dev.c                                     |  12 +-
 net/core/rtnetlink.c                               |   2 +
 net/core/sock.c                                    |  15 +-
 net/ipv4/af_inet.c                                 |   2 +-
 net/ipv4/ip_output.c                               |   2 +-
 net/ipv4/tcp.c                                     |  13 +-
 net/ipv4/tcp_input.c                               |  11 +-
 net/ipv6/addrconf.c                                |   8 +-
 net/ipv6/fib6_rules.c                              |   3 +-
 net/ipv6/ip6_offload.c                             |   4 +-
 net/ipv6/ip6_output.c                              |  17 +-
 net/ipv6/ping.c                                    |   2 +-
 net/ipv6/raw.c                                     |   2 +-
 net/ipv6/route.c                                   |  43 +++--
 net/ipv6/xfrm6_mode_ro.c                           |   2 +
 net/ipv6/xfrm6_mode_transport.c                    |   2 +
 net/key/af_key.c                                   |  19 +-
 net/l2tp/l2tp_eth.c                                |  13 +-
 net/mac80211/rx.c                                  |   9 +-
 net/mac80211/wpa.c                                 |   5 +-
 net/netfilter/nf_conntrack_netlink.c               |   7 +-
 net/wireless/util.c                                |  14 +-
 net/xfrm/xfrm_policy.c                             |  53 +-----
 scripts/tags.sh                                    |   1 +
 security/commoncap.c                               |   7 +-
 security/keys/keyctl.c                             |   4 +-
 security/selinux/hooks.c                           |   5 +-
 sound/pci/hda/hda_generic.c                        |   1 +
 sound/pci/hda/patch_sigmatel.c                     |   2 +
 sound/soc/soc-core.c                               |   5 +-
 tools/perf/Documentation/perf-probe.txt            |   8 +-
 tools/perf/Documentation/perf-script-perl.txt      |   2 +-
 tools/perf/Documentation/perf-script-python.txt    |  23 +--
 .../util/scripting-engines/trace-event-python.c    |   2 +-
 .../testing/selftests/powerpc/tm/tm-resched-dscr.c |   2 +-
 213 files changed, 1797 insertions(+), 790 deletions(-)

Adrien Vergé (1):
USB: quirks: Apply ALWAYS_POLL to all ELAN devices

Al Viro (5):
osf_wait4(): fix infoleak
fix ufs_isblockset()
ufs: restore maintaining ->i_blocks
ufs: set correct ->s_maxsize
excessive checks in ufs_write_failed() and ufs_evict_inode()

Alan Stern (2):
USB: ene_usb6250: fix DMA to the stack
USB: xhci: fix lock-inversion problem

Alex Deucher (3):
drm/radeon/ci: disable mclk switching for high refresh rates (v2) drm/radeon: add a PX quirk for another K53TK variant drm/radeon: add a quirk for Toshiba Satellite L20-183

Alex Wood (1):
HID: usbhid: Add quirk for the Futaba TOSD-5711BB VFD

Alexander Sverdlin (1):
dmaengine: ep93xx: Always start from BASE0

Alexander Tsoy (1):
ALSA: hda - apply STAC_9200_DELL_M22 quirk for Dell Latitude D430

Andrew Lunn (1):
net: phy: marvell: Limit errata to 88m1101

Andrey Korolyov (1):
USB: serial: ftdi_sio: add Olimex ARM-USB-TINY(H) PIDs

Anthony Mallet (1):
USB: serial: ftdi_sio: fix setting latency for unprivileged users

Arend van Spriel (1):
brcmfmac: fix possible buffer overflow in brcmf_cfg80211_mgmt_tx()

Bart Van Assche (1):
target/iscsi: Fix indentation in iscsi_target_start_negotiation()

Ben Hutchings (2):
ipv6: xfrm: Handle errors reported by xfrm6_find_1stfragopt() Linux 3.16.48

Benjamin Peterson (1):
x86/watchdog: Fix Kconfig help text file path reference to lockup watchdog documentation

Benjamin Tissoires (3):
HID: uclogic: Set quirks from inside the driver
HID: quirks: add QUIRK_NOGET for an other TPV touchscreen
HID: add HID_QUIRK_NOGET to Quanta 3003 too

Bjørn Mork (1):
USB: serial: qcserial: add more Lenovo EM74xx device IDs

Chris Brandt (2):
usb: r8a66597-hcd: decrease timeout
usb: r8a66597-hcd: select a different endpoint on timeout

Christian Lamparter (1):
net: emac: fix reset timeout with AR8035 phy

Christophe JAILLET (3):
SMB2: Fix share type handling
serial: efm32: Fix parity management in 'efm32_uart_console_get_options()'
vb2: Fix an off by one error in 'vb2_plane_vaddr'

Colin Ian King (3):
netxen_nic: set rcode to the return status from the call to netxen_issue_cmd
btrfs: fix incorrect error return ret being passed to mapping_set_error
HID: usbhid: Quirk a AMI virtual mouse and keyboard with ALWAYS_POLL

Corentin Labbe (1):
usb: xhci: ASMedia ASM1042A chipset need shorts TX quirk

Dan Carpenter (7):
PowerCap: Fix an error code in powercap_register_zone()
uio: add missing error codes
block: fix an error code in add_partition()
libceph: NULL deref on crush_decode() error path drm/vmwgfx: Handle vmalloc() failure in vmw_local_fifo_reserve()
xfrm: Oops on error in pfkey_msg2xfrm_state()
xfrm: NULL dereference on allocation failure

Daniel Bristot de Oliveira (1):
HID: usbhid: enable NO_INIT_REPORTS quirk for Semico USB Keykoard2

Daniel Drake (1):
Input: i8042 - add Fujitsu Lifebook AH544 to notimeout list

Daniel Keller (1):
HID: microsoft: Add Surface 4 type cover pro 4 not JP versions

Daniele Palmas (1):
usb: serial: option: add Telit ME910 support

David S. Miller (1):
ipv6: Fix leak in ipv6_gso_segment().

David Sterba (1):
btrfs: use correct types for page indices in btrfs_page_exists_in_range

Dominik Heidler (1):
l2tp: cast l2tp traffic counter to unsigned

Donavan Lance (1):
HID: Add new Microsoft Type Cover 3 product ID

Doug Berger (1):
ARM: 8685/1: ensure memblock-limit is pmd-aligned

Emmanuel Grumbach (1):
mac80211: don't look at the PM bit of BAR frames

Eric Anholt (1):
watchdog: bcm281xx: Fix use of uninitialized spinlock.

Eric Biggers (1):
KEYS: fix dereferencing NULL payload with nonzero length

Eric Dumazet (4):
netem: fix skb_orphan_partial()
net: fix compile error in skb_orphan_partial()
net: ping: do not abuse udp_poll()
net: prevent sign extension in dev_get_stats()

Eric W. Biederman (2):
pid_ns: Sleep in TASK_INTERRUPTIBLE in zap_pid_ns_processes
signal: Only reschedule timers on signals timers have sent

Eryu Guan (1):
xfs: fix off-by-one on max nr_pages in xfs_find_get_desired_pgoff()

Felipe Balbi (1):
usb: host: xhci: simplify irq handler return

Feras Daoud (1):
IB/ipoib: Fix memory leak in create child syscall

Geert Uytterhoeven (2):
serial: ifx6x60: Remove dangerous spi_driver casts
sh_eth: Use platform device for printing before register_netdev()

Gilad Ben-Yossef (1):
crypto: gcm - wait for crypto op not signal safe

Heiner Kallweit (1):
genirq: Release resources in __setup_irq() error path

Hui Wang (1):
ALSA: hda - set input_path bitmap to zero after moving it to new place

Ilya Matveychikov (1):
lib/cmdline.c: fix get_options() overflow while parsing ranges

James Hogan (1):
MIPS: Avoid accidental raw backtrace

James Morse (1):
mm/memory-failure.c: use compound_head() flags for huge pages

Jan Kara (4):
ext4: fix SEEK_HOLE
xfs: Fix missed holes in SEEK_HOLE implementation
ext4: fix data corruption for mmap writes
ext4: fix fdatasync(2) after extent manipulation operations

Jann Horn (1):
ptrace: use fsuid, fsgid, effective creds for fs access checks

Jason A. Donenfeld (1):
mac80211/wpa: use constant time memory comparison for MACs

Jeff Mahoney (1):
btrfs: fix memory leak in update_space_info failure path

Jiang Yi (1):
iscsi-target: Always wait for kthread_should_stop() before kthread exit

Jimmy Berry (1):
HID: usbhid: add Logitech G710+ keyboard quirk NOGET

Jisheng Zhang (1):
usb: chipidea: udc: fix NULL pointer dereference if udc_start failed

Joe Thornber (2):
dm thin metadata: call precommit before saving the roots dm space map disk: fix some book keeping in the disk space map

Johan Hovold (14):
net: irda: irda-usb: fix firmware name on big-endian hosts
USB: serial: ir-usb: fix big-endian baud-rate debug printk
USB: serial: mct_u232: fix big-endian baud-rate handling
USB: serial: io_ti: fix div-by-zero in set_termios
uwb: fix device quirk on big-endian hosts
USB: iowarrior: fix info ioctl on big-endian hosts
USB: gadget: dummy_hcd: fix hub-descriptor removable fields
USB: usbip: fix nonconforming hub descriptor
USB: hub: fix SS hub-descriptor handling
USB: hub: fix non-SS hub-descriptor handling
USB: hub: fix SS max number of ports
of: fdt: add missing allocation-failure check
serial: ifx6x60: fix use-after-free on module unload
watchdog: pcwd_usb: fix NULL-deref at probe

Johannes Thumshirn (1):
scsi: qla2xxx: don't disable a not previously enabled PCI device

Julian Wiedmann (1):
s390/qeth: unbreak OSM and OSN support

Julius Werner (2):
drivers: char: mem: Check for address space wraparound with mmap()
drivers: char: mem: Fix wraparound check to allow mappings up to the end

Kirill Tkhai (1):
pid_ns: Fix race between setns'ed fork() and zap_pid_ns_processes()

Konstantin Khlebnikov (3):
ext4: keep existing extra fields when inode expands
ext4: use __GFP_NOFAIL in ext4_free_blocks()
ext4: handle the rest of ext4_mb_load_buddy() ENOMEM errors

Linus Torvalds (1):
Sanitize 'move_pages()' permission checks

Liping Zhang (1):
netfilter: ctnetlink: fix incorrect nf_ct_put during hash resize

Liwei Song (1):
i2c: ismt: fix wrong device address when unmap the data buffer

Lyude (1):
drm/radeon: Unbreak HPD handling for r600+

Malcolm Priestley (3):
staging: rtl8192e: rtl92e_fill_tx_desc fix write to mapped out memory.
staging: rtl8192e: fix 2 byte alignment of register BSSIDR.
staging: rtl8192e: rtl92e_get_eeprom_size Fix read size of EPROM_CMD.

Marc Kleine-Budde (1):
can: gs_usb: fix memory leak in gs_cmd_reset()

Marc Zyngier (3):
arm64: KVM: Preserve RES1 bits in SCTLR_EL2
arm64: KVM: Allow unaligned accesses at EL2
arm: KVM: Allow unaligned accesses at HYP

Marcel Hasler (2):
HID: usbhid: Add quirks for Mayflash/Dragonrise GameCube and PS3 adapters
HID: usbhid: Add quirk for Mayflash/Dragonrise DolphinBar.

Marcin Nowakowski (1):
MIPS: kprobes: flush_insn_slot should flush only if probe initialised

Marian Krivoš (1):
HID: support for keyboard - Corsair STRAFE

Mark Rutland (1):
mm: numa: avoid waiting on freed migrated pages

Mathias Nyman (1):
xhci: apply PME_STUCK_QUIRK and MISSING_CAS quirk for Denverton

Matt Ranostay (3):
iio: proximity: as3935: recalibrate RCO after resume
iio: proximity: as3935: fix AS3935_INT mask
iio: proximity: as3935: fix iio_trigger_poll issue

Max Filippov (1):
net: ethoc: enable NAPI before poll may be scheduled

Michael Ellerman (4):
powerpc/mm: Fix virt_addr_valid() etc. on 64-bit hash selftests/powerpc: Fix TM resched DSCR test with some compilers powerpc/spufs: Fix coredump of SPU contexts powerpc/numa: Fix percpu allocations to be NUMA aware

Michael Thalmeier (1):
usb: chipidea: debug: check before accessing ci_role

Michail Georgios Etairidis (1):
i2c: imx: Use correct function to write to register

Michal Kubeček (2):
net: account for current skb length when deciding about UFO
net: handle NAPI_GRO_FREE_STOLEN_HEAD case also in napi_frags_finish()

Milan Plzik (1):
HID: kye: Fix report descriptor for Genius PenSketch M912

Mintz, Yuval (1):
bnx2x: Fix Multi-Cos

Naveen N. Rao (1):
powerpc/kprobes: Pause function_graph tracing during jprobes handling

Nazar Mokrynskyi (1):
HID: Fix boot delay for Creative SB Omni Surround 5.1 with quirk

NeilBrown (1):
autofs: sanity check status reported with AUTOFS_DEV_IOCTL_FAIL

Nicholas Bellinger (4):
iscsi-target: Fix early sk_data_ready LOGIN_FLAGS_READY race
iscsi-target: Fix initial login PDU asynchronous socket close OOPs
target: Fix kref->refcount underflow in transport_cmd_finish_abort
configfs: Fix race between create_link and configfs_rmdir

Nicholas Piggin (1):
powerpc/64: Initialise thread_info for emergency stacks

Oleg Drokin (1):
staging/lustre/lov: remove set_fs() call from lov_getstripe()

Oliver Neukum (2):
HID: usbhid: more mice with ALWAYS_POLL
HID: usbhid: yet another mouse with ALWAYS_POLL

Oliver Schmitt (1):
HID: usbhid: Fix for the WiiU adapter from Mayflash

Oscar Campos (1):
HID: corsair: support for K65-K70 Rapidfire and Scimitar Pro RGB

Paolo Bonzini (2):
kvm: async_pf: fix rcu_irq_enter() with irqs enabled
srcu: Allow use of Classic SRCU from both process and interrupt context

Patrik Jakobsson (1):
drm/gma500/psb: Actually use VBT mode when it is found

Paul Burton (2):
MIPS: pm-cps: Drop manual cache-line alignment of ready_count
MIPS: Fix IRQ tracing & lockdep when rescheduling

Paul E. McKenney (1):
rcu: Move preemption disabling out of __srcu_read_lock()

Paul Mackerras (2):
KVM: PPC: Book3S HV: Context-switch EBB registers properly
KVM: PPC: Book3S HV: Preserve userspace HTM state properly

Paul Moore (1):
selinux: fix double free in selinux_parse_opts_str()

Pavel Shilovsky (1):
CIFS: Improve readdir verbosity

Peter Chen (1):
usb: host: xhci-mem: allocate zeroed Scratchpad Buffer

Peter Ujfalusi (1):
usb: musb: tusb6010_omap: Do not reset the other direction's packet size

Punit Agrawal (1):
mm/migrate: fix refcount handling when !hugepage_migration_supported()

Radim Krčmář (1):
KVM: x86: zero base3 of unusable segments

Raimund Roth (1):
HID: microsoft: Add Surface Power Cover

Rajkumar Manoharan (1):
mac80211: strictly check mesh address extension mode

Raphael Assenat (1):
HID: usbhid: Add a quirk for raphnet multi-gamepad adapters

Reyad Attiyat (1):
HID: microsoft: Add quirk for MS Surface Type/Touch cover

Richard Cochran (1):
net: dp83640: Avoid NULL pointer dereference.

Richard Narron (1):
fs/ufs: Set UFS default maximum bytes per file

Robert Jarzmik (1):
tags: honor COMPILED_SOURCE with apart output directory

Roger Pau Monne (1):
xen: fix bio vec merging

Russell King (1):
net: phy: fix marvell phy status reading

Sabrina Dubroca (2):
xfrm: fix stack access out of bounds with CONFIG_XFRM_SUB_POLICY tracing/kprobes: Allow to create probe with a module name starting with a digit

Sean Young (2):
rc-core: race condition during ir_raw_event_register()
HID: sjoy: support Super Joy Box 4

Sebastian Parschauer (1):
HID: Add quirk for Dell PIXART OEM mouse

Sebastian Reichel (1):
i2c: i2c-tiny-usb: fix buffer not being DMA capable

SeongJae Park (6):
perf probe: Fix examples section of documentation perf script: Fix outdated comment for perf-trace-python perf script: Fix documentation errors
perf script python: Fix wrong code snippets in documentation perf script python: Updated trace_unhandled() signature perf script python: Remove dups in documentation examples

Serhey Popovych (2):
ipv6: Do not leak throw route references
rtnetlink: add IFLA_GROUP to ifla_policy

Soheil Hassas Yeganeh (1):
tcp: eliminate negative reordering in tcp_clean_rtx_queue

Stafford Horne (1):
HID: quirks: Add no_init_reports for AKAI midi controller

Steffen Klassert (1):
af_key: Fix slab-out-of-bounds in pfkey_compile_policy.

Steinar H. Gunderson (1):
HID: add quirk for Akai MIDImix.

Stephen Just (1):
HID: microsoft: Add Surface 3 type cover

Sui Chen (1):
ahci: Acer SA5-271 SSD Not Detected Fix

Suman Anna (1):
uio: fix incorrect memory leak cleanup

Suzuki K Poulose (3):
kvm: arm/arm64: Fix race in resetting stage2 PGD
kvm: arm/arm64: Force reading uncached stage2 PGD
kvm: arm/arm64: Fix use after free of stage2 page table

Sven Eckelmann (1):
batman-adv: Fix rx packet/bytes stats on local ARP reply

Takashi Iwai (1):
ASoC: Fix use-after-free at card unregistration

Thinh Nguyen (2):
usb: dwc3: gadget: Prevent losing events in event cache
usb: gadget: f_mass_storage: Serialize wake and sleep execution

Thomas Gleixner (4):
tracing/kprobes: Enforce kprobes teardown after testing slub/memcg: cure the brainless abuse of sysfs attributes
alarmtimer: Prevent overflow of relative timers
alarmtimer: Rate limit periodic intervals

Thomas Petazzoni (1):
usb: host: xhci-plat: propagate return value of platform_get_irq()

Tomasz Wilczyński (1):
cpufreq: conservative: Allow down_threshold to take values from 1 to 10

Trent Lloyd (1):
HID: usbhid: quirks for Corsair RGB keyboard & mice (K70R, K95RGB, M65RGB, K70RGB, K65RGB)

Ulrik De Bie (1):
Input: elantech - add Fujitsu Lifebook E546/E557 to force crc_enabled

Ursula Braun (1):
s390/qeth: handle sysfs error during initialization

Uwe Kleine-König (2):
pinctrl: mxs: atomically switch mux and drive strength config
net: ethernet: ax88796: don't call free_irq without request_irq first

Vamsi Krishna Samavedam (1):
USB: core: replace %p with %pK

Vasilis Liaskovitis (1):
HID: usbhid: Add HID_QUIRK_NOGET for Aten CS-1758 KVM switch

Vladis Dronov (1):
xfrm: policy: check policy direction value

WANG Cong (5):
ipv6: initialize route null entry in addrconf_init()
ipv6: reorder ip6_route_dev_notifier after ipv6_dev_notf
ipv6: only call ip6_route_dev_notify() once for NETDEV_UNREGISTER
ipv6: avoid unregistering inet6_dev for loopback
tcp: reset sk_rx_dst in tcp_disconnect()

Wangzhao Cai (1):

      HID: add quirk for 0x04d9:0xa096 device

Wanpeng Li (5):
KVM: x86: Fix load damaged SSEx MXCSR register
KVM: X86: Fix read out-of-bounds vulnerability in kvm pio emulation
KVM: nVMX: Fix exception injection
KVM: cpuid: Fix read/write out-of-bounds vulnerability in cpuid emulation
KVM: async_pf: avoid async pf injection when in guest mode

Wei Wang (2):
tcp: avoid fastopen API to be used on AF_UNSPEC
tcp: initialize rcv_mss to TCP_MIN_MSS instead of 0

Yisheng Xie (1):
mlock: fix mlock count can not decrease in race condition

Yu Zhao (1):
swap: cond_resched in swap_cgroup_prepare()

Yuchung Cheng (1):
tcp: avoid fragmenting peculiar skbs in SACK

Yuta Kobayashi (1):
HID: microsoft: Add Surface 4 type cover pro 4 (JP)

zheng li (1):
ipv4: Should use consistent conditional judgement for ip fragment in __ip_append_data and ip_finish_output

Signature · 3 lines
Ben Hutchings
Kids!  Bringing about Armageddon can be dangerous.  Do not attempt it in
your own home. - Terry Pratchett and Neil Gaiman, `Good Omens'
Makefile +1 -1
index feec4287aa87..890d673d9391 100644
@@ -1,6 +1,6 @@
 VERSION = 3
 PATCHLEVEL = 16
-SUBLEVEL = 47
+SUBLEVEL = 48
 EXTRAVERSION =
 NAME = Museum of Fishiegoodies
 
arch/alpha/kernel/osf_sys.c +4 -2
index 1402fcc11c2c..1e81bc6f9494 100644
@@ -1186,8 +1186,10 @@ SYSCALL_DEFINE4(osf_wait4, pid_t, pid, int __user *, ustatus, int, options,
 	if (!access_ok(VERIFY_WRITE, ur, sizeof(*ur)))
 		return -EFAULT;
 
-	err = 0;
-	err |= put_user(status, ustatus);
+	err = put_user(status, ustatus);
+	if (ret < 0)
+		return err ? err : ret;
+
 	err |= __put_user(r.ru_utime.tv_sec, &ur->ru_utime.tv_sec);
 	err |= __put_user(r.ru_utime.tv_usec, &ur->ru_utime.tv_usec);
 	err |= __put_user(r.ru_stime.tv_sec, &ur->ru_stime.tv_sec);
arch/arm/kvm/init.S +2 -3
index ee4f7447a1d3..622a30a3563a 100644
@@ -109,7 +109,6 @@
 	@  - Write permission implies XN: disabled
 	@  - Instruction cache: enabled
 	@  - Data/Unified cache: enabled
-	@  - Memory alignment checks: enabled
 	@  - MMU: enabled (this code must be run from an identity mapping)
 	mrc	p15, 4, r0, c1, c0, 0	@ HSCR
 	ldr	r2, =HSCTLR_MASK
@@ -117,8 +116,8 @@
 	mrc	p15, 0, r1, c1, c0, 0	@ SCTLR
 	ldr	r2, =(HSCTLR_EE | HSCTLR_FI | HSCTLR_I | HSCTLR_C)
 	and	r1, r1, r2
- ARM(	ldr	r2, =(HSCTLR_M | HSCTLR_A)			)
- THUMB(	ldr	r2, =(HSCTLR_M | HSCTLR_A | HSCTLR_TE)		)
+ ARM(	ldr	r2, =(HSCTLR_M)					)
+ THUMB(	ldr	r2, =(HSCTLR_M | HSCTLR_TE)			)
 	orr	r1, r1, r2
 	orr	r0, r0, r1
 	isb
arch/arm/kvm/mmu.c +15 -8
index c13c846fad72..4c4e35eb96d0 100644
@@ -196,6 +196,13 @@ static void unmap_range(struct kvm *kvm, pgd_t *pgdp,
 
 	pgd = pgdp + kvm_pgd_index(addr);
 	do {
+		/*
+		 * Make sure the page table is still active, as another thread
+		 * could have possibly freed the page table, while we released
+		 * the lock.
+		 */
+		if (kvm && !ACCESS_ONCE(kvm->arch.pgd))
+			break;
 		next = kvm_pgd_addr_end(addr, end);
 		if (!pgd_none(*pgd))
 			unmap_puds(kvm, pgd, addr, next);
@@ -635,21 +642,21 @@ void stage2_unmap_vm(struct kvm *kvm)
  * Walks the level-1 page table pointed to by kvm->arch.pgd and frees all
  * underlying level-2 and level-3 tables before freeing the actual level-1 table
  * and setting the struct pointer to NULL.
- *
- * Note we don't need locking here as this is only called when the VM is
- * destroyed, which can only be done once.
  */
 void kvm_free_stage2_pgd(struct kvm *kvm)
 {
-	if (kvm->arch.pgd == NULL)
-		return;
+	void *pgd = NULL;
 
 	spin_lock(&kvm->mmu_lock);
-	unmap_stage2_range(kvm, 0, KVM_PHYS_SIZE);
+	if (kvm->arch.pgd) {
+		unmap_stage2_range(kvm, 0, KVM_PHYS_SIZE);
+		pgd = ACCESS_ONCE(kvm->arch.pgd);
+		kvm->arch.pgd = NULL;
+	}
 	spin_unlock(&kvm->mmu_lock);
 
-	free_pages((unsigned long)kvm->arch.pgd, S2_PGD_ORDER);
-	kvm->arch.pgd = NULL;
+	if (pgd)
+		free_pages((unsigned long)pgd, S2_PGD_ORDER);
 }
 
 static pmd_t *stage2_get_pmd(struct kvm *kvm, struct kvm_mmu_memory_cache *cache,
arch/arm/mm/mmu.c +4 -4
index 8a7c998f789d..0c668e861782 100644
@@ -1142,15 +1142,15 @@ void __init sanity_check_meminfo(void)
 
 	high_memory = __va(arm_lowmem_limit - 1) + 1;
 
+	if (!memblock_limit)
+		memblock_limit = arm_lowmem_limit;
+
 	/*
 	 * Round the memblock limit down to a pmd size.  This
 	 * helps to ensure that we will allocate memory from the
 	 * last full pmd, which should be mapped.
 	 */
-	if (memblock_limit)
-		memblock_limit = round_down(memblock_limit, PMD_SIZE);
-	if (!memblock_limit)
-		memblock_limit = arm_lowmem_limit;
+	memblock_limit = round_down(memblock_limit, PMD_SIZE);
 
 	memblock_set_current_limit(memblock_limit);
 }
arch/arm64/include/asm/kvm_arm.h +5 -0
index c33a96bac824..243bd77558c3 100644
@@ -89,6 +89,11 @@
 #define SCTLR_EL2_C	(1 << 2)
 #define SCTLR_EL2_A	(1 << 1)
 #define SCTLR_EL2_M	1
+
+#define SCTLR_EL2_RES1	((1 << 4)  | (1 << 5)  | (1 << 11) | (1 << 16) | \
+			 (1 << 16) | (1 << 18) | (1 << 22) | (1 << 23) | \
+			 (1 << 28) | (1 << 29))
+
 #define SCTLR_EL2_FLAGS	(SCTLR_EL2_M | SCTLR_EL2_A | SCTLR_EL2_C |	\
 			 SCTLR_EL2_SA | SCTLR_EL2_I)
 
arch/arm64/kvm/hyp-init.S +7 -4
index c3191168a994..29c47f7d6ecf 100644
@@ -84,10 +84,13 @@ ENTRY(__kvm_hyp_init)
 	tlbi	alle2
 	dsb	sy
 
-	mrs	x4, sctlr_el2
-	and	x4, x4, #SCTLR_EL2_EE	// preserve endianness of EL2
-	ldr	x5, =SCTLR_EL2_FLAGS
-	orr	x4, x4, x5
+	/*
+	 * Preserve all the RES1 bits while setting the default flags,
+	 * as well as the EE bit on BE. Drop the A flag since the compiler
+	 * is allowed to generate unaligned accesses.
+	 */
+	ldr	x4, =(SCTLR_EL2_RES1 | (SCTLR_EL2_FLAGS & ~SCTLR_EL2_A))
+CPU_BE(	orr	x4, x4, #SCTLR_EL2_EE)
 	msr	sctlr_el2, x4
 	isb
 
arch/mips/include/asm/kprobes.h +2 -1
index daba1f9a4f79..174aedce3167 100644
@@ -40,7 +40,8 @@ typedef union mips_instruction kprobe_opcode_t;
 
 #define flush_insn_slot(p)						\
 do {									\
-	flush_icache_range((unsigned long)p->addr,			\
+	if (p->addr)							\
+		flush_icache_range((unsigned long)p->addr,		\
 			   (unsigned long)p->addr +			\
 			   (MAX_INSN_SIZE * sizeof(kprobe_opcode_t)));	\
 } while (0)
arch/mips/kernel/entry.S +3 -0
index 4353d323f017..73a7a60640c8 100644
@@ -10,6 +10,7 @@
 
 #include <asm/asm.h>
 #include <asm/asmmacro.h>
+#include <asm/irqflags.h>
 #include <asm/regdef.h>
 #include <asm/mipsregs.h>
 #include <asm/stackframe.h>
@@ -118,6 +119,7 @@ restore_partial:		# restore partial frame
 	andi	t0, a2, _TIF_NEED_RESCHED # a2 is preloaded with TI_FLAGS
 	beqz	t0, work_notifysig
 work_resched:
+	TRACE_IRQS_OFF
 	jal	schedule
 
 	local_irq_disable		# make sure need_resched and
@@ -154,6 +156,7 @@ FEXPORT(syscall_exit_partial)
 	beqz	t0, work_pending	# trace bit set?
 	local_irq_enable		# could let syscall_trace_leave()
 					# call schedule() instead
+	TRACE_IRQS_ON
 	move	a0, sp
 	jal	syscall_trace_leave
 	b	resume_userspace
arch/mips/kernel/pm-cps.c +1 -8
index c4c2069d3a20..1ff84aa2de18 100644
@@ -55,7 +55,6 @@ DECLARE_BITMAP(state_support, CPS_PM_STATE_COUNT);
  * state. Actually per-core rather than per-CPU.
  */
 static DEFINE_PER_CPU_ALIGNED(u32*, ready_count);
-static DEFINE_PER_CPU_ALIGNED(void*, ready_count_alloc);
 
 /* Indicates online CPUs coupled with the current CPU */
 static DEFINE_PER_CPU_ALIGNED(cpumask_t, online_coupled);
@@ -616,7 +615,6 @@ static int __init cps_gen_core_entries(unsigned cpu)
 {
 	enum cps_pm_state state;
 	unsigned core = cpu_data[cpu].core;
-	unsigned dlinesz = cpu_data[cpu].dcache.linesz;
 	void *entry_fn, *core_rc;
 
 	for (state = CPS_PM_NC_WAIT; state < CPS_PM_STATE_COUNT; state++) {
@@ -636,16 +634,11 @@ static int __init cps_gen_core_entries(unsigned cpu)
 	}
 
 	if (!per_cpu(ready_count, core)) {
-		core_rc = kmalloc(dlinesz * 2, GFP_KERNEL);
+		core_rc = kmalloc(sizeof(u32), GFP_KERNEL);
 		if (!core_rc) {
 			pr_err("Failed allocate core %u ready_count\n", core);
 			return -ENOMEM;
 		}
-		per_cpu(ready_count_alloc, core) = core_rc;
-
-		/* Ensure ready_count is aligned to a cacheline boundary */
-		core_rc += dlinesz - 1;
-		core_rc = (void *)((unsigned long)core_rc & ~(dlinesz - 1));
 		per_cpu(ready_count, core) = core_rc;
 	}
 
arch/mips/kernel/traps.c +2 -0
index e6e055d19f6c..22bd174fa3b1 100644
@@ -190,6 +190,8 @@ void show_stack(struct task_struct *task, unsigned long *sp)
 {
 	struct pt_regs regs;
 	mm_segment_t old_fs = get_fs();
+
+	regs.cp0_status = KSU_KERNEL;
 	if (sp) {
 		regs.regs[29] = (unsigned long)sp;
 		regs.regs[31] = 0;
arch/powerpc/include/asm/page.h +12 -0
index 32e4e212b9c1..2d44f9af63d7 100644
@@ -132,7 +132,19 @@ extern long long virt_phys_offset;
 
 #define virt_to_page(kaddr)	pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
 #define pfn_to_kaddr(pfn)	__va((pfn) << PAGE_SHIFT)
+
+#ifdef CONFIG_PPC_BOOK3S_64
+/*
+ * On hash the vmalloc and other regions alias to the kernel region when passed
+ * through __pa(), which virt_to_pfn() uses. That means virt_addr_valid() can
+ * return true for some vmalloc addresses, which is incorrect. So explicitly
+ * check that the address is in the kernel region.
+ */
+#define virt_addr_valid(kaddr) (REGION_ID(kaddr) == KERNEL_REGION_ID && \
+				pfn_valid(__pa(kaddr) >> PAGE_SHIFT))
+#else
 #define virt_addr_valid(kaddr)	pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
+#endif
 
 /*
  * On Book-E parts we need __va to parse the device tree and we can't
arch/powerpc/include/asm/topology.h +14 -0
index 5f1048eaa5b6..a69d091d31ff 100644
@@ -44,8 +44,22 @@ extern void __init dump_numa_cpu_topology(void);
 extern int sysfs_add_device_to_node(struct device *dev, int nid);
 extern void sysfs_remove_device_from_node(struct device *dev, int nid);
 
+static inline int early_cpu_to_node(int cpu)
+{
+	int nid;
+
+	nid = numa_cpu_lookup_table[cpu];
+
+	/*
+	 * Fall back to node 0 if nid is unset (it should be, except bugs).
+	 * This allows callers to safely do NODE_DATA(early_cpu_to_node(cpu)).
+	 */
+	return (nid < 0) ? 0 : nid;
+}
 #else
 
+static inline int early_cpu_to_node(int cpu) { return 0; }
+
 static inline void dump_numa_cpu_topology(void) {}
 
 static inline int sysfs_add_device_to_node(struct device *dev, int nid)
arch/powerpc/kernel/kprobes.c +11 -0
index 2f72af82513c..4dc454172ab3 100644
@@ -514,6 +514,15 @@ int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
 #endif
 #endif
 
+	/*
+	 * jprobes use jprobe_return() which skips the normal return
+	 * path of the function, and this messes up the accounting of the
+	 * function graph tracer.
+	 *
+	 * Pause function graph tracing while performing the jprobe function.
+	 */
+	pause_graph_tracing();
+
 	return 1;
 }
 
@@ -536,6 +545,8 @@ int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
 	 * saved regs...
 	 */
 	memcpy(regs, &kcb->jprobe_saved_regs, sizeof(struct pt_regs));
+	/* It's OK to start function graph tracing again */
+	unpause_graph_tracing();
 	preempt_enable_no_resched();
 	return 1;
 }
arch/powerpc/kernel/setup_64.c +30 -2
index 4f1f67936a5f..8240e3d548df 100644
@@ -614,6 +614,23 @@ static void __init exc_lvl_early_init(void)
 #define exc_lvl_early_init()
 #endif
 
+/*
+ * Emergency stacks are used for a range of things, from asynchronous
+ * NMIs (system reset, machine check) to synchronous, process context.
+ * We set preempt_count to zero, even though that isn't necessarily correct. To
+ * get the right value we'd need to copy it from the previous thread_info, but
+ * doing that might fault causing more problems.
+ * TODO: what to do with accounting?
+ */
+static void emerg_stack_init_thread_info(struct thread_info *ti, int cpu)
+{
+	ti->task = NULL;
+	ti->cpu = cpu;
+	ti->preempt_count = 0;
+	ti->local_flags = 0;
+	ti->flags = 0;
+}
+
 /*
  * Stack space used when we detect a bad kernel stack pointer, and
  * early in SMP boots before relocation is enabled. Exclusive emergency
@@ -632,18 +649,29 @@ static void __init emergency_stack_init(void)
 	 * Since we use these as temporary stacks during secondary CPU
 	 * bringup, we need to get at them in real mode. This means they
 	 * must also be within the RMO region.
+	 *
+	 * The IRQ stacks allocated elsewhere in this file are zeroed and
+	 * initialized in kernel/irq.c. These are initialized here in order
+	 * to have emergency stacks available as early as possible.
 	 */
 	limit = min(safe_stack_limit(), ppc64_rma_size);
 
 	for_each_possible_cpu(i) {
 		unsigned long sp;
+		struct thread_info *ti;
 		sp  = memblock_alloc_base(THREAD_SIZE, THREAD_SIZE, limit);
+		ti = __va(sp);
+		memset(ti, 0, THREAD_SIZE);
+		emerg_stack_init_thread_info(ti, i);
 		sp += THREAD_SIZE;
 		paca[i].emergency_sp = __va(sp);
 
 #ifdef CONFIG_PPC_BOOK3S_64
 		/* emergency stack for machine check exception handling. */
 		sp  = memblock_alloc_base(THREAD_SIZE, THREAD_SIZE, limit);
+		ti = __va(sp);
+		memset(ti, 0, THREAD_SIZE);
+		emerg_stack_init_thread_info(ti, i);
 		sp += THREAD_SIZE;
 		paca[i].mc_emergency_sp = __va(sp);
 #endif
@@ -739,7 +767,7 @@ void ppc64_boot_msg(unsigned int src, const char *msg)
 
 static void * __init pcpu_fc_alloc(unsigned int cpu, size_t size, size_t align)
 {
-	return __alloc_bootmem_node(NODE_DATA(cpu_to_node(cpu)), size, align,
+	return __alloc_bootmem_node(NODE_DATA(early_cpu_to_node(cpu)), size, align,
 				    __pa(MAX_DMA_ADDRESS));
 }
 
@@ -750,7 +778,7 @@ static void __init pcpu_fc_free(void *ptr, size_t size)
 
 static int pcpu_cpu_distance(unsigned int from, unsigned int to)
 {
-	if (cpu_to_node(from) == cpu_to_node(to))
+	if (early_cpu_to_node(from) == early_cpu_to_node(to))
 		return LOCAL_DISTANCE;
 	else
 		return REMOTE_DISTANCE;
arch/powerpc/kvm/book3s_hv.c +37 -0
index d39faa230eb1..73abf3119ad1 100644
@@ -1795,12 +1795,34 @@ static int kvmppc_vcpu_run_hv(struct kvm_run *run, struct kvm_vcpu *vcpu)
 {
 	int r;
 	int srcu_idx;
+	unsigned long ebb_regs[3] = {};	/* shut up GCC */
 
 	if (!vcpu->arch.sane) {
 		run->exit_reason = KVM_EXIT_INTERNAL_ERROR;
 		return -EINVAL;
 	}
 
+	/*
+	 * Don't allow entry with a suspended transaction, because
+	 * the guest entry/exit code will lose it.
+	 * If the guest has TM enabled, save away their TM-related SPRs
+	 * (they will get restored by the TM unavailable interrupt).
+	 */
+#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
+	if (cpu_has_feature(CPU_FTR_TM) && current->thread.regs &&
+	    (current->thread.regs->msr & MSR_TM)) {
+		if (MSR_TM_ACTIVE(current->thread.regs->msr)) {
+			run->exit_reason = KVM_EXIT_FAIL_ENTRY;
+			run->fail_entry.hardware_entry_failure_reason = 0;
+			return -EINVAL;
+		}
+		current->thread.tm_tfhar = mfspr(SPRN_TFHAR);
+		current->thread.tm_tfiar = mfspr(SPRN_TFIAR);
+		current->thread.tm_texasr = mfspr(SPRN_TEXASR);
+		current->thread.regs->msr &= ~MSR_TM;
+	}
+#endif
+
 	kvmppc_core_prepare_to_enter(vcpu);
 
 	/* No need to go into the guest when all we'll do is come back out */
@@ -1823,6 +1845,14 @@ static int kvmppc_vcpu_run_hv(struct kvm_run *run, struct kvm_vcpu *vcpu)
 	flush_fp_to_thread(current);
 	flush_altivec_to_thread(current);
 	flush_vsx_to_thread(current);
+
+	/* Save userspace EBB register values */
+	if (cpu_has_feature(CPU_FTR_ARCH_207S)) {
+		ebb_regs[0] = mfspr(SPRN_EBBHR);
+		ebb_regs[1] = mfspr(SPRN_EBBRR);
+		ebb_regs[2] = mfspr(SPRN_BESCR);
+	}
+
 	vcpu->arch.wqp = &vcpu->arch.vcore->wq;
 	vcpu->arch.pgdir = current->mm->pgd;
 	vcpu->arch.state = KVMPPC_VCPU_BUSY_IN_HOST;
@@ -1842,6 +1872,13 @@ static int kvmppc_vcpu_run_hv(struct kvm_run *run, struct kvm_vcpu *vcpu)
 		}
 	} while (is_kvmppc_resume_guest(r));
 
+	/* Restore userspace EBB register values */
+	if (cpu_has_feature(CPU_FTR_ARCH_207S)) {
+		mtspr(SPRN_EBBHR, ebb_regs[0]);
+		mtspr(SPRN_EBBRR, ebb_regs[1]);
+		mtspr(SPRN_BESCR, ebb_regs[2]);
+	}
+
  out:
 	vcpu->arch.state = KVMPPC_VCPU_NOTREADY;
 	atomic_dec(&vcpu->kvm->arch.vcpus_running);
arch/powerpc/platforms/cell/spufs/coredump.c +2 -0
index be6212ddbf06..7e42e3ec2142 100644
@@ -174,6 +174,8 @@ static int spufs_arch_write_note(struct spu_context *ctx, int i,
 	if (!dump_skip(cprm,
 		       roundup(cprm->written - total + sz, 4) - cprm->written))
 		goto Eio;
+
+	rc = 0;
 out:
 	free_page((unsigned long)buf);
 	return rc;
arch/x86/Kconfig +1 -1
index a51d8286c75d..ea6a3fb6a411 100644
@@ -304,7 +304,7 @@ config SMP
 	  Management" code will be disabled if you say Y here.
 
 	  See also <file:Documentation/x86/i386/IO-APIC.txt>,
-	  <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO available at
+	  <file:Documentation/lockup-watchdogs.txt> and the SMP-HOWTO available at
 	  <http://www.tldp.org/docs.html#howto>.
 
 	  If you don't know what to do here, say N.
arch/x86/kernel/i387.c +1 -0
index d5dd80814419..5d7acb77cc1d 100644
@@ -115,6 +115,7 @@ void unlazy_fpu(struct task_struct *tsk)
 EXPORT_SYMBOL(unlazy_fpu);
 
 unsigned int mxcsr_feature_mask __read_mostly = 0xffffffffu;
+EXPORT_SYMBOL_GPL(mxcsr_feature_mask);
 unsigned int xstate_size;
 EXPORT_SYMBOL_GPL(xstate_size);
 static struct i387_fxsave_struct fx_scratch;
arch/x86/kernel/kvm.c +1 -1
index 07de51f66deb..61da6be309a7 100644
@@ -160,8 +160,8 @@ void kvm_async_pf_task_wait(u32 token)
 			 */
 			rcu_irq_exit();
 			native_safe_halt();
-			rcu_irq_enter();
 			local_irq_disable();
+			rcu_irq_enter();
 		}
 	}
 	if (!n.halted)
arch/x86/kvm/cpuid.c +11 -9
index 38a0afe83c6b..d77d76936a6d 100644
@@ -671,18 +671,20 @@ int kvm_dev_ioctl_get_cpuid(struct kvm_cpuid2 *cpuid,
 static int move_to_next_stateful_cpuid_entry(struct kvm_vcpu *vcpu, int i)
 {
 	struct kvm_cpuid_entry2 *e = &vcpu->arch.cpuid_entries[i];
-	int j, nent = vcpu->arch.cpuid_nent;
+	struct kvm_cpuid_entry2 *ej;
+	int j = i;
+	int nent = vcpu->arch.cpuid_nent;
 
 	e->flags &= ~KVM_CPUID_FLAG_STATE_READ_NEXT;
 	/* when no next entry is found, the current entry[i] is reselected */
-	for (j = i + 1; ; j = (j + 1) % nent) {
-		struct kvm_cpuid_entry2 *ej = &vcpu->arch.cpuid_entries[j];
-		if (ej->function == e->function) {
-			ej->flags |= KVM_CPUID_FLAG_STATE_READ_NEXT;
-			return j;
-		}
-	}
-	return 0; /* silence gcc, even though control never reaches here */
+	do {
+		j = (j + 1) % nent;
+		ej = &vcpu->arch.cpuid_entries[j];
+	} while (ej->function != e->function);
+
+	ej->flags |= KVM_CPUID_FLAG_STATE_READ_NEXT;
+
+	return j;
 }
 
 /* find an entry with matching function, matching index (if needed), and that
arch/x86/kvm/mmu.c +5 -2
index cb3d12be3c9c..a2da841d3792 100644
@@ -3292,12 +3292,15 @@ static int kvm_arch_setup_async_pf(struct kvm_vcpu *vcpu, gva_t gva, gfn_t gfn)
 	return kvm_setup_async_pf(vcpu, gva, gfn_to_hva(vcpu->kvm, gfn), &arch);
 }
 
-static bool can_do_async_pf(struct kvm_vcpu *vcpu)
+bool kvm_can_do_async_pf(struct kvm_vcpu *vcpu)
 {
 	if (unlikely(!irqchip_in_kernel(vcpu->kvm) ||
 		     kvm_event_needs_reinjection(vcpu)))
 		return false;
 
+	if (is_guest_mode(vcpu))
+		return false;
+
 	return kvm_x86_ops->interrupt_allowed(vcpu);
 }
 
@@ -3311,7 +3314,7 @@ static bool try_async_pf(struct kvm_vcpu *vcpu, bool prefault, gfn_t gfn,
 	if (!async)
 		return false; /* *pfn has correct page already */
 
-	if (!prefault && can_do_async_pf(vcpu)) {
+	if (!prefault && kvm_can_do_async_pf(vcpu)) {
 		trace_kvm_try_async_get_page(gva, gfn);
 		if (kvm_find_async_pf_gfn(vcpu, gfn)) {
 			trace_kvm_async_pf_doublefault(gva, gfn);
arch/x86/kvm/mmu.h +1 -0
index 1d4548867c86..58b2f51fdfdc 100644
@@ -79,6 +79,7 @@ int handle_mmio_page_fault_common(struct kvm_vcpu *vcpu, u64 addr, bool direct);
 void kvm_init_shadow_mmu(struct kvm_vcpu *vcpu, struct kvm_mmu *context);
 void kvm_init_shadow_ept_mmu(struct kvm_vcpu *vcpu, struct kvm_mmu *context,
 		bool execonly);
+bool kvm_can_do_async_pf(struct kvm_vcpu *vcpu);
 
 static inline unsigned int kvm_mmu_available_pages(struct kvm *kvm)
 {
arch/x86/kvm/vmx.c +1 -1
index d55d7b518cdc..56772d2781b0 100644
@@ -2001,7 +2001,7 @@ static int nested_vmx_check_exception(struct kvm_vcpu *vcpu, unsigned nr)
 	if (!(vmcs12->exception_bitmap & (1u << nr)))
 		return 0;
 
-	nested_vmx_vmexit(vcpu, to_vmx(vcpu)->exit_reason,
+	nested_vmx_vmexit(vcpu, EXIT_REASON_EXCEPTION_NMI,
 			  vmcs_read32(VM_EXIT_INTR_INFO),
 			  vmcs_readl(EXIT_QUALIFICATION));
 	return 1;
arch/x86/kvm/x86.c +25 -13
index 75bf438eb2e5..d271869c488f 100644
@@ -3110,11 +3110,14 @@ static void kvm_vcpu_ioctl_x86_get_xsave(struct kvm_vcpu *vcpu,
 	}
 }
 
+#define XSAVE_MXCSR_OFFSET 24
+
 static int kvm_vcpu_ioctl_x86_set_xsave(struct kvm_vcpu *vcpu,
 					struct kvm_xsave *guest_xsave)
 {
 	u64 xstate_bv =
 		*(u64 *)&guest_xsave->region[XSAVE_HDR_OFFSET / sizeof(u32)];
+	u32 mxcsr = *(u32 *)&guest_xsave->region[XSAVE_MXCSR_OFFSET / sizeof(u32)];
 
 	if (cpu_has_xsave) {
 		/*
@@ -3122,12 +3125,14 @@ static int kvm_vcpu_ioctl_x86_set_xsave(struct kvm_vcpu *vcpu,
 		 * CPUID leaf 0xD, index 0, EDX:EAX.  This is for compatibility
 		 * with old userspace.
 		 */
-		if (xstate_bv & ~kvm_supported_xcr0())
+		if (xstate_bv & ~kvm_supported_xcr0() ||
+			mxcsr & ~mxcsr_feature_mask)
 			return -EINVAL;
 		memcpy(&vcpu->arch.guest_fpu.state->xsave,
 			guest_xsave->region, vcpu->arch.guest_xstate_size);
 	} else {
-		if (xstate_bv & ~XSTATE_FPSSE)
+		if (xstate_bv & ~XSTATE_FPSSE ||
+			mxcsr & ~mxcsr_feature_mask)
 			return -EINVAL;
 		memcpy(&vcpu->arch.guest_fpu.state->fxsave,
 			guest_xsave->region, sizeof(struct i387_fxsave_struct));
@@ -4518,16 +4523,20 @@ static int emulator_cmpxchg_emulated(struct x86_emulate_ctxt *ctxt,
 
 static int kernel_pio(struct kvm_vcpu *vcpu, void *pd)
 {
-	/* TODO: String I/O for in kernel device */
-	int r;
+	int r = 0, i;
 
-	if (vcpu->arch.pio.in)
-		r = kvm_io_bus_read(vcpu->kvm, KVM_PIO_BUS, vcpu->arch.pio.port,
-				    vcpu->arch.pio.size, pd);
-	else
-		r = kvm_io_bus_write(vcpu->kvm, KVM_PIO_BUS,
-				     vcpu->arch.pio.port, vcpu->arch.pio.size,
-				     pd);
+	for (i = 0; i < vcpu->arch.pio.count; i++) {
+		if (vcpu->arch.pio.in)
+			r = kvm_io_bus_read(vcpu->kvm, KVM_PIO_BUS, vcpu->arch.pio.port,
+					    vcpu->arch.pio.size, pd);
+		else
+			r = kvm_io_bus_write(vcpu->kvm, KVM_PIO_BUS,
+					     vcpu->arch.pio.port, vcpu->arch.pio.size,
+					     pd);
+		if (r)
+			break;
+		pd += vcpu->arch.pio.size;
+	}
 	return r;
 }
 
@@ -4565,6 +4574,8 @@ static int emulator_pio_in_emulated(struct x86_emulate_ctxt *ctxt,
 	if (vcpu->arch.pio.count)
 		goto data_avail;
 
+	memset(vcpu->arch.pio_data, 0, size * count);
+
 	ret = emulator_pio_in_out(vcpu, size, port, val, count, true);
 	if (ret) {
 data_avail:
@@ -4738,6 +4749,8 @@ static bool emulator_get_segment(struct x86_emulate_ctxt *ctxt, u16 *selector,
 
 	if (var.unusable) {
 		memset(desc, 0, sizeof(*desc));
+		if (base3)
+			*base3 = 0;
 		return false;
 	}
 
@@ -7599,8 +7612,7 @@ bool kvm_arch_can_inject_async_page_present(struct kvm_vcpu *vcpu)
 	if (!(vcpu->arch.apf.msr_val & KVM_ASYNC_PF_ENABLED))
 		return true;
 	else
-		return !kvm_event_needs_reinjection(vcpu) &&
-			kvm_x86_ops->interrupt_allowed(vcpu);
+		return kvm_can_do_async_pf(vcpu);
 }
 
 void kvm_arch_register_noncoherent_dma(struct kvm *kvm)
block/partition-generic.c +3 -1
index 0d9e5f97f0a8..94de2055365e 100644
@@ -309,8 +309,10 @@ struct hd_struct *add_partition(struct gendisk *disk, int partno,
 
 	if (info) {
 		struct partition_meta_info *pinfo = alloc_part_info(disk);
-		if (!pinfo)
+		if (!pinfo) {
+			err = -ENOMEM;
 			goto out_free_stats;
+		}
 		memcpy(pinfo, info, sizeof(*info));
 		p->info = pinfo;
 	}
crypto/gcm.c +2 -4
index 49b6fb20cceb..8ad447ce2da0 100644
@@ -146,10 +146,8 @@ static int crypto_gcm_setkey(struct crypto_aead *aead, const u8 *key,
 
 	err = crypto_ablkcipher_encrypt(&data->req);
 	if (err == -EINPROGRESS || err == -EBUSY) {
-		err = wait_for_completion_interruptible(
-			&data->result.completion);
-		if (!err)
-			err = data->result.err;
+		wait_for_completion(&data->result.completion);
+		err = data->result.err;
 	}
 
 	if (err)
drivers/ata/ahci.c +38 -0
index ea7fc359d807..631646e13119 100644
@@ -1313,6 +1313,40 @@ static inline void ahci_gtf_filter_workaround(struct ata_host *host)
 {}
 #endif
 
+/*
+ * On the Acer Aspire Switch Alpha 12, sometimes all SATA ports are detected
+ * as DUMMY, or detected but eventually get a "link down" and never get up
+ * again. When this happens, CAP.NP may hold a value of 0x00 or 0x01, and the
+ * port_map may hold a value of 0x00.
+ *
+ * Overriding CAP.NP to 0x02 and the port_map to 0x7 will reveal all 3 ports
+ * and can significantly reduce the occurrence of the problem.
+ *
+ * https://bugzilla.kernel.org/show_bug.cgi?id=189471
+ */
+static void acer_sa5_271_workaround(struct ahci_host_priv *hpriv,
+				    struct pci_dev *pdev)
+{
+	static const struct dmi_system_id sysids[] = {
+		{
+			.ident = "Acer Switch Alpha 12",
+			.matches = {
+				DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+				DMI_MATCH(DMI_PRODUCT_NAME, "Switch SA5-271")
+			},
+		},
+		{ }
+	};
+
+	if (dmi_check_system(sysids)) {
+		dev_info(&pdev->dev, "enabling Acer Switch Alpha 12 workaround\n");
+		if ((hpriv->saved_cap & 0xC734FF00) == 0xC734FF00) {
+			hpriv->port_map = 0x7;
+			hpriv->cap = 0xC734FF02;
+		}
+	}
+}
+
 static int ahci_init_interrupts(struct pci_dev *pdev, unsigned int n_ports,
 				struct ahci_host_priv *hpriv)
 {
@@ -1565,6 +1599,10 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 			 "online status unreliable, applying workaround\n");
 	}
 
+
+	/* Acer SA5-271 workaround modifies private_data */
+	acer_sa5_271_workaround(hpriv, pdev);
+
 	/* CAP.NP sometimes indicate the index of the last enabled
 	 * port, at other times, that of the last possible port, so
 	 * determining the maximum port number requires looking at
drivers/char/mem.c +5 -0
index 5c2b7c575c9d..446b57efb19f 100644
@@ -329,6 +329,11 @@ static const struct vm_operations_struct mmap_mem_ops = {
 static int mmap_mem(struct file *file, struct vm_area_struct *vma)
 {
 	size_t size = vma->vm_end - vma->vm_start;
+	phys_addr_t offset = (phys_addr_t)vma->vm_pgoff << PAGE_SHIFT;
+
+	/* It's illegal to wrap around the end of the physical address space. */
+	if (offset + (phys_addr_t)size - 1 < offset)
+		return -EINVAL;
 
 	if (!valid_mmap_phys_addr_range(vma->vm_pgoff, size))
 		return -EINVAL;
drivers/cpufreq/cpufreq_conservative.c +2 -2
index 25a70d06c5bf..55836a538a68 100644
@@ -204,8 +204,8 @@ static ssize_t store_down_threshold(struct dbs_data *dbs_data, const char *buf,
 	int ret;
 	ret = sscanf(buf, "%u", &input);
 
-	/* cannot be lower than 11 otherwise freq will not fall */
-	if (ret != 1 || input < 11 || input > 100 ||
+	/* cannot be lower than 1 otherwise freq will not fall */
+	if (ret != 1 || input < 1 || input > 100 ||
 			input >= cs_tuners->up_threshold)
 		return -EINVAL;
 
drivers/dma/ep93xx_dma.c +2 -0
index cb4bf682a708..ed836faa407c 100644
@@ -325,6 +325,8 @@ static int m2p_hw_setup(struct ep93xx_dma_chan *edmac)
 		| M2P_CONTROL_ENABLE;
 	m2p_set_control(edmac, control);
 
+	edmac->buffer = 0;
+
 	return 0;
 }
 
drivers/gpu/drm/gma500/psb_intel_lvds.c +11 -7
index d7778d0472c1..f7e112a2e3b6 100644
@@ -783,20 +783,23 @@ void psb_intel_lvds_init(struct drm_device *dev,
 		if (scan->type & DRM_MODE_TYPE_PREFERRED) {
 			mode_dev->panel_fixed_mode =
 			    drm_mode_duplicate(dev, scan);
+			DRM_DEBUG_KMS("Using mode from DDC\n");
 			goto out;	/* FIXME: check for quirks */
 		}
 	}
 
 	/* Failed to get EDID, what about VBT? do we need this? */
-	if (mode_dev->vbt_mode)
+	if (dev_priv->lfp_lvds_vbt_mode) {
 		mode_dev->panel_fixed_mode =
-		    drm_mode_duplicate(dev, mode_dev->vbt_mode);
+			drm_mode_duplicate(dev, dev_priv->lfp_lvds_vbt_mode);
 
-	if (!mode_dev->panel_fixed_mode)
-		if (dev_priv->lfp_lvds_vbt_mode)
-			mode_dev->panel_fixed_mode =
-				drm_mode_duplicate(dev,
-					dev_priv->lfp_lvds_vbt_mode);
+		if (mode_dev->panel_fixed_mode) {
+			mode_dev->panel_fixed_mode->type |=
+				DRM_MODE_TYPE_PREFERRED;
+			DRM_DEBUG_KMS("Using mode from VBT\n");
+			goto out;
+		}
+	}
 
 	/*
 	 * If we didn't get EDID, try checking if the panel is already turned
@@ -813,6 +816,7 @@ void psb_intel_lvds_init(struct drm_device *dev,
 		if (mode_dev->panel_fixed_mode) {
 			mode_dev->panel_fixed_mode->type |=
 			    DRM_MODE_TYPE_PREFERRED;
+			DRM_DEBUG_KMS("Using pre-programmed mode\n");
 			goto out;	/* FIXME: check for quirks */
 		}
 	}
drivers/gpu/drm/radeon/ci_dpm.c +6 -0
index c224eaef272e..18bdb3ee7a81 100644
@@ -733,6 +733,12 @@ bool ci_dpm_vblank_too_short(struct radeon_device *rdev)
 	u32 vblank_time = r600_dpm_get_vblank_time(rdev);
 	u32 switch_limit = pi->mem_gddr5 ? 450 : 300;
 
+	/* 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/radeon/cik.c +1 -1
index 4db031e92628..10b6329f9ba1 100644
@@ -7334,7 +7334,7 @@ static inline void cik_irq_ack(struct radeon_device *rdev)
 		WREG32(DC_HPD5_INT_CONTROL, tmp);
 	}
 	if (rdev->irq.stat_regs.cik.disp_int_cont5 & DC_HPD6_INTERRUPT) {
-		tmp = RREG32(DC_HPD5_INT_CONTROL);
+		tmp = RREG32(DC_HPD6_INT_CONTROL);
 		tmp |= DC_HPDx_INT_ACK;
 		WREG32(DC_HPD6_INT_CONTROL, tmp);
 	}
drivers/gpu/drm/radeon/evergreen.c +1 -1
index 76b12cc441e8..cd5bc8b1a2b4 100644
@@ -4692,7 +4692,7 @@ static void evergreen_irq_ack(struct radeon_device *rdev)
 		WREG32(DC_HPD5_INT_CONTROL, tmp);
 	}
 	if (rdev->irq.stat_regs.evergreen.disp_int_cont5 & DC_HPD6_INTERRUPT) {
-		tmp = RREG32(DC_HPD5_INT_CONTROL);
+		tmp = RREG32(DC_HPD6_INT_CONTROL);
 		tmp |= DC_HPDx_INT_ACK;
 		WREG32(DC_HPD6_INT_CONTROL, tmp);
 	}
drivers/gpu/drm/radeon/r600.c +1 -1
index 9eab1f172d33..f5f9a5e28f48 100644
@@ -3725,7 +3725,7 @@ static void r600_irq_ack(struct radeon_device *rdev)
 			WREG32(DC_HPD5_INT_CONTROL, tmp);
 		}
 		if (rdev->irq.stat_regs.r600.disp_int_cont2 & DC_HPD6_INTERRUPT) {
-			tmp = RREG32(DC_HPD5_INT_CONTROL);
+			tmp = RREG32(DC_HPD6_INT_CONTROL);
 			tmp |= DC_HPDx_INT_ACK;
 			WREG32(DC_HPD6_INT_CONTROL, tmp);
 		}
drivers/gpu/drm/radeon/radeon_combios.c +7 -0
index fd2820ff9e5b..def6031ede76 100644
@@ -3394,6 +3394,13 @@ void radeon_combios_asic_init(struct drm_device *dev)
 	    rdev->pdev->subsystem_vendor == 0x103c &&
 	    rdev->pdev->subsystem_device == 0x280a)
 		return;
+	/* quirk for rs4xx Toshiba Sattellite L20-183 latop to make it resume
+	 * - it hangs on resume inside the dynclk 1 table.
+	 */
+	if (rdev->family == CHIP_RS400 &&
+	    rdev->pdev->subsystem_vendor == 0x1179 &&
+	    rdev->pdev->subsystem_device == 0xff31)
+	        return;
 
 	/* DYN CLK 1 */
 	table = combios_get_table_offset(dev, COMBIOS_DYN_CLK_1_TABLE);
drivers/gpu/drm/radeon/radeon_device.c +4 -0
index 93324c9ddfc6..1ba38687a85e 100644
@@ -128,6 +128,10 @@ static struct radeon_px_quirk radeon_px_quirk_list[] = {
 	 * https://bugzilla.kernel.org/show_bug.cgi?id=51381
 	 */
 	{ PCI_VENDOR_ID_ATI, 0x6840, 0x1043, 0x2122, RADEON_PX_QUIRK_DISABLE_PX },
+	/* Asus K53TK laptop with AMD A6-3420M APU and Radeon 7670m GPU
+	 * https://bugs.freedesktop.org/show_bug.cgi?id=101491
+	 */
+	{ PCI_VENDOR_ID_ATI, 0x6741, 0x1043, 0x2122, RADEON_PX_QUIRK_DISABLE_PX },
 	/* macbook pro 8.2 */
 	{ PCI_VENDOR_ID_ATI, 0x6741, PCI_VENDOR_ID_APPLE, 0x00e2, RADEON_PX_QUIRK_LONG_WAKEUP },
 	{ 0, 0, 0, 0, 0 },
drivers/gpu/drm/radeon/si.c +1 -1
index 22330f6c7737..d473912ceb53 100644
@@ -6071,7 +6071,7 @@ static inline void si_irq_ack(struct radeon_device *rdev)
 		WREG32(DC_HPD5_INT_CONTROL, tmp);
 	}
 	if (rdev->irq.stat_regs.evergreen.disp_int_cont5 & DC_HPD6_INTERRUPT) {
-		tmp = RREG32(DC_HPD5_INT_CONTROL);
+		tmp = RREG32(DC_HPD6_INT_CONTROL);
 		tmp |= DC_HPDx_INT_ACK;
 		WREG32(DC_HPD6_INT_CONTROL, tmp);
 	}
drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c +2 -0
index 6eae14d2a3f7..f4a9ffd6bcb1 100644
@@ -385,6 +385,8 @@ void *vmw_fifo_reserve(struct vmw_private *dev_priv, uint32_t bytes)
 				return fifo_state->static_buffer;
 			else {
 				fifo_state->dynamic_buffer = vmalloc(bytes);
+				if (!fifo_state->dynamic_buffer)
+					goto out_err;
 				return fifo_state->dynamic_buffer;
 			}
 		}
drivers/hid/hid-core.c +17 -3
index 831c834c2d82..8df8344c1098 100644
@@ -704,8 +704,14 @@ static void hid_scan_collection(struct hid_parser *parser, unsigned type)
 		hid->group = HID_GROUP_SENSOR_HUB;
 
 	if (hid->vendor == USB_VENDOR_ID_MICROSOFT &&
-	    (hid->product == USB_DEVICE_ID_MS_TYPE_COVER_3 ||
-	     hid->product == USB_DEVICE_ID_MS_TYPE_COVER_3_JP) &&
+	    (hid->product == USB_DEVICE_ID_MS_TYPE_COVER_PRO_3 ||
+	     hid->product == USB_DEVICE_ID_MS_TYPE_COVER_PRO_3_2 ||
+	     hid->product == USB_DEVICE_ID_MS_TYPE_COVER_PRO_3_JP ||
+	     hid->product == USB_DEVICE_ID_MS_TYPE_COVER_PRO_4 ||
+	     hid->product == USB_DEVICE_ID_MS_TYPE_COVER_PRO_4_2 ||
+	     hid->product == USB_DEVICE_ID_MS_TYPE_COVER_PRO_4_JP ||
+	     hid->product == USB_DEVICE_ID_MS_TYPE_COVER_3 ||
+	     hid->product == USB_DEVICE_ID_MS_POWER_COVER) &&
 	    hid->group == HID_GROUP_MULTITOUCH)
 		hid->group = HID_GROUP_GENERIC;
 }
@@ -1804,6 +1810,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X_2) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M610X) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_PENSKETCH_M912) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_LCPOWER, USB_DEVICE_ID_LCPOWER_LC1000 ) },
 #if IS_ENABLED(CONFIG_HID_LENOVO_TPKBD)
@@ -1856,8 +1863,14 @@ static const struct hid_device_id hid_have_special_driver[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_DIGITAL_MEDIA_3K) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_WIRELESS_OPTICAL_DESKTOP_3_0) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_OFFICE_KB) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_PRO_3) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_PRO_3_2) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_PRO_3_JP) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_PRO_4) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_PRO_4_2) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_PRO_4_JP) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_3) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_3_JP) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_POWER_COVER) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_MONTEREY, USB_DEVICE_ID_GENIUS_KB29E) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_1) },
@@ -1947,6 +1960,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SUPER_JOY_BOX_3_PRO) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SUPER_DUAL_BOX_PRO) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SUPER_JOY_BOX_5_PRO) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_PLAYDOTCOM, USB_DEVICE_ID_PLAYDOTCOM_EMS_USBII) },
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE_BLUETOOTH) },
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS4_BLUETOOTH) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SLIM_TABLET_5_8_INCH) },
drivers/hid/hid-ids.h +61 -10

178 lines not on this page · raw message

drivers/hid/hid-kye.c +140 -0

164 lines not on this page · raw message

drivers/hid/hid-microsoft.c +13 -1
index af935eb198c9..a5b6f84f9652 100644
@@ -276,9 +276,21 @@ static const struct hid_device_id ms_devices[] = {
 		.driver_data = MS_NOGET },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_COMFORT_MOUSE_4500),
 		.driver_data = MS_DUPLICATE_USAGES },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_PRO_3),
+		.driver_data = MS_HIDINPUT },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_PRO_3_2),
+		.driver_data = MS_HIDINPUT },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_PRO_3_JP),
+		.driver_data = MS_HIDINPUT },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_PRO_4),
+		.driver_data = MS_HIDINPUT },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_PRO_4_2),
+		.driver_data = MS_HIDINPUT },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_PRO_4_JP),
+		.driver_data = MS_HIDINPUT },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_3),
 		.driver_data = MS_HIDINPUT },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_3_JP),
+	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_POWER_COVER),
 		.driver_data = MS_HIDINPUT },
 
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_BT),
drivers/hid/hid-sjoy.c +3 -0
index 37845eccddb5..36b6470af947 100644
@@ -166,6 +166,9 @@ static const struct hid_device_id sjoy_devices[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD),
 		.driver_data = HID_QUIRK_MULTI_INPUT |
 			       HID_QUIRK_SKIP_OUTPUT_REPORTS },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_PLAYDOTCOM, USB_DEVICE_ID_PLAYDOTCOM_EMS_USBII),
+		.driver_data = HID_QUIRK_MULTI_INPUT |
+			       HID_QUIRK_SKIP_OUTPUT_REPORTS },
 	{ }
 };
 MODULE_DEVICE_TABLE(hid, sjoy_devices);
drivers/hid/hid-uclogic.c +27 -0
index fb8b516ff0ed..22dccce6a85c 100644
@@ -626,6 +626,32 @@ static __u8 *uclogic_report_fixup(struct hid_device *hdev, __u8 *rdesc,
 	return rdesc;
 }
 
+static int uclogic_probe(struct hid_device *hdev,
+		const struct hid_device_id *id)
+{
+	int rc;
+
+	/*
+	 * libinput requires the pad interface to be on a different node
+	 * than the pen, so use QUIRK_MULTI_INPUT for all tablets.
+	 */
+	hdev->quirks |= HID_QUIRK_MULTI_INPUT;
+
+	rc = hid_parse(hdev);
+	if (rc) {
+		hid_err(hdev, "parse failed\n");
+		return rc;
+	}
+
+	rc = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
+	if (rc) {
+		hid_err(hdev, "hw start failed\n");
+		return rc;
+	}
+
+	return 0;
+}
+
 static const struct hid_device_id uclogic_devices[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC,
 				USB_DEVICE_ID_UCLOGIC_TABLET_PF1209) },
@@ -648,6 +674,7 @@ MODULE_DEVICE_TABLE(hid, uclogic_devices);
 static struct hid_driver uclogic_driver = {
 	.name = "uclogic",
 	.id_table = uclogic_devices,
+	.probe = uclogic_probe,
 	.report_fixup = uclogic_report_fixup,
 };
 module_hid_driver(uclogic_driver);
drivers/hid/usbhid/hid-quirks.c +49 -14

128 lines not on this page · raw message

drivers/i2c/busses/i2c-imx.c +2 -2
index aa8bc146718b..494a9e7e88c4 100644
@@ -542,9 +542,9 @@ static int i2c_imx_read(struct imx_i2c_struct *i2c_imx, struct i2c_msg *msgs, bo
 				 * the first read operation, otherwise the first read cost
 				 * one extra clock cycle.
 				 */
-				temp = readb(i2c_imx->base + IMX_I2C_I2CR);
+				temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2CR);
 				temp |= I2CR_MTX;
-				writeb(temp, i2c_imx->base + IMX_I2C_I2CR);
+				imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2CR);
 			}
 		} else if (i == (msgs->len - 2)) {
 			dev_dbg(&i2c_imx->adapter.dev,
drivers/i2c/busses/i2c-ismt.c +1 -1
index d9ee43c80cde..eb3ba56e90b1 100644
@@ -586,7 +586,7 @@ static int ismt_access(struct i2c_adapter *adap, u16 addr,
 
 	/* unmap the data buffer */
 	if (dma_size != 0)
-		dma_unmap_single(&adap->dev, dma_addr, dma_size, dma_direction);
+		dma_unmap_single(dev, dma_addr, dma_size, dma_direction);
 
 	if (unlikely(!ret)) {
 		dev_err(dev, "completion wait timed out\n");
drivers/i2c/busses/i2c-tiny-usb.c +21 -4
index 0ed77eeff31e..a2e3dd715380 100644
@@ -178,22 +178,39 @@ static int usb_read(struct i2c_adapter *adapter, int cmd,
 		    int value, int index, void *data, int len)
 {
 	struct i2c_tiny_usb *dev = (struct i2c_tiny_usb *)adapter->algo_data;
+	void *dmadata = kmalloc(len, GFP_KERNEL);
+	int ret;
+
+	if (!dmadata)
+		return -ENOMEM;
 
 	/* do control transfer */
-	return usb_control_msg(dev->usb_dev, usb_rcvctrlpipe(dev->usb_dev, 0),
+	ret = usb_control_msg(dev->usb_dev, usb_rcvctrlpipe(dev->usb_dev, 0),
 			       cmd, USB_TYPE_VENDOR | USB_RECIP_INTERFACE |
-			       USB_DIR_IN, value, index, data, len, 2000);
+			       USB_DIR_IN, value, index, dmadata, len, 2000);
+
+	memcpy(data, dmadata, len);
+	kfree(dmadata);
+	return ret;
 }
 
 static int usb_write(struct i2c_adapter *adapter, int cmd,
 		     int value, int index, void *data, int len)
 {
 	struct i2c_tiny_usb *dev = (struct i2c_tiny_usb *)adapter->algo_data;
+	void *dmadata = kmemdup(data, len, GFP_KERNEL);
+	int ret;
+
+	if (!dmadata)
+		return -ENOMEM;
 
 	/* do control transfer */
-	return usb_control_msg(dev->usb_dev, usb_sndctrlpipe(dev->usb_dev, 0),
+	ret = usb_control_msg(dev->usb_dev, usb_sndctrlpipe(dev->usb_dev, 0),
 			       cmd, USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
-			       value, index, data, len, 2000);
+			       value, index, dmadata, len, 2000);
+
+	kfree(dmadata);
+	return ret;
 }
 
 static void i2c_tiny_usb_free(struct i2c_tiny_usb *dev)
drivers/iio/proximity/as3935.c +6 -8
index a6370a4d6705..54a115c23b06 100644
@@ -40,9 +40,9 @@
 #define AS3935_AFE_PWR_BIT	BIT(0)
 
 #define AS3935_INT		0x03
-#define AS3935_INT_MASK		0x07
+#define AS3935_INT_MASK		0x0f
 #define AS3935_EVENT_INT	BIT(3)
-#define AS3935_NOISE_INT	BIT(1)
+#define AS3935_NOISE_INT	BIT(0)
 
 #define AS3935_DATA		0x07
 #define AS3935_DATA_MASK	0x3F
@@ -215,7 +215,7 @@ static irqreturn_t as3935_trigger_handler(int irq, void *private)
 
 	st->buffer[0] = val & AS3935_DATA_MASK;
 	iio_push_to_buffers_with_timestamp(indio_dev, &st->buffer,
-					   pf->timestamp);
+					   iio_get_time_ns());
 err_read:
 	iio_trigger_notify_done(indio_dev->trig);
 
@@ -238,7 +238,7 @@ static void as3935_event_work(struct work_struct *work)
 
 	switch (val) {
 	case AS3935_EVENT_INT:
-		iio_trigger_poll(st->trig, iio_get_time_ns());
+		iio_trigger_poll_chained(st->trig, iio_get_time_ns());
 		break;
 	case AS3935_NOISE_INT:
 		dev_warn(&st->spi->dev, "noise level is too high");
@@ -263,8 +263,6 @@ static irqreturn_t as3935_interrupt_handler(int irq, void *private)
 
 static void calibrate_as3935(struct as3935_state *st)
 {
-	mutex_lock(&st->lock);
-
 	/* mask disturber interrupt bit */
 	as3935_write(st, AS3935_INT, BIT(5));
 
@@ -274,8 +272,6 @@ static void calibrate_as3935(struct as3935_state *st)
 
 	mdelay(2);
 	as3935_write(st, AS3935_TUNE_CAP, (st->tune_cap / TUNE_CAP_DIV));
-
-	mutex_unlock(&st->lock);
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -312,6 +308,8 @@ static int as3935_resume(struct spi_device *spi)
 	val &= ~AS3935_AFE_PWR_BIT;
 	ret = as3935_write(st, AS3935_AFE_GAIN, val);
 
+	calibrate_as3935(st);
+
 err_resume:
 	mutex_unlock(&st->lock);
 
drivers/infiniband/ulp/ipoib/ipoib_vlan.c +4 -3
index 4c83a970e7f3..946a1cceffd9 100644
@@ -133,13 +133,14 @@ int ipoib_vlan_add(struct net_device *pdev, unsigned short pkey)
 
 	snprintf(intf_name, sizeof intf_name, "%s.%04x",
 		 ppriv->dev->name, pkey);
-	priv = ipoib_intf_alloc(intf_name);
-	if (!priv)
-		return -ENOMEM;
 
 	if (!rtnl_trylock())
 		return restart_syscall();
 
+	priv = ipoib_intf_alloc(intf_name);
+	if (!priv)
+		return -ENOMEM;
+
 	down_write(&ppriv->vlan_rwsem);
 
 	/*
drivers/input/mouse/elantech.c +16 -0
index 577ea8f3cd0f..d46519778726 100644
@@ -1036,8 +1036,10 @@ static int elantech_get_resolution_v4(struct psmouse *psmouse,
  * Asus UX32VD             0x361f02        00, 15, 0e      clickpad
  * Avatar AVIU-145A2       0x361f00        ?               clickpad
  * Fujitsu LIFEBOOK E544   0x470f00        d0, 12, 09      2 hw buttons
+ * Fujitsu LIFEBOOK E546   0x470f00        50, 12, 09      2 hw buttons
  * Fujitsu LIFEBOOK E547   0x470f00        50, 12, 09      2 hw buttons
  * Fujitsu LIFEBOOK E554   0x570f01        40, 14, 0c      2 hw buttons
+ * Fujitsu LIFEBOOK E557   0x570f01        40, 14, 0c      2 hw buttons
  * Gigabyte U2442          0x450f01        58, 17, 0c      2 hw buttons
  * Lenovo L430             0x350f02        b9, 15, 0c      2 hw buttons (*)
  * Samsung NF210           0x150b00        78, 14, 0a      2 hw buttons
@@ -1396,6 +1398,13 @@ static const struct dmi_system_id elantech_dmi_force_crc_enabled[] = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E544"),
 		},
 	},
+	{
+		/* Fujitsu LIFEBOOK E546  does not work with crc_enabled == 0 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E546"),
+		},
+	},
 	{
 		/* Fujitsu LIFEBOOK E547 does not work with crc_enabled == 0 */
 		.matches = {
@@ -1417,6 +1426,13 @@ static const struct dmi_system_id elantech_dmi_force_crc_enabled[] = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E556"),
 		},
 	},
+	{
+		/* Fujitsu LIFEBOOK E557 does not work with crc_enabled == 0 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E557"),
+		},
+	},
 	{
 		/* Fujitsu LIFEBOOK U745 does not work with crc_enabled == 0 */
 		.matches = {
drivers/input/serio/i8042-x86ia64io.h +7 -0
index 04a2593f0a9a..fda2742f01e6 100644
@@ -687,6 +687,13 @@ static const struct dmi_system_id __initconst i8042_dmi_notimeout_table[] = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U574"),
 		},
 	},
+	{
+		/* Fujitsu UH554 laptop */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK UH544"),
+		},
+	},
 	{ }
 };
 
drivers/md/dm-thin-metadata.c +2 -2
index 7768de60f699..0f9d9bcc91ed 100644
@@ -484,11 +484,11 @@ static int __write_initial_superblock(struct dm_pool_metadata *pmd)
 	if (r < 0)
 		return r;
 
-	r = save_sm_roots(pmd);
+	r = dm_tm_pre_commit(pmd->tm);
 	if (r < 0)
 		return r;
 
-	r = dm_tm_pre_commit(pmd->tm);
+	r = save_sm_roots(pmd);
 	if (r < 0)
 		return r;
 
drivers/md/persistent-data/dm-space-map-disk.c +14 -1
index cfbf9617e465..8d0a6a23438b 100644
@@ -140,10 +140,23 @@ static int sm_disk_inc_block(struct dm_space_map *sm, dm_block_t b)
 
 static int sm_disk_dec_block(struct dm_space_map *sm, dm_block_t b)
 {
+	int r;
+	uint32_t old_count;
 	enum allocation_event ev;
 	struct sm_disk *smd = container_of(sm, struct sm_disk, sm);
 
-	return sm_ll_dec(&smd->ll, b, &ev);
+	r = sm_ll_dec(&smd->ll, b, &ev);
+	if (!r && (ev == SM_FREE)) {
+		/*
+		 * It's only free if it's also free in the last
+		 * transaction.
+		 */
+		r = sm_ll_lookup(&smd->old_ll, b, &old_count);
+		if (!r && !old_count)
+			smd->nr_allocated_this_transaction--;
+	}
+
+	return r;
 }
 
 static int sm_disk_new_block(struct dm_space_map *sm, dm_block_t *b)
drivers/media/rc/ir-raw.c +8 -5
index 763c9d131d0f..802399f23320 100644
@@ -220,7 +220,7 @@ void ir_raw_event_handle(struct rc_dev *dev)
 {
 	unsigned long flags;
 
-	if (!dev->raw)
+	if (!dev->raw || !dev->raw->thread)
 		return;
 
 	spin_lock_irqsave(&dev->raw->lock, flags);
@@ -247,6 +247,7 @@ int ir_raw_event_register(struct rc_dev *dev)
 {
 	int rc;
 	struct ir_raw_handler *handler;
+	struct task_struct *thread;
 
 	if (!dev)
 		return -EINVAL;
@@ -264,14 +265,16 @@ int ir_raw_event_register(struct rc_dev *dev)
 		goto out;
 
 	spin_lock_init(&dev->raw->lock);
-	dev->raw->thread = kthread_run(ir_raw_event_thread, dev->raw,
-				       "rc%ld", dev->devno);
+	thread = kthread_run(ir_raw_event_thread, dev->raw, "rc%ld",
+			     dev->devno);
 
-	if (IS_ERR(dev->raw->thread)) {
-		rc = PTR_ERR(dev->raw->thread);
+	if (IS_ERR(thread)) {
+		rc = PTR_ERR(thread);
 		goto out;
 	}
 
+	dev->raw->thread = thread;
+
 	mutex_lock(&ir_raw_handler_lock);
 	list_add_tail(&dev->raw->list, &ir_raw_client_list);
 	list_for_each_entry(handler, &ir_raw_handler_list, list)
drivers/media/v4l2-core/videobuf2-core.c +1 -1
index b9098be9164d..e63a7904bf5b 100644
@@ -1107,7 +1107,7 @@ EXPORT_SYMBOL_GPL(vb2_create_bufs);
  */
 void *vb2_plane_vaddr(struct vb2_buffer *vb, unsigned int plane_no)
 {
-	if (plane_no > vb->num_planes || !vb->planes[plane_no].mem_priv)
+	if (plane_no >= vb->num_planes || !vb->planes[plane_no].mem_priv)
 		return NULL;
 
 	return call_ptr_memop(vb, vaddr, vb->planes[plane_no].mem_priv);
drivers/net/can/usb/gs_usb.c +2 -0
index 047b63caa3b7..b16c5a2d92fb 100644
@@ -246,6 +246,8 @@ static int gs_cmd_reset(struct gs_usb *gsusb, struct gs_can *gsdev)
 			     sizeof(*dm),
 			     1000);
 
+	kfree(dm);
+
 	return rc;
 }
 
drivers/net/ethernet/8390/ax88796.c +2 -5
index 1d162ccb4733..07674ed398aa 100644
@@ -786,13 +786,13 @@ static int ax_init_dev(struct net_device *dev)
 
 	ret = ax_mii_init(dev);
 	if (ret)
-		goto out_irq;
+		goto err_out;
 
 	ax_NS8390_init(dev, 0);
 
 	ret = register_netdev(dev);
 	if (ret)
-		goto out_irq;
+		goto err_out;
 
 	netdev_info(dev, "%dbit, irq %d, %lx, MAC: %pM\n",
 		    ei_local->word16 ? 16 : 8, dev->irq, dev->base_addr,
@@ -800,9 +800,6 @@ static int ax_init_dev(struct net_device *dev)
 
 	return 0;
 
- out_irq:
-	/* cleanup irq */
-	free_irq(dev->irq, dev);
  err_out:
 	return ret;
 }
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +1 -1
index 343511988683..09f6325d13c3 100644
@@ -1914,7 +1914,7 @@ u16 bnx2x_select_queue(struct net_device *dev, struct sk_buff *skb,
 	}
 
 	/* select a non-FCoE queue */
-	return fallback(dev, skb) % BNX2X_NUM_ETH_QUEUES(bp);
+	return fallback(dev, skb) % (BNX2X_NUM_ETH_QUEUES(bp) * bp->max_cos);
 }
 
 void bnx2x_set_num_queues(struct bnx2x *bp)
drivers/net/ethernet/ethoc.c +2 -1
index 00d0a05b9d7f..cbf74e370f67 100644
@@ -706,6 +706,8 @@ static int ethoc_open(struct net_device *dev)
 	if (ret)
 		return ret;
 
+	napi_enable(&priv->napi);
+
 	ethoc_init_ring(priv, dev->mem_start);
 	ethoc_reset(priv);
 
@@ -718,7 +720,6 @@ static int ethoc_open(struct net_device *dev)
 	}
 
 	phy_start(priv->phy);
-	napi_enable(&priv->napi);
 
 	if (netif_msg_ifup(priv)) {
 		dev_info(&dev->dev, "I/O: %08lx Memory: %08lx-%08lx\n",
drivers/net/ethernet/ibm/emac/core.c +22 -4
index 87bd953cc2ee..41ce1aafcc1c 100644
@@ -349,6 +349,7 @@ static int emac_reset(struct emac_instance *dev)
 {
 	struct emac_regs __iomem *p = dev->emacp;
 	int n = 20;
+	bool __maybe_unused try_internal_clock = false;
 
 	DBG(dev, "reset" NL);
 
@@ -361,6 +362,7 @@ static int emac_reset(struct emac_instance *dev)
 	}
 
 #ifdef CONFIG_PPC_DCR_NATIVE
+do_retry:
 	/*
 	 * PPC460EX/GT Embedded Processor Advanced User's Manual
 	 * section 28.10.1 Mode Register 0 (EMACx_MR0) states:
@@ -368,10 +370,19 @@ static int emac_reset(struct emac_instance *dev)
 	 * of the EMAC. If none is present, select the internal clock
 	 * (SDR0_ETH_CFG[EMACx_PHY_CLK] = 1).
 	 * After a soft reset, select the external clock.
+	 *
+	 * The AR8035-A PHY Meraki MR24 does not provide a TX Clk if the
+	 * ethernet cable is not attached. This causes the reset to timeout
+	 * and the PHY detection code in emac_init_phy() is unable to
+	 * communicate and detect the AR8035-A PHY. As a result, the emac
+	 * driver bails out early and the user has no ethernet.
+	 * In order to stay compatible with existing configurations, the
+	 * driver will temporarily switch to the internal clock, after
+	 * the first reset fails.
 	 */
 	if (emac_has_feature(dev, EMAC_FTR_460EX_PHY_CLK_FIX)) {
-		if (dev->phy_address == 0xffffffff &&
-		    dev->phy_map == 0xffffffff) {
+		if (try_internal_clock || (dev->phy_address == 0xffffffff &&
+					   dev->phy_map == 0xffffffff)) {
 			/* No PHY: select internal loop clock before reset */
 			dcri_clrset(SDR0, SDR0_ETH_CFG,
 				    0, SDR0_ETH_CFG_ECS << dev->cell_index);
@@ -389,8 +400,15 @@ static int emac_reset(struct emac_instance *dev)
 
 #ifdef CONFIG_PPC_DCR_NATIVE
 	if (emac_has_feature(dev, EMAC_FTR_460EX_PHY_CLK_FIX)) {
-		if (dev->phy_address == 0xffffffff &&
-		    dev->phy_map == 0xffffffff) {
+		if (!n && !try_internal_clock) {
+			/* first attempt has timed out. */
+			n = 20;
+			try_internal_clock = true;
+			goto do_retry;
+		}
+
+		if (try_internal_clock || (dev->phy_address == 0xffffffff &&
+					   dev->phy_map == 0xffffffff)) {
 			/* No PHY: restore external clock source after reset */
 			dcri_clrset(SDR0, SDR0_ETH_CFG,
 				    SDR0_ETH_CFG_ECS << dev->cell_index, 0);
drivers/net/ethernet/qlogic/netxen/netxen_nic_ctx.c +1 -1
index 6f6be57f4690..d02ed21bff16 100644
@@ -249,7 +249,7 @@ nx_fw_cmd_set_mtu(struct netxen_adapter *adapter, int mtu)
 	cmd.req.arg3 = 0;
 
 	if (recv_ctx->state == NX_HOST_CTX_STATE_ACTIVE)
-		netxen_issue_cmd(adapter, &cmd);
+		rcode = netxen_issue_cmd(adapter, &cmd);
 
 	if (rcode != NX_RCODE_SUCCESS)
 		return -EIO;
drivers/net/ethernet/renesas/sh_eth.c +1 -1
index 9a03bfd51397..f1f3858f4d37 100644
@@ -2897,7 +2897,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
 	/* MDIO bus init */
 	ret = sh_mdio_init(mdp, pd);
 	if (ret) {
-		dev_err(&ndev->dev, "failed to initialise MDIO\n");
+		dev_err(&pdev->dev, "failed to initialise MDIO\n");
 		goto out_release;
 	}
 
drivers/net/irda/irda-usb.c +1 -1
index 925b78cc9797..f82463a6e1c2 100644
@@ -1082,7 +1082,7 @@ static int stir421x_patch_device(struct irda_usb_cb *self)
          * are "42101001.sb" or "42101002.sb"
          */
         sprintf(stir421x_fw_name, "4210%4X.sb",
-                self->usbdev->descriptor.bcdDevice);
+		le16_to_cpu(self->usbdev->descriptor.bcdDevice));
         ret = request_firmware(&fw, stir421x_fw_name, &self->usbdev->dev);
         if (ret < 0)
                 return ret;
drivers/net/phy/dp83640.c +1 -1
index 4c8eb5721d4d..da61c3161071 100644
@@ -802,7 +802,7 @@ static void decode_txts(struct dp83640_private *dp83640,
 	if (overflow) {
 		pr_debug("tx timestamp queue overflow, count %d\n", overflow);
 		while (skb) {
-			skb_complete_tx_timestamp(skb, NULL);
+			kfree_skb(skb);
 			skb = skb_dequeue(&dp83640->tx_queue);
 		}
 		return;
drivers/net/phy/marvell.c +37 -31

92 lines not on this page · raw message

drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +5 -0
index 9e6502a9648c..1d6ff00a4194 100644
@@ -4119,6 +4119,11 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
 		cfg80211_mgmt_tx_status(wdev, *cookie, buf, len, true,
 					GFP_KERNEL);
 	} else if (ieee80211_is_action(mgmt->frame_control)) {
+		if (len > BRCMF_FIL_ACTION_FRAME_SIZE + DOT11_MGMT_HDR_LEN) {
+			brcmf_err("invalid action frame length\n");
+			err = -EINVAL;
+			goto exit;
+		}
 		af_params = kzalloc(sizeof(*af_params), GFP_KERNEL);
 		if (af_params == NULL) {
 			brcmf_err("unable to allocate frame\n");
drivers/of/fdt.c +3 -0
index 24ad55129194..ff01ee27130d 100644
@@ -380,6 +380,9 @@ static void __unflatten_device_tree(void *blob,
 
 	/* Allocate memory for the expanded device tree */
 	mem = dt_alloc(size + 4, __alignof__(struct device_node));
+	if (!mem)
+		return NULL;
+
 	memset(mem, 0, size);
 
 	*(__be32 *)(mem + size) = cpu_to_be32(0xdeadbeef);
drivers/pinctrl/pinctrl-mxs.c +12 -4
index 40c76f26998c..5a556c436453 100644
@@ -195,6 +195,16 @@ static int mxs_pinctrl_get_func_groups(struct pinctrl_dev *pctldev,
 	return 0;
 }
 
+static void mxs_pinctrl_rmwl(u32 value, u32 mask, u8 shift, void __iomem *reg)
+{
+	u32 tmp;
+
+	tmp = readl(reg);
+	tmp &= ~(mask << shift);
+	tmp |= value << shift;
+	writel(tmp, reg);
+}
+
 static int mxs_pinctrl_enable(struct pinctrl_dev *pctldev, unsigned selector,
 			      unsigned group)
 {
@@ -212,8 +222,7 @@ static int mxs_pinctrl_enable(struct pinctrl_dev *pctldev, unsigned selector,
 		reg += bank * 0x20 + pin / 16 * 0x10;
 		shift = pin % 16 * 2;
 
-		writel(0x3 << shift, reg + CLR);
-		writel(g->muxsel[i] << shift, reg + SET);
+		mxs_pinctrl_rmwl(g->muxsel[i], 0x3, shift, reg);
 	}
 
 	return 0;
@@ -280,8 +289,7 @@ static int mxs_pinconf_group_set(struct pinctrl_dev *pctldev,
 			/* mA */
 			if (config & MA_PRESENT) {
 				shift = pin % 8 * 4;
-				writel(0x3 << shift, reg + CLR);
-				writel(ma << shift, reg + SET);
+				mxs_pinctrl_rmwl(ma, 0x3, shift, reg);
 			}
 
 			/* vol */
drivers/powercap/powercap_sys.c +1 -0
index 84419af16f77..fd12ccc11e26 100644
@@ -538,6 +538,7 @@ struct powercap_zone *powercap_register_zone(
 
 	power_zone->id = result;
 	idr_init(&power_zone->idr);
+	result = -ENOMEM;
 	power_zone->name = kstrdup(name, GFP_KERNEL);
 	if (!power_zone->name)
 		goto err_name_alloc;
drivers/s390/net/qeth_core.h +4 -0
index a2088af51cc5..8100396ba1b4 100644
@@ -722,6 +722,7 @@ enum qeth_discipline_id {
 };
 
 struct qeth_discipline {
+	const struct device_type *devtype;
 	void (*start_poll)(struct ccw_device *, int, unsigned long);
 	qdio_handler_t *input_handler;
 	qdio_handler_t *output_handler;
@@ -882,6 +883,9 @@ extern struct qeth_discipline qeth_l2_discipline;
 extern struct qeth_discipline qeth_l3_discipline;
 extern const struct attribute_group *qeth_generic_attr_groups[];
 extern const struct attribute_group *qeth_osn_attr_groups[];
+extern const struct attribute_group qeth_device_attr_group;
+extern const struct attribute_group qeth_device_blkt_group;
+extern const struct device_type qeth_generic_devtype;
 extern struct workqueue_struct *qeth_wq;
 
 const char *qeth_get_cardname_short(struct qeth_card *);
drivers/s390/net/qeth_core_main.c +12 -9
index f54bec54d677..7fc3922dd54c 100644
@@ -5225,10 +5225,12 @@ void qeth_core_free_discipline(struct qeth_card *card)
 	card->discipline = NULL;
 }
 
-static const struct device_type qeth_generic_devtype = {
+const struct device_type qeth_generic_devtype = {
 	.name = "qeth_generic",
 	.groups = qeth_generic_attr_groups,
 };
+EXPORT_SYMBOL_GPL(qeth_generic_devtype);
+
 static const struct device_type qeth_osn_devtype = {
 	.name = "qeth_osn",
 	.groups = qeth_osn_attr_groups,
@@ -5354,23 +5356,22 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev)
 		goto err_card;
 	}
 
-	if (card->info.type == QETH_CARD_TYPE_OSN)
-		gdev->dev.type = &qeth_osn_devtype;
-	else
-		gdev->dev.type = &qeth_generic_devtype;
-
 	switch (card->info.type) {
 	case QETH_CARD_TYPE_OSN:
 	case QETH_CARD_TYPE_OSM:
 		rc = qeth_core_load_discipline(card, QETH_DISCIPLINE_LAYER2);
 		if (rc)
 			goto err_card;
+
+		gdev->dev.type = (card->info.type != QETH_CARD_TYPE_OSN)
+					? card->discipline->devtype
+					: &qeth_osn_devtype;
 		rc = card->discipline->setup(card->gdev);
 		if (rc)
 			goto err_disc;
-	case QETH_CARD_TYPE_OSD:
-	case QETH_CARD_TYPE_OSX:
+		break;
 	default:
+		gdev->dev.type = &qeth_generic_devtype;
 		break;
 	}
 
@@ -5426,8 +5427,10 @@ static int qeth_core_set_online(struct ccwgroup_device *gdev)
 		if (rc)
 			goto err;
 		rc = card->discipline->setup(card->gdev);
-		if (rc)
+		if (rc) {
+			qeth_core_free_discipline(card);
 			goto err;
+		}
 	}
 	rc = card->discipline->set_online(gdev);
 err:
drivers/s390/net/qeth_core_sys.c +16 -8
index 8a25a2be9890..e7e0a4fadb37 100644
@@ -446,12 +446,16 @@ static ssize_t qeth_dev_layer2_store(struct device *dev,
 
 	if (card->options.layer2 == newdis)
 		goto out;
-	else {
-		card->info.mac_bits  = 0;
-		if (card->discipline) {
-			card->discipline->remove(card->gdev);
-			qeth_core_free_discipline(card);
-		}
+	if (card->info.type == QETH_CARD_TYPE_OSM) {
+		/* fixed layer, can't switch */
+		rc = -EOPNOTSUPP;
+		goto out;
+	}
+
+	card->info.mac_bits = 0;
+	if (card->discipline) {
+		card->discipline->remove(card->gdev);
+		qeth_core_free_discipline(card);
 	}
 
 	rc = qeth_core_load_discipline(card, newdis);
@@ -459,6 +463,8 @@ static ssize_t qeth_dev_layer2_store(struct device *dev,
 		goto out;
 
 	rc = card->discipline->setup(card->gdev);
+	if (rc)
+		qeth_core_free_discipline(card);
 out:
 	mutex_unlock(&card->discipline_mutex);
 	return rc ? rc : count;
@@ -708,10 +714,11 @@ static struct attribute *qeth_blkt_device_attrs[] = {
 	&dev_attr_inter_jumbo.attr,
 	NULL,
 };
-static struct attribute_group qeth_device_blkt_group = {
+const struct attribute_group qeth_device_blkt_group = {
 	.name = "blkt",
 	.attrs = qeth_blkt_device_attrs,
 };
+EXPORT_SYMBOL_GPL(qeth_device_blkt_group);
 
 static struct attribute *qeth_device_attrs[] = {
 	&dev_attr_state.attr,
@@ -730,9 +737,10 @@ static struct attribute *qeth_device_attrs[] = {
 	&dev_attr_hw_trap.attr,
 	NULL,
 };
-static struct attribute_group qeth_device_attr_group = {
+const struct attribute_group qeth_device_attr_group = {
 	.attrs = qeth_device_attrs,
 };
+EXPORT_SYMBOL_GPL(qeth_device_attr_group);
 
 const struct attribute_group *qeth_generic_attr_groups[] = {
 	&qeth_device_attr_group,
drivers/s390/net/qeth_l2.h +2 -0
index 0767556404bd..eb87bf97d38a 100644
@@ -8,6 +8,8 @@
 
 #include "qeth_core.h"
 
+extern const struct attribute_group *qeth_l2_attr_groups[];
+
 int qeth_l2_create_device_attributes(struct device *);
 void qeth_l2_remove_device_attributes(struct device *);
 void qeth_l2_setup_bridgeport_attrs(struct qeth_card *card);
drivers/s390/net/qeth_l2_main.c +14 -2
index c75bddfaa837..ccc71ab92fe6 100644
@@ -887,11 +887,21 @@ static int qeth_l2_stop(struct net_device *dev)
 	return 0;
 }
 
+static const struct device_type qeth_l2_devtype = {
+	.name = "qeth_layer2",
+	.groups = qeth_l2_attr_groups,
+};
+
 static int qeth_l2_probe_device(struct ccwgroup_device *gdev)
 {
 	struct qeth_card *card = dev_get_drvdata(&gdev->dev);
+	int rc;
 
-	qeth_l2_create_device_attributes(&gdev->dev);
+	if (gdev->dev.type == &qeth_generic_devtype) {
+		rc = qeth_l2_create_device_attributes(&gdev->dev);
+		if (rc)
+			return rc;
+	}
 	INIT_LIST_HEAD(&card->vid_list);
 	INIT_LIST_HEAD(&card->mc_list);
 	card->options.layer2 = 1;
@@ -903,7 +913,8 @@ static void qeth_l2_remove_device(struct ccwgroup_device *cgdev)
 {
 	struct qeth_card *card = dev_get_drvdata(&cgdev->dev);
 
-	qeth_l2_remove_device_attributes(&cgdev->dev);
+	if (cgdev->dev.type == &qeth_generic_devtype)
+		qeth_l2_remove_device_attributes(&cgdev->dev);
 	qeth_set_allowed_threads(card, 0, 1);
 	wait_event(card->wait_q, qeth_threads_running(card, 0xffffffff) == 0);
 
@@ -1272,6 +1283,7 @@ static int qeth_l2_control_event(struct qeth_card *card,
 }
 
 struct qeth_discipline qeth_l2_discipline = {
+	.devtype = &qeth_l2_devtype,
 	.start_poll = qeth_qdio_start_poll,
 	.input_handler = (qdio_handler_t *) qeth_qdio_input_handler,
 	.output_handler = (qdio_handler_t *) qeth_qdio_output_handler,
drivers/s390/net/qeth_l2_sys.c +8 -0
index ae1bc04b8653..6989aabec7cd 100644
@@ -221,3 +221,11 @@ void qeth_l2_setup_bridgeport_attrs(struct qeth_card *card)
 	} else
 		qeth_bridgeport_an_set(card, 0);
 }
+
+const struct attribute_group *qeth_l2_attr_groups[] = {
+	&qeth_device_attr_group,
+	&qeth_device_blkt_group,
+	/* l2 specific, see l2_{create,remove}_device_attributes(): */
+	&qeth_l2_bridgeport_attr_group,
+	NULL,
+};
drivers/s390/net/qeth_l3_main.c +5 -1
index 3e5ba1ac9e2a..8de493a18d9e 100644
@@ -3317,8 +3317,11 @@ static int qeth_l3_setup_netdev(struct qeth_card *card)
 static int qeth_l3_probe_device(struct ccwgroup_device *gdev)
 {
 	struct qeth_card *card = dev_get_drvdata(&gdev->dev);
+	int rc;
 
-	qeth_l3_create_device_attributes(&gdev->dev);
+	rc = qeth_l3_create_device_attributes(&gdev->dev);
+	if (rc)
+		return rc;
 	card->options.layer2 = 0;
 	card->info.hwtrap = 0;
 	return 0;
@@ -3609,6 +3612,7 @@ static int qeth_l3_control_event(struct qeth_card *card,
 }
 
 struct qeth_discipline qeth_l3_discipline = {
+	.devtype = &qeth_generic_devtype,
 	.start_poll = qeth_qdio_start_poll,
 	.input_handler = (qdio_handler_t *) qeth_qdio_input_handler,
 	.output_handler = (qdio_handler_t *) qeth_qdio_output_handler,
drivers/scsi/qla2xxx/qla_os.c +4 -4
index c770ef886dc2..7d81adf80359 100644
@@ -2362,10 +2362,10 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 
 	if (mem_only) {
 		if (pci_enable_device_mem(pdev))
-			goto probe_out;
+			return ret;
 	} else {
 		if (pci_enable_device(pdev))
-			goto probe_out;
+			return ret;
 	}
 
 	/* This may fail but that's ok */
@@ -2375,7 +2375,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 	if (!ha) {
 		ql_log_pci(ql_log_fatal, pdev, 0x0009,
 		    "Unable to allocate memory for ha.\n");
-		goto probe_out;
+		goto disable_device;
 	}
 	ql_dbg_pci(ql_dbg_init, pdev, 0x000a,
 	    "Memory allocated for ha=%p.\n", ha);
@@ -2972,7 +2972,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 	kfree(ha);
 	ha = NULL;
 
-probe_out:
+disable_device:
 	pci_disable_device(pdev);
 	return ret;
 }
drivers/staging/lustre/lustre/lov/lov_pack.c +0 -9
index 59ab7c30ffbf..d8638012f63a 100644
@@ -592,18 +592,10 @@ int lov_getstripe(struct obd_export *exp, struct lov_stripe_md *lsm,
 	struct lov_mds_md *lmmk = NULL;
 	int rc, lmm_size;
 	int lum_size;
-	mm_segment_t seg;
 
 	if (!lsm)
 		return -ENODATA;
 
-	/*
-	 * "Switch to kernel segment" to allow copying from kernel space by
-	 * copy_{to,from}_user().
-	 */
-	seg = get_fs();
-	set_fs(KERNEL_DS);
-
 	/* we only need the header part from user space to get lmm_magic and
 	 * lmm_stripe_count, (the header part is common to v1 and v3) */
 	lum_size = sizeof(struct lov_user_md_v1);
@@ -672,6 +664,5 @@ int lov_getstripe(struct obd_export *exp, struct lov_stripe_md *lsm,
 
 	obd_free_diskmd(exp, &lmmk);
 out_set:
-	set_fs(seg);
 	return rc;
 }
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +15 -9
index 4a35f9b5602d..a81ca60c4a9d 100644
@@ -100,8 +100,9 @@ void rtl8192e_SetHwReg(struct net_device *dev, u8 variable, u8 *val)
 
 	switch (variable) {
 	case HW_VAR_BSSID:
-		write_nic_dword(dev, BSSIDR, ((u32 *)(val))[0]);
-		write_nic_word(dev, BSSIDR+2, ((u16 *)(val+2))[0]);
+		/* BSSIDR 2 byte alignment */
+		write_nic_word(dev, BSSIDR, *(u16 *)val);
+		write_nic_dword(dev, BSSIDR + 2, *(u32 *)(val + 2));
 		break;
 
 	case HW_VAR_MEDIA_STATUS:
@@ -627,7 +628,7 @@ void rtl8192_get_eeprom_size(struct net_device *dev)
 	struct r8192_priv *priv = rtllib_priv(dev);
 
 	RT_TRACE(COMP_INIT, "===========>%s()\n", __func__);
-	curCR = read_nic_dword(dev, EPROM_CMD);
+	curCR = read_nic_word(dev, EPROM_CMD);
 	RT_TRACE(COMP_INIT, "read from Reg Cmd9346CR(%x):%x\n", EPROM_CMD,
 		 curCR);
 	priv->epromtype = (curCR & EPROM_CMD_9356SEL) ? EEPROM_93C56 :
@@ -965,8 +966,8 @@ static void rtl8192_net_update(struct net_device *dev)
 	rtl8192_config_rate(dev, &rate_config);
 	priv->dot11CurrentPreambleMode = PREAMBLE_AUTO;
 	 priv->basic_rate = rate_config &= 0x15f;
-	write_nic_dword(dev, BSSIDR, ((u32 *)net->bssid)[0]);
-	write_nic_word(dev, BSSIDR+4, ((u16 *)net->bssid)[2]);
+	write_nic_word(dev, BSSIDR, *(u16 *)net->bssid);
+	write_nic_dword(dev, BSSIDR + 2, *(u32 *)(net->bssid + 2));
 
 	if (priv->rtllib->iw_mode == IW_MODE_ADHOC) {
 		write_nic_word(dev, ATIMWND, 2);
@@ -1172,8 +1173,7 @@ void  rtl8192_tx_fill_desc(struct net_device *dev, struct tx_desc *pdesc,
 			   struct cb_desc *cb_desc, struct sk_buff *skb)
 {
 	struct r8192_priv *priv = rtllib_priv(dev);
-	dma_addr_t mapping = pci_map_single(priv->pdev, skb->data, skb->len,
-			 PCI_DMA_TODEVICE);
+	dma_addr_t mapping;
 	struct tx_fwinfo_8190pci *pTxFwInfo = NULL;
 	pTxFwInfo = (struct tx_fwinfo_8190pci *)skb->data;
 	memset(pTxFwInfo, 0, sizeof(struct tx_fwinfo_8190pci));
@@ -1184,8 +1184,6 @@ void  rtl8192_tx_fill_desc(struct net_device *dev, struct tx_desc *pdesc,
 						pTxFwInfo->TxRate,
 						cb_desc);
 
-	if (pci_dma_mapping_error(priv->pdev, mapping))
-		RT_TRACE(COMP_ERR, "DMA Mapping error\n");
 	if (cb_desc->bAMPDUEnable) {
 		pTxFwInfo->AllowAggregation = 1;
 		pTxFwInfo->RxMF = cb_desc->ampdu_factor;
@@ -1220,6 +1218,14 @@ void  rtl8192_tx_fill_desc(struct net_device *dev, struct tx_desc *pdesc,
 	}
 
 	memset((u8 *)pdesc, 0, 12);
+
+	mapping = pci_map_single(priv->pdev, skb->data, skb->len,
+				 PCI_DMA_TODEVICE);
+	if (pci_dma_mapping_error(priv->pdev, mapping)) {
+		RT_TRACE(COMP_ERR, "DMA Mapping error\n");
+		return;
+	}
+
 	pdesc->LINIP = 0;
 	pdesc->CmdInit = 1;
 	pdesc->Offset = sizeof(struct tx_fwinfo_8190pci) + 8;
drivers/staging/usbip/vhci_hcd.c +8 -3
index 0007d30e45bd..59a4ad61980b 100644
@@ -215,13 +215,18 @@ static int vhci_hub_status(struct usb_hcd *hcd, char *buf)
 
 static inline void hub_descriptor(struct usb_hub_descriptor *desc)
 {
+	int width;
+
 	memset(desc, 0, sizeof(*desc));
 	desc->bDescriptorType = 0x29;
-	desc->bDescLength = 9;
 	desc->wHubCharacteristics = (__constant_cpu_to_le16(0x0001));
+
 	desc->bNbrPorts = VHCI_NPORTS;
-	desc->u.hs.DeviceRemovable[0] = 0xff;
-	desc->u.hs.DeviceRemovable[1] = 0xff;
+	BUILD_BUG_ON(VHCI_NPORTS > USB_MAXCHILDREN);
+	width = desc->bNbrPorts / 8 + 1;
+	desc->bDescLength = USB_DT_HUB_NONVAR_SIZE + 2 * width;
+	memset(&desc->u.hs.DeviceRemovable[0], 0, width);
+	memset(&desc->u.hs.DeviceRemovable[width], 0xff, width);
 }
 
 static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
drivers/target/iscsi/iscsi_target.c +25 -6
index ef9c33fe2617..1a4f09ab3866 100644
@@ -3931,6 +3931,8 @@ int iscsi_target_tx_thread(void *arg)
 {
 	int ret = 0;
 	struct iscsi_conn *conn = arg;
+	bool conn_freed = false;
+
 	/*
 	 * Allow ourselves to be interrupted by SIGINT so that a
 	 * connection recovery / failure event can be triggered externally.
@@ -3956,12 +3958,14 @@ int iscsi_target_tx_thread(void *arg)
 			goto transport_err;
 
 		ret = iscsit_handle_response_queue(conn);
-		if (ret == 1)
+		if (ret == 1) {
 			goto get_immediate;
-		else if (ret == -ECONNRESET)
+		} else if (ret == -ECONNRESET) {
+			conn_freed = true;
 			goto out;
-		else if (ret < 0)
+		} else if (ret < 0) {
 			goto transport_err;
+		}
 	}
 
 transport_err:
@@ -3971,8 +3975,13 @@ int iscsi_target_tx_thread(void *arg)
 	 * responsible for cleaning up the early connection failure.
 	 */
 	if (conn->conn_state != TARG_CONN_STATE_IN_LOGIN)
-		iscsit_take_action_for_connection_exit(conn);
+		iscsit_take_action_for_connection_exit(conn, &conn_freed);
 out:
+	if (!conn_freed) {
+		while (!kthread_should_stop()) {
+			msleep(100);
+		}
+	}
 	return 0;
 }
 
@@ -4073,6 +4082,8 @@ int iscsi_target_rx_thread(void *arg)
 	u32 checksum = 0, digest = 0;
 	struct iscsi_conn *conn = arg;
 	struct kvec iov;
+	bool conn_freed = false;
+
 	/*
 	 * Allow ourselves to be interrupted by SIGINT so that a
 	 * connection recovery / failure event can be triggered externally.
@@ -4084,7 +4095,7 @@ int iscsi_target_rx_thread(void *arg)
 	 */
 	rc = wait_for_completion_interruptible(&conn->rx_login_comp);
 	if (rc < 0 || iscsi_target_check_conn_state(conn))
-		return 0;
+		goto out;
 
 	if (conn->conn_transport->transport_type == ISCSI_INFINIBAND) {
 		struct completion comp;
@@ -4169,7 +4180,15 @@ int iscsi_target_rx_thread(void *arg)
 transport_err:
 	if (!signal_pending(current))
 		atomic_set(&conn->transport_failed, 1);
-	iscsit_take_action_for_connection_exit(conn);
+	iscsit_take_action_for_connection_exit(conn, &conn_freed);
+
+out:
+	if (!conn_freed) {
+		while (!kthread_should_stop()) {
+			msleep(100);
+		}
+	}
+
 	return 0;
 }
 
drivers/target/iscsi/iscsi_target_core.h +1 -0
index 62eb11329c71..1863de28ce46 100644
@@ -562,6 +562,7 @@ struct iscsi_conn {
 #define LOGIN_FLAGS_READ_ACTIVE		1
 #define LOGIN_FLAGS_CLOSED		2
 #define LOGIN_FLAGS_READY		4
+#define LOGIN_FLAGS_INITIAL_PDU		8
 	unsigned long		login_flags;
 	struct delayed_work	login_work;
 	struct delayed_work	login_cleanup_work;
drivers/target/iscsi/iscsi_target_erl0.c +5 -1
index 7396d90d96b2..18681cb143c6 100644
@@ -935,8 +935,10 @@ static void iscsit_handle_connection_cleanup(struct iscsi_conn *conn)
 	}
 }
 
-void iscsit_take_action_for_connection_exit(struct iscsi_conn *conn)
+void iscsit_take_action_for_connection_exit(struct iscsi_conn *conn, bool *conn_freed)
 {
+	*conn_freed = false;
+
 	spin_lock_bh(&conn->state_lock);
 	if (atomic_read(&conn->connection_exit)) {
 		spin_unlock_bh(&conn->state_lock);
@@ -947,6 +949,7 @@ void iscsit_take_action_for_connection_exit(struct iscsi_conn *conn)
 	if (conn->conn_state == TARG_CONN_STATE_IN_LOGOUT) {
 		spin_unlock_bh(&conn->state_lock);
 		iscsit_close_connection(conn);
+		*conn_freed = true;
 		return;
 	}
 
@@ -960,6 +963,7 @@ void iscsit_take_action_for_connection_exit(struct iscsi_conn *conn)
 	spin_unlock_bh(&conn->state_lock);
 
 	iscsit_handle_connection_cleanup(conn);
+	*conn_freed = true;
 }
 
 /*
drivers/target/iscsi/iscsi_target_erl0.h +1 -1
index 21acc9a06376..42673fb44790 100644
@@ -9,7 +9,7 @@ extern int iscsit_stop_time2retain_timer(struct iscsi_session *);
 extern void iscsit_connection_reinstatement_rcfr(struct iscsi_conn *);
 extern void iscsit_cause_connection_reinstatement(struct iscsi_conn *, int);
 extern void iscsit_fall_back_to_erl0(struct iscsi_session *);
-extern void iscsit_take_action_for_connection_exit(struct iscsi_conn *);
+extern void iscsit_take_action_for_connection_exit(struct iscsi_conn *, bool *);
 extern int iscsit_recover_from_unknown_opcode(struct iscsi_conn *);
 
 #endif   /*** ISCSI_TARGET_ERL0_H ***/
drivers/target/iscsi/iscsi_target_login.c +4 -0
index d534738ff3c7..850c977b6df3 100644
@@ -1496,5 +1496,9 @@ int iscsi_target_login_thread(void *arg)
 			break;
 	}
 
+	while (!kthread_should_stop()) {
+		msleep(100);
+	}
+
 	return 0;
 }
drivers/target/iscsi/iscsi_target_nego.c +139 -69

293 lines not on this page · raw message

drivers/target/target_core_internal.h +1 -1
index de9cab708f45..0ed822b139a9 100644
@@ -92,7 +92,7 @@ int	init_se_kmem_caches(void);
 void	release_se_kmem_caches(void);
 u32	scsi_get_new_index(scsi_index_t);
 void	transport_subsystem_check_init(void);
-void	transport_cmd_finish_abort(struct se_cmd *, int);
+int	transport_cmd_finish_abort(struct se_cmd *, int);
 unsigned char *transport_dump_cmd_direction(struct se_cmd *);
 void	transport_dump_dev_state(struct se_device *, char *, int *);
 void	transport_dump_dev_info(struct se_device *, struct se_lun *,
drivers/target/target_core_tmr.c +8 -8
index 033a59cd6c70..e6fe1b3dd76f 100644
@@ -82,7 +82,7 @@ void core_tmr_release_req(
 	kfree(tmr);
 }
 
-static void core_tmr_handle_tas_abort(struct se_cmd *cmd, int tas)
+static int core_tmr_handle_tas_abort(struct se_cmd *cmd, int tas)
 {
 	unsigned long flags;
 	bool remove = true, send_tas;
@@ -98,7 +98,7 @@ static void core_tmr_handle_tas_abort(struct se_cmd *cmd, int tas)
 		transport_send_task_abort(cmd);
 	}
 
-	transport_cmd_finish_abort(cmd, remove);
+	return transport_cmd_finish_abort(cmd, remove);
 }
 
 static int target_check_cdb_and_preempt(struct list_head *list,
@@ -195,8 +195,8 @@ void core_tmr_abort_task(
 		cancel_work_sync(&se_cmd->work);
 		transport_wait_for_tasks(se_cmd);
 
-		transport_cmd_finish_abort(se_cmd, true);
-		target_put_sess_cmd(se_sess, se_cmd);
+		if (!transport_cmd_finish_abort(se_cmd, true))
+			target_put_sess_cmd(se_sess, se_cmd);
 
 		printk("ABORT_TASK: Sending TMR_FUNCTION_COMPLETE for"
 				" ref_tag: %d\n", ref_tag);
@@ -296,8 +296,8 @@ static void core_tmr_drain_tmr_list(
 		cancel_work_sync(&cmd->work);
 		transport_wait_for_tasks(cmd);
 
-		transport_cmd_finish_abort(cmd, 1);
-		target_put_sess_cmd(cmd->se_sess, cmd);
+		if (!transport_cmd_finish_abort(cmd, 1))
+			target_put_sess_cmd(cmd->se_sess, cmd);
 	}
 }
 
@@ -395,8 +395,8 @@ static void core_tmr_drain_state_list(
 		cancel_work_sync(&cmd->work);
 		transport_wait_for_tasks(cmd);
 
-		core_tmr_handle_tas_abort(cmd, tas);
-		target_put_sess_cmd(cmd->se_sess, cmd);
+		if (!core_tmr_handle_tas_abort(cmd, tas))
+			target_put_sess_cmd(cmd->se_sess, cmd);
 	}
 }
 
drivers/target/target_core_transport.c +6 -3
index 589f9df574f2..6c3b00ca4d20 100644
@@ -600,9 +600,10 @@ static void transport_lun_remove_cmd(struct se_cmd *cmd)
 		percpu_ref_put(&lun->lun_ref);
 }
 
-void transport_cmd_finish_abort(struct se_cmd *cmd, int remove)
+int transport_cmd_finish_abort(struct se_cmd *cmd, int remove)
 {
 	bool ack_kref = (cmd->se_cmd_flags & SCF_ACK_KREF);
+	int ret = 0;
 
 	if (cmd->se_cmd_flags & SCF_SE_LUN_CMD)
 		transport_lun_remove_cmd(cmd);
@@ -614,9 +615,11 @@ void transport_cmd_finish_abort(struct se_cmd *cmd, int remove)
 		cmd->se_tfo->aborted_task(cmd);
 
 	if (transport_cmd_check_stop_to_fabric(cmd))
-		return;
+		return 1;
 	if (remove && ack_kref)
-		transport_put_cmd(cmd);
+		ret = transport_put_cmd(cmd);
+
+	return ret;
 }
 
 static void target_complete_failure_work(struct work_struct *work)
drivers/tty/serial/efm32-uart.c +8 -3
index 3b0ee9afd76f..3281fcea7827 100644
@@ -27,6 +27,7 @@
 #define UARTn_FRAME		0x04
 #define UARTn_FRAME_DATABITS__MASK	0x000f
 #define UARTn_FRAME_DATABITS(n)		((n) - 3)
+#define UARTn_FRAME_PARITY__MASK	0x0300
 #define UARTn_FRAME_PARITY_NONE		0x0000
 #define UARTn_FRAME_PARITY_EVEN		0x0200
 #define UARTn_FRAME_PARITY_ODD		0x0300
@@ -578,12 +579,16 @@ static void efm32_uart_console_get_options(struct efm32_uart_port *efm_port,
 			16 * (4 + (clkdiv >> 6)));
 
 	frame = efm32_uart_read32(efm_port, UARTn_FRAME);
-	if (frame & UARTn_FRAME_PARITY_ODD)
+	switch (frame & UARTn_FRAME_PARITY__MASK) {
+	case UARTn_FRAME_PARITY_ODD:
 		*parity = 'o';
-	else if (frame & UARTn_FRAME_PARITY_EVEN)
+		break;
+	case UARTn_FRAME_PARITY_EVEN:
 		*parity = 'e';
-	else
+		break;
+	default:
 		*parity = 'n';
+	}
 
 	*bits = (frame & UARTn_FRAME_DATABITS__MASK) -
 			UARTn_FRAME_DATABITS(4) + 4;
drivers/tty/serial/ifx6x60.c +3 -3
index 590390970996..fe958f415e85 100644
@@ -1379,9 +1379,9 @@ static struct spi_driver ifx_spi_driver = {
 static void __exit ifx_spi_exit(void)
 {
 	/* unregister */
+	spi_unregister_driver(&ifx_spi_driver);
 	tty_unregister_driver(tty_drv);
 	put_tty_driver(tty_drv);
-	spi_unregister_driver((void *)&ifx_spi_driver);
 	unregister_reboot_notifier(&ifx_modem_reboot_notifier_block);
 }
 
@@ -1420,7 +1420,7 @@ static int __init ifx_spi_init(void)
 		goto err_free_tty;
 	}
 
-	result = spi_register_driver((void *)&ifx_spi_driver);
+	result = spi_register_driver(&ifx_spi_driver);
 	if (result) {
 		pr_err("%s: spi_register_driver failed(%d)",
 			DRVNAME, result);
@@ -1436,7 +1436,7 @@ static int __init ifx_spi_init(void)
 
 	return 0;
 err_unreg_spi:
-	spi_unregister_driver((void *)&ifx_spi_driver);
+	spi_unregister_driver(&ifx_spi_driver);
 err_unreg_tty:
 	tty_unregister_driver(tty_drv);
 err_free_tty:
drivers/uio/uio.c +16 -8
index a673e5b6a2e0..079294590c00 100644
@@ -283,12 +283,16 @@ static int uio_dev_add_attributes(struct uio_device *idev)
 			map_found = 1;
 			idev->map_dir = kobject_create_and_add("maps",
 							&idev->dev->kobj);
-			if (!idev->map_dir)
+			if (!idev->map_dir) {
+				ret = -ENOMEM;
 				goto err_map;
+			}
 		}
 		map = kzalloc(sizeof(*map), GFP_KERNEL);
-		if (!map)
-			goto err_map_kobj;
+		if (!map) {
+			ret = -ENOMEM;
+			goto err_map;
+		}
 		kobject_init(&map->kobj, &map_attr_type);
 		map->mem = mem;
 		mem->map = map;
@@ -297,7 +301,7 @@ static int uio_dev_add_attributes(struct uio_device *idev)
 			goto err_map_kobj;
 		ret = kobject_uevent(&map->kobj, KOBJ_ADD);
 		if (ret)
-			goto err_map;
+			goto err_map_kobj;
 	}
 
 	for (pi = 0; pi < MAX_UIO_PORT_REGIONS; pi++) {
@@ -308,12 +312,16 @@ static int uio_dev_add_attributes(struct uio_device *idev)
 			portio_found = 1;
 			idev->portio_dir = kobject_create_and_add("portio",
 							&idev->dev->kobj);
-			if (!idev->portio_dir)
+			if (!idev->portio_dir) {
+				ret = -ENOMEM;
 				goto err_portio;
+			}
 		}
 		portio = kzalloc(sizeof(*portio), GFP_KERNEL);
-		if (!portio)
-			goto err_portio_kobj;
+		if (!portio) {
+			ret = -ENOMEM;
+			goto err_portio;
+		}
 		kobject_init(&portio->kobj, &portio_attr_type);
 		portio->port = port;
 		port->portio = portio;
@@ -323,7 +331,7 @@ static int uio_dev_add_attributes(struct uio_device *idev)
 			goto err_portio_kobj;
 		ret = kobject_uevent(&portio->kobj, KOBJ_ADD);
 		if (ret)
-			goto err_portio;
+			goto err_portio_kobj;
 	}
 
 	return 0;
drivers/usb/chipidea/debug.c +2 -1
index 09a54c731852..39332d3bfd9a 100644
@@ -286,7 +286,8 @@ static int ci_role_show(struct seq_file *s, void *data)
 {
 	struct ci_hdrc *ci = s->private;
 
-	seq_printf(s, "%s\n", ci_role(ci)->name);
+	if (ci->role != CI_ROLE_END)
+		seq_printf(s, "%s\n", ci_role(ci)->name);
 
 	return 0;
 }
drivers/usb/chipidea/udc.c +6 -2
index a887a874d6f3..156aff4ff0f2 100644
@@ -1892,6 +1892,7 @@ static void udc_id_switch_for_host(struct ci_hdrc *ci)
 int ci_hdrc_gadget_init(struct ci_hdrc *ci)
 {
 	struct ci_role_driver *rdrv;
+	int ret;
 
 	if (!hw_read(ci, CAP_DCCPARAMS, DCCPARAMS_DC))
 		return -ENXIO;
@@ -1904,7 +1905,10 @@ int ci_hdrc_gadget_init(struct ci_hdrc *ci)
 	rdrv->stop	= udc_id_switch_for_host;
 	rdrv->irq	= udc_irq;
 	rdrv->name	= "gadget";
-	ci->roles[CI_ROLE_GADGET] = rdrv;
 
-	return udc_start(ci);
+	ret = udc_start(ci);
+	if (!ret)
+		ci->roles[CI_ROLE_GADGET] = rdrv;
+
+	return ret;
 }
drivers/usb/core/devio.c +2 -2
index 39a8bb8f8820..b62d65d46902 100644
@@ -373,11 +373,11 @@ static void snoop_urb(struct usb_device *udev,
 
 	if (userurb) {		/* Async */
 		if (when == SUBMIT)
-			dev_info(&udev->dev, "userurb %p, ep%d %s-%s, "
+			dev_info(&udev->dev, "userurb %pK, ep%d %s-%s, "
 					"length %u\n",
 					userurb, ep, t, d, length);
 		else
-			dev_info(&udev->dev, "userurb %p, ep%d %s-%s, "
+			dev_info(&udev->dev, "userurb %pK, ep%d %s-%s, "
 					"actual_length %u status %d\n",
 					userurb, ep, t, d, length,
 					timeout_or_status);
drivers/usb/core/hcd.c +2 -2
index 66f513398d28..495f6949ebf6 100644
@@ -1648,7 +1648,7 @@ int usb_hcd_unlink_urb (struct urb *urb, int status)
 		if (retval == 0)
 			retval = -EINPROGRESS;
 		else if (retval != -EIDRM && retval != -EBUSY)
-			dev_dbg(&udev->dev, "hcd_unlink_urb %p fail %d\n",
+			dev_dbg(&udev->dev, "hcd_unlink_urb %pK fail %d\n",
 					urb, retval);
 		usb_put_dev(udev);
 	}
@@ -1813,7 +1813,7 @@ void usb_hcd_flush_endpoint(struct usb_device *udev,
 		/* kick hcd */
 		unlink1(hcd, urb, -ESHUTDOWN);
 		dev_dbg (hcd->self.controller,
-			"shutdown urb %p ep%d%s%s\n",
+			"shutdown urb %pK ep%d%s%s\n",
 			urb, usb_endpoint_num(&ep->desc),
 			is_in ? "in" : "out",
 			({	char *s;
drivers/usb/core/hub.c +21 -6
index 7ed312aa0d2e..25892de366b4 100644
@@ -363,7 +363,8 @@ static void usb_set_lpm_parameters(struct usb_device *udev)
 }
 
 /* USB 2.0 spec Section 11.24.4.5 */
-static int get_hub_descriptor(struct usb_device *hdev, void *data)
+static int get_hub_descriptor(struct usb_device *hdev,
+		struct usb_hub_descriptor *desc)
 {
 	int i, ret, size;
 	unsigned dtype;
@@ -379,10 +380,18 @@ static int get_hub_descriptor(struct usb_device *hdev, void *data)
 	for (i = 0; i < 3; i++) {
 		ret = usb_control_msg(hdev, usb_rcvctrlpipe(hdev, 0),
 			USB_REQ_GET_DESCRIPTOR, USB_DIR_IN | USB_RT_HUB,
-			dtype << 8, 0, data, size,
+			dtype << 8, 0, desc, size,
 			USB_CTRL_GET_TIMEOUT);
-		if (ret >= (USB_DT_HUB_NONVAR_SIZE + 2))
+		if (hub_is_superspeed(hdev)) {
+			if (ret == size)
+				return ret;
+		} else if (ret >= USB_DT_HUB_NONVAR_SIZE + 2) {
+			/* Make sure we have the DeviceRemovable field. */
+			size = USB_DT_HUB_NONVAR_SIZE + desc->bNbrPorts / 8 + 1;
+			if (ret < size)
+				return -EMSGSIZE;
 			return ret;
+		}
 	}
 	return -EINVAL;
 }
@@ -1293,7 +1302,7 @@ static int hub_configure(struct usb_hub *hub,
 	}
 	mutex_init(&hub->status_mutex);
 
-	hub->descriptor = kmalloc(sizeof(*hub->descriptor), GFP_KERNEL);
+	hub->descriptor = kzalloc(sizeof(*hub->descriptor), GFP_KERNEL);
 	if (!hub->descriptor) {
 		ret = -ENOMEM;
 		goto fail;
@@ -1301,13 +1310,19 @@ static int hub_configure(struct usb_hub *hub,
 
 	/* Request the entire hub descriptor.
 	 * hub->descriptor can handle USB_MAXCHILDREN ports,
-	 * but the hub can/will return fewer bytes here.
+	 * but a (non-SS) hub can/will return fewer bytes here.
 	 */
 	ret = get_hub_descriptor(hdev, hub->descriptor);
 	if (ret < 0) {
 		message = "can't read hub descriptor";
 		goto fail;
-	} else if (hub->descriptor->bNbrPorts > USB_MAXCHILDREN) {
+	}
+
+	maxchild = USB_MAXCHILDREN;
+	if (hub_is_superspeed(hdev))
+		maxchild = min_t(unsigned, maxchild, USB_SS_MAXPORTS);
+
+	if (hub->descriptor->bNbrPorts > maxchild) {
 		message = "hub has too many ports!";
 		ret = -ENODEV;
 		goto fail;
drivers/usb/core/urb.c +1 -1
index 991386ceb4ec..ce5f13d62b64 100644
@@ -336,7 +336,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
 	if (!urb || !urb->complete)
 		return -EINVAL;
 	if (urb->hcpriv) {
-		WARN_ONCE(1, "URB %p submitted while active\n", urb);
+		WARN_ONCE(1, "URB %pK submitted while active\n", urb);
 		return -EBUSY;
 	}
 
drivers/usb/dwc3/gadget.c +9 -0
index 691c63297e4c..52620eb41838 100644
@@ -2761,6 +2761,15 @@ static irqreturn_t dwc3_check_event_buf(struct dwc3 *dwc, u32 buf)
 
 	evt = dwc->ev_buffs[buf];
 
+	/*
+	 * With PCIe legacy interrupt, test shows that top-half irq handler can
+	 * be called again after HW interrupt deassertion. Check if bottom-half
+	 * irq event handler completes before caching new event to prevent
+	 * losing events.
+	 */
+	if (evt->flags & DWC3_EVENT_PENDING)
+		return IRQ_HANDLED;
+
 	count = dwc3_readl(dwc->regs, DWC3_GEVNTCOUNT(buf));
 	count &= DWC3_GEVNTCOUNT_MASK;
 	if (!count)
drivers/usb/gadget/dummy_hcd.c +3 -3
index b0da9552b3b0..d20222e56419 100644
@@ -1933,7 +1933,7 @@ ss_hub_descriptor(struct usb_hub_descriptor *desc)
 	desc->wHubCharacteristics = cpu_to_le16(0x0001);
 	desc->bNbrPorts = 1;
 	desc->u.ss.bHubHdrDecLat = 0x04; /* Worst case: 0.4 micro sec*/
-	desc->u.ss.DeviceRemovable = 0xffff;
+	desc->u.ss.DeviceRemovable = 0;
 }
 
 static inline void hub_descriptor(struct usb_hub_descriptor *desc)
@@ -1943,8 +1943,8 @@ static inline void hub_descriptor(struct usb_hub_descriptor *desc)
 	desc->bDescLength = 9;
 	desc->wHubCharacteristics = cpu_to_le16(0x0001);
 	desc->bNbrPorts = 1;
-	desc->u.hs.DeviceRemovable[0] = 0xff;
-	desc->u.hs.DeviceRemovable[1] = 0xff;
[… more lines in the raw message]

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

drivers/usb/gadget/f_mass_storage.c +11 -2
index 53f4d4a868b5..2234c3a5ed8e 100644

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

drivers/usb/host/r8a66597-hcd.c +4 -2
index f130bb2f7bbe..a9f12e382f2a 100644

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

drivers/usb/host/xhci-mem.c +1 -1
index 601420407721..bba6aafe24c4 100644

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

drivers/usb/host/xhci-pci.c +8 -2
index 63d4f2897f00..6e48fd8d673e 100644

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

drivers/usb/host/xhci-plat.c +1 -1
index b1e4031d081a..f217c677a1ef 100644

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

drivers/usb/host/xhci-ring.c +20 -17
index 6db00d804d0e..97a3955650c9 100644

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

drivers/usb/misc/iowarrior.c +1 -1
index 775690bed4c0..5e43fd881a9c 100644

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

drivers/usb/musb/tusb6010_omap.c +9 -4
index 3ce152c0408e..c43455affbd8 100644

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

drivers/usb/serial/ftdi_sio.c +5 -5
index c709fbc271d8..9c0cfba2c803 100644

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

drivers/usb/serial/ftdi_sio_ids.h +2 -0
index fe794427c1f6..f34bc435d90a 100644

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

drivers/usb/serial/io_ti.c +4 -1
index ea1591127acb..7a8ee30bc177 100644

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

drivers/usb/serial/ir-usb.c +12 -9
index 73956d48a0c5..f9734a96d516 100644

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

drivers/usb/serial/mct_u232.c +1 -1
index 9bf82c262c5b..a6c07c6be25f 100644

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

drivers/usb/serial/option.c +8 -0
index f599a1904f87..58b13a537a7d 100644

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

drivers/usb/serial/qcserial.c +2 -0
index 2f1e1ac133da..4f91868736a5 100644

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

drivers/usb/storage/ene_ub6250.c +55 -35

90 lines not on this page · raw message

drivers/uwb/i1480/dfu/usb.c +3 -2
index 6345e85822a4..a50cf45e530f 100644

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

drivers/watchdog/bcm_kona_wdt.c +2 -1
index 9c248099f4a2..8ecaf8714154 100644

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

drivers/watchdog/pcwd_usb.c +3 -0
index 1a11aedc4fe8..9eb5b314ba06 100644

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

drivers/xen/biomerge.c +1 -2
index 0edb91c0de6b..4a77fe802b37 100644

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

fs/autofs4/dev-ioctl.c +1 -1
index 9fae6e8a4c7e..0c510d31caba 100644

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

fs/btrfs/extent-tree.c +1 -0
index fd518dffe6d3..1f20c8e75e19 100644

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

fs/btrfs/extent_io.c +1 -1
index 13ee2bb1ed9c..e987c0d56fd1 100644

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

fs/btrfs/inode.c +2 -2
index 4292500ef241..e4c07b2cf9b0 100644

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

fs/cifs/smb1ops.c +7 -2
index 2312a8563453..6c776f531184 100644

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

fs/cifs/smb2ops.c +2 -2
index 9e1ef458be30..c43a0fd068bf 100644

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

fs/cifs/smb2pdu.c +9 -5
index 07d2f1c659e2..caa38395ec83 100644

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

fs/configfs/symlink.c +1 -2
index cc9f2546ea4a..52fc4e25a7cb 100644

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

fs/ext4/extents.c +3 -0
index d24d6fc1df4f..d4b31664a75b 100644

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

fs/ext4/file.c +14 -36

50 lines not on this page · raw message

fs/ext4/inode.c +21 -4
index a7702f41cf95..65579972c4ba 100644

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

fs/ext4/mballoc.c +42 -28

70 lines not on this page · raw message

fs/proc/array.c +1 -1
index 98f368b7c857..6a8bdd516f80 100644

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

fs/proc/base.c +11 -10
index 944c6be58199..8233f183a945 100644

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

fs/proc/namespaces.c +2 -2
index 89026095f2b5..0bdad6b11a16 100644

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

fs/proc/task_mmu.c +2 -2
index fb073b9fe25e..9380e4e291a6 100644

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

fs/proc/task_nommu.c +1 -1
index 678455d2d683..f9db7e9f6966 100644

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

fs/stat.c +1 -0
index ae0c3cef9927..2b7a46be73a8 100644

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

fs/ufs/balloc.c +25 -1
index fe1b53d441e0..41aecd066f23 100644

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

fs/ufs/inode.c +4 -1
index 40d6423429cb..c13fbcebefa5 100644

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

fs/ufs/super.c +20 -3
index f5fb525ae201..30f47fcd0f68 100644

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

fs/ufs/truncate.c +0 -6
index 92cde998aead..93bc59c0d598 100644

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

fs/ufs/util.h +7 -3
index 954175928240..3f9463f8cf2f 100644

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

fs/xfs/xfs_file.c +10 -21
index d00b21c5d3ec..593985a0447c 100644

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

include/linux/kprobes.h +3 -1
index f7296e57d614..8c0ff78ff45a 100644

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

include/linux/ptrace.h +23 -1
index cc79eff4a1ad..608d90444b6f 100644

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

include/linux/srcu.h +2 -1
index a2783cb5d275..0f6e3a8d7516 100644

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

include/net/addrconf.h +2 -0
index f679877bb601..c9766ab9c87c 100644

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

include/net/ip6_route.h +1 -0
index eda131d179d9..2e765849ccd6 100644

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

include/net/ipv6.h +1 -0
index 9aca37aa9796..c30ba46ef2f0 100644

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

include/net/xfrm.h +0 -10
index 721e9c3b11bd..4f2d16d375f3 100644

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

include/uapi/linux/usb/ch11.h +3 -0
index 331499d597fa..9ce10d4a0245 100644

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

kernel/events/core.c +1 -1
index 1ac05d1c0e6b..847cf0d7428e 100644

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

kernel/fork.c +6 -2
index 602dbac0b201..0e1f602b8f47 100644

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

kernel/futex.c +1 -1
index 338f62675383..54b11500b1d3 100644

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

kernel/futex_compat.c +1 -1
index 55c8c9349cfe..4ae3232e7a28 100644

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

kernel/irq/manage.c +3 -1
index efd80f0af47f..1ce20fc82364 100644

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

kernel/kcmp.c +2 -2
index 0aa69ea1d8fd..3a47fa998fe0 100644

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

kernel/kprobes.c +1 -1
index 734e9a7d280b..f6397bb4d5f6 100644

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

kernel/pid_namespace.c +1 -1
index db95d8eb761b..d550f930027c 100644

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

kernel/ptrace.c +31 -8
index d52bd8dbfb4b..7660e8eae6f6 100644

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

kernel/rcu/srcu.c +6 -6
index c639556f3fa0..bfea8caf8fe2 100644

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

kernel/signal.c +14 -6
index 6eb8466819b7..998e9f173c45 100644

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

kernel/time/alarmtimer.c +11 -3
index cd45a0727a16..28627a9b667b 100644

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

kernel/trace/trace_kprobe.c +10 -8
index 282f6e4e5539..94b253911a2a 100644

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

lib/cmdline.c +3 -3
index d4932f745e92..9b86ec3c7d75 100644

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

mm/huge_memory.c +8 -1
index 4397b89155f8..e1a6dce055a0 100644

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

mm/memory-failure.c +6 -7
index 7e23d04393b7..eb99a91a8434 100644

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

mm/migrate.c +3 -8
index 5193433d8605..4fb18030de62 100644

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

mm/mlock.c +3 -2
index b1eb53634005..e29e9116a40e 100644

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

mm/page_cgroup.c +3 -0
index 5331c2bd85a2..29fd07ba57bd 100644

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

mm/process_vm_access.c +1 -1
index 5077afcd9e11..b2dfa8cf6e4c 100644

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

mm/slub.c +4 -2
index 73004808537e..287f32c1d249 100644

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

net/batman-adv/distributed-arp-table.c +3 -2
index dc240a8d99d4..7353487b787f 100644

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

net/ceph/osdmap.c +1 -0
index e77feac7ac6d..8f35d71da955 100644

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

net/core/dev.c +9 -3
index 1441a4934c18..869a04d5558d 100644

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

net/core/rtnetlink.c +2 -0
index 96e9c5f51704..66498c948405 100644

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

net/core/sock.c +6 -9
index 92ff8fba31ab..ee26a0af2327 100644

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

net/ipv4/af_inet.c +1 -1
index 9da88765e88e..6a203fddc2fe 100644

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

net/ipv4/ip_output.c +1 -1
index d813da85bdaa..3cb23fb85a4a 100644

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

net/ipv4/tcp.c +11 -2
index 068ffa698318..17d425067d27 100644

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

net/ipv4/tcp_input.c +6 -5
index 50023e8af668..9a36ff6346f2 100644

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

net/ipv6/addrconf.c +7 -1
index cd12b63faf10..d5fe33752ca6 100644

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

net/ipv6/fib6_rules.c +2 -1
index 27ca79682efb..826a356cc022 100644

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

net/ipv6/ip6_offload.c +3 -1
index 0d5772393014..a98e965db124 100644

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

net/ipv6/ip6_output.c +8 -9
index 89da95f2b4b1..1fd80d8abd1d 100644

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

net/ipv6/ping.c +1 -1
index 2d452a382128..50bb5e5c99c1 100644

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

net/ipv6/raw.c +1 -1
index edff1d1c74cb..1412a20eded3 100644

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

net/ipv6/route.c +30 -13

43 lines not on this page · raw message

net/ipv6/xfrm6_mode_ro.c +2 -0
index 0e015906f9ca..07d36573f50b 100644

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

net/ipv6/xfrm6_mode_transport.c +2 -0
index 4e344105b3fd..1d3bbe6e1183 100644

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

net/key/af_key.c +14 -5
index 97d94fa287ed..eac22fe84c4a 100644

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

net/l2tp/l2tp_eth.c +7 -6
index 19198675daea..992bc49f57ee 100644

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

net/mac80211/rx.c +7 -2
index b1d0d22fb2a4..ebdc2d160817 100644

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

net/mac80211/wpa.c +3 -2
index 9b3dcc201145..749fc1fc45f5 100644

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

net/netfilter/nf_conntrack_netlink.c +6 -1
index 63f734c5af79..faa736bae869 100644

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

net/wireless/util.c +10 -4
index b5dd3c829b1a..d2589830356f 100644

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

net/xfrm/xfrm_policy.c +6 -47

53 lines not on this page · raw message

scripts/tags.sh +1 -0
index e6b011fe1d0d..140e5fad867d 100755

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

security/commoncap.c +6 -1
index 963dc5981661..a484506445d7 100644

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

security/keys/keyctl.c +2 -2
index 57f8e162b51b..edc3f3c32324 100644

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

security/selinux/hooks.c +2 -3
index 85a74e299412..df42cb7a1bbf 100644

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

sound/pci/hda/hda_generic.c +1 -0
index 0882f060696d..800180ed0a10 100644

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

sound/pci/hda/patch_sigmatel.c +2 -0
index 3a014a4e6f51..8535b9c6506d 100644

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

sound/soc/soc-core.c +3 -2
index 6c927ac43876..93b60ecf61ab 100644

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

tools/perf/Documentation/perf-probe.txt +6 -2
index 1513935c399b..afb3d36e7662 100644

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

tools/perf/Documentation/perf-script-perl.txt +1 -1
index d00bef231340..2d5da5be4093 100644

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

tools/perf/Documentation/perf-script-python.txt +9 -14
index 9f1f054b8432..38953e2453bc 100644

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

tools/perf/util/scripting-engines/trace-event-python.c +1 -1
index 1c419321f707..4d52b211442e 100644

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

tools/testing/selftests/powerpc/tm/tm-resched-dscr.c +1 -1
index 42d4c8caad81..de8dc82e2567 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.