Linux 4.16.7
Greg KH
maintainerI'm announcing the release of the 4.16.7 kernel.
All users of the 4.16 kernel series must upgrade.
The updated 4.16.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.16.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Documentation/virtual/kvm/api.txt | 9 Documentation/virtual/kvm/arm/psci.txt | 30 ++ Makefile | 2 arch/arm/boot/dts/gemini-nas4220b.dts | 28 +- arch/arm/configs/socfpga_defconfig | 1 arch/arm/include/asm/kvm_host.h | 3 arch/arm/include/uapi/asm/kvm.h | 6 arch/arm/kvm/guest.c | 13 arch/arm64/include/asm/kvm_host.h | 3 arch/arm64/include/uapi/asm/kvm.h | 6 arch/arm64/kvm/guest.c | 14 - arch/powerpc/kernel/mce_power.c | 7 arch/powerpc/mm/mem.c | 2 arch/powerpc/platforms/powernv/npu-dma.c | 23 + arch/powerpc/platforms/powernv/opal-rtc.c | 8 arch/sparc/include/uapi/asm/oradax.h | 2 arch/x86/include/uapi/asm/msgbuf.h | 31 ++ arch/x86/include/uapi/asm/shmbuf.h | 42 +++ arch/x86/kernel/cpu/microcode/core.c | 6 arch/x86/kernel/cpu/microcode/intel.c | 2 arch/x86/kernel/smpboot.c | 2 block/bfq-iosched.c | 10 block/blk-core.c | 15 - block/blk-mq.c | 7 crypto/drbg.c | 2 drivers/amba/bus.c | 17 - drivers/android/binder.c | 8 drivers/char/random.c | 90 +++++- drivers/char/virtio_console.c | 157 +++++------- drivers/cpufreq/powernv-cpufreq.c | 14 - drivers/crypto/ccp/sp-dev.c | 6 drivers/fpga/altera-ps-spi.c | 2 drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 7 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 10 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c | 5 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 32 -- drivers/gpu/drm/drm_edid.c | 11 drivers/gpu/drm/i915/intel_cdclk.c | 16 + drivers/gpu/drm/i915/intel_fbdev.c | 2 drivers/gpu/drm/i915/intel_runtime_pm.c | 11 drivers/gpu/drm/virtio/virtgpu_vq.c | 4 drivers/mtd/chips/cfi_cmdset_0001.c | 33 ++ drivers/mtd/chips/cfi_cmdset_0002.c | 9 drivers/mtd/nand/marvell_nand.c | 25 - drivers/mtd/nand/tango_nand.c | 2 drivers/mtd/spi-nor/cadence-quadspi.c | 19 + drivers/of/fdt.c | 7 drivers/pci/host/pci-aardvark.c | 53 ++-- drivers/pci/pci-driver.c | 5 drivers/rtc/rtc-opal.c | 37 +- drivers/s390/cio/vfio_ccw_fsm.c | 19 - drivers/sbus/char/oradax.c | 2 drivers/scsi/sd.c | 2 drivers/scsi/sd_zbc.c | 140 ++++++---- drivers/slimbus/messaging.c | 2 drivers/tty/n_gsm.c | 23 + drivers/tty/serial/earlycon.c | 6 drivers/tty/serial/mvebu-uart.c | 1 drivers/tty/tty_io.c | 5 drivers/tty/tty_ldisc.c | 29 -- drivers/usb/core/hcd.c | 1 drivers/usb/core/hub.c | 10 drivers/usb/core/quirks.c | 3 drivers/usb/host/xhci-dbgtty.c | 8 drivers/usb/host/xhci-pci.c | 5 drivers/usb/host/xhci-plat.c | 1 drivers/usb/serial/Kconfig | 1 drivers/usb/serial/cp210x.c | 1 drivers/usb/serial/ftdi_sio.c | 3 drivers/usb/serial/usb-serial-simple.c | 7 drivers/usb/typec/ucsi/ucsi.c | 2 drivers/usb/usbip/stub_main.c | 5 drivers/usb/usbip/usbip_common.h | 2 drivers/usb/usbip/usbip_event.c | 4 drivers/usb/usbip/vhci_hcd.c | 13 drivers/virt/vboxguest/vboxguest_core.c | 66 ++--- drivers/virt/vboxguest/vboxguest_core.h | 9 drivers/virt/vboxguest/vboxguest_linux.c | 19 + drivers/virt/vboxguest/vboxguest_utils.c | 17 - fs/cifs/cifssmb.c | 3 fs/cifs/smb2ops.c | 18 + fs/cifs/smb2pdu.c | 4 fs/cifs/smbdirect.c | 36 -- fs/cifs/transport.c | 4 fs/ext4/balloc.c | 17 + fs/ext4/extents.c | 16 - fs/ext4/ialloc.c | 7 fs/ext4/super.c | 1 fs/jbd2/transaction.c | 1 include/asm-generic/vmlinux.lds.h | 2 include/kvm/arm_psci.h | 16 + include/linux/blkdev.h | 5 include/linux/mtd/flashchip.h | 1 include/linux/serial_core.h | 21 + include/linux/tty.h | 2 include/linux/vbox_utils.h | 23 - include/linux/virtio.h | 3 include/sound/control.h | 7 kernel/module.c | 3 kernel/time/tick-sched.c | 11 lib/kobject.c | 12 net/ceph/messenger.c | 7 net/ceph/mon_client.c | 14 - sound/core/pcm_compat.c | 7 sound/core/pcm_native.c | 24 - sound/core/seq/oss/seq_oss_event.c | 15 - sound/core/seq/oss/seq_oss_midi.c | 2 sound/core/seq/oss/seq_oss_synth.c | 85 +++--- sound/core/seq/oss/seq_oss_synth.h | 3 sound/drivers/opl3/opl3_synth.c | 7 sound/firewire/dice/dice-stream.c | 2 sound/firewire/dice/dice.c | 2 sound/pci/asihpi/hpimsginit.c | 13 sound/pci/asihpi/hpioctl.c | 4 sound/pci/hda/hda_hwdep.c | 12 sound/pci/hda/patch_hdmi.c | 9 sound/pci/hda/patch_realtek.c | 5 sound/pci/rme9652/hdspm.c | 24 + sound/pci/rme9652/rme9652.c | 6 sound/soc/fsl/fsl_esai.c | 7 sound/soc/omap/omap-dmic.c | 14 - sound/usb/mixer_maps.c | 3 tools/lib/str_error_r.c | 2 virt/kvm/arm/arm.c | 15 - virt/kvm/arm/psci.c | 60 ++++ 125 files changed, 1216 insertions(+), 601 deletions(-)
Abhay Kumar (1):
drm/i915/audio: set minimum CD clock to twice the BCLK
Alan Jenkins (1):
block: do not use interruptible wait anywhere
Alistair Popple (1):
powerpc/powernv/npu: Do a PID GPU TLB flush when invalidating a large address range
Anatolij Gustschin (1):
fpga-manager: altera-ps-spi: preserve nCONFIG state
Arnd Bergmann (1):
x86/ipc: Fix x32 version of shmid64_ds and msqid64_ds
Balbir Singh (1):
powerpc/mm: Flush cache on memory hot(un)plug
Bart Van Assche (1):
scsi: sd_zbc: Avoid that resetting a zone fails sporadically
Borislav Petkov (2):
x86/microcode/intel: Save microcode patch unconditionally x86/microcode: Do not exit early from __reload_late()
Brijesh Singh (1):
crypto: ccp - add check to get PSP master only when PSP is detected
Collin May (1):
USB: serial: simple: add libtransistor console
Cornelia Huck (1):
vfio: ccw: process ssch with interrupts disabled
Daniel Kurtz (1):
earlycon: Use a pointer table to fix __earlycon_table stride
David Henningsson (1):
ALSA: core: Report audio_tstamp in snd_pcm_sync_ptr
Dmitry Vyukov (1):
kobject: don't use WARN for registration failures
Eric Biggers (1):
ext4: prevent right-shifting extents beyond EXT_MAX_BLOCKS
Evan Wang (1):
PCI: aardvark: Fix PCIe Max Read Request Size setting
Geert Uytterhoeven (4):
ARM: amba: Make driver_override output consistent with other buses
ARM: amba: Fix race condition with driver_override
ARM: amba: Don't read past the end of sysfs "driver_override" buffer
slimbus: Fix out-of-bounds access in slim_slicesize()
Gerd Hoffmann (1):
drm/virtio: fix vq wait_event condition
Greg Kroah-Hartman (2):
Revert "xhci: plat: Register shutdown for xhci_plat" Linux 4.16.7
Hans de Goede (3):
virt: vbox: Move declarations of vboxguest private functions to private header
virt: vbox: Add vbg_req_free() helper function
virt: vbox: Use __get_free_pages instead of kmalloc for DMA32 memory
Harry Wentland (2):
drm/amd/display: Don't read EDID in atomic_check drm/amd/display: Disallow enabling CRTC without primary plane with FB
Heikki Krogerus (1):
usb: typec: ucsi: Increase command completion timeout value
Ilya Dryomov (3):
libceph: un-backoff on tick when we have a authenticated session
libceph: reschedule a tick in finish_hunting()
libceph: validate con->state at the top of try_write()
Imre Deak (1):
drm/i915: Enable display WA#1183 from its correct spot
Jeffery Miller (1):
ALSA: pcm: Return negative delays from SNDRV_PCM_IOCTL_DELAY.
Jens Axboe (1):
bfq-iosched: ensure to clear bic/bfqq pointers when preparing request
Jianchao Wang (1):
blk-mq: start request gstate with gen 1
Joakim Tjernlund (3):
mtd: cfi: cmdset_0001: Do not allow read/write to suspend erase block.
mtd: cfi: cmdset_0001: Workaround Micron Erase suspend bug.
mtd: cfi: cmdset_0002: Do not allow read/write to suspend erase block.
Josh Poimboeuf (1):
objtool, perf: Fix GCC 8 -Wrestrict error
José Roberto de Souza (1):
drm/i915/fbdev: Enable late fbdev initial configuration
Kai-Heng Feng (1):
xhci: Fix USB ports for Dell Inspiron 5775
Kailang Yang (3):
ALSA: hda/realtek - Add some fixes for ALC233
ALSA: hda/realtek - Update ALC255 depop optimize
ALSA: hda/realtek - change the location for one of two front mics
Kamil Lulko (1):
usb: core: Add quirk for HP v222w 16GB Mini
Kyle Roeschley (1):
USB: serial: cp210x: add ID for NI USB serial console
Linus Walleij (1):
ARM: dts: Fix NAS4220B pin config
Long Li (2):
cifs: smbd: Avoid allocating iov on the stack
cifs: smbd: Don't use RDMA read/write when signing is used
Lukas Czerner (1):
ext4: fix bitmap position validation
Mahesh Rajashekhara (1):
scsi: sd: Defer spinning up drive while SANITIZE is in progress
Mahesh Salgaonkar (1):
powerpc/mce: Fix a bug where mce loops on memory UE.
Marc Gonzalez (1):
mtd: rawnand: tango: Fix struct clk memory leak
Marc Zyngier (3):
serial: mvebu-uart: Fix local flags handling on termios update
KVM: arm/arm64: Close VMID generation race arm/arm64: KVM: Add PSCI version selection API
Martijn Coenen (1):
ANDROID: binder: prevent transactions into own process.
Michael S. Tsirkin (6):
virtio: add ability to iterate over vqs
virtio_console: don't tie bufs to a vq
virtio_console: free buffers after reset
virtio_console: drop custom control queue cleanup
virtio_console: move removal code
virtio_console: reset on out of memory
Mika Westerberg (1):
PCI / PM: Do not clear state_saved in pci_pm_freeze() when smart suspend is set
Mikita Lipski (1):
drm/amd/display: Fix deadlock when flushing irq
Miquel Raynal (1):
mtd: rawnand: marvell: fix the chip-select DT parsing logic
Nicholas Piggin (1):
rtc: opal: Fix OPAL RTC driver OPAL_BUSY loops
Nicolai Hähnle (1):
drm/amdgpu: set COMPUTE_PGM_RSRC1 for SGPR/VGPR clearing shaders
Nicolin Chen (1):
ASoC: fsl_esai: Fix divisor calculation failure at lower ratio
Ravi Chandra Sadineni (1):
USB: Increment wakeup count on remote wakeup.
Rob Gardner (1):
sparc64: Fix mistake in oradax license text
Shilpasri G Bhat (1):
cpufreq: powernv: Fix hardlockup due to synchronous smp_call in timer interrupt
Shuah Khan (4):
usbip: usbip_event: fix to not print kernel pointer address
usbip: usbip_host: fix to hold parent lock for device_attach() calls
usbip: vhci_hcd: Fix usb device and sockfd leaks
usbip: vhci_hcd: check rhport before using in vhci_hub_control()
Stephan Mueller (1):
crypto: drbg - set freed buffers to NULL
Steve French (1):
SMB311: Fix reconnect
Takashi Iwai (10):
ALSA: usb-audio: Skip broken EU on Dell dock USB-audio
ALSA: hda - Skip jack and others for non-existing PCM streams
ALSA: opl3: Hardening for potential Spectre v1
ALSA: asihpi: Hardening for potential Spectre v1
ALSA: hdspm: Hardening for potential Spectre v1
ALSA: rme9652: Hardening for potential Spectre v1
ALSA: control: Hardening for potential Spectre v1
ALSA: seq: oss: Fix unbalanced use lock for synth MIDI device
ALSA: seq: oss: Hardening for potential Spectre v1
ALSA: hda: Hardening for potential Spectre v1
Takashi Sakamoto (2):
ALSA: dice: fix OUI for TC group
ALSA: dice: fix error path to destroy initialized stream data
Tero Kristo (1):
ASoC: dmic: Fix clock parenting
Tetsuo Handa (3):
tty: Don't call panic() at tty_ldisc_init()
tty: Avoid possible error pointer dereference at tty_ldisc_restore().
tty: Use __GFP_NOFAIL for tty_ldisc_get()
Theodore Ts'o (6):
ext4: set h_journal if there is a failure starting a reserved handle
ext4: add MODULE_SOFTDEP to ensure crc32c is included in the initramfs
ext4: add validity checks for bitmap block numbers
random: set up the NUMA crng instances after the CRNG is fully initialized
random: fix possible sleeping allocation from irq context
random: rate limit unseeded randomness warnings
Thomas Gleixner (1):
tick/sched: Do not mess with an enqueued hrtimer
Thomas Richter (1):
module: Fix display of wrong module .text address
Thor Thayer (2):
mtd: spi-nor: cadence-quadspi: Fix page fault kernel panic
ARM: socfpga_defconfig: Remove QSPI Sector 4K size force
Tony Lindgren (2):
tty: n_gsm: Fix long delays with control frame timeouts in ADM mode
tty: n_gsm: Fix DLCI handling for ADM mode if debug & 2 is not set
Vasyl Vavrychuk (1):
USB: serial: ftdi_sio: use jtag quirk for Arrow USB Blaster
Victor Gu (3):
PCI: aardvark: Fix logic in advk_pcie_{rd,wr}_conf()
PCI: aardvark: Set PIO_ADDR_LS correctly in advk_pcie_rd_conf()
PCI: aardvark: Use ISR1 instead of ISR0 interrupt in legacy irq mode
Ville Syrjälä (1):
drm/edid: Reset more of the display info
Yazen Ghannam (1):
x86/smpboot: Don't use mwait_play_dead() on AMD systems
Zhengjun Xing (1):
xhci: Fix Kernel oops in xhci dbgtty
Greg KH
maintainerDocumentation/virtual/kvm/api.txt +8 -1
@@ -1960,6 +1960,9 @@ ARM 32-bit VFP control registers have the following id bit patterns: ARM 64-bit FP registers have the following id bit patterns: 0x4030 0000 0012 0 <regno:12> +ARM firmware pseudo-registers have the following bit pattern: + 0x4030 0000 0014 <regno:16> + arm64 registers are mapped using the lower 32 bits. The upper 16 of that is the register group type, or coprocessor number:
@@ -1976,6 +1979,9 @@ arm64 CCSIDR registers are demultiplexed by CSSELR value: arm64 system registers have the following id bit patterns: 0x6030 0000 0013 <op0:2> <op1:3> <crn:4> <crm:4> <op2:3> +arm64 firmware pseudo-registers have the following bit pattern: + 0x6030 0000 0014 <regno:16> + MIPS registers are mapped using the lower 32 bits. The upper 16 of that is the register group type:
@@ -2510,7 +2516,8 @@ Possible features: and execute guest code when KVM_RUN is called. - KVM_ARM_VCPU_EL1_32BIT: Starts the CPU in a 32bit mode. Depends on KVM_CAP_ARM_EL1_32BIT (arm64 only). - - KVM_ARM_VCPU_PSCI_0_2: Emulate PSCI v0.2 for the CPU. + - KVM_ARM_VCPU_PSCI_0_2: Emulate PSCI v0.2 (or a future revision + backward compatible with v0.2) for the CPU. Depends on KVM_CAP_ARM_PSCI_0_2. - KVM_ARM_VCPU_PMU_V3: Emulate PMUv3 for the CPU. Depends on KVM_CAP_ARM_PMU_V3.
Documentation/virtual/kvm/arm/psci.txt new file +30 -0
@@ -0,0 +1,30 @@ +KVM implements the PSCI (Power State Coordination Interface) +specification in order to provide services such as CPU on/off, reset +and power-off to the guest. + +The PSCI specification is regularly updated to provide new features, +and KVM implements these updates if they make sense from a virtualization +point of view. + +This means that a guest booted on two different versions of KVM can +observe two different "firmware" revisions. This could cause issues if +a given guest is tied to a particular PSCI revision (unlikely), or if +a migration causes a different PSCI version to be exposed out of the +blue to an unsuspecting guest. + +In order to remedy this situation, KVM exposes a set of "firmware +pseudo-registers" that can be manipulated using the GET/SET_ONE_REG +interface. These registers can be saved/restored by userspace, and set +to a convenient value if required. + +The following register is defined: + +* KVM_REG_ARM_PSCI_VERSION: + + - Only valid if the vcpu has the KVM_ARM_VCPU_PSCI_0_2 feature set + (and thus has already been initialized) + - Returns the current PSCI version on GET_ONE_REG (defaulting to the + highest PSCI version implemented by KVM and compatible with v0.2) + - Allows any PSCI version implemented by KVM and compatible with + v0.2 to be set with SET_ONE_REG + - Affects the whole VM (even if the register view is per-vcpu)
Makefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 16 -SUBLEVEL = 6 +SUBLEVEL = 7 EXTRAVERSION = NAME = Fearless Coyote
arch/arm/boot/dts/gemini-nas4220b.dts +14 -14
@@ -134,37 +134,37 @@ function = "gmii"; groups = "gmii_gmac0_grp"; }; - /* Settings come from OpenWRT */ + /* Settings come from OpenWRT, pins on SL3516 */ conf0 { - pins = "R8 GMAC0 RXDV", "U11 GMAC1 RXDV"; + pins = "V8 GMAC0 RXDV", "T10 GMAC1 RXDV"; skew-delay = <0>; }; conf1 { - pins = "T8 GMAC0 RXC", "T11 GMAC1 RXC"; + pins = "Y7 GMAC0 RXC", "Y11 GMAC1 RXC"; skew-delay = <15>; }; conf2 { - pins = "P8 GMAC0 TXEN", "V11 GMAC1 TXEN"; + pins = "T8 GMAC0 TXEN", "W11 GMAC1 TXEN"; skew-delay = <7>; }; conf3 { - pins = "V7 GMAC0 TXC"; + pins = "U8 GMAC0 TXC"; skew-delay = <11>; }; conf4 { - pins = "P10 GMAC1 TXC"; + pins = "V11 GMAC1 TXC"; skew-delay = <10>; }; conf5 { /* The data lines all have default skew */ - pins = "U8 GMAC0 RXD0", "V8 GMAC0 RXD1", - "P9 GMAC0 RXD2", "R9 GMAC0 RXD3", - "U7 GMAC0 TXD0", "T7 GMAC0 TXD1", - "R7 GMAC0 TXD2", "P7 GMAC0 TXD3", - "R11 GMAC1 RXD0", "P11 GMAC1 RXD1", - "V12 GMAC1 RXD2", "U12 GMAC1 RXD3", - "R10 GMAC1 TXD0", "T10 GMAC1 TXD1", - "U10 GMAC1 TXD2", "V10 GMAC1 TXD3"; + pins = "W8 GMAC0 RXD0", "V9 GMAC0 RXD1", + "Y8 GMAC0 RXD2", "U9 GMAC0 RXD3", + "T7 GMAC0 TXD0", "U6 GMAC0 TXD1", + "V7 GMAC0 TXD2", "U7 GMAC0 TXD3", + "Y12 GMAC1 RXD0", "V12 GMAC1 RXD1", + "T11 GMAC1 RXD2", "W12 GMAC1 RXD3", + "U10 GMAC1 TXD0", "Y10 GMAC1 TXD1", + "W10 GMAC1 TXD2", "T9 GMAC1 TXD3"; skew-delay = <7>; }; /* Set up drive strength on GMAC0 to 16 mA */
arch/arm/configs/socfpga_defconfig +1 -0
@@ -57,6 +57,7 @@ CONFIG_MTD_M25P80=y CONFIG_MTD_NAND=y CONFIG_MTD_NAND_DENALI_DT=y CONFIG_MTD_SPI_NOR=y +# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set CONFIG_SPI_CADENCE_QUADSPI=y CONFIG_OF_OVERLAY=y CONFIG_OF_CONFIGFS=y
arch/arm/include/asm/kvm_host.h +3 -0
@@ -77,6 +77,9 @@ struct kvm_arch {/* Interrupt controller */ struct vgic_dist vgic;int max_vcpus; + +/* Mandated version of PSCI */ +u32 psci_version; };#define KVM_NR_MEM_OBJS 40
arch/arm/include/uapi/asm/kvm.h +6 -0
@@ -186,6 +186,12 @@ struct kvm_arch_memory_slot {#define KVM_REG_ARM_VFP_FPINST 0x1009#define KVM_REG_ARM_VFP_FPINST2 0x100A +/* KVM-as-firmware specific pseudo-registers */ +#define KVM_REG_ARM_FW (0x0014 << KVM_REG_ARM_COPROC_SHIFT) +#define KVM_REG_ARM_FW_REG (r) (KVM_REG_ARM | KVM_REG_SIZE_U64 | \ + KVM_REG_ARM_FW | ((r) & 0xffff)) +#define KVM_REG_ARM_PSCI_VERSION KVM_REG_ARM_FW_REG(0) +/* Device Control API: ARM VGIC */ #define KVM_DEV_ARM_VGIC_GRP_ADDR 0#define KVM_DEV_ARM_VGIC_GRP_DIST_REGS 1
arch/arm/kvm/guest.c +13 -0
@@ -22,6 +22,7 @@#include <linux/module.h> #include <linux/vmalloc.h> #include <linux/fs.h> +#include <kvm/arm_psci.h> #include <asm/cputype.h> #include <linux/uaccess.h> #include <asm/kvm.h>
@@ -176,6 +177,7 @@ static unsigned long num_core_regs(void)unsigned long kvm_arm_num_regs (struct kvm_vcpu *vcpu) {return num_core_regs () +kvm_arm_num_coproc_regs (vcpu) + +kvm_arm_get_fw_num_regs (vcpu) +NUM_TIMER_REGS ; }
@@ -196,6 +198,11 @@ int kvm_arm_copy_reg_indices(struct kvm_vcpu *vcpu, u64 __user *uindices) uindices++; } + ret =kvm_arm_copy_fw_reg_indices (vcpu, uindices); +if (ret) +return ret; + uindices +=kvm_arm_get_fw_num_regs (vcpu); + ret =copy_timer_indices (vcpu, uindices);if (ret)return ret;
@@ -214,6 +221,9 @@ int kvm_arm_get_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)if ((reg->id &KVM_REG_ARM_COPROC_MASK ) ==KVM_REG_ARM_CORE )return get_core_reg (vcpu, reg); +if ((reg->id &KVM_REG_ARM_COPROC_MASK ) ==KVM_REG_ARM_FW ) +return kvm_arm_get_fw_reg (vcpu, reg); +if (is_timer_reg (reg->id))return get_timer_reg (vcpu, reg);
@@ -230,6 +240,9 @@ int kvm_arm_set_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)if ((reg->id &KVM_REG_ARM_COPROC_MASK ) ==KVM_REG_ARM_CORE )return set_core_reg (vcpu, reg); +if ((reg->id &KVM_REG_ARM_COPROC_MASK ) ==KVM_REG_ARM_FW ) +return kvm_arm_set_fw_reg (vcpu, reg); +if (is_timer_reg (reg->id))return set_timer_reg (vcpu, reg);
arch/arm64/include/asm/kvm_host.h +3 -0
@@ -75,6 +75,9 @@ struct kvm_arch {/* Interrupt controller */ struct vgic_dist vgic; + +/* Mandated version of PSCI */ +u32 psci_version; };#define KVM_NR_MEM_OBJS 40
arch/arm64/include/uapi/asm/kvm.h +6 -0
@@ -206,6 +206,12 @@ struct kvm_arch_memory_slot {#define KVM_REG_ARM_TIMER_CNT ARM64_SYS_REG(3, 3, 14, 3, 2)#define KVM_REG_ARM_TIMER_CVAL ARM64_SYS_REG(3, 3, 14, 0, 2) +/* KVM-as-firmware specific pseudo-registers */ +#define KVM_REG_ARM_FW (0x0014 << KVM_REG_ARM_COPROC_SHIFT) +#define KVM_REG_ARM_FW_REG (r) (KVM_REG_ARM64 | KVM_REG_SIZE_U64 | \ + KVM_REG_ARM_FW | ((r) & 0xffff)) +#define KVM_REG_ARM_PSCI_VERSION KVM_REG_ARM_FW_REG(0) +/* Device Control API: ARM VGIC */ #define KVM_DEV_ARM_VGIC_GRP_ADDR 0#define KVM_DEV_ARM_VGIC_GRP_DIST_REGS 1
arch/arm64/kvm/guest.c +13 -1
@@ -25,6 +25,7 @@#include <linux/module.h> #include <linux/vmalloc.h> #include <linux/fs.h> +#include <kvm/arm_psci.h> #include <asm/cputype.h> #include <linux/uaccess.h> #include <asm/kvm.h>
@@ -205,7 +206,7 @@ static int get_timer_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)unsigned long kvm_arm_num_regs (struct kvm_vcpu *vcpu) {return num_core_regs () +kvm_arm_num_sys_reg_descs (vcpu) - +NUM_TIMER_REGS ; + +kvm_arm_get_fw_num_regs (vcpu) +NUM_TIMER_REGS ; }/**
@@ -225,6 +226,11 @@ int kvm_arm_copy_reg_indices(struct kvm_vcpu *vcpu, u64 __user *uindices) uindices++; } + ret =kvm_arm_copy_fw_reg_indices (vcpu, uindices); +if (ret) +return ret; + uindices +=kvm_arm_get_fw_num_regs (vcpu); + ret =copy_timer_indices (vcpu, uindices);if (ret)return ret;
@@ -243,6 +249,9 @@ int kvm_arm_get_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)if ((reg->id &KVM_REG_ARM_COPROC_MASK ) ==KVM_REG_ARM_CORE )return get_core_reg (vcpu, reg); +if ((reg->id &KVM_REG_ARM_COPROC_MASK ) ==KVM_REG_ARM_FW ) +return kvm_arm_get_fw_reg (vcpu, reg); +if (is_timer_reg (reg->id))return get_timer_reg (vcpu, reg);
@@ -259,6 +268,9 @@ int kvm_arm_set_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)if ((reg->id &KVM_REG_ARM_COPROC_MASK ) ==KVM_REG_ARM_CORE )return set_core_reg (vcpu, reg); +if ((reg->id &KVM_REG_ARM_COPROC_MASK ) ==KVM_REG_ARM_FW ) +return kvm_arm_set_fw_reg (vcpu, reg); +if (is_timer_reg (reg->id))return set_timer_reg (vcpu, reg);
arch/powerpc/kernel/mce_power.c +2 -5
@@ -441,7 +441,6 @@ static int mce_handle_ierror(struct pt_regs *regs,if (pfn !=ULONG_MAX ) { *phys_addr = (pfn <<PAGE_SHIFT ); - handled =1 ; } } }
@@ -532,9 +531,7 @@ static int mce_handle_derror(struct pt_regs *regs,* kernel/exception-64s.h */ if (get_paca ()->in_mce <MAX_MCE_DEPTH ) -if (!mce_find_instr_ea_and_pfn (regs, addr, - phys_addr)) - handled =1 ; +mce_find_instr_ea_and_pfn (regs, addr, phys_addr); } found =1 ; }
@@ -572,7 +569,7 @@ static long mce_handle_error(struct pt_regs *regs, const struct mce_ierror_table itable[]) {struct mce_error_info mce_err = {0 }; -uint64_t addr, phys_addr; +uint64_t addr, phys_addr =ULONG_MAX ;uint64_t srr1 = regs->msr;long handled;
arch/powerpc/mm/mem.c +2 -0
@@ -143,6 +143,7 @@ int arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap, start, start + size, rc);return -EFAULT ; } +flush_inval_dcache_range (start, start + size);return __add_pages (nid, start_pfn, nr_pages, altmap, want_memblock); }
@@ -169,6 +170,7 @@ int arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap)/* Remove htab bolted mappings for this section of memory */ start = (unsigned long )__va (start); +flush_inval_dcache_range (start, start + size); ret =remove_section_mapping (start, start + size);/* Ensure all vmalloc mappings are flushed in case they also
arch/powerpc/platforms/powernv/npu-dma.c +19 -4
@@ -33,6 +33,13 @@#define npu_to_phb (x) container_of(x, struct pnv_phb, npu) +/* +* When an address shootdown range exceeds this threshold we invalidate the +* entire TLB on the GPU for the given PID rather than each specific address in +* the range. +*/ +#define ATSD_THRESHOLD (2*1024*1024) +/* * Other types of TCE cache invalidation are not functional in the * hardware.
@@ -627,11 +634,19 @@ static void pnv_npu2_mn_invalidate_range(struct mmu_notifier *mn,struct npu_context *npu_context =mn_to_npu_context (mn);unsigned long address; -for (address = start; address < end; address +=PAGE_SIZE ) -mmio_invalidate (npu_context,1 , address, false); +if (end - start >ATSD_THRESHOLD ) { +/* +* Just invalidate the entire PID if the address range is too +* large. +*/ +mmio_invalidate (npu_context,0 ,0 , true); + }else { +for (address = start; address < end; address +=PAGE_SIZE ) +mmio_invalidate (npu_context,1 , address, false); -/* Do the flush only on the final addess == end */ -mmio_invalidate (npu_context,1 , address, true); +/* Do the flush only on the final addess == end */ +mmio_invalidate (npu_context,1 , address, true); + } }static const struct mmu_notifier_ops nv_nmmu_notifier_ops = {
arch/powerpc/platforms/powernv/opal-rtc.c +5 -3
@@ -48,10 +48,12 @@ unsigned long __init opal_get_boot_time(void)while (rc ==OPAL_BUSY || rc ==OPAL_BUSY_EVENT ) { rc =opal_rtc_read (&__y_m_d, &__h_m_s_ms); -if (rc ==OPAL_BUSY_EVENT ) +if (rc ==OPAL_BUSY_EVENT ) { +mdelay (OPAL_BUSY_DELAY_MS );opal_poll_events (NULL ); -else if (rc ==OPAL_BUSY ) -mdelay (10 ); + }else if (rc ==OPAL_BUSY ) { +mdelay (OPAL_BUSY_DELAY_MS ); + } }if (rc !=OPAL_SUCCESS )return 0 ;
arch/sparc/include/uapi/asm/oradax.h +1 -1
@@ -3,7 +3,7 @@* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or +* the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful,
arch/x86/include/uapi/asm/msgbuf.h +31 -0
@@ -1 +1,32 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +#ifndef __ASM_X64_MSGBUF_H +#define __ASM_X64_MSGBUF_H + +#if !defined(__x86_64__) || !defined(__ILP32__)#include <asm-generic/msgbuf.h> +#else +/* +* The msqid64_ds structure for x86 architecture with x32 ABI. +* +* On x86-32 and x86-64 we can just use the generic definition, but +* x32 uses the same binary layout as x86_64, which is differnet +* from other 32-bit architectures. +*/ + +struct msqid64_ds { +struct ipc64_perm msg_perm; +__kernel_time_t msg_stime;/* last msgsnd time */ +__kernel_time_t msg_rtime;/* last msgrcv time */ +__kernel_time_t msg_ctime;/* last change time */ +__kernel_ulong_t msg_cbytes;/* current number of bytes on queue */ +__kernel_ulong_t msg_qnum;/* number of messages in queue */ +__kernel_ulong_t msg_qbytes;/* max number of bytes on queue */ +__kernel_pid_t msg_lspid;/* pid of last msgsnd */ +__kernel_pid_t msg_lrpid;/* last receive pid */ +__kernel_ulong_t __unused4; +__kernel_ulong_t __unused5; +}; + +#endif + +#endif /* __ASM_GENERIC_MSGBUF_H */
arch/x86/include/uapi/asm/shmbuf.h +42 -0
43 lines not on this page · raw message
arch/x86/kernel/cpu/microcode/core.c +2 -4
@@ -564,14 +564,12 @@ static int __reload_late(void *info)apply_microcode_local (&err);spin_unlock (&update_lock); +/* siblings return UCODE_OK because their engine got updated already */ if (err >UCODE_NFOUND ) {pr_warn ("Error reloading microcode on CPU %d\n" , cpu); -return -1 ; -/* siblings return UCODE_OK because their engine got updated already */ + ret =-1 ; }else if (err ==UCODE_UPDATED || err ==UCODE_OK ) { ret =1 ; - }else { -return ret; }/*
arch/x86/kernel/cpu/microcode/intel.c +0 -2
@@ -485,7 +485,6 @@ static void show_saved_mc(void)*/ static void save_mc_for_early (u8 *mc,unsigned int size) { -#ifdef CONFIG_HOTPLUG_CPU /* Synchronization during CPU hotplug. */ static DEFINE_MUTEX (x86_cpu_microcode_mutex);
@@ -495,7 +494,6 @@ static void save_mc_for_early(u8 *mc, unsigned int size)show_saved_mc ();mutex_unlock (&x86_cpu_microcode_mutex); -#endif }static bool load_builtin_intel_microcode (struct cpio_data *cp)
arch/x86/kernel/smpboot.c +2 -0
@@ -1536,6 +1536,8 @@ static inline void mwait_play_dead(void)void *mwait_ptr;int i; +if (boot_cpu_data.x86_vendor ==X86_VENDOR_AMD ) +return ;if (!this_cpu_has (X86_FEATURE_MWAIT ))return ;if (!this_cpu_has (X86_FEATURE_CLFLUSH ))
block/bfq-iosched.c +9 -1
@@ -4911,8 +4911,16 @@ static void bfq_prepare_request(struct request *rq, struct bio *bio)bool new_queue = false;bool bfqq_already_existing = false, split = false; -if (!rq->elv.icq) +/* +* Even if we don't have an icq attached, we should still clear +* the scheduler pointers, as they might point to previously +* allocated bic/bfqq structs. +*/ +if (!rq->elv.icq) { + rq->elv.priv[0 ] = rq->elv.priv[1 ] =NULL ;return ; + } + bic =icq_to_bic (rq->elv.icq);spin_lock_irq (&bfqd->lock);
block/blk-core.c +8 -7
@@ -129,6 +129,10 @@ void blk_rq_init(struct request_queue *q, struct request *rq) rq->part =NULL ;seqcount_init (&rq->gstate_seq);u64_stats_init (&rq->aborted_gstate_sync); +/* +* See comment of blk_mq_init_request +*/ +WRITE_ONCE (rq->gstate,MQ_RQ_GEN_INC ); }EXPORT_SYMBOL (blk_rq_init);
@@ -825,7 +829,6 @@ int blk_queue_enter(struct request_queue *q, blk_mq_req_flags_t flags)while (true) {bool success = false; -int ret;rcu_read_lock ();if (percpu_ref_tryget_live (&q->q_usage_counter)) {
@@ -857,14 +860,12 @@ int blk_queue_enter(struct request_queue *q, blk_mq_req_flags_t flags)*/ smp_rmb (); - ret =wait_event_interruptible (q->mq_freeze_wq, - (atomic_read (&q->mq_freeze_depth) ==0 && - (preempt || !blk_queue_preempt_only (q))) || -blk_queue_dying (q)); +wait_event (q->mq_freeze_wq, + (atomic_read (&q->mq_freeze_depth) ==0 && + (preempt || !blk_queue_preempt_only (q))) || +blk_queue_dying (q));if (blk_queue_dying (q))return -ENODEV ; -if (ret) -return ret; } }
block/blk-mq.c +7 -0
@@ -2076,6 +2076,13 @@ static int blk_mq_init_request(struct blk_mq_tag_set *set, struct request *rq,seqcount_init (&rq->gstate_seq);u64_stats_init (&rq->aborted_gstate_sync); +/* +* start gstate with gen 1 instead of 0, otherwise it will be equal +* to aborted_gstate, and be identified timed out by +* blk_mq_terminate_expired. +*/ +WRITE_ONCE (rq->gstate,MQ_RQ_GEN_INC ); +return 0 ; }
crypto/drbg.c +2 -0
@@ -1134,8 +1134,10 @@ static inline void drbg_dealloc_state(struct drbg_state *drbg)if (!drbg)return ;kzfree (drbg->Vbuf); + drbg->Vbuf =NULL ; drbg->V =NULL ;kzfree (drbg->Cbuf); + drbg->Cbuf =NULL ; drbg->C =NULL ;kzfree (drbg->scratchpadbuf); drbg->scratchpadbuf =NULL ;
drivers/amba/bus.c +11 -6
@@ -69,11 +69,12 @@ static ssize_t driver_override_show(struct device *_dev, struct device_attribute *attr, char *buf) { struct amba_device *dev = to_amba_device(_dev); +ssize_t len; -if (!dev->driver_override) -return 0 ; - -return sprintf (buf,"%s\n" , dev->driver_override); +device_lock (_dev); + len =sprintf (buf,"%s\n" , dev->driver_override); +device_unlock (_dev); +return len; } static ssize_t driver_override_store(struct device *_dev,
@@ -81,9 +82,10 @@ static ssize_t driver_override_store(struct device *_dev, const char *buf, size_t count) {struct amba_device *dev =to_amba_device (_dev); -char *driver_override, *old = dev->driver_override, *cp; +char *driver_override, *old, *cp; -if (count >PATH_MAX ) +/* We need to keep extra room for a newline */ +if (count >= (PAGE_SIZE -1 ))return -EINVAL ; driver_override =kstrndup (buf, count,GFP_KERNEL );
@@ -94,12 +96,15 @@ static ssize_t driver_override_store(struct device *_dev,if (cp) *cp ='\0' ; +device_lock (_dev); + old = dev->driver_override;if (strlen (driver_override)) { dev->driver_override = driver_override; }else {kfree (driver_override); dev->driver_override =NULL ; } +device_unlock (_dev);kfree (old);
drivers/android/binder.c +8 -0
@@ -2839,6 +2839,14 @@ static void binder_transaction(struct binder_proc *proc,else return_error =BR_DEAD_REPLY ;mutex_unlock (&context->context_mgr_node_lock); +if (target_node && target_proc == proc) { +binder_user_error ("%d:%d got transaction to context manager from process owning it\n" , + proc->pid, thread->pid); + return_error =BR_FAILED_REPLY ; + return_error_param = -EINVAL ; + return_error_line = __LINE__; + goto err_invalid_target_handle; + } }if (!target_node) {/*
drivers/char/random.c +67 -23
141 lines not on this page · raw message
drivers/char/virtio_console.c +71 -86
284 lines not on this page · raw message
drivers/cpufreq/powernv-cpufreq.c +11 -3
@@ -679,6 +679,16 @@ void gpstate_timer_handler(struct timer_list *t)if (!spin_trylock (&gpstates->gpstate_lock))return ; +/* +* If the timer has migrated to the different cpu then bring +* it back to one of the policy->cpus +*/ +if (!cpumask_test_cpu (raw_smp_processor_id (), policy->cpus)) { + gpstates->timer.expires = jiffies +msecs_to_jiffies (1 ); +add_timer_on (&gpstates->timer,cpumask_first (policy->cpus)); +spin_unlock (&gpstates->gpstate_lock); +return ; + }/* * If PMCR was last updated was using fast_swtich then
@@ -718,10 +728,8 @@ void gpstate_timer_handler(struct timer_list *t)if (gpstate_idx != gpstates->last_lpstate_idx)queue_gpstate_timer (gpstates); +set_pstate (&freq_data);spin_unlock (&gpstates->gpstate_lock); - -/* Timer may get migrated to a different cpu on cpu hot unplug */ -smp_call_function_any (policy->cpus, set_pstate, &freq_data,1 ); }/*
drivers/crypto/ccp/sp-dev.c +3 -3
@@ -252,12 +252,12 @@ struct sp_device *sp_get_psp_master_device(void) goto unlock;list_for_each_entry (i, &sp_units, entry) { -if (i->psp_data) +if (i->psp_data && i->get_psp_master_device) { + ret = i->get_psp_master_device ();break ; + } } -if (i->get_psp_master_device) - ret = i->get_psp_master_device (); unlock:write_unlock_irqrestore (&sp_unit_lock, flags);return ret;
drivers/fpga/altera-ps-spi.c +1 -1
@@ -249,7 +249,7 @@ static int altera_ps_probe(struct spi_device *spi) conf->data = of_id->data; conf->spi = spi; - conf->config =devm_gpiod_get (&spi->dev,"nconfig" ,GPIOD_OUT_HIGH ); + conf->config =devm_gpiod_get (&spi->dev,"nconfig" ,GPIOD_OUT_LOW );if (IS_ERR (conf->config)) {dev_err (&spi->dev,"Failed to get config gpio: %ld\n" ,PTR_ERR (conf->config));
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +5 -2
@@ -1459,10 +1459,11 @@ static const u32 sgpr_init_compute_shader[] =static const u32 vgpr_init_regs[] = { mmCOMPUTE_STATIC_THREAD_MGMT_SE0,0xffffffff , - mmCOMPUTE_RESOURCE_LIMITS,0 , + mmCOMPUTE_RESOURCE_LIMITS,0x1000000 ,/* CU_GROUP_COUNT=1 */ mmCOMPUTE_NUM_THREAD_X,256 *4 , mmCOMPUTE_NUM_THREAD_Y,1 , mmCOMPUTE_NUM_THREAD_Z,1 , + mmCOMPUTE_PGM_RSRC1,0x100004f ,/* VGPRS=15 (64 logical VGPRs), SGPRS=1 (16 SGPRs), BULKY=1 */ mmCOMPUTE_PGM_RSRC2,20 , mmCOMPUTE_USER_DATA_0,0xedcedc00 , mmCOMPUTE_USER_DATA_1,0xedcedc01 ,
@@ -1479,10 +1480,11 @@ static const u32 vgpr_init_regs[] =static const u32 sgpr1_init_regs[] = { mmCOMPUTE_STATIC_THREAD_MGMT_SE0,0x0f , - mmCOMPUTE_RESOURCE_LIMITS,0x1000000 , + mmCOMPUTE_RESOURCE_LIMITS,0x1000000 ,/* CU_GROUP_COUNT=1 */ mmCOMPUTE_NUM_THREAD_X,256 *5 , mmCOMPUTE_NUM_THREAD_Y,1 , mmCOMPUTE_NUM_THREAD_Z,1 , + mmCOMPUTE_PGM_RSRC1,0x240 ,/* SGPRS=9 (80 GPRS) */ mmCOMPUTE_PGM_RSRC2,20 , mmCOMPUTE_USER_DATA_0,0xedcedc00 , mmCOMPUTE_USER_DATA_1,0xedcedc01 ,
@@ -1503,6 +1505,7 @@ static const u32 sgpr2_init_regs[] = mmCOMPUTE_NUM_THREAD_X,256 *5 , mmCOMPUTE_NUM_THREAD_Y,1 , mmCOMPUTE_NUM_THREAD_Z,1 , + mmCOMPUTE_PGM_RSRC1,0x240 ,/* SGPRS=9 (80 GPRS) */ mmCOMPUTE_PGM_RSRC2,20 , mmCOMPUTE_USER_DATA_0,0xedcedc00 , mmCOMPUTE_USER_DATA_1, 0xedcedc01,
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +9 -1
@@ -4506,6 +4506,7 @@ static int dm_update_crtcs_state(struct dc *dc,struct amdgpu_dm_connector *aconnector =NULL ;struct drm_connector_state *new_con_state =NULL ;struct dm_connector_state *dm_conn_state =NULL ; +struct drm_plane_state *new_plane_state =NULL ; new_stream =NULL ;
@@ -4513,6 +4514,13 @@ static int dm_update_crtcs_state(struct dc *dc, dm_new_crtc_state =to_dm_crtc_state (new_crtc_state); acrtc =to_amdgpu_crtc (crtc); + new_plane_state =drm_atomic_get_new_plane_state (state, new_crtc_state->crtc->primary); + +if (new_crtc_state->enable && new_plane_state && !new_plane_state->fb) { + ret = -EINVAL ; + goto fail; + } + aconnector =amdgpu_dm_find_first_crtc_matching_connector (state, crtc);/* TODO This hack should go away */
@@ -4685,7 +4693,7 @@ static int dm_update_planes_state(struct dc *dc,if (!dm_old_crtc_state->stream)continue ; -DRM_DEBUG_DRIVER ("Disabling DRM plane: %d on DRM crtc %d\n" , +DRM_DEBUG_ATOMIC ("Disabling DRM plane: %d on DRM crtc %d\n" , plane->base.id, old_plane_crtc->base.id); if (!dc_remove_plane_from_context(
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c +3 -2
@@ -400,14 +400,15 @@ void amdgpu_dm_irq_fini(struct amdgpu_device *adev) {int src;struct irq_list_head *lh; +unsigned long irq_table_flags;DRM_DEBUG_KMS ("DM_IRQ: releasing resources.\n" ); -for (src =0 ; src <DAL_IRQ_SOURCES_NUMBER ; src++) { - +DM_IRQ_TABLE_LOCK (adev, irq_table_flags);/* The handler was removed from the table, * it means it is safe to flush all the 'work' * (because no code can schedule a new one). */ lh = &adev->dm.irq_handler_list_low_tab[src]; +DM_IRQ_TABLE_UNLOCK (adev, irq_table_flags);flush_work (&lh->work); }
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +10 -22
@@ -157,6 +157,11 @@ dm_dp_mst_connector_destroy(struct drm_connector *connector)struct amdgpu_dm_connector *amdgpu_dm_connector =to_amdgpu_dm_connector (connector);struct amdgpu_encoder *amdgpu_encoder = amdgpu_dm_connector->mst_encoder; +if (amdgpu_dm_connector->edid) { +kfree (amdgpu_dm_connector->edid); + amdgpu_dm_connector->edid =NULL ; + } +drm_encoder_cleanup (&amdgpu_encoder->base);kfree (amdgpu_encoder);drm_connector_cleanup (connector);
@@ -183,28 +188,22 @@ static int dm_connector_update_modes(struct drm_connector *connector,void dm_dp_mst_dc_sink_create (struct drm_connector *connector) {struct amdgpu_dm_connector *aconnector =to_amdgpu_dm_connector (connector); -struct edid *edid;struct dc_sink *dc_sink;struct dc_sink_init_data init_params = { .link = aconnector->dc_link, .sink_signal =SIGNAL_TYPE_DISPLAY_PORT_MST }; +/* FIXME none of this is safe. we shouldn't touch aconnector here in +* atomic_check +*/ +/* * TODO: Need to further figure out why ddc.algo is NULL while MST port exists */ if (!aconnector->port || !aconnector->port->aux.ddc.algo)return ; - edid =drm_dp_mst_get_edid (connector, &aconnector->mst_port->mst_mgr, aconnector->port); - -if (!edid) { -drm_mode_connector_update_edid_property ( - &aconnector->base, -NULL ); -return ; - } - - aconnector->edid = edid; +ASSERT (aconnector->edid); dc_sink = dc_link_add_remote_sink( aconnector->dc_link,
@@ -217,9 +216,6 @@ void dm_dp_mst_dc_sink_create(struct drm_connector *connector)amdgpu_dm_add_sink_to_freesync_module ( connector, aconnector->edid); - -drm_mode_connector_update_edid_property ( - &aconnector->base, aconnector->edid); }static int dm_dp_mst_get_modes (struct drm_connector *connector)
@@ -426,14 +422,6 @@ static void dm_dp_destroy_mst_connector(struct drm_dp_mst_topology_mgr *mgr,dc_sink_release (aconnector->dc_sink); aconnector->dc_sink =NULL ; } -if (aconnector->edid) { -kfree (aconnector->edid); - aconnector->edid =NULL ; - } - -drm_mode_connector_update_edid_property ( - &aconnector->base, -NULL ); aconnector->mst_connected = false; }
drivers/gpu/drm/drm_edid.c +3 -8
@@ -4450,6 +4450,7 @@ drm_reset_display_info(struct drm_connector *connector) info->max_tmds_clock =0 ; info->dvi_dual = false; info->has_hdmi_infoframe = false; +memset (&info->hdmi,0 ,sizeof (info->hdmi)); info->non_desktop =0 ; }
@@ -4461,17 +4462,11 @@ u32 drm_add_display_info(struct drm_connector *connector, const struct edid *ediu32 quirks =edid_get_quirks (edid); +drm_reset_display_info (connector); + info->width_mm = edid->width_cm *10 ; info->height_mm = edid->height_cm *10 ; -/* driver figures it out in this case */ - info->bpc =0 ; - info->color_formats =0 ; - info->cea_rev =0 ; - info->max_tmds_clock =0 ; - info->dvi_dual = false; - info->has_hdmi_infoframe = false; - info->non_desktop = !!(quirks &EDID_QUIRK_NON_DESKTOP );DRM_DEBUG_KMS ("non_desktop set to %d\n" , info->non_desktop);
drivers/gpu/drm/i915/intel_cdclk.c +14 -2
@@ -1946,10 +1946,22 @@ int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_state) } } -/* According to BSpec, "The CD clock frequency must be at least twice +/* +* According to BSpec, "The CD clock frequency must be at least twice * the frequency of the Azalia BCLK." and BCLK is 96 MHz by default. +* +* FIXME: Check the actual, not default, BCLK being used. +* +* FIXME: This does not depend on ->has_audio because the higher CDCLK +* is required for audio probe, also when there are no audio capable +* displays connected at probe time. This leads to unnecessarily high +* CDCLK when audio is not required. +* +* FIXME: This limit is only applied when there are displays connected +* at probe time. If we probe without displays, we'll still end up using +* the platform minimum CDCLK, failing audio probe. */ -if (crtc_state->has_audio &&INTEL_GEN (dev_priv) >=9 ) +if (INTEL_GEN (dev_priv) >=9 ) min_cdclk =max (2 *96000 , min_cdclk);/*
drivers/gpu/drm/i915/intel_fbdev.c +1 -1
@@ -801,7 +801,7 @@ void intel_fbdev_output_poll_changed(struct drm_device *dev)return ;intel_fbdev_sync (ifbdev); -if (ifbdev->vma) +if (ifbdev->vma || ifbdev->helper.deferred_setup)drm_fb_helper_hotplug_event (&ifbdev->helper); }
drivers/gpu/drm/i915/intel_runtime_pm.c +5 -6
@@ -624,19 +624,18 @@ void skl_enable_dc6(struct drm_i915_private *dev_priv)DRM_DEBUG_KMS ("Enabling DC6\n" ); -gen9_set_dc_state (dev_priv,DC_STATE_EN_UPTO_DC6 ); +/* Wa Display #1183: skl,kbl,cfl */ +if (IS_GEN9_BC (dev_priv)) +I915_WRITE (GEN8_CHICKEN_DCPR_1 ,I915_READ (GEN8_CHICKEN_DCPR_1 ) | +SKL_SELECT_ALTERNATE_DC_EXIT ); +gen9_set_dc_state (dev_priv,DC_STATE_EN_UPTO_DC6 ); }void skl_disable_dc6 (struct drm_i915_private *dev_priv) {DRM_DEBUG_KMS ("Disabling DC6\n" ); -/* Wa Display #1183: skl,kbl,cfl */ -if (IS_GEN9_BC (dev_priv)) -I915_WRITE (GEN8_CHICKEN_DCPR_1 ,I915_READ (GEN8_CHICKEN_DCPR_1 ) | -SKL_SELECT_ALTERNATE_DC_EXIT ); -gen9_set_dc_state (dev_priv,DC_STATE_DISABLE ); }
drivers/gpu/drm/virtio/virtgpu_vq.c +2 -2
@@ -291,7 +291,7 @@ static int virtio_gpu_queue_ctrl_buffer_locked(struct virtio_gpu_device *vgdev, ret =virtqueue_add_sgs (vq, sgs, outcnt, incnt, vbuf,GFP_ATOMIC );if (ret == -ENOSPC ) {spin_unlock (&vgdev->ctrlq.qlock); -wait_event (vgdev->ctrlq.ack_queue, vq->num_free); +wait_event (vgdev->ctrlq.ack_queue, vq->num_free >= outcnt + incnt);spin_lock (&vgdev->ctrlq.qlock); goto retry; }else {
@@ -366,7 +366,7 @@ static int virtio_gpu_queue_cursor(struct virtio_gpu_device *vgdev, ret =virtqueue_add_sgs (vq, sgs, outcnt,0 , vbuf,GFP_ATOMIC );if (ret == -ENOSPC ) {spin_unlock (&vgdev->cursorq.qlock); -wait_event (vgdev->cursorq.ack_queue, vq->num_free); +wait_event (vgdev->cursorq.ack_queue, vq->num_free >= outcnt);spin_lock (&vgdev->cursorq.qlock); goto retry; }else {
drivers/mtd/chips/cfi_cmdset_0001.c +28 -5
@@ -45,6 +45,7 @@#define I82802AB 0x00ad#define I82802AC 0x00ac#define PF38F4476 0x881c +#define M28F00AP30 0x8963/* STMicroelectronics chips */ #define M50LPW080 0x002F#define M50FLW080A 0x0080
@@ -375,6 +376,17 @@ static void cfi_fixup_major_minor(struct cfi_private *cfi, extp->MinorVersion ='1' ; } +static int cfi_is_micron_28F00AP30 (struct cfi_private *cfi,struct flchip *chip) +{ +/* +* Micron(was Numonyx) 1Gbit bottom boot are buggy w.r.t +* Erase Supend for their small Erase Blocks(0x8000) +*/ +if (cfi->mfr ==CFI_MFR_INTEL && cfi->id ==M28F00AP30 ) +return 1 ; +return 0 ; +} +static inline struct cfi_pri_intelext *read_pri_intelext (struct map_info *map,__u16 adr) {
@@ -831,21 +843,30 @@ static int chip_ready (struct map_info *map, struct flchip *chip, unsigned long (mode == FL_WRITING && (cfip->SuspendCmdSupport & 1)))) goto sleep; +/* Do not allow suspend iff read/write to EB address */ +if ((adr & chip->in_progress_block_mask) == + chip->in_progress_block_addr) + goto sleep; + +/* do not suspend small EBs, buggy Micron Chips */ +if (cfi_is_micron_28F00AP30 (cfi, chip) && + (chip->in_progress_block_mask == ~(0x8000 -1 ))) + goto sleep;/* Erase suspend */ -map_write (map,CMD (0xB0 ), adr); +map_write (map,CMD (0xB0 ), chip->in_progress_block_addr);/* If the flash has finished erasing, then 'erase suspend' * appears to make some (28F320) flash devices switch to * 'read' mode. Make sure that we switch to 'read status' * mode so we get the right data. --rmk */ -map_write (map,CMD (0x70 ), adr); +map_write (map,CMD (0x70 ), chip->in_progress_block_addr); chip->oldstate =FL_ERASING ; chip->state =FL_ERASE_SUSPENDING ; chip->erase_suspended =1 ;for (;;) { - status =map_read (map, adr); + status =map_read (map, chip->in_progress_block_addr);if (map_word_andequal (map, status, status_OK, status_OK))break ;
@@ -1041,8 +1062,8 @@ static void put_chip(struct map_info *map, struct flchip *chip, unsigned long adsending the 0x70 (Read Status) command to an erasing chip and expecting it to be ignored, that's what we do. */ -map_write (map,CMD (0xd0 ), adr); -map_write (map,CMD (0x70 ), adr); +map_write (map,CMD (0xd0 ), chip->in_progress_block_addr); +map_write (map,CMD (0x70 ), chip->in_progress_block_addr); chip->oldstate =FL_READY ; chip->state =FL_ERASING ;break ;
@@ -1933,6 +1954,8 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip,map_write (map,CMD (0xD0 ), adr); chip->state =FL_ERASING ; chip->erase_suspended =0 ; + chip->in_progress_block_addr = adr; + chip->in_progress_block_mask = ~(len -1 ); ret = INVAL_CACHE_AND_WAIT(map, chip, adr, adr, len,
drivers/mtd/chips/cfi_cmdset_0002.c +6 -3
@@ -816,9 +816,10 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr (mode == FL_WRITING && (cfip->EraseSuspend & 0x2)))) goto sleep; -/* We could check to see if we're trying to access the sector -* that is currently being erased. However, no user will try -* anything like that so we just wait for the timeout. */ +/* Do not allow suspend iff read/write to EB address */ +if ((adr & chip->in_progress_block_mask) == + chip->in_progress_block_addr) + goto sleep;/* Erase suspend */ /* It's harmless to issue the Erase-Suspend and Erase-Resume
@@ -2267,6 +2268,7 @@ static int __xipram do_erase_chip(struct map_info *map, struct flchip *chip) chip->state =FL_ERASING ; chip->erase_suspended =0 ; chip->in_progress_block_addr = adr; + chip->in_progress_block_mask = ~(map->size -1 ); INVALIDATE_CACHE_UDELAY(map, chip, adr, map->size,
@@ -2356,6 +2358,7 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip, chip->state =FL_ERASING ; chip->erase_suspended =0 ; chip->in_progress_block_addr = adr; + chip->in_progress_block_mask = ~(len -1 ); INVALIDATE_CACHE_UDELAY(map, chip, adr, len,
drivers/mtd/nand/marvell_nand.c +8 -17
@@ -2277,29 +2277,20 @@ static int marvell_nand_chip_init(struct device *dev, struct marvell_nfc *nfc,/* * The legacy "num-cs" property indicates the number of CS on the only * chip connected to the controller (legacy bindings does not support -* more than one chip). CS are only incremented one by one while the RB -* pin is always the #0. +* more than one chip). The CS and RB pins are always the #0. * * When not using legacy bindings, a couple of "reg" and "nand-rb" * properties must be filled. For each chip, expressed as a subnode, * "reg" points to the CS lines and "nand-rb" to the RB line. */ -if (pdata) { +if (pdata || nfc->caps->legacy_of_bindings) { nsels =1 ; - }else if (nfc->caps->legacy_of_bindings && - !of_get_property (np,"num-cs" , &nsels)) { -dev_err (dev,"missing num-cs property\n" ); -return -EINVAL ; - }else if (!of_get_property (np,"reg" , &nsels)) { -dev_err (dev,"missing reg property\n" ); -return -EINVAL ; - } - -if (!pdata) - nsels /=sizeof (u32); -if (!nsels) { -dev_err (dev,"invalid reg property size\n" ); -return -EINVAL ; + }else { + nsels =of_property_count_elems_of_size (np,"reg" ,sizeof (u32)); +if (nsels <=0 ) { +dev_err (dev,"missing/invalid reg property\n" ); +return -EINVAL ; + } }/* Alloc the nand chip structure */
drivers/mtd/nand/tango_nand.c +1 -1
@@ -643,7 +643,7 @@ static int tango_nand_probe(struct platform_device *pdev)writel_relaxed (MODE_RAW , nfc->pbus_base +PBUS_PAD_MODE ); - clk =clk_get (&pdev->dev,NULL ); + clk =devm_clk_get (&pdev->dev,NULL );if (IS_ERR (clk))return PTR_ERR (clk);
drivers/mtd/spi-nor/cadence-quadspi.c +17 -2
@@ -501,7 +501,9 @@ static int cqspi_indirect_read_execute(struct spi_nor *nor, u8 *rxbuf,void __iomem *reg_base = cqspi->iobase;void __iomem *ahb_base = cqspi->ahb_base;unsigned int remaining = n_rx; +unsigned int mod_bytes = n_rx %4 ;unsigned int bytes_to_read =0 ; +u8 *rxbuf_end = rxbuf + n_rx;int ret =0 ;writel (from_addr, reg_base +CQSPI_REG_INDIRECTRDSTARTADDR );
@@ -530,11 +532,24 @@ static int cqspi_indirect_read_execute(struct spi_nor *nor, u8 *rxbuf, }while (bytes_to_read !=0 ) { +unsigned int word_remain =round_down (remaining,4 ); + bytes_to_read *= cqspi->fifo_width; bytes_to_read = bytes_to_read > remaining ? remaining : bytes_to_read; -ioread32_rep (ahb_base, rxbuf, -DIV_ROUND_UP (bytes_to_read,4 )); + bytes_to_read =round_down (bytes_to_read,4 ); +/* Read 4 byte word chunks then single bytes */ +if (bytes_to_read) { +ioread32_rep (ahb_base, rxbuf, + (bytes_to_read /4 )); + }else if (!word_remain && mod_bytes) { +unsigned int temp =ioread32 (ahb_base); + + bytes_to_read = mod_bytes; +memcpy (rxbuf, &temp,min ((unsigned int ) + (rxbuf_end - rxbuf), + bytes_to_read)); + } rxbuf += bytes_to_read; remaining -= bytes_to_read; bytes_to_read =cqspi_get_rd_sram_level (cqspi);
drivers/of/fdt.c +5 -2
@@ -942,7 +942,7 @@ int __init early_init_dt_scan_chosen_stdout(void)int offset;const char *p, *q, *options =NULL ;int l; -const struct earlycon_id *match; +const struct earlycon_id **p_match;const void *fdt = initial_boot_params; offset =fdt_path_offset (fdt,"/chosen" );
@@ -969,7 +969,10 @@ int __init early_init_dt_scan_chosen_stdout(void)return 0 ; } -for (match = __earlycon_table; match < __earlycon_table_end; match++) { +for (p_match = __earlycon_table; p_match < __earlycon_table_end; + p_match++) { +const struct earlycon_id *match = *p_match; +if (!match->compatible[0 ])continue ;
drivers/pci/host/pci-aardvark.c +30 -23
126 lines not on this page · raw message
drivers/pci/pci-driver.c +3 -2
@@ -945,10 +945,11 @@ static int pci_pm_freeze(struct device *dev)* devices should not be touched during freeze/thaw transitions, * however. */ -if (!dev_pm_test_driver_flags (dev,DPM_FLAG_SMART_SUSPEND )) +if (!dev_pm_smart_suspend_and_suspended (dev)) {pm_runtime_resume (dev); + pci_dev->state_saved = false; + } - pci_dev->state_saved = false;if (pm->freeze) {int error;
drivers/rtc/rtc-opal.c +23 -14
@@ -57,7 +57,7 @@ static void tm_to_opal(struct rtc_time *tm, u32 *y_m_d, u64 *h_m_s_ms)static int opal_get_rtc_time (struct device *dev,struct rtc_time *tm) { -long rc =OPAL_BUSY ; +s64 rc =OPAL_BUSY ;int retries =10 ;u32 y_m_d;u64 h_m_s_ms;
@@ -66,13 +66,17 @@ static int opal_get_rtc_time(struct device *dev, struct rtc_time *tm)while (rc ==OPAL_BUSY || rc ==OPAL_BUSY_EVENT ) { rc =opal_rtc_read (&__y_m_d, &__h_m_s_ms); -if (rc ==OPAL_BUSY_EVENT ) +if (rc ==OPAL_BUSY_EVENT ) { +msleep (OPAL_BUSY_DELAY_MS );opal_poll_events (NULL ); -else if (retries-- && (rc ==OPAL_HARDWARE - || rc ==OPAL_INTERNAL_ERROR )) -msleep (10 ); -else if (rc !=OPAL_BUSY && rc !=OPAL_BUSY_EVENT ) -break ; + }else if (rc ==OPAL_BUSY ) { +msleep (OPAL_BUSY_DELAY_MS ); + }else if (rc ==OPAL_HARDWARE || rc ==OPAL_INTERNAL_ERROR ) { +if (retries--) { +msleep (10 );/* Wait 10ms before retry */ + rc =OPAL_BUSY ;/* go around again */ + } + } }if (rc !=OPAL_SUCCESS )
@@ -87,21 +91,26 @@ static int opal_get_rtc_time(struct device *dev, struct rtc_time *tm)static int opal_set_rtc_time (struct device *dev,struct rtc_time *tm) { -long rc =OPAL_BUSY ; +s64 rc =OPAL_BUSY ;int retries =10 ;u32 y_m_d =0 ;u64 h_m_s_ms =0 ;tm_to_opal (tm, &y_m_d, &h_m_s_ms); +while (rc ==OPAL_BUSY || rc ==OPAL_BUSY_EVENT ) { rc =opal_rtc_write (y_m_d, h_m_s_ms); -if (rc ==OPAL_BUSY_EVENT ) +if (rc ==OPAL_BUSY_EVENT ) { +msleep (OPAL_BUSY_DELAY_MS );opal_poll_events (NULL ); -else if (retries-- && (rc ==OPAL_HARDWARE - || rc ==OPAL_INTERNAL_ERROR )) -msleep (10 ); -else if (rc !=OPAL_BUSY && rc !=OPAL_BUSY_EVENT ) -break ; + }else if (rc ==OPAL_BUSY ) { +msleep (OPAL_BUSY_DELAY_MS ); + }else if (rc ==OPAL_HARDWARE || rc ==OPAL_INTERNAL_ERROR ) { +if (retries--) { +msleep (10 );/* Wait 10ms before retry */ + rc =OPAL_BUSY ;/* go around again */ + } + } }return rc ==OPAL_SUCCESS ?0 : -EIO ;
drivers/s390/cio/vfio_ccw_fsm.c +12 -7
@@ -20,12 +20,12 @@ static int fsm_io_helper(struct vfio_ccw_private *private)int ccode;__u8 lpm;unsigned long flags; +int ret; sch = private->sch;spin_lock_irqsave (sch->lock, flags); private->state =VFIO_CCW_STATE_BUSY ; -spin_unlock_irqrestore (sch->lock, flags); orb =cp_get_orb (&private->cp, (u32 )(addr_t )sch, sch->lpm);
@@ -38,10 +38,12 @@ static int fsm_io_helper(struct vfio_ccw_private *private)* Initialize device status information */ sch->schib.scsw.cmd.actl |=SCSW_ACTL_START_PEND ; -return 0 ; + ret =0 ; +break ;case 1 :/* Status pending */ case 2 :/* Busy */ -return -EBUSY ; + ret = -EBUSY ; +break ;case 3 :/* Device/path not operational */ { lpm = orb->cmd.lpm;
@@ -51,13 +53,16 @@ static int fsm_io_helper(struct vfio_ccw_private *private) sch->lpm =0 ;if (cio_update_schib (sch)) -return -ENODEV ; - -return sch->lpm ? -EACCES : -ENODEV ; + ret = -ENODEV ; +else + ret = sch->lpm ? -EACCES : -ENODEV ; +break ; }default : -return ccode; + ret = ccode; } +spin_unlock_irqrestore (sch->lock, flags); +return ret; } static void fsm_notoper(struct vfio_ccw_private *private,
drivers/sbus/char/oradax.c +1 -1
@@ -3,7 +3,7 @@* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or +* the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful,
drivers/scsi/sd.c +2 -0
@@ -2121,6 +2121,8 @@ sd_spinup_disk(struct scsi_disk *sdkp)break ;/* standby */ if (sshdr.asc ==4 && sshdr.ascq ==0xc )break ;/* unavailable */ +if (sshdr.asc ==4 && sshdr.ascq ==0x1b ) +break ;/* sanitize in progress */ /* * Issue command to spin up drive when not ready */
drivers/scsi/sd_zbc.c +82 -58
267 lines not on this page · raw message
drivers/slimbus/messaging.c +1 -1
@@ -183,7 +183,7 @@ static u16 slim_slicesize(int code)0 ,1 ,2 ,3 ,3 ,4 ,4 ,5 ,5 ,5 ,5 ,6 ,6 ,6 ,6 ,7 }; -clamp (code,1 , (int )ARRAY_SIZE (sizetocode)); + code =clamp (code,1 , (int )ARRAY_SIZE (sizetocode));return sizetocode[code -1 ]; }
drivers/tty/n_gsm.c +22 -1
@@ -121,6 +121,9 @@ struct gsm_dlci {struct mutex mutex;/* Link layer */ +int mode; +#define DLCI_MODE_ABM 0/* Normal Asynchronous Balanced Mode */ +#define DLCI_MODE_ADM 1/* Asynchronous Disconnected Mode */ spinlock_t lock;/* Protects the internal state */ struct timer_list t1;/* Retransmit timer for SABM and UA */ int retries;
@@ -1364,7 +1367,13 @@ static struct gsm_control *gsm_control_send(struct gsm_mux *gsm, ctrl->data = data; ctrl->len = clen; gsm->pending_cmd = ctrl; - gsm->cretries = gsm->n2; + +/* If DLCI0 is in ADM mode skip retries, it won't respond */ +if (gsm->dlci[0 ]->mode ==DLCI_MODE_ADM ) + gsm->cretries =1 ; +else + gsm->cretries = gsm->n2; +mod_timer (&gsm->t2_timer, jiffies + gsm->t2 *HZ /100 );gsm_control_transmit (gsm, ctrl);spin_unlock_irqrestore (&gsm->control_lock, flags);
@@ -1472,6 +1481,7 @@ static void gsm_dlci_t1(struct timer_list *t)if (debug &8 )pr_info ("DLCI %d opening in ADM mode.\n" , dlci->addr); + dlci->mode =DLCI_MODE_ADM ;gsm_dlci_open (dlci); }else {gsm_dlci_close (dlci);
@@ -2861,11 +2871,22 @@ static int gsmtty_modem_update(struct gsm_dlci *dlci, u8 brk)static int gsm_carrier_raised (struct tty_port *port) { struct gsm_dlci *dlci = container_of(port, struct gsm_dlci, port); +struct gsm_mux *gsm = dlci->gsm; +/* Not yet open so no carrier info */ if (dlci->state !=DLCI_OPEN )return 0 ;if (debug &2 )return 1 ; + +/* +* Basic mode with control channel in ADM mode may not respond +* to CMD_MSC at all and modem_rx is empty. +*/ +if (gsm->encoding ==0 && gsm->dlci[0 ]->mode ==DLCI_MODE_ADM && + !dlci->modem_rx) +return 1 ; +return dlci->modem_rx &TIOCM_CD ; }
drivers/tty/serial/earlycon.c +4 -2
@@ -169,7 +169,7 @@ static int __init register_earlycon(char *buf, const struct earlycon_id *match)*/ int __init setup_earlycon (char *buf) { -const struct earlycon_id *match; +const struct earlycon_id **p_match;if (!buf || !buf[0 ])return -EINVAL ;
@@ -177,7 +177,9 @@ int __init setup_earlycon(char *buf)if (early_con.flags &CON_ENABLED )return -EALREADY ; -for (match = __earlycon_table; match < __earlycon_table_end; match++) { +for (p_match = __earlycon_table; p_match < __earlycon_table_end; + p_match++) { +const struct earlycon_id *match = *p_match;size_t len =strlen (match->name);if (strncmp (buf, match->name, len))
drivers/tty/serial/mvebu-uart.c +0 -1
@@ -495,7 +495,6 @@ static void mvebu_uart_set_termios(struct uart_port *port, termios->c_iflag |= old->c_iflag & ~(INPCK |IGNPAR ); termios->c_cflag &=CREAD |CBAUD ; termios->c_cflag |= old->c_cflag & ~(CREAD |CBAUD ); - termios->c_lflag = old->c_lflag; }spin_unlock_irqrestore (&port->lock, flags);
drivers/tty/tty_io.c +4 -1
@@ -2816,7 +2816,10 @@ struct tty_struct *alloc_tty_struct(struct tty_driver *driver, int idx)kref_init (&tty->kref); tty->magic =TTY_MAGIC ; -tty_ldisc_init (tty); +if (tty_ldisc_init (tty)) { +kfree (tty); +return NULL ; + } tty->session =NULL ; tty->pgrp =NULL ;mutex_init (&tty->legacy_mutex);
drivers/tty/tty_ldisc.c +13 -16
@@ -176,12 +176,11 @@ static struct tty_ldisc *tty_ldisc_get(struct tty_struct *tty, int disc)return ERR_CAST (ldops); } - ld =kmalloc (sizeof (struct tty_ldisc ),GFP_KERNEL ); -if (ld ==NULL ) { -put_ldops (ldops); -return ERR_PTR (-ENOMEM ); - } - +/* +* There is no way to handle allocation failure of only 16 bytes. +* Let's simplify error handling and save more memory. +*/ + ld =kmalloc (sizeof (struct tty_ldisc ),GFP_KERNEL | __GFP_NOFAIL); ld->ops = ldops; ld->tty = tty;
@@ -527,19 +526,16 @@ static int tty_ldisc_failto(struct tty_struct *tty, int ld)static void tty_ldisc_restore (struct tty_struct *tty,struct tty_ldisc *old) {/* There is an outstanding reference here so this is safe */ - old =tty_ldisc_get (tty, old->ops->num); -WARN_ON (IS_ERR (old)); - tty->ldisc = old; -tty_set_termios_ldisc (tty, old->ops->num); -if (tty_ldisc_open (tty, old) <0 ) { -tty_ldisc_put (old); +if (tty_ldisc_failto (tty, old->ops->num) <0 ) { +const char *name =tty_name (tty); + +pr_warn ("Falling back ldisc for %s.\n" , name);/* The traditional behaviour is to fall back to N_TTY, we want to avoid falling back to N_NULL unless we have no choice to avoid the risk of breaking anything */ if (tty_ldisc_failto (tty,N_TTY ) <0 &&tty_ldisc_failto (tty,N_NULL ) <0 ) -panic ("Couldn't open N_NULL ldisc for %s." , -tty_name (tty)); +panic ("Couldn't open N_NULL ldisc for %s." , name); } }
@@ -824,12 +820,13 @@ EXPORT_SYMBOL_GPL(tty_ldisc_release);* the tty structure is not completely set up when this call is made. */ -void tty_ldisc_init (struct tty_struct *tty) +int tty_ldisc_init (struct tty_struct *tty) {struct tty_ldisc *ld =tty_ldisc_get (tty,N_TTY );if (IS_ERR (ld)) -panic ("n_tty: init_tty" ); +return PTR_ERR (ld); tty->ldisc = ld; +return 0 ; }/**
drivers/usb/core/hcd.c +1 -0
@@ -2365,6 +2365,7 @@ void usb_hcd_resume_root_hub (struct usb_hcd *hcd)spin_lock_irqsave (&hcd_root_hub_lock, flags);if (hcd->rh_registered) { +pm_wakeup_event (&hcd->self.root_hub->dev,0 );set_bit (HCD_FLAG_WAKEUP_PENDING , &hcd->flags);queue_work (pm_wq, &hcd->wakeup_work); }
drivers/usb/core/hub.c +9 -1
@@ -653,12 +653,17 @@ void usb_wakeup_notification(struct usb_device *hdev, unsigned int portnum) {struct usb_hub *hub; +struct usb_port *port_dev;if (!hdev)return ; hub =usb_hub_to_struct_hub (hdev);if (hub) { + port_dev = hub->ports[portnum -1 ]; +if (port_dev && port_dev->child) +pm_wakeup_event (&port_dev->child->dev,0 ); +set_bit (portnum, hub->wakeup_bits);kick_hub_wq (hub); }
@@ -3430,8 +3435,11 @@ int usb_port_resume(struct usb_device *udev, pm_message_t msg)/* Skip the initial Clear-Suspend step for a remote wakeup */ status =hub_port_status (hub, port1, &portstatus, &portchange); -if (status ==0 && !port_is_suspended (hub, portstatus)) +if (status ==0 && !port_is_suspended (hub, portstatus)) { +if (portchange &USB_PORT_STAT_C_SUSPEND ) +pm_wakeup_event (&udev->dev,0 ); goto SuspendCleared; + }/* see 7.1.7.7; affects power usage, but not budgeting */ if (hub_is_superspeed (hub->hdev))
drivers/usb/core/quirks.c +3 -0
@@ -40,6 +40,9 @@ static const struct usb_device_id usb_quirk_list[] = { { USB_DEVICE(0x03f0, 0x0701), .driver_info = USB_QUIRK_STRING_FETCH_255 }, + /* HP v222w 16GB Mini USB Drive */ + { USB_DEVICE(0x03f0, 0x3f40), .driver_info = USB_QUIRK_DELAY_INIT }, + /* Creative SB Audigy 2 NX */ { USB_DEVICE(0x041e, 0x3020), .driver_info = USB_QUIRK_RESET_RESUME },
drivers/usb/host/xhci-dbgtty.c +5 -3
@@ -320,9 +320,11 @@ int xhci_dbc_tty_register_driver(struct xhci_hcd *xhci)void xhci_dbc_tty_unregister_driver (void ) { -tty_unregister_driver (dbc_tty_driver); -put_tty_driver (dbc_tty_driver); - dbc_tty_driver =NULL ; +if (dbc_tty_driver) { +tty_unregister_driver (dbc_tty_driver); +put_tty_driver (dbc_tty_driver); + dbc_tty_driver =NULL ; + } }static void dbc_rx_push (unsigned long _port)
drivers/usb/host/xhci-pci.c +4 -1
@@ -126,7 +126,10 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)if (pdev->vendor ==PCI_VENDOR_ID_AMD &&usb_amd_find_chipset_info ()) xhci->quirks |=XHCI_AMD_PLL_FIX ; -if (pdev->vendor ==PCI_VENDOR_ID_AMD && pdev->device ==0x43bb ) +if (pdev->vendor ==PCI_VENDOR_ID_AMD && + (pdev->device ==0x15e0 || + pdev->device ==0x15e1 || + pdev->device ==0x43bb )) xhci->quirks |=XHCI_SUSPEND_DELAY ;if (pdev->vendor ==PCI_VENDOR_ID_AMD )
drivers/usb/host/xhci-plat.c +0 -1
@@ -419,7 +419,6 @@ MODULE_DEVICE_TABLE(acpi, usb_xhci_acpi_match);static struct platform_driver usb_xhci_driver = { .probe = xhci_plat_probe, .remove = xhci_plat_remove, - .shutdown = usb_hcd_platform_shutdown, .driver = { .name ="xhci-hcd" , .pm = &xhci_plat_pm_ops,
drivers/usb/serial/Kconfig +1 -0
@@ -62,6 +62,7 @@ config USB_SERIAL_SIMPLE - Fundamental Software dongle. - Google USB serial devices - HP4x calculators + - Libtransistor USB console - a number of Motorola phones - Motorola Tetra devices - Novatel Wireless GPS receivers
drivers/usb/serial/cp210x.c +1 -0
@@ -214,6 +214,7 @@ static const struct usb_device_id id_table[] = { { USB_DEVICE(0x3195, 0xF190) }, /* Link Instruments MSO-19 */ { USB_DEVICE(0x3195, 0xF280) }, /* Link Instruments MSO-28 */ { USB_DEVICE(0x3195, 0xF281) }, /* Link Instruments MSO-28 */ + { USB_DEVICE(0x3923, 0x7A0B) }, /* National Instruments USB Serial Console */ { USB_DEVICE(0x413C, 0x9500) }, /* DW700 GPS USB interface */ { } /* Terminating Entry */ };
drivers/usb/serial/ftdi_sio.c +2 -1
@@ -1898,7 +1898,8 @@ static int ftdi_8u2232c_probe(struct usb_serial *serial)return ftdi_jtag_probe (serial);if (udev->product && - (!strcmp (udev->product,"BeagleBone/XDS100V2" ) || + (!strcmp (udev->product,"Arrow USB Blaster" ) || + !strcmp (udev->product,"BeagleBone/XDS100V2" ) || !strcmp (udev->product,"SNAP Connect E10" )))return ftdi_jtag_probe (serial);
drivers/usb/serial/usb-serial-simple.c +7 -0
@@ -63,6 +63,11 @@ DEVICE(flashloader, FLASHLOADER_IDS); 0x01) }DEVICE (google,GOOGLE_IDS ); +/* Libtransistor USB console */ +#define LIBTRANSISTOR_IDS () \ + { USB_DEVICE(0x1209, 0x8b00) } +DEVICE (libtransistor,LIBTRANSISTOR_IDS ); +/* ViVOpay USB Serial Driver */ #define VIVOPAY_IDS () \ { USB_DEVICE(0x1d5f, 0x1004) }/* ViVOpay 8800 */
@@ -110,6 +115,7 @@ static struct usb_serial_driver * const serial_drivers[] = { &funsoft_device, &flashloader_device, &google_device, + &libtransistor_device, &vivopay_device, &moto_modem_device, &motorola_tetra_device,
@@ -126,6 +132,7 @@ static const struct usb_device_id id_table[] = {FUNSOFT_IDS (),FLASHLOADER_IDS (),GOOGLE_IDS (), +LIBTRANSISTOR_IDS (),VIVOPAY_IDS (),MOTO_IDS (), MOTOROLA_TETRA_IDS(),
drivers/usb/typec/ucsi/ucsi.c +1 -1
@@ -28,7 +28,7 @@* difficult to estimate the time it takes for the system to process the command * before it is actually passed to the PPM. */ -#define UCSI_TIMEOUT_MS 1000 +#define UCSI_TIMEOUT_MS 5000/* * UCSI_SWAP_TIMEOUT_MS - Timeout for role swap requests
drivers/usb/usbip/stub_main.c +5 -0
@@ -186,7 +186,12 @@ static ssize_t rebind_store(struct device_driver *dev, const char *buf,if (!bid)return -ENODEV ; +/* device_attach() callers should hold parent lock for USB */ +if (bid->udev->dev.parent) +device_lock (bid->udev->dev.parent); ret =device_attach (&bid->udev->dev); +if (bid->udev->dev.parent) +device_unlock (bid->udev->dev.parent);if (ret <0 ) {dev_err (&bid->udev->dev,"rebind failed\n" );return ret;
drivers/usb/usbip/usbip_common.h +1 -1
@@ -243,7 +243,7 @@ enum usbip_side {#define VUDC_EVENT_ERROR_USB (USBIP_EH_SHUTDOWN | USBIP_EH_UNUSABLE)#define VUDC_EVENT_ERROR_MALLOC (USBIP_EH_SHUTDOWN | USBIP_EH_UNUSABLE) -#define VDEV_EVENT_REMOVED (USBIP_EH_SHUTDOWN | USBIP_EH_BYE) +#define VDEV_EVENT_REMOVED (USBIP_EH_SHUTDOWN | USBIP_EH_RESET | USBIP_EH_BYE)#define VDEV_EVENT_DOWN (USBIP_EH_SHUTDOWN | USBIP_EH_RESET)#define VDEV_EVENT_ERROR_TCP (USBIP_EH_SHUTDOWN | USBIP_EH_RESET)#define VDEV_EVENT_ERROR_MALLOC (USBIP_EH_SHUTDOWN | USBIP_EH_UNUSABLE)
drivers/usb/usbip/usbip_event.c +0 -4
@@ -91,10 +91,6 @@ static void event_handler(struct work_struct *work)unset_event (ud,USBIP_EH_UNUSABLE ); } -/* Stop the error handler. */ -if (ud->event &USBIP_EH_BYE ) -usbip_dbg_eh ("removed %p\n" , ud); -wake_up (&ud->eh_waitq); } }
drivers/usb/usbip/vhci_hcd.c +13 -0
@@ -354,6 +354,8 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,usbip_dbg_vhci_rh (" ClearHubFeature\n" );break ;case ClearPortFeature: +if (rhport <0 ) + goto error;switch (wValue) {case USB_PORT_FEAT_SUSPEND :if (hcd->speed ==HCD_USB3 ) {
@@ -511,11 +513,16 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, goto error; } +if (rhport <0 ) + goto error; + vhci_hcd->port_status[rhport] |=USB_PORT_STAT_SUSPEND ;break ;case USB_PORT_FEAT_POWER :usbip_dbg_vhci_rh (" SetPortFeature: USB_PORT_FEAT_POWER\n" ); +if (rhport <0 ) + goto error;if (hcd->speed ==HCD_USB3 ) vhci_hcd->port_status[rhport] |=USB_SS_PORT_STAT_POWER ;else
@@ -524,6 +531,8 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,case USB_PORT_FEAT_BH_PORT_RESET :usbip_dbg_vhci_rh (" SetPortFeature: USB_PORT_FEAT_BH_PORT_RESET\n" ); +if (rhport <0 ) + goto error;/* Applicable only for USB3.0 hub */ if (hcd->speed !=HCD_USB3 ) { pr_err("USB_PORT_FEAT_BH_PORT_RESET req not "
@@ -534,6 +543,8 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,case USB_PORT_FEAT_RESET :usbip_dbg_vhci_rh (" SetPortFeature: USB_PORT_FEAT_RESET\n" ); +if (rhport <0 ) + goto error;/* if it's already enabled, disable */ if (hcd->speed ==HCD_USB3 ) { vhci_hcd->port_status[rhport] =0 ;
@@ -554,6 +565,8 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,default :usbip_dbg_vhci_rh (" SetPortFeature: default %d\n" , wValue); +if (rhport <0 ) + goto error;if (hcd->speed ==HCD_USB3 ) {if ((vhci_hcd->port_status[rhport] &USB_SS_PORT_STAT_POWER ) !=0 ) {
drivers/virt/vboxguest/vboxguest_core.c +35 -31
162 lines not on this page · raw message
drivers/virt/vboxguest/vboxguest_core.h +9 -0
@@ -171,4 +171,13 @@ irqreturn_t vbg_core_isr(int irq, void *dev_id);void vbg_linux_mouse_event (struct vbg_dev *gdev); +/* Private (non exported) functions form vboxguest_utils.c */ +void *vbg_req_alloc (size_t len,enum vmmdev_request_type req_type); +void vbg_req_free (void *req,size_t len); +int vbg_req_perform (struct vbg_dev *gdev,void *req); +int vbg_hgcm_call32 ( +struct vbg_dev *gdev,u32 client_id,u32 function,u32 timeout_ms, +struct vmmdev_hgcm_function_parameter32 *parm32,u32 parm_count, +int *vbox_status); +#endif
drivers/virt/vboxguest/vboxguest_linux.c +16 -3
@@ -87,6 +87,7 @@ static long vbg_misc_device_ioctl(struct file *filp, unsigned int req,struct vbg_session *session = filp->private_data;size_t returned_size, size;struct vbg_ioctl_hdr hdr; +bool is_vmmdev_req;int ret =0 ;void *buf;
@@ -106,8 +107,17 @@ static long vbg_misc_device_ioctl(struct file *filp, unsigned int req,if (size >SZ_16M )return -E2BIG ; -/* __GFP_DMA32 because IOCTL_VMMDEV_REQUEST passes this to the host */ - buf =kmalloc (size,GFP_KERNEL | __GFP_DMA32); +/* +* IOCTL_VMMDEV_REQUEST needs the buffer to be below 4G to avoid +* the need for a bounce-buffer and another copy later on. +*/ + is_vmmdev_req = (req & ~IOCSIZE_MASK ) ==VBG_IOCTL_VMMDEV_REQUEST (0 ) || + req ==VBG_IOCTL_VMMDEV_REQUEST_BIG ; + +if (is_vmmdev_req) + buf =vbg_req_alloc (size,VBG_IOCTL_HDR_TYPE_DEFAULT ); +else + buf =kmalloc (size,GFP_KERNEL );if (!buf)return -ENOMEM ;
@@ -132,7 +142,10 @@ static long vbg_misc_device_ioctl(struct file *filp, unsigned int req, ret = -EFAULT ; out: -kfree (buf); +if (is_vmmdev_req) +vbg_req_free (buf, size); +else +kfree (buf);return ret; }
drivers/virt/vboxguest/vboxguest_utils.c +13 -4
@@ -65,8 +65,9 @@ VBG_LOG(vbg_debug, pr_debug);void *vbg_req_alloc (size_t len,enum vmmdev_request_type req_type) {struct vmmdev_request_header *req; +int order =get_order (PAGE_ALIGN (len)); - req =kmalloc (len,GFP_KERNEL | __GFP_DMA32); + req = (void *)__get_free_pages (GFP_KERNEL |GFP_DMA32 , order);if (!req)return NULL ;
@@ -82,6 +83,14 @@ void *vbg_req_alloc(size_t len, enum vmmdev_request_type req_type)return req; } +void vbg_req_free (void *req,size_t len) +{ +if (!req) +return ; + +free_pages ((unsigned long )req,get_order (PAGE_ALIGN (len))); +} +/* Note this function returns a VBox status code, not a negative errno!! */ int vbg_req_perform (struct vbg_dev *gdev,void *req) {
@@ -137,7 +146,7 @@ int vbg_hgcm_connect(struct vbg_dev *gdev, rc = hgcm_connect->header.result; } -kfree (hgcm_connect); +vbg_req_free (hgcm_connect,sizeof (*hgcm_connect)); *vbox_status = rc;return 0 ;
@@ -166,7 +175,7 @@ int vbg_hgcm_disconnect(struct vbg_dev *gdev, u32 client_id, int *vbox_status)if (rc >=0 ) rc = hgcm_disconnect->header.result; -kfree (hgcm_disconnect); +vbg_req_free (hgcm_disconnect,sizeof (*hgcm_disconnect)); *vbox_status = rc;return 0 ;
@@ -623,7 +632,7 @@ int vbg_hgcm_call(struct vbg_dev *gdev, u32 client_id, u32 function, }if (!leak_it) -kfree (call); +vbg_req_free (call, size); free_bounce_bufs:if (bounce_bufs) {
fs/cifs/cifssmb.c +3 -0
@@ -453,6 +453,9 @@ cifs_enable_signing(struct TCP_Server_Info *server, bool mnt_sign_required) server->sign = true; } +if (cifs_rdma_enabled (server) && server->sign) +cifs_dbg (VFS ,"Signing is enabled, and RDMA read/write will be disabled" ); +return 0 ; }
fs/cifs/smb2ops.c +14 -4
@@ -252,9 +252,14 @@ smb2_negotiate_wsize(struct cifs_tcon *tcon, struct smb_vol *volume_info) wsize = volume_info->wsize ? volume_info->wsize :CIFS_DEFAULT_IOSIZE ; wsize = min_t(unsigned int, wsize, server->max_write);#ifdef CONFIG_CIFS_SMB_DIRECT -if (server->rdma) - wsize = min_t(unsigned int, +if (server->rdma) { +if (server->sign) + wsize = min_t(unsigned int, + wsize, server->smbd_conn->max_fragmented_send_size); +else + wsize = min_t(unsigned int, wsize, server->smbd_conn->max_readwrite_size); + }#endif if (!(server->capabilities &SMB2_GLOBAL_CAP_LARGE_MTU )) wsize = min_t(unsigned int, wsize, SMB2_MAX_BUFFER_SIZE);
@@ -272,9 +277,14 @@ smb2_negotiate_rsize(struct cifs_tcon *tcon, struct smb_vol *volume_info) rsize = volume_info->rsize ? volume_info->rsize :CIFS_DEFAULT_IOSIZE ; rsize = min_t(unsigned int, rsize, server->max_read);#ifdef CONFIG_CIFS_SMB_DIRECT -if (server->rdma) - rsize = min_t(unsigned int, +if (server->rdma) { +if (server->sign) + rsize = min_t(unsigned int, + rsize, server->smbd_conn->max_fragmented_recv_size); +else + rsize = min_t(unsigned int, rsize, server->smbd_conn->max_readwrite_size); + }#endif if (!(server->capabilities &SMB2_GLOBAL_CAP_LARGE_MTU ))
fs/cifs/smb2pdu.c +2 -2
@@ -2479,7 +2479,7 @@ smb2_new_read_req(void **buf, unsigned int *total_len,* If we want to do a RDMA write, fill in and append * smbd_buffer_descriptor_v1 to the end of read request */ -if (server->rdma && rdata && +if (server->rdma && rdata && !server->sign && rdata->bytes >= server->smbd_conn->rdma_readwrite_threshold) {struct smbd_buffer_descriptor_v1 *v1;
@@ -2857,7 +2857,7 @@ smb2_async_writev(struct cifs_writedata *wdata,* If we want to do a server RDMA read, fill in and append * smbd_buffer_descriptor_v1 to the end of write request */ -if (server->rdma && wdata->bytes >= +if (server->rdma && !server->sign && wdata->bytes >= server->smbd_conn->rdma_readwrite_threshold) {struct smbd_buffer_descriptor_v1 *v1;
fs/cifs/smbdirect.c +12 -24
@@ -2086,7 +2086,7 @@ int smbd_send(struct smbd_connection *info, struct smb_rqst *rqst)int start, i, j;int max_iov_size = info->max_send_size -sizeof (struct smbd_data_transfer ); -struct kvec iov[SMBDIRECT_MAX_SGE ]; +struct kvec *iov;int rc; info->smbd_send_pending++;
@@ -2096,32 +2096,20 @@ int smbd_send(struct smbd_connection *info, struct smb_rqst *rqst) }/* -* This usually means a configuration error -* We use RDMA read/write for packet size > rdma_readwrite_threshold -* as long as it's properly configured we should never get into this -* situation -*/ -if (rqst->rq_nvec + rqst->rq_npages >SMBDIRECT_MAX_SGE ) { -log_write (ERR ,"maximum send segment %x exceeding %x\n" , - rqst->rq_nvec + rqst->rq_npages,SMBDIRECT_MAX_SGE ); - rc = -EINVAL ; - goto done; - } - -/* -* Remove the RFC1002 length defined in MS-SMB2 section 2.1 -* It is used only for TCP transport +* Skip the RFC1002 length defined in MS-SMB2 section 2.1 +* It is used only for TCP transport in the iov[0] * In future we may want to add a transport layer under protocol * layer so this will only be issued to TCP transport */ - iov[0 ].iov_base = (char *)rqst->rq_iov[0 ].iov_base +4 ; - iov[0 ].iov_len = rqst->rq_iov[0 ].iov_len -4 ; - buflen += iov[0 ].iov_len; + +if (rqst->rq_iov[0 ].iov_len !=4 ) { +log_write (ERR ,"expected the pdu length in 1st iov, but got %zu\n" , rqst->rq_iov[0 ].iov_len); +return -EINVAL ; + } + iov = &rqst->rq_iov[1 ];/* total up iov array first */ -for (i =1 ; i < rqst->rq_nvec; i++) { - iov[i].iov_base = rqst->rq_iov[i].iov_base; - iov[i].iov_len = rqst->rq_iov[i].iov_len; +for (i =0 ; i < rqst->rq_nvec-1 ; i++) { buflen += iov[i].iov_len; }
@@ -2194,14 +2182,14 @@ int smbd_send(struct smbd_connection *info, struct smb_rqst *rqst) goto done; } i++; -if (i == rqst->rq_nvec) +if (i == rqst->rq_nvec-1 )break ; } start = i; buflen =0 ; }else { i++; -if (i == rqst->rq_nvec) { +if (i == rqst->rq_nvec-1 ) {/* send out all remaining vecs */ remaining_data_length -= buflen; log_write(INFO,
fs/cifs/transport.c +2 -2
@@ -753,7 +753,7 @@ cifs_send_recv(const unsigned int xid, struct cifs_ses *ses, goto out;#ifdef CONFIG_CIFS_SMB311 -if (ses->status == CifsNew) +if ((ses->status == CifsNew) || (optype &CIFS_NEG_OP ))smb311_update_preauth_hash (ses, rqst->rq_iov+1 , rqst->rq_nvec-1 );#endif
@@ -797,7 +797,7 @@ cifs_send_recv(const unsigned int xid, struct cifs_ses *ses, *resp_buf_type =CIFS_SMALL_BUFFER ; #ifdef CONFIG_CIFS_SMB311 - if (ses->status == CifsNew) { + if ((ses->status == CifsNew) || (optype & CIFS_NEG_OP)) { struct kvec iov = { .iov_base = buf + 4, .iov_len = get_rfc1002_length(buf)
fs/ext4/balloc.c +15 -2
@@ -321,6 +321,7 @@ static ext4_fsblk_t ext4_valid_block_bitmap(struct super_block *sb,struct ext4_sb_info *sbi =EXT4_SB (sb);ext4_grpblk_t offset;ext4_grpblk_t next_zero_bit; +ext4_grpblk_t max_bit =EXT4_CLUSTERS_PER_GROUP (sb);ext4_fsblk_t blk;ext4_fsblk_t group_first_block;
@@ -338,20 +339,25 @@ static ext4_fsblk_t ext4_valid_block_bitmap(struct super_block *sb,/* check whether block bitmap block number is set */ blk =ext4_block_bitmap (sb, desc); offset = blk - group_first_block; -if (!ext4_test_bit (EXT4_B2C (sbi, offset), bh->b_data)) +if (offset <0 ||EXT4_B2C (sbi, offset) >= max_bit || + !ext4_test_bit (EXT4_B2C (sbi, offset), bh->b_data))/* bad block bitmap */ return blk;/* check whether the inode bitmap block number is set */ blk =ext4_inode_bitmap (sb, desc); offset = blk - group_first_block; -if (!ext4_test_bit (EXT4_B2C (sbi, offset), bh->b_data)) +if (offset <0 ||EXT4_B2C (sbi, offset) >= max_bit || + !ext4_test_bit (EXT4_B2C (sbi, offset), bh->b_data))/* bad block bitmap */ return blk;/* check whether the inode table block number is set */ blk =ext4_inode_table (sb, desc); offset = blk - group_first_block; +if (offset <0 ||EXT4_B2C (sbi, offset) >= max_bit || +EXT4_B2C (sbi, offset + sbi->s_itb_per_group) >= max_bit) +return blk; next_zero_bit =ext4_find_next_zero_bit (bh->b_data,EXT4_B2C (sbi, offset + sbi->s_itb_per_group),EXT4_B2C (sbi, offset));
@@ -417,6 +423,7 @@ struct buffer_head * ext4_read_block_bitmap_nowait(struct super_block *sb, ext4_group_t block_group) {struct ext4_group_desc *desc; +struct ext4_sb_info *sbi =EXT4_SB (sb);struct buffer_head *bh;ext4_fsblk_t bitmap_blk;int err;
@@ -425,6 +432,12 @@ ext4_read_block_bitmap_nowait(struct super_block *sb, ext4_group_t block_group)if (!desc)return ERR_PTR (-EFSCORRUPTED ); bitmap_blk =ext4_block_bitmap (sb, desc); +if ((bitmap_blk <=le32_to_cpu (sbi->s_es->s_first_data_block)) || + (bitmap_blk >=ext4_blocks_count (sbi->s_es))) { +ext4_error (sb,"Invalid block bitmap block %llu in " +"block_group %u" , bitmap_blk, block_group); +return ERR_PTR (-EFSCORRUPTED ); + } bh =sb_getblk (sb, bitmap_blk);if (unlikely (!bh)) { ext4_error(sb, "Cannot get buffer for block bitmap - "
fs/ext4/extents.c +11 -5
@@ -5334,8 +5334,9 @@ ext4_ext_shift_extents(struct inode *inode, handle_t *handle, stop =le32_to_cpu (extent->ee_block);/* -* In case of left shift, Don't start shifting extents until we make -* sure the hole is big enough to accommodate the shift. +* For left shifts, make sure the hole on the left is big enough to +* accommodate the shift. For right shifts, make sure the last extent +* won't be shifted beyond EXT_MAX_BLOCKS. */ if (SHIFT ==SHIFT_LEFT ) { path = ext4_find_extent(inode, start - 1, &path,
@@ -5355,9 +5356,14 @@ ext4_ext_shift_extents(struct inode *inode, handle_t *handle,if ((start == ex_start && shift > ex_start) || (shift > start - ex_end)) { -ext4_ext_drop_refs (path); -kfree (path); -return -EINVAL ; + ret = -EINVAL ; + goto out; + } + }else { +if (shift >EXT_MAX_BLOCKS - + (stop +ext4_ext_get_actual_len (extent))) { + ret = -EINVAL ; + goto out; } }
fs/ext4/ialloc.c +7 -0
@@ -122,6 +122,7 @@ static struct buffer_head * ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group) {struct ext4_group_desc *desc; +struct ext4_sb_info *sbi =EXT4_SB (sb);struct buffer_head *bh =NULL ;ext4_fsblk_t bitmap_blk;int err;
@@ -131,6 +132,12 @@ ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)return ERR_PTR (-EFSCORRUPTED ); bitmap_blk =ext4_inode_bitmap (sb, desc); +if ((bitmap_blk <=le32_to_cpu (sbi->s_es->s_first_data_block)) || + (bitmap_blk >=ext4_blocks_count (sbi->s_es))) { +ext4_error (sb,"Invalid inode bitmap blk %llu in " +"block_group %u" , bitmap_blk, block_group); +return ERR_PTR (-EFSCORRUPTED ); + } bh =sb_getblk (sb, bitmap_blk);if (unlikely (!bh)) { ext4_error(sb, "Cannot read inode bitmap - "
fs/ext4/super.c +1 -0
@@ -5868,5 +5868,6 @@ static void __exit ext4_exit_fs(void)MODULE_AUTHOR ("Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others" );MODULE_DESCRIPTION ("Fourth Extended Filesystem" );MODULE_LICENSE ("GPL" ); +MODULE_SOFTDEP ("pre: crc32c" );module_init (ext4_init_fs)module_exit (ext4_exit_fs)
fs/jbd2/transaction.c +1 -0
@@ -532,6 +532,7 @@ int jbd2_journal_start_reserved(handle_t *handle, unsigned int type,*/ ret =start_this_handle (journal, handle,GFP_NOFS );if (ret <0 ) { + handle->h_journal = journal;jbd2_journal_free_reserved (handle);return ret; }
include/asm-generic/vmlinux.lds.h +1 -1
@@ -179,7 +179,7 @@#endif #ifdef CONFIG_SERIAL_EARLYCON -#define EARLYCON_TABLE () STRUCT_ALIGN(); \ +#define EARLYCON_TABLE () . = ALIGN(8); \ VMLINUX_SYMBOL(__earlycon_table) = .; \ KEEP(*(__earlycon_table)) \ VMLINUX_SYMBOL(__earlycon_table_end) = .;
include/kvm/arm_psci.h +14 -2
@@ -37,10 +37,15 @@ static inline int kvm_psci_version(struct kvm_vcpu *vcpu, struct kvm *kvm)* Our PSCI implementation stays the same across versions from * v0.2 onward, only adding the few mandatory functions (such * as FEATURES with 1.0) that are required by newer -* revisions. It is thus safe to return the latest. +* revisions. It is thus safe to return the latest, unless +* userspace has instructed us otherwise. */ -if (test_bit (KVM_ARM_VCPU_PSCI_0_2 , vcpu->arch.features)) +if (test_bit (KVM_ARM_VCPU_PSCI_0_2 , vcpu->arch.features)) { +if (vcpu->kvm->arch.psci_version) +return vcpu->kvm->arch.psci_version; +return KVM_ARM_PSCI_LATEST ; + }return KVM_ARM_PSCI_0_1 ; }
@@ -48,4 +53,11 @@ static inline int kvm_psci_version(struct kvm_vcpu *vcpu, struct kvm *kvm)int kvm_hvc_call_handler (struct kvm_vcpu *vcpu); +struct kvm_one_reg ; + +int kvm_arm_get_fw_num_regs (struct kvm_vcpu *vcpu); +int kvm_arm_copy_fw_reg_indices (struct kvm_vcpu *vcpu,u64 __user *uindices); +int kvm_arm_get_fw_reg (struct kvm_vcpu *vcpu,const struct kvm_one_reg *reg); +int kvm_arm_set_fw_reg (struct kvm_vcpu *vcpu,const struct kvm_one_reg *reg); +#endif /* __KVM_ARM_PSCI_H__ */
include/linux/blkdev.h +5 -0
@@ -605,6 +605,11 @@ struct request_queue {* initialized by the low level device driver (e.g. scsi/sd.c). * Stacking drivers (device mappers) may or may not initialize * these fields. +* +* Reads of this information must be protected with blk_queue_enter() / +* blk_queue_exit(). Modifying this information is only allowed while +* no requests are being processed. See also blk_mq_freeze_queue() and +* blk_mq_unfreeze_queue(). */ unsigned int nr_zones;unsigned long *seq_zones_bitmap;
include/linux/mtd/flashchip.h +1 -0
@@ -85,6 +85,7 @@ struct flchip { unsigned int write_suspended:1; unsigned int erase_suspended:1;unsigned long in_progress_block_addr; +unsigned long in_progress_block_mask;struct mutex mutex;wait_queue_head_t wq;/* Wait on here when we're waiting for the chip
include/linux/serial_core.h +14 -7
@@ -351,10 +351,10 @@ struct earlycon_id {char name[16 ];char compatible[128 ];int (*setup)(struct earlycon_device *,const char *options); -}__aligned(32) ; +}; -extern const struct earlycon_id __earlycon_table[]; -extern const struct earlycon_id __earlycon_table_end[]; +extern const struct earlycon_id *__earlycon_table[]; +extern const struct earlycon_id *__earlycon_table_end[];#if defined(CONFIG_SERIAL_EARLYCON ) && !defined(MODULE )#define EARLYCON_USED_OR_UNUSED __used
@@ -362,12 +362,19 @@ extern const struct earlycon_id __earlycon_table_end[];#define EARLYCON_USED_OR_UNUSED __maybe_unused#endif -#define OF_EARLYCON_DECLARE (_name, compat, fn) \ - static const struct earlycon_id __UNIQUE_ID(__earlycon_##_name) \ - EARLYCON_USED_OR_UNUSED __section(__earlycon_table) \ +#define _OF_EARLYCON_DECLARE (_name, compat, fn, unique_id) \ + static const struct earlycon_id unique_id \ + EARLYCON_USED_OR_UNUSED __initconst \ = { .name = __stringify(_name), \ .compatible = compat, \ - .setup = fn } + .setup = fn }; \ + static const struct earlycon_id EARLYCON_USED_OR_UNUSED \
Lines of this file are not shown. View the raw message.
sound/core/seq/oss/seq_oss_synth.c +49 -36
85 lines not on this page · raw message
virt/kvm/arm/psci.c +60 -0
60 lines not on this page · 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.