Linux 4.19.268
Greg Kroah-Hartman
maintainerI'm announcing the release of the 4.19.268 kernel.
All users of the 4.19 kernel series must upgrade.
The updated 4.19.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.19.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;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/arm/boot/dts/am335x-pcm-953.dtsi | 28 ++--- arch/arm/boot/dts/at91sam9g20ek_common.dtsi | 9 + arch/arm/mach-mxs/mach-mxs.c | 4 arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts | 2 arch/arm64/kernel/cpu_errata.c | 24 +++-- arch/mips/include/asm/fw/fw.h | 2 arch/mips/pic32/pic32mzda/early_console.c | 13 +- arch/mips/pic32/pic32mzda/init.c | 2 arch/nios2/boot/Makefile | 2 arch/riscv/kernel/vdso/Makefile | 3 arch/riscv/kernel/vdso/vdso.lds.S | 2 arch/s390/kernel/crash_dump.c | 2 arch/x86/include/asm/cpufeatures.h | 1 arch/x86/include/asm/nospec-branch.h | 12 +- arch/x86/kernel/cpu/bugs.c | 21 ++-- arch/x86/kernel/cpu/tsx.c | 33 ++---- arch/x86/kernel/process.c | 2 arch/x86/mm/ioremap.c | 8 + arch/x86/power/cpu.c | 23 +++- drivers/bus/sunxi-rsb.c | 29 ++++-- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 8 - drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c | 3 drivers/gpu/drm/drm_panel_orientation_quirks.c | 6 + drivers/hv/channel_mgmt.c | 6 + drivers/hv/vmbus_drv.c | 1 drivers/hwmon/coretemp.c | 9 + drivers/hwmon/i5500_temp.c | 2 drivers/hwmon/ibmpex.c | 1 drivers/iio/health/afe4403.c | 5 - drivers/iio/health/afe4404.c | 12 +- drivers/iio/industrialio-sw-trigger.c | 6 + drivers/iio/light/Kconfig | 2 drivers/iio/light/apds9960.c | 12 +- drivers/iio/pressure/ms5611.h | 18 +-- drivers/iio/pressure/ms5611_core.c | 56 ++++++----- drivers/iio/pressure/ms5611_i2c.c | 11 -- drivers/iio/pressure/ms5611_spi.c | 17 +-- drivers/input/mouse/synaptics.c | 1 drivers/iommu/dmar.c | 1 drivers/md/dm-integrity.c | 7 - drivers/mmc/host/sdhci.c | 71 ++++++++++++--- drivers/mmc/host/sdhci.h | 12 +- drivers/net/can/cc770/cc770_isa.c | 10 +- drivers/net/can/sja1000/sja1000_isa.c | 10 +- drivers/net/dsa/lan9303-core.c | 2 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 12 +- drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 4 drivers/net/ethernet/mellanox/mlx4/qp.c | 3 drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 4 drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c | 2 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 6 + drivers/net/ethernet/qlogic/qla3xxx.c | 1 drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 4 drivers/net/ethernet/renesas/ravb_main.c | 1 drivers/net/ntb_netdev.c | 9 + drivers/net/phy/phy_device.c | 1 drivers/net/tun.c | 4 drivers/net/usb/qmi_wwan.c | 1 drivers/net/wireless/mac80211_hwsim.c | 5 + drivers/nfc/st-nci/se.c | 6 - drivers/nvme/host/core.c | 6 + drivers/of/property.c | 4 drivers/pinctrl/intel/pinctrl-intel.c | 27 +++++ drivers/pinctrl/pinctrl-single.c | 2 drivers/platform/x86/acer-wmi.c | 9 + drivers/platform/x86/asus-wmi.c | 2 drivers/platform/x86/hp-wmi.c | 3 drivers/s390/block/dasd_eckd.c | 6 - drivers/spi/spi-imx.c | 3 drivers/spi/spi-stm32.c | 2 drivers/tty/serial/8250/8250_omap.c | 7 - drivers/xen/platform-pci.c | 7 + fs/btrfs/ioctl.c | 23 ++-- fs/btrfs/qgroup.c | 9 - fs/ceph/snap.c | 31 ++++-- fs/nilfs2/dat.c | 7 + fs/nilfs2/sufile.c | 8 + include/linux/mmdebug.h | 2 include/uapi/linux/audit.h | 2 ipc/sem.c | 3 kernel/sysctl.c | 30 +++--- lib/Kconfig.debug | 14 ++ mm/frame_vector.c | 31 +----- net/9p/trans_fd.c | 6 + net/bluetooth/l2cap_core.c | 13 ++ net/dccp/ipv4.c | 2 net/dccp/ipv6.c | 2 net/hsr/hsr_forward.c | 5 - net/ipv4/Kconfig | 10 ++ net/ipv4/inet_hashtables.c | 10 +- net/ipv4/tcp_ipv4.c | 2 net/ipv6/ipv6_sockglue.c | 7 + net/ipv6/tcp_ipv6.c | 2 net/ipv6/xfrm6_policy.c | 6 + net/key/af_key.c | 32 ++++-- net/mac80211/mesh_pathtbl.c | 2 net/nfc/nci/core.c | 2 net/nfc/nci/data.c | 4 net/packet/af_packet.c | 6 - net/tipc/discover.c | 5 - net/tipc/topsrv.c | 20 ++-- scripts/faddr2line | 7 - sound/soc/codecs/sgtl5000.c | 1 sound/soc/soc-ops.c | 2 tools/vm/slabinfo-gnuplot.sh | 4 106 files changed, 621 insertions(+), 343 deletions(-)
Adrian Hunter (1):
mmc: sdhci: Fix voltage switch delay
Alejandro Concepción Rodríguez (1):
iio: light: apds9960: fix wrong register for gesture gain
Aman Dhoot (1):
Input: synaptics - switch touchpad on HP Laptop 15-da3001TU to RMI mode
Anand Jain (3):
btrfs: free btrfs_path before copying fspath to userspace
btrfs: free btrfs_path before copying subvol info to userspace
btrfs: free btrfs_path before copying inodes to userspace
Andy Shevchenko (1):
pinctrl: intel: Save and restore pins in "direct IRQ" mode
Ben Hutchings (1):
Revert "x86/speculation: Change FILL_RETURN_BUFFER to work with objtool"
Chen Zhongjin (3):
xfrm: Fix ignored return value in xfrm6_init()
iio: core: Fix entry not deleted when iio_register_sw_trigger_type() fails
nilfs2: fix nilfs_sufile_mark_dirty() not set segment usage as dirty
ChenXiaoSong (1):
btrfs: qgroup: fix sleep from invalid context bug in btrfs_qgroup_inherit()
Christian König (1):
drm/amdgpu: always register an MMU notifier for userptr
Detlev Casanova (1):
ASoC: sgtl5000: Reset the CHIP_CLK_CTRL reg on remove
Dominik Haller (1):
ARM: dts: am335x-pcm-953: Define fixed regulators in root node
Duoming Zhou (1):
qlcnic: fix sleep-in-atomic-context bugs caused by msleep
Enrico Sau (1):
net: usb: qmi_wwan: add Telit 0x103a composition
Frieder Schrempf (1):
spi: spi-imx: Fix spi_bus_clk if requested clock is higher than input clock
Gaosheng Cui (2):
audit: fix undefined behavior in bit shift for AUDIT_BIT
hwmon: (ibmpex) Fix possible UAF when ibmpex_register_bmc() fails
Gleb Mazovetskiy (1):
tcp: configurable source port perturb table size
Greg Kroah-Hartman (1):
Linux 4.19.268
Guenter Roeck (1):
xtensa: increase size of gcc stack frame check
Hans de Goede (2):
drm: panel-orientation-quirks: Add quirk for Acer Switch V 10 (SW5-017) platform/x86: acer-wmi: Enable SW_TABLET_MODE on Switch V 10 (SW5-017)
Heiko Carstens (1):
s390/crashdump: fix TOD programmable field size
Helge Deller (2):
parisc: Increase size of gcc stack frame check
parisc: Increase FRAME_WARN to 2048 bytes on parisc
Herbert Xu (1):
af_key: Fix send_acquire race with pfkey_register
Jakob Unterwurzacher (1):
arm64: dts: rockchip: lower rk3399-puma-haikou SD controller clock frequency
James Morse (2):
arm64: Fix panic() when Spectre-v2 causes Spectre-BHB to re-allocate KVM vectors
arm64: errata: Fix KVM Spectre-v2 mitigation selection for Cortex-A57/A72
Jann Horn (1):
ipc/sem: Fix dangling sem_array access in semtimedop race
Jason A. Donenfeld (1):
MIPS: pic32: treat port as signed integer
Jerry Ray (1):
dsa: lan9303: Correct stat name
Jonas Jelonek (1):
wifi: mac80211_hwsim: fix debugfs attribute ps with rc table support
Josef Bacik (1):
btrfs: free btrfs_path before copying root refs to userspace
Kai-Heng Feng (1):
platform/x86: hp-wmi: Ignore Smart Experience App event
Keith Busch (1):
nvme: restrict management ioctls to admin
Kuniyuki Iwashima (2):
dccp/tcp: Reset saddr on failure after inet6?_hash_connect(). tcp/udp: Fix memory leak in ipv6_renew_options().
Lars-Peter Clausen (1):
iio: ms5611: Simplify IO callback parameters
Lee Jones (1):
Kconfig.debug: provide a little extra FRAME_WARN leeway when KASAN is enabled
Lin Ma (1):
nfc/nci: fix race with opening and closing
Linus Torvalds (3):
proc: avoid integer type confusion in get_proc_long
proc: proc_skip_spaces() shouldn't think it is working on C strings
v4l2: don't fall back to follow_pfn() if pin_user_pages_fast() fails
Liu Shixin (1):
NFC: nci: fix memory leak in nci_rx_data_packet()
Luiz Augusto von Dentz (1):
Bluetooth: L2CAP: Fix accepting connection request for invalid SPSM
Lukas Wunner (1):
serial: 8250: 8250_omap: Avoid RS485 RTS glitch on ->set_termios()
Lyude Paul (1):
drm/amd/dc/dce120: Fix audio register mapping, stop triggering KASAN
Mark Brown (1):
ASoC: ops: Fix bounds check for _sx controls
Martin Faltesek (2):
nfc: st-nci: fix incorrect validating logic in EVT_TRANSACTION
nfc: st-nci: fix memory leaks in EVT_TRANSACTION
Masahiro Yamada (1):
mmc: sdhci: use FIELD_GET for preset value bit masks
Maxim Korotkov (1):
pinctrl: single: Fix potential division by zero
Michael Grzeschik (1):
ARM: dts: at91: sam9g20ek: enable udc vbus gpio pinctrl
Michael Kelley (1):
x86/ioremap: Fix page aligned size calculation in __ioremap_caller()
Mikulas Patocka (1):
dm integrity: flush the journal on suspend
Mitja Spes (1):
iio: pressure: ms5611: fixed value compensation bug
Moshe Shemesh (1):
net/mlx5: Fix FW tracer timestamp calculation
Nathan Chancellor (2):
RISC-V: vdso: Do not add missing symbols to version section in linker script
mm: Fix '.data.once' orphan section warning
Nicolas Cavallari (1):
wifi: mac80211: Fix ack frame idr leak when mesh has no route
Paul Gazzillo (1):
iio: light: rpr0521: add missing Kconfig dependencies
Pawan Gupta (3):
x86/bugs: Make sure MSR_SPEC_CTRL is updated properly upon resume from S3 x86/tsx: Add a feature bit for TSX control MSR support x86/pm: Add enumeration check before spec MSRs save/restore setup
Peter Kosyh (1):
net/mlx4: Check retval of mlx4_bitmap_init
Phil Auld (1):
hwmon: (coretemp) Check for null before removing sysfs attrs
Randy Dunlap (1):
nios2: add FORCE for vmlinuz.gz
Samuel Holland (1):
bus: sunxi-rsb: Support atomic transfers
Sean Nyekjaer (1):
spi: stm32: fix stm32_spi_prepare_mbr() that halves spi clk for every run
Shigeru Yoshida (1):
net: tun: Fix use-after-free in tun_detach()
Srikar Dronamraju (1):
scripts/faddr2line: Fix regression in name resolution on ppc64le
Stefan Haberland (1):
s390/dasd: fix no record found for raw_track_access
Steven Rostedt (Google) (1):
error-injection: Add prompt for function error injection
Tiezhu Yang (1):
tools/vm/slabinfo-gnuplot: use "grep -E" instead of "egrep"
Wang Hai (2):
net: pch_gbe: fix potential memleak in pch_gbe_tx_queue() net/9p: Fix a potential socket leak in p9_socket_open
Wei Yongjun (2):
iio: health: afe4403: Fix oob read in afe4403_read_raw
iio: health: afe4404: Fix oob read in afe4404_[read|write]_raw
Willem de Bruijn (1):
packet: do not set TP_STATUS_CSUM_VALID on CHECKSUM_COMPLETE
Xin Long (2):
tipc: set con sock in tipc_conn_alloc
tipc: add an extra conn_get in tipc_conn_alloc
Xiongfeng Wang (2):
platform/x86: asus-wmi: add missing pci_dev_put() in asus_wmi_set_xusb2pr() iommu/vt-d: Fix PCI device refcount leak in dmar_dev_scope_init()
Xiubo Li (2):
ceph: do not update snapshot context when there is no new snapshot
ceph: avoid putting the realm twice when decoding snaps fails
Yang Yingliang (8):
net: pch_gbe: fix pci device refcount leak while module exiting
Drivers: hv: vmbus: fix double free in the error path of vmbus_add_channel_work()
Drivers: hv: vmbus: fix possible memory leak in vmbus_device_register()
bnx2x: fix pci device refcount leak in bnx2x_vf_is_pcie_pending()
hwmon: (i5500_temp) fix missing pci_disable_device()
of: property: decrement node refcount in of_fwnode_get_reference_args()
net: phy: fix null-ptr-deref while probe() failed
hwmon: (coretemp) fix pci device refcount leak in nv1a_ram_new()
Yoshihiro Shimoda (1):
net: ethernet: renesas: ravb: Fix promiscuous mode after system resumed
Yu Liao (1):
net: thunderx: Fix the ACPI memory leak
Yuan Can (1):
net: net_netdev: Fix error handling in ntb_netdev_init_module()
YueHaibing (3):
tipc: check skb_linearize() return value in tipc_disc_rcv() net/mlx5: Fix uninitialized variable bug in outlen_write()
net: hsr: Fix potential use-after-free
Zhang Changzhong (3):
net/qla3xxx: fix potential memleak in ql3xxx_send()
can: sja1000_isa: sja1000_isa_probe(): add missing free_sja1000dev()
can: cc770: cc770_isa_probe(): add missing free_cc770dev()ZhangPeng (1):
nilfs2: fix NULL pointer dereference in nilfs_palloc_commit_free_entry()
Zheng Yongjun (1):
ARM: mxs: fix memory leak in mxs_machine_init()
Zhengchao Shao (1):
9p/fd: fix issue of list_del corruption in p9_fd_cancel()
ruanjinjie (1):
xen/platform-pci: add missing free_irq() in error path
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 19 -SUBLEVEL = 267 +SUBLEVEL = 268 EXTRAVERSION = NAME = "People's Front"
arch/arm/boot/dts/am335x-pcm-953.dtsi +13 -15
@@ -15,22 +15,20 @@ compatible = "phytec,am335x-pcm-953", "phytec,am335x-phycore-som", "ti,am33xx"; /* Power */ - regulators { - vcc3v3: fixedregulator@1 { - compatible = "regulator-fixed"; - regulator-name = "vcc3v3"; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; - regulator-boot-on; - }; + vcc3v3: fixedregulator1 { + compatible = "regulator-fixed"; + regulator-name = "vcc3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + }; - vcc1v8: fixedregulator@2 { - compatible = "regulator-fixed"; - regulator-name = "vcc1v8"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - regulator-boot-on; - }; + vcc1v8: fixedregulator2 { + compatible = "regulator-fixed"; + regulator-name = "vcc1v8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; }; /* User IO */
arch/arm/boot/dts/at91sam9g20ek_common.dtsi +9 -0
@@ -39,6 +39,13 @@ }; + usb1 { + pinctrl_usb1_vbus_gpio: usb1_vbus_gpio { + atmel,pins = + <AT91_PIOC 5 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>; /* PC5 GPIO */ + }; + }; + mmc0_slot1 { pinctrl_board_mmc0_slot1: mmc0_slot1-board { atmel,pins =
@@ -84,6 +91,8 @@ }; usb1: gadget@fffa4000 { + pinctrl-0 = <&pinctrl_usb1_vbus_gpio>; + pinctrl-names = "default"; atmel,vbus-gpio = <&pioC 5 GPIO_ACTIVE_HIGH>; status = "okay"; };
arch/arm/mach-mxs/mach-mxs.c +3 -1
@@ -393,8 +393,10 @@ static void __init mxs_machine_init(void) root =of_find_node_by_path ("/" ); ret =of_property_read_string (root,"model" , &soc_dev_attr->machine); -if (ret) +if (ret) { +kfree (soc_dev_attr);return ; + } soc_dev_attr->family ="Freescale MXS Family" ; soc_dev_attr->soc_id =mxs_get_soc_id ();
arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts +1 -1
@@ -203,7 +203,7 @@ cap-sd-highspeed; cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>; disable-wp; - max-frequency = <150000000>; + max-frequency = <40000000>; pinctrl-names = "default"; pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>; vmmc-supply = <&vcc3v3_baseboard>;
arch/arm64/kernel/cpu_errata.c +18 -6
@@ -142,9 +142,12 @@ static void install_bp_hardening_cb(bp_hardening_cb_t fn, __copy_hyp_vect_bpi(slot, hyp_vecs_start, hyp_vecs_end); } -__this_cpu_write (bp_hardening_data.hyp_vectors_slot, slot); -__this_cpu_write (bp_hardening_data.fn, fn); -__this_cpu_write (bp_hardening_data.template_start, hyp_vecs_start); +if (fn !=__this_cpu_read (bp_hardening_data.fn)) { +__this_cpu_write (bp_hardening_data.hyp_vectors_slot, slot); +__this_cpu_write (bp_hardening_data.fn, fn); +__this_cpu_write (bp_hardening_data.template_start, + hyp_vecs_start); + }spin_unlock (&bp_lock); }#else
@@ -1203,8 +1206,11 @@ static void kvm_setup_bhb_slot(const char *hyp_vecs_start) __copy_hyp_vect_bpi(slot, hyp_vecs_start, hyp_vecs_end); } -__this_cpu_write (bp_hardening_data.hyp_vectors_slot, slot); -__this_cpu_write (bp_hardening_data.template_start, hyp_vecs_start); +if (hyp_vecs_start !=__this_cpu_read (bp_hardening_data.template_start)) { +__this_cpu_write (bp_hardening_data.hyp_vectors_slot, slot); +__this_cpu_write (bp_hardening_data.template_start, + hyp_vecs_start); + }spin_unlock (&bp_lock); }#else
@@ -1240,7 +1246,13 @@ void spectre_bhb_enable_mitigation(const struct arm64_cpu_capabilities *entry) }else if (spectre_bhb_loop_affected (SCOPE_LOCAL_CPU )) {switch (spectre_bhb_loop_affected (SCOPE_SYSTEM )) {case 8 : -kvm_setup_bhb_slot (__spectre_bhb_loop_k8_start); +/* +* A57/A72-r0 will already have selected the +* spectre-indirect vector, which is sufficient +* for BHB too. +*/ +if (!__this_cpu_read (bp_hardening_data.fn)) +kvm_setup_bhb_slot (__spectre_bhb_loop_k8_start);break ;case 24 :kvm_setup_bhb_slot (__spectre_bhb_loop_k24_start);
arch/mips/include/asm/fw/fw.h +1 -1
@@ -26,6 +26,6 @@ extern char *fw_getcmdline(void);extern void fw_meminit (void );extern char *fw_getenv (char *name);extern unsigned long fw_getenvl (char *name); -extern void fw_init_early_console (char port); +extern void fw_init_early_console (void );#endif /* __ASM_FW_H_ */
arch/mips/pic32/pic32mzda/early_console.c +6 -7
@@ -35,7 +35,7 @@#define U_BRG (x) (UART_BASE(x) + 0x40)static void __iomem *uart_base; -static char console_port =-1 ; +static int console_port =-1 ;static int __init configure_uart_pins (int port) {
@@ -55,7 +55,7 @@ static int __init configure_uart_pins(int port)return 0 ; } -static void __init configure_uart (char port,int baud) +static void __init configure_uart (int port,int baud) {u32 pbclk;
@@ -68,7 +68,7 @@ static void __init configure_uart(char port, int baud) uart_base + PIC32_SET(U_STA(port))); } -static void __init setup_early_console (char port,int baud) +static void __init setup_early_console (int port,int baud) {if (configure_uart_pins (port))return ;
@@ -138,16 +138,15 @@ static int __init get_baud_from_cmdline(char *arch_cmdline)return baud; } -void __init fw_init_early_console (char port) +void __init fw_init_early_console (void ) {char *arch_cmdline =pic32_getcmdline (); -int baud =-1 ; +int baud, port; uart_base =ioremap_nocache (PIC32_BASE_UART ,0xc00 ); baud =get_baud_from_cmdline (arch_cmdline); -if (port ==-1 ) - port =get_port_from_cmdline (arch_cmdline); + port =get_port_from_cmdline (arch_cmdline);if (port ==-1 ) port =EARLY_CONSOLE_PORT ;
arch/mips/pic32/pic32mzda/init.c +1 -1
@@ -68,7 +68,7 @@ void __init plat_mem_setup(void)strlcpy (arcs_cmdline, boot_command_line,COMMAND_LINE_SIZE );#ifdef CONFIG_EARLY_PRINTK -fw_init_early_console (-1 ); +fw_init_early_console ();#endif pic32_config_init (); }
arch/nios2/boot/Makefile +1 -1
@@ -20,7 +20,7 @@ $(obj)/vmlinux.bin: vmlinux FORCE $(obj)/vmlinux.gz: $(obj)/vmlinux.bin FORCE $(call if_changed,gzip) -$(obj)/vmImage: $(obj)/vmlinux.gz +$(obj)/vmImage: $(obj)/vmlinux.gz FORCE $(call if_changed,uimage) @$(kecho) 'Kernel: $@ is ready'
arch/riscv/kernel/vdso/Makefile +3 -0
@@ -17,6 +17,9 @@ obj-vdso := $(addprefix $(obj)/, $(obj-vdso)) obj-y += vdso.o vdso-syms.o CPPFLAGS_vdso.lds += -P -C -U$(ARCH) +ifneq ($(filter vgettimeofday, $(vdso-syms)),) +CPPFLAGS_vdso.lds += -DHAS_VGETTIMEOFDAY +endif # Disable gcov profiling for VDSO code GCOV_PROFILE := n
arch/riscv/kernel/vdso/vdso.lds.S +2 -0
@@ -70,9 +70,11 @@ VERSION LINUX_4.15 { global: __vdso_rt_sigreturn; +#ifdef HAS_VGETTIMEOFDAY __vdso_gettimeofday; __vdso_clock_gettime; __vdso_clock_getres; +#endif __vdso_getcpu; __vdso_flush_icache; local: *;
arch/s390/kernel/crash_dump.c +1 -1
@@ -45,7 +45,7 @@ struct save_area {u64 fprs[16 ];u32 fpc;u32 prefix; -u64 todpreg; +u32 todpreg;u64 timer;u64 todcmp;u64 vxrs_low[16 ];
arch/x86/include/asm/cpufeatures.h +1 -0
@@ -292,6 +292,7 @@#define X86_FEATURE_RETPOLINE (11*32+12)/* "" Generic Retpoline mitigation for Spectre variant 2 */ #define X86_FEATURE_RETPOLINE_LFENCE (11*32+13)/* "" Use LFENCE for Spectre variant 2 */ #define X86_FEATURE_RSB_VMEXIT_LITE (11*32+17)/* "" Fill RSB on VM exit when EIBRS is enabled */ +#define X86_FEATURE_MSR_TSX_CTRL (11*32+18)/* "" MSR IA32_TSX_CTRL (Intel) implemented */ /* AMD-defined CPU features, CPUID level 0x80000008 (EBX), word 13 */ #define X86_FEATURE_CLZERO (13*32+ 0)/* CLZERO instruction */
arch/x86/include/asm/nospec-branch.h +6 -6
@@ -4,13 +4,11 @@#define _ASM_X86_NOSPEC_BRANCH_H_#include <linux/static_key.h> -#include <linux/frame.h> #include <asm/alternative.h> #include <asm/alternative-asm.h> #include <asm/cpufeatures.h> #include <asm/msr-index.h> -#include <asm/unwind_hints.h> #include <asm/percpu.h> /*
@@ -54,9 +52,9 @@lfence ; \ jmp 775b; \ 774: \ - add $(BITS_PER_LONG/8) * 2, sp; \dec reg; \ jnz 771b; \ + add $(BITS_PER_LONG/8) * nr, sp; \/* barrier for jnz misprediction */ \ lfence;#else
@@ -167,8 +165,10 @@* monstrosity above, manually. */ .macro FILL_RETURN_BUFFER reg:req nr:req ftr:req - ALTERNATIVE "jmp .Lskip_rsb_\@", "", \ftr - __FILL_RETURN_BUFFER(\reg,\nr,%_ASM_SP) + ANNOTATE_NOSPEC_ALTERNATIVE +ALTERNATIVE "jmp .Lskip_rsb_\@" , \ + __stringify(__FILL_RETURN_BUFFER(\reg,\nr,%_ASM_SP)) \ + \ftr .Lskip_rsb_\@: .endm
@@ -317,7 +317,7 @@ static inline void indirect_branch_prediction_barrier(void)/* The Intel SPEC CTRL MSR base value cache */ extern u64 x86_spec_ctrl_base;DECLARE_PER_CPU (u64, x86_spec_ctrl_current); -extern void write_spec_ctrl_current (u64 val,bool force); +extern void update_spec_ctrl_cond (u64 val);extern u64 spec_ctrl_current (void );/*
arch/x86/kernel/cpu/bugs.c +14 -7
@@ -58,11 +58,18 @@ EXPORT_SYMBOL_GPL(x86_spec_ctrl_current);static DEFINE_MUTEX (spec_ctrl_mutex); +/* Update SPEC_CTRL MSR and its cached copy unconditionally */ +static void update_spec_ctrl (u64 val) +{ +this_cpu_write (x86_spec_ctrl_current, val); +wrmsrl (MSR_IA32_SPEC_CTRL , val); +} +/* * Keep track of the SPEC_CTRL MSR value for the current task, which may differ * from x86_spec_ctrl_base due to STIBP/SSB in __speculation_ctrl_update(). */ -void write_spec_ctrl_current (u64 val,bool force) +void update_spec_ctrl_cond (u64 val) {if (this_cpu_read (x86_spec_ctrl_current) == val)return ;
@@ -73,7 +80,7 @@ void write_spec_ctrl_current(u64 val, bool force)* When KERNEL_IBRS this MSR is written on return-to-user, unless * forced the update can be delayed until that time. */ -if (force || !cpu_feature_enabled (X86_FEATURE_KERNEL_IBRS )) +if (!cpu_feature_enabled (X86_FEATURE_KERNEL_IBRS ))wrmsrl (MSR_IA32_SPEC_CTRL , val); }
@@ -1194,7 +1201,7 @@ static void __init spec_ctrl_disable_kernel_rrsba(void)if (ia32_cap &ARCH_CAP_RRSBA ) { x86_spec_ctrl_base |=SPEC_CTRL_RRSBA_DIS_S ; -write_spec_ctrl_current (x86_spec_ctrl_base, true); +update_spec_ctrl (x86_spec_ctrl_base); } }
@@ -1316,7 +1323,7 @@ static void __init spectre_v2_select_mitigation(void)if (spectre_v2_in_ibrs_mode (mode)) { x86_spec_ctrl_base |=SPEC_CTRL_IBRS ; -write_spec_ctrl_current (x86_spec_ctrl_base, true); +update_spec_ctrl (x86_spec_ctrl_base); }switch (mode) {
@@ -1420,7 +1427,7 @@ static void __init spectre_v2_select_mitigation(void)static void update_stibp_msr (void * __unused) {u64 val =spec_ctrl_current () | (x86_spec_ctrl_base &SPEC_CTRL_STIBP ); -write_spec_ctrl_current (val, true); +update_spec_ctrl (val); }/* Update x86_spec_ctrl_base in case SMT state changed. */
@@ -1653,7 +1660,7 @@ static enum ssb_mitigation __init __ssb_select_mitigation(void)x86_amd_ssb_disable (); }else { x86_spec_ctrl_base |=SPEC_CTRL_SSBD ; -write_spec_ctrl_current (x86_spec_ctrl_base, true); +update_spec_ctrl (x86_spec_ctrl_base); } }
@@ -1858,7 +1865,7 @@ int arch_prctl_spec_ctrl_get(struct task_struct *task, unsigned long which)void x86_spec_ctrl_setup_ap (void ) {if (boot_cpu_has (X86_FEATURE_MSR_SPEC_CTRL )) -write_spec_ctrl_current (x86_spec_ctrl_base, true); +update_spec_ctrl (x86_spec_ctrl_base);if (ssb_mode ==SPEC_STORE_BYPASS_DISABLE )x86_amd_ssb_disable ();
arch/x86/kernel/cpu/tsx.c +14 -19
@@ -55,24 +55,6 @@ void tsx_enable(void)wrmsrl (MSR_IA32_TSX_CTRL , tsx); } -static bool __init tsx_ctrl_is_supported (void ) -{ -u64 ia32_cap =x86_read_arch_cap_msr (); - -/* -* TSX is controlled via MSR_IA32_TSX_CTRL. However, support for this -* MSR is enumerated by ARCH_CAP_TSX_MSR bit in MSR_IA32_ARCH_CAPABILITIES. -* -* TSX control (aka MSR_IA32_TSX_CTRL) is only available after a -* microcode update on CPUs that have their MSR_IA32_ARCH_CAPABILITIES -* bit MDS_NO=1. CPUs with MDS_NO=0 are not planned to get -* MSR_IA32_TSX_CTRL support even after a microcode update. Thus, -* tsx= cmdline requests will do nothing on CPUs without -* MSR_IA32_TSX_CTRL support. -*/ -return !!(ia32_cap &ARCH_CAP_TSX_CTRL_MSR ); -} -static enum tsx_ctrl_states x86_get_tsx_auto_mode (void ) {if (boot_cpu_has_bug (X86_BUG_TAA ))
@@ -86,9 +68,22 @@ void __init tsx_init(void)char arg[5 ] = {};int ret; -if (!tsx_ctrl_is_supported ()) +/* +* TSX is controlled via MSR_IA32_TSX_CTRL. However, support for this +* MSR is enumerated by ARCH_CAP_TSX_MSR bit in MSR_IA32_ARCH_CAPABILITIES. +* +* TSX control (aka MSR_IA32_TSX_CTRL) is only available after a +* microcode update on CPUs that have their MSR_IA32_ARCH_CAPABILITIES +* bit MDS_NO=1. CPUs with MDS_NO=0 are not planned to get +* MSR_IA32_TSX_CTRL support even after a microcode update. Thus, +* tsx= cmdline requests will do nothing on CPUs without +* MSR_IA32_TSX_CTRL support. +*/ +if (!(x86_read_arch_cap_msr () &ARCH_CAP_TSX_CTRL_MSR ))return ; +setup_force_cpu_cap (X86_FEATURE_MSR_TSX_CTRL ); + ret =cmdline_find_option (boot_command_line,"tsx" , arg,sizeof (arg));if (ret >=0 ) {if (!strcmp (arg,"on" )) {
arch/x86/kernel/process.c +1 -1
@@ -434,7 +434,7 @@ static __always_inline void __speculation_ctrl_update(unsigned long tifp, }if (updmsr) -write_spec_ctrl_current (msr, false); +update_spec_ctrl_cond (msr); }static unsigned long speculation_ctrl_update_tif (struct task_struct *tsk)
arch/x86/mm/ioremap.c +7 -1
@@ -171,9 +171,15 @@ static void __iomem *__ioremap_caller(resource_size_t phys_addr,* Mappings have to be page-aligned */ offset = phys_addr & ~PAGE_MASK ; - phys_addr &=PHYSICAL_PAGE_MASK ; + phys_addr &=PAGE_MASK ; size =PAGE_ALIGN (last_addr+1 ) - phys_addr; +/* +* Mask out any bits not part of the actual physical +* address, like memory encryption bits. +*/ + phys_addr &=PHYSICAL_PAGE_MASK ; + retval =reserve_memtype (phys_addr, (u64 )phys_addr + size, pcm, &new_pcm);if (retval) {
arch/x86/power/cpu.c +15 -8
@@ -527,16 +527,23 @@ static int pm_cpu_check(const struct x86_cpu_id *c)static void pm_save_spec_msr (void ) { -u32 spec_msr_id[] = { -MSR_IA32_SPEC_CTRL , -MSR_IA32_TSX_CTRL , -MSR_TSX_FORCE_ABORT , -MSR_IA32_MCU_OPT_CTRL , -MSR_AMD64_LS_CFG , -MSR_AMD64_DE_CFG , +struct msr_enumeration { +u32 msr_no; +u32 feature; + } msr_enum[] = { + {MSR_IA32_SPEC_CTRL ,X86_FEATURE_MSR_SPEC_CTRL }, + {MSR_IA32_TSX_CTRL ,X86_FEATURE_MSR_TSX_CTRL }, + {MSR_TSX_FORCE_ABORT ,X86_FEATURE_TSX_FORCE_ABORT }, + {MSR_IA32_MCU_OPT_CTRL ,X86_FEATURE_SRBDS_CTRL }, + {MSR_AMD64_LS_CFG ,X86_FEATURE_LS_CFG_SSBD }, + {MSR_AMD64_DE_CFG ,X86_FEATURE_LFENCE_RDTSC }, }; +int i; -msr_build_context (spec_msr_id,ARRAY_SIZE (spec_msr_id)); +for (i =0 ; i <ARRAY_SIZE (msr_enum); i++) { +if (boot_cpu_has (msr_enum[i].feature)) +msr_build_context (&msr_enum[i].msr_no,1 ); + } }static int pm_check_save_msr (void )
drivers/bus/sunxi-rsb.c +21 -8
@@ -268,6 +268,9 @@ EXPORT_SYMBOL_GPL(sunxi_rsb_driver_register);/* common code that starts a transfer */ static int _sunxi_rsb_run_xfer (struct sunxi_rsb *rsb) { +u32 int_mask, status; +bool timeout; +if (readl (rsb->regs +RSB_CTRL ) &RSB_CTRL_START_TRANS ) {dev_dbg (rsb->dev,"RSB transfer still in progress\n" );return -EBUSY ;
@@ -275,13 +278,23 @@ static int _sunxi_rsb_run_xfer(struct sunxi_rsb *rsb)reinit_completion (&rsb->complete); -writel (RSB_INTS_LOAD_BSY |RSB_INTS_TRANS_ERR |RSB_INTS_TRANS_OVER , - rsb->regs +RSB_INTE ); + int_mask =RSB_INTS_LOAD_BSY |RSB_INTS_TRANS_ERR |RSB_INTS_TRANS_OVER ; +writel (int_mask, rsb->regs +RSB_INTE );writel (RSB_CTRL_START_TRANS |RSB_CTRL_GLOBAL_INT_ENB , rsb->regs +RSB_CTRL ); -if (!wait_for_completion_io_timeout (&rsb->complete, -msecs_to_jiffies (100 ))) { +if (irqs_disabled ()) { + timeout =readl_poll_timeout_atomic (rsb->regs +RSB_INTS , + status, (status & int_mask), +10 ,100000 ); +writel (status, rsb->regs +RSB_INTS ); + }else { + timeout = !wait_for_completion_io_timeout (&rsb->complete, +msecs_to_jiffies (100 )); + status = rsb->status; + } + +if (timeout) {dev_dbg (rsb->dev,"RSB timeout\n" );/* abort the transfer */
@@ -293,18 +306,18 @@ static int _sunxi_rsb_run_xfer(struct sunxi_rsb *rsb)return -ETIMEDOUT ; } -if (rsb->status &RSB_INTS_LOAD_BSY ) { +if (status &RSB_INTS_LOAD_BSY ) {dev_dbg (rsb->dev,"RSB busy\n" );return -EBUSY ; } -if (rsb->status &RSB_INTS_TRANS_ERR ) { -if (rsb->status &RSB_INTS_TRANS_ERR_ACK ) { +if (status &RSB_INTS_TRANS_ERR ) { +if (status &RSB_INTS_TRANS_ERR_ACK ) {dev_dbg (rsb->dev,"RSB slave nack\n" );return -EINVAL ; } -if (rsb->status &RSB_INTS_TRANS_ERR_DATA ) { +if (status &RSB_INTS_TRANS_ERR_DATA ) {dev_dbg (rsb->dev,"RSB transfer data error\n" );return -EIO ; }
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +3 -5
@@ -328,11 +328,9 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,if (r) goto release_object; -if (args->flags &AMDGPU_GEM_USERPTR_REGISTER ) { - r =amdgpu_mn_register (bo, args->addr); -if (r) - goto release_object; - } + r =amdgpu_mn_register (bo, args->addr); +if (r) + goto release_object;if (args->flags &AMDGPU_GEM_USERPTR_VALIDATE ) { r = amdgpu_ttm_tt_get_user_pages(bo->tbo.ttm,
drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c +2 -1
@@ -324,7 +324,8 @@ static const struct dce_audio_registers audio_regs[] = {audio_regs (2 ),audio_regs (3 ),audio_regs (4 ), - audio_regs(5) +audio_regs (5 ), + audio_regs(6), };#define DCE120_AUD_COMMON_MASK_SH_LIST (mask_sh)\
drivers/gpu/drm/drm_panel_orientation_quirks.c +6 -0
@@ -95,6 +95,12 @@ static const struct dmi_system_id orientation_data[] = { DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "One S1003"), }, .driver_data = (void *)&lcd800x1280_rightside_up, + }, { /* Acer Switch V 10 (SW5-017) */ + .matches = { +DMI_EXACT_MATCH (DMI_SYS_VENDOR ,"Acer" ), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "SW5-017"), + }, + .driver_data = (void *)&lcd800x1280_rightside_up, }, { /* Anbernic Win600 */ .matches = { DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Anbernic"),
drivers/hv/channel_mgmt.c +5 -1
@@ -508,13 +508,17 @@ static void vmbus_add_channel_work(struct work_struct *work)* Add the new device to the bus. This will kick off device-driver * binding which eventually invokes the device driver's AddDevice() * method. +* +* If vmbus_device_register() fails, the 'device_obj' is freed in +* vmbus_device_release() as called by device_unregister() in the +* error path of vmbus_device_register(). In the outside error +* path, there's no need to free it. */ ret =vmbus_device_register (newchannel->device_obj);if (ret !=0 ) {pr_err ("unable to add child device object (relid %d)\n" , newchannel->offermsg.child_relid); -kfree (newchannel->device_obj); goto err_deq_chan; }
drivers/hv/vmbus_drv.c +1 -0
@@ -1634,6 +1634,7 @@ int vmbus_device_register(struct hv_device *child_device_obj) ret =device_register (&child_device_obj->device);if (ret) {pr_err ("Unable to register child device\n" ); +put_device (&child_device_obj->device);return ret; }
drivers/hwmon/coretemp.c +8 -1
@@ -255,10 +255,13 @@ static int adjust_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)*/ if (host_bridge && host_bridge->vendor ==PCI_VENDOR_ID_INTEL ) {for (i =0 ; i <ARRAY_SIZE (tjmax_pci_table); i++) { -if (host_bridge->device == tjmax_pci_table[i].device) +if (host_bridge->device == tjmax_pci_table[i].device) { +pci_dev_put (host_bridge);return tjmax_pci_table[i].tjmax; + } } } +pci_dev_put (host_bridge);for (i =0 ; i <ARRAY_SIZE (tjmax_table); i++) {if (strstr (c->x86_model_id, tjmax_table[i].id))
@@ -546,6 +549,10 @@ static void coretemp_remove_core(struct platform_data *pdata, int indx) {struct temp_data *tdata = pdata->core_data[indx]; +/* if we errored on add then this is already gone */ +if (!tdata) +return ; +/* Remove the sysfs attributes */ sysfs_remove_group (&pdata->hwmon_dev->kobj, &tdata->attr_group);
drivers/hwmon/i5500_temp.c +1 -1
@@ -117,7 +117,7 @@ static int i5500_temp_probe(struct pci_dev *pdev,u32 tstimer;s8 tsfsc; - err =pci_enable_device (pdev); + err =pcim_enable_device (pdev);if (err) {dev_err (&pdev->dev,"Failed to enable device\n" );return err;
drivers/hwmon/ibmpex.c +1 -0
@@ -517,6 +517,7 @@ static void ibmpex_register_bmc(int iface, struct device *dev)return ; out_register: +list_del (&data->list);hwmon_device_unregister (data->hwmon_dev); out_user:ipmi_destroy_user (data->user);
drivers/iio/health/afe4403.c +3 -2
@@ -253,14 +253,14 @@ static int afe4403_read_raw(struct iio_dev *indio_dev, int *val, int *val2, long mask) { struct afe4403_data *afe = iio_priv(indio_dev); -unsigned int reg = afe4403_channel_values[chan->address]; -unsigned int field = afe4403_channel_leds[chan->address]; +unsigned int reg, field;int ret;switch (chan->type) {case IIO_INTENSITY :switch (mask) {case IIO_CHAN_INFO_RAW : + reg = afe4403_channel_values[chan->address]; ret =afe4403_read (afe, reg, val);if (ret)return ret;
@@ -270,6 +270,7 @@ static int afe4403_read_raw(struct iio_dev *indio_dev,case IIO_CURRENT :switch (mask) {case IIO_CHAN_INFO_RAW : + field = afe4403_channel_leds[chan->address]; ret =regmap_field_read (afe->fields[field], val);if (ret)return ret;
drivers/iio/health/afe4404.c +7 -5
@@ -258,20 +258,20 @@ static int afe4404_read_raw(struct iio_dev *indio_dev, int *val, int *val2, long mask) { struct afe4404_data *afe = iio_priv(indio_dev); -unsigned int value_reg = afe4404_channel_values[chan->address]; -unsigned int led_field = afe4404_channel_leds[chan->address]; -unsigned int offdac_field = afe4404_channel_offdacs[chan->address]; +unsigned int value_reg, led_field, offdac_field;int ret;switch (chan->type) {case IIO_INTENSITY :switch (mask) {case IIO_CHAN_INFO_RAW : + value_reg = afe4404_channel_values[chan->address]; ret =regmap_read (afe->regmap, value_reg, val);if (ret)return ret;return IIO_VAL_INT ;case IIO_CHAN_INFO_OFFSET : + offdac_field = afe4404_channel_offdacs[chan->address]; ret =regmap_field_read (afe->fields[offdac_field], val);if (ret)return ret;
@@ -281,6 +281,7 @@ static int afe4404_read_raw(struct iio_dev *indio_dev,case IIO_CURRENT :switch (mask) {case IIO_CHAN_INFO_RAW : + led_field = afe4404_channel_leds[chan->address]; ret =regmap_field_read (afe->fields[led_field], val);if (ret)return ret;
@@ -303,19 +304,20 @@ static int afe4404_write_raw(struct iio_dev *indio_dev, int val, int val2, long mask) { struct afe4404_data *afe = iio_priv(indio_dev); -unsigned int led_field = afe4404_channel_leds[chan->address]; -unsigned int offdac_field = afe4404_channel_offdacs[chan->address]; +unsigned int led_field, offdac_field;switch (chan->type) {case IIO_INTENSITY :switch (mask) {case IIO_CHAN_INFO_OFFSET : + offdac_field = afe4404_channel_offdacs[chan->address];return regmap_field_write (afe->fields[offdac_field], val); }break ;case IIO_CURRENT :switch (mask) {case IIO_CHAN_INFO_RAW : + led_field = afe4404_channel_leds[chan->address];return regmap_field_write (afe->fields[led_field], val); }break ;
drivers/iio/industrialio-sw-trigger.c +5 -1
@@ -61,8 +61,12 @@ int iio_register_sw_trigger_type(struct iio_sw_trigger_type *t) t->group =configfs_register_default_group (iio_triggers_group, t->name, &iio_trigger_type_group_type); -if (IS_ERR (t->group)) +if (IS_ERR (t->group)) { +mutex_lock (&iio_trigger_types_lock); +list_del (&t->list); +mutex_unlock (&iio_trigger_types_lock); ret =PTR_ERR (t->group); + }return ret; }
drivers/iio/light/Kconfig +2 -0
@@ -238,6 +238,8 @@ config RPR0521 tristate "ROHM RPR0521 ALS and proximity sensor driver" depends on I2C select REGMAP_I2C + select IIO_BUFFER + select IIO_TRIGGERED_BUFFER help Say Y here if you want to build support for ROHM's RPR0521 ambient light and proximity sensor device.
drivers/iio/light/apds9960.c +6 -6
@@ -55,9 +55,6 @@#define APDS9960_REG_CONTROL_PGAIN_MASK_SHIFT 2#define APDS9960_REG_CONFIG_2 0x90 -#define APDS9960_REG_CONFIG_2_GGAIN_MASK 0x60 -#define APDS9960_REG_CONFIG_2_GGAIN_MASK_SHIFT 5 -#define APDS9960_REG_ID 0x92#define APDS9960_REG_STATUS 0x93
@@ -78,6 +75,9 @@#define APDS9960_REG_GCONF_1_GFIFO_THRES_MASK_SHIFT 6#define APDS9960_REG_GCONF_2 0xa3 +#define APDS9960_REG_GCONF_2_GGAIN_MASK 0x60 +#define APDS9960_REG_GCONF_2_GGAIN_MASK_SHIFT 5 +#define APDS9960_REG_GOFFSET_U 0xa4#define APDS9960_REG_GOFFSET_D 0xa5#define APDS9960_REG_GPULSE 0xa6
@@ -396,9 +396,9 @@ static int apds9960_set_pxs_gain(struct apds9960_data *data, int val) } ret =regmap_update_bits (data->regmap, -APDS9960_REG_CONFIG_2 , -APDS9960_REG_CONFIG_2_GGAIN_MASK , - idx <<APDS9960_REG_CONFIG_2_GGAIN_MASK_SHIFT ); +APDS9960_REG_GCONF_2 , +APDS9960_REG_GCONF_2_GGAIN_MASK , + idx <<APDS9960_REG_GCONF_2_GGAIN_MASK_SHIFT );if (!ret) data->pxs_gain = idx;mutex_unlock (&data->lock);
drivers/iio/pressure/ms5611.h +7 -11
@@ -28,13 +28,6 @@ enum { MS5607, }; -struct ms5611_chip_info { -u16 prom[MS5611_PROM_WORDS_NB ]; - -int (*temp_and_pressure_compensate)(struct ms5611_chip_info *chip_info, -s32 *temp,s32 *pressure); -}; -/* * OverSampling Rate descriptor. * Warning: cmd MUST be kept aligned on a word boundary (see
@@ -53,12 +46,15 @@ struct ms5611_state {const struct ms5611_osr *pressure_osr;const struct ms5611_osr *temp_osr; -int (*reset)(struct device *dev); -int (*read_prom_word)(struct device *dev,int index,u16 *word); -int (*read_adc_temp_and_pressure)(struct device *dev, +u16 prom[MS5611_PROM_WORDS_NB ]; + +int (*reset)(struct ms5611_state *st); +int (*read_prom_word)(struct ms5611_state *st,int index,u16 *word); +int (*read_adc_temp_and_pressure)(struct ms5611_state *st,s32 *temp,s32 *pressure); -struct ms5611_chip_info *chip_info; +int (*compensate_temp_and_pressure)(struct ms5611_state *st,s32 *temp, +s32 *pressure);struct regulator *vdd; };
drivers/iio/pressure/ms5611_core.c +29 -27
118 lines not on this page · raw message
drivers/iio/pressure/ms5611_i2c.c +4 -7
@@ -21,17 +21,15 @@#include "ms5611.h" -static int ms5611_i2c_reset (struct device *dev) +static int ms5611_i2c_reset (struct ms5611_state *st) { -struct ms5611_state *st =iio_priv (dev_to_iio_dev (dev)); -return i2c_smbus_write_byte (st->client,MS5611_RESET ); } -static int ms5611_i2c_read_prom_word (struct device *dev,int index,u16 *word) +static int ms5611_i2c_read_prom_word (struct ms5611_state *st,int index, +u16 *word) {int ret; -struct ms5611_state *st =iio_priv (dev_to_iio_dev (dev)); ret =i2c_smbus_read_word_swapped (st->client,MS5611_READ_PROM_WORD + (index <<1 ));
@@ -58,11 +56,10 @@ static int ms5611_i2c_read_adc(struct ms5611_state *st, s32 *val)return 0 ; } -static int ms5611_i2c_read_adc_temp_and_pressure (struct device *dev, +static int ms5611_i2c_read_adc_temp_and_pressure (struct ms5611_state *st,s32 *temp,s32 *pressure) {int ret; -struct ms5611_state *st =iio_priv (dev_to_iio_dev (dev));const struct ms5611_osr *osr = st->temp_osr; ret =i2c_smbus_write_byte (st->client, osr->cmd);
drivers/iio/pressure/ms5611_spi.c +7 -10
@@ -16,18 +16,17 @@#include "ms5611.h" -static int ms5611_spi_reset (struct device *dev) +static int ms5611_spi_reset (struct ms5611_state *st) {u8 cmd =MS5611_RESET ; -struct ms5611_state *st =iio_priv (dev_to_iio_dev (dev));return spi_write_then_read (st->client, &cmd,1 ,NULL ,0 ); } -static int ms5611_spi_read_prom_word (struct device *dev,int index,u16 *word) +static int ms5611_spi_read_prom_word (struct ms5611_state *st,int index, +u16 *word) {int ret; -struct ms5611_state *st =iio_priv (dev_to_iio_dev (dev)); ret =spi_w8r16be (st->client,MS5611_READ_PROM_WORD + (index <<1 ));if (ret <0 )
@@ -38,11 +37,10 @@ static int ms5611_spi_read_prom_word(struct device *dev, int index, u16 *word)return 0 ; } -static int ms5611_spi_read_adc (struct device *dev,s32 *val) +static int ms5611_spi_read_adc (struct ms5611_state *st,s32 *val) {int ret;u8 buf[3 ] = {MS5611_READ_ADC }; -struct ms5611_state *st =iio_priv (dev_to_iio_dev (dev)); ret =spi_write_then_read (st->client, buf,1 , buf,3 );if (ret <0 )
@@ -53,11 +51,10 @@ static int ms5611_spi_read_adc(struct device *dev, s32 *val)return 0 ; } -static int ms5611_spi_read_adc_temp_and_pressure (struct device *dev, +static int ms5611_spi_read_adc_temp_and_pressure (struct ms5611_state *st,s32 *temp,s32 *pressure) {int ret; -struct ms5611_state *st =iio_priv (dev_to_iio_dev (dev));const struct ms5611_osr *osr = st->temp_osr;/*
@@ -69,7 +66,7 @@ static int ms5611_spi_read_adc_temp_and_pressure(struct device *dev,return ret;usleep_range (osr->conv_usec, osr->conv_usec + (osr->conv_usec /10UL )); - ret =ms5611_spi_read_adc (dev, temp); + ret =ms5611_spi_read_adc (st, temp);if (ret <0 )return ret;
@@ -79,7 +76,7 @@ static int ms5611_spi_read_adc_temp_and_pressure(struct device *dev,return ret;usleep_range (osr->conv_usec, osr->conv_usec + (osr->conv_usec /10UL )); -return ms5611_spi_read_adc (dev, pressure); +return ms5611_spi_read_adc (st, pressure); }static int ms5611_spi_probe (struct spi_device *spi)
drivers/input/mouse/synaptics.c +1 -0
@@ -192,6 +192,7 @@ static const char * const smbus_pnp_ids[] = {"SYN3221" ,/* HP 15-ay000 */ "SYN323d" ,/* HP Spectre X360 13-w013dx */ "SYN3257" ,/* HP Envy 13-ad105ng */ +"SYN3286" ,/* HP Laptop 15-da3001TU */ NULL };
drivers/iommu/dmar.c +1 -0
@@ -804,6 +804,7 @@ int __init dmar_dev_scope_init(void) info =dmar_alloc_pci_notify_info (dev,BUS_NOTIFY_ADD_DEVICE );if (!info) { +pci_dev_put (dev);return dmar_dev_scope_status; }else {dmar_pci_bus_add_dev (info);
drivers/md/dm-integrity.c +1 -6
@@ -2116,10 +2116,6 @@ static void integrity_writer(struct work_struct *w)unsigned prev_free_sectors; -/* the following test is not needed, but it tests the replay code */ -if (unlikely (dm_post_suspending (ic->ti)) && !ic->meta_dev) -return ; -spin_lock_irq (&ic->endio_wait.lock); write_start = ic->committed_section; write_sections = ic->n_committed_sections;
@@ -2455,8 +2451,7 @@ static void dm_integrity_postsuspend(struct dm_target *ti)drain_workqueue (ic->commit_wq);if (ic->mode =='J' ) { -if (ic->meta_dev) -queue_work (ic->writer_wq, &ic->writer_work); +queue_work (ic->writer_wq, &ic->writer_work);drain_workqueue (ic->writer_wq);dm_integrity_flush_buffers (ic, true); }
drivers/mmc/host/sdhci.c +59 -12
141 lines not on this page · raw message
drivers/mmc/host/sdhci.h +6 -6
@@ -13,6 +13,7 @@#ifndef __SDHCI_HW_H#define __SDHCI_HW_H +#include <linux/bits.h> #include <linux/scatterlist.h> #include <linux/compiler.h> #include <linux/types.h>
@@ -259,12 +260,9 @@#define SDHCI_PRESET_FOR_SDR104 0x6C#define SDHCI_PRESET_FOR_DDR50 0x6E#define SDHCI_PRESET_FOR_HS400 0x74/* Non-standard */ -#define SDHCI_PRESET_DRV_MASK 0xC000 -#define SDHCI_PRESET_DRV_SHIFT 14 -#define SDHCI_PRESET_CLKGEN_SEL_MASK 0x400 -#define SDHCI_PRESET_CLKGEN_SEL_SHIFT 10 -#define SDHCI_PRESET_SDCLK_FREQ_MASK 0x3FF -#define SDHCI_PRESET_SDCLK_FREQ_SHIFT 0 +#define SDHCI_PRESET_DRV_MASK GENMASK(15, 14) +#define SDHCI_PRESET_CLKGEN_SEL BIT(10) +#define SDHCI_PRESET_SDCLK_FREQ_MASK GENMASK(9, 0)#define SDHCI_SLOT_INT_STATUS 0xFC
@@ -503,6 +501,8 @@ struct sdhci_host {unsigned int clock;/* Current clock (MHz) */ u8 pwr;/* Current voltage */ +u8 drv_type;/* Current UHS-I driver type */ +bool reinit_uhs;/* Force UHS-related re-initialization */ bool runtime_suspended;/* Host is runtime suspended */ bool bus_on;/* Bus power prevents runtime suspend */
drivers/net/can/cc770/cc770_isa.c +6 -4
@@ -272,22 +272,24 @@ static int cc770_isa_probe(struct platform_device *pdev)if (err) {dev_err (&pdev->dev,"couldn't register device (err=%d)\n" , err); - goto exit_unmap; + goto exit_free; }dev_info (&pdev->dev,"device registered (reg_base=0x%p, irq=%d)\n" , priv->reg_base, dev->irq);return 0 ; - exit_unmap: +exit_free: +free_cc770dev (dev); +exit_unmap:if (mem[idx])iounmap (base); - exit_release: +exit_release:if (mem[idx])release_mem_region (mem[idx], iosize);else release_region (port[idx], iosize); - exit: +exit:return err; }
drivers/net/can/sja1000/sja1000_isa.c +6 -4
@@ -213,22 +213,24 @@ static int sja1000_isa_probe(struct platform_device *pdev)if (err) {dev_err (&pdev->dev,"registering %s failed (err=%d)\n" ,DRV_NAME , err); - goto exit_unmap; + goto exit_free; }dev_info (&pdev->dev,"%s device registered (reg_base=0x%p, irq=%d)\n" ,DRV_NAME , priv->reg_base, dev->irq);return 0 ; - exit_unmap: +exit_free: +free_sja1000dev (dev); +exit_unmap:if (mem[idx])iounmap (base); - exit_release: +exit_release:if (mem[idx])release_mem_region (mem[idx], iosize);else release_region (port[idx], iosize); - exit: +exit:return err; }
drivers/net/dsa/lan9303-core.c +1 -1
@@ -966,7 +966,7 @@ static const struct lan9303_mib_desc lan9303_mib[] = { { .offset = LAN9303_MAC_TX_BRDCST_CNT_0, .name = "TxBroad", }, { .offset = LAN9303_MAC_TX_PAUSE_CNT_0, .name = "TxPause", }, { .offset = LAN9303_MAC_TX_MULCST_CNT_0, .name = "TxMulti", }, - { .offset = LAN9303_MAC_RX_UNDSZE_CNT_0, .name = "TxUnderRun", }, + { .offset = LAN9303_MAC_RX_UNDSZE_CNT_0, .name = "RxShort", }, { .offset = LAN9303_MAC_TX_64_CNT_0, .name = "Tx64Byte", }, { .offset = LAN9303_MAC_TX_127_CNT_0, .name = "Tx128Byte", }, { .offset = LAN9303_MAC_TX_255_CNT_0, .name = "Tx256Byte", },
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +8 -4
@@ -806,16 +806,20 @@ static void bnx2x_vf_enable_traffic(struct bnx2x *bp, struct bnx2x_virtf *vf)static u8 bnx2x_vf_is_pcie_pending (struct bnx2x *bp,u8 abs_vfid) { -struct pci_dev *dev;struct bnx2x_virtf *vf =bnx2x_vf_by_abs_fid (bp, abs_vfid); +struct pci_dev *dev; +bool pending;if (!vf)return false; dev =pci_get_domain_bus_and_slot (vf->domain, vf->bus, vf->devfn); -if (dev) -return bnx2x_is_pcie_pending (dev); -return false; +if (!dev) +return false; + pending =bnx2x_is_pcie_pending (dev); +pci_dev_put (dev); + +return pending; }int bnx2x_vf_flr_clnup_epilog (struct bnx2x *bp,u8 abs_vfid)
drivers/net/ethernet/cavium/thunder/thunder_bgx.c +3 -1
@@ -1447,8 +1447,10 @@ static acpi_status bgx_acpi_match_id(acpi_handle handle, u32 lvl,return AE_OK ; } -if (strncmp (string.pointer, bgx_sel,4 )) +if (strncmp (string.pointer, bgx_sel,4 )) { +kfree (string.pointer);return AE_OK ; + }acpi_walk_namespace (ACPI_TYPE_DEVICE , handle,1 , bgx_acpi_register_phy,NULL , bgx,NULL );
drivers/net/ethernet/mellanox/mlx4/qp.c +2 -1
@@ -697,7 +697,8 @@ static int mlx4_create_zones(struct mlx4_dev *dev, err =mlx4_bitmap_init (*bitmap + k,1 ,MLX4_QP_TABLE_RAW_ETH_SIZE -1 ,0 ,0 ); -mlx4_bitmap_alloc_range (*bitmap + k,1 ,1 ,0 ); +if (!err) +mlx4_bitmap_alloc_range (*bitmap + k,1 ,1 ,0 ); }if (err)
drivers/net/ethernet/mellanox/mlx5/core/cmd.c +2 -2
@@ -1324,8 +1324,8 @@ static ssize_t outlen_write(struct file *filp, const char __user *buf,return -EFAULT ; err =sscanf (outlen_str,"%d" , &outlen); -if (err <0 ) -return err; +if (err !=1 ) +return -EINVAL ; ptr =kzalloc (outlen,GFP_KERNEL );if (!ptr)
drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c +1 -1
@@ -600,7 +600,7 @@ static void mlx5_tracer_handle_timestamp_trace(struct mlx5_fw_tracer *tracer, trace_timestamp = (timestamp_event.timestamp &MASK_52_7 ) | (str_frmt->timestamp &MASK_6_0 ); else - trace_timestamp = ((timestamp_event.timestamp &MASK_52_7 ) -1 ) | + trace_timestamp = ((timestamp_event.timestamp -1 ) &MASK_52_7 ) | (str_frmt->timestamp &MASK_6_0 );mlx5_tracer_print_trace (str_frmt, dev, trace_timestamp);
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +5 -1
@@ -1177,6 +1177,7 @@ static void pch_gbe_tx_queue(struct pch_gbe_adapter *adapter, buffer_info->dma =0 ; buffer_info->time_stamp =0 ; tx_ring->next_to_use = ring_num; +dev_kfree_skb_any (skb);return ; } buffer_info->mapped = true;
@@ -2491,6 +2492,7 @@ static void pch_gbe_remove(struct pci_dev *pdev)unregister_netdev (netdev);pch_gbe_phy_hw_reset (&adapter->hw); +pci_dev_put (adapter->ptp_pdev);free_netdev (netdev); }
@@ -2572,7 +2574,7 @@ static int pch_gbe_probe(struct pci_dev *pdev,/* setup the private structure */ ret =pch_gbe_sw_init (adapter);if (ret) - goto err_free_netdev; + goto err_put_dev;/* Initialize PHY */ ret =pch_gbe_init_phy (adapter);
@@ -2630,6 +2632,8 @@ static int pch_gbe_probe(struct pci_dev *pdev, err_free_adapter:pch_gbe_phy_hw_reset (&adapter->hw); +err_put_dev: +pci_dev_put (adapter->ptp_pdev); err_free_netdev:free_netdev (netdev);return ret;
drivers/net/ethernet/qlogic/qla3xxx.c +1 -0
@@ -2477,6 +2477,7 @@ static netdev_tx_t ql3xxx_send(struct sk_buff *skb, skb_shinfo(skb)->nr_frags);if (tx_cb->seg_count ==-1 ) {netdev_err (ndev,"%s: invalid segment count!\n" , __func__); +dev_kfree_skb_any (skb);return NETDEV_TX_OK ; }
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c +2 -2
@@ -2993,7 +2993,7 @@ static void qlcnic_83xx_recover_driver_lock(struct qlcnic_adapter *adapter)QLCWRX (adapter->ahw,QLC_83XX_RECOVER_DRV_LOCK , val);dev_info (&adapter->pdev->dev,"%s: lock recovery initiated\n" , __func__); -msleep (QLC_83XX_DRV_LOCK_RECOVERY_DELAY ); +mdelay (QLC_83XX_DRV_LOCK_RECOVERY_DELAY ); val =QLCRDX (adapter->ahw,QLC_83XX_RECOVER_DRV_LOCK ); id = ((val >>2 ) &0xF );if (id == adapter->portnum) {
@@ -3029,7 +3029,7 @@ int qlcnic_83xx_lock_driver(struct qlcnic_adapter *adapter)if (status)break ; -msleep (QLC_83XX_DRV_LOCK_WAIT_DELAY ); +mdelay (QLC_83XX_DRV_LOCK_WAIT_DELAY ); i++;if (i ==1 )
drivers/net/ethernet/renesas/ravb_main.c +1 -0
@@ -2310,6 +2310,7 @@ static int __maybe_unused ravb_resume(struct device *dev) ret =ravb_open (ndev);if (ret <0 )return ret; +ravb_set_rx_mode (ndev);netif_device_attach (ndev); }
drivers/net/ntb_netdev.c +8 -1
@@ -506,7 +506,14 @@ static int __init ntb_netdev_init_module(void) rc =ntb_transport_register_client_dev (KBUILD_MODNAME );if (rc)return rc; -return ntb_transport_register_client (&ntb_netdev_client); + + rc =ntb_transport_register_client (&ntb_netdev_client); +if (rc) { +ntb_transport_unregister_client_dev (KBUILD_MODNAME ); +return rc; + } + +return 0 ; }module_init (ntb_netdev_init_module);
drivers/net/phy/phy_device.c +1 -0
@@ -1083,6 +1083,7 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, error_module_put:module_put (d->driver->owner); + d->driver =NULL ; error_put_device:put_device (d);if (ndev_owner != bus->owner)
drivers/net/tun.c +3 -1
@@ -756,7 +756,6 @@ static void __tun_detach(struct tun_file *tfile, bool clean)if (tun)xdp_rxq_info_unreg (&tfile->xdp_rxq);ptr_ring_cleanup (&tfile->tx_ring, tun_ptr_free); -sock_put (&tfile->sk); } }
@@ -772,6 +771,9 @@ static void tun_detach(struct tun_file *tfile, bool clean)if (dev)netdev_state_change (dev);rtnl_unlock (); + +if (clean) +sock_put (&tfile->sk); }static void tun_detach_all (struct net_device *dev)
drivers/net/usb/qmi_wwan.c +1 -0
@@ -1317,6 +1317,7 @@ static const struct usb_device_id products[] = { {QMI_FIXED_INTF(0x2357, 0x0201, 4)}, /* TP-LINK HSUPA Modem MA180 */ {QMI_FIXED_INTF(0x2357, 0x9000, 4)}, /* TP-LINK MA260 */ {QMI_QUIRK_SET_DTR(0x1bc7, 0x1031, 3)}, /* Telit LE910C1-EUX */ + {QMI_QUIRK_SET_DTR(0x1bc7, 0x103a, 0)}, /* Telit LE910C4-WWX */ {QMI_QUIRK_SET_DTR(0x1bc7, 0x1040, 2)}, /* Telit LE922A */ {QMI_QUIRK_SET_DTR(0x1bc7, 0x1050, 2)}, /* Telit FN980 */ {QMI_QUIRK_SET_DTR(0x1bc7, 0x1060, 2)}, /* Telit LN920 */
drivers/net/wireless/mac80211_hwsim.c +5 -0
@@ -686,6 +686,7 @@ static void hwsim_send_nullfunc(struct mac80211_hwsim_data *data, u8 *mac,struct hwsim_vif_priv *vp = (void *)vif->drv_priv;struct sk_buff *skb;struct ieee80211_hdr *hdr; +struct ieee80211_tx_info *cb;if (!vp->assoc)return ;
@@ -707,6 +708,10 @@ static void hwsim_send_nullfunc(struct mac80211_hwsim_data *data, u8 *mac,memcpy (hdr->addr2, mac,ETH_ALEN );memcpy (hdr->addr3, vp->bssid,ETH_ALEN ); + cb =IEEE80211_SKB_CB (skb); + cb->control.rates[0 ].count =1 ; + cb->control.rates[1 ].idx =-1 ; +rcu_read_lock ();mac80211_hwsim_tx_frame (data->hw, skb,rcu_dereference (vif->chanctx_conf)->def.chan);
drivers/nfc/st-nci/se.c +4 -2
@@ -338,7 +338,7 @@ static int st_nci_hci_connectivity_event_received(struct nci_dev *ndev,* AID 81 5 to 16 * PARAMETERS 82 0 to 255 */ -if (skb->len <NFC_MIN_AID_LENGTH +2 && +if (skb->len <NFC_MIN_AID_LENGTH +2 || skb->data[0 ] !=NFC_EVT_TRANSACTION_AID_TAG )return -EPROTO ;
@@ -352,8 +352,10 @@ static int st_nci_hci_connectivity_event_received(struct nci_dev *ndev,/* Check next byte is PARAMETERS tag (82) */ if (skb->data[transaction->aid_len +2 ] != -NFC_EVT_TRANSACTION_PARAMS_TAG ) +NFC_EVT_TRANSACTION_PARAMS_TAG ) { +devm_kfree (dev, transaction);return -EPROTO ; + } transaction->params_len = skb->data[transaction->aid_len +3 ]; memcpy(transaction->params, skb->data +
drivers/nvme/host/core.c +6 -0
@@ -2675,11 +2675,17 @@ static long nvme_dev_ioctl(struct file *file, unsigned int cmd,case NVME_IOCTL_IO_CMD :return nvme_dev_user_cmd (ctrl, argp);case NVME_IOCTL_RESET : +if (!capable (CAP_SYS_ADMIN )) +return -EACCES ;dev_warn (ctrl->device,"resetting controller\n" );return nvme_reset_ctrl_sync (ctrl);case NVME_IOCTL_SUBSYS_RESET : +if (!capable (CAP_SYS_ADMIN )) +return -EACCES ;return nvme_reset_subsystem (ctrl);case NVME_IOCTL_RESCAN : +if (!capable (CAP_SYS_ADMIN )) +return -EACCES ;nvme_queue_scan (ctrl);return 0 ;default :
drivers/of/property.c +3 -1
@@ -918,8 +918,10 @@ of_fwnode_get_reference_args(const struct fwnode_handle *fwnode, nargs, index, &of_args);if (ret <0 )return ret; -if (!args) +if (!args) { +of_node_put (of_args.np);return 0 ; + } args->nargs = of_args.args_count; args->fwnode =of_fwnode_handle (of_args.np);
drivers/pinctrl/intel/pinctrl-intel.c +26 -1
@@ -423,9 +423,14 @@ static void __intel_gpio_set_direction(void __iomem *padcfg0, bool input)writel (value, padcfg0); } +static int __intel_gpio_get_gpio_mode (u32 value) +{ +return (value &PADCFG0_PMODE_MASK ) >>PADCFG0_PMODE_SHIFT ; +} +static int intel_gpio_get_gpio_mode (void __iomem *padcfg0) { -return (readl (padcfg0) &PADCFG0_PMODE_MASK ) >>PADCFG0_PMODE_SHIFT ; +return __intel_gpio_get_gpio_mode (readl (padcfg0)); }static void intel_gpio_set_gpio_mode (void __iomem *padcfg0)
@@ -1429,6 +1434,7 @@ EXPORT_SYMBOL_GPL(intel_pinctrl_probe);static bool intel_pinctrl_should_save (struct intel_pinctrl *pctrl,unsigned pin) {const struct pin_desc *pd =pin_desc_get (pctrl->pctldev, pin); +u32 value;if (!pd || !intel_pad_usable (pctrl, pin))return false;
@@ -1443,6 +1449,25 @@ static bool intel_pinctrl_should_save(struct intel_pinctrl *pctrl, unsigned pin) gpiochip_line_is_irq(&pctrl->chip, pin))return true; +/* +* The firmware on some systems may configure GPIO pins to be +* an interrupt source in so called "direct IRQ" mode. In such +* cases the GPIO controller driver has no idea if those pins +* are being used or not. At the same time, there is a known bug +* in the firmwares that don't restore the pin settings correctly +* after suspend, i.e. by an unknown reason the Rx value becomes +* inverted. +* +* Hence, let's save and restore the pins that are configured +* as GPIOs in the input mode with GPIROUTIOXAPIC bit set. +* +* See https://bugzilla.kernel.org/show_bug.cgi?id=214749. +*/ + value =readl (intel_get_padcfg (pctrl, pin,PADCFG0 )); +if ((value &PADCFG0_GPIROUTIOXAPIC ) && (value &PADCFG0_GPIOTXDIS ) && + (__intel_gpio_get_gpio_mode (value) ==PADCFG0_PMODE_GPIO )) +return true; +return false; }
drivers/pinctrl/pinctrl-single.c +1 -1
@@ -703,7 +703,7 @@ static int pcs_allocate_pin_table(struct pcs_device *pcs) mux_bytes = pcs->width /BITS_PER_BYTE ; -if (pcs->bits_per_mux) { +if (pcs->bits_per_mux && pcs->fmask) { pcs->bits_per_pin =fls (pcs->fmask); nr_pins = (pcs->size *BITS_PER_BYTE ) / pcs->bits_per_pin; num_pins_in_register = pcs->width / pcs->bits_per_pin;
drivers/platform/x86/acer-wmi.c +9 -0
@@ -550,6 +550,15 @@ static const struct dmi_system_id acer_quirks[] __initconst = { }, .driver_data = (void *)ACER_CAP_KBD_DOCK, }, + { + .callback = set_force_caps, + .ident = "Acer Aspire Switch V 10 SW5-017", + .matches = { +DMI_EXACT_MATCH (DMI_SYS_VENDOR ,"Acer" ), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "SW5-017"), + }, + .driver_data = (void *)ACER_CAP_KBD_DOCK, + }, { .callback = set_force_caps, .ident = "Acer One 10 (S1003)",
drivers/platform/x86/asus-wmi.c +2 -0
@@ -1176,6 +1176,8 @@ static void asus_wmi_set_xusb2pr(struct asus_wmi *asus)pci_write_config_dword (xhci_pdev,USB_INTEL_XUSB2PR ,cpu_to_le32 (ports_available)); +pci_dev_put (xhci_pdev); +pr_info ("set USB_INTEL_XUSB2PR old: 0x%04x, new: 0x%04x\n" , orig_ports_available, ports_available); }
drivers/platform/x86/hp-wmi.c +3 -0
@@ -76,6 +76,7 @@ enum hp_wmi_event_ids {HPWMI_PEAKSHIFT_PERIOD =0x0F ,HPWMI_BATTERY_CHARGE_PERIOD =0x10 ,HPWMI_SANITIZATION_MODE =0x17 , + HPWMI_SMART_EXPERIENCE_APP = 0x21, }; struct bios_args {
@@ -634,6 +635,8 @@ static void hp_wmi_notify(u32 value, void *context)break ;case HPWMI_SANITIZATION_MODE :break ; +case HPWMI_SMART_EXPERIENCE_APP : +break ;default :pr_info ("Unknown event_id - %d - 0x%x\n" , event_id, event_data);break ;
drivers/s390/block/dasd_eckd.c +2 -4
@@ -3788,7 +3788,6 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_raw(struct dasd_device *startdev,struct dasd_device *basedev;struct req_iterator iter;struct dasd_ccw_req *cqr; -unsigned int first_offs;unsigned int trkcount;unsigned long *idaws;unsigned int size;
@@ -3822,7 +3821,6 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_raw(struct dasd_device *startdev, last_trk = (blk_rq_pos (req) +blk_rq_sectors (req) -1 ) /DASD_RAW_SECTORS_PER_TRACK ; trkcount = last_trk - first_trk +1 ; - first_offs =0 ;if (rq_data_dir (req) ==READ ) cmd =DASD_ECKD_CCW_READ_TRACK ;
@@ -3866,13 +3864,13 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_raw(struct dasd_device *startdev,if (use_prefix) {prefix_LRE (ccw++, data, first_trk, last_trk, cmd, basedev, - startdev,1 , first_offs +1 , trkcount,0 ,0 ); + startdev,1 ,0 , trkcount,0 ,0 ); }else {define_extent (ccw++, data, first_trk, last_trk, cmd, basedev,0 ); ccw[-1 ].flags |=CCW_FLAG_CC ; data +=sizeof (struct DE_eckd_data ); -locate_record_ext (ccw++, data, first_trk, first_offs +1 , +locate_record_ext (ccw++, data, first_trk,0 , trkcount, cmd, basedev,0 ,0 ); }
drivers/spi/spi-imx.c +1 -2
@@ -429,8 +429,7 @@ static unsigned int mx51_ecspi_clkdiv(struct spi_imx_data *spi_imx,unsigned int pre, post;unsigned int fin = spi_imx->spi_clk; -if (unlikely (fspi > fin)) -return 0 ; + fspi =min (fspi, fin); post =fls (fin) -fls (fspi);if (fin > fspi << post)
drivers/spi/spi-stm32.c +1 -1
@@ -255,7 +255,7 @@ static int stm32_spi_prepare_mbr(struct stm32_spi *spi, u32 speed_hz)u32 div, mbrdiv;/* Ensure spi->clk_rate is even */ - div =DIV_ROUND_UP (spi->clk_rate & ~0x1 , speed_hz); + div =DIV_ROUND_CLOSEST (spi->clk_rate & ~0x1 , speed_hz);/* * SPI framework set xfer->speed_hz to master->max_speed_hz if
drivers/tty/serial/8250/8250_omap.c +4 -3
@@ -244,6 +244,7 @@ static void omap8250_restore_regs(struct uart_8250_port *up) {struct omap8250_priv *priv = up->port.private_data;struct uart_8250_dma *dma = up->dma; +u8 mcr =serial8250_in_MCR (up);if (dma && dma->tx_running) {/*
@@ -260,7 +261,7 @@ static void omap8250_restore_regs(struct uart_8250_port *up)serial_out (up,UART_EFR ,UART_EFR_ECB );serial_out (up,UART_LCR ,UART_LCR_CONF_MODE_A ); -serial8250_out_MCR (up,UART_MCR_TCRTLR ); +serial8250_out_MCR (up, mcr |UART_MCR_TCRTLR );serial_out (up,UART_FCR , up->fcr);omap8250_update_scr (up, priv);
@@ -276,7 +277,8 @@ static void omap8250_restore_regs(struct uart_8250_port *up)serial_out (up,UART_LCR ,0 );/* drop TCR + TLR access, we setup XON/XOFF later */ -serial8250_out_MCR (up, up->mcr); +serial8250_out_MCR (up, mcr); +serial_out (up,UART_IER , up->ier);serial_out (up,UART_LCR ,UART_LCR_CONF_MODE_B );
@@ -585,7 +587,6 @@ static int omap_8250_startup(struct uart_port *port)pm_runtime_get_sync (port->dev); - up->mcr =0 ;serial_out (up,UART_FCR ,UART_FCR_CLEAR_RCVR |UART_FCR_CLEAR_XMIT );serial_out (up,UART_LCR ,UART_LCR_WLEN8 );
drivers/xen/platform-pci.c +5 -2
@@ -150,7 +150,7 @@ static int platform_pci_probe(struct pci_dev *pdev,if (ret) {dev_warn (&pdev->dev,"Unable to set the evtchn callback " "err=%d\n" , ret); - goto out; + goto irq_out; } }
@@ -158,13 +158,16 @@ static int platform_pci_probe(struct pci_dev *pdev, grant_frames =alloc_xen_mmio (PAGE_SIZE * max_nr_gframes); ret =gnttab_setup_auto_xlat_frames (grant_frames);if (ret) - goto out; + goto irq_out; ret =gnttab_init ();if (ret) goto grant_out;return 0 ; grant_out:gnttab_free_auto_xlat_frames (); +irq_out: +if (!xen_have_vector_callback) +free_irq (pdev->irq, pdev); out:pci_release_region (pdev,0 ); mem_out:
fs/btrfs/ioctl.c +13 -10
@@ -2759,6 +2759,8 @@ static int btrfs_ioctl_get_subvol_info(struct file *file, void __user *argp) } } +btrfs_free_path (path); + path =NULL ;if (copy_to_user (argp, subvol_info,sizeof (*subvol_info))) ret = -EFAULT ;
@@ -2849,6 +2851,8 @@ static int btrfs_ioctl_get_subvol_rootref(struct file *file, void __user *argp) } out: +btrfs_free_path (path); +if (!ret || ret == -EOVERFLOW ) { rootrefs->num_items = found;/* update min_treeid for next search */
@@ -2860,7 +2864,6 @@ static int btrfs_ioctl_get_subvol_rootref(struct file *file, void __user *argp) }kfree (rootrefs); -btrfs_free_path (path);return ret; }
@@ -4886,6 +4889,8 @@ static long btrfs_ioctl_ino_to_path(struct btrfs_root *root, void __user *arg) ipath->fspath->val[i] = rel_ptr; } +btrfs_free_path (path); + path =NULL ; ret =copy_to_user ((void __user *)(unsigned long )ipa->fspath, ipath->fspath, size);if (ret) {
@@ -4956,21 +4961,20 @@ static long btrfs_ioctl_logical_to_ino(struct btrfs_fs_info *fs_info, size =min_t (u32, loi->size,SZ_16M ); } - path =btrfs_alloc_path (); -if (!path) { - ret = -ENOMEM ; - goto out; - } - inodes =init_data_container (size);if (IS_ERR (inodes)) { ret =PTR_ERR (inodes); - inodes =NULL ; - goto out; + goto out_loi; } + path =btrfs_alloc_path (); +if (!path) { + ret = -ENOMEM ; + goto out; + } ret =iterate_inodes_from_logical (loi->logical, fs_info, path, build_ino_list, inodes, ignore_offset); +btrfs_free_path (path);if (ret == -EINVAL ) ret = -ENOENT ;if (ret <0 )
@@ -4982,7 +4986,6 @@ static long btrfs_ioctl_logical_to_ino(struct btrfs_fs_info *fs_info, ret = -EFAULT ; out: -btrfs_free_path (path);kvfree (inodes); out_loi:kfree (loi);
fs/btrfs/qgroup.c +1 -8
@@ -2368,14 +2368,7 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans, u64 srcid, dstgroup->rsv_rfer = inherit->lim.rsv_rfer; dstgroup->rsv_excl = inherit->lim.rsv_excl; - ret =update_qgroup_limit_item (trans, dstgroup); -if (ret) { - fs_info->qgroup_flags |=BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT ; -btrfs_info (fs_info, -"unable to update quota limit for %llu" , - dstgroup->qgroupid); - goto unlock; - } +qgroup_dirty (fs_info, dstgroup); }if (srcid) {
fs/ceph/snap.c +21 -10
@@ -671,14 +671,17 @@ int ceph_update_snap_trace(struct ceph_mds_client *mdsc,struct ceph_mds_snap_realm *ri;/* encoded */ __le64 *snaps;/* encoded */ __le64 *prior_parent_snaps;/* encoded */ -struct ceph_snap_realm *realm =NULL ; +struct ceph_snap_realm *realm;struct ceph_snap_realm *first_realm =NULL ; -int invalidate =0 ; +struct ceph_snap_realm *realm_to_rebuild =NULL ; +int rebuild_snapcs;int err = -ENOMEM ;LIST_HEAD (dirty_realms);dout ("update_snap_trace deletion=%d\n" , deletion); more: + realm =NULL ; + rebuild_snapcs =0 ;ceph_decode_need (&p, e,sizeof (*ri), bad); ri = p; p +=sizeof (*ri);
@@ -702,7 +705,7 @@ int ceph_update_snap_trace(struct ceph_mds_client *mdsc, err =adjust_snap_realm_parent (mdsc, realm,le64_to_cpu (ri->parent));if (err <0 ) goto fail; - invalidate += err; + rebuild_snapcs += err;if (le64_to_cpu (ri->seq) > realm->seq) { dout("update_snap_trace updating %llx %p %lld -> %lld\n",
@@ -727,22 +730,30 @@ int ceph_update_snap_trace(struct ceph_mds_client *mdsc,if (realm->seq > mdsc->last_snap_seq) mdsc->last_snap_seq = realm->seq; - invalidate =1 ; + rebuild_snapcs =1 ; }else if (!realm->cached_context) {dout ("update_snap_trace %llx %p seq %lld new\n" , realm->ino, realm, realm->seq); - invalidate =1 ; + rebuild_snapcs =1 ; }else {dout ("update_snap_trace %llx %p seq %lld unchanged\n" , realm->ino, realm, realm->seq); } -dout ("done with %llx %p, invalidated=%d, %p %p\n" , realm->ino, - realm, invalidate, p, e); +dout ("done with %llx %p, rebuild_snapcs=%d, %p %p\n" , realm->ino, + realm, rebuild_snapcs, p, e); + +/* +* this will always track the uppest parent realm from which +* we need to rebuild the snapshot contexts _downward_ in +* hierarchy. +*/ +if (rebuild_snapcs) + realm_to_rebuild = realm; -/* invalidate when we reach the _end_ (root) of the trace */ -if (invalidate && p >= e) -rebuild_snap_realms (realm, &dirty_realms); +/* rebuild_snapcs when we reach the _end_ (root) of the trace */ +if (realm_to_rebuild && p >= e) +rebuild_snap_realms (realm_to_rebuild, &dirty_realms);if (!first_realm) first_realm = realm;
fs/nilfs2/dat.c +7 -0
@@ -111,6 +111,13 @@ static void nilfs_dat_commit_free(struct inode *dat,kunmap_atomic (kaddr);nilfs_dat_commit_entry (dat, req); + +if (unlikely (req->pr_desc_bh ==NULL || req->pr_bitmap_bh ==NULL )) { +nilfs_error (dat->i_sb, +"state inconsistency probably due to duplicate use of vblocknr = %llu" , + (unsigned long long )req->pr_entry_nr); +return ; + }nilfs_palloc_commit_free_entry (dat, req); }
fs/nilfs2/sufile.c +8 -0
@@ -498,14 +498,22 @@ void nilfs_sufile_do_free(struct inode *sufile, __u64 segnum,int nilfs_sufile_mark_dirty (struct inode *sufile,__u64 segnum) {struct buffer_head *bh; +void *kaddr; +struct nilfs_segment_usage *su;int ret; +down_write (&NILFS_MDT (sufile)->mi_sem); ret =nilfs_sufile_get_segment_usage_block (sufile, segnum,0 , &bh);if (!ret) {mark_buffer_dirty (bh);nilfs_mdt_mark_dirty (sufile); + kaddr =kmap_atomic (bh->b_page); + su =nilfs_sufile_block_get_segment_usage (sufile, segnum, bh, kaddr); +nilfs_segment_usage_set_dirty (su); +kunmap_atomic (kaddr);brelse (bh); } +up_write (&NILFS_MDT (sufile)->mi_sem);return ret; }
include/linux/mmdebug.h +1 -1
@@ -38,7 +38,7 @@ void dump_mm(const struct mm_struct *mm); } \ } while (0)#define VM_WARN_ON_ONCE_PAGE (cond, page) ({ \ - static bool __section(".data.once") __warned; \ + static bool __section(.data.once) __warned; \ int __ret_warn_once = !!(cond); \ \ if (unlikely(__ret_warn_once && !__warned)) { \
include/uapi/linux/audit.h +1 -1
@@ -177,7 +177,7 @@#define AUDIT_MAX_KEY_LEN 256#define AUDIT_BITMASK_SIZE 64#define AUDIT_WORD (nr) ((__u32)((nr)/32)) -#define AUDIT_BIT (nr) (1 << ((nr) - AUDIT_WORD(nr)*32)) +#define AUDIT_BIT (nr) (1U << ((nr) - AUDIT_WORD(nr)*32))#define AUDIT_SYSCALL_CLASSES 16#define AUDIT_CLASS_DIR_WRITE 0
ipc/sem.c +2 -1
@@ -2148,6 +2148,7 @@ static long do_semtimedop(int semid, struct sembuf __user *tsops,* scenarios where we were awakened externally, during the * window between wake_q_add() and wake_up_q(). */ +rcu_read_lock (); error =READ_ONCE (queue.status);if (error != -EINTR ) {/*
@@ -2157,10 +2158,10 @@ static long do_semtimedop(int semid, struct sembuf __user *tsops,* overwritten by the previous owner of the semaphore. */ smp_mb (); +rcu_read_unlock (); goto out_free; } -rcu_read_lock (); locknum =sem_lock (sma, sops, nsops);if (!ipc_valid_object (&sma->sem_perm))
kernel/sysctl.c +15 -15
@@ -2081,13 +2081,14 @@ int proc_dostring(struct ctl_table *table, int write, (char __user *)buffer, lenp, ppos); } -static size_t proc_skip_spaces (char **buf) +static void proc_skip_spaces (char **buf,size_t *size) { -size_t ret; -char *tmp =skip_spaces (*buf); - ret = tmp - *buf; - *buf = tmp; -return ret; +while (*size) { +if (!isspace (**buf)) +break ; + (*size)--; + (*buf)++; + } }static void proc_skip_char (char **buf,size_t *size,const char v)
@@ -2156,13 +2157,12 @@ static int proc_get_long(char **buf, size_t *size, unsigned long *val, bool *neg, const char *perm_tr, unsigned perm_tr_len, char *tr) { - int len; char *p, tmp[TMPBUFLEN]; +ssize_t len = *size; -if (!*size) +if (len <=0 )return -EINVAL ; - len = *size;if (len >TMPBUFLEN -1 ) len =TMPBUFLEN -1 ;
@@ -2325,7 +2325,7 @@ static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table,bool neg;if (write) { - left -=proc_skip_spaces (&p); +proc_skip_spaces (&p, &left);if (!left)break ;
@@ -2356,7 +2356,7 @@ static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table,if (!write && !first && left && !err) err =proc_put_char (&buffer, &left,'\n' );if (write && !err && left) - left -=proc_skip_spaces (&p); +proc_skip_spaces (&p, &left);if (write) {kfree (kbuf);if (first)
@@ -2405,7 +2405,7 @@ static int do_proc_douintvec_w(unsigned int *tbl_data,if (IS_ERR (kbuf))return -EINVAL ; - left -=proc_skip_spaces (&p); +proc_skip_spaces (&p, &left);if (!left) { err = -EINVAL ; goto out_free;
@@ -2425,7 +2425,7 @@ static int do_proc_douintvec_w(unsigned int *tbl_data, }if (!err && left) - left -=proc_skip_spaces (&p); +proc_skip_spaces (&p, &left); out_free:kfree (kbuf);
@@ -2846,7 +2846,7 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, intif (write) {bool neg; - left -=proc_skip_spaces (&p); +proc_skip_spaces (&p, &left);if (!left)break ;
@@ -2879,7 +2879,7 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, intif (!write && !first && left && !err) err =proc_put_char (&buffer, &left,'\n' );if (write && !err) - left -=proc_skip_spaces (&p); +proc_skip_spaces (&p, &left);if (write) {kfree (kbuf);if (first)
lib/Kconfig.debug +11 -3
@@ -224,8 +224,10 @@ config FRAME_WARN range 0 8192 default 3072 if KASAN_EXTRA default 2048 if GCC_PLUGIN_LATENT_ENTROPY - default 1280 if (!64BIT && PARISC) - default 1024 if (!64BIT && !PARISC) + default 2048 if PARISC + default 1536 if (!64BIT && XTENSA) + default 1280 if KASAN && !64BIT + default 1024 if !64BIT default 2048 if 64BIT help Tell gcc to warn at build time for stack frames larger than this.
@@ -1510,8 +1512,14 @@ config NETDEV_NOTIFIER_ERROR_INJECT If unsure, say N. config FUNCTION_ERROR_INJECTION - def_bool y + bool "Fault-injections of functions" depends on HAVE_FUNCTION_ERROR_INJECTION && KPROBES + help + Add fault injections into various functions that are annotated with + ALLOW_ERROR_INJECTION() in the kernel. BPF may also modify the return + value of theses functions. This is useful to test error paths of code. + + If unsure, say N config FAULT_INJECTION bool "Fault-injection framework"
mm/frame_vector.c +6 -25
@@ -37,7 +37,6 @@ int get_vaddr_frames(unsigned long start, unsigned int nr_frames,struct mm_struct *mm = current->mm;struct vm_area_struct *vma;int ret =0 ; -int err;int locked;if (nr_frames ==0 )
@@ -72,32 +71,14 @@ int get_vaddr_frames(unsigned long start, unsigned int nr_frames, vec->is_pfns = false; ret =get_user_pages_locked (start, nr_frames, gup_flags, (struct page **)(vec->ptrs), &locked); - goto out; +if (likely (ret >0 )) + goto out; } - vec->got_ref = false; - vec->is_pfns = true; -do { -unsigned long *nums =frame_vector_pfns (vec); - -while (ret < nr_frames && start +PAGE_SIZE <= vma->vm_end) { - err =follow_pfn (vma, start, &nums[ret]); -if (err) { -if (ret ==0 ) - ret = err; - goto out; - } - start +=PAGE_SIZE ; - ret++; - } -/* -* We stop if we have enough pages or if VMA doesn't completely -* cover the tail page. -*/ -if (ret >= nr_frames || start < vma->vm_end) -break ; - vma =find_vma_intersection (mm, start, start +1 ); - }while (vma && vma->vm_flags & (VM_IO |VM_PFNMAP )); +/* This used to (racily) return non-refcounted pfns. Let people know */ +WARN_ONCE (1 ,"get_vaddr_frames() cannot follow VM_IO mapping" ); + vec->nr_frames =0 ; + out:if (locked)up_read (&mm->mmap_sem);
net/9p/trans_fd.c +5 -1
@@ -215,9 +215,11 @@ static void p9_conn_cancel(struct p9_conn *m, int err)list_for_each_entry_safe (req, rtmp, &m->req_list, req_list) {list_move (&req->req_list, &cancel_list); + req->status =REQ_STATUS_ERROR ; }list_for_each_entry_safe (req, rtmp, &m->unsent_req_list, req_list) {list_move (&req->req_list, &cancel_list); + req->status =REQ_STATUS_ERROR ; }spin_unlock (&m->client->lock);
@@ -865,8 +867,10 @@ static int p9_socket_open(struct p9_client *client, struct socket *csocket)struct file *file; p =kzalloc (sizeof (struct p9_trans_fd ),GFP_KERNEL ); -if (!p) +if (!p) { +sock_release (csocket);return -ENOMEM ; + } csocket->sk->sk_allocation =GFP_NOIO ; file =sock_alloc_file (csocket,0 ,NULL );
net/bluetooth/l2cap_core.c +13 -0
@@ -5553,6 +5553,19 @@ static int l2cap_le_connect_req(struct l2cap_conn *conn,BT_DBG ("psm 0x%2.2x scid 0x%4.4x mtu %u mps %u" ,__le16_to_cpu (psm), scid, mtu, mps); +/* BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 3, Part A +* page 1059: +* +* Valid range: 0x0001-0x00ff +* +* Table 4.15: L2CAP_LE_CREDIT_BASED_CONNECTION_REQ SPSM ranges +*/ +if (!psm ||__le16_to_cpu (psm) >L2CAP_PSM_LE_DYN_END ) { + result =L2CAP_CR_BAD_PSM ; + chan =NULL ; + goto response; + } +/* Check if we have socket listening on psm */ pchan =l2cap_global_chan_by_psm (BT_LISTEN , psm, &conn->hcon->src, &conn->hcon->dst,LE_LINK );
net/dccp/ipv4.c +2 -0
@@ -134,6 +134,8 @@ int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)* This unhashes the socket and releases the local port, if necessary. */ dccp_set_state (sk,DCCP_CLOSED ); +if (!(sk->sk_userlocks &SOCK_BINDADDR_LOCK )) +inet_reset_saddr (sk);ip_rt_put (rt); sk->sk_route_caps =0 ; inet->inet_dport =0 ;
net/dccp/ipv6.c +2 -0
@@ -957,6 +957,8 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr, late_failure:dccp_set_state (sk,DCCP_CLOSED ); +if (!(sk->sk_userlocks &SOCK_BINDADDR_LOCK )) +inet_reset_saddr (sk);__sk_dst_reset (sk); failure: inet->inet_dport =0 ;
net/hsr/hsr_forward.c +3 -2
@@ -207,17 +207,18 @@ static void hsr_deliver_master(struct sk_buff *skb, struct net_device *dev, struct hsr_node *node_src) {bool was_multicast_frame; -int res; +int res, recv_len; was_multicast_frame = (skb->pkt_type ==PACKET_MULTICAST );hsr_addr_subst_source (node_src, skb);skb_pull (skb,ETH_HLEN ); + recv_len = skb->len; res =netif_rx (skb);if (res ==NET_RX_DROP ) { dev->stats.rx_dropped++; }else { dev->stats.rx_packets++; - dev->stats.rx_bytes += skb->len; + dev->stats.rx_bytes += recv_len;if (was_multicast_frame) dev->stats.multicast++; }
net/ipv4/Kconfig +10 -0
@@ -388,6 +388,16 @@ config INET_IPCOMP If unsure, say Y. +config INET_TABLE_PERTURB_ORDER + int "INET: Source port perturbation table size (as power of 2)" if EXPERT + default 16 + help + Source port perturbation table size (as power of 2) for + RFC 6056 3.3.4. Algorithm 4: Double-Hash Port Selection Algorithm. + + The default is almost always what you want. + Only change this if you know what you are doing. + config INET_XFRM_TUNNEL tristate select INET_TUNNEL
net/ipv4/inet_hashtables.c +5 -5
@@ -718,13 +718,13 @@ EXPORT_SYMBOL_GPL(inet_unhash);* Note that we use 32bit integers (vs RFC 'short integers') * because 2^16 is not a multiple of num_ephemeral and this * property might be used by clever attacker. +* * RFC claims using TABLE_LENGTH=10 buckets gives an improvement, though -* attacks were since demonstrated, thus we use 65536 instead to really -* give more isolation and privacy, at the expense of 256kB of kernel -* memory. +* attacks were since demonstrated, thus we use 65536 by default instead +* to really give more isolation and privacy, at the expense of 256kB +* of kernel memory. */ -#define INET_TABLE_PERTURB_SHIFT 16 -#define INET_TABLE_PERTURB_SIZE (1 << INET_TABLE_PERTURB_SHIFT) +#define INET_TABLE_PERTURB_SIZE (1 << CONFIG_INET_TABLE_PERTURB_ORDER)static u32 *table_perturb; int __inet_hash_connect(struct inet_timewait_death_row *death_row,
net/ipv4/tcp_ipv4.c +2 -0
@@ -328,6 +328,8 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)* if necessary. */ tcp_set_state (sk,TCP_CLOSE ); +if (!(sk->sk_userlocks &SOCK_BINDADDR_LOCK )) +inet_reset_saddr (sk);ip_rt_put (rt); sk->sk_route_caps =0 ; inet->inet_dport =0 ;
net/ipv6/ipv6_sockglue.c +7 -0
@@ -166,6 +166,12 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,rtnl_lock ();lock_sock (sk); +/* Another thread has converted the socket into IPv4 with +* IPV6_ADDRFORM concurrently. +*/ +if (unlikely (sk->sk_family !=AF_INET6 )) + goto unlock; +switch (optname) {case IPV6_ADDRFORM :
@@ -913,6 +919,7 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,break ; } +unlock:release_sock (sk);if (needs_rtnl)rtnl_unlock ();
net/ipv6/tcp_ipv6.c +2 -0
@@ -327,6 +327,8 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, late_failure:tcp_set_state (sk,TCP_CLOSE ); +if (!(sk->sk_userlocks &SOCK_BINDADDR_LOCK )) +inet_reset_saddr (sk); failure: inet->inet_dport =0 ; sk->sk_route_caps =0 ;
net/ipv6/xfrm6_policy.c +5 -1
@@ -416,9 +416,13 @@ int __init xfrm6_init(void)if (ret) goto out_state; -register_pernet_subsys (&xfrm6_net_ops); + ret =register_pernet_subsys (&xfrm6_net_ops); +if (ret) + goto out_protocol; out:return ret; +out_protocol: +xfrm6_protocol_fini (); out_state:xfrm6_state_fini (); out_policy:
net/key/af_key.c +22 -10
@@ -2915,7 +2915,7 @@ static int count_ah_combs(const struct xfrm_tmpl *t)break ;if (!aalg->pfkey_supported)continue ; -if (aalg_tmpl_set (t, aalg) && aalg->available) +if (aalg_tmpl_set (t, aalg)) sz +=sizeof (struct sadb_comb ); }return sz +sizeof (struct sadb_prop );
@@ -2933,7 +2933,7 @@ static int count_esp_combs(const struct xfrm_tmpl *t)if (!ealg->pfkey_supported)continue ; -if (!(ealg_tmpl_set (t, ealg) && ealg->available)) +if (!(ealg_tmpl_set (t, ealg)))continue ;for (k =1 ; ; k++) {
@@ -2944,16 +2944,17 @@ static int count_esp_combs(const struct xfrm_tmpl *t)if (!aalg->pfkey_supported)continue ; -if (aalg_tmpl_set (t, aalg) && aalg->available) +if (aalg_tmpl_set (t, aalg)) sz +=sizeof (struct sadb_comb ); } }return sz +sizeof (struct sadb_prop ); } -static void dump_ah_combs (struct sk_buff *skb,const struct xfrm_tmpl *t) +static int dump_ah_combs (struct sk_buff *skb,const struct xfrm_tmpl *t) {struct sadb_prop *p; +int sz =0 ;int i; p =skb_put (skb,sizeof (struct sadb_prop ));
@@ -2981,13 +2982,17 @@ static void dump_ah_combs(struct sk_buff *skb, const struct xfrm_tmpl *t) c->sadb_comb_soft_addtime =20 *60 *60 ; c->sadb_comb_hard_usetime =8 *60 *60 ; c->sadb_comb_soft_usetime =7 *60 *60 ; + sz +=sizeof (*c); } } + +return sz +sizeof (*p); } -static void dump_esp_combs (struct sk_buff *skb,const struct xfrm_tmpl *t) +static int dump_esp_combs (struct sk_buff *skb,const struct xfrm_tmpl *t) {struct sadb_prop *p; +int sz =0 ;int i, k; p =skb_put (skb,sizeof (struct sadb_prop ));
@@ -3029,8 +3034,11 @@ static void dump_esp_combs(struct sk_buff *skb, const struct xfrm_tmpl *t) c->sadb_comb_soft_addtime =20 *60 *60 ; c->sadb_comb_hard_usetime =8 *60 *60 ; c->sadb_comb_soft_usetime =7 *60 *60 ; + sz +=sizeof (*c); } } + +return sz +sizeof (*p); }static int key_notify_policy_expire (struct xfrm_policy *xp,const struct km_event *c)
@@ -3160,6 +3168,7 @@ static int pfkey_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *t, structstruct sadb_x_sec_ctx *sec_ctx;struct xfrm_sec_ctx *xfrm_ctx;int ctx_size =0 ; +int alg_size =0 ; sockaddr_size =pfkey_sockaddr_size (x->props.family);if (!sockaddr_size)
@@ -3171,16 +3180,16 @@ static int pfkey_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *t, structsizeof (struct sadb_x_policy );if (x->id.proto ==IPPROTO_AH ) - size +=count_ah_combs (t); + alg_size =count_ah_combs (t);else if (x->id.proto ==IPPROTO_ESP ) - size +=count_esp_combs (t); + alg_size =count_esp_combs (t);if ((xfrm_ctx = x->security)) { ctx_size =PFKEY_ALIGN8 (xfrm_ctx->ctx_len); size +=sizeof (struct sadb_x_sec_ctx ) + ctx_size; } - skb =alloc_skb (size +16 ,GFP_ATOMIC ); + skb =alloc_skb (size + alg_size +16 ,GFP_ATOMIC );if (skb ==NULL )return -ENOMEM ;
@@ -3234,10 +3243,13 @@ static int pfkey_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *t, struct pol->sadb_x_policy_priority = xp->priority;/* Set sadb_comb's. */ + alg_size =0 ;if (x->id.proto ==IPPROTO_AH ) -dump_ah_combs (skb, t); + alg_size =dump_ah_combs (skb, t);else if (x->id.proto ==IPPROTO_ESP ) -dump_esp_combs (skb, t); + alg_size =dump_esp_combs (skb, t); + + hdr->sadb_msg_len += alg_size /8 ;/* security context */ if (xfrm_ctx) {
net/mac80211/mesh_pathtbl.c +1 -1
@@ -731,7 +731,7 @@ int mesh_path_send_to_gates(struct mesh_path *mpath)void mesh_path_discard_frame (struct ieee80211_sub_if_data *sdata,struct sk_buff *skb) { -kfree_skb (skb); +ieee80211_free_txskb (&sdata->local->hw, skb); sdata->u.mesh.mshstats.dropped_frames_no_route++; }
net/nfc/nci/core.c +1 -1
@@ -542,7 +542,7 @@ static int nci_open_device(struct nci_dev *ndev)skb_queue_purge (&ndev->tx_q); ndev->ops->close (ndev); - ndev->flags =0 ; + ndev->flags &=BIT (NCI_UNREG ); } done:
net/nfc/nci/data.c +3 -1
@@ -291,8 +291,10 @@ void nci_rx_data_packet(struct nci_dev *ndev, struct sk_buff *skb) nci_plen(skb->data)); conn_info =nci_get_conn_info_by_conn_id (ndev,nci_conn_id (skb->data)); -if (!conn_info) +if (!conn_info) { +kfree_skb (skb);return ; + }/* strip the nci data header */ skb_pull (skb,NCI_DATA_HDR_SIZE );
net/packet/af_packet.c +2 -4
@@ -2209,8 +2209,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,if (skb->ip_summed ==CHECKSUM_PARTIAL ) status |=TP_STATUS_CSUMNOTREADY ;else if (skb->pkt_type !=PACKET_OUTGOING && - (skb->ip_summed ==CHECKSUM_COMPLETE || -skb_csum_unnecessary (skb))) +skb_csum_unnecessary (skb)) status |=TP_STATUS_CSUM_VALID ;if (snaplen > res)
@@ -3452,8 +3451,7 @@ static int packet_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,if (skb->ip_summed ==CHECKSUM_PARTIAL ) aux.tp_status |=TP_STATUS_CSUMNOTREADY ;else if (skb->pkt_type !=PACKET_OUTGOING && - (skb->ip_summed ==CHECKSUM_COMPLETE || -skb_csum_unnecessary (skb))) +skb_csum_unnecessary (skb)) aux.tp_status |=TP_STATUS_CSUM_VALID ; aux.tp_len = origlen;
net/tipc/discover.c +4 -1
@@ -208,7 +208,10 @@ void tipc_disc_rcv(struct net *net, struct sk_buff *skb,u32 self;int err; -skb_linearize (skb); +if (skb_linearize (skb)) { +kfree_skb (skb); +return ; + } hdr =buf_msg (skb);if (caps &TIPC_NODE_ID128 )
net/tipc/topsrv.c +11 -9
@@ -184,7 +184,7 @@ static void tipc_conn_close(struct tipc_conn *con)conn_put (con); } -static struct tipc_conn *tipc_conn_alloc (struct tipc_topsrv *s) +static struct tipc_conn *tipc_conn_alloc (struct tipc_topsrv *s,struct socket *sock) {struct tipc_conn *con;int ret;
@@ -210,10 +210,12 @@ static struct tipc_conn *tipc_conn_alloc(struct tipc_topsrv *s) } con->conid = ret; s->idr_in_use++; -spin_unlock_bh (&s->idr_lock);set_bit (CF_CONNECTED , &con->flags); con->server = s; + con->sock = sock; +conn_get (con); +spin_unlock_bh (&s->idr_lock);return con; }
@@ -474,7 +476,7 @@ static void tipc_topsrv_accept(struct work_struct *work) ret =kernel_accept (lsock, &newsock,O_NONBLOCK );if (ret <0 )return ; - con =tipc_conn_alloc (srv); + con =tipc_conn_alloc (srv, newsock);if (IS_ERR (con)) { ret =PTR_ERR (con);sock_release (newsock);
@@ -486,11 +488,11 @@ static void tipc_topsrv_accept(struct work_struct *work) newsk->sk_data_ready = tipc_conn_data_ready; newsk->sk_write_space = tipc_conn_write_space; newsk->sk_user_data = con; - con->sock = newsock;write_unlock_bh (&newsk->sk_callback_lock);/* Wake up receive process in case of 'SYN+' message */ newsk->sk_data_ready (newsk); +conn_put (con); } }
@@ -584,17 +586,17 @@ bool tipc_topsrv_kern_subscr(struct net *net, u32 port, u32 type, u32 lower, sub.filter = filter; *(u64 *)&sub.usr_handle = (u64 )port; - con =tipc_conn_alloc (tipc_topsrv (net)); + con =tipc_conn_alloc (tipc_topsrv (net),NULL );if (IS_ERR (con))return false; *conid = con->conid; - con->sock =NULL ; rc =tipc_conn_rcv_sub (tipc_topsrv (net), con, &sub); -if (rc >=0 ) -return true; +if (rc) +conn_put (con); +conn_put (con); -return false; +return !rc; }void tipc_topsrv_kern_unsubscr (struct net *net,int conid)
scripts/faddr2line +4 -3
@@ -73,7 +73,8 @@ command -v ${ADDR2LINE} >/dev/null 2>&1 || die "${ADDR2LINE} isn't installed" find_dir_prefix() { local objfile=$1 - local start_kernel_addr=$(${READELF} --symbols --wide $objfile | ${AWK} '$8 == "start_kernel" {printf "0x%s", $2}') + local start_kernel_addr=$(${READELF} --symbols --wide $objfile | sed 's/\[.*\]//' | + ${AWK} '$8 == "start_kernel" {printf "0x%s", $2}') [[ -z $start_kernel_addr ]] && return local file_line=$(${ADDR2LINE} -e $objfile $start_kernel_addr)
@@ -177,7 +178,7 @@ __faddr2line() { found=2 break fi - done < <(${READELF} --symbols --wide $objfile | ${AWK} -v sec=$sym_sec '$7 == sec' | sort --key=2) + done < <(${READELF} --symbols --wide $objfile | sed 's/\[.*\]//' | ${AWK} -v sec=$sym_sec '$7 == sec' | sort --key=2) if [[ $found = 0 ]]; then warn "can't find symbol: sym_name: $sym_name sym_sec: $sym_sec sym_addr: $sym_addr sym_elf_size: $sym_elf_size"
@@ -258,7 +259,7 @@ __faddr2line() { DONE=1 - done < <(${READELF} --symbols --wide $objfile | ${AWK} -v fn=$sym_name '$4 == "FUNC" && $8 == fn') + done < <(${READELF} --symbols --wide $objfile | sed 's/\[.*\]//' | ${AWK} -v fn=$sym_name '$4 == "FUNC" && $8 == fn') } [[ $# -lt 2 ]] && usage
sound/soc/codecs/sgtl5000.c +1 -0
@@ -1769,6 +1769,7 @@ static int sgtl5000_i2c_remove(struct i2c_client *client) {struct sgtl5000_priv *sgtl5000 =i2c_get_clientdata (client); +regmap_write (sgtl5000->regmap,SGTL5000_CHIP_CLK_CTRL ,SGTL5000_CHIP_CLK_CTRL_DEFAULT );regmap_write (sgtl5000->regmap,SGTL5000_CHIP_DIG_POWER ,SGTL5000_DIG_POWER_DEFAULT );regmap_write (sgtl5000->regmap,SGTL5000_CHIP_ANA_POWER ,SGTL5000_ANA_POWER_DEFAULT );
sound/soc/soc-ops.c +1 -1
@@ -445,7 +445,7 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol, val = ucontrol->value.integer.value[0 ];if (mc->platform_max && val > mc->platform_max)return -EINVAL ; -if (val > max - min) +if (val > max)return -EINVAL ;if (val <0 )return -EINVAL ;
tools/vm/slabinfo-gnuplot.sh +2 -2
@@ -157,7 +157,7 @@ do_preprocess() let lines=3 out=`basename "$in"`"-slabs-by-loss" `cat "$in" | grep -A "$lines" 'Slabs sorted by loss' |\ - egrep -iv '\-\-|Name|Slabs'\ + grep -E -iv '\-\-|Name|Slabs'\ | awk '{print $1" "$4+$2*$3" "$4}' > "$out"` if [ $? -eq 0 ]; then do_slabs_plotting "$out"
@@ -166,7 +166,7 @@ do_preprocess() let lines=3 out=`basename "$in"`"-slabs-by-size" `cat "$in" | grep -A "$lines" 'Slabs sorted by size' |\ - egrep -iv '\-\-|Name|Slabs'\ + grep -E -iv '\-\-|Name|Slabs'\ | awk '{print $1" "$4" "$4-$2*$3}' > "$out"` if [ $? -eq 0 ]; then do_slabs_plotting "$out"