Linux 5.0.9
Greg KH
maintainerI'm announcing the release of the 5.0.9 kernel.
All users of the 5.0 kernel series must upgrade.
The updated 5.0.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.0.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/arc/configs/hsdk_defconfig | 1 arch/arc/kernel/head.S | 1 arch/arc/kernel/setup.c | 8 + arch/arm/kernel/patch.c | 6 arch/mips/bcm47xx/workarounds.c | 1 arch/x86/hyperv/hv_init.c | 6 arch/x86/kernel/aperture_64.c | 20 +- arch/x86/kernel/cpu/cyrix.c | 14 +- arch/x86/kernel/hpet.c | 2 arch/x86/kernel/hw_breakpoint.c | 1 arch/x86/kernel/mpparse.c | 4 block/blk-iolatency.c | 1 drivers/acpi/ec.c | 53 +++++++ drivers/acpi/utils.c | 1 drivers/auxdisplay/hd44780.c | 2 drivers/base/power/domain.c | 13 - drivers/block/paride/pcd.c | 20 ++ drivers/block/paride/pf.c | 26 +++ drivers/crypto/axis/artpec6_crypto.c | 28 +++- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c | 52 ------- drivers/gpu/drm/exynos/exynos_mixer.c | 110 +++++++++------- drivers/gpu/drm/nouveau/include/nvkm/subdev/volt.h | 1 drivers/gpu/drm/nouveau/nouveau_debugfs.c | 2 drivers/gpu/drm/nouveau/nvkm/engine/device/base.c | 2 drivers/gpu/drm/nouveau/nvkm/subdev/volt/Kbuild | 1 drivers/gpu/drm/nouveau/nvkm/subdev/volt/gf117.c | 60 ++++++++ drivers/gpu/drm/panel/panel-innolux-p079zca.c | 11 - drivers/gpu/drm/udl/udl_gem.c | 2 drivers/hwtracing/coresight/coresight-cpu-debug.c | 4 drivers/infiniband/hw/hfi1/qp.c | 2 drivers/infiniband/hw/hns/hns_roce_device.h | 21 +++ drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 103 +++++++++++++- drivers/infiniband/hw/hns/hns_roce_hw_v2.h | 1 drivers/infiniband/hw/i40iw/i40iw_utils.c | 12 + drivers/infiniband/hw/mlx4/alias_GUID.c | 2 drivers/iommu/intel-iommu.c | 5 drivers/irqchip/irq-mbigen.c | 3 drivers/irqchip/irq-stm32-exti.c | 10 - drivers/misc/lkdtm/core.c | 2 drivers/misc/lkdtm/lkdtm.h | 2 drivers/misc/lkdtm/perms.c | 36 +++-- drivers/mmc/host/davinci_mmc.c | 2 drivers/net/ethernet/hisilicon/hns3/hnae3.h | 2 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 28 ++++ drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 20 -- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c | 8 - drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.h | 4 drivers/pci/pci.c | 75 ++++++++++ drivers/platform/x86/intel_pmc_core.c | 34 ++++ drivers/platform/x86/intel_pmc_core.h | 5 drivers/scsi/qla2xxx/qla_os.c | 2 drivers/scsi/scsi_lib.c | 9 + drivers/scsi/scsi_transport_iscsi.c | 2 drivers/thermal/broadcom/bcm2835_thermal.c | 9 - drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 21 ++- drivers/thermal/intel/intel_powerclamp.c | 4 drivers/thermal/samsung/exynos_tmu.c | 2 fs/cifs/cifsfs.c | 2 fs/cifs/smb2maperror.c | 3 fs/cifs/smb2ops.c | 10 + fs/cifs/trace.h | 6 fs/ext4/ioctl.c | 7 + fs/ext4/resize.c | 17 ++ fs/ext4/super.c | 16 +- fs/f2fs/checkpoint.c | 9 - fs/f2fs/data.c | 21 +-- fs/f2fs/dir.c | 2 fs/f2fs/f2fs.h | 21 +++ fs/f2fs/file.c | 5 fs/f2fs/node.c | 6 fs/f2fs/segment.c | 9 - fs/f2fs/super.c | 44 ++++-- fs/f2fs/xattr.c | 10 - fs/notify/inotify/inotify_user.c | 7 - fs/proc/kcore.c | 27 +++ include/linux/atalk.h | 2 include/linux/kcore.h | 2 include/linux/swap.h | 4 include/trace/events/rxrpc.h | 2 kernel/bpf/inode.c | 32 ++-- kernel/events/core.c | 2 kernel/sched/core.c | 2 kernel/sched/cpufreq_schedutil.c | 59 +++----- lib/div64.c | 4 net/appletalk/atalk_proc.c | 2 net/appletalk/ddp.c | 37 ++++- net/appletalk/sysctl_net_atalk.c | 5 net/rxrpc/conn_client.c | 20 ++ sound/drivers/opl3/opl3_voice.h | 2 sound/isa/sb/sb8.c | 4 sound/pci/echoaudio/echoaudio.c | 5 tools/lib/bpf/libbpf.c | 2 tools/perf/Documentation/perf-config.txt | 2 tools/perf/Documentation/perf-stat.txt | 5 tools/perf/bench/epoll-ctl.c | 2 tools/perf/bench/epoll-wait.c | 2 tools/perf/builtin-stat.c | 3 tools/perf/builtin-top.c | 5 tools/perf/tests/backward-ring-buffer.c | 2 tools/perf/tests/evsel-tp-sched.c | 1 tools/perf/tests/expr.c | 5 tools/perf/tests/openat-syscall-all-cpus.c | 4 tools/perf/util/build-id.c | 1 tools/perf/util/config.c | 3 tools/perf/util/evsel.c | 4 tools/perf/util/hist.c | 4 tools/perf/util/map.c | 18 ++ tools/perf/util/ordered-events.c | 2 tools/perf/util/parse-events.c | 2 tools/perf/util/stat.c | 12 - tools/power/x86/turbostat/turbostat.c | 3 113 files changed, 998 insertions(+), 373 deletions(-)
Aditya Pakki (1):
x86/hpet: Prevent potential NULL pointer dereference
Andi Kleen (1):
perf stat: Fix --no-scale
Andrzej Hajda (1):
drm/exynos/mixer: fix MIXER shadow registry synchronisation code
Andy Shevchenko (2):
auxdisplay: hd44780: Fix memory leak on ->remove() ACPI / utils: Drop reference in test for device presence
Arnaldo Carvalho de Melo (1):
perf evsel: Free evsel->counts in perf_evsel__exit()
Arnd Bergmann (1):
mmc: davinci: remove extraneous __init annotation
Bart Van Assche (2):
scsi: core: Also call destroy_rcu_head() for passthrough requests
blk-iolatency: #include "blk.h"
Bjorn Helgaas (1):
PCI/ASPM: Save LTR Capability for suspend/resume
Changbin Du (13):
perf list: Don't forget to drop the reference to the allocated thread_map perf tools: Fix errors under optimization level '-Og'
perf config: Fix an error in the config template documentation
perf config: Fix a memory leak in collect_config()
perf build-id: Fix memory leak in print_sdt_events()
perf top: Fix error handling in cmd_top()
perf hist: Add missing map__put() in error case
perf map: Remove map from 'names' tree in __maps__remove()
perf maps: Purge all maps from the 'names' tree
perf top: Fix global-buffer-overflow issue
perf tests: Fix a memory leak of cpu_map object in the openat_syscall_event_on_all_cpus test perf tests: Fix memory leak by expr__find_other() in test__expr()
perf tests: Fix a memory leak in test__perf_evsel__tp_sched_test()
Chao Yu (3):
f2fs: fix to dirty inode for i_mode recovery
f2fs: fix to use kvfree instead of kzfree
f2fs: fix to add refcount once page is tagged PG_private
Christophe Leroy (2):
lkdtm: Print real addresses
lkdtm: Add tests for NULL pointer dereference
Colin Ian King (1):
ALSA: opl3: fix mismatch between snd_opl3_drum_switch definition and declaration
Corentin Labbe (1):
arc: hsdk_defconfig: Enable CONFIG_BLK_DEV_RAM
Daniel Borkmann (1):
bpf: fix use after free in bpf_evict_inode
Darrick J. Wong (1):
ext4: prohibit fstrim in norecovery mode
Dave Airlie (1):
drm/udl: use drm_gem_object_put_unlocked.
David Arcari (1):
tools/power turbostat: return the exit status of a command
David Howells (1):
rxrpc: Fix client call connect/disconnect race
Eugeniy Paltsev (1):
ARC: u-boot args: check that magic number is correct
Fabien Dessenne (2):
irqchip/stm32: Don't clear rising/falling config registers at init irqchip/stm32: Don't set rising configuration registers at init
Feng Tang (1):
i40iw: Avoid panic when handling the inetdev event
Greg Kroah-Hartman (1):
Linux 5.0.9
Himanshu Madhani (1):
scsi: qla2xxx: Fix NULL pointer crash due to stale CPUID
Hsin-Yi, Wang (1):
drm/panel: panel-innolux: set display off in innolux_panel_unprepare
Huazhong Tan (1):
net: hns3: Fix NULL deref when unloading driver
Ilia Mirkin (1):
drm/nouveau/volt/gf117: fix speedo readout register
Jack Morgenstein (1):
IB/mlx4: Fix race condition between catas error reset and aliasguid flows
Jaegeuk Kim (1):
f2fs: sync filesystem after roll-forward recovery
Jan Kara (1):
ext4: avoid panic during forced reboot
Jens Axboe (2):
paride/pf: cleanup queues when detection fails paride/pcd: cleanup queues when detection fails
Jiada Wang (1):
PM / Domains: Avoid a potential deadlock
Jianguo Chen (1):
irqchip/mbigen: Don't clear eventid when freeing an MSI
Kaike Wan (1):
IB/hfi1: Failed to drain send queue when QP is put into error state
Kairui Song (1):
x86/gart: Exclude GART aperture from kcore
Kangjie Lu (3):
ALSA: echoaudio: add a check for ioremap_nocache
ALSA: sb8: add a check for request_region x86/hyperv: Prevent potential NULL pointer dereference
Kevin Wang (1):
drm/amdkfd: use init_mqd function to allocate object for hid_mqd (CI)
Konstantin Khlebnikov (1):
sched/core: Fix buffer overflow in cgroup2 property cpu.max
Lars Persson (1):
crypto: axis - fix for recursive locking from bottom half
Leo Yan (1):
coresight: cpu-debug: Support for CA73 CPUs
Lu Baolu (2):
iommu/vt-d: Check capability before disabling protected memory iommu/vt-d: Save the right domain ID used by hardware
Luc Van Oostenryck (1):
thermal/intel_powerclamp: fix __percpu declaration of worker_data
Lukas Czerner (2):
ext4: add missing brelse() in add_new_gdb_meta_bg()
ext4: report real fs size after failed resize
Marek Szyprowski (1):
thermal: samsung: Fix incorrect check after code merge
Matteo Croce (1):
x86/mm: Don't leak kernel addresses
Matthew Garrett (2):
thermal/int340x_thermal: Add additional UUIDs
thermal/int340x_thermal: fix mode settingMatthew Whitehead (1):
x86/cpu/cyrix: Use correct macros for Cyrix calls on Geode processors
Maurizio Lombardi (1):
scsi: iscsi: flush running unbind operations when removing a session
Mika Westerberg (1):
PCI: Blacklist power management of Gigabyte X299 DESIGNARE EX PCIe ports
Nathan Chancellor (1):
x86/hw_breakpoints: Make default case in hw_breakpoint_arch_parse() return an error
Paulo Alcantara (SUSE) (1):
cifs: Fix slab-out-of-bounds when tracing SMB tcon
Peter Zijlstra (1):
sched/cpufreq: Fix 32-bit math overflow
Petr Štetiar (1):
mips: bcm47xx: Enable USB power on Netgear WNDR3400v2
Phil Elwell (1):
thermal: bcm2835: Fix crash in bcm2835_thermal_debugfs
Pi-Hsun Shih (1):
include/linux/swap.h: use offsetof() instead of custom __swapoffset macro
Rajneesh Bhardwaj (1):
platform/x86: intel_pmc_core: Quirk to ignore XTAL shutdown
Ronnie Sahlberg (1):
cifs: return -ENODATA when deleting an xattr that does not exist
Stanislaw Gruszka (1):
lib/div64.c: off by one in shift
Stephane Eranian (1):
perf/core: Restore mmap record type correctly
Steve French (1):
fix incorrect error code mapping for OBJECTID_NOT_FOUND
Wei Hu (Xavier) (1):
RDMA/hns: Fix the Oops during rmmod or insmod ko when reset occurs
Xiaoli Feng (1):
cifs: fix that return -EINVAL when do dedupe operation
Yang Shi (1):
ARM: 8839/1: kprobe: make patch_lock a raw_spinlock_t
YueHaibing (4):
drm/nouveau/debugfs: Fix check of pm_runtime_get_sync failure
appletalk: Fix use-after-free in atalk_proc_exit paride/pf: Fix potential NULL pointer dereference paride/pcd: Fix potential NULL pointer dereference and mem leak
Zhang Rui (2):
thermal/intel_powerclamp: fix truncated kthread name Revert "ACPI / EC: Remove old CLEAR_ON_RESUME quirk"
ZhangXiaoxu (1):
inotify: Fix fsnotify_mark refcount leak in inotify_update_existing_watch()
wentalou (1):
drm/amdgpu: psp_ring_destroy cause psp->km_ring.ring_mem NULL
Greg KH
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 5 PATCHLEVEL = 0 -SUBLEVEL = 8 +SUBLEVEL = 9 EXTRAVERSION = NAME = Shy Crocodile
arch/arc/configs/hsdk_defconfig +1 -0
@@ -8,6 +8,7 @@ CONFIG_NAMESPACES=y # CONFIG_UTS_NS is not set # CONFIG_PID_NS is not set CONFIG_BLK_DEV_INITRD=y +CONFIG_BLK_DEV_RAM=y CONFIG_EMBEDDED=y CONFIG_PERF_EVENTS=y # CONFIG_VM_EVENT_COUNTERS is not set
arch/arc/kernel/head.S +1 -0
@@ -106,6 +106,7 @@ ENTRY(stext) ; r2 = pointer to uboot provided cmdline or external DTB in mem ; These are handled later in handle_uboot_args() st r0, [@uboot_tag] + st r1, [@uboot_magic] st r2, [@uboot_arg] ; setup "current" tsk and optionally cache it in dedicated r25
arch/arc/kernel/setup.c +8 -0
@@ -36,6 +36,7 @@ unsigned int intr_to_DE_cnt;/* Part of U-boot ABI: see head.S */ int __initdata uboot_tag; +int __initdata uboot_magic;char __initdata *uboot_arg;const struct machine_desc *machine_desc;
@@ -497,6 +498,8 @@ static inline bool uboot_arg_invalid(unsigned long addr)#define UBOOT_TAG_NONE 0#define UBOOT_TAG_CMDLINE 1#define UBOOT_TAG_DTB 2 +/* We always pass 0 as magic from U-boot */ +#define UBOOT_MAGIC_VALUE 0void __init handle_uboot_args (void ) {
@@ -511,6 +514,11 @@ void __init handle_uboot_args(void) goto ignore_uboot_args; } +if (uboot_magic !=UBOOT_MAGIC_VALUE ) { +pr_warn (IGNORE_ARGS "non zero uboot magic\n" ); + goto ignore_uboot_args; + } +if (uboot_tag !=UBOOT_TAG_NONE &&uboot_arg_invalid ((unsigned long )uboot_arg)) {pr_warn (IGNORE_ARGS "invalid uboot arg: '%px'\n" , uboot_arg);
arch/arm/kernel/patch.c +3 -3
@@ -16,7 +16,7 @@ struct patch {unsigned int insn; }; -static DEFINE_SPINLOCK (patch_lock); +static DEFINE_RAW_SPINLOCK (patch_lock);static void __kprobes *patch_map (void *addr,int fixmap,unsigned long *flags) __acquires(&patch_lock)
@@ -33,7 +33,7 @@ static void __kprobes *patch_map(void *addr, int fixmap, unsigned long *flags)return addr;if (flags) -spin_lock_irqsave (&patch_lock, *flags); +raw_spin_lock_irqsave (&patch_lock, *flags);else __acquire (&patch_lock);
@@ -48,7 +48,7 @@ static void __kprobes patch_unmap(int fixmap, unsigned long *flags)clear_fixmap (fixmap);if (flags) -spin_unlock_irqrestore (&patch_lock, *flags); +raw_spin_unlock_irqrestore (&patch_lock, *flags);else __release (&patch_lock); }
arch/mips/bcm47xx/workarounds.c +1 -0
@@ -24,6 +24,7 @@ void __init bcm47xx_workarounds(void)case BCM47XX_BOARD_NETGEAR_WNR3500L :bcm47xx_workarounds_enable_usb_power (12 );break ; +case BCM47XX_BOARD_NETGEAR_WNDR3400V2 :case BCM47XX_BOARD_NETGEAR_WNDR3400_V3 :bcm47xx_workarounds_enable_usb_power (21 );break ;
arch/x86/hyperv/hv_init.c +5 -1
@@ -102,9 +102,13 @@ static int hv_cpu_init(unsigned int cpu)u64 msr_vp_index;struct hv_vp_assist_page **hvp = &hv_vp_assist_page[smp_processor_id ()];void **input_arg; +struct page *pg; input_arg = (void **)this_cpu_ptr (hyperv_pcpu_input_arg); - *input_arg =page_address (alloc_page (GFP_KERNEL )); + pg =alloc_page (GFP_KERNEL ); +if (unlikely (!pg)) +return -ENOMEM ; + *input_arg =page_address (pg);hv_get_vp_index (msr_vp_index);
arch/x86/kernel/aperture_64.c +13 -7
@@ -14,6 +14,7 @@#define pr_fmt (fmt) "AGP: " fmt#include <linux/kernel.h> +#include <linux/kcore.h> #include <linux/types.h> #include <linux/init.h> #include <linux/memblock.h>
@@ -57,7 +58,7 @@ int fallback_aper_force __initdata;int fix_aperture__initdata =1 ; -#ifdef CONFIG_PROC_VMCORE +#if defined(CONFIG_PROC_VMCORE ) || defined(CONFIG_PROC_KCORE )/* * If the first kernel maps the aperture over e820 RAM, the kdump kernel will * use the same range because it will remain configured in the northbridge.
@@ -66,20 +67,25 @@ int fix_aperture __initdata = 1;*/ static unsigned long aperture_pfn_start, aperture_page_count; -static int gart_oldmem_pfn_is_ram (unsigned long pfn) +static int gart_mem_pfn_is_ram (unsigned long pfn) {return likely ((pfn < aperture_pfn_start) || (pfn >= aperture_pfn_start + aperture_page_count)); } -static void exclude_from_vmcore (u64 aper_base,u32 aper_order) +static void __init exclude_from_core (u64 aper_base,u32 aper_order) { aperture_pfn_start = aper_base >>PAGE_SHIFT ; aperture_page_count = (32 *1024 *1024 ) << aper_order >>PAGE_SHIFT ; -WARN_ON (register_oldmem_pfn_is_ram (&gart_oldmem_pfn_is_ram)); +#ifdef CONFIG_PROC_VMCORE +WARN_ON (register_oldmem_pfn_is_ram (&gart_mem_pfn_is_ram)); +#endif +#ifdef CONFIG_PROC_KCORE +WARN_ON (register_mem_pfn_is_ram (&gart_mem_pfn_is_ram)); +#endif }#else -static void exclude_from_vmcore (u64 aper_base,u32 aper_order) +static void exclude_from_core (u64 aper_base,u32 aper_order) { }#endif
@@ -474,7 +480,7 @@ int __init gart_iommu_hole_init(void)* may have allocated the range over its e820 RAM * and fixed up the northbridge */ -exclude_from_vmcore (last_aper_base, last_aper_order); +exclude_from_core (last_aper_base, last_aper_order);return 1 ; }
@@ -520,7 +526,7 @@ int __init gart_iommu_hole_init(void)* overlap with the first kernel's memory. We can't access the * range through vmcore even though it should be part of the dump. */ -exclude_from_vmcore (aper_alloc, aper_order); +exclude_from_core (aper_alloc, aper_order);/* Fix up the north bridges */ for (i =0 ; i < amd_nb_bus_dev_ranges[i].dev_limit; i++) {
arch/x86/kernel/cpu/cyrix.c +7 -7
@@ -124,7 +124,7 @@ static void set_cx86_reorder(void)setCx86 (CX86_CCR3 , (ccr3 &0x0f ) |0x10 );/* enable MAPEN */ /* Load/Store Serialize to mem access disable (=reorder it) */ -setCx86_old (CX86_PCR0 ,getCx86_old (CX86_PCR0 ) & ~0x80 ); +setCx86 (CX86_PCR0 ,getCx86 (CX86_PCR0 ) & ~0x80 );/* set load/store serialize from 1GB to 4GB */ ccr3 |=0xe0 ;setCx86 (CX86_CCR3 , ccr3);
@@ -135,11 +135,11 @@ static void set_cx86_memwb(void)pr_info ("Enable Memory-Write-back mode on Cyrix/NSC processor.\n" );/* CCR2 bit 2: unlock NW bit */ -setCx86_old (CX86_CCR2 ,getCx86_old (CX86_CCR2 ) & ~0x04 ); +setCx86 (CX86_CCR2 ,getCx86 (CX86_CCR2 ) & ~0x04 );/* set 'Not Write-through' */ write_cr0 (read_cr0 () |X86_CR0_NW );/* CCR2 bit 2: lock NW bit and set WT1 */ -setCx86_old (CX86_CCR2 ,getCx86_old (CX86_CCR2 ) |0x14 ); +setCx86 (CX86_CCR2 ,getCx86 (CX86_CCR2 ) |0x14 ); }/*
@@ -153,14 +153,14 @@ static void geode_configure(void)local_irq_save (flags);/* Suspend on halt power saving and enable #SUSP pin */ -setCx86_old (CX86_CCR2 ,getCx86_old (CX86_CCR2 ) |0x88 ); +setCx86 (CX86_CCR2 ,getCx86 (CX86_CCR2 ) |0x88 ); ccr3 =getCx86 (CX86_CCR3 );setCx86 (CX86_CCR3 , (ccr3 &0x0f ) |0x10 );/* enable MAPEN */ /* FPU fast, DTE cache, Mem bypass */ -setCx86_old (CX86_CCR4 ,getCx86_old (CX86_CCR4 ) |0x38 ); +setCx86 (CX86_CCR4 ,getCx86 (CX86_CCR4 ) |0x38 );setCx86 (CX86_CCR3 , ccr3);/* disable MAPEN */ set_cx86_memwb ();
@@ -296,7 +296,7 @@ static void init_cyrix(struct cpuinfo_x86 *c)/* GXm supports extended cpuid levels 'ala' AMD */ if (c->cpuid_level ==2 ) {/* Enable cxMMX extensions (GX1 Datasheet 54) */ -setCx86_old (CX86_CCR7 ,getCx86_old (CX86_CCR7 ) |1 ); +setCx86 (CX86_CCR7 ,getCx86 (CX86_CCR7 ) |1 );/* * GXm : 0x30 ... 0x5f GXm datasheet 51
@@ -319,7 +319,7 @@ static void init_cyrix(struct cpuinfo_x86 *c)if (dir1 >7 ) { dir0_msn++;/* M II */ /* Enable MMX extensions (App note 108) */ -setCx86_old (CX86_CCR7 ,getCx86_old (CX86_CCR7 )|1 ); +setCx86 (CX86_CCR7 ,getCx86 (CX86_CCR7 )|1 ); }else {/* A 6x86MX - it has the bug. */ set_cpu_bug (c,X86_BUG_COMA );
arch/x86/kernel/hpet.c +2 -0
@@ -905,6 +905,8 @@ int __init hpet_enable(void)return 0 ;hpet_set_mapping (); +if (!hpet_virt_address) +return 0 ;/* * Read the period and check for a sane value:
arch/x86/kernel/hw_breakpoint.c +1 -0
@@ -357,6 +357,7 @@ int hw_breakpoint_arch_parse(struct perf_event *bp,#endif default :WARN_ON_ONCE (1 ); +return -EINVAL ; }/*
arch/x86/kernel/mpparse.c +2 -2
@@ -598,8 +598,8 @@ static int __init smp_scan_config(unsigned long base, unsigned long length) mpf_base = base; mpf_found = true; -pr_info ("found SMP MP-table at [mem %#010lx-%#010lx] mapped at [%p]\n" , - base, base +sizeof (*mpf) -1 , mpf); +pr_info ("found SMP MP-table at [mem %#010lx-%#010lx]\n" , + base, base +sizeof (*mpf) -1 );memblock_reserve (base,sizeof (*mpf));if (mpf->physptr)
block/blk-iolatency.c +1 -0
@@ -75,6 +75,7 @@#include <linux/blk-mq.h> #include "blk-rq-qos.h" #include "blk-stat.h" +#include "blk.h" #define DEFAULT_SCALE_COOKIE 1000000U
drivers/acpi/ec.c +53 -0
83 lines not on this page · raw message
drivers/acpi/utils.c +1 -0
@@ -800,6 +800,7 @@ bool acpi_dev_present(const char *hid, const char *uid, s64 hrv) match.hrv = hrv; dev =bus_find_device (&acpi_bus_type,NULL , &match, acpi_dev_match_cb); +put_device (dev);return !!dev; }EXPORT_SYMBOL (acpi_dev_present);
drivers/auxdisplay/hd44780.c +2 -0
@@ -280,6 +280,8 @@ static int hd44780_remove(struct platform_device *pdev)struct charlcd *lcd =platform_get_drvdata (pdev);charlcd_unregister (lcd); + +kfree (lcd);return 0 ; }
drivers/base/power/domain.c +6 -7
@@ -1467,12 +1467,12 @@ static int genpd_add_device(struct generic_pm_domain *genpd, struct device *dev,if (IS_ERR (gpd_data))return PTR_ERR (gpd_data); -genpd_lock (genpd); - ret = genpd->attach_dev ? genpd->attach_dev (genpd, dev) :0 ;if (ret) goto out; +genpd_lock (genpd); +dev_pm_domain_set (dev, &genpd->domain); genpd->device_count++;
@@ -1480,9 +1480,8 @@ static int genpd_add_device(struct generic_pm_domain *genpd, struct device *dev,list_add_tail (&gpd_data->base.list_node, &genpd->dev_list); - out:genpd_unlock (genpd); - + out:if (ret)genpd_free_dev_data (dev, gpd_data);else
@@ -1531,15 +1530,15 @@ static int genpd_remove_device(struct generic_pm_domain *genpd, genpd->device_count--; genpd->max_off_time_changed = true; -if (genpd->detach_dev) - genpd->detach_dev (genpd, dev); -dev_pm_domain_set (dev,NULL );list_del_init (&pdd->list_node);genpd_unlock (genpd); +if (genpd->detach_dev) + genpd->detach_dev (genpd, dev); +genpd_free_dev_data (dev, gpd_data);return 0 ;
drivers/block/paride/pcd.c +18 -2
@@ -314,6 +314,7 @@ static void pcd_init_units(void) disk->queue =blk_mq_init_sq_queue (&cd->tag_set, &pcd_mq_ops,1 ,BLK_MQ_F_SHOULD_MERGE );if (IS_ERR (disk->queue)) { +put_disk (disk); disk->queue =NULL ;continue ; }
@@ -749,8 +750,14 @@ static int pcd_detect(void)return 0 ;printk ("%s: No CD-ROM drive found\n" , name); -for (unit =0 , cd = pcd; unit <PCD_UNITS ; unit++, cd++) +for (unit =0 , cd = pcd; unit <PCD_UNITS ; unit++, cd++) { +if (!cd->disk) +continue ; +blk_cleanup_queue (cd->disk->queue); + cd->disk->queue =NULL ; +blk_mq_free_tag_set (&cd->tag_set);put_disk (cd->disk); + }pi_unregister_driver (par_drv);return -1 ; }
@@ -1006,8 +1013,14 @@ static int __init pcd_init(void)pcd_probe_capabilities ();if (register_blkdev (major, name)) { -for (unit =0 , cd = pcd; unit <PCD_UNITS ; unit++, cd++) +for (unit =0 , cd = pcd; unit <PCD_UNITS ; unit++, cd++) { +if (!cd->disk) +continue ; + +blk_cleanup_queue (cd->disk->queue); +blk_mq_free_tag_set (&cd->tag_set);put_disk (cd->disk); + }return -EBUSY ; }
@@ -1028,6 +1041,9 @@ static void __exit pcd_exit(void)int unit;for (unit =0 , cd = pcd; unit <PCD_UNITS ; unit++, cd++) { +if (!cd->disk) +continue ; +if (cd->present) {del_gendisk (cd->disk);pi_release (cd->pi);
drivers/block/paride/pf.c +21 -5
@@ -761,8 +761,14 @@ static int pf_detect(void)return 0 ;printk ("%s: No ATAPI disk detected\n" , name); -for (pf = units, unit =0 ; unit <PF_UNITS ; pf++, unit++) +for (pf = units, unit =0 ; unit <PF_UNITS ; pf++, unit++) { +if (!pf->disk) +continue ; +blk_cleanup_queue (pf->disk->queue); + pf->disk->queue =NULL ; +blk_mq_free_tag_set (&pf->tag_set);put_disk (pf->disk); + }pi_unregister_driver (par_drv);return -1 ; }
@@ -1025,8 +1031,13 @@ static int __init pf_init(void) pf_busy =0 ;if (register_blkdev (major, name)) { -for (pf = units, unit =0 ; unit <PF_UNITS ; pf++, unit++) +for (pf = units, unit =0 ; unit <PF_UNITS ; pf++, unit++) { +if (!pf->disk) +continue ; +blk_cleanup_queue (pf->disk->queue); +blk_mq_free_tag_set (&pf->tag_set);put_disk (pf->disk); + }return -EBUSY ; }
@@ -1047,13 +1058,18 @@ static void __exit pf_exit(void)int unit;unregister_blkdev (major, name);for (pf = units, unit =0 ; unit <PF_UNITS ; pf++, unit++) { -if (!pf->present) +if (!pf->disk)continue ; -del_gendisk (pf->disk); + +if (pf->present) +del_gendisk (pf->disk); +blk_cleanup_queue (pf->disk->queue);blk_mq_free_tag_set (&pf->tag_set);put_disk (pf->disk); -pi_release (pf->pi); + +if (pf->present) +pi_release (pf->pi); } }
drivers/crypto/axis/artpec6_crypto.c +23 -5
@@ -284,6 +284,7 @@ enum artpec6_crypto_hash_flags {struct artpec6_crypto_req_common {struct list_head list; +struct list_head complete_in_progress;struct artpec6_crypto_dma_descriptors *dma;struct crypto_async_request *req;void (*complete)(struct crypto_async_request *req);
@@ -2045,7 +2046,8 @@ static int artpec6_crypto_prepare_aead(struct aead_request *areq)return artpec6_crypto_dma_map_descs (common); } -static void artpec6_crypto_process_queue (struct artpec6_crypto *ac) +static void artpec6_crypto_process_queue (struct artpec6_crypto *ac, +struct list_head *completions) {struct artpec6_crypto_req_common *req;
@@ -2056,7 +2058,7 @@ static void artpec6_crypto_process_queue(struct artpec6_crypto *ac)list_move_tail (&req->list, &ac->pending);artpec6_crypto_start_dma (req); - req->req->complete (req->req, -EINPROGRESS ); +list_add_tail (&req->complete_in_progress, completions); }/*
@@ -2086,6 +2088,11 @@ static void artpec6_crypto_task(unsigned long data)struct artpec6_crypto *ac = (struct artpec6_crypto *)data;struct artpec6_crypto_req_common *req;struct artpec6_crypto_req_common *n; +struct list_head complete_done; +struct list_head complete_in_progress; + +INIT_LIST_HEAD (&complete_done); +INIT_LIST_HEAD (&complete_in_progress);if (list_empty (&ac->pending)) {pr_debug ("Spurious IRQ\n" );
@@ -2119,19 +2126,30 @@ static void artpec6_crypto_task(unsigned long data)pr_debug ("Completing request %p\n" , req); -list_del (&req->list); +list_move_tail (&req->list, &complete_done);artpec6_crypto_dma_unmap_all (req);artpec6_crypto_copy_bounce_buffers (req); ac->pending_count--;artpec6_crypto_common_destroy (req); - req->complete (req->req); } -artpec6_crypto_process_queue (ac); +artpec6_crypto_process_queue (ac, &complete_in_progress);spin_unlock_bh (&ac->queue_lock); + +/* Perform the completion callbacks without holding the queue lock +* to allow new request submissions from the callbacks. +*/ +list_for_each_entry_safe (req, n, &complete_done, list) { + req->complete (req->req); + } + +list_for_each_entry_safe (req, n, &complete_in_progress, + complete_in_progress) { + req->req->complete (req->req, -EINPROGRESS ); + } }static void artpec6_crypto_complete_crypto (struct crypto_async_request *req)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1 -1
@@ -546,7 +546,7 @@ static int psp_load_fw(struct amdgpu_device *adev)struct psp_context *psp = &adev->psp;if (amdgpu_sriov_vf (adev) && adev->in_gpu_reset) { -psp_ring_destroy (psp,PSP_RING_TYPE__KM ); +psp_ring_stop (psp,PSP_RING_TYPE__KM );/* should not destroy ring, only stop */ goto skip_memalloc; }
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c +1 -51
58 lines not on this page · raw message
drivers/gpu/drm/exynos/exynos_mixer.c +66 -44
182 lines not on this page · raw message
drivers/gpu/drm/nouveau/include/nvkm/subdev/volt.h +1 -0
@@ -38,6 +38,7 @@ int nvkm_volt_set_id(struct nvkm_volt *, u8 id, u8 min_id, u8 temp,int nv40_volt_new (struct nvkm_device *,int ,struct nvkm_volt **);int gf100_volt_new (struct nvkm_device *,int ,struct nvkm_volt **); +int gf117_volt_new (struct nvkm_device *,int ,struct nvkm_volt **);int gk104_volt_new (struct nvkm_device *,int ,struct nvkm_volt **);int gk20a_volt_new (struct nvkm_device *,int ,struct nvkm_volt **);int gm20b_volt_new (struct nvkm_device *,int ,struct nvkm_volt **);
drivers/gpu/drm/nouveau/nouveau_debugfs.c +1 -1
@@ -181,7 +181,7 @@ nouveau_debugfs_pstate_set(struct file *file, const char __user *ubuf, } ret =pm_runtime_get_sync (drm->dev); -if (IS_ERR_VALUE (ret) && ret != -EACCES ) +if (ret <0 && ret != -EACCES )return ret; ret =nvif_mthd (ctrl,NVIF_CONTROL_PSTATE_USER , &args,sizeof (args));pm_runtime_put_autosuspend (drm->dev);
drivers/gpu/drm/nouveau/nvkm/engine/device/base.c +1 -1
@@ -1613,7 +1613,7 @@ nvd7_chipset = { .pci = gf106_pci_new, .therm = gf119_therm_new, .timer = nv41_timer_new, - .volt = gf100_volt_new, + .volt = gf117_volt_new, .ce[0] = gf100_ce_new, .disp = gf119_disp_new, .dma = gf119_dma_new,
drivers/gpu/drm/nouveau/nvkm/subdev/volt/Kbuild +1 -0
@@ -2,6 +2,7 @@ nvkm-y += nvkm/subdev/volt/base.o nvkm-y += nvkm/subdev/volt/gpio.o nvkm-y += nvkm/subdev/volt/nv40.o nvkm-y += nvkm/subdev/volt/gf100.o +nvkm-y += nvkm/subdev/volt/gf117.o nvkm-y += nvkm/subdev/volt/gk104.o nvkm-y += nvkm/subdev/volt/gk20a.o nvkm-y += nvkm/subdev/volt/gm20b.o
drivers/gpu/drm/nouveau/nvkm/subdev/volt/gf117.c new file +60 -0
60 lines not on this page · raw message
drivers/gpu/drm/panel/panel-innolux-p079zca.c +5 -6
@@ -70,18 +70,12 @@ static inline struct innolux_panel *to_innolux_panel(struct drm_panel *panel)static int innolux_panel_disable (struct drm_panel *panel) {struct innolux_panel *innolux =to_innolux_panel (panel); -int err;if (!innolux->enabled)return 0 ;backlight_disable (innolux->backlight); - err =mipi_dsi_dcs_set_display_off (innolux->link); -if (err <0 ) -DRM_DEV_ERROR (panel->dev,"failed to set display off: %d\n" , - err); - innolux->enabled = false;return 0 ;
@@ -95,6 +89,11 @@ static int innolux_panel_unprepare(struct drm_panel *panel)if (!innolux->prepared)return 0 ; + err =mipi_dsi_dcs_set_display_off (innolux->link); +if (err <0 ) +DRM_DEV_ERROR (panel->dev,"failed to set display off: %d\n" , + err); + err =mipi_dsi_dcs_enter_sleep_mode (innolux->link);if (err <0 ) { DRM_DEV_ERROR(panel->dev, "failed to enter sleep mode: %d\n",
drivers/gpu/drm/udl/udl_gem.c +1 -1
@@ -224,7 +224,7 @@ int udl_gem_mmap(struct drm_file *file, struct drm_device *dev, *offset =drm_vma_node_offset_addr (&gobj->base.vma_node); out: -drm_gem_object_put (&gobj->base); +drm_gem_object_put_unlocked (&gobj->base); unlock:mutex_unlock (&udl->gem_lock);return ret;
drivers/hwtracing/coresight/coresight-cpu-debug.c +4 -0
@@ -668,6 +668,10 @@ static const struct amba_id debug_ids[] = { .id = 0x000bbd08, .mask = 0x000fffff, }, + { /* Debug for Cortex-A73 */ + .id = 0x000bbd09, + .mask = 0x000fffff, + }, { 0, 0 }, };
drivers/infiniband/hw/hfi1/qp.c +1 -1
@@ -833,7 +833,7 @@ void notify_error_qp(struct rvt_qp *qp)write_seqlock (lock);if (!list_empty (&priv->s_iowait.list) && !(qp->s_flags &RVT_S_BUSY )) { - qp->s_flags &= ~RVT_S_ANY_WAIT_IO ; + qp->s_flags &= ~HFI1_S_ANY_WAIT_IO ;list_del_init (&priv->s_iowait.list); priv->s_iowait.lock =NULL ;rvt_put_qp (qp);
drivers/infiniband/hw/hns/hns_roce_device.h +21 -0
@@ -216,6 +216,26 @@ enum { HNS_ROCE_DB_PER_PAGE = PAGE_SIZE / 4 }; +enum hns_roce_reset_stage { +HNS_ROCE_STATE_NON_RST , +HNS_ROCE_STATE_RST_BEF_DOWN , +HNS_ROCE_STATE_RST_DOWN , +HNS_ROCE_STATE_RST_UNINIT , +HNS_ROCE_STATE_RST_INIT , +HNS_ROCE_STATE_RST_INITED , +}; + +enum hns_roce_instance_state { +HNS_ROCE_STATE_NON_INIT , +HNS_ROCE_STATE_INIT , +HNS_ROCE_STATE_INITED , +HNS_ROCE_STATE_UNINIT , +}; + +enum { +HNS_ROCE_RST_DIRECT_RETURN =0 , +}; +#define HNS_ROCE_CMD_SUCCESS 1#define HNS_ROCE_PORT_DOWN 0
@@ -898,6 +918,7 @@ struct hns_roce_dev {spinlock_t bt_cmd_lock;bool active;bool is_reset; +unsigned long reset_cnt;struct hns_roce_ib_iboe iboe;struct list_head pgdir_list;
drivers/infiniband/hw/hns/hns_roce_hw_v2.c +90 -13
175 lines not on this page · raw message
drivers/infiniband/hw/hns/hns_roce_hw_v2.h +1 -0
@@ -1546,6 +1546,7 @@ struct hns_roce_link_table_entry {#define HNS_ROCE_LINK_TABLE_NXT_PTR_M GENMASK(31, 20)struct hns_roce_v2_priv { +struct hnae3_handle *handle;struct hns_roce_v2_cmq cmq;struct hns_roce_link_table tsq;struct hns_roce_link_table tpq;
drivers/infiniband/hw/i40iw/i40iw_utils.c +11 -1
@@ -173,7 +173,12 @@ int i40iw_inetaddr_event(struct notifier_block *notifier,rcu_read_lock (); in =__in_dev_get_rcu (upper_dev); - local_ipaddr =ntohl (in->ifa_list->ifa_address); + +if (!in->ifa_list) + local_ipaddr =0 ; +else + local_ipaddr =ntohl (in->ifa_list->ifa_address); +rcu_read_unlock (); }else { local_ipaddr =ntohl (ifa->ifa_address);
@@ -185,6 +190,11 @@ int i40iw_inetaddr_event(struct notifier_block *notifier,case NETDEV_UP :/* Fall through */ case NETDEV_CHANGEADDR : + +/* Just skip if no need to handle ARP cache */ +if (!local_ipaddr) +break ; + i40iw_manage_arp_cache(iwdev, netdev->dev_addr, &local_ipaddr,
drivers/infiniband/hw/mlx4/alias_GUID.c +1 -1
@@ -804,8 +804,8 @@ void mlx4_ib_destroy_alias_guid_service(struct mlx4_ib_dev *dev)unsigned long flags;for (i =0 ; i < dev->num_ports; i++) { -cancel_delayed_work (&dev->sriov.alias_guid.ports_guid[i].alias_guid_work); det = &sriov->alias_guid.ports_guid[i]; +cancel_delayed_work_sync (&det->alias_guid_work);spin_lock_irqsave (&sriov->alias_guid.ag_work_lock, flags);while (!list_empty (&det->cb_list)) { cb_ctx = list_entry(det->cb_list.next,
drivers/iommu/intel-iommu.c +4 -1
@@ -1534,6 +1534,9 @@ static void iommu_disable_protect_mem_regions(struct intel_iommu *iommu)u32 pmen;unsigned long flags; +if (!cap_plmr (iommu->cap) && !cap_phmr (iommu->cap)) +return ; +raw_spin_lock_irqsave (&iommu->register_lock, flags); pmen =readl (iommu->reg +DMAR_PMEN_REG ); pmen &= ~DMA_PMEN_EPM ;
@@ -5328,7 +5331,7 @@ int intel_iommu_enable_pasid(struct intel_iommu *iommu, struct intel_svm_dev *sd ctx_lo = context[0 ].lo; - sdev->did = domain->iommu_did[iommu->seq_id]; + sdev->did =FLPT_DEFAULT_DID ; sdev->sid =PCI_DEVID (info->bus, info->devfn);if (!(ctx_lo &CONTEXT_PASIDE )) {
drivers/irqchip/irq-mbigen.c +3 -0
@@ -161,6 +161,9 @@ static void mbigen_write_msg(struct msi_desc *desc, struct msi_msg *msg)void __iomem *base = d->chip_data;u32 val; +if (!msg->address_lo && !msg->address_hi) +return ; + base +=get_mbigen_vec_reg (d->hwirq); val =readl_relaxed (base);
drivers/irqchip/irq-stm32-exti.c +0 -10
@@ -716,7 +716,6 @@ stm32_exti_chip_data *stm32_exti_chip_init(struct stm32_exti_host_data *h_data,const struct stm32_exti_bank *stm32_bank;struct stm32_exti_chip_data *chip_data;void __iomem *base = h_data->base; -u32 irqs_mask; stm32_bank = h_data->drv_data->exti_banks[bank_idx]; chip_data = &h_data->chips_data[bank_idx];
@@ -725,21 +724,12 @@ stm32_exti_chip_data *stm32_exti_chip_init(struct stm32_exti_host_data *h_data,raw_spin_lock_init (&chip_data->rlock); -/* Determine number of irqs supported */ -writel_relaxed (~0UL , base + stm32_bank->rtsr_ofst); - irqs_mask =readl_relaxed (base + stm32_bank->rtsr_ofst); -/* * This IP has no reset, so after hot reboot we should * clear registers to avoid residue */ writel_relaxed (0 , base + stm32_bank->imr_ofst);writel_relaxed (0 , base + stm32_bank->emr_ofst); -writel_relaxed (0 , base + stm32_bank->rtsr_ofst); -writel_relaxed (0 , base + stm32_bank->ftsr_ofst); -writel_relaxed (~0UL , base + stm32_bank->rpr_ofst); -if (stm32_bank->fpr_ofst !=UNDEF_REG ) -writel_relaxed (~0UL , base + stm32_bank->fpr_ofst);pr_info ("%pOF: bank%d\n" , h_data->node, bank_idx);
drivers/misc/lkdtm/core.c +2 -0
@@ -152,7 +152,9 @@ static const struct crashtype crashtypes[] = {CRASHTYPE (EXEC_VMALLOC ),CRASHTYPE (EXEC_RODATA ),CRASHTYPE (EXEC_USERSPACE ), +CRASHTYPE (EXEC_NULL ),CRASHTYPE (ACCESS_USERSPACE ), +CRASHTYPE (ACCESS_NULL ),CRASHTYPE (WRITE_RO ),CRASHTYPE (WRITE_RO_AFTER_INIT ), CRASHTYPE(WRITE_KERN),
drivers/misc/lkdtm/lkdtm.h +2 -0
@@ -45,7 +45,9 @@ void lkdtm_EXEC_KMALLOC(void);void lkdtm_EXEC_VMALLOC (void );void lkdtm_EXEC_RODATA (void );void lkdtm_EXEC_USERSPACE (void ); +void lkdtm_EXEC_NULL (void );void lkdtm_ACCESS_USERSPACE (void ); +void lkdtm_ACCESS_NULL (void );/* lkdtm_refcount.c */ void lkdtm_REFCOUNT_INC_OVERFLOW (void );
drivers/misc/lkdtm/perms.c +27 -9
@@ -47,7 +47,7 @@ static noinline void execute_location(void *dst, bool write) {void (*func)(void ) = dst; -pr_info ("attempting ok execution at %p\n" , do_nothing); +pr_info ("attempting ok execution at %px\n" , do_nothing);do_nothing ();if (write ==CODE_WRITE ) {
@@ -55,7 +55,7 @@ static noinline void execute_location(void *dst, bool write)flush_icache_range ((unsigned long )dst, (unsigned long )dst +EXEC_SIZE ); } -pr_info ("attempting bad execution at %p\n" , func); +pr_info ("attempting bad execution at %px\n" , func);func (); }
@@ -66,14 +66,14 @@ static void execute_user_location(void *dst)/* Intentionally crossing kernel/user memory boundary. */ void (*func)(void ) = dst; -pr_info ("attempting ok execution at %p\n" , do_nothing); +pr_info ("attempting ok execution at %px\n" , do_nothing);do_nothing (); copied =access_process_vm (current, (unsigned long )dst, do_nothing,EXEC_SIZE ,FOLL_WRITE );if (copied <EXEC_SIZE )return ; -pr_info ("attempting bad execution at %p\n" , func); +pr_info ("attempting bad execution at %px\n" , func);func (); }
@@ -82,7 +82,7 @@ void lkdtm_WRITE_RO(void)/* Explicitly cast away "const" for the test. */ unsigned long *ptr = (unsigned long *)&rodata; -pr_info ("attempting bad rodata write at %p\n" , ptr); +pr_info ("attempting bad rodata write at %px\n" , ptr); *ptr ^=0xabcd1234 ; }
@@ -100,7 +100,7 @@ void lkdtm_WRITE_RO_AFTER_INIT(void)return ; } -pr_info ("attempting bad ro_after_init write at %p\n" , ptr); +pr_info ("attempting bad ro_after_init write at %px\n" , ptr); *ptr ^=0xabcd1234 ; }
@@ -112,7 +112,7 @@ void lkdtm_WRITE_KERN(void) size = (unsigned long )do_overwritten - (unsigned long )do_nothing; ptr = (unsigned char *)do_overwritten; -pr_info ("attempting bad %zu byte write at %p\n" , size, ptr); +pr_info ("attempting bad %zu byte write at %px\n" , size, ptr);memcpy (ptr, (unsigned char *)do_nothing, size);flush_icache_range ((unsigned long )ptr, (unsigned long )(ptr + size));
@@ -164,6 +164,11 @@ void lkdtm_EXEC_USERSPACE(void)vm_munmap (user_addr,PAGE_SIZE ); } +void lkdtm_EXEC_NULL (void ) +{ +execute_location (NULL ,CODE_AS_IS ); +} +void lkdtm_ACCESS_USERSPACE (void ) {unsigned long user_addr, tmp =0 ;
@@ -185,16 +190,29 @@ void lkdtm_ACCESS_USERSPACE(void) ptr = (unsigned long *)user_addr; -pr_info ("attempting bad read at %p\n" , ptr); +pr_info ("attempting bad read at %px\n" , ptr); tmp = *ptr; tmp +=0xc0dec0de ; -pr_info ("attempting bad write at %p\n" , ptr); +pr_info ("attempting bad write at %px\n" , ptr); *ptr = tmp;vm_munmap (user_addr,PAGE_SIZE ); } +void lkdtm_ACCESS_NULL (void ) +{ +unsigned long tmp; +unsigned long *ptr = (unsigned long *)NULL ; + +pr_info ("attempting bad read at %px\n" , ptr); + tmp = *ptr; + tmp +=0xc0dec0de ; + +pr_info ("attempting bad write at %px\n" , ptr); + *ptr = tmp; +} +void __init lkdtm_perms_init (void ) {/* Make sure we can write to __ro_after_init values during __init */
drivers/mmc/host/davinci_mmc.c +1 -1
@@ -1117,7 +1117,7 @@ static inline void mmc_davinci_cpufreq_deregister(struct mmc_davinci_host *host) { }#endif -static void __init init_mmcsd_host (struct mmc_davinci_host *host) +static void init_mmcsd_host (struct mmc_davinci_host *host) {mmc_davinci_reset_ctrl (host,1 );
drivers/net/ethernet/hisilicon/hns3/hnae3.h +2 -0
@@ -463,6 +463,8 @@ struct hnae3_ae_ops {int (*set_gro_en)(struct hnae3_handle *handle,int enable);u16 (*get_global_queue_id)(struct hnae3_handle *handle,u16 queue_id);void (*set_timer_task)(struct hnae3_handle *handle,bool enable); +int (*mac_connect_phy)(struct hnae3_handle *handle); +void (*mac_disconnect_phy)(struct hnae3_handle *handle); };struct hnae3_dcb_ops {
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +28 -0
@@ -3519,6 +3519,25 @@ static int hns3_init_mac_addr(struct net_device *netdev, bool init)return ret; } +static int hns3_init_phy (struct net_device *netdev) +{ +struct hnae3_handle *h =hns3_get_handle (netdev); +int ret =0 ; + +if (h->ae_algo->ops->mac_connect_phy) + ret = h->ae_algo->ops->mac_connect_phy (h); + +return ret; +} + +static void hns3_uninit_phy (struct net_device *netdev) +{ +struct hnae3_handle *h =hns3_get_handle (netdev); + +if (h->ae_algo->ops->mac_disconnect_phy) + h->ae_algo->ops->mac_disconnect_phy (h); +} +static int hns3_restore_fd_rules (struct net_device *netdev) {struct hnae3_handle *h =hns3_get_handle (netdev);
@@ -3627,6 +3646,10 @@ static int hns3_client_init(struct hnae3_handle *handle) goto out_init_ring_data; } + ret =hns3_init_phy (netdev); +if (ret) + goto out_init_phy; + ret =register_netdev (netdev);if (ret) {dev_err (priv->dev,"probe register netdev fail!\n" );
@@ -3651,6 +3674,9 @@ static int hns3_client_init(struct hnae3_handle *handle)return ret; out_reg_netdev_fail: +hns3_uninit_phy (netdev); +out_init_phy: +hns3_uninit_all_ring (priv); out_init_ring_data: (void )hns3_nic_uninit_vector_data (priv); out_init_vector_data:
@@ -3685,6 +3711,8 @@ static void hns3_client_uninit(struct hnae3_handle *handle, bool reset)hns3_force_clear_all_rx_ring (handle); +hns3_uninit_phy (netdev); + ret =hns3_nic_uninit_vector_data (priv);if (ret)netdev_err (netdev,"uninit vector error\n" );
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +2 -18
@@ -6959,16 +6959,6 @@ static void hclge_get_mdix_mode(struct hnae3_handle *handle, *tp_mdix =ETH_TP_MDI ; } -static int hclge_init_instance_hw (struct hclge_dev *hdev) -{ -return hclge_mac_connect_phy (hdev); -} - -static void hclge_uninit_instance_hw (struct hclge_dev *hdev) -{ -hclge_mac_disconnect_phy (hdev); -} -static int hclge_init_client_instance (struct hnae3_client *client,struct hnae3_ae_dev *ae_dev) {
@@ -6988,13 +6978,6 @@ static int hclge_init_client_instance(struct hnae3_client *client,if (ret) goto clear_nic; - ret =hclge_init_instance_hw (hdev); -if (ret) { - client->ops->uninit_instance (&vport->nic, -0 ); - goto clear_nic; - } -hnae3_set_client_init_flag (client, ae_dev,1 ); if (hdev->roce_client &&
@@ -7079,7 +7062,6 @@ static void hclge_uninit_client_instance(struct hnae3_client *client,if (client->type ==HNAE3_CLIENT_ROCE )return ;if (hdev->nic_client && client->ops->uninit_instance) { -hclge_uninit_instance_hw (hdev); client->ops->uninit_instance (&vport->nic,0 ); hdev->nic_client =NULL ; vport->nic.client =NULL ;
@@ -8012,6 +7994,8 @@ static const struct hnae3_ae_ops hclge_ops = { .set_gro_en = hclge_gro_en, .get_global_queue_id = hclge_covert_handle_qid_global, .set_timer_task = hclge_set_timer_task, + .mac_connect_phy = hclge_mac_connect_phy, + .mac_disconnect_phy = hclge_mac_disconnect_phy, };static struct hnae3_ae_algo ae_algo = {
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c +6 -2
@@ -195,8 +195,10 @@ static void hclge_mac_adjust_link(struct net_device *netdev)netdev_err (netdev,"failed to configure flow control.\n" ); } -int hclge_mac_connect_phy (struct hclge_dev *hdev) +int hclge_mac_connect_phy (struct hnae3_handle *handle) { +struct hclge_vport *vport =hclge_get_vport (handle); +struct hclge_dev *hdev = vport->back;struct net_device *netdev = hdev->vport[0 ].nic.netdev;struct phy_device *phydev = hdev->hw.mac.phydev;__ETHTOOL_DECLARE_LINK_MODE_MASK (mask) = {0 , };
@@ -229,8 +231,10 @@ int hclge_mac_connect_phy(struct hclge_dev *hdev)return 0 ; } -void hclge_mac_disconnect_phy (struct hclge_dev *hdev) +void hclge_mac_disconnect_phy (struct hnae3_handle *handle) { +struct hclge_vport *vport =hclge_get_vport (handle); +struct hclge_dev *hdev = vport->back;struct phy_device *phydev = hdev->hw.mac.phydev;if (!phydev)
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.h +2 -2
@@ -5,8 +5,8 @@#define __HCLGE_MDIO_Hint hclge_mac_mdio_config (struct hclge_dev *hdev); -int hclge_mac_connect_phy (struct hclge_dev *hdev); -void hclge_mac_disconnect_phy (struct hclge_dev *hdev); +int hclge_mac_connect_phy (struct hnae3_handle *handle); +void hclge_mac_disconnect_phy (struct hnae3_handle *handle);void hclge_mac_start_phy (struct hclge_dev *hdev);void hclge_mac_stop_phy (struct hclge_dev *hdev);
drivers/pci/pci.c +73 -2
117 lines not on this page · raw message
drivers/platform/x86/intel_pmc_core.c +34 -0
@@ -15,6 +15,7 @@#include <linux/bitfield.h> #include <linux/debugfs.h> #include <linux/delay.h> +#include <linux/dmi.h> #include <linux/io.h> #include <linux/module.h> #include <linux/pci.h>
@@ -139,6 +140,7 @@ static const struct pmc_reg_map spt_reg_map = { .pm_cfg_offset = SPT_PMC_PM_CFG_OFFSET, .pm_read_disable_bit = SPT_PMC_READ_DISABLE_BIT, .ltr_ignore_max = SPT_NUM_IP_IGN_ALLOWED, + .pm_vric1_offset = SPT_PMC_VRIC1_OFFSET, };/* Cannonlake: PGD PFET Enable Ack Status Register(s) bitmap */
@@ -751,6 +753,37 @@ static const struct pci_device_id pmc_pci_ids[] = { { 0, }, }; +/* +* This quirk can be used on those platforms where +* the platform BIOS enforces 24Mhx Crystal to shutdown +* before PMC can assert SLP_S0#. +*/ +int quirk_xtal_ignore (const struct dmi_system_id *id) +{ +struct pmc_dev *pmcdev = &pmc; +u32 value; + + value =pmc_core_reg_read (pmcdev, pmcdev->map->pm_vric1_offset); +/* 24MHz Crystal Shutdown Qualification Disable */ + value |=SPT_PMC_VRIC1_XTALSDQDIS ; +/* Low Voltage Mode Enable */ + value &= ~SPT_PMC_VRIC1_SLPS0LVEN ; +pmc_core_reg_write (pmcdev, pmcdev->map->pm_vric1_offset, value); +return 0 ; +} + +static const struct dmi_system_id pmc_core_dmi_table[] = { + { + .callback = quirk_xtal_ignore, + .ident ="HP Elite x2 1013 G3" , + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"HP" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"HP Elite x2 1013 G3" ), + }, + }, + {} +}; +static int __init pmc_core_probe (void ) {struct pmc_dev *pmcdev = &pmc;
@@ -792,6 +825,7 @@ static int __init pmc_core_probe(void)return err; } +dmi_check_system (pmc_core_dmi_table);pr_info (" initialized\n" );return 0 ; }
drivers/platform/x86/intel_pmc_core.h +5 -0
@@ -25,6 +25,7 @@#define SPT_PMC_MTPMC_OFFSET 0x20#define SPT_PMC_MFPMC_OFFSET 0x38#define SPT_PMC_LTR_IGNORE_OFFSET 0x30C +#define SPT_PMC_VRIC1_OFFSET 0x31c#define SPT_PMC_MPHY_CORE_STS_0 0x1143#define SPT_PMC_MPHY_CORE_STS_1 0x1142#define SPT_PMC_MPHY_COM_STS_0 0x1155
@@ -135,6 +136,9 @@ enum ppfear_regs {#define SPT_PMC_BIT_MPHY_CMN_LANE2 BIT(2)#define SPT_PMC_BIT_MPHY_CMN_LANE3 BIT(3) +#define SPT_PMC_VRIC1_SLPS0LVEN BIT(13) +#define SPT_PMC_VRIC1_XTALSDQDIS BIT(22) +/* Cannonlake Power Management Controller register offsets */ #define CNP_PMC_SLPS0_DBG_OFFSET 0x10B4#define CNP_PMC_PM_CFG_OFFSET 0x1818
@@ -217,6 +221,7 @@ struct pmc_reg_map {const int pm_read_disable_bit;const u32 slps0_dbg_offset;const u32 ltr_ignore_max; +const u32 pm_vric1_offset; };/**
drivers/scsi/qla2xxx/qla_os.c +1 -1
@@ -1459,7 +1459,7 @@ __qla2xxx_eh_generic_reset(char *name, enum nexus_wait_type type, goto eh_reset_failed; } err =2 ; -if (do_reset (fcport, cmd->device->lun,blk_mq_rq_cpu (cmd->request) +1 ) +if (do_reset (fcport, cmd->device->lun,1 ) !=QLA_SUCCESS ) {ql_log (ql_log_warn, vha,0x800c ,"do_reset failed for cmd=%p.\n" , cmd);
drivers/scsi/scsi_lib.c +8 -1
@@ -598,9 +598,16 @@ static bool scsi_end_request(struct request *req, blk_status_t error,if (!blk_rq_is_scsi (req)) {WARN_ON_ONCE (!(cmd->flags &SCMD_INITIALIZED )); cmd->flags &= ~SCMD_INITIALIZED ; -destroy_rcu_head (&cmd->rcu); } +/* +* Calling rcu_barrier() is not necessary here because the +* SCSI error handler guarantees that the function called by +* call_rcu() has been called before scsi_end_request() is +* called. +*/ +destroy_rcu_head (&cmd->rcu); +/* * In the MQ case the command gets freed by __blk_mq_end_request, * so we have to do all cleanup that depends on it earlier.
drivers/scsi/scsi_transport_iscsi.c +2 -0
@@ -2200,6 +2200,8 @@ void iscsi_remove_session(struct iscsi_cls_session *session)scsi_target_unblock (&session->dev,SDEV_TRANSPORT_OFFLINE );/* flush running scans then delete devices */ flush_work (&session->scan_work); +/* flush running unbind operations */ +flush_work (&session->unbind_work);__iscsi_unbind_session (&session->unbind_work);/* hw iscsi may not have removed all connections from session */
drivers/thermal/broadcom/bcm2835_thermal.c +4 -5
@@ -119,8 +119,7 @@ static const struct debugfs_reg32 bcm2835_thermal_regs[] = {static void bcm2835_thermal_debugfs (struct platform_device *pdev) { -struct thermal_zone_device *tz =platform_get_drvdata (pdev); -struct bcm2835_thermal_data *data = tz->devdata; +struct bcm2835_thermal_data *data =platform_get_drvdata (pdev);struct debugfs_regset32 *regset; data->debugfsdir =debugfs_create_dir ("bcm2835_thermal" ,NULL );
@@ -266,7 +265,7 @@ static int bcm2835_thermal_probe(struct platform_device *pdev) data->tz = tz; -platform_set_drvdata (pdev, tz); +platform_set_drvdata (pdev, data);/* * Thermal_zone doesn't enable hwmon as default,
@@ -290,8 +289,8 @@ static int bcm2835_thermal_probe(struct platform_device *pdev)static int bcm2835_thermal_remove (struct platform_device *pdev) { -struct thermal_zone_device *tz =platform_get_drvdata (pdev); -struct bcm2835_thermal_data *data = tz->devdata; +struct bcm2835_thermal_data *data =platform_get_drvdata (pdev); +struct thermal_zone_device *tz = data->tz;debugfs_remove_recursive (data->debugfsdir);thermal_zone_of_sensor_unregister (&pdev->dev, tz);
drivers/thermal/intel/int340x_thermal/int3400_thermal.c +17 -4
@@ -22,6 +22,13 @@ enum int3400_thermal_uuid {INT3400_THERMAL_PASSIVE_1 ,INT3400_THERMAL_ACTIVE ,INT3400_THERMAL_CRITICAL , +INT3400_THERMAL_ADAPTIVE_PERFORMANCE , +INT3400_THERMAL_EMERGENCY_CALL_MODE , +INT3400_THERMAL_PASSIVE_2 , +INT3400_THERMAL_POWER_BOSS , +INT3400_THERMAL_VIRTUAL_SENSOR , +INT3400_THERMAL_COOLING_MODE , +INT3400_THERMAL_HARDWARE_DUTY_CYCLING , INT3400_THERMAL_MAXIMUM_UUID, };
@@ -29,6 +36,13 @@ static char *int3400_thermal_uuids[INT3400_THERMAL_MAXIMUM_UUID] = {"42A441D6-AE6A-462b-A84B-4A8CE79027D3" ,"3A95C389-E4B8-4629-A526-C52C88626BAE" ,"97C68AE7-15FA-499c-B8C9-5DA81D606E0A" , +"63BE270F-1C11-48FD-A6F7-3AF253FF3E2D" , +"5349962F-71E6-431D-9AE8-0A635B710AEE" , +"9E04115A-AE87-4D1C-9500-0F3E340BFE75" , +"F5A35014-C209-46A4-993A-EB56DE7530A1" , +"6ED722A7-9240-48A5-B479-31EEF723D7CF" , +"16CAF1B7-DD38-40ED-B1C1-1B8A1913D531" , + "BE84BABF-C4D4-403D-B495-3128FD44dAC1", }; struct int3400_thermal_priv {
@@ -299,10 +313,9 @@ static int int3400_thermal_probe(struct platform_device *pdev)platform_set_drvdata (pdev, priv); -if (priv->uuid_bitmap &1 <<INT3400_THERMAL_PASSIVE_1 ) { - int3400_thermal_ops.get_mode = int3400_thermal_get_mode; - int3400_thermal_ops.set_mode = int3400_thermal_set_mode; - } + int3400_thermal_ops.get_mode = int3400_thermal_get_mode; + int3400_thermal_ops.set_mode = int3400_thermal_set_mode; + priv->thermal =thermal_zone_device_register ("INT3400 Thermal" ,0 ,0 , priv, &int3400_thermal_ops, &int3400_thermal_params,0 ,0 );
drivers/thermal/intel/intel_powerclamp.c +2 -2
@@ -101,7 +101,7 @@ struct powerclamp_worker_data {bool clamping; }; -static struct powerclamp_worker_data *__percpu worker_data; +static struct powerclamp_worker_data __percpu *worker_data;static struct thermal_cooling_device *cooling_dev;static unsigned long *cpu_clamping_mask;/* bit map for tracking per cpu * clamping kthread worker
@@ -494,7 +494,7 @@ static void start_power_clamp_worker(unsigned long cpu)struct powerclamp_worker_data *w_data =per_cpu_ptr (worker_data, cpu);struct kthread_worker *worker; - worker =kthread_create_worker_on_cpu (cpu,0 ,"kidle_inject/%ld" , cpu); + worker =kthread_create_worker_on_cpu (cpu,0 ,"kidle_inj/%ld" , cpu);if (IS_ERR (worker))return ;
drivers/thermal/samsung/exynos_tmu.c +1 -1
@@ -666,7 +666,7 @@ static int exynos_get_temp(void *p, int *temp)struct exynos_tmu_data *data = p;int value, ret =0 ; -if (!data || !data->tmu_read || !data->enabled) +if (!data || !data->tmu_read)return -EINVAL ;else if (!data->enabled)/*
fs/cifs/cifsfs.c +1 -1
@@ -1010,7 +1010,7 @@ static loff_t cifs_remap_file_range(struct file *src_file, loff_t off,unsigned int xid;int rc; -if (remap_flags & ~REMAP_FILE_ADVISORY ) +if (remap_flags & ~(REMAP_FILE_DEDUP |REMAP_FILE_ADVISORY ))return -EINVAL ;cifs_dbg (FYI ,"clone range\n" );
fs/cifs/smb2maperror.c +2 -1
@@ -1036,7 +1036,8 @@ static const struct status_to_posix_error smb2_error_map_table[] = { {STATUS_UNFINISHED_CONTEXT_DELETED , -EIO , "STATUS_UNFINISHED_CONTEXT_DELETED"}, {STATUS_NO_TGT_REPLY, -EIO, "STATUS_NO_TGT_REPLY"}, - {STATUS_OBJECTID_NOT_FOUND, -EIO, "STATUS_OBJECTID_NOT_FOUND"}, +/* Note that ENOATTTR and ENODATA are the same errno */ + {STATUS_OBJECTID_NOT_FOUND, -ENODATA, "STATUS_OBJECTID_NOT_FOUND"}, {STATUS_NO_IP_ADDRESSES, -EIO, "STATUS_NO_IP_ADDRESSES"}, {STATUS_WRONG_CREDENTIAL_HANDLE, -EIO, "STATUS_WRONG_CREDENTIAL_HANDLE"},
fs/cifs/smb2ops.c +10 -0
@@ -949,6 +949,16 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon, resp_buftype[0 ] = resp_buftype[1 ] = resp_buftype[2 ] =CIFS_NO_BUFFER ;memset (rsp_iov,0 ,sizeof (rsp_iov)); +if (ses->server->ops->query_all_EAs) { +if (!ea_value) { + rc = ses->server->ops->query_all_EAs (xid, tcon, path, + ea_name,NULL ,0 , + cifs_sb); +if (rc == -ENODATA ) + goto sea_exit; + } + } +/* Open */ memset (&open_iov,0 ,sizeof (open_iov)); rqst[0 ].rq_iov = open_iov;
fs/cifs/trace.h +3 -3
@@ -378,19 +378,19 @@ DECLARE_EVENT_CLASS(smb3_tcon_class, __field(unsigned int, xid) __field(__u32, tid) __field(__u64, sesid) - __field(const char *, unc_name) + __string(name, unc_name) __field(int, rc) ),TP_fast_assign ( __entry->xid = xid; __entry->tid = tid; __entry->sesid = sesid; - __entry->unc_name = unc_name; +__assign_str (name, unc_name); __entry->rc = rc; ), TP_printk("xid=%u sid=0x%llx tid=0x%x unc_name=%s rc=%d", __entry->xid, __entry->sesid, __entry->tid, - __entry->unc_name, __entry->rc) + __get_str(name), __entry->rc) )#define DEFINE_SMB3_TCON_EVENT (name) \
fs/ext4/ioctl.c +7 -0
@@ -999,6 +999,13 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)if (!blk_queue_discard (q))return -EOPNOTSUPP ; +/* +* We haven't replayed the journal, so we cannot use our +* block-bitmap-guided storage zapping commands. +*/ +if (test_opt (sb,NOLOAD ) &&ext4_has_feature_journal (sb)) +return -EROFS ; +if (copy_from_user (&range, (struct fstrim_range __user *)arg,sizeof (range)))return -EFAULT ;
fs/ext4/resize.c +14 -3
@@ -932,11 +932,18 @@ static int add_new_gdb_meta_bg(struct super_block *sb,memcpy (n_group_desc, o_group_desc,EXT4_SB (sb)->s_gdb_count *sizeof (struct buffer_head *)); n_group_desc[gdb_num] = gdb_bh; + +BUFFER_TRACE (gdb_bh,"get_write_access" ); + err =ext4_journal_get_write_access (handle, gdb_bh); +if (err) { +kvfree (n_group_desc); +brelse (gdb_bh); +return err; + } +EXT4_SB (sb)->s_group_desc = n_group_desc;EXT4_SB (sb)->s_gdb_count++;kvfree (o_group_desc); -BUFFER_TRACE (gdb_bh,"get_write_access" ); - err =ext4_journal_get_write_access (handle, gdb_bh);return err; }
@@ -2073,6 +2080,10 @@ int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count)free_flex_gd (flex_gd);if (resize_inode !=NULL )iput (resize_inode); -ext4_msg (sb,KERN_INFO ,"resized filesystem to %llu" , n_blocks_count); +if (err) +ext4_warning (sb,"error (%d) occurred during " +"file system resize" , err); +ext4_msg (sb,KERN_INFO ,"resized filesystem to %llu" , +ext4_blocks_count (es));return err; }
fs/ext4/super.c +13 -3
@@ -430,6 +430,12 @@ static void ext4_journal_commit_callback(journal_t *journal, transaction_t *txn)spin_unlock (&sbi->s_md_lock); } +static bool system_going_down (void ) +{ +return system_state ==SYSTEM_HALT || system_state ==SYSTEM_POWER_OFF + || system_state ==SYSTEM_RESTART ; +} +/* Deal with the reporting of failure conditions on a filesystem such as * inconsistencies detected or read IO failures. *
@@ -460,7 +466,12 @@ static void ext4_handle_error(struct super_block *sb)if (journal)jbd2_journal_abort (journal, -EIO ); } -if (test_opt (sb,ERRORS_RO )) { +/* +* We force ERRORS_RO behavior when system is rebooting. Otherwise we +* could panic during 'reboot -f' as the underlying device got already +* disabled. +*/ +if (test_opt (sb,ERRORS_RO ) ||system_going_down ()) {ext4_msg (sb,KERN_CRIT ,"Remounting filesystem read-only" );/* * Make sure updated value of ->s_mount_flags will be visible
@@ -468,8 +479,7 @@ static void ext4_handle_error(struct super_block *sb)*/ smp_wmb (); sb->s_flags |=SB_RDONLY ; - } -if (test_opt (sb,ERRORS_PANIC )) { + }else if (test_opt (sb,ERRORS_PANIC )) {if (EXT4_SB (sb)->s_journal && !(EXT4_SB (sb)->s_journal->j_flags &JBD2_REC_ERR ))return ;
fs/f2fs/checkpoint.c +5 -4
@@ -306,8 +306,9 @@ static int f2fs_write_meta_pages(struct address_space *mapping, goto skip_write;/* collect a number of dirty meta pages and write together */ -if (wbc->for_kupdate || -get_pages (sbi,F2FS_DIRTY_META ) <nr_pages_to_skip (sbi,META )) +if (wbc->sync_mode !=WB_SYNC_ALL && +get_pages (sbi,F2FS_DIRTY_META ) < +nr_pages_to_skip (sbi,META )) goto skip_write;/* if locked failed, cp will flush dirty pages instead */
@@ -405,7 +406,7 @@ static int f2fs_set_meta_page_dirty(struct page *page)if (!PageDirty (page)) {__set_page_dirty_nobuffers (page);inc_page_count (F2FS_P_SB (page),F2FS_DIRTY_META ); -SetPagePrivate (page); +f2fs_set_page_private (page,0 );f2fs_trace_pid (page);return 1 ; }
@@ -956,7 +957,7 @@ void f2fs_update_dirty_page(struct inode *inode, struct page *page)inode_inc_dirty_pages (inode);spin_unlock (&sbi->inode_lock[type]); -SetPagePrivate (page); +f2fs_set_page_private (page,0 );f2fs_trace_pid (page); }
fs/f2fs/data.c +8 -13
@@ -2711,8 +2711,7 @@ void f2fs_invalidate_page(struct page *page, unsigned int offset,if (IS_ATOMIC_WRITTEN_PAGE (page))return f2fs_drop_inmem_page (inode, page); -set_page_private (page,0 ); -ClearPagePrivate (page); +f2fs_clear_page_private (page); }int f2fs_release_page (struct page *page,gfp_t wait)
@@ -2726,8 +2725,7 @@ int f2fs_release_page(struct page *page, gfp_t wait)return 0 ;clear_cold_data (page); -set_page_private (page,0 ); -ClearPagePrivate (page); +f2fs_clear_page_private (page);return 1 ; }
@@ -2795,12 +2793,8 @@ int f2fs_migrate_page(struct address_space *mapping,return -EAGAIN ; } -/* -* A reference is expected if PagePrivate set when move mapping, -* however F2FS breaks this for maintaining dirty page counts when -* truncating pages. So here adjusting the 'extra_count' make it work. -*/ - extra_count = (atomic_written ?1 :0 ) -page_has_private (page); +/* one extra reference was held for atomic_write page */ + extra_count = atomic_written ?1 :0 ; rc =migrate_page_move_mapping (mapping, newpage, page, mode, extra_count);if (rc !=MIGRATEPAGE_SUCCESS ) {
@@ -2821,9 +2815,10 @@ int f2fs_migrate_page(struct address_space *mapping,get_page (newpage); } -if (PagePrivate (page)) -SetPagePrivate (newpage); -set_page_private (newpage,page_private (page)); +if (PagePrivate (page)) { +f2fs_set_page_private (newpage,page_private (page)); +f2fs_clear_page_private (page); + }if (mode !=MIGRATE_SYNC_NO_COPY )migrate_page_copy (newpage, page);
fs/f2fs/dir.c +1 -1
@@ -728,7 +728,7 @@ void f2fs_delete_entry(struct f2fs_dir_entry *dentry, struct page *page, !f2fs_truncate_hole(dir, page->index, page->index + 1)) {f2fs_clear_page_cache_dirty_tag (page);clear_page_dirty_for_io (page); -ClearPagePrivate (page); +f2fs_clear_page_private (page);ClearPageUptodate (page);clear_cold_data (page);inode_dec_dirty_pages (dir);
fs/f2fs/f2fs.h +21 -0
@@ -2825,6 +2825,27 @@ static inline bool is_valid_data_blkaddr(struct f2fs_sb_info *sbi,return true; } +static inline void f2fs_set_page_private (struct page *page, +unsigned long data) +{ +if (PagePrivate (page)) +return ; + +get_page (page); +SetPagePrivate (page); +set_page_private (page, data); +} + +static inline void f2fs_clear_page_private (struct page *page) +{ +if (!PagePrivate (page)) +return ; + +set_page_private (page,0 ); +ClearPagePrivate (page); +f2fs_put_page (page,0 ); +} +/* * file.c */
fs/f2fs/file.c +1 -4
@@ -768,7 +768,6 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr) {struct inode *inode =d_inode (dentry);int err; -bool size_changed = false;if (unlikely (f2fs_cp_error (F2FS_I_SB (inode))))return -EIO ;
@@ -843,8 +842,6 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr)down_write (&F2FS_I (inode)->i_sem);F2FS_I (inode)->last_disk_size =i_size_read (inode);up_write (&F2FS_I (inode)->i_sem); - - size_changed = true; }__setattr_copy (inode, attr);
@@ -858,7 +855,7 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr) }/* file size may changed here */ -f2fs_mark_inode_dirty_sync (inode, size_changed); +f2fs_mark_inode_dirty_sync (inode, true);/* inode change will produce dirty node pages flushed by checkpoint */ f2fs_balance_fs (F2FS_I_SB (inode), true);
fs/f2fs/node.c +4 -2
@@ -1920,7 +1920,9 @@ static int f2fs_write_node_pages(struct address_space *mapping,f2fs_balance_fs_bg (sbi);/* collect a number of dirty node pages and write together */ -if (get_pages (sbi,F2FS_DIRTY_NODES ) <nr_pages_to_skip (sbi,NODE )) +if (wbc->sync_mode !=WB_SYNC_ALL && +get_pages (sbi,F2FS_DIRTY_NODES ) < +nr_pages_to_skip (sbi,NODE )) goto skip_write;if (wbc->sync_mode ==WB_SYNC_ALL )
@@ -1959,7 +1961,7 @@ static int f2fs_set_node_page_dirty(struct page *page)if (!PageDirty (page)) {__set_page_dirty_nobuffers (page);inc_page_count (F2FS_P_SB (page),F2FS_DIRTY_NODES ); -SetPagePrivate (page); +f2fs_set_page_private (page,0 );f2fs_trace_pid (page);return 1 ; }
fs/f2fs/segment.c +3 -6
@@ -191,8 +191,7 @@ void f2fs_register_inmem_page(struct inode *inode, struct page *page)f2fs_trace_pid (page); -set_page_private (page, (unsigned long )ATOMIC_WRITTEN_PAGE ); -SetPagePrivate (page); +f2fs_set_page_private (page, (unsigned long )ATOMIC_WRITTEN_PAGE ); new =f2fs_kmem_cache_alloc (inmem_entry_slab,GFP_NOFS );
@@ -280,8 +279,7 @@ static int __revoke_inmem_pages(struct inode *inode,ClearPageUptodate (page);clear_cold_data (page); } -set_page_private (page,0 ); -ClearPagePrivate (page); +f2fs_clear_page_private (page);f2fs_put_page (page,1 );list_del (&cur->list);
@@ -370,8 +368,7 @@ void f2fs_drop_inmem_page(struct inode *inode, struct page *page)kmem_cache_free (inmem_entry_slab, cur);ClearPageUptodate (page); -set_page_private (page,0 ); -ClearPagePrivate (page); +f2fs_clear_page_private (page);f2fs_put_page (page,0 );trace_f2fs_commit_inmem_page (page,INMEM_INVALIDATE );
fs/f2fs/super.c +33 -11
93 lines not on this page · raw message
fs/f2fs/xattr.c +5 -5
@@ -347,7 +347,7 @@ static int lookup_all_xattrs(struct inode *inode, struct page *ipage, *base_addr = txattr_addr;return 0 ; out: -kzfree (txattr_addr); +kvfree (txattr_addr);return err; }
@@ -390,7 +390,7 @@ static int read_all_xattrs(struct inode *inode, struct page *ipage, *base_addr = txattr_addr;return 0 ; fail: -kzfree (txattr_addr); +kvfree (txattr_addr);return err; }
@@ -517,7 +517,7 @@ int f2fs_getxattr(struct inode *inode, int index, const char *name, } error = size; out: -kzfree (base_addr); +kvfree (base_addr);return error; }
@@ -563,7 +563,7 @@ ssize_t f2fs_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size) } error = buffer_size - rest; cleanup: -kzfree (base_addr); +kvfree (base_addr);return error; }
@@ -694,7 +694,7 @@ static int __f2fs_setxattr(struct inode *inode, int index,if (!error &&S_ISDIR (inode->i_mode))set_sbi_flag (F2FS_I_SB (inode),SBI_NEED_CP ); exit: -kzfree (base_addr); +kvfree (base_addr);return error; }
fs/notify/inotify/inotify_user.c +5 -2
@@ -519,8 +519,10 @@ static int inotify_update_existing_watch(struct fsnotify_group *group, fsn_mark =fsnotify_find_mark (&inode->i_fsnotify_marks, group);if (!fsn_mark)return -ENOENT ; -else if (create) -return -EEXIST ; +else if (create) { + ret = -EEXIST ; + goto out; + } i_mark = container_of(fsn_mark, struct inotify_inode_mark, fsn_mark);
@@ -548,6 +550,7 @@ static int inotify_update_existing_watch(struct fsnotify_group *group,/* return the wd */ ret = i_mark->wd; +out:/* match the get from fsnotify_find_mark() */ fsnotify_put_mark (fsn_mark);
fs/proc/kcore.c +27 -0
@@ -54,6 +54,28 @@ static LIST_HEAD(kclist_head);static DECLARE_RWSEM (kclist_lock);static int kcore_need_update =1 ; +/* +* Returns > 0 for RAM pages, 0 for non-RAM pages, < 0 on error +* Same as oldmem_pfn_is_ram in vmcore +*/ +static int (*mem_pfn_is_ram)(unsigned long pfn); + +int __init register_mem_pfn_is_ram (int (*fn)(unsigned long pfn)) +{ +if (mem_pfn_is_ram) +return -EBUSY ; + mem_pfn_is_ram = fn; +return 0 ; +} + +static int pfn_is_ram (unsigned long pfn) +{ +if (mem_pfn_is_ram) +return mem_pfn_is_ram (pfn); +else +return 1 ; +} +/* This doesn't grab kclist_lock, so it should only be used at init time. */ void __init kclist_add (struct kcore_list *new,void *addr,size_t size,int type)
@@ -465,6 +487,11 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos) goto out; } m =NULL ;/* skip the list anchor */ + }else if (!pfn_is_ram (__pa (start) >>PAGE_SHIFT )) { +if (clear_user (buffer, tsz)) { + ret = -EFAULT ; + goto out; + } }else if (m->type ==KCORE_VMALLOC ) {vread (buf, (char *)start, tsz);/* we have to zero-fill user buffer even if no read */
include/linux/atalk.h +1 -1
@@ -158,7 +158,7 @@ extern int sysctl_aarp_retransmit_limit;extern int sysctl_aarp_resolve_time;#ifdef CONFIG_SYSCTL -extern void atalk_register_sysctl (void ); +extern int atalk_register_sysctl (void );extern void atalk_unregister_sysctl (void );#else static inline int atalk_register_sysctl (void )
include/linux/kcore.h +2 -0
@@ -44,6 +44,8 @@ void kclist_add_remap(struct kcore_list *m, void *addr, void *vaddr, size_t sz) m->vaddr = (unsigned long )vaddr; kclist_add(m, addr, sz, KCORE_REMAP); } + +extern int __init register_mem_pfn_is_ram (int (*fn)(unsigned long pfn));#else static inline void kclist_add (struct kcore_list *new,void *addr,size_t size,int type)
include/linux/swap.h +2 -2
@@ -157,9 +157,9 @@ struct swap_extent {/* * Max bad pages in the new format.. */ -#define __swapoffset (x) ((unsigned long)&((union swap_header *)0)->x)#define MAX_SWAP_BADPAGES \ - ((__swapoffset(magic.magic) - __swapoffset(info.badpages)) / sizeof(int)) + ((offsetof(union swap_header, magic.magic) - \ + offsetof(union swap_header, info.badpages)) / sizeof(int))enum {SWP_USED = (1 <<0 ),/* is slot in swap_info[] used? */
include/trace/events/rxrpc.h +2 -0
@@ -76,6 +76,7 @@ enum rxrpc_client_trace { rxrpc_client_chan_disconnect, rxrpc_client_chan_pass, rxrpc_client_chan_unstarted, + rxrpc_client_chan_wait_failed, rxrpc_client_cleanup, rxrpc_client_count, rxrpc_client_discard,
@@ -276,6 +277,7 @@ enum rxrpc_tx_point { EM(rxrpc_client_chan_disconnect, "ChDisc") \ EM(rxrpc_client_chan_pass, "ChPass") \ EM(rxrpc_client_chan_unstarted, "ChUnst") \ + EM(rxrpc_client_chan_wait_failed, "ChWtFl") \ EM(rxrpc_client_cleanup, "Clean ") \ EM(rxrpc_client_count, "Count ") \EM (rxrpc_client_discard,"Discar" ) \
kernel/bpf/inode.c +18 -14
@@ -554,19 +554,6 @@ struct bpf_prog *bpf_prog_get_type_path(const char *name, enum bpf_prog_type typ }EXPORT_SYMBOL (bpf_prog_get_type_path); -static void bpf_evict_inode (struct inode *inode) -{ -enum bpf_type type; - -truncate_inode_pages_final (&inode->i_data); -clear_inode (inode); - -if (S_ISLNK (inode->i_mode)) -kfree (inode->i_link); -if (!bpf_inode_type (inode, &type)) -bpf_any_put (inode->i_private, type); -} -/* * Display the mount options in /proc/mounts. */
@@ -579,11 +566,28 @@ static int bpf_show_options(struct seq_file *m, struct dentry *root)return 0 ; } +static void bpf_destroy_inode_deferred (struct rcu_head *head) +{ + struct inode *inode = container_of(head, struct inode, i_rcu); +enum bpf_type type; + +if (S_ISLNK (inode->i_mode)) +kfree (inode->i_link); +if (!bpf_inode_type (inode, &type)) +bpf_any_put (inode->i_private, type); +free_inode_nonrcu (inode); +} + +static void bpf_destroy_inode (struct inode *inode) +{ +call_rcu (&inode->i_rcu, bpf_destroy_inode_deferred); +} +static const struct super_operations bpf_super_ops = { .statfs = simple_statfs, .drop_inode = generic_delete_inode, .show_options = bpf_show_options, - .evict_inode = bpf_evict_inode, + .destroy_inode = bpf_destroy_inode, };enum {
kernel/events/core.c +2 -0
@@ -7178,6 +7178,7 @@ static void perf_event_mmap_output(struct perf_event *event,struct perf_output_handle handle;struct perf_sample_data sample;int size = mmap_event->event_id.header.size; +u32 type = mmap_event->event_id.header.type;int ret;if (!perf_event_mmap_match (event, data))
@@ -7221,6 +7222,7 @@ static void perf_event_mmap_output(struct perf_event *event,perf_output_end (&handle); out: mmap_event->event_id.header.size = size; + mmap_event->event_id.header.type = type; }static void perf_event_mmap_event (struct perf_mmap_event *mmap_event)
kernel/sched/core.c +1 -1
@@ -6942,7 +6942,7 @@ static int __maybe_unused cpu_period_quota_parse(char *buf, {char tok[21 ];/* U64_MAX */ -if (!sscanf (buf,"%s %llu" , tok, periodp)) +if (sscanf (buf,"%20s %llu" , tok, periodp) <1 )return -EINVAL ; *periodp *=NSEC_PER_USEC ;
kernel/sched/cpufreq_schedutil.c +25 -34
125 lines not on this page · raw message
lib/div64.c +2 -2
@@ -109,7 +109,7 @@ u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) quot =div_u64_rem (dividend, divisor, &rem32); *remainder = rem32; }else { -int n =1 +fls (high); +int n =fls (high); quot =div_u64 (dividend >> n, divisor >> n);if (quot !=0 )
@@ -147,7 +147,7 @@ u64 div64_u64(u64 dividend, u64 divisor)if (high ==0 ) { quot =div_u64 (dividend, divisor); }else { -int n =1 +fls (high); +int n =fls (high); quot =div_u64 (dividend >> n, divisor >> n);if (quot !=0 )
net/appletalk/atalk_proc.c +1 -1
@@ -255,7 +255,7 @@ int __init atalk_proc_init(void) goto out; } -void __exit atalk_proc_exit(void) +void atalk_proc_exit (void ) {remove_proc_entry ("interface" , atalk_proc_dir);remove_proc_entry ("route" , atalk_proc_dir);
net/appletalk/ddp.c +31 -6
@@ -1910,12 +1910,16 @@ static const char atalk_err_snap[] __initconst =/* Called by proto.c on kernel start up */ static int __init atalk_init (void ) { -int rc =proto_register (&ddp_proto,0 ); +int rc; -if (rc !=0 ) + rc =proto_register (&ddp_proto,0 ); +if (rc) goto out; - (void )sock_register (&atalk_family_ops); + rc =sock_register (&atalk_family_ops); +if (rc) + goto out_proto; + ddp_dl =register_snap_client (ddp_snap_id, atalk_rcv);if (!ddp_dl)printk (atalk_err_snap);
@@ -1923,12 +1927,33 @@ static int __init atalk_init(void)dev_add_pack (<alk_packet_type);dev_add_pack (&ppptalk_packet_type); -register_netdevice_notifier (&ddp_notifier); + rc =register_netdevice_notifier (&ddp_notifier); +if (rc) + goto out_sock; +aarp_proto_init (); -atalk_proc_init (); -atalk_register_sysctl (); + rc =atalk_proc_init (); +if (rc) + goto out_aarp; + + rc =atalk_register_sysctl (); +if (rc) + goto out_proc; out:return rc; +out_proc: +atalk_proc_exit (); +out_aarp: +aarp_cleanup_module (); +unregister_netdevice_notifier (&ddp_notifier); +out_sock: +dev_remove_pack (&ppptalk_packet_type); +dev_remove_pack (<alk_packet_type); +unregister_snap_client (ddp_dl); +sock_unregister (PF_APPLETALK ); +out_proto: +proto_unregister (&ddp_proto); + goto out; }module_init (atalk_init);
net/appletalk/sysctl_net_atalk.c +4 -1
@@ -45,9 +45,12 @@ static struct ctl_table atalk_table[] = {static struct ctl_table_header *atalk_table_header; -void atalk_register_sysctl (void ) +int __init atalk_register_sysctl (void ) { atalk_table_header =register_net_sysctl (&init_net,"net/appletalk" , atalk_table); +if (!atalk_table_header) +return -ENOMEM ; +return 0 ; }void atalk_unregister_sysctl (void )
net/rxrpc/conn_client.c +15 -5
@@ -704,6 +704,7 @@ int rxrpc_connect_call(struct rxrpc_sock *rx, ret =rxrpc_wait_for_channel (call, gfp);if (ret <0 ) { +trace_rxrpc_client (call->conn, ret, rxrpc_client_chan_wait_failed);rxrpc_disconnect_client_call (call); goto out; }
@@ -774,16 +775,22 @@ static void rxrpc_set_client_reap_timer(struct rxrpc_net *rxnet)*/ void rxrpc_disconnect_client_call (struct rxrpc_call *call) { -unsigned int channel = call->cid &RXRPC_CHANNELMASK ;struct rxrpc_connection *conn = call->conn; -struct rxrpc_channel *chan = &conn->channels[channel]; +struct rxrpc_channel *chan =NULL ;struct rxrpc_net *rxnet = conn->params.local->rxnet; +unsigned int channel =-1 ; +u32 cid; +spin_lock (&conn->channel_lock); + + cid = call->cid; +if (cid) { + channel = cid &RXRPC_CHANNELMASK ; + chan = &conn->channels[channel]; + }trace_rxrpc_client (conn, channel, rxrpc_client_chan_disconnect); call->conn =NULL ; -spin_lock (&conn->channel_lock); -/* Calls that have never actually been assigned a channel can simply be * discarded. If the conn didn't get used either, it will follow * immediately unless someone else grabs it in the meantime.
@@ -807,7 +814,10 @@ void rxrpc_disconnect_client_call(struct rxrpc_call *call) goto out; } - ASSERTCMP(rcu_access_pointer(chan->call), ==, call); +if (rcu_access_pointer (chan->call) != call) { +spin_unlock (&conn->channel_lock); +BUG (); + }/* If a client call was exposed to the world, we save the result for * retransmission.
sound/drivers/opl3/opl3_voice.h +1 -1
@@ -41,7 +41,7 @@ void snd_opl3_timer_func(struct timer_list *t);/* Prototypes for opl3_drums.c */ void snd_opl3_load_drums (struct snd_opl3 *opl3); -void snd_opl3_drum_switch (struct snd_opl3 *opl3,int note,int on_off,int vel,struct snd_midi_channel *chan); +void snd_opl3_drum_switch (struct snd_opl3 *opl3,int note,int vel,int on_off,struct snd_midi_channel *chan);/* Prototypes for opl3_oss.c */ #if IS_ENABLED (CONFIG_SND_SEQUENCER_OSS )
sound/isa/sb/sb8.c +4 -0
@@ -111,6 +111,10 @@ static int snd_sb8_probe(struct device *pdev, unsigned int dev)/* block the 0x388 port to avoid PnP conflicts */ acard->fm_res =request_region (0x388 ,4 ,"SoundBlaster FM" ); +if (!acard->fm_res) { + err = -EBUSY ; + goto _err; + } if (port[dev] != SNDRV_AUTO_PORT) { if ((err = snd_sbdsp_create(card, port[dev], irq[dev],
sound/pci/echoaudio/echoaudio.c +5 -0
@@ -1954,6 +1954,11 @@ static int snd_echo_create(struct snd_card *card, } chip->dsp_registers = (volatile u32 __iomem *)ioremap_nocache (chip->dsp_registers_phys, sz); +if (!chip->dsp_registers) { +dev_err (chip->card->dev,"ioremap failed\n" ); +snd_echo_free (chip); +return -ENOMEM ; + }if (request_irq (pci->irq, snd_echo_interrupt,IRQF_SHARED ,KBUILD_MODNAME , chip)) {
tools/lib/bpf/libbpf.c +1 -1
@@ -627,7 +627,7 @@ bpf_object__init_maps(struct bpf_object *obj, int flags)bool strict = !(flags &MAPS_RELAX_COMPAT );int i, map_idx, map_def_sz, nr_maps =0 ;Elf_Scn *scn; -Elf_Data *data; +Elf_Data *data =NULL ;Elf_Data *symbols = obj->efile.symbols;if (obj->efile.maps_shndx <0 )
tools/perf/Documentation/perf-config.txt +1 -1
@@ -114,7 +114,7 @@ Given a $HOME/.perfconfig like this: [report] # Defaults - sort-order = comm,dso,symbol + sort_order = comm,dso,symbol percent-limit = 0 queue-size = 0 children = true
tools/perf/Documentation/perf-stat.txt +2 -3
@@ -72,9 +72,8 @@ report:: --all-cpus:: system-wide collection from all CPUs (default if no target is specified) --c:: ---scale:: - scale/normalize counter values +--no-scale:: + Don't scale/normalize counter values -d:: --detailed::
tools/perf/bench/epoll-ctl.c +1 -1
@@ -224,7 +224,7 @@ static int do_threads(struct worker *worker, struct cpu_map *cpu)pthread_attr_t thread_attr, *attrp =NULL ;cpu_set_t cpuset;unsigned int i, j; -int ret; +int ret =0 ;if (!noaffinity)pthread_attr_init (&thread_attr);
tools/perf/bench/epoll-wait.c +1 -1
@@ -293,7 +293,7 @@ static int do_threads(struct worker *worker, struct cpu_map *cpu)pthread_attr_t thread_attr, *attrp =NULL ;cpu_set_t cpuset;unsigned int i, j; -int ret, events =EPOLLIN ; +int ret =0 , events =EPOLLIN ;if (oneshot) events |=EPOLLONESHOT ;
tools/perf/builtin-stat.c +2 -1
@@ -728,7 +728,8 @@ static struct option stat_options[] = { "system-wide collection from all CPUs"),OPT_BOOLEAN ('g' ,"group" , &group,"put the counters into a counter group" ), -OPT_BOOLEAN ('c' ,"scale" , &stat_config.scale,"scale/normalize counters" ), +OPT_BOOLEAN (0 ,"scale" , &stat_config.scale, +"Use --no-scale to disable counter scaling for multiplexing" ),OPT_INCR ('v' ,"verbose" , &verbose,"be more verbose (show counter open errors, etc)" ), OPT_INTEGER('r', "repeat", &stat_config.run_count,
tools/perf/builtin-top.c +3 -2
@@ -1633,8 +1633,9 @@ int cmd_top(int argc, const char **argv)annotation_config__init (); symbol_conf.try_vmlinux_path = (symbol_conf.vmlinux_name ==NULL ); -if (symbol__init (NULL ) <0 ) -return -1 ; + status =symbol__init (NULL ); +if (status <0 ) + goto out_delete_evlist;sort__setup_elide (stdout);
tools/perf/tests/backward-ring-buffer.c +1 -1
@@ -18,7 +18,7 @@ static void testcase(void)int i;for (i =0 ; i <NR_ITERS ; i++) { -char proc_name[10 ]; +char proc_name[15 ];snprintf (proc_name,sizeof (proc_name),"p:%d\n" , i);prctl (PR_SET_NAME , proc_name);
tools/perf/tests/evsel-tp-sched.c +1 -0
@@ -85,5 +85,6 @@ int test__perf_evsel__tp_sched_test(struct test *test __maybe_unused, int subtesif (perf_evsel__test_field (evsel,"target_cpu" ,4 , true)) ret =-1 ; +perf_evsel__delete (evsel);return ret; }
tools/perf/tests/expr.c +4 -1
@@ -19,7 +19,7 @@ int test__expr(struct test *t __maybe_unused, int subtest __maybe_unused)const char *p;const char **other;double val; -int ret; +int i, ret;struct parse_ctx ctx;int num_other;
@@ -56,6 +56,9 @@ int test__expr(struct test *t __maybe_unused, int subtest __maybe_unused)TEST_ASSERT_VAL ("find other" , !strcmp (other[1 ],"BAZ" ));TEST_ASSERT_VAL ("find other" , !strcmp (other[2 ],"BOZO" ));TEST_ASSERT_VAL ("find other" , other[3 ] ==NULL ); + +for (i =0 ; i < num_other; i++) +free ((void *)other[i]);free ((void *)other);return 0 ;
tools/perf/tests/openat-syscall-all-cpus.c +3 -1
@@ -45,7 +45,7 @@ int test__openat_syscall_event_on_all_cpus(struct test *test __maybe_unused, intif (IS_ERR (evsel)) {tracing_path__strerror_open_tp (errno, errbuf,sizeof (errbuf),"syscalls" ,"sys_enter_openat" );pr_debug ("%s\n" , errbuf); - goto out_thread_map_delete; + goto out_cpu_map_delete; }if (perf_evsel__open (evsel, cpus, threads) <0 ) {
@@ -119,6 +119,8 @@ int test__openat_syscall_event_on_all_cpus(struct test *test __maybe_unused, intperf_evsel__close_fd (evsel); out_evsel_delete:perf_evsel__delete (evsel); +out_cpu_map_delete: +cpu_map__put (cpus); out_thread_map_delete:thread_map__put (threads);return err;
tools/perf/util/build-id.c +1 -0
@@ -183,6 +183,7 @@ char *build_id_cache__linkname(const char *sbuild_id, char *bf, size_t size)return bf; } +/* The caller is responsible to free the returned buffer. */ char *build_id_cache__origname (const char *sbuild_id) {char *linkname;
tools/perf/util/config.c +1 -2
@@ -632,11 +632,10 @@ static int collect_config(const char *var, const char *value, } ret =set_value (item, value); -return ret; out_free:free (key); -return -1 ; +return ret; } int perf_config_set__collect(struct perf_config_set *set, const char *file_name,
tools/perf/util/evsel.c +2 -2
@@ -1289,6 +1289,7 @@ void perf_evsel__exit(struct perf_evsel *evsel) {assert (list_empty (&evsel->node));assert (evsel->evlist ==NULL ); +perf_evsel__free_counts (evsel);perf_evsel__free_fd (evsel);perf_evsel__free_id (evsel);perf_evsel__free_config_terms (evsel);
@@ -1341,8 +1342,7 @@ void perf_counts_values__scale(struct perf_counts_values *count, scaled =1 ; count->val = (u64)((double ) count->val * count->ena / count->run +0.5 ); } - }else - count->ena = count->run =0 ; + }if (pscaled) *pscaled = scaled;
tools/perf/util/hist.c +3 -1
@@ -1048,8 +1048,10 @@ int hist_entry_iter__add(struct hist_entry_iter *iter, struct addr_location *al, err =sample__resolve_callchain (iter->sample, &callchain_cursor, &iter->parent, iter->evsel, al, max_stack_depth); -if (err) +if (err) { +map__put (alm);return err; + } err = iter->ops->prepare_entry (iter, al);if (err)
tools/perf/util/map.c +18 -0
@@ -571,10 +571,25 @@ static void __maps__purge(struct maps *maps) } } +static void __maps__purge_names (struct maps *maps) +{ +struct rb_root *root = &maps->names; +struct rb_node *next =rb_first (root); + +while (next) { + struct map *pos = rb_entry(next, struct map, rb_node_name); + + next =rb_next (&pos->rb_node_name); +rb_erase_init (&pos->rb_node_name, root); +map__put (pos); + } +} +static void maps__exit (struct maps *maps) {down_write (&maps->lock);__maps__purge (maps); +__maps__purge_names (maps);up_write (&maps->lock); }
@@ -911,6 +926,9 @@ static void __maps__remove(struct maps *maps, struct map *map) {rb_erase_init (&map->rb_node, &maps->entries);map__put (map); + +rb_erase_init (&map->rb_node_name, &maps->names); +map__put (map); }void maps__remove (struct maps *maps,struct map *map)
tools/perf/util/ordered-events.c +2 -0
@@ -270,6 +270,8 @@ static int __ordered_events__flush(struct ordered_events *oe, enum oe_flush how,"FINAL" ,"ROUND" ,"HALF " , +"TOP " , + "TIME ", };int err;bool show_progress = false;
tools/perf/util/parse-events.c +2 -0
@@ -2271,6 +2271,7 @@ static bool is_event_supported(u8 type, unsigned config)perf_evsel__delete (evsel); } +thread_map__put (tmap);return ret; }
@@ -2341,6 +2342,7 @@ void print_sdt_events(const char *subsys_glob, const char *event_glob,printf (" %-50s [%s]\n" , buf,"SDT event" );free (buf); } +free (path); }else printf (" %-50s [%s]\n" , nd->s,"SDT event" );if (nd2) {
tools/perf/util/stat.c +4 -8
@@ -291,10 +291,8 @@ process_counter_values(struct perf_stat_config *config, struct perf_evsel *evselbreak ;case AGGR_GLOBAL : aggr->val += count->val; -if (config->scale) { - aggr->ena += count->ena; - aggr->run += count->run; - } + aggr->ena += count->ena; + aggr->run += count->run;case AGGR_UNSET :default :break ;
@@ -442,10 +440,8 @@ int create_perf_stat_counter(struct perf_evsel *evsel,struct perf_event_attr *attr = &evsel->attr;struct perf_evsel *leader = evsel->leader; -if (config->scale) { - attr->read_format =PERF_FORMAT_TOTAL_TIME_ENABLED | -PERF_FORMAT_TOTAL_TIME_RUNNING ; - } + attr->read_format =PERF_FORMAT_TOTAL_TIME_ENABLED | +PERF_FORMAT_TOTAL_TIME_RUNNING ;/* * The event is part of non trivial group, let's enable
tools/power/x86/turbostat/turbostat.c +3 -0
@@ -5077,6 +5077,9 @@ int fork_it(char **argv)signal (SIGQUIT ,SIG_IGN );if (waitpid (child_pid, &status,0 ) ==-1 )err (status,"waitpid" ); + +if (WIFEXITED (status)) + status =WEXITSTATUS (status); }/* * n.b. fork_it() does not check for errors from for_all_cpus()