Linux 5.3.14
Greg KH
maintainerI'm announcing the release of the 5.3.14 kernel.
All users of the 5.3 kernel series must upgrade.
The updated 5.3.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.3.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
------------
Documentation/admin-guide/hw-vuln/mds.rst | 7 Documentation/admin-guide/hw-vuln/tsx_async_abort.rst | 5 Documentation/admin-guide/kernel-parameters.txt | 11 Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt | 6 Makefile | 2 arch/arm/mm/mmu.c | 3 arch/powerpc/include/asm/asm-prototypes.h | 3 arch/powerpc/include/asm/security_features.h | 3 arch/powerpc/kernel/entry_64.S | 6 arch/powerpc/kernel/security.c | 74 +++ arch/powerpc/kvm/book3s_hv_rmhandlers.S | 30 + arch/x86/entry/entry_32.S | 211 ++++++---- arch/x86/include/asm/cpu_entry_area.h | 18 arch/x86/include/asm/pgtable_32_types.h | 8 arch/x86/include/asm/segment.h | 12 arch/x86/kernel/cpu/bugs.c | 30 + arch/x86/kernel/doublefault.c | 3 arch/x86/kernel/head_32.S | 10 arch/x86/mm/cpu_entry_area.c | 4 arch/x86/tools/gen-insn-attr-x86.awk | 4 arch/x86/xen/xen-asm_32.S | 75 +-- drivers/block/nbd.c | 6 drivers/bluetooth/hci_bcsp.c | 3 drivers/bluetooth/hci_ll.c | 39 - drivers/char/virtio_console.c | 28 - drivers/cpufreq/cpufreq.c | 6 drivers/gpio/gpio-bd70528.c | 6 drivers/gpio/gpio-max77620.c | 6 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 6 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 9 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 23 - drivers/gpu/drm/i915/display/intel_display.c | 3 drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 22 - drivers/gpu/drm/i915/i915_pmu.c | 4 drivers/md/dm-crypt.c | 9 drivers/md/raid10.c | 2 drivers/media/platform/vivid/vivid-kthread-cap.c | 8 drivers/media/platform/vivid/vivid-kthread-out.c | 8 drivers/media/platform/vivid/vivid-sdr-cap.c | 8 drivers/media/platform/vivid/vivid-vid-cap.c | 3 drivers/media/platform/vivid/vivid-vid-out.c | 3 drivers/media/rc/imon.c | 3 drivers/media/rc/mceusb.c | 141 ++++-- drivers/media/usb/b2c2/flexcop-usb.c | 3 drivers/media/usb/dvb-usb/cxusb.c | 3 drivers/media/usb/usbvision/usbvision-video.c | 29 + drivers/media/usb/uvc/uvc_driver.c | 28 - drivers/net/ethernet/google/gve/gve_tx.c | 9 drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 9 drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 9 drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c | 18 drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 12 drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 2 drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 10 drivers/net/ethernet/mellanox/mlx5/core/fs_core.h | 1 drivers/net/ethernet/mellanox/mlx5/core/main.c | 1 drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c | 2 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 19 drivers/net/ethernet/sfc/ptp.c | 3 drivers/net/phy/mdio_bus.c | 11 drivers/net/wireless/ath/ath10k/pci.c | 36 + drivers/net/wireless/ath/ath10k/qmi.c | 13 drivers/net/wireless/ath/ath10k/qmi_wlfw_v01.c | 22 + drivers/net/wireless/ath/ath10k/qmi_wlfw_v01.h | 1 drivers/net/wireless/ath/ath10k/snoc.c | 11 drivers/net/wireless/ath/ath10k/snoc.h | 1 drivers/net/wireless/ath/ath10k/usb.c | 8 drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 2 drivers/nfc/port100.c | 2 drivers/staging/comedi/drivers/usbduxfast.c | 21 drivers/usb/misc/appledisplay.c | 8 drivers/usb/misc/chaoskey.c | 24 - drivers/usb/serial/cp210x.c | 1 drivers/usb/serial/mos7720.c | 4 drivers/usb/serial/mos7840.c | 16 drivers/usb/serial/option.c | 7 drivers/usb/usbip/Kconfig | 1 drivers/usb/usbip/stub_rx.c | 50 +- drivers/vhost/vsock.c | 66 ++- drivers/virtio/virtio_balloon.c | 2 drivers/virtio/virtio_ring.c | 4 fs/ocfs2/xattr.c | 56 +- include/net/tls.h | 2 kernel/fork.c | 6 kernel/futex.c | 58 ++ mm/ksm.c | 14 mm/memory_hotplug.c | 16 mm/slub.c | 22 - net/core/rtnetlink.c | 23 + net/ipv4/sysctl_net_ipv4.c | 2 net/ipv6/route.c | 2 net/sched/act_pedit.c | 12 net/sched/act_tunnel_key.c | 4 net/sched/sch_taprio.c | 28 + net/tls/tls_main.c | 1 net/tls/tls_sw.c | 11 net/vmw_vsock/virtio_transport_common.c | 15 sound/usb/mixer.c | 3 tools/gpio/Build | 1 tools/gpio/Makefile | 10 tools/objtool/arch/x86/tools/gen-insn-attr-x86.awk | 4 tools/testing/selftests/x86/mov_ss_trap.c | 3 tools/testing/selftests/x86/sigreturn.c | 13 tools/usb/usbip/libsrc/usbip_host_common.c | 2 104 files changed, 1159 insertions(+), 489 deletions(-)
A Sun (1):
media: mceusb: fix out of bounds read in MCE receiver buffer
Adam Ford (1):
Revert "Bluetooth: hci_ll: set operational frequency earlier"
Adi Suresh (1):
gve: fix dma sync bug where not all pages synced
Alan Stern (2):
media: usbvision: Fix invalid accesses after device disconnect
media: usbvision: Fix races among open, close, and disconnect
Aleksander Morgado (2):
USB: serial: option: add support for DW5821e with eSIM support
USB: serial: option: add support for Foxconn T77W968 LTE modules
Alex Deucher (2):
drm/amdgpu: disable gfxoff when using register read interface drm/amdgpu: disable gfxoff on original raven
Alexander Kapshuk (1):
x86/insn: Fix awk regexp warnings
Alexander Popov (1):
media: vivid: Fix wrong locking that causes race conditions on streaming stop
Alexander Potapenko (1):
mm/slub.c: init_on_free=1 should wipe freelist ptr for bulk allocations
Andrey Ryabinin (1):
mm/ksm.c: don't WARN if page is still mapped in remove_stable_node()
Andy Lutomirski (7):
x86/doublefault/32: Fix stack canaries in the double fault handler x86/entry/32: Use %ss segment where required
x86/entry/32: Move FIXUP_FRAME after pushing %fs in SAVE_ALL x86/entry/32: Unwind the ESPFIX stack earlier on exception entry selftests/x86/mov_ss_trap: Fix the SYSENTER test selftests/x86/sigreturn/32: Invalidate DS and ES when abusing the kernel x86/entry/32: Fix FIXUP_ESPFIX_STACK with user CR3
Bernd Porr (1):
staging: comedi: usbduxfast: usbduxfast_ai_cmdtest rounding error
Bjorn Andersson (1):
ath10k: Fix HOST capability QMI incompatibility
Chester Lin (1):
ARM: 8904/1: skip nomap memblocks while finding the lowmem/highmem boundary
Chris Wilson (2):
drm/i915/pmu: "Frequency" is reported as accumulated cycles drm/i915/userptr: Try to acquire the page lock around set_page_dirty()
Christian Lamparter (1):
ath10k: restore QCA9880-AR1A (v1) detection
Christopher M. Riedl (1):
powerpc/64s: support nospectre_v2 cmdline option
Dan Carpenter (1):
net: rtnetlink: prevent underflows in do_setvfinfo()
David Hildenbrand (1):
mm/memory_hotplug: don't access uninitialized memmaps in shrink_zone_span()
Davide Caratti (1):
net/sched: act_pedit: fix WARN() in the traffic path
Denis Efremov (1):
ath9k_hw: fix uninitialized variable data
Eli Cohen (1):
net/mlx5e: Fix error flow cleanup in mlx5e_tc_tun_create_header_ipv4/6
Eran Ben Elisha (2):
net/mlxfw: Verify FSM error code translation doesn't exceed array size net/mlx5e: Do not use non-EXT link modes in EXT mode
Evan Quan (1):
drm/amd/powerplay: issue no PPSMC_MSG_GetCurrPkgPwr on unsupported ASICs
Geert Uytterhoeven (1):
mdio_bus: Fix init if CONFIG_RESET_CONTROLLER=n
Greg Kroah-Hartman (2):
usb-serial: cp201x: support Mark-10 digital force gauge Linux 5.3.14
Halil Pasic (1):
virtio_ring: fix return code on DMA mapping fails
Hangbin Liu (1):
ipv6/route: return if there is no fib_nh_gw_family
Hewenliang (1):
usbip: tools: fix fd leakage in the function of read_attr_usbip_status
Hui Peng (1):
ath10k: Fix a NULL-ptr-deref bug in ath10k_usb_alloc_urb_from_pipe
Ingo Molnar (1):
x86/pti/32: Calculate the various PTI cpu_entry_area sizes correctly, make the CPU_ENTRY_AREA_PAGES assert precise
Ivan Khoronzhuk (1):
taprio: don't reject same mqprio settings
Jan Beulich (3):
x86/stackframe/32: Repair 32-bit Xen PV
x86/xen/32: Make xen_iret_crit_fixup() independent of frame layout x86/xen/32: Simplify ring check in xen_iret_crit_fixup()
Johan Hovold (2):
USB: serial: mos7720: fix remote wakeup
USB: serial: mos7840: fix remote wakeup
John Pittman (1):
md/raid10: prevent access of uninitialized resync_pages offset
Joseph Qi (1):
Revert "fs: ocfs2: fix possible null-pointer dereferences in ocfs2_xa_prepare_entry()"
Kai Shen (1):
cpufreq: Add NULL checks to show() and store() methods of cpufreq
Laura Abbott (1):
tools: gpio: Correctly add make dependencies for gpio_utils
Laurent Pinchart (1):
media: uvcvideo: Fix error path in control parsing failure
Laurent Vivier (1):
virtio_console: allocate inbufs in add_port() only if it is needed
Luc Van Oostenryck (1):
fork: fix pidfd_poll()'s return type
Luigi Rizzo (1):
net/mlx4_en: fix mlx4 ethtool -N insertion
Maor Gottlieb (1):
net/mlx5: Fix auto group size calculation
Marcelo Ricardo Leitner (1):
net/ipv4: fix sysctl max for fib_multipath_hash_policy
Martin Habets (1):
sfc: Only cancel the PPS workqueue if it exists
Michael Ellerman (2):
powerpc/book3s64: Fix link stack flush on context switch
KVM: PPC: Book3S HV: Flush link stack on guest exit to host kernel
Mike Snitzer (1):
Revert "dm crypt: use WQ_HIGHPRI for the IO and crypt workqueues"
Navid Emamdoost (1):
nbd: prevent memory leak
Oliver Neukum (5):
nfc: port100: handle command failure cleanly
media: b2c2-flexcop-usb: add sanity checking
USBIP: add config dependency for SGL_ALLOC
USB: chaoskey: fix error case of a timeout
appledisplay: fix error handling in the scheduled work
Pavel Löbl (1):
USB: serial: mos7840: add USB ID to support Moxa UPort 2210
Peter Zijlstra (2):
x86/entry/32: Fix IRET exception
x86/entry/32: Fix NMI vs ESPFIX
Petr Machata (1):
mlxsw: spectrum_router: Fix determining underlay for a GRE tunnel
Roi Dayan (1):
net/mlx5e: Fix set vf link state error flow
Sean Young (1):
media: imon: invalid dereference in imon_touch_event
Shani Shapp (1):
net/mlx5: Update the list of the PCI supported devices
Stefano Garzarella (1):
vhost/vsock: split packets to send using multiple buffers
Sun Ke (1):
nbd:fix memory leak in nbd_get_socket()
Suwan Kim (1):
usbip: Fix uninitialized symbol 'nents' in stub_recv_cmd_submit()
Takashi Iwai (1):
ALSA: usb-audio: Fix NULL dereference at parsing BADD
Tariq Toukan (1):
net/mlx4_en: Fix wrong limitation for number of TX rings
Thierry Reding (2):
gpio: max77620: Fixup debounce delays
gpio: bd70528: Use correct unit for debounce times
Thomas Gleixner (2):
x86/pti/32: Size initial_page_table correctly x86/cpu_entry_area: Add guard page for entry stack on 32bit
Tomas Bortoli (1):
Bluetooth: Fix invalid-free in bcsp_close()
Vandana BN (1):
media: vivid: Set vid_cap_streaming and vid_out_streaming to true
Ville Syrjälä (1):
drm/i915: Don't oops in dumb_create ioctl if we have no crtcs
Vito Caputo (1):
media: cxusb: detect cxusb_ctrl_msg error in query
Waiman Long (2):
x86/speculation: Fix incorrect MDS/TAA mitigation status x86/speculation: Fix redundant MDS mitigation message
Wei Wang (1):
virtio_balloon: fix shrinker count
Willem de Bruijn (1):
net/tls: enable sk_msg redirect to tls socket egress
Xin Long (1):
net: sched: ensure opts_len <= IP_TUNNEL_OPTS_MAX in act_tunnel_key
Yang Tao (1):
futex: Prevent robust futex exit race
Greg KH
maintainerDocumentation/admin-guide/hw-vuln/mds.rst +5 -2
@@ -265,8 +265,11 @@ time with the option "mds=". The valid arguments for this option are: ============ ============================================================= -Not specifying this option is equivalent to "mds=full". - +Not specifying this option is equivalent to "mds=full". For processors +that are affected by both TAA (TSX Asynchronous Abort) and MDS, +specifying just "mds=off" without an accompanying "tsx_async_abort=off" +will have no effect as the same mitigation is used for both +vulnerabilities. Mitigation selection guide --------------------------
Documentation/admin-guide/hw-vuln/tsx_async_abort.rst +4 -1
@@ -174,7 +174,10 @@ the option "tsx_async_abort=". The valid arguments for this option are: CPU is not vulnerable to cross-thread TAA attacks. ============ ============================================================= -Not specifying this option is equivalent to "tsx_async_abort=full". +Not specifying this option is equivalent to "tsx_async_abort=full". For +processors that are affected by both TAA and MDS, specifying just +"tsx_async_abort=off" without an accompanying "mds=off" will have no +effect as the same mitigation is used for both vulnerabilities. The kernel command line also allows to control the TSX feature using the parameter "tsx=" on CPUs which support TSX control. MSR_IA32_TSX_CTRL is used
Documentation/admin-guide/kernel-parameters.txt +11 -0
@@ -2449,6 +2449,12 @@ SMT on vulnerable CPUs off - Unconditionally disable MDS mitigation + On TAA-affected machines, mds=off can be prevented by + an active TAA mitigation as both vulnerabilities are + mitigated with the same mechanism so in order to disable + this mitigation, you need to specify tsx_async_abort=off + too. + Not specifying this option is equivalent to mds=full.
@@ -4896,6 +4902,11 @@ vulnerable to cross-thread TAA attacks. off - Unconditionally disable TAA mitigation + On MDS-affected machines, tsx_async_abort=off can be + prevented by an active MDS mitigation as both vulnerabilities + are mitigated with the same mechanism so in order to disable + this mitigation, you need to specify mds=off too. + Not specifying this option is equivalent to tsx_async_abort=full. On CPUs which are MDS affected and deploy MDS mitigation, TAA mitigation is not
Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt +6 -0
@@ -81,6 +81,12 @@ Optional properties: Definition: Name of external front end module used. Some valid FEM names for example: "microsemi-lx5586", "sky85703-11" and "sky85803" etc. +- qcom,snoc-host-cap-8bit-quirk: + Usage: Optional + Value type: <empty> + Definition: Quirk specifying that the firmware expects the 8bit version + of the host capability QMI request + Example (to supply PCI based wifi block details):
Makefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 5 PATCHLEVEL = 3 -SUBLEVEL = 13 +SUBLEVEL = 14 EXTRAVERSION = NAME = Bobtail Squid
arch/arm/mm/mmu.c +3 -0
@@ -1197,6 +1197,9 @@ void __init adjust_lowmem_bounds(void)phys_addr_t block_start = reg->base;phys_addr_t block_end = reg->base + reg->size; +if (memblock_is_nomap (reg)) +continue ; +if (reg->base < vmalloc_limit) {if (block_end > lowmem_limit)/*
arch/powerpc/include/asm/asm-prototypes.h +3 -0
@@ -140,9 +140,12 @@ void _kvmppc_save_tm_pr(struct kvm_vcpu *vcpu, u64 guest_msr);/* Patch sites */ extern s32 patch__call_flush_count_cache;extern s32 patch__flush_count_cache_return; +extern s32 patch__flush_link_stack_return; +extern s32 patch__call_kvm_flush_link_stack;extern s32 patch__memset_nocache, patch__memcpy_nocache;extern long flush_count_cache; +extern long kvm_flush_link_stack;#ifdef CONFIG_PPC_TRANSACTIONAL_MEM void kvmppc_save_tm_hv (struct kvm_vcpu *vcpu,u64 msr,bool preserve_nv);
arch/powerpc/include/asm/security_features.h +3 -0
@@ -81,6 +81,9 @@ static inline bool security_ftr_enabled(unsigned long feature)// Software required to flush count cache on context switch #define SEC_FTR_FLUSH_COUNT_CACHE 0x0000000000000400ull +// Software required to flush link stack on context switch +#define SEC_FTR_FLUSH_LINK_STACK 0x0000000000001000ull +// Features enabled by default #define SEC_FTR_DEFAULT \
arch/powerpc/kernel/entry_64.S +6 -0
@@ -546,6 +546,7 @@ flush_count_cache: /* Save LR into r9 */ mflr r9 + // Flush the link stack .rept 64 bl .+4 .endr
@@ -555,6 +556,11 @@ flush_count_cache: .balign 32 /* Restore LR */ 1: mtlr r9 + + // If we're just flushing the link stack, return here +3: nop + patch_site 3b patch__flush_link_stack_return + li r9,0x7fff mtctr r9
arch/powerpc/kernel/security.c +68 -6
128 lines not on this page · raw message
arch/powerpc/kvm/book3s_hv_rmhandlers.S +30 -0
@@ -11,6 +11,7 @@ */ #include <asm/ppc_asm.h> +#include <asm/code-patching-asm.h> #include <asm/kvm_asm.h> #include <asm/reg.h> #include <asm/mmu.h>
@@ -1458,6 +1459,13 @@ guest_exit_cont: /* r9 = vcpu, r12 = trap, r13 = paca */ 1: #endif /* CONFIG_KVM_XICS */ + /* + * Possibly flush the link stack here, before we do a blr in + * guest_exit_short_path. + */ +1: nop + patch_site 1b patch__call_kvm_flush_link_stack + /* If we came in through the P9 short path, go back out to C now */ lwz r0, STACK_SLOT_SHORT_PATH(r1) cmpwi r0, 0
@@ -1933,6 +1941,28 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300) mtlr r0 blr +.balign 32 +.global kvm_flush_link_stack +kvm_flush_link_stack: + /* Save LR into r0 */ + mflr r0 + + /* Flush the link stack. On Power8 it's up to 32 entries in size. */ + .rept 32 + bl .+4 + .endr + + /* And on Power9 it's up to 64. */ +BEGIN_FTR_SECTION + .rept 32 + bl .+4 + .endr +END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300) + + /* Restore LR */ + mtlr r0 + blr + kvmppc_guest_external: /* External interrupt, first check for host_ipi. If this is * set, we know the host wants us out so let's do it now
arch/x86/entry/entry_32.S +133 -78
382 lines not on this page · raw message
arch/x86/include/asm/cpu_entry_area.h +12 -6
@@ -78,8 +78,12 @@ struct cpu_entry_area {/* * The GDT is just below entry_stack and thus serves (on x86_64) as -* a a read-only guard page. +* a read-only guard page. On 32-bit the GDT must be writeable, so +* it needs an extra guard page. */ +#ifdef CONFIG_X86_32 +char guard_entry_stack[PAGE_SIZE ]; +#endif struct entry_stack_page entry_stack_page;/*
@@ -94,7 +98,6 @@ struct cpu_entry_area {*/ struct cea_exception_stacks estacks;#endif -#ifdef CONFIG_CPU_SUP_INTEL /* * Per CPU debug store for Intel performance monitoring. Wastes a * full page at the moment.
@@ -105,11 +108,13 @@ struct cpu_entry_area {* Reserve enough fixmap PTEs. */ struct debug_store_buffers cpu_debug_buffers; -#endif }; -#define CPU_ENTRY_AREA_SIZE (sizeof(struct cpu_entry_area)) -#define CPU_ENTRY_AREA_TOT_SIZE (CPU_ENTRY_AREA_SIZE * NR_CPUS) +#define CPU_ENTRY_AREA_SIZE (sizeof(struct cpu_entry_area)) +#define CPU_ENTRY_AREA_ARRAY_SIZE (CPU_ENTRY_AREA_SIZE * NR_CPUS) + +/* Total size includes the readonly IDT mapping page as well: */ +#define CPU_ENTRY_AREA_TOTAL_SIZE (CPU_ENTRY_AREA_ARRAY_SIZE + PAGE_SIZE) DECLARE_PER_CPU(struct cpu_entry_area *, cpu_entry_area); DECLARE_PER_CPU(struct cea_exception_stacks *, cea_exception_stacks);
@@ -117,13 +122,14 @@ DECLARE_PER_CPU(struct cea_exception_stacks *, cea_exception_stacks);extern void setup_cpu_entry_areas (void );extern void cea_set_pte (void *cea_vaddr,phys_addr_t pa,pgprot_t flags); +/* Single page reserved for the readonly IDT mapping: */ #define CPU_ENTRY_AREA_RO_IDT CPU_ENTRY_AREA_BASE#define CPU_ENTRY_AREA_PER_CPU (CPU_ENTRY_AREA_RO_IDT + PAGE_SIZE)#define CPU_ENTRY_AREA_RO_IDT_VADDR ((void *)CPU_ENTRY_AREA_RO_IDT)#define CPU_ENTRY_AREA_MAP_SIZE \ - (CPU_ENTRY_AREA_PER_CPU + CPU_ENTRY_AREA_TOT_SIZE - CPU_ENTRY_AREA_BASE) + (CPU_ENTRY_AREA_PER_CPU + CPU_ENTRY_AREA_ARRAY_SIZE - CPU_ENTRY_AREA_BASE)extern struct cpu_entry_area *get_cpu_entry_area (int cpu);
arch/x86/include/asm/pgtable_32_types.h +4 -4
@@ -44,11 +44,11 @@ extern bool __vmalloc_start_set; /* set once high_memory is set */* Define this here and validate with BUILD_BUG_ON() in pgtable_32.c * to avoid include recursion hell */ -#define CPU_ENTRY_AREA_PAGES (NR_CPUS * 40) +#define CPU_ENTRY_AREA_PAGES (NR_CPUS * 39) -#define CPU_ENTRY_AREA_BASE \ - ((FIXADDR_TOT_START - PAGE_SIZE * (CPU_ENTRY_AREA_PAGES + 1)) \ - & PMD_MASK) +/* The +1 is for the readonly IDT page: */ +#define CPU_ENTRY_AREA_BASE \ + ((FIXADDR_TOT_START - PAGE_SIZE*(CPU_ENTRY_AREA_PAGES+1)) & PMD_MASK)#define LDT_BASE_ADDR \ ((CPU_ENTRY_AREA_BASE - PAGE_SIZE) & PMD_MASK)
arch/x86/include/asm/segment.h +12 -0
@@ -31,6 +31,18 @@*/ #define SEGMENT_RPL_MASK 0x3 +/* +* When running on Xen PV, the actual privilege level of the kernel is 1, +* not 0. Testing the Requested Privilege Level in a segment selector to +* determine whether the context is user mode or kernel mode with +* SEGMENT_RPL_MASK is wrong because the PV kernel's privilege level +* matches the 0x3 mask. +* +* Testing with USER_SEGMENT_RPL_MASK is valid for both native and Xen PV +* kernels because privilege level 2 is never used. +*/ +#define USER_SEGMENT_RPL_MASK 0x2 +/* User mode is privilege level 3: */ #define USER_RPL 0x3
arch/x86/kernel/cpu/bugs.c +28 -2
@@ -39,6 +39,7 @@ static void __init spectre_v2_select_mitigation(void);static void __init ssb_select_mitigation (void );static void __init l1tf_select_mitigation (void );static void __init mds_select_mitigation (void ); +static void __init mds_print_mitigation (void );static void __init taa_select_mitigation (void );/* The base value of the SPEC_CTRL MSR that always has to be preserved. */
@@ -108,6 +109,12 @@ void __init check_bugs(void)mds_select_mitigation ();taa_select_mitigation (); +/* +* As MDS and TAA mitigations are inter-related, print MDS +* mitigation until after TAA mitigation selection is done. +*/ +mds_print_mitigation (); +arch_smt_update ();#ifdef CONFIG_X86_32
@@ -245,6 +252,12 @@ static void __init mds_select_mitigation(void) (mds_nosmt || cpu_mitigations_auto_nosmt()))cpu_smt_disable (false); } +} + +static void __init mds_print_mitigation (void ) +{ +if (!boot_cpu_has_bug (X86_BUG_MDS ) ||cpu_mitigations_off ()) +return ;pr_info ("%s\n" , mds_strings[mds_mitigation]); }
@@ -304,8 +317,12 @@ static void __init taa_select_mitigation(void)return ; } -/* TAA mitigation is turned off on the cmdline (tsx_async_abort=off) */ -if (taa_mitigation ==TAA_MITIGATION_OFF ) +/* +* TAA mitigation via VERW is turned off if both +* tsx_async_abort=off and mds=off are specified. +*/ +if (taa_mitigation ==TAA_MITIGATION_OFF && + mds_mitigation ==MDS_MITIGATION_OFF ) goto out;if (boot_cpu_has (X86_FEATURE_MD_CLEAR ))
@@ -339,6 +356,15 @@ static void __init taa_select_mitigation(void)if (taa_nosmt ||cpu_mitigations_auto_nosmt ())cpu_smt_disable (false); +/* +* Update MDS mitigation, if necessary, as the mds_user_clear is +* now enabled for TAA mitigation. +*/ +if (mds_mitigation ==MDS_MITIGATION_OFF && +boot_cpu_has_bug (X86_BUG_MDS )) { + mds_mitigation =MDS_MITIGATION_FULL ; +mds_select_mitigation (); + } out:pr_info ("%s\n" , taa_strings[taa_mitigation]); }
arch/x86/kernel/doublefault.c +3 -0
@@ -65,6 +65,9 @@ struct x86_hw_tss doublefault_tss __cacheline_aligned = { .ss = __KERNEL_DS, .ds = __USER_DS, .fs = __KERNEL_PERCPU, +#ifndef CONFIG_X86_32_LAZY_GS + .gs = __KERNEL_STACK_CANARY, +#endif .__cr3 = __pa_nodebug(swapper_pg_dir), };
arch/x86/kernel/head_32.S +10 -0
@@ -571,6 +571,16 @@ ENTRY(initial_page_table) # error "Kernel PMDs should be 1, 2 or 3" # endif .align PAGE_SIZE /* needs to be page-sized too */ + +#ifdef CONFIG_PAGE_TABLE_ISOLATION + /* + * PTI needs another page so sync_initial_pagetable() works correctly + * and does not scribble over the data which is placed behind the + * actual initial_page_table. See clone_pgd_range(). + */ + .fill 1024, 4, 0 +#endif + #endif .data
arch/x86/mm/cpu_entry_area.c +3 -1
@@ -178,7 +178,9 @@ static __init void setup_cpu_entry_area_ptes(void)#ifdef CONFIG_X86_32 unsigned long start, end; -BUILD_BUG_ON (CPU_ENTRY_AREA_PAGES *PAGE_SIZE <CPU_ENTRY_AREA_MAP_SIZE ); +/* The +1 is for the readonly IDT: */ +BUILD_BUG_ON ((CPU_ENTRY_AREA_PAGES +1 )*PAGE_SIZE !=CPU_ENTRY_AREA_MAP_SIZE ); +BUILD_BUG_ON (CPU_ENTRY_AREA_TOTAL_SIZE !=CPU_ENTRY_AREA_MAP_SIZE );BUG_ON (CPU_ENTRY_AREA_BASE & ~PMD_MASK ); start =CPU_ENTRY_AREA_BASE ;
arch/x86/tools/gen-insn-attr-x86.awk +2 -2
@@ -69,7 +69,7 @@ BEGIN { lprefix1_expr = "\\((66|!F3)\\)" lprefix2_expr = "\\(F3\\)" - lprefix3_expr = "\\((F2|!F3|66\\&F2)\\)" + lprefix3_expr = "\\((F2|!F3|66&F2)\\)" lprefix_expr = "\\((66|F2|F3)\\)" max_lprefix = 4
@@ -257,7 +257,7 @@ function convert_operands(count,opnd, i,j,imm,mod) return add_flags(imm, mod) } -/^[0-9a-f]+\:/ { +/^[0-9a-f]+:/ { if (NR == 1) next # get index
arch/x86/xen/xen-asm_32.S +25 -50
105 lines not on this page · raw message
drivers/block/nbd.c +4 -2
@@ -956,6 +956,7 @@ static struct socket *nbd_get_socket(struct nbd_device *nbd, unsigned long fd,if (sock->ops->shutdown == sock_no_shutdown) {dev_err (disk_to_dev (nbd->disk),"Unsupported socket: shutdown callout must be supported.\n" ); *err = -EINVAL ; +sockfd_put (sock);return NULL ; }
@@ -994,14 +995,15 @@ static int nbd_add_socket(struct nbd_device *nbd, unsigned long arg,sockfd_put (sock);return -ENOMEM ; } + + config->socks = socks; + nsock =kzalloc (sizeof (struct nbd_sock ),GFP_KERNEL );if (!nsock) {sockfd_put (sock);return -ENOMEM ; } - config->socks = socks; - nsock->fallback_index =-1 ; nsock->dead = false;mutex_init (&nsock->tx_lock);
drivers/bluetooth/hci_bcsp.c +3 -0
@@ -591,6 +591,7 @@ static int bcsp_recv(struct hci_uart *hu, const void *data, int count)if (*ptr ==0xc0 ) {BT_ERR ("Short BCSP packet" );kfree_skb (bcsp->rx_skb); + bcsp->rx_skb =NULL ; bcsp->rx_state =BCSP_W4_PKT_START ; bcsp->rx_count =0 ; }else
@@ -606,6 +607,7 @@ static int bcsp_recv(struct hci_uart *hu, const void *data, int count) bcsp->rx_skb->data[2])) != bcsp->rx_skb->data[3]) {BT_ERR ("Error in BCSP hdr checksum" );kfree_skb (bcsp->rx_skb); + bcsp->rx_skb =NULL ; bcsp->rx_state =BCSP_W4_PKT_DELIMITER ; bcsp->rx_count =0 ;continue ;
@@ -630,6 +632,7 @@ static int bcsp_recv(struct hci_uart *hu, const void *data, int count) bscp_get_crc(bcsp));kfree_skb (bcsp->rx_skb); + bcsp->rx_skb =NULL ; bcsp->rx_state =BCSP_W4_PKT_DELIMITER ; bcsp->rx_count =0 ;continue ;
drivers/bluetooth/hci_ll.c +18 -21
@@ -621,13 +621,6 @@ static int ll_setup(struct hci_uart *hu)serdev_device_set_flow_control (serdev, true); -if (hu->oper_speed) - speed = hu->oper_speed; -else if (hu->proto->oper_speed) - speed = hu->proto->oper_speed; -else - speed =0 ; - do { /* Reset the Bluetooth device */ gpiod_set_value_cansleep(lldev->enable_gpio, 0);
@@ -639,20 +632,6 @@ static int ll_setup(struct hci_uart *hu)return err; } -if (speed) { -__le32 speed_le =cpu_to_le32 (speed); -struct sk_buff *skb; - - skb =__hci_cmd_sync (hu->hdev, -HCI_VS_UPDATE_UART_HCI_BAUDRATE , -sizeof (speed_le), &speed_le, -HCI_INIT_TIMEOUT ); -if (!IS_ERR (skb)) { -kfree_skb (skb); -serdev_device_set_baudrate (serdev, speed); - } - } - err =download_firmware (lldev);if (!err)break ;
@@ -677,7 +656,25 @@ static int ll_setup(struct hci_uart *hu) }/* Operational speed if any */ +if (hu->oper_speed) + speed = hu->oper_speed; +else if (hu->proto->oper_speed) + speed = hu->proto->oper_speed; +else + speed =0 ; + +if (speed) { +__le32 speed_le =cpu_to_le32 (speed); +struct sk_buff *skb; + skb =__hci_cmd_sync (hu->hdev,HCI_VS_UPDATE_UART_HCI_BAUDRATE , +sizeof (speed_le), &speed_le, +HCI_INIT_TIMEOUT ); +if (!IS_ERR (skb)) { +kfree_skb (skb); +serdev_device_set_baudrate (serdev, speed); + } + }return 0 ; }
drivers/char/virtio_console.c +13 -15
@@ -1325,24 +1325,24 @@ static void set_console_size(struct port *port, u16 rows, u16 cols) port->cons.ws.ws_col = cols; } -static unsigned int fill_queue (struct virtqueue *vq,spinlock_t *lock) +static int fill_queue (struct virtqueue *vq,spinlock_t *lock) {struct port_buffer *buf; -unsigned int nr_added_bufs; +int nr_added_bufs;int ret; nr_added_bufs =0 ; do { buf = alloc_buf(vq->vdev, PAGE_SIZE, 0); if (!buf) - break; + return -ENOMEM; spin_lock_irq(lock); ret = add_inbuf(vq, buf); if (ret < 0) { spin_unlock_irq(lock); free_buf(buf, true); - break; + return ret; } nr_added_bufs++; spin_unlock_irq(lock);
@@ -1362,7 +1362,6 @@ static int add_port(struct ports_device *portdev, u32 id)char debugfs_name[16 ];struct port *port;dev_t devt; -unsigned int nr_added_bufs;int err; port =kmalloc (sizeof (*port),GFP_KERNEL );
@@ -1421,11 +1420,13 @@ static int add_port(struct ports_device *portdev, u32 id)spin_lock_init (&port->outvq_lock);init_waitqueue_head (&port->waitqueue); -/* Fill the in_vq with buffers so the host can send us data. */ - nr_added_bufs =fill_queue (port->in_vq, &port->inbuf_lock); -if (!nr_added_bufs) { +/* We can safely ignore ENOSPC because it means +* the queue already has buffers. Buffers are removed +* only by virtcons_remove(), not by unplug_port() +*/ + err =fill_queue (port->in_vq, &port->inbuf_lock); +if (err <0 && err != -ENOSPC ) {dev_err (port->dev,"Error allocating inbufs\n" ); - err = -ENOMEM ; goto free_device; }
@@ -2059,14 +2060,11 @@ static int virtcons_probe(struct virtio_device *vdev)INIT_WORK (&portdev->control_work, &control_work_handler);if (multiport) { -unsigned int nr_added_bufs; -spin_lock_init (&portdev->c_ivq_lock);spin_lock_init (&portdev->c_ovq_lock); - nr_added_bufs =fill_queue (portdev->c_ivq, - &portdev->c_ivq_lock); -if (!nr_added_bufs) { + err =fill_queue (portdev->c_ivq, &portdev->c_ivq_lock); +if (err <0 ) {dev_err (&vdev->dev,"Error allocating buffers for control queue\n" );/*
@@ -2077,7 +2075,7 @@ static int virtcons_probe(struct virtio_device *vdev) VIRTIO_CONSOLE_DEVICE_READY, 0);/* Device was functional: we need full cleanup. */ virtcons_remove (vdev); -return -ENOMEM ; +return err; } }else {/*
drivers/cpufreq/cpufreq.c +6 -0
@@ -933,6 +933,9 @@ static ssize_t show(struct kobject *kobj, struct attribute *attr, char *buf)struct freq_attr *fattr =to_attr (attr);ssize_t ret; +if (!fattr->show) +return -EIO ; +down_read (&policy->rwsem); ret = fattr->show (policy, buf);up_read (&policy->rwsem);
@@ -947,6 +950,9 @@ static ssize_t store(struct kobject *kobj, struct attribute *attr,struct freq_attr *fattr =to_attr (attr);ssize_t ret = -EINVAL ; +if (!fattr->store) +return -EIO ; +/* * cpus_read_trylock() is used here to work around a circular lock * dependency problem with respect to the cpufreq_register_driver().
drivers/gpio/gpio-bd70528.c +3 -3
@@ -25,13 +25,13 @@ static int bd70528_set_debounce(struct bd70528_gpio *bdgpio,case 0 : val =BD70528_DEBOUNCE_DISABLE ;break ; - case 1 ... 15: + case 1 ... 15000: val =BD70528_DEBOUNCE_15MS ;break ; - case 16 ... 30: + case 15001 ... 30000: val =BD70528_DEBOUNCE_30MS ;break ; - case 31 ... 50: + case 30001 ... 50000: val =BD70528_DEBOUNCE_50MS ;break ;default :
drivers/gpio/gpio-max77620.c +3 -3
@@ -192,13 +192,13 @@ static int max77620_gpio_set_debounce(struct max77620_gpio *mgpio,case 0 : val = MAX77620_CNFG_GPIO_DBNC_None;break ; - case 1000 ... 8000: + case 1 ... 8000: val = MAX77620_CNFG_GPIO_DBNC_8ms;break ; - case 9000 ... 16000: + case 8001 ... 16000: val = MAX77620_CNFG_GPIO_DBNC_16ms;break ; - case 17000 ... 32000: + case 16001 ... 32000: val = MAX77620_CNFG_GPIO_DBNC_32ms;break ;default :
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +5 -1
@@ -635,15 +635,19 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_filereturn -ENOMEM ; alloc_size = info->read_mmr_reg.count *sizeof (*regs); -for (i =0 ; i < info->read_mmr_reg.count; i++) +amdgpu_gfx_off_ctrl (adev, false); +for (i =0 ; i < info->read_mmr_reg.count; i++) {if (amdgpu_asic_read_register (adev, se_num, sh_num, info->read_mmr_reg.dword_offset + i, ®s[i])) {DRM_DEBUG_KMS ("unallowed offset %#x\n" , info->read_mmr_reg.dword_offset + i);kfree (regs); +amdgpu_gfx_off_ctrl (adev, true);return -EFAULT ; } + } +amdgpu_gfx_off_ctrl (adev, true); n =copy_to_user (out, regs,min (size, alloc_size));kfree (regs);return n ? -EFAULT :0 ;
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +7 -2
@@ -596,8 +596,13 @@ static void gfx_v9_0_check_if_need_gfxoff(struct amdgpu_device *adev)case CHIP_VEGA20 :break ;case CHIP_RAVEN : - if (!(adev->rev_id >= 0x8 || adev->pdev->device == 0x15d8) - &&((adev->gfx.rlc_fw_version != 106 && +/* Disable GFXOFF on original raven. There are combinations +* of sbios and platforms that are not stable. +*/ +if (!(adev->rev_id >=0x8 || adev->pdev->device ==0x15d8 )) + adev->pm.pp_feature &= ~PP_GFXOFF_MASK ; + else if (!(adev->rev_id >= 0x8 || adev->pdev->device == 0x15d8) + &&((adev->gfx.rlc_fw_version != 106 && adev->gfx.rlc_fw_version < 531) || (adev->gfx.rlc_fw_version == 53815) || (adev->gfx.rlc_feature_version < 1) ||
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +18 -5
@@ -3477,18 +3477,31 @@ static int smu7_get_pp_table_entry(struct pp_hwmgr *hwmgr,static int smu7_get_gpu_power (struct pp_hwmgr *hwmgr,u32 *query) { +struct amdgpu_device *adev = hwmgr->adev;int i;u32 tmp =0 ;if (!query)return -EINVAL ; -smum_send_msg_to_smc_with_parameter (hwmgr, PPSMC_MSG_GetCurrPkgPwr,0 ); - tmp =cgs_read_register (hwmgr->device, mmSMC_MSG_ARG_0); - *query = tmp; +/* +* PPSMC_MSG_GetCurrPkgPwr is not supported on: +* - Hawaii +* - Bonaire +* - Fiji +* - Tonga +*/ +if ((adev->asic_type !=CHIP_HAWAII ) && + (adev->asic_type !=CHIP_BONAIRE ) && + (adev->asic_type !=CHIP_FIJI ) && + (adev->asic_type !=CHIP_TONGA )) { +smum_send_msg_to_smc_with_parameter (hwmgr, PPSMC_MSG_GetCurrPkgPwr,0 ); + tmp =cgs_read_register (hwmgr->device, mmSMC_MSG_ARG_0); + *query = tmp; -if (tmp !=0 ) -return 0 ; +if (tmp !=0 ) +return 0 ; + }smum_send_msg_to_smc (hwmgr, PPSMC_MSG_PmStatusLogStart); cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC,
drivers/gpu/drm/i915/display/intel_display.c +3 -0
@@ -2519,6 +2519,9 @@ u32 intel_plane_fb_max_stride(struct drm_i915_private *dev_priv,* the highest stride limits of them all. */ crtc =intel_get_crtc_for_pipe (dev_priv,PIPE_A ); +if (!crtc) +return 0 ; + plane =to_intel_plane (crtc->base.primary); return plane->max_stride(plane, pixel_format, modifier,
drivers/gpu/drm/i915/gem/i915_gem_userptr.c +21 -1
@@ -663,8 +663,28 @@ i915_gem_userptr_put_pages(struct drm_i915_gem_object *obj,i915_gem_gtt_finish_pages (obj, pages);for_each_sgt_page (page, sgt_iter, pages) { -if (obj->mm.dirty) +if (obj->mm.dirty &&trylock_page (page)) { +/* +* As this may not be anonymous memory (e.g. shmem) +* but exist on a real mapping, we have to lock +* the page in order to dirty it -- holding +* the page reference is not sufficient to +* prevent the inode from being truncated. +* Play safe and take the lock. +* +* However...! +* +* The mmu-notifier can be invalidated for a +* migrate_page, that is alreadying holding the lock +* on the page. Such a try_to_unmap() will result +* in us calling put_pages() and so recursively try +* to lock the page. We avoid that deadlock with +* a trylock_page() and in exchange we risk missing +* some page dirtying. +*/ set_page_dirty (page); +unlock_page (page); + }mark_page_accessed (page);put_page (page);
drivers/gpu/drm/i915/i915_pmu.c +2 -2
@@ -833,8 +833,8 @@ create_event_attributes(struct drm_i915_private *i915)const char *name;const char *unit; } events[] = { -__event (I915_PMU_ACTUAL_FREQUENCY ,"actual-frequency" ,"MHz" ), -__event (I915_PMU_REQUESTED_FREQUENCY ,"requested-frequency" ,"MHz" ), +__event (I915_PMU_ACTUAL_FREQUENCY ,"actual-frequency" ,"M" ), +__event (I915_PMU_REQUESTED_FREQUENCY ,"requested-frequency" ,"M" ),__event (I915_PMU_INTERRUPTS ,"interrupts" ,NULL ), __event(I915_PMU_RC6_RESIDENCY, "rc6-residency", "ns"), };
drivers/md/dm-crypt.c +3 -6
@@ -2911,21 +2911,18 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv) } ret = -ENOMEM ; - cc->io_queue =alloc_workqueue ("kcryptd_io/%s" , -WQ_HIGHPRI |WQ_CPU_INTENSIVE |WQ_MEM_RECLAIM , -1 , devname); + cc->io_queue =alloc_workqueue ("kcryptd_io/%s" ,WQ_MEM_RECLAIM ,1 , devname);if (!cc->io_queue) { ti->error ="Couldn't create kcryptd io queue" ; goto bad; }if (test_bit (DM_CRYPT_SAME_CPU , &cc->flags)) - cc->crypt_queue =alloc_workqueue ("kcryptd/%s" , -WQ_HIGHPRI |WQ_CPU_INTENSIVE |WQ_MEM_RECLAIM , + cc->crypt_queue =alloc_workqueue ("kcryptd/%s" ,WQ_CPU_INTENSIVE |WQ_MEM_RECLAIM ,1 , devname);else cc->crypt_queue =alloc_workqueue ("kcryptd/%s" , -WQ_HIGHPRI |WQ_CPU_INTENSIVE |WQ_MEM_RECLAIM |WQ_UNBOUND , +WQ_CPU_INTENSIVE |WQ_MEM_RECLAIM |WQ_UNBOUND ,num_online_cpus (), devname);if (!cc->crypt_queue) { ti->error ="Couldn't create kcryptd queue" ;
drivers/md/raid10.c +1 -1
@@ -191,7 +191,7 @@ static void * r10buf_pool_alloc(gfp_t gfp_flags, void *data) out_free_pages:while (--j >=0 ) -resync_free_pages (&rps[j *2 ]); +resync_free_pages (&rps[j]); j =0 ; out_free_bio:
drivers/media/platform/vivid/vivid-kthread-cap.c +5 -3
@@ -796,7 +796,11 @@ static int vivid_thread_vid_cap(void *data)if (kthread_should_stop ())break ; -mutex_lock (&dev->mutex); +if (!mutex_trylock (&dev->mutex)) { +schedule_timeout_uninterruptible (1 ); +continue ; + } + cur_jiffies = jiffies;if (dev->cap_seq_resync) { dev->jiffies_vid_cap = cur_jiffies;
@@ -956,8 +960,6 @@ void vivid_stop_generating_vid_cap(struct vivid_dev *dev, bool *pstreaming)/* shutdown control thread */ vivid_grab_controls (dev, false); -mutex_unlock (&dev->mutex);kthread_stop (dev->kthread_vid_cap); dev->kthread_vid_cap =NULL ; -mutex_lock (&dev->mutex); }
drivers/media/platform/vivid/vivid-kthread-out.c +5 -3
@@ -143,7 +143,11 @@ static int vivid_thread_vid_out(void *data)if (kthread_should_stop ())break ; -mutex_lock (&dev->mutex); +if (!mutex_trylock (&dev->mutex)) { +schedule_timeout_uninterruptible (1 ); +continue ; + } + cur_jiffies = jiffies;if (dev->out_seq_resync) { dev->jiffies_vid_out = cur_jiffies;
@@ -301,8 +305,6 @@ void vivid_stop_generating_vid_out(struct vivid_dev *dev, bool *pstreaming)/* shutdown control thread */ vivid_grab_controls (dev, false); -mutex_unlock (&dev->mutex);kthread_stop (dev->kthread_vid_out); dev->kthread_vid_out =NULL ; -mutex_lock (&dev->mutex); }
drivers/media/platform/vivid/vivid-sdr-cap.c +5 -3
@@ -141,7 +141,11 @@ static int vivid_thread_sdr_cap(void *data)if (kthread_should_stop ())break ; -mutex_lock (&dev->mutex); +if (!mutex_trylock (&dev->mutex)) { +schedule_timeout_uninterruptible (1 ); +continue ; + } + cur_jiffies = jiffies;if (dev->sdr_cap_seq_resync) { dev->jiffies_sdr_cap = cur_jiffies;
@@ -303,10 +307,8 @@ static void sdr_cap_stop_streaming(struct vb2_queue *vq) }/* shutdown control thread */ -mutex_unlock (&dev->mutex);kthread_stop (dev->kthread_sdr_cap); dev->kthread_sdr_cap =NULL ; -mutex_lock (&dev->mutex); }static void sdr_cap_buf_request_complete (struct vb2_buffer *vb)
drivers/media/platform/vivid/vivid-vid-cap.c +0 -3
@@ -223,9 +223,6 @@ static int vid_cap_start_streaming(struct vb2_queue *vq, unsigned count)if (vb2_is_streaming (&dev->vb_vid_out_q)) dev->can_loop_video =vivid_vid_can_loop (dev); -if (dev->kthread_vid_cap) -return 0 ; - dev->vid_cap_seq_count =0 ;dprintk (dev,1 ,"%s\n" , __func__);for (i =0 ; i <VIDEO_MAX_FRAME ; i++)
drivers/media/platform/vivid/vivid-vid-out.c +0 -3
@@ -161,9 +161,6 @@ static int vid_out_start_streaming(struct vb2_queue *vq, unsigned count)if (vb2_is_streaming (&dev->vb_vid_cap_q)) dev->can_loop_video =vivid_vid_can_loop (dev); -if (dev->kthread_vid_out) -return 0 ; - dev->vid_out_seq_count =0 ;dprintk (dev,1 ,"%s\n" , __func__);if (dev->start_streaming_error) {
drivers/media/rc/imon.c +1 -2
@@ -1598,8 +1598,7 @@ static void imon_incoming_packet(struct imon_context *ictx,spin_unlock_irqrestore (&ictx->kc_lock, flags);/* send touchscreen events through input subsystem if touchpad data */ -if (ictx->display_type ==IMON_DISPLAY_TYPE_VGA && len ==8 && - buf[7 ] ==0x86 ) { +if (ictx->touch && len ==8 && buf[7 ] ==0x86 ) {imon_touch_event (ictx, buf);return ;
drivers/media/rc/mceusb.c +98 -43
241 lines not on this page · raw message
drivers/media/usb/b2c2/flexcop-usb.c +3 -0
@@ -538,6 +538,9 @@ static int flexcop_usb_probe(struct usb_interface *intf,struct flexcop_device *fc =NULL ;int ret; +if (intf->cur_altsetting->desc.bNumEndpoints <1 ) +return -ENODEV ; +if ((fc =flexcop_device_kmalloc (sizeof (struct flexcop_usb ))) ==NULL ) {err ("out of memory\n" );return -ENOMEM ;
drivers/media/usb/dvb-usb/cxusb.c +2 -1
@@ -542,7 +542,8 @@ static int cxusb_rc_query(struct dvb_usb_device *d) {u8 ircode[4 ]; -cxusb_ctrl_msg (d,CMD_GET_IR_CODE ,NULL ,0 , ircode,4 ); +if (cxusb_ctrl_msg (d,CMD_GET_IR_CODE ,NULL ,0 , ircode,4 ) <0 ) +return 0 ;if (ircode[2 ] || ircode[3 ]) rc_keydown(d->rc_dev, RC_PROTO_NEC,
drivers/media/usb/usbvision/usbvision-video.c +24 -5
@@ -314,6 +314,10 @@ static int usbvision_v4l2_open(struct file *file)if (mutex_lock_interruptible (&usbvision->v4l2_lock))return -ERESTARTSYS ; +if (usbvision->remove_pending) { + err_code = -ENODEV ; + goto unlock; + }if (usbvision->user) { err_code = -EBUSY ; }else {
@@ -377,6 +381,7 @@ static int usbvision_v4l2_open(struct file *file)static int usbvision_v4l2_close (struct file *file) {struct usb_usbvision *usbvision =video_drvdata (file); +int r;PDEBUG (DBG_IO ,"close" );
@@ -391,9 +396,10 @@ static int usbvision_v4l2_close(struct file *file)usbvision_scratch_free (usbvision); usbvision->user--; + r = usbvision->remove_pending;mutex_unlock (&usbvision->v4l2_lock); -if (usbvision->remove_pending) { +if (r) {printk (KERN_INFO "%s: Final disconnect\n" , __func__);usbvision_release (usbvision);return 0 ;
@@ -453,6 +459,9 @@ static int vidioc_querycap(struct file *file, void *priv, {struct usb_usbvision *usbvision =video_drvdata (file); +if (!usbvision->dev) +return -ENODEV ; +strscpy (vc->driver,"USBVision" ,sizeof (vc->driver)); strscpy(vc->card, usbvision_device_data[usbvision->dev_model].model_string,
@@ -1073,6 +1082,11 @@ static int usbvision_radio_open(struct file *file)if (mutex_lock_interruptible (&usbvision->v4l2_lock))return -ERESTARTSYS ; + +if (usbvision->remove_pending) { + err_code = -ENODEV ; + goto out; + } err_code =v4l2_fh_open (file);if (err_code) goto out;
@@ -1105,21 +1119,24 @@ static int usbvision_radio_open(struct file *file)static int usbvision_radio_close (struct file *file) {struct usb_usbvision *usbvision =video_drvdata (file); +int r;PDEBUG (DBG_IO ,"" );mutex_lock (&usbvision->v4l2_lock);/* Set packet size to 0 */ usbvision->iface_alt =0 ; -usb_set_interface (usbvision->dev, usbvision->iface, - usbvision->iface_alt); +if (usbvision->dev) +usb_set_interface (usbvision->dev, usbvision->iface, + usbvision->iface_alt);usbvision_audio_off (usbvision); usbvision->radio =0 ; usbvision->user--; + r = usbvision->remove_pending;mutex_unlock (&usbvision->v4l2_lock); -if (usbvision->remove_pending) { +if (r) {printk (KERN_INFO "%s: Final disconnect\n" , __func__);v4l2_fh_release (file);usbvision_release (usbvision);
@@ -1551,6 +1568,7 @@ static int usbvision_probe(struct usb_interface *intf,static void usbvision_disconnect (struct usb_interface *intf) {struct usb_usbvision *usbvision =to_usbvision (usb_get_intfdata (intf)); +int u;PDEBUG (DBG_PROBE ,"" );
@@ -1567,13 +1585,14 @@ static void usbvision_disconnect(struct usb_interface *intf)v4l2_device_disconnect (&usbvision->v4l2_dev);usbvision_i2c_unregister (usbvision); usbvision->remove_pending =1 ;/* Now all ISO data will be ignored */ + u = usbvision->user;usb_put_dev (usbvision->dev); usbvision->dev =NULL ;/* USB device is no more */ mutex_unlock (&usbvision->v4l2_lock); -if (usbvision->user) { +if (u) {printk (KERN_INFO "%s: In use, disconnect pending\n" , __func__);wake_up_interruptible (&usbvision->wait_frame);
drivers/media/usb/uvc/uvc_driver.c +15 -13
@@ -2151,6 +2151,20 @@ static int uvc_probe(struct usb_interface *intf, sizeof(dev->name) - len); } +/* Initialize the media device. */ +#ifdef CONFIG_MEDIA_CONTROLLER + dev->mdev.dev = &intf->dev; +strscpy (dev->mdev.model, dev->name,sizeof (dev->mdev.model)); +if (udev->serial) +strscpy (dev->mdev.serial, udev->serial, +sizeof (dev->mdev.serial)); +usb_make_path (udev, dev->mdev.bus_info,sizeof (dev->mdev.bus_info)); + dev->mdev.hw_revision =le16_to_cpu (udev->descriptor.bcdDevice); +media_device_init (&dev->mdev); + + dev->vdev.mdev = &dev->mdev; +#endif +/* Parse the Video Class control descriptor. */ if (uvc_parse_control (dev) <0 ) { uvc_trace(UVC_TRACE_PROBE, "Unable to parse UVC "
@@ -2171,19 +2185,7 @@ static int uvc_probe(struct usb_interface *intf, "linux-uvc-devel mailing list.\n"); } -/* Initialize the media device and register the V4L2 device. */ -#ifdef CONFIG_MEDIA_CONTROLLER - dev->mdev.dev = &intf->dev; -strscpy (dev->mdev.model, dev->name,sizeof (dev->mdev.model)); -if (udev->serial) -strscpy (dev->mdev.serial, udev->serial, -sizeof (dev->mdev.serial)); -usb_make_path (udev, dev->mdev.bus_info,sizeof (dev->mdev.bus_info)); - dev->mdev.hw_revision =le16_to_cpu (udev->descriptor.bcdDevice); -media_device_init (&dev->mdev); - - dev->vdev.mdev = &dev->mdev; -#endif +/* Register the V4L2 device. */ if (v4l2_device_register (&intf->dev, &dev->vdev) <0 ) goto error;
drivers/net/ethernet/google/gve/gve_tx.c +5 -4
@@ -393,12 +393,13 @@ static void gve_tx_fill_seg_desc(union gve_tx_desc *seg_desc,static void gve_dma_sync_for_device (struct device *dev,dma_addr_t *page_buses,u64 iov_offset,u64 iov_len) { +u64 last_page = (iov_offset + iov_len -1 ) /PAGE_SIZE ; +u64 first_page = iov_offset /PAGE_SIZE ;dma_addr_t dma; -u64 addr; +u64 page; -for (addr = iov_offset; addr < iov_offset + iov_len; - addr +=PAGE_SIZE ) { - dma = page_buses[addr /PAGE_SIZE ]; +for (page = first_page; page <= last_page; page++) { + dma = page_buses[page];dma_sync_single_for_device (dev, dma,PAGE_SIZE ,DMA_TO_DEVICE ); } }
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c +5 -4
@@ -1745,6 +1745,7 @@ static int mlx4_en_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd, err =mlx4_en_get_flow (dev, cmd, cmd->fs.location);break ;case ETHTOOL_GRXCLSRLALL : + cmd->data =MAX_NUM_OF_FS_RULES ;while ((!err || err == -ENOENT ) && priority < cmd->rule_cnt) { err =mlx4_en_get_flow (dev, cmd, i);if (!err)
@@ -1811,6 +1812,7 @@ static int mlx4_en_set_channels(struct net_device *dev,struct mlx4_en_dev *mdev = priv->mdev;struct mlx4_en_port_profile new_prof;struct mlx4_en_priv *tmp; +int total_tx_count;int port_up =0 ;int xdp_count;int err =0 ;
@@ -1825,13 +1827,12 @@ static int mlx4_en_set_channels(struct net_device *dev,mutex_lock (&mdev->state_lock); xdp_count = priv->tx_ring_num[TX_XDP ] ? channel->rx_count :0 ; -if (channel->tx_count * priv->prof->num_up + xdp_count > - priv->mdev->profile.max_num_tx_rings_p_up * priv->prof->num_up) { + total_tx_count = channel->tx_count * priv->prof->num_up + xdp_count; +if (total_tx_count >MAX_TX_RINGS ) { err = -EINVAL ;en_err (priv,"Total number of TX and XDP rings (%d) exceeds the maximum supported (%d)\n" , - channel->tx_count * priv->prof->num_up + xdp_count, -MAX_TX_RINGS ); + total_tx_count,MAX_TX_RINGS ); goto out; }
drivers/net/ethernet/mellanox/mlx4/en_netdev.c +9 -0
@@ -91,6 +91,7 @@ int mlx4_en_alloc_tx_queue_per_tc(struct net_device *dev, u8 tc)struct mlx4_en_dev *mdev = priv->mdev;struct mlx4_en_port_profile new_prof;struct mlx4_en_priv *tmp; +int total_count;int port_up =0 ;int err =0 ;
@@ -104,6 +105,14 @@ int mlx4_en_alloc_tx_queue_per_tc(struct net_device *dev, u8 tc)MLX4_EN_NUM_UP_HIGH ; new_prof.tx_ring_num[TX ] = new_prof.num_tx_rings_p_up * new_prof.num_up; + total_count = new_prof.tx_ring_num[TX ] + new_prof.tx_ring_num[TX_XDP ]; +if (total_count >MAX_TX_RINGS ) { + err = -EINVAL ; +en_err (priv, +"Total number of TX and XDP rings (%d) exceeds the maximum supported (%d)\n" , + total_count,MAX_TX_RINGS ); + goto out; + } err =mlx4_en_try_alloc_resources (priv, tmp, &new_prof, true);if (err) goto out;
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c +12 -6
@@ -232,12 +232,15 @@ int mlx5e_tc_tun_create_header_ipv4(struct mlx5e_priv *priv,if (max_encap_size < ipv4_encap_size) {mlx5_core_warn (priv->mdev,"encap size %d too big, max supported is %d\n" , ipv4_encap_size, max_encap_size); -return -EOPNOTSUPP ; + err = -EOPNOTSUPP ; + goto out; } encap_header =kzalloc (ipv4_encap_size,GFP_KERNEL ); -if (!encap_header) -return -ENOMEM ; +if (!encap_header) { + err = -ENOMEM ; + goto out; + }/* used by mlx5e_detach_encap to lookup a neigh hash table * entry in the neigh hash table when a user deletes a rule
@@ -348,12 +351,15 @@ int mlx5e_tc_tun_create_header_ipv6(struct mlx5e_priv *priv,if (max_encap_size < ipv6_encap_size) {mlx5_core_warn (priv->mdev,"encap size %d too big, max supported is %d\n" , ipv6_encap_size, max_encap_size); -return -EOPNOTSUPP ; + err = -EOPNOTSUPP ; + goto out; } encap_header =kzalloc (ipv6_encap_size,GFP_KERNEL ); -if (!encap_header) -return -ENOMEM ; +if (!encap_header) { + err = -ENOMEM ; + goto out; + }/* used by mlx5e_detach_encap to lookup a neigh hash table * entry in the neigh hash table when a user deletes a rule
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +6 -6
@@ -708,9 +708,9 @@ static int get_fec_supported_advertised(struct mlx5_core_dev *dev,static void ptys2ethtool_supported_advertised_port (struct ethtool_link_ksettings *link_ksettings,u32 eth_proto_cap, -u8 connector_type) +u8 connector_type,bool ext) { -if (!connector_type || connector_type >=MLX5E_CONNECTOR_TYPE_NUMBER ) { +if ((!connector_type && !ext) || connector_type >=MLX5E_CONNECTOR_TYPE_NUMBER ) { if (eth_proto_cap & (MLX5E_PROT_MASK(MLX5E_10GBASE_CR) | MLX5E_PROT_MASK(MLX5E_10GBASE_SR) | MLX5E_PROT_MASK(MLX5E_40GBASE_CR4)
@@ -842,9 +842,9 @@ static int ptys2connector_type[MLX5E_CONNECTOR_TYPE_NUMBER] = { [MLX5E_PORT_OTHER] = PORT_OTHER, }; -static u8 get_connector_port (u32 eth_proto,u8 connector_type) +static u8 get_connector_port (u32 eth_proto,u8 connector_type,bool ext) { -if (connector_type && connector_type <MLX5E_CONNECTOR_TYPE_NUMBER ) +if ((connector_type || ext) && connector_type <MLX5E_CONNECTOR_TYPE_NUMBER )return ptys2connector_type[connector_type]; if (eth_proto &
@@ -945,9 +945,9 @@ int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv, eth_proto_oper = eth_proto_oper ? eth_proto_oper : eth_proto_cap; link_ksettings->base.port =get_connector_port (eth_proto_oper, - connector_type); + connector_type, ext);ptys2ethtool_supported_advertised_port (link_ksettings, eth_proto_admin, - connector_type); + connector_type, ext);get_lp_advertising (mdev, eth_proto_lp, link_ksettings);if (an_status ==MLX5_AN_COMPLETE )
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +1 -1
@@ -2044,7 +2044,7 @@ int mlx5_eswitch_set_vport_state(struct mlx5_eswitch *esw, unlock:mutex_unlock (&esw->state_lock); -return 0 ; +return err; } int mlx5_eswitch_get_vport_config(struct mlx5_eswitch *esw,
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +6 -4
@@ -549,7 +549,7 @@ static void del_sw_flow_group(struct fs_node *node)rhashtable_destroy (&fg->ftes_hash);ida_destroy (&fg->fte_allocator); -if (ft->autogroup.active) +if (ft->autogroup.active && fg->max_ftes == ft->autogroup.group_size) ft->autogroup.num_groups--; err = rhltable_remove(&ft->fgs_hash, &fg->hash,
@@ -1095,6 +1095,8 @@ mlx5_create_auto_grouped_flow_table(struct mlx5_flow_namespace *ns, ft->autogroup.active = true; ft->autogroup.required_groups = max_num_groups; +/* We save place for flow groups in addition to max types */ + ft->autogroup.group_size = ft->max_fte / (max_num_groups +1 );return ft; }
@@ -1297,8 +1299,7 @@ static struct mlx5_flow_group *alloc_auto_flow_group(struct mlx5_flow_table *ftreturn ERR_PTR (-ENOENT );if (ft->autogroup.num_groups < ft->autogroup.required_groups) -/* We save place for flow groups in addition to max types */ - group_size = ft->max_fte / (ft->autogroup.required_groups +1 ); + group_size = ft->autogroup.group_size;/* ft->max_fte == ft->autogroup.max_types */ if (group_size ==0 )
@@ -1325,7 +1326,8 @@ static struct mlx5_flow_group *alloc_auto_flow_group(struct mlx5_flow_table *ftif (IS_ERR (fg)) goto out; - ft->autogroup.num_groups++; +if (group_size == ft->autogroup.group_size) + ft->autogroup.num_groups++; out:return fg;
drivers/net/ethernet/mellanox/mlx5/core/fs_core.h +1 -0
@@ -137,6 +137,7 @@ struct mlx5_flow_table {struct {bool active;unsigned int required_groups; +unsigned int group_size;unsigned int num_groups; } autogroup;/* Protect fwd_rules */
drivers/net/ethernet/mellanox/mlx5/core/main.c +1 -0
@@ -1552,6 +1552,7 @@ static const struct pci_device_id mlx5_core_pci_table[] = { { PCI_VDEVICE(MELLANOX, 0x101c), MLX5_PCI_DEV_IS_VF}, /* ConnectX-6 VF */ { PCI_VDEVICE(MELLANOX, 0x101d) }, /* ConnectX-6 Dx */ { PCI_VDEVICE(MELLANOX, 0x101e), MLX5_PCI_DEV_IS_VF}, /* ConnectX Family mlx5Gen Virtual Function */ + { PCI_VDEVICE(MELLANOX, 0x101f) }, /* ConnectX-6 LX */ { PCI_VDEVICE(MELLANOX, 0xa2d2) }, /* BlueField integrated ConnectX-5 network controller */ { PCI_VDEVICE(MELLANOX, 0xa2d3), MLX5_PCI_DEV_IS_VF}, /* BlueField integrated ConnectX-5 network controller VF */ { PCI_VDEVICE(MELLANOX, 0xa2d6) }, /* BlueField-2 integrated ConnectX-6 Dx network controller */
drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c +2 -0
@@ -66,6 +66,8 @@ static int mlxfw_fsm_state_wait(struct mlxfw_dev *mlxfw_dev, u32 fwhandle,return err;if (fsm_state_err !=MLXFW_FSM_STATE_ERR_OK ) { + fsm_state_err = min_t(enum mlxfw_fsm_state_err, + fsm_state_err,MLXFW_FSM_STATE_ERR_MAX );pr_err ("Firmware flash failed: %s\n" , mlxfw_fsm_state_err_str[fsm_state_err]);NL_SET_ERR_MSG_MOD (extack,"Firmware flash failed" );
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +1 -18
@@ -994,7 +994,7 @@ u32 mlxsw_sp_ipip_dev_ul_tb_id(const struct net_device *ol_dev)if (d)return l3mdev_fib_table (d) ? :RT_TABLE_MAIN ;else -return l3mdev_fib_table (ol_dev) ? :RT_TABLE_MAIN ; +return RT_TABLE_MAIN ; } static struct mlxsw_sp_rif *
@@ -1598,27 +1598,10 @@ static int mlxsw_sp_netdevice_ipip_ol_vrf_event(struct mlxsw_sp *mlxsw_sp, {struct mlxsw_sp_ipip_entry *ipip_entry =mlxsw_sp_ipip_entry_find_by_ol_dev (mlxsw_sp, ol_dev); -enum mlxsw_sp_l3proto ul_proto; -union mlxsw_sp_l3addr saddr; -u32 ul_tb_id;if (!ipip_entry)return 0 ; -/* For flat configuration cases, moving overlay to a different VRF might -* cause local address conflict, and the conflicting tunnels need to be -* demoted. -*/ - ul_tb_id =mlxsw_sp_ipip_dev_ul_tb_id (ol_dev); - ul_proto = mlxsw_sp->router->ipip_ops_arr[ipip_entry->ipipt]->ul_proto; - saddr =mlxsw_sp_ipip_netdev_saddr (ul_proto, ol_dev); -if (mlxsw_sp_ipip_demote_tunnel_by_saddr (mlxsw_sp, ul_proto, - saddr, ul_tb_id, - ipip_entry)) { -mlxsw_sp_ipip_entry_demote_tunnel (mlxsw_sp, ipip_entry); -return 0 ; - } -return __mlxsw_sp_ipip_entry_update_tunnel (mlxsw_sp, ipip_entry, true, false, false, extack); }
drivers/net/ethernet/sfc/ptp.c +2 -1
@@ -1531,7 +1531,8 @@ void efx_ptp_remove(struct efx_nic *efx) (void )efx_ptp_disable (efx);cancel_work_sync (&efx->ptp_data->work); -cancel_work_sync (&efx->ptp_data->pps_work); +if (efx->ptp_data->pps_workwq) +cancel_work_sync (&efx->ptp_data->pps_work);skb_queue_purge (&efx->ptp_data->rxq);skb_queue_purge (&efx->ptp_data->txq);
drivers/net/phy/mdio_bus.c +6 -5
@@ -68,11 +68,12 @@ static int mdiobus_register_reset(struct mdio_device *mdiodev)if (mdiodev->dev.of_node) reset =devm_reset_control_get_exclusive (&mdiodev->dev,"phy" ); -if (PTR_ERR (reset) == -ENOENT || -PTR_ERR (reset) == -ENOTSUPP ) - reset =NULL ; -else if (IS_ERR (reset)) -return PTR_ERR (reset); +if (IS_ERR (reset)) { +if (PTR_ERR (reset) == -ENOENT ||PTR_ERR (reset) == -ENOTSUPP ) + reset =NULL ; +else +return PTR_ERR (reset); + } mdiodev->reset_ctrl = reset;
drivers/net/wireless/ath/ath10k/pci.c +25 -11
@@ -3490,7 +3490,7 @@ static int ath10k_pci_probe(struct pci_dev *pdev,struct ath10k_pci *ar_pci;enum ath10k_hw_rev hw_rev;struct ath10k_bus_params bus_params = {}; -bool pci_ps; +bool pci_ps, is_qca988x = false;int (*pci_soft_reset)(struct ath10k *ar);int (*pci_hard_reset)(struct ath10k *ar);u32 (*targ_cpu_to_ce_addr)(struct ath10k *ar,u32 addr);
@@ -3500,6 +3500,7 @@ static int ath10k_pci_probe(struct pci_dev *pdev,case QCA988X_2_0_DEVICE_ID : hw_rev =ATH10K_HW_QCA988X ; pci_ps = false; + is_qca988x = true; pci_soft_reset = ath10k_pci_warm_reset; pci_hard_reset = ath10k_pci_qca988x_chip_reset; targ_cpu_to_ce_addr = ath10k_pci_qca988x_targ_cpu_to_ce_addr;
@@ -3619,25 +3620,34 @@ static int ath10k_pci_probe(struct pci_dev *pdev, goto err_deinit_irq; } + bus_params.dev_type =ATH10K_DEV_TYPE_LL ; + bus_params.link_can_suspend = true; +/* Read CHIP_ID before reset to catch QCA9880-AR1A v1 devices that +* fall off the bus during chip_reset. These chips have the same pci +* device id as the QCA9880 BR4A or 2R4E. So that's why the check. +*/ +if (is_qca988x) { + bus_params.chip_id = +ath10k_pci_soc_read32 (ar,SOC_CHIP_ID_ADDRESS ); +if (bus_params.chip_id !=0xffffffff ) { +if (!ath10k_pci_chip_is_supported (pdev->device, + bus_params.chip_id)) + goto err_unsupported; + } + } + ret =ath10k_pci_chip_reset (ar);if (ret) {ath10k_err (ar,"failed to reset chip: %d\n" , ret); goto err_free_irq; } - bus_params.dev_type =ATH10K_DEV_TYPE_LL ; - bus_params.link_can_suspend = true; bus_params.chip_id =ath10k_pci_soc_read32 (ar,SOC_CHIP_ID_ADDRESS ); -if (bus_params.chip_id ==0xffffffff ) { -ath10k_err (ar,"failed to get chip id\n" ); - goto err_free_irq; - } +if (bus_params.chip_id ==0xffffffff ) + goto err_unsupported; -if (!ath10k_pci_chip_is_supported (pdev->device, bus_params.chip_id)) { -ath10k_err (ar,"device %04x with chip_id %08x isn't supported\n" , - pdev->device, bus_params.chip_id); +if (!ath10k_pci_chip_is_supported (pdev->device, bus_params.chip_id)) goto err_free_irq; - } ret =ath10k_core_register (ar, &bus_params);if (ret) {
@@ -3647,6 +3657,10 @@ static int ath10k_pci_probe(struct pci_dev *pdev,return 0 ; +err_unsupported: +ath10k_err (ar,"device %04x with chip_id %08x isn't supported\n" , + pdev->device, bus_params.chip_id); + err_free_irq:ath10k_pci_free_irq (ar);ath10k_pci_rx_retry_sync (ar);
drivers/net/wireless/ath/ath10k/qmi.c +10 -3
@@ -581,22 +581,29 @@ static int ath10k_qmi_host_cap_send_sync(struct ath10k_qmi *qmi) {struct wlfw_host_cap_resp_msg_v01 resp = {};struct wlfw_host_cap_req_msg_v01 req = {}; +struct qmi_elem_info *req_ei;struct ath10k *ar = qmi->ar; +struct ath10k_snoc *ar_snoc =ath10k_snoc_priv (ar);struct qmi_txn txn;int ret; req.daemon_support_valid =1 ; req.daemon_support =0 ; - ret =qmi_txn_init (&qmi->qmi_hdl, &txn, - wlfw_host_cap_resp_msg_v01_ei, &resp); + ret =qmi_txn_init (&qmi->qmi_hdl, &txn, wlfw_host_cap_resp_msg_v01_ei, + &resp);if (ret <0 ) goto out; +if (test_bit (ATH10K_SNOC_FLAG_8BIT_HOST_CAP_QUIRK , &ar_snoc->flags)) + req_ei = wlfw_host_cap_8bit_req_msg_v01_ei; +else + req_ei = wlfw_host_cap_req_msg_v01_ei; + ret =qmi_send_request (&qmi->qmi_hdl,NULL , &txn,QMI_WLFW_HOST_CAP_REQ_V01 ,WLFW_HOST_CAP_REQ_MSG_V01_MAX_MSG_LEN , - wlfw_host_cap_req_msg_v01_ei, &req); + req_ei, &req);if (ret <0 ) {qmi_txn_cancel (&txn);ath10k_err (ar,"failed to send host capability request: %d\n" , ret);
drivers/net/wireless/ath/ath10k/qmi_wlfw_v01.c +22 -0
@@ -1988,6 +1988,28 @@ struct qmi_elem_info wlfw_host_cap_req_msg_v01_ei[] = { {} }; +struct qmi_elem_info wlfw_host_cap_8bit_req_msg_v01_ei[] = { + { + .data_type =QMI_OPT_FLAG , + .elem_len =1 , + .elem_size =sizeof (u8), + .array_type =NO_ARRAY , + .tlv_type =0x10 , + .offset = offsetof(struct wlfw_host_cap_req_msg_v01 , + daemon_support_valid), + }, + { + .data_type =QMI_UNSIGNED_1_BYTE , + .elem_len =1 , + .elem_size =sizeof (u8), + .array_type =NO_ARRAY , + .tlv_type =0x10 , + .offset = offsetof(struct wlfw_host_cap_req_msg_v01 , + daemon_support), + }, + {} +}; +struct qmi_elem_info wlfw_host_cap_resp_msg_v01_ei[] = { { .data_type =QMI_STRUCT ,
drivers/net/wireless/ath/ath10k/qmi_wlfw_v01.h +1 -0
@@ -575,6 +575,7 @@ struct wlfw_host_cap_req_msg_v01 {#define WLFW_HOST_CAP_REQ_MSG_V01_MAX_MSG_LEN 189extern struct qmi_elem_info wlfw_host_cap_req_msg_v01_ei[]; +extern struct qmi_elem_info wlfw_host_cap_8bit_req_msg_v01_ei[];struct wlfw_host_cap_resp_msg_v01 {struct qmi_response_type_v01 resp;
drivers/net/wireless/ath/ath10k/snoc.c +11 -0
@@ -1261,6 +1261,15 @@ static int ath10k_snoc_resource_init(struct ath10k *ar)return ret; } +static void ath10k_snoc_quirks_init (struct ath10k *ar) +{ +struct ath10k_snoc *ar_snoc =ath10k_snoc_priv (ar); +struct device *dev = &ar_snoc->dev->dev; + +if (of_property_read_bool (dev->of_node,"qcom,snoc-host-cap-8bit-quirk" )) +set_bit (ATH10K_SNOC_FLAG_8BIT_HOST_CAP_QUIRK , &ar_snoc->flags); +} +int ath10k_snoc_fw_indication (struct ath10k *ar,u64 type) {struct ath10k_snoc *ar_snoc =ath10k_snoc_priv (ar);
@@ -1678,6 +1687,8 @@ static int ath10k_snoc_probe(struct platform_device *pdev) ar->ce_priv = &ar_snoc->ce; msa_size = drv_data->msa_size; +ath10k_snoc_quirks_init (ar); + ret =ath10k_snoc_resource_init (ar);if (ret) {ath10k_warn (ar,"failed to initialize resource: %d\n" , ret);
drivers/net/wireless/ath/ath10k/snoc.h +1 -0
@@ -63,6 +63,7 @@ enum ath10k_snoc_flags {ATH10K_SNOC_FLAG_REGISTERED ,ATH10K_SNOC_FLAG_UNREGISTERING ,ATH10K_SNOC_FLAG_RECOVERY , + ATH10K_SNOC_FLAG_8BIT_HOST_CAP_QUIRK, }; struct ath10k_snoc {
drivers/net/wireless/ath/ath10k/usb.c +8 -0
@@ -38,6 +38,10 @@ ath10k_usb_alloc_urb_from_pipe(struct ath10k_usb_pipe *pipe)struct ath10k_urb_context *urb_context =NULL ;unsigned long flags; +/* bail if this pipe is not initialized */ +if (!pipe->ar_usb) +return NULL ; +spin_lock_irqsave (&pipe->ar_usb->cs_lock, flags);if (!list_empty (&pipe->urb_list_head)) { urb_context = list_first_entry(&pipe->urb_list_head,
@@ -55,6 +59,10 @@ static void ath10k_usb_free_urb_to_pipe(struct ath10k_usb_pipe *pipe, {unsigned long flags; +/* bail if this pipe is not initialized */ +if (!pipe->ar_usb) +return ; +spin_lock_irqsave (&pipe->ar_usb->cs_lock, flags); pipe->urb_cnt++;
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +1 -1
@@ -4183,7 +4183,7 @@ static void ar9003_hw_thermometer_apply(struct ath_hw *ah)static void ar9003_hw_thermo_cal_apply (struct ath_hw *ah) { -u32 data, ko, kg; +u32 data =0 , ko, kg;if (!AR_SREV_9462_20_OR_LATER (ah))return ;
drivers/nfc/port100.c +1 -1
@@ -783,7 +783,7 @@ static int port100_send_frame_async(struct port100 *dev, struct sk_buff *out, rc =port100_submit_urb_for_ack (dev,GFP_KERNEL );if (rc) -usb_unlink_urb (dev->out_urb); +usb_kill_urb (dev->out_urb); exit:mutex_unlock (&dev->out_urb_lock);
drivers/staging/comedi/drivers/usbduxfast.c +14 -7
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0+ /* -* Copyright (C) 2004-2014 Bernd Porr, [email protected] +* Copyright (C) 2004-2019 Bernd Porr, [email protected] */ /*
@@ -8,7 +8,7 @@* Description: University of Stirling USB DAQ & INCITE Technology Limited * Devices: [ITL] USB-DUX-FAST (usbduxfast) * Author: Bernd Porr <[email protected]> -* Updated: 10 Oct 2014 +* Updated: 16 Nov 2019 * Status: stable */
@@ -22,6 +22,7 @@* * * Revision history: +* 1.0: Fixed a rounding error in usbduxfast_ai_cmdtest * 0.9: Dropping the first data packet which seems to be from the last transfer. * Buffer overflows in the FX2 are handed over to comedi. * 0.92: Dropping now 4 packets. The quad buffer has to be emptied.
@@ -350,6 +351,7 @@ static int usbduxfast_ai_cmdtest(struct comedi_device *dev, struct comedi_cmd *cmd) {int err =0 ; +int err2 =0 ;unsigned int steps;unsigned int arg;
@@ -399,11 +401,16 @@ static int usbduxfast_ai_cmdtest(struct comedi_device *dev,*/ steps = (cmd->convert_arg *30 ) /1000 ;if (cmd->chanlist_len !=1 ) - err |=comedi_check_trigger_arg_min (&steps, -MIN_SAMPLING_PERIOD ); - err |=comedi_check_trigger_arg_max (&steps,MAX_SAMPLING_PERIOD ); - arg = (steps *1000 ) /30 ; - err |=comedi_check_trigger_arg_is (&cmd->convert_arg, arg); + err2 |=comedi_check_trigger_arg_min (&steps, +MIN_SAMPLING_PERIOD ); +else + err2 |=comedi_check_trigger_arg_min (&steps,1 ); + err2 |=comedi_check_trigger_arg_max (&steps,MAX_SAMPLING_PERIOD ); +if (err2) { + err |= err2; + arg = (steps *1000 ) /30 ; + err |=comedi_check_trigger_arg_is (&cmd->convert_arg, arg); + }if (cmd->stop_src ==TRIG_COUNT ) err |=comedi_check_trigger_arg_min (&cmd->stop_arg,1 );
drivers/usb/misc/appledisplay.c +7 -1
@@ -164,7 +164,12 @@ static int appledisplay_bl_get_brightness(struct backlight_device *bd)0 , pdata->msgdata,2 , ACD_USB_TIMEOUT); - brightness = pdata->msgdata[1 ]; +if (retval <2 ) { +if (retval >=0 ) + retval = -EMSGSIZE ; + }else { + brightness = pdata->msgdata[1 ]; + }mutex_unlock (&pdata->sysfslock);if (retval <0 )
@@ -299,6 +304,7 @@ static int appledisplay_probe(struct usb_interface *iface,if (pdata) {if (pdata->urb) {usb_kill_urb (pdata->urb); +cancel_delayed_work_sync (&pdata->work);if (pdata->urbdata)usb_free_coherent (pdata->udev,ACD_URB_BUFFER_LEN , pdata->urbdata, pdata->urb->transfer_dma);
drivers/usb/misc/chaoskey.c +21 -3
@@ -384,13 +384,17 @@ static int _chaoskey_fill(struct chaoskey *dev) !dev->reading, (started ? NAK_TIMEOUT : ALEA_FIRST_TIMEOUT) ); -if (result <0 ) +if (result <0 ) { +usb_kill_urb (dev->urb); goto out; + } -if (result ==0 ) +if (result ==0 ) { result = -ETIMEDOUT ; -else +usb_kill_urb (dev->urb); + }else { result = dev->valid; + } out:/* Let the device go back to sleep eventually */ usb_autopm_put_interface (dev->interface);
@@ -526,7 +530,21 @@ static int chaoskey_suspend(struct usb_interface *interface,static int chaoskey_resume (struct usb_interface *interface) { +struct chaoskey *dev; +struct usb_device *udev =interface_to_usbdev (interface); +usb_dbg (interface,"resume" ); + dev =usb_get_intfdata (interface); + +/* +* We may have lost power. +* In that case the device that needs a long time +* for the first requests needs an extended timeout +* again +*/ +if (le16_to_cpu (udev->descriptor.idVendor) ==ALEA_VENDOR_ID ) + dev->reads_started = false; +return 0 ; }#else
drivers/usb/serial/cp210x.c +1 -0
@@ -125,6 +125,7 @@ static const struct usb_device_id id_table[] = { { USB_DEVICE(0x10C4, 0x8341) }, /* Siemens MC35PU GPRS Modem */ { USB_DEVICE(0x10C4, 0x8382) }, /* Cygnal Integrated Products, Inc. */ { USB_DEVICE(0x10C4, 0x83A8) }, /* Amber Wireless AMB2560 */ + { USB_DEVICE(0x10C4, 0x83AA) }, /* Mark-10 Digital Force Gauge */ { USB_DEVICE(0x10C4, 0x83D8) }, /* DekTec DTA Plus VHF/UHF Booster/Attenuator */ { USB_DEVICE(0x10C4, 0x8411) }, /* Kyocera GPS Module */ { USB_DEVICE(0x10C4, 0x8418) }, /* IRZ Automation Teleport SG-10 GSM/GPRS Modem */
drivers/usb/serial/mos7720.c +0 -4
@@ -1833,10 +1833,6 @@ static int mos7720_startup(struct usb_serial *serial) product =le16_to_cpu (serial->dev->descriptor.idProduct); dev = serial->dev; -/* setting configuration feature to one */ -usb_control_msg (serial->dev,usb_sndctrlpipe (serial->dev,0 ), - (__u8 )0x03 ,0x00 ,0x01 ,0x00 ,NULL ,0x00 ,5000 ); -if (product ==MOSCHIP_DEVICE_ID_7715 ) {struct urb *urb = serial->port[0 ]->interrupt_in_urb;
drivers/usb/serial/mos7840.c +11 -5
@@ -119,11 +119,15 @@/* This driver also supports * ATEN UC2324 device using Moschip MCS7840 * ATEN UC2322 device using Moschip MCS7820 +* MOXA UPort 2210 device using Moschip MCS7820 */ #define USB_VENDOR_ID_ATENINTL 0x0557#define ATENINTL_DEVICE_ID_UC2324 0x2011#define ATENINTL_DEVICE_ID_UC2322 0x7820 +#define USB_VENDOR_ID_MOXA 0x110a +#define MOXA_DEVICE_ID_2210 0x2210 +/* Interrupt Routine Defines */ #define SERIAL_IIR_RLS 0x06
@@ -195,6 +199,7 @@ static const struct usb_device_id id_table[] = { {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL2_4)}, {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)}, {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)}, + {USB_DEVICE(USB_VENDOR_ID_MOXA, MOXA_DEVICE_ID_2210)}, {} /* terminating entry */ };MODULE_DEVICE_TABLE (usb, id_table);
@@ -2020,6 +2025,7 @@ static int mos7840_probe(struct usb_serial *serial, const struct usb_device_id *id) {u16 product =le16_to_cpu (serial->dev->descriptor.idProduct); +u16 vid =le16_to_cpu (serial->dev->descriptor.idVendor);u8 *buf;int device_type;
@@ -2030,6 +2036,11 @@ static int mos7840_probe(struct usb_serial *serial, goto out; } +if (vid ==USB_VENDOR_ID_MOXA && product ==MOXA_DEVICE_ID_2210 ) { + device_type =MOSCHIP_DEVICE_ID_7820 ; + goto out; + } + buf =kzalloc (VENDOR_READ_LENGTH ,GFP_KERNEL );if (!buf)return -ENOMEM ;
@@ -2279,11 +2290,6 @@ static int mos7840_port_probe(struct usb_serial_port *port) goto error; }else dev_dbg (&port->dev,"ZLP_REG5 Writing success status%d\n" , status); - -/* setting configuration feature to one */ -usb_control_msg (serial->dev,usb_sndctrlpipe (serial->dev,0 ), -0x03 ,0x00 ,0x01 ,0x00 ,NULL ,0x00 , -MOS_WDR_TIMEOUT ); }return 0 ; error:
drivers/usb/serial/option.c +7 -0
@@ -197,6 +197,7 @@ static void option_instat_callback(struct urb *urb);#define DELL_PRODUCT_5804_MINICARD_ATT 0x819b/* Novatel E371 */ #define DELL_PRODUCT_5821E 0x81d7 +#define DELL_PRODUCT_5821E_ESIM 0x81e0#define KYOCERA_VENDOR_ID 0x0c88#define KYOCERA_PRODUCT_KPC650 0x17da
@@ -1044,6 +1045,8 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, DELL_PRODUCT_5804_MINICARD_ATT, 0xff, 0xff, 0xff) }, { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5821E), .driver_info = RSVD(0) | RSVD(1) | RSVD(6) }, + { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5821E_ESIM), + .driver_info = RSVD(0) | RSVD(1) | RSVD(6) }, { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, /* ADU-E100, ADU-310 */ { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) }, { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) },
@@ -1990,6 +1993,10 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0xa31d, 0xff, 0x06, 0x13) }, { USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0xa31d, 0xff, 0x06, 0x14) }, { USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0xa31d, 0xff, 0x06, 0x1b) }, + { USB_DEVICE(0x0489, 0xe0b4), /* Foxconn T77W968 */ + .driver_info = RSVD(0) | RSVD(1) | RSVD(6) }, + { USB_DEVICE(0x0489, 0xe0b5), /* Foxconn T77W968 ESIM */ + .driver_info = RSVD(0) | RSVD(1) | RSVD(6) }, { USB_DEVICE(0x1508, 0x1001), /* Fibocom NL668 */ .driver_info = RSVD(4) | RSVD(5) | RSVD(6) }, { USB_DEVICE(0x2cb7, 0x0104), /* Fibocom NL678 series */
drivers/usb/usbip/Kconfig +1 -0
@@ -4,6 +4,7 @@ config USBIP_CORE tristate "USB/IP support" depends on NET select USB_COMMON + select SGL_ALLOC ---help--- This enables pushing USB packets over IP to allow remote machines direct access to USB devices. It provides the
drivers/usb/usbip/stub_rx.c +32 -18
74 lines not on this page · raw message
drivers/vhost/vsock.c +48 -18
96 lines not on this page · raw message
drivers/virtio/virtio_balloon.c +1 -1
@@ -820,7 +820,7 @@ static unsigned long virtio_balloon_shrinker_count(struct shrinker *shrinker,unsigned long count; count = vb->num_pages /VIRTIO_BALLOON_PAGES_PER_PAGE ; - count += vb->num_free_page_blocks >>VIRTIO_BALLOON_FREE_PAGE_ORDER ; + count += vb->num_free_page_blocks <<VIRTIO_BALLOON_FREE_PAGE_ORDER ;return count; }
drivers/virtio/virtio_ring.c +2 -2
@@ -583,7 +583,7 @@ static inline int virtqueue_add_split(struct virtqueue *_vq,kfree (desc);END_USE (vq); -return -EIO ; +return -ENOMEM ; }static bool virtqueue_kick_prepare_split (struct virtqueue *_vq)
@@ -1085,7 +1085,7 @@ static int virtqueue_add_indirect_packed(struct vring_virtqueue *vq,kfree (desc);END_USE (vq); -return -EIO ; +return -ENOMEM ; } static inline int virtqueue_add_packed(struct virtqueue *_vq,
fs/ocfs2/xattr.c +33 -23
70 lines not on this page · raw message
include/net/tls.h +2 -0
@@ -364,6 +364,8 @@ int tls_set_sw_offload(struct sock *sk, struct tls_context *ctx, int tx);void tls_sw_strparser_arm (struct sock *sk,struct tls_context *ctx);void tls_sw_strparser_done (struct tls_context *tls_ctx);int tls_sw_sendmsg (struct sock *sk,struct msghdr *msg,size_t size); +int tls_sw_sendpage_locked (struct sock *sk,struct page *page, +int offset,size_t size,int flags);int tls_sw_sendpage (struct sock *sk,struct page *page,int offset,size_t size,int flags);void tls_sw_cancel_work_tx (struct tls_context *tls_ctx);
kernel/fork.c +3 -3
@@ -1713,11 +1713,11 @@ static void pidfd_show_fdinfo(struct seq_file *m, struct file *f)/* * Poll support for process exit notification. */ -static unsigned int pidfd_poll (struct file *file,struct poll_table_struct *pts) +static __poll_t pidfd_poll (struct file *file,struct poll_table_struct *pts) {struct task_struct *task;struct pid *pid = file->private_data; -int poll_flags =0 ; +__poll_t poll_flags =0 ;poll_wait (file, &pid->wait_pidfd, pts);
@@ -1729,7 +1729,7 @@ static unsigned int pidfd_poll(struct file *file, struct poll_table_struct *pts)* group, then poll(2) should block, similar to the wait(2) family. */ if (!task || (task->exit_state &&thread_group_empty (task))) - poll_flags =POLLIN |POLLRDNORM ; + poll_flags =EPOLLIN |EPOLLRDNORM ;rcu_read_unlock ();return poll_flags;
kernel/futex.c +51 -7
101 lines not on this page · raw message
mm/ksm.c +7 -7
@@ -885,13 +885,13 @@ static int remove_stable_node(struct stable_node *stable_node)return 0 ; } -if (WARN_ON_ONCE (page_mapped (page))) { -/* -* This should not happen: but if it does, just refuse to let -* merge_across_nodes be switched - there is no need to panic. -*/ - err = -EBUSY ; - }else { +/* +* Page could be still mapped if this races with __mmput() running in +* between ksm_exit() and exit_mmap(). Just refuse to let +* merge_across_nodes/max_page_sharing be switched. +*/ + err = -EBUSY ; +if (!page_mapped (page)) {/* * The stable node did not yet appear stale to get_ksm_page(), * since that allows for an unmapped ksm page to be recognized
mm/memory_hotplug.c +13 -3
@@ -331,7 +331,7 @@ static unsigned long find_smallest_section_pfn(int nid, struct zone *zone, unsigned long end_pfn) {for (; start_pfn < end_pfn; start_pfn +=PAGES_PER_SUBSECTION ) { -if (unlikely (!pfn_valid (start_pfn))) +if (unlikely (!pfn_to_online_page (start_pfn)))continue ;if (unlikely (pfn_to_nid (start_pfn) != nid))
@@ -356,7 +356,7 @@ static unsigned long find_biggest_section_pfn(int nid, struct zone *zone,/* pfn is the end pfn of a memory section. */ pfn = end_pfn -1 ;for (; pfn >= start_pfn; pfn -=PAGES_PER_SUBSECTION ) { -if (unlikely (!pfn_valid (pfn))) +if (unlikely (!pfn_to_online_page (pfn)))continue ;if (unlikely (pfn_to_nid (pfn) != nid))
@@ -415,7 +415,7 @@ static void shrink_zone_span(struct zone *zone, unsigned long start_pfn,*/ pfn = zone_start_pfn;for (; pfn < zone_end_pfn; pfn +=PAGES_PER_SUBSECTION ) { -if (unlikely (!pfn_valid (pfn))) +if (unlikely (!pfn_to_online_page (pfn)))continue ;if (page_zone (pfn_to_page (pfn)) != zone)
@@ -471,6 +471,16 @@ static void __remove_zone(struct zone *zone, unsigned long start_pfn,struct pglist_data *pgdat = zone->zone_pgdat;unsigned long flags; +#ifdef CONFIG_ZONE_DEVICE +/* +* Zone shrinking code cannot properly deal with ZONE_DEVICE. So +* we will not try to shrink the zones - which is okay as +* set_zone_contiguous() cannot deal with ZONE_DEVICE either way. +*/ +if (zone_idx (zone) ==ZONE_DEVICE ) +return ; +#endif +pgdat_resize_lock (zone->zone_pgdat, &flags);shrink_zone_span (zone, start_pfn, start_pfn + nr_pages);update_pgdat_span (pgdat);
mm/slub.c +16 -6
@@ -2648,6 +2648,17 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,return p; } +/* +* If the object has been wiped upon free, make sure it's fully initialized by +* zeroing out freelist pointer. +*/ +static __always_inline void maybe_wipe_obj_freeptr(struct kmem_cache *s, +void *obj) +{ +if (unlikely (slab_want_init_on_free (s)) && obj) +memset ((void *)((char *)obj + s->offset),0 ,sizeof (void *)); +} +/* * Inlined fastpath so that allocation functions (kmalloc, kmem_cache_alloc) * have the fastpath folded into their functions. So no function call
@@ -2736,12 +2747,8 @@ static __always_inline void *slab_alloc_node(struct kmem_cache *s,prefetch_freepointer (s, next_object);stat (s,ALLOC_FASTPATH ); } -/* -* If the object has been wiped upon free, make sure it's fully -* initialized by zeroing out freelist pointer. -*/ -if (unlikely (slab_want_init_on_free (s)) && object) -memset (object + s->offset,0 ,sizeof (void *)); + +maybe_wipe_obj_freeptr (s, object);if (unlikely (slab_want_init_on_alloc (gfpflags, s)) && object)memset (object,0 , s->object_size);
@@ -3155,10 +3162,13 @@ int kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t flags, size_t size, goto error;
Lines of this file are not shown. View the raw message.
net/vmw_vsock/virtio_transport_common.c +12 -3
Lines of this file are not shown. View the raw message.
tools/objtool/arch/x86/tools/gen-insn-attr-x86.awk +2 -2
Lines of this file are not shown. View the raw message.
tools/testing/selftests/x86/mov_ss_trap.c +2 -1
Lines of this file are not shown. View the raw message.
tools/testing/selftests/x86/sigreturn.c +13 -0
Lines of this file are not shown. View the raw message.
tools/usb/usbip/libsrc/usbip_host_common.c +1 -1
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.