Linux 5.7.13
Greg Kroah-Hartman
maintainerI'm announcing the release of the 5.7.13 kernel.
All users of the 5.7 kernel series must upgrade.
The updated 5.7.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.7.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/arm/boot/dts/armada-38x.dtsi | 3 arch/arm/boot/dts/imx6qdl-icore.dtsi | 3 arch/arm/boot/dts/imx6sx-sabreauto.dts | 2 arch/arm/boot/dts/imx6sx-sdb.dtsi | 2 arch/arm/boot/dts/sun4i-a10.dtsi | 2 arch/arm/boot/dts/sun5i.dtsi | 2 arch/arm/boot/dts/sun7i-a20.dtsi | 2 arch/arm/kernel/hw_breakpoint.c | 27 +++- arch/arm/kernel/vdso.c | 1 arch/arm64/include/asm/alternative.h | 4 arch/arm64/include/asm/checksum.h | 5 arch/parisc/include/asm/cmpxchg.h | 2 arch/parisc/lib/bitops.c | 12 ++ arch/riscv/mm/init.c | 33 +++-- arch/riscv/mm/kasan_init.c | 4 arch/sh/include/asm/pgalloc.h | 10 - arch/sh/kernel/entry-common.S | 6 - arch/x86/kernel/i8259.c | 2 arch/x86/kernel/stacktrace.c | 5 arch/x86/kernel/unwind_orc.c | 8 + arch/x86/kvm/lapic.c | 2 arch/x86/kvm/svm/svm.c | 9 + drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 3 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 9 + drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 36 ++++-- drivers/gpu/drm/drm_gem.c | 10 - drivers/gpu/drm/drm_mipi_dbi.c | 2 drivers/gpu/drm/drm_of.c | 4 drivers/gpu/drm/mcde/mcde_display.c | 11 + drivers/i2c/busses/i2c-cadence.c | 28 ++-- drivers/infiniband/core/cq.c | 14 +- drivers/infiniband/hw/mlx5/odp.c | 5 drivers/infiniband/sw/rdmavt/qp.c | 33 ----- drivers/infiniband/sw/rdmavt/rc.c | 4 drivers/misc/habanalabs/command_submission.c | 14 +- drivers/net/bareudp.c | 29 +++- drivers/net/ethernet/chelsio/cxgb4/sge.c | 1 drivers/net/ethernet/cortina/gemini.c | 5 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 18 +-- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 35 +++-- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 38 ++++-- drivers/net/ethernet/ibm/ibmvnic.c | 2 drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 3 drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c | 2 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 drivers/net/ethernet/mellanox/mlx4/main.c | 2 drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_geneve.c | 2 drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_gre.c | 2 drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_vxlan.c | 2 drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 31 ++++- drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 2 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 1 drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 27 ++-- drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | 2 drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 6 - drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c | 78 ++++++++++--- drivers/net/ethernet/mellanox/mlxsw/core.c | 8 - drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 50 ++++---- drivers/net/ethernet/ni/nixge.c | 8 - drivers/net/ethernet/pensando/ionic/ionic_lif.c | 4 drivers/net/ethernet/qlogic/qed/qed_int.c | 3 drivers/net/ethernet/renesas/ravb_main.c | 26 ++++ drivers/net/usb/hso.c | 5 drivers/net/usb/lan78xx.c | 6 + drivers/net/vxlan.c | 6 - drivers/net/wan/hdlc_x25.c | 4 drivers/net/wan/lapbether.c | 8 - drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c | 16 ++ drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c | 9 - drivers/net/xen-netfront.c | 64 +++++++--- drivers/nfc/s3fwrn5/core.c | 1 drivers/nvme/host/core.c | 15 -- drivers/nvme/host/nvme.h | 7 + drivers/nvme/host/pci.c | 2 drivers/nvme/host/tcp.c | 3 drivers/pci/quirks.c | 13 ++ drivers/pinctrl/qcom/Kconfig | 2 drivers/pinctrl/qcom/pinctrl-msm.c | 74 ++++++++++++ drivers/pinctrl/qcom/pinctrl-msm.h | 4 drivers/pinctrl/qcom/pinctrl-sc7180.c | 1 drivers/scsi/scsi_lib.c | 16 +- drivers/vhost/scsi.c | 2 drivers/virtio/virtio_balloon.c | 6 - fs/io_uring.c | 13 +- include/linux/mlx5/mlx5_ifc.h | 1 include/linux/rhashtable.h | 25 ++-- include/net/xfrm.h | 15 +- include/rdma/rdmavt_qp.h | 19 +++ kernel/audit.c | 1 kernel/audit.h | 8 - kernel/auditsc.c | 3 kernel/bpf/hashtab.c | 12 +- net/9p/trans_fd.c | 15 ++ net/bluetooth/hci_event.c | 26 +++- net/key/af_key.c | 4 net/mac80211/cfg.c | 1 net/mac80211/mesh_pathtbl.c | 1 net/rds/recv.c | 3 net/sunrpc/sunrpc.h | 1 net/sunrpc/sunrpc_syms.c | 2 net/sunrpc/svcauth.c | 25 ++++ net/x25/x25_subr.c | 6 + net/xfrm/espintcp.c | 30 ++++- net/xfrm/xfrm_policy.c | 39 ++---- net/xfrm/xfrm_user.c | 18 +-- sound/pci/hda/hda_controller.h | 2 sound/pci/hda/hda_intel.c | 17 ++ sound/pci/hda/patch_hdmi.c | 2 sound/pci/hda/patch_realtek.c | 36 +++++- sound/usb/pcm.c | 1 tools/lib/traceevent/plugins/Makefile | 2 tools/perf/arch/arm/util/auxtrace.c | 8 - tools/testing/selftests/bpf/test_offload.py | 3 tools/testing/selftests/net/fib_nexthop_multiprefix.sh | 2 tools/testing/selftests/net/forwarding/ethtool.sh | 2 tools/testing/selftests/net/ip_defrag.sh | 2 tools/testing/selftests/net/psock_fanout.c | 3 tools/testing/selftests/net/rxtimestamp.c | 3 tools/testing/selftests/net/so_txtime.c | 2 tools/testing/selftests/net/tcp_mmap.c | 6 - tools/testing/selftests/net/txtimestamp.sh | 2 virt/kvm/arm/mmu.c | 11 + 123 files changed, 926 insertions(+), 420 deletions(-)
Alaa Hleihel (1):
net/mlx5e: Fix kernel crash when setting vf VLANID on a VF dev
Alain Michaud (1):
Bluetooth: fix kernel oops in store_pending_adv_report
Alex Deucher (1):
Revert "drm/amdgpu: Fix NULL dereference in dpm sysfs handlers"
Amit Cohen (1):
selftests: ethtool: Fix test when only two speeds are supported
Andrea Righi (1):
xen-netfront: fix potential deadlock in xennet_remove()
Andrii Nakryiko (1):
bpf: Fix map leak in HASH_OF_MAPS map
Armas Spann (2):
ALSA: hda/realtek: enable headset mic of ASUS ROG Zephyrus G15(GA502) series with ALC289
ALSA: hda/realtek: typo_fix: enable headset mic of ASUS ROG Zephyrus G14(GA401) series with ALC289
Atish Patra (2):
RISC-V: Set maximum number of mapped pages correctly
riscv: Parse all memory blocks to remove unusable memory
Aya Levin (1):
net/mlx5e: Fix error path of device attach
Ben Hutchings (1):
libtraceevent: Fix build with binutils 2.35
Biju Das (1):
drm: of: Fix double-free bug
Christoph Hellwig (1):
nvme: add a Identify Namespace Identification Descriptor list quirk
Daniele Albano (1):
io_uring: always allow drain/link/hardlink/async sqe flags
Douglas Anderson (1):
pinctrl: qcom: Handle broken/missing PDC dual edge IRQs on sc7180
Eran Ben Elisha (3):
net/mlx5: Fix a bug of using ptp channel index as pin index net/mlx5: Verify Hardware supports requested ptp function on a given pin net/mlx5: Query PPS pin operational status before registering it
Fabio Estevam (2):
ARM: dts: imx6sx-sabreauto: Fix the phy-mode on fec2
ARM: dts: imx6sx-sdb: Fix the phy-mode on fec2
Geert Uytterhoeven (1):
usb: hso: Fix debug compile warning on sparc32
Greg Kroah-Hartman (1):
Linux 5.7.13
Guillaume Nault (1):
bareudp: forbid mixing IP and MPLS in multiproto mode
Guojia Liao (2):
net: hns3: fix aRFS FD rules leftover after add a user FD rule
net: hns3: fix for VLAN config when reset failed
Hangbin Liu (1):
selftests/bpf: fix netdevsim trap_flow_action_cookie read
Herbert Xu (1):
rhashtable: Fix unprotected RCU dereference in __rht_ptr
Ido Schimmel (3):
mlxsw: core: Increase scope of RCU read-side critical section
mlxsw: core: Free EMAD transactions using kfree_rcu()
mlxsw: spectrum_router: Fix use-after-free in router init / de-init
Jaedon Shin (1):
ARM: 8987/1: VDSO: Fix incorrect clock_gettime64
Jakub Kicinski (1):
mlx4: disable device on shutdown
Jason Gunthorpe (1):
RDMA/mlx5: Fix prefetch memory leak if get_prefetchable_mr fails
Jian Shen (1):
net: hns3: add reset check for VF updating port based VLAN
Jianbo Liu (1):
net/mlx5e: E-Switch, Add misc bit when misc fields changed for mirroring
Jiri Slaby (1):
iwlwifi: fix crash in iwl_dbg_tlv_alloc_trigger
Johan Hovold (2):
net: lan78xx: add missing endpoint sanity check
net: lan78xx: fix transfer-buffer memory leak
Josh Poimboeuf (2):
x86/unwind/orc: Fix ORC for newly forked tasks x86/stacktrace: Fix reliable check for empty user task stacks
Kailang Yang (1):
ALSA: hda/realtek - Fixed HP right speaker no sound
Landen Chao (1):
net: ethernet: mtk_eth_soc: fix MTU warnings
Laurence Oberman (1):
qed: Disable "MFW indication via attention" SPAM every 5 minutes
Laurence Tratt (1):
ALSA: usb-audio: Add implicit feedback quirk for SSL2
Leon Romanovsky (2):
RDMA/core: Stop DIM before destroying CQ
RDMA/core: Free DIM memory in error unwind
Liam Beguin (1):
parisc: add support for cmpxchg on u8 pointers
Linus Walleij (1):
drm/mcde: Fix stability issue
Lorenzo Bianconi (1):
mt76: mt7615: fix lmac queue debugsfs entry
Lu Wei (1):
net: nixge: fix potential memory leak in nixge_probe()
Maxime Ripard (1):
ARM: dts sunxi: Relax a bit the CMA pool allocation range
Mazin Rezk (1):
drm/amd/display: Clear dm_state for fast updates
Michael Karcher (1):
sh: Fix validation of system call number
Michael S. Tsirkin (2):
vhost/scsi: fix up req type endian-ness
virtio_balloon: fix up endian-ness for free cmd id
Michael Trimarchi (1):
ARM: dts: imx6qdl-icore: Fix OTG_ID pin and sdcard detect
Mike Marciniszyn (1):
IB/rdmavt: Fix RQ counting issues causing use of an invalid RWQE
Ming Lei (1):
scsi: core: Run queue in case of I/O resource contention failure
Navid Emamdoost (2):
nfc: s3fwrn5: add missing release on skb in s3fwrn5_recv_frame
cxgb4: add missing release on skb in uld_send()
NeilBrown (1):
sunrpc: check that domain table is empty at module unload.
Oded Gabbay (1):
habanalabs: prevent possible out-of-bounds array access
Paolo Pisati (3):
selftests: fib_nexthop_multiprefix: fix cleanup() netns deletion
selftests: net: ip_defrag: modprobe missing nf_defrag_ipv6 support
selftest: txtimestamp: fix net ns entry logic
Parav Pandit (2):
net/mlx5: E-switch, Destroy TSAR when fail to enable the mode net/mlx5: E-switch, Destroy TSAR after reload interface
Paul Cercueil (1):
drm/dbi: Fix SPI Type 1 (9-bit) transfer
Paul Moore (1):
revert: 1320a4052ea1 ("audit: trigger accompanying records when no rules present")
PeiSen Hou (1):
ALSA: hda/realtek: Fix add a "ultra_low_power" function for intel reference board (alc256)
Peilin Ye (2):
drm/amdgpu: Prevent kernel-infoleak in amdgpu_info_ioctl()
rds: Prevent kernel-infoleak in rds_notify_queue_get()
Peter Zijlstra (1):
sh/tlb: Fix PGTABLE_LEVELS > 2
Raviteja Narayanam (2):
Revert "i2c: cadence: Fix the hold bit setting"
i2c: cadence: Clear HOLD bit at correct time in Rx path
Remi Pommarel (2):
mac80211: mesh: Free ie data when leaving mesh
mac80211: mesh: Free pending skb when destroying a mpath
Robert Hancock (1):
PCI/ASPM: Disable ASPM on ASMedia ASM1083/1085 PCIe-to-PCI bridge
Robin Murphy (1):
arm64: csum: Fix handling of bad packets
Ron Diskin (1):
net/mlx5e: Modify uplink state on interface up/down
Russell King (1):
ARM: dts: armada-38x: fix NETA lockup when repeatedly switching speeds
Sabrina Dubroca (2):
espintcp: recv() should return 0 when the peer socket is closed
espintcp: handle short messages instead of breaking the encap socket
Sagi Grimberg (1):
nvme-tcp: fix possible hang waiting for icresp response
Sami Tolvanen (1):
arm64/alternatives: move length validation inside the subsection
Shannon Nelson (1):
ionic: unlock queue mutex in error path
Steffen Klassert (1):
xfrm: Fix crash when the hold queue is used.
Steve Cohen (1):
drm: hold gem reference until object is no longer accessed
Subbaraya Sundeep (3):
octeontx2-pf: Fix reset_task bugs
octeontx2-pf: cancel reset_task work
octeontx2-pf: Unregister netdev at driver remove
Taehee Yoo (1):
vxlan: fix memleak of fdb
Takashi Iwai (2):
ALSA: hda: Workaround for spurious wakeups on some Intel platforms
ALSA: hda/hdmi: Fix keep_power assignment for non-component devices
Tanner Love (4):
selftests/net: rxtimestamp: fix clang issues for target arch PowerPC selftests/net: psock_fanout: fix clang issues for target arch PowerPC selftests/net: so_txtime: fix clang issues for target arch PowerPC selftests/net: tcp_mmap: fix clang warning for target arch PowerPC
Thomas Falcon (1):
ibmvnic: Fix IRQ mapping disposal in error path
Thomas Gleixner (1):
x86/i8259: Use printk_deferred() to prevent deadlock
Vincent Chen (1):
riscv: kasan: use local_tlb_flush_all() to avoid uninitialized __sbi_rfence
Wang Hai (2):
9p/trans_fd: Fix concurrency del of req_list in p9_fd_cancelled/p9_read_work
net: gemini: Fix missing clk_disable_unprepare() in error path of gemini_ethernet_port_probe()
Wanpeng Li (2):
KVM: LAPIC: Prevent setting the tscdeadline timer if the lapic is hw disabled
KVM: SVM: Fix disable pause loop exit/pause filtering capability on SVM
Wei Li (1):
perf tools: Fix record failure when mixed with ARM SPE event
Will Deacon (2):
ARM: 8986/1: hw_breakpoint: Don't invoke overflow handler on uaccess watchpoints
KVM: arm64: Don't inherit exec permission across page-table levels
Xie He (1):
drivers/net/wan: lapb: Corrected the usage of skb_cow
Xin Long (1):
xfrm: policy: match with both mark and mask on user interfaces
Xin Xiong (1):
net/mlx5e: fix bpf_prog reference count leaks in mlx5e_alloc_rq
Xiyu Yang (1):
net/x25: Fix x25_neigh refcnt leak when x25 disconnect
Yonglong Liu (1):
net: hns3: fix a TX timeout issue
Yoshihiro Shimoda (1):
net: ethernet: ravb: exit if re-initialization fails in tx timeout
YueHaibing (1):
net/x25: Fix null-ptr-deref in x25_disconnect
Yunsheng Lin (1):
net: hns3: fix desc filling bug when skb is expanded or lineared
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 5 PATCHLEVEL = 7 -SUBLEVEL = 12 +SUBLEVEL = 13 EXTRAVERSION = NAME = Kleptomaniac Octopus
arch/arm/boot/dts/armada-38x.dtsi +2 -1
@@ -344,7 +344,8 @@ gateclk: clock-gating-control@18220 { comphy: phy@18300 { compatible = "marvell,armada-380-comphy"; - reg = <0x18300 0x100>; + reg-names = "comphy", "conf"; + reg = <0x18300 0x100>, <0x18460 4>; #address-cells = <1>; #size-cells = <0>;
arch/arm/boot/dts/imx6qdl-icore.dtsi +2 -1
@@ -397,7 +397,7 @@ MX6QDL_PAD_SD4_DAT1__PWM3_OUT 0x1b0b1 pinctrl_usbotg: usbotggrp { fsl,pins = < - MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x17059 + MX6QDL_PAD_ENET_RX_ER__USB_OTG_ID 0x17059 >; };
@@ -409,6 +409,7 @@ MX6QDL_PAD_SD1_DAT0__SD1_DATA0 0x17070 MX6QDL_PAD_SD1_DAT1__SD1_DATA1 0x17070 MX6QDL_PAD_SD1_DAT2__SD1_DATA2 0x17070 MX6QDL_PAD_SD1_DAT3__SD1_DATA3 0x17070 + MX6QDL_PAD_GPIO_1__GPIO1_IO01 0x1b0b0 >; };
arch/arm/boot/dts/imx6sx-sabreauto.dts +1 -1
@@ -99,7 +99,7 @@ ethphy1: ethernet-phy@1 { &fec2 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_enet2>; - phy-mode = "rgmii"; + phy-mode = "rgmii-id"; phy-handle = <ðphy0>; fsl,magic-packet; status = "okay";
arch/arm/boot/dts/imx6sx-sdb.dtsi +1 -1
@@ -213,7 +213,7 @@ ethphy2: ethernet-phy@2 { &fec2 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_enet2>; - phy-mode = "rgmii"; + phy-mode = "rgmii-id"; phy-handle = <ðphy2>; status = "okay"; };
arch/arm/boot/dts/sun4i-a10.dtsi +1 -1
@@ -198,7 +198,7 @@ reserved-memory { default-pool { compatible = "shared-dma-pool"; size = <0x6000000>; - alloc-ranges = <0x4a000000 0x6000000>; + alloc-ranges = <0x40000000 0x10000000>; reusable; linux,cma-default; };
arch/arm/boot/dts/sun5i.dtsi +1 -1
@@ -117,7 +117,7 @@ reserved-memory { default-pool { compatible = "shared-dma-pool"; size = <0x6000000>; - alloc-ranges = <0x4a000000 0x6000000>; + alloc-ranges = <0x40000000 0x10000000>; reusable; linux,cma-default; };
arch/arm/boot/dts/sun7i-a20.dtsi +1 -1
@@ -181,7 +181,7 @@ reserved-memory { default-pool { compatible = "shared-dma-pool"; size = <0x6000000>; - alloc-ranges = <0x4a000000 0x6000000>; + alloc-ranges = <0x40000000 0x10000000>; reusable; linux,cma-default; };
arch/arm/kernel/hw_breakpoint.c +22 -5
@@ -683,6 +683,12 @@ static void disable_single_step(struct perf_event *bp)arch_install_hw_breakpoint (bp); } +static int watchpoint_fault_on_uaccess (struct pt_regs *regs, +struct arch_hw_breakpoint *info) +{ +return !user_mode (regs) && info->ctrl.privilege ==ARM_BREAKPOINT_USER ; +} +static void watchpoint_handler (unsigned long addr,unsigned int fsr,struct pt_regs *regs) {
@@ -742,16 +748,27 @@ static void watchpoint_handler(unsigned long addr, unsigned int fsr, }pr_debug ("watchpoint fired: address = 0x%x\n" , info->trigger); + +/* +* If we triggered a user watchpoint from a uaccess routine, +* then handle the stepping ourselves since userspace really +* can't help us with this. +*/ +if (watchpoint_fault_on_uaccess (regs, info)) + goto step; +perf_bp_event (wp, regs);/* -* If no overflow handler is present, insert a temporary -* mismatch breakpoint so we can single-step over the -* watchpoint trigger. +* Defer stepping to the overflow handler if one is installed. +* Otherwise, insert a temporary mismatch breakpoint so that +* we can single-step over the watchpoint trigger. */ -if (is_default_overflow_handler (wp)) -enable_single_step (wp,instruction_pointer (regs)); +if (!is_default_overflow_handler (wp)) + goto unlock; +step: +enable_single_step (wp,instruction_pointer (regs)); unlock:rcu_read_unlock (); }
arch/arm/kernel/vdso.c +1 -0
@@ -184,6 +184,7 @@ static void __init patch_vdso(void *ehdr)if (!cntvct_ok) {vdso_nullpatch_one (&einfo,"__vdso_gettimeofday" );vdso_nullpatch_one (&einfo,"__vdso_clock_gettime" ); +vdso_nullpatch_one (&einfo,"__vdso_clock_gettime64" ); } }
arch/arm64/include/asm/alternative.h +2 -2
@@ -77,9 +77,9 @@ static inline void apply_alternatives_module(void *start, size_t length) { }"663:\n\t" \ newinstr"\n" \"664:\n\t" \ -".previous\n\t" \".org . - (664b-663b) + (662b-661b)\n\t" \ -".org . - (662b-661b) + (664b-663b)\n" \ +".org . - (662b-661b) + (664b-663b)\n\t" \ +".previous\n" \".endif\n" #define __ALTERNATIVE_CFG_CB(oldinstr, feature, cfg_enabled, cb) \
arch/arm64/include/asm/checksum.h +3 -2
@@ -24,16 +24,17 @@ static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl) {__uint128_t tmp;u64 sum; +int n = ihl;/* we want it signed */ tmp = *(const __uint128_t *)iph; iph +=16 ; - ihl -=4 ; + n -=4 ; tmp += ((tmp >>64 ) | (tmp <<64 )); sum = tmp >>64 ;do { sum += *(const u32 *)iph; iph +=4 ; - }while (--ihl); + }while (--n >0 ); sum += ((sum >>32 ) | (sum <<32 ));return csum_fold ((__force u32)(sum >>32 ));
arch/parisc/include/asm/cmpxchg.h +2 -0
@@ -60,6 +60,7 @@ extern void __cmpxchg_called_with_bad_pointer(void);extern unsigned long __cmpxchg_u32 (volatile unsigned int *m,unsigned int old,unsigned int new_);extern u64 __cmpxchg_u64 (volatile u64 *ptr,u64 old,u64 new_); +extern u8 __cmpxchg_u8 (volatile u8 *ptr,u8 old,u8 new_);/* don't worry...optimizer will get rid of most of this */ static inline unsigned long
@@ -71,6 +72,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size)#endif case 4 :return __cmpxchg_u32 ((unsigned int *)ptr, (unsigned int )old, (unsigned int )new_); +case 1 :return __cmpxchg_u8 ((u8 *)ptr, (u8 )old, (u8 )new_); }__cmpxchg_called_with_bad_pointer ();return old;
arch/parisc/lib/bitops.c +12 -0
@@ -79,3 +79,15 @@ unsigned long __cmpxchg_u32(volatile unsigned int *ptr, unsigned int old, unsign_atomic_spin_unlock_irqrestore (ptr, flags);return (unsigned long )prev; } + +u8 __cmpxchg_u8 (volatile u8 *ptr,u8 old,u8 new) +{ +unsigned long flags; +u8 prev; + +_atomic_spin_lock_irqsave (ptr, flags); +if ((prev = *ptr) == old) + *ptr = new; +_atomic_spin_unlock_irqrestore (ptr, flags); +return prev; +}
arch/riscv/mm/init.c +18 -15
@@ -146,33 +146,36 @@ void __init setup_bootmem(void) {struct memblock_region *reg;phys_addr_t mem_size =0 ; +phys_addr_t total_mem =0 ; +phys_addr_t mem_start, end =0 ;phys_addr_t vmlinux_end =__pa_symbol (&_end);phys_addr_t vmlinux_start =__pa_symbol (&_start);/* Find the memory region containing the kernel */ for_each_memblock (memory, reg) { -phys_addr_t end = reg->base + reg->size; - -if (reg->base <= vmlinux_start && vmlinux_end <= end) { - mem_size =min (reg->size, (phys_addr_t)-PAGE_OFFSET ); - -/* -* Remove memblock from the end of usable area to the -* end of region -*/ -if (reg->base + mem_size < end) -memblock_remove (reg->base + mem_size, - end - reg->base - mem_size); - } + end = reg->base + reg->size; +if (!total_mem) + mem_start = reg->base; +if (reg->base <= vmlinux_start && vmlinux_end <= end) +BUG_ON (reg->size ==0 ); + total_mem = total_mem + reg->size; } -BUG_ON (mem_size ==0 ); + +/* +* Remove memblock from the end of usable area to the +* end of region +*/ + mem_size =min (total_mem, (phys_addr_t)-PAGE_OFFSET ); +if (mem_start + mem_size < end) +memblock_remove (mem_start + mem_size, + end - mem_start - mem_size);/* Reserve from the start of the kernel to the end of the kernel */ memblock_reserve (vmlinux_start, vmlinux_end - vmlinux_start); -set_max_mapnr (PFN_DOWN (mem_size)); max_pfn =PFN_DOWN (memblock_end_of_DRAM ()); max_low_pfn = max_pfn; +set_max_mapnr (max_low_pfn);#ifdef CONFIG_BLK_DEV_INITRD setup_initrd ();
arch/riscv/mm/kasan_init.c +2 -2
@@ -44,7 +44,7 @@ asmlinkage void __init kasan_early_init(void) (__pa (((uintptr_t ) kasan_early_shadow_pmd))), __pgprot(_PAGE_TABLE))); -flush_tlb_all (); +local_flush_tlb_all (); }static void __init populate (void *start,void *end)
@@ -79,7 +79,7 @@ static void __init populate(void *start, void *end)pfn_pgd (PFN_DOWN (__pa (&pmd[offset])), __pgprot(_PAGE_TABLE))); -flush_tlb_all (); +local_flush_tlb_all ();memset (start,0 , end - start); }
arch/sh/include/asm/pgalloc.h +1 -9
@@ -12,6 +12,7 @@ extern void pgd_free(struct mm_struct *mm, pgd_t *pgd);extern void pud_populate (struct mm_struct *mm,pud_t *pudp,pmd_t *pmd);extern pmd_t *pmd_alloc_one (struct mm_struct *mm,unsigned long address);extern void pmd_free (struct mm_struct *mm,pmd_t *pmd); +#define __pmd_free_tlb (tlb, pmdp, addr) pmd_free((tlb)->mm, (pmdp))#endif static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd,
@@ -33,13 +34,4 @@ do { \tlb_remove_page ((tlb), (pte)); \ } while (0) -#if CONFIG_PGTABLE_LEVELS >2 -#define __pmd_free_tlb (tlb, pmdp, addr) \ -do { \ - struct page *page = virt_to_page(pmdp); \ - pgtable_pmd_page_dtor(page); \ - tlb_remove_page((tlb), page); \ -} while (0); -#endif -#endif /* __ASM_SH_PGALLOC_H */
arch/sh/kernel/entry-common.S +3 -3
@@ -199,7 +199,7 @@ syscall_trace_entry: mov.l @(OFF_R7,r15), r7 ! arg3 mov.l @(OFF_R3,r15), r3 ! syscall_nr ! - mov.l 2f, r10 ! Number of syscalls + mov.l 6f, r10 ! Number of syscalls cmp/hs r10, r3 bf syscall_call mov #-ENOSYS, r0
@@ -353,7 +353,7 @@ ENTRY(system_call) tst r9, r8 bf syscall_trace_entry ! - mov.l 2f, r8 ! Number of syscalls + mov.l 6f, r8 ! Number of syscalls cmp/hs r8, r3 bt syscall_badsys !
@@ -392,7 +392,7 @@ syscall_exit: #if !defined(CONFIG_CPU_SH2) 1: .long TRA #endif -2: .long NR_syscalls +6: .long NR_syscalls 3: .long sys_call_table 7: .long do_syscall_trace_enter 8: .long do_syscall_trace_leave
arch/x86/kernel/i8259.c +1 -1
@@ -207,7 +207,7 @@ static void mask_and_ack_8259A(struct irq_data *data)* lets ACK and report it. [once per IRQ] */ if (!(spurious_irq_mask & irqmask)) { -printk (KERN_DEBUG +printk_deferred (KERN_DEBUG "spurious 8259A interrupt: IRQ%d.\n" , irq); spurious_irq_mask |= irqmask; }
arch/x86/kernel/stacktrace.c +0 -5
@@ -58,7 +58,6 @@ int arch_stack_walk_reliable(stack_trace_consume_fn consume_entry,* or a page fault), which can make frame pointers * unreliable. */ -if (IS_ENABLED (CONFIG_FRAME_POINTER ))return -EINVAL ; }
@@ -81,10 +80,6 @@ int arch_stack_walk_reliable(stack_trace_consume_fn consume_entry,if (unwind_error (&state))return -EINVAL ; -/* Success path for non-user tasks, i.e. kthreads and idle tasks */ -if (!(task->flags & (PF_KTHREAD |PF_IDLE ))) -return -EINVAL ; -return 0 ; }
arch/x86/kernel/unwind_orc.c +6 -2
@@ -440,8 +440,11 @@ bool unwind_next_frame(struct unwind_state *state)/* * Find the orc_entry associated with the text address. * -* Decrement call return addresses by one so they work for sibling -* calls and calls to noreturn functions. +* For a call frame (as opposed to a signal frame), state->ip points to +* the instruction after the call. That instruction's stack layout +* could be different from the call instruction's layout, for example +* if the call was to a noreturn function. So get the ORC data for the +* call instruction itself. */ orc =orc_find (state->signal ? state->ip : state->ip -1 );if (!orc) {
@@ -662,6 +665,7 @@ void __unwind_start(struct unwind_state *state, struct task_struct *task, state->sp = task->thread.sp; state->bp =READ_ONCE_NOCHECK (frame->bp); state->ip =READ_ONCE_NOCHECK (frame->ret_addr); + state->signal = (void *)state->ip == ret_from_fork; } if (get_stack_info((unsigned long *)state->sp, state->task,
arch/x86/kvm/lapic.c +1 -1
@@ -2136,7 +2136,7 @@ void kvm_set_lapic_tscdeadline_msr(struct kvm_vcpu *vcpu, u64 data) {struct kvm_lapic *apic = vcpu->arch.apic; -if (!lapic_in_kernel (vcpu) ||apic_lvtt_oneshot (apic) || +if (!kvm_apic_present (vcpu) ||apic_lvtt_oneshot (apic) ||apic_lvtt_period (apic))return ;
arch/x86/kvm/svm/svm.c +6 -3
@@ -1105,7 +1105,7 @@ static void init_vmcb(struct vcpu_svm *svm) svm->nested.vmcb =0 ; svm->vcpu.arch.hflags =0 ; -if (pause_filter_count) { +if (!kvm_pause_in_guest (svm->vcpu.kvm)) { control->pause_filter_count = pause_filter_count;if (pause_filter_thresh) control->pause_filter_thresh = pause_filter_thresh;
@@ -2682,7 +2682,7 @@ static int pause_interception(struct vcpu_svm *svm)struct kvm_vcpu *vcpu = &svm->vcpu;bool in_kernel = (svm_get_cpl (vcpu) ==0 ); -if (pause_filter_thresh) +if (!kvm_pause_in_guest (vcpu->kvm))grow_ple_window (vcpu);kvm_vcpu_on_spin (vcpu, in_kernel);
@@ -3727,7 +3727,7 @@ static void svm_handle_exit_irqoff(struct kvm_vcpu *vcpu,static void svm_sched_in (struct kvm_vcpu *vcpu,int cpu) { -if (pause_filter_thresh) +if (!kvm_pause_in_guest (vcpu->kvm))shrink_ple_window (vcpu); }
@@ -3892,6 +3892,9 @@ static void svm_vm_destroy(struct kvm *kvm)static int svm_vm_init (struct kvm *kvm) { +if (!pause_filter_count || !pause_filter_thresh) + kvm->arch.pause_in_guest = true; +if (avic) {int ret =avic_vm_init (kvm);if (ret)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +2 -1
@@ -692,9 +692,10 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_filereturn n ? -EFAULT :0 ; }case AMDGPU_INFO_DEV_INFO : { -struct drm_amdgpu_info_device dev_info = {}; +struct drm_amdgpu_info_device dev_info;uint64_t vm_size; +memset (&dev_info,0 ,sizeof (dev_info)); dev_info.device_id = dev->pdev->device; dev_info.chip_rev = adev->rev_id; dev_info.external_rev = adev->external_rev_id;
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +6 -3
@@ -775,7 +775,8 @@ static ssize_t amdgpu_set_pp_od_clk_voltage(struct device *dev, tmp_str++;while (isspace (*++tmp_str)); -while ((sub_str =strsep (&tmp_str, delimiter)) !=NULL ) { +while (tmp_str[0 ]) { + sub_str =strsep (&tmp_str, delimiter); ret =kstrtol (sub_str,0 , ¶meter[parameter_size]);if (ret)return -EINVAL ;
@@ -1035,7 +1036,8 @@ static ssize_t amdgpu_read_mask(const char *buf, size_t count, uint32_t *mask)memcpy (buf_cpy, buf, bytes); buf_cpy[bytes] ='\0' ; tmp = buf_cpy; -while ((sub_str =strsep (&tmp, delimiter)) !=NULL ) { +while (tmp[0 ]) { + sub_str =strsep (&tmp, delimiter);if (strlen (sub_str)) { ret =kstrtol (sub_str,0 , &level);if (ret)
@@ -1632,7 +1634,8 @@ static ssize_t amdgpu_set_pp_power_profile_mode(struct device *dev, i++;memcpy (buf_cpy, buf, count-i); tmp_str = buf_cpy; -while ((sub_str =strsep (&tmp_str, delimiter)) !=NULL ) { +while (tmp_str[0 ]) { + sub_str =strsep (&tmp_str, delimiter); ret =kstrtol (sub_str,0 , ¶meter[parameter_size]);if (ret)return -EINVAL ;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +27 -9
@@ -8489,20 +8489,38 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,* the same resource. If we have a new DC context as part of * the DM atomic state from validation we need to free it and * retain the existing one instead. +* +* Furthermore, since the DM atomic state only contains the DC +* context and can safely be annulled, we can free the state +* and clear the associated private object now to free +* some memory and avoid a possible use-after-free later. */ -struct dm_atomic_state *new_dm_state, *old_dm_state; - new_dm_state =dm_atomic_get_new_state (state); - old_dm_state =dm_atomic_get_old_state (state); +for (i =0 ; i < state->num_private_objs; i++) { +struct drm_private_obj *obj = state->private_objs[i].ptr; -if (new_dm_state && old_dm_state) { -if (new_dm_state->context) -dc_release_state (new_dm_state->context); +if (obj->funcs == adev->dm.atomic_obj.funcs) { +int j = state->num_private_objs-1 ; - new_dm_state->context = old_dm_state->context; +dm_atomic_destroy_state (obj, + state->private_objs[i].state); + +/* If i is not at the end of the array then the +* last element needs to be moved to where i was +* before the array can safely be truncated. +*/ +if (i != j) + state->private_objs[i] = + state->private_objs[j]; -if (old_dm_state->context) -dc_retain_state (old_dm_state->context); + state->private_objs[j].ptr =NULL ; + state->private_objs[j].state =NULL ; + state->private_objs[j].old_state =NULL ; + state->private_objs[j].new_state =NULL ; + + state->num_private_objs = j; +break ; + } } }
drivers/gpu/drm/drm_gem.c +4 -6
@@ -872,9 +872,6 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data,* @file_priv: drm file-private structure * * Open an object using the global name, returning a handle and the size. -* -* This handle (of course) holds a reference to the object, so the object -* will not go away until the handle is deleted. */ int drm_gem_open_ioctl(struct drm_device *dev, void *data,
@@ -899,14 +896,15 @@ drm_gem_open_ioctl(struct drm_device *dev, void *data,/* drm_gem_handle_create_tail unlocks dev->object_name_lock. */ ret =drm_gem_handle_create_tail (file_priv, obj, &handle); -drm_gem_object_put_unlocked (obj);if (ret) -return ret; + goto err; args->handle = handle; args->size = obj->size; -return 0 ; +err: +drm_gem_object_put_unlocked (obj); +return ret; }/**
drivers/gpu/drm/drm_mipi_dbi.c +1 -1
@@ -938,7 +938,7 @@ static int mipi_dbi_spi1_transfer(struct mipi_dbi *dbi, int dc, } } - tr.len = chunk; + tr.len = chunk *2 ; len -= chunk; ret =spi_sync (spi, &m);
drivers/gpu/drm/drm_of.c +1 -3
@@ -322,10 +322,8 @@ static int drm_of_lvds_get_remote_pixels_type(* configurations by passing the endpoints explicitly to * drm_of_lvds_get_dual_link_pixel_order(). */ -if (!current_pt || pixels_type != current_pt) { -of_node_put (remote_port); +if (!current_pt || pixels_type != current_pt)return -EINVAL ; - } }return pixels_type;
drivers/gpu/drm/mcde/mcde_display.c +8 -3
@@ -1060,9 +1060,14 @@ static void mcde_display_update(struct drm_simple_display_pipe *pipe,*/ if (fb) {mcde_set_extsrc (mcde,drm_fb_cma_get_gem_addr (fb, pstate,0 )); -if (!mcde->video_mode) -/* Send a single frame using software sync */ -mcde_display_send_one_frame (mcde); +if (!mcde->video_mode) { +/* +* Send a single frame using software sync if the flow +* is not active yet. +*/ +if (mcde->flow_active ==0 ) +mcde_display_send_one_frame (mcde); + }dev_info_once (mcde->dev,"sent first display update\n" ); }else {/*
drivers/i2c/busses/i2c-cadence.c +12 -16
@@ -230,20 +230,21 @@ static irqreturn_t cdns_i2c_isr(int irq, void *ptr)/* Read data if receive data valid is set */ while (cdns_i2c_readreg (CDNS_I2C_SR_OFFSET ) &CDNS_I2C_SR_RXDV ) { -/* -* Clear hold bit that was set for FIFO control if -* RX data left is less than FIFO depth, unless -* repeated start is selected. -*/ -if ((id->recv_count <CDNS_I2C_FIFO_DEPTH ) && - !id->bus_hold_flag) -cdns_i2c_clear_bus_hold (id); -if (id->recv_count >0 ) { *(id->p_recv_buf)++ =cdns_i2c_readreg (CDNS_I2C_DATA_OFFSET ); id->recv_count--; id->curr_recv_count--; + +/* +* Clear hold bit that was set for FIFO control +* if RX data left is less than or equal to +* FIFO DEPTH unless repeated start is selected +*/ +if (id->recv_count <=CDNS_I2C_FIFO_DEPTH && + !id->bus_hold_flag) +cdns_i2c_clear_bus_hold (id); + }else {dev_err (id->adap.dev.parent,"xfer_size reg rollover. xfer aborted!\n" );
@@ -382,10 +383,8 @@ static void cdns_i2c_mrecv(struct cdns_i2c *id)* Check for the message size against FIFO depth and set the * 'hold bus' bit if it is greater than FIFO depth. */ -if ((id->recv_count >CDNS_I2C_FIFO_DEPTH ) || id->bus_hold_flag) +if (id->recv_count >CDNS_I2C_FIFO_DEPTH ) ctrl_reg |=CDNS_I2C_CR_HOLD ; -else - ctrl_reg = ctrl_reg & ~CDNS_I2C_CR_HOLD ;cdns_i2c_writereg (ctrl_reg,CDNS_I2C_CR_OFFSET );
@@ -442,11 +441,8 @@ static void cdns_i2c_msend(struct cdns_i2c *id)* Check for the message size against FIFO depth and set the * 'hold bus' bit if it is greater than FIFO depth. */ -if ((id->send_count >CDNS_I2C_FIFO_DEPTH ) || id->bus_hold_flag) +if (id->send_count >CDNS_I2C_FIFO_DEPTH ) ctrl_reg |=CDNS_I2C_CR_HOLD ; -else - ctrl_reg = ctrl_reg & ~CDNS_I2C_CR_HOLD ; -cdns_i2c_writereg (ctrl_reg,CDNS_I2C_CR_OFFSET );/* Clear the interrupts in interrupt status register. */
drivers/infiniband/core/cq.c +11 -3
@@ -68,6 +68,15 @@ static void rdma_dim_init(struct ib_cq *cq)INIT_WORK (&dim->work, ib_cq_rdma_dim_work); } +static void rdma_dim_destroy (struct ib_cq *cq) +{ +if (!cq->dim) +return ; + +cancel_work_sync (&cq->dim->work); +kfree (cq->dim); +} +static int __poll_cq (struct ib_cq *cq,int num_entries,struct ib_wc *wc) {int rc;
@@ -261,6 +270,7 @@ struct ib_cq *__ib_alloc_cq_user(struct ib_device *dev, void *private,return cq; out_destroy_cq: +rdma_dim_destroy (cq);rdma_restrack_del (&cq->res); cq->device->ops.destroy_cq (cq, udata); out_free_wc:
@@ -324,12 +334,10 @@ void ib_free_cq_user(struct ib_cq *cq, struct ib_udata *udata)WARN_ON_ONCE (1 ); } +rdma_dim_destroy (cq);trace_cq_free (cq);rdma_restrack_del (&cq->res); cq->device->ops.destroy_cq (cq, udata); -if (cq->dim) -cancel_work_sync (&cq->dim->work); -kfree (cq->dim);kfree (cq->wc);kfree (cq); }
drivers/infiniband/hw/mlx5/odp.c +2 -3
@@ -1798,9 +1798,7 @@ static bool init_prefetch_work(struct ib_pd *pd, work->frags[i].mr =get_prefetchable_mr (pd, advice, sg_list[i].lkey);if (!work->frags[i].mr) { - work->num_sge = i -1 ; -if (i) -destroy_prefetch_work (work); + work->num_sge = i;return false; }
@@ -1866,6 +1864,7 @@ int mlx5_ib_advise_mr_prefetch(struct ib_pd *pd, srcu_key =srcu_read_lock (&dev->odp_srcu);if (!init_prefetch_work (pd, advice, pf_flags, work, sg_list, num_sge)) {srcu_read_unlock (&dev->odp_srcu, srcu_key); +destroy_prefetch_work (work);return -EINVAL ; }queue_work (system_unbound_wq, &work->work);
drivers/infiniband/sw/rdmavt/qp.c +4 -29
@@ -898,8 +898,6 @@ static void rvt_init_qp(struct rvt_dev_info *rdi, struct rvt_qp *qp, qp->s_tail_ack_queue =0 ; qp->s_acked_ack_queue =0 ; qp->s_num_rd_atomic =0 ; -if (qp->r_rq.kwq) - qp->r_rq.kwq->count = qp->r_rq.size; qp->r_sge.num_sge =0 ;atomic_set (&qp->s_reserved_used,0 ); }
@@ -2352,31 +2350,6 @@ static int init_sge(struct rvt_qp *qp, struct rvt_rwqe *wqe)return 0 ; } -/** -* get_count - count numbers of request work queue entries -* in circular buffer -* @rq: data structure for request queue entry -* @tail: tail indices of the circular buffer -* @head: head indices of the circular buffer -* -* Return - total number of entries in the circular buffer -*/ -static u32 get_count (struct rvt_rq *rq,u32 tail,u32 head) -{ -u32 count; - - count = head; - -if (count >= rq->size) - count =0 ; -if (count < tail) - count += rq->size - tail; -else - count -= tail; - -return count; -} -/** * get_rvt_head - get head indices of the circular buffer * @rq: data structure for request queue entry
@@ -2451,7 +2424,7 @@ int rvt_get_rwqe(struct rvt_qp *qp, bool wr_id_only)if (kwq->count <RVT_RWQ_COUNT_THRESHOLD ) { head =get_rvt_head (rq, ip); - kwq->count =get_count (rq, tail, head); + kwq->count =rvt_get_rq_count (rq, head, tail); }if (unlikely (kwq->count ==0 )) { ret =0 ;
@@ -2486,7 +2459,9 @@ int rvt_get_rwqe(struct rvt_qp *qp, bool wr_id_only)* the number of remaining WQEs. */ if (kwq->count < srq->limit) { - kwq->count =get_count (rq, tail,get_rvt_head (rq, ip)); + kwq->count = +rvt_get_rq_count (rq, +get_rvt_head (rq, ip), tail);if (kwq->count < srq->limit) {struct ib_event ev;
drivers/infiniband/sw/rdmavt/rc.c +1 -3
@@ -127,9 +127,7 @@ __be32 rvt_compute_aeth(struct rvt_qp *qp)* not atomic, which is OK, since the fuzziness is * resolved as further ACKs go out. */ - credits = head - tail; -if ((int )credits <0 ) - credits += qp->r_rq.size; + credits =rvt_get_rq_count (&qp->r_rq, head, tail); }/* * Binary search the credit table to find the code to
drivers/misc/habanalabs/command_submission.c +11 -3
@@ -425,11 +425,19 @@ static int validate_queue_index(struct hl_device *hdev,struct asic_fixed_properties *asic = &hdev->asic_prop;struct hw_queue_properties *hw_queue_prop; +/* This must be checked here to prevent out-of-bounds access to +* hw_queues_props array +*/ +if (chunk->queue_index >=HL_MAX_QUEUES ) { +dev_err (hdev->dev,"Queue index %d is invalid\n" , + chunk->queue_index); +return -EINVAL ; + } + hw_queue_prop = &asic->hw_queues_props[chunk->queue_index]; -if ((chunk->queue_index >=HL_MAX_QUEUES ) || - (hw_queue_prop->type ==QUEUE_TYPE_NA )) { -dev_err (hdev->dev,"Queue index %d is invalid\n" , +if (hw_queue_prop->type ==QUEUE_TYPE_NA ) { +dev_err (hdev->dev,"Queue index %d is not applicable\n" , chunk->queue_index);return -EINVAL ; }
drivers/net/bareudp.c +22 -7
@@ -407,19 +407,34 @@ static int bareudp6_xmit_skb(struct sk_buff *skb, struct net_device *dev,return err; } +static bool bareudp_proto_valid (struct bareudp_dev *bareudp,__be16 proto) +{ +if (bareudp->ethertype == proto) +return true; + +if (!bareudp->multi_proto_mode) +return false; + +if (bareudp->ethertype ==htons (ETH_P_MPLS_UC ) && + proto ==htons (ETH_P_MPLS_MC )) +return true; + +if (bareudp->ethertype ==htons (ETH_P_IP ) && + proto ==htons (ETH_P_IPV6 )) +return true; + +return false; +} +static netdev_tx_t bareudp_xmit (struct sk_buff *skb,struct net_device *dev) {struct bareudp_dev *bareudp =netdev_priv (dev);struct ip_tunnel_info *info =NULL ;int err; -if (skb->protocol != bareudp->ethertype) { -if (!bareudp->multi_proto_mode || - (skb->protocol !=htons (ETH_P_MPLS_MC ) && - skb->protocol !=htons (ETH_P_IPV6 ))) { - err = -EINVAL ; - goto tx_error; - } +if (!bareudp_proto_valid (bareudp, skb->protocol)) { + err = -EINVAL ; + goto tx_error; } info =skb_tunnel_info (skb);
drivers/net/ethernet/chelsio/cxgb4/sge.c +1 -0
@@ -2925,6 +2925,7 @@ static inline int uld_send(struct adapter *adap, struct sk_buff *skb, txq_info = adap->sge.uld_txq_info[tx_uld_type];if (unlikely (!txq_info)) {WARN_ON (true); +kfree_skb (skb);return NET_XMIT_DROP ; }
drivers/net/ethernet/cortina/gemini.c +4 -1
@@ -2445,6 +2445,7 @@ static int gemini_ethernet_port_probe(struct platform_device *pdev) port->reset =devm_reset_control_get_exclusive (dev,NULL );if (IS_ERR (port->reset)) {dev_err (dev,"no reset\n" ); +clk_disable_unprepare (port->pclk);return PTR_ERR (port->reset); }reset_control_reset (port->reset);
@@ -2500,8 +2501,10 @@ static int gemini_ethernet_port_probe(struct platform_device *pdev)IRQF_SHARED , port_names[port->id], port); -if (ret) +if (ret) { +clk_disable_unprepare (port->pclk);return ret; + } ret =register_netdev (netdev);if (!ret) {
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +7 -11
@@ -1098,16 +1098,8 @@ static int hns3_fill_desc(struct hns3_enet_ring *ring, void *priv,int k, sizeoflast;dma_addr_t dma; -if (type ==DESC_TYPE_SKB ) { -struct sk_buff *skb = (struct sk_buff *)priv; -int ret; - - ret =hns3_fill_skb_desc (ring, skb, desc); -if (unlikely (ret <0 )) -return ret; - - dma =dma_map_single (dev, skb->data, size,DMA_TO_DEVICE ); - }else if (type ==DESC_TYPE_FRAGLIST_SKB ) { +if (type ==DESC_TYPE_FRAGLIST_SKB || + type ==DESC_TYPE_SKB ) {struct sk_buff *skb = (struct sk_buff *)priv; dma =dma_map_single (dev, skb->data, size,DMA_TO_DEVICE );
@@ -1452,6 +1444,10 @@ netdev_tx_t hns3_nic_net_xmit(struct sk_buff *skb, struct net_device *netdev) next_to_use_head = ring->next_to_use; + ret =hns3_fill_skb_desc (ring, skb, &ring->desc[ring->next_to_use]); +if (unlikely (ret <0 )) + goto fill_err; + ret =hns3_fill_skb_to_desc (ring, skb,DESC_TYPE_SKB );if (unlikely (ret <0 )) goto fill_err;
@@ -4174,8 +4170,8 @@ static void hns3_link_status_change(struct hnae3_handle *handle, bool linkup)return ;if (linkup) { -netif_carrier_on (netdev);netif_tx_wake_all_queues (netdev); +netif_carrier_on (netdev);if (netif_msg_link (handle))netdev_info (netdev,"link up\n" ); }else {
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +19 -16
@@ -5737,9 +5737,9 @@ static int hclge_add_fd_entry(struct hnae3_handle *handle,/* to avoid rule conflict, when user configure rule by ethtool, * we need to clear all arfs rules */ +spin_lock_bh (&hdev->fd_rule_lock);hclge_clear_arfs_rules (handle); -spin_lock_bh (&hdev->fd_rule_lock); ret =hclge_fd_config_rule (hdev, rule);spin_unlock_bh (&hdev->fd_rule_lock);
@@ -5782,6 +5782,7 @@ static int hclge_del_fd_entry(struct hnae3_handle *handle,return ret; } +/* make sure being called after lock up with fd_rule_lock */ static void hclge_del_all_fd_entries (struct hnae3_handle *handle,bool clear_list) {
@@ -5794,7 +5795,6 @@ static void hclge_del_all_fd_entries(struct hnae3_handle *handle,if (!hnae3_dev_fd_supported (hdev))return ; -spin_lock_bh (&hdev->fd_rule_lock);for_each_set_bit (location, hdev->fd_bmap, hdev->fd_cfg.rule_num[HCLGE_FD_STAGE_1 ]) hclge_fd_tcam_config(hdev, HCLGE_FD_STAGE_1, true, location,
@@ -5811,8 +5811,6 @@ static void hclge_del_all_fd_entries(struct hnae3_handle *handle,bitmap_zero (hdev->fd_bmap, hdev->fd_cfg.rule_num[HCLGE_FD_STAGE_1 ]); } - -spin_unlock_bh (&hdev->fd_rule_lock); }static int hclge_restore_fd_entries (struct hnae3_handle *handle)
@@ -6179,7 +6177,7 @@ static int hclge_add_fd_entry_by_arfs(struct hnae3_handle *handle, u16 queue_id, u16 flow_id, struct flow_keys *fkeys) { struct hclge_vport *vport = hclge_get_vport(handle); -struct hclge_fd_rule_tuples new_tuples; +struct hclge_fd_rule_tuples new_tuples = {};struct hclge_dev *hdev = vport->back;struct hclge_fd_rule *rule;u16 tmp_queue_id;
@@ -6189,20 +6187,18 @@ static int hclge_add_fd_entry_by_arfs(struct hnae3_handle *handle, u16 queue_id,if (!hnae3_dev_fd_supported (hdev))return -EOPNOTSUPP ; -memset (&new_tuples,0 ,sizeof (new_tuples)); -hclge_fd_get_flow_tuples (fkeys, &new_tuples); - -spin_lock_bh (&hdev->fd_rule_lock); -/* when there is already fd rule existed add by user, * arfs should not work */ +spin_lock_bh (&hdev->fd_rule_lock);if (hdev->fd_active_type ==HCLGE_FD_EP_ACTIVE ) {spin_unlock_bh (&hdev->fd_rule_lock);return -EOPNOTSUPP ; } +hclge_fd_get_flow_tuples (fkeys, &new_tuples); +/* check is there flow director filter existed for this flow, * if not, create a new filter for it; * if filter exist with different queue id, modify the filter;
@@ -6287,6 +6283,7 @@ static void hclge_rfs_filter_expire(struct hclge_dev *hdev)#endif } +/* make sure being called after lock up with fd_rule_lock */ static void hclge_clear_arfs_rules (struct hnae3_handle *handle) {#ifdef CONFIG_RFS_ACCEL
@@ -6331,10 +6328,14 @@ static void hclge_enable_fd(struct hnae3_handle *handle, bool enable) hdev->fd_en = enable; clear = hdev->fd_active_type ==HCLGE_FD_ARFS_ACTIVE ; -if (!enable) + +if (!enable) { +spin_lock_bh (&hdev->fd_rule_lock);hclge_del_all_fd_entries (handle, clear); -else +spin_unlock_bh (&hdev->fd_rule_lock); + }else {hclge_restore_fd_entries (handle); + } }static void hclge_cfg_mac_mode (struct hclge_dev *hdev,bool enable)
@@ -6799,8 +6800,9 @@ static void hclge_ae_stop(struct hnae3_handle *handle)int i;set_bit (HCLGE_STATE_DOWN , &hdev->state); - +spin_lock_bh (&hdev->fd_rule_lock);hclge_clear_arfs_rules (handle); +spin_unlock_bh (&hdev->fd_rule_lock);/* If it is not PF reset, the firmware will disable the MAC, * so it only need to stop phy here.
@@ -8532,11 +8534,12 @@ int hclge_set_vlan_filter(struct hnae3_handle *handle, __be16 proto,bool writen_to_tbl = false;int ret =0 ; -/* When device is resetting, firmware is unable to handle -* mailbox. Just record the vlan id, and remove it after +/* When device is resetting or reset failed, firmware is unable to +* handle mailbox. Just record the vlan id, and remove it after * reset finished. */ -if (test_bit (HCLGE_STATE_RST_HANDLING , &hdev->state) && is_kill) { +if ((test_bit (HCLGE_STATE_RST_HANDLING , &hdev->state) || +test_bit (HCLGE_STATE_RST_FAIL , &hdev->state)) && is_kill) {set_bit (vlan_id, vport->vlan_del_fail_bmap);return -EBUSY ; }
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +26 -12
@@ -1322,11 +1322,12 @@ static int hclgevf_set_vlan_filter(struct hnae3_handle *handle,if (proto !=htons (ETH_P_8021Q ))return -EPROTONOSUPPORT ; -/* When device is resetting, firmware is unable to handle -* mailbox. Just record the vlan id, and remove it after +/* When device is resetting or reset failed, firmware is unable to +* handle mailbox. Just record the vlan id, and remove it after * reset finished. */ -if (test_bit (HCLGEVF_STATE_RST_HANDLING , &hdev->state) && is_kill) { +if ((test_bit (HCLGEVF_STATE_RST_HANDLING , &hdev->state) || +test_bit (HCLGEVF_STATE_RST_FAIL , &hdev->state)) && is_kill) {set_bit (vlan_id, hdev->vlan_del_fail_bmap);return -EBUSY ; }
@@ -3142,23 +3143,36 @@ void hclgevf_update_port_base_vlan_info(struct hclgevf_dev *hdev, u16 state, {struct hnae3_handle *nic = &hdev->nic;struct hclge_vf_to_pf_msg send_msg; +int ret;rtnl_lock (); -hclgevf_notify_client (hdev,HNAE3_DOWN_CLIENT ); -rtnl_unlock (); + +if (test_bit (HCLGEVF_STATE_RST_HANDLING , &hdev->state) || +test_bit (HCLGEVF_STATE_RST_FAIL , &hdev->state)) { +dev_warn (&hdev->pdev->dev, +"is resetting when updating port based vlan info\n" ); +rtnl_unlock (); +return ; + } + + ret =hclgevf_notify_client (hdev,HNAE3_DOWN_CLIENT ); +if (ret) { +rtnl_unlock (); +return ; + }/* send msg to PF and wait update port based vlan info */ hclgevf_build_send_msg (&send_msg,HCLGE_MBX_SET_VLAN ,HCLGE_MBX_PORT_BASE_VLAN_CFG );memcpy (send_msg.data, port_base_vlan_info, data_size); -hclgevf_send_mbx_msg (hdev, &send_msg, false,NULL ,0 ); - -if (state ==HNAE3_PORT_BASE_VLAN_DISABLE ) - nic->port_base_vlan_state =HNAE3_PORT_BASE_VLAN_DISABLE ; -else - nic->port_base_vlan_state =HNAE3_PORT_BASE_VLAN_ENABLE ; + ret =hclgevf_send_mbx_msg (hdev, &send_msg, false,NULL ,0 ); +if (!ret) { +if (state ==HNAE3_PORT_BASE_VLAN_DISABLE ) + nic->port_base_vlan_state = state; +else + nic->port_base_vlan_state =HNAE3_PORT_BASE_VLAN_ENABLE ; + } -rtnl_lock ();hclgevf_notify_client (hdev,HNAE3_UP_CLIENT );rtnl_unlock (); }
drivers/net/ethernet/ibm/ibmvnic.c +1 -1
@@ -3206,7 +3206,7 @@ static int init_sub_crq_irqs(struct ibmvnic_adapter *adapter) req_tx_irq_failed:for (j =0 ; j < i; j++) {free_irq (adapter->tx_scrq[j]->irq, adapter->tx_scrq[j]); -irq_dispose_mapping (adapter->rx_scrq[j]->irq); +irq_dispose_mapping (adapter->tx_scrq[j]->irq); }release_sub_crqs (adapter,1 );return rc;
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +3 -0
@@ -1730,10 +1730,12 @@ static void otx2_reset_task(struct work_struct *work)if (!netif_running (pf->netdev))return ; +rtnl_lock ();otx2_stop (pf->netdev); pf->reset_count++;otx2_open (pf->netdev);netif_trans_update (pf->netdev); +rtnl_unlock (); }static const struct net_device_ops otx2_netdev_ops = {
@@ -2111,6 +2113,7 @@ static void otx2_remove(struct pci_dev *pdev) pf =netdev_priv (netdev); +cancel_work_sync (&pf->reset_task);/* Disable link notifications */ otx2_cgx_config_linkevents (pf, false);
drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c +2 -0
@@ -617,6 +617,8 @@ static void otx2vf_remove(struct pci_dev *pdev) vf =netdev_priv (netdev); +cancel_work_sync (&vf->reset_task); +unregister_netdev (netdev);otx2vf_disable_mbox_intr (vf);otx2_detach_resources (&vf->mbox);
drivers/net/ethernet/mediatek/mtk_eth_soc.c +2 -0
@@ -2882,6 +2882,8 @@ static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) eth->netdev[id]->irq = eth->irq[0 ]; eth->netdev[id]->dev.of_node = np; + eth->netdev[id]->max_mtu =MTK_MAX_RX_LENGTH -MTK_RX_ETH_HLEN ; +return 0 ; free_netdev:
drivers/net/ethernet/mellanox/mlx4/main.c +2 -0
@@ -4358,12 +4358,14 @@ static void mlx4_pci_resume(struct pci_dev *pdev)static void mlx4_shutdown (struct pci_dev *pdev) {struct mlx4_dev_persistent *persist =pci_get_drvdata (pdev); +struct mlx4_dev *dev = persist->dev;mlx4_info (persist->dev,"mlx4_shutdown was called\n" );mutex_lock (&persist->interface_state_mutex);if (persist->interface_state &MLX4_INTERFACE_STATE_UP )mlx4_unload_one (pdev);mutex_unlock (&persist->interface_state_mutex); +mlx4_pci_disable_device (dev); }static const struct pci_error_handlers mlx4_err_handler = {
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_geneve.c +2 -0
@@ -301,6 +301,8 @@ static int mlx5e_tc_tun_parse_geneve_params(struct mlx5e_priv *priv,MLX5_SET (fte_match_set_misc, misc_v, geneve_protocol_type,ETH_P_TEB ); } + spec->match_criteria_enable |=MLX5_MATCH_MISC_PARAMETERS ; +return 0 ; }
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_gre.c +2 -0
@@ -80,6 +80,8 @@ static int mlx5e_tc_tun_parse_gretap(struct mlx5e_priv *priv, gre_key.key, be32_to_cpu(enc_keyid.key->keyid)); } + spec->match_criteria_enable |=MLX5_MATCH_MISC_PARAMETERS ; +return 0 ; }
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_vxlan.c +2 -0
@@ -136,6 +136,8 @@ static int mlx5e_tc_tun_parse_vxlan(struct mlx5e_priv *priv,MLX5_SET (fte_match_set_misc, misc_v, vxlan_vni,be32_to_cpu (enc_keyid.key->keyid)); + spec->match_criteria_enable |=MLX5_MATCH_MISC_PARAMETERS ; +return 0 ; }
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +26 -5
@@ -422,7 +422,7 @@ static int mlx5e_alloc_rq(struct mlx5e_channel *c, err =mlx5_wq_ll_create (mdev, &rqp->wq, rqc_wq, &rq->mpwqe.wq, &rq->wq_ctrl);if (err) -return err; + goto err_rq_wq_destroy; rq->mpwqe.wq.db = &rq->mpwqe.wq.db[MLX5_RCV_DBR ];
@@ -475,7 +475,7 @@ static int mlx5e_alloc_rq(struct mlx5e_channel *c, err =mlx5_wq_cyc_create (mdev, &rqp->wq, rqc_wq, &rq->wqe.wq, &rq->wq_ctrl);if (err) -return err; + goto err_rq_wq_destroy; rq->wqe.wq.db = &rq->wqe.wq.db[MLX5_RCV_DBR ];
@@ -3041,6 +3041,25 @@ void mlx5e_timestamp_init(struct mlx5e_priv *priv) priv->tstamp.rx_filter =HWTSTAMP_FILTER_NONE ; } +static void mlx5e_modify_admin_state (struct mlx5_core_dev *mdev, +enum mlx5_port_status state) +{ +struct mlx5_eswitch *esw = mdev->priv.eswitch; +int vport_admin_state; + +mlx5_set_port_admin_status (mdev, state); + +if (!MLX5_ESWITCH_MANAGER (mdev) ||mlx5_eswitch_mode (esw) ==MLX5_ESWITCH_OFFLOADS ) +return ; + +if (state ==MLX5_PORT_UP ) + vport_admin_state =MLX5_VPORT_ADMIN_STATE_AUTO ; +else + vport_admin_state =MLX5_VPORT_ADMIN_STATE_DOWN ; + +mlx5_eswitch_set_vport_state (esw,MLX5_VPORT_UPLINK , vport_admin_state); +} +int mlx5e_open_locked (struct net_device *netdev) {struct mlx5e_priv *priv =netdev_priv (netdev);
@@ -3073,7 +3092,7 @@ int mlx5e_open(struct net_device *netdev)mutex_lock (&priv->state_lock); err =mlx5e_open_locked (netdev);if (!err) -mlx5_set_port_admin_status (priv->mdev,MLX5_PORT_UP ); +mlx5e_modify_admin_state (priv->mdev,MLX5_PORT_UP );mutex_unlock (&priv->state_lock);return err;
@@ -3107,7 +3126,7 @@ int mlx5e_close(struct net_device *netdev)return -ENODEV ;mutex_lock (&priv->state_lock); -mlx5_set_port_admin_status (priv->mdev,MLX5_PORT_DOWN ); +mlx5e_modify_admin_state (priv->mdev,MLX5_PORT_DOWN ); err =mlx5e_close_locked (netdev);mutex_unlock (&priv->state_lock);
@@ -5185,7 +5204,7 @@ static void mlx5e_nic_enable(struct mlx5e_priv *priv)/* Marking the link as currently not needed by the Driver */ if (!netif_running (netdev)) -mlx5_set_port_admin_status (mdev,MLX5_PORT_DOWN ); +mlx5e_modify_admin_state (mdev,MLX5_PORT_DOWN );mlx5e_set_netdev_mtu_boundaries (priv);mlx5e_set_dev_port_mtu (priv);
@@ -5395,6 +5414,8 @@ int mlx5e_attach_netdev(struct mlx5e_priv *priv) profile->cleanup_tx (priv); out: +set_bit (MLX5E_STATE_DESTROYING , &priv->state); +cancel_work_sync (&priv->update_stats_work);return err; }
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +2 -0
@@ -1922,6 +1922,8 @@ static void mlx5e_uplink_rep_enable(struct mlx5e_priv *priv)INIT_WORK (&rpriv->uplink_priv.reoffload_flows_work, mlx5e_tc_reoffload_flows_work); +mlx5_modify_vport_admin_state (mdev,MLX5_VPORT_STATE_OP_MOD_UPLINK , +0 ,0 ,MLX5_VPORT_ADMIN_STATE_AUTO );mlx5_lag_add (mdev, netdev); priv->events_nb.notifier_call = uplink_rep_async_event;mlx5_notifier_register (mdev, &priv->events_nb);
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +1 -0
@@ -2256,6 +2256,7 @@ static int __parse_cls_flower(struct mlx5e_priv *priv, match.key->vlan_priority); *match_level =MLX5_MATCH_L2 ; + spec->match_criteria_enable |=MLX5_MATCH_MISC_PARAMETERS ; } }
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +16 -11
@@ -2161,7 +2161,7 @@ int mlx5_eswitch_enable_locked(struct mlx5_eswitch *esw, int mode, int num_vfs)mlx5_reload_interface (esw->dev,MLX5_INTERFACE_PROTOCOL_IB );mlx5_reload_interface (esw->dev,MLX5_INTERFACE_PROTOCOL_ETH ); } - +esw_destroy_tsar (esw);return err; }
@@ -2206,8 +2206,6 @@ void mlx5_eswitch_disable_locked(struct mlx5_eswitch *esw, bool clear_vf)else if (esw->mode ==MLX5_ESWITCH_OFFLOADS )esw_offloads_disable (esw); -esw_destroy_tsar (esw); - old_mode = esw->mode; esw->mode =MLX5_ESWITCH_NONE ;
@@ -2217,6 +2215,8 @@ void mlx5_eswitch_disable_locked(struct mlx5_eswitch *esw, bool clear_vf)mlx5_reload_interface (esw->dev,MLX5_INTERFACE_PROTOCOL_IB );mlx5_reload_interface (esw->dev,MLX5_INTERFACE_PROTOCOL_ETH ); } +esw_destroy_tsar (esw); +if (clear_vf)mlx5_eswitch_clear_vf_vports_info (esw); }
@@ -2374,6 +2374,8 @@ int mlx5_eswitch_set_vport_state(struct mlx5_eswitch *esw, u16 vport, int link_state) {struct mlx5_vport *evport =mlx5_eswitch_get_vport (esw, vport); +int opmod =MLX5_VPORT_STATE_OP_MOD_ESW_VPORT ; +int other_vport =1 ;int err =0 ;if (!ESW_ALLOWED (esw))
@@ -2381,15 +2383,17 @@ int mlx5_eswitch_set_vport_state(struct mlx5_eswitch *esw,if (IS_ERR (evport))return PTR_ERR (evport); +if (vport ==MLX5_VPORT_UPLINK ) { + opmod =MLX5_VPORT_STATE_OP_MOD_UPLINK ; + other_vport =0 ; + vport =0 ; + }mutex_lock (&esw->state_lock); - err =mlx5_modify_vport_admin_state (esw->dev, -MLX5_VPORT_STATE_OP_MOD_ESW_VPORT , - vport,1 , link_state); + err =mlx5_modify_vport_admin_state (esw->dev, opmod, vport, other_vport, link_state);if (err) { -mlx5_core_warn (esw->dev, -"Failed to set vport %d link state, err = %d" , - vport, err); +mlx5_core_warn (esw->dev,"Failed to set vport %d link state, opmod = %d, err = %d" , + vport, opmod, err); goto unlock; }
@@ -2431,8 +2435,6 @@ int __mlx5_eswitch_set_vport_vlan(struct mlx5_eswitch *esw,struct mlx5_vport *evport =mlx5_eswitch_get_vport (esw, vport);int err =0 ; -if (!ESW_ALLOWED (esw)) -return -EPERM ;if (IS_ERR (evport))return PTR_ERR (evport);if (vlan >4095 || qos >7 )
@@ -2460,6 +2462,9 @@ int mlx5_eswitch_set_vport_vlan(struct mlx5_eswitch *esw,u8 set_flags =0 ;int err; +if (!ESW_ALLOWED (esw)) +return -EPERM ; +if (vlan || qos) set_flags =SET_VLAN_STRIP |SET_VLAN_INSERT ;
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +2 -0
@@ -684,6 +684,8 @@ static inline int mlx5_eswitch_enable(struct mlx5_eswitch *esw, int num_vfs) { rstatic inline void mlx5_eswitch_disable (struct mlx5_eswitch *esw,bool clear_vf) {}static inline bool mlx5_esw_lag_prereq (struct mlx5_core_dev *dev0,struct mlx5_core_dev *dev1) {return true; }static inline bool mlx5_eswitch_is_funcs_handler (struct mlx5_core_dev *dev) {return false; } +static inline +int mlx5_eswitch_set_vport_state (struct mlx5_eswitch *esw,u16 vport,int link_state) {return 0 ; }static inline const u32 *mlx5_esw_query_functions (struct mlx5_core_dev *dev) {return ERR_PTR (-EOPNOTSUPP );
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +3 -3
@@ -264,9 +264,6 @@ mlx5_eswitch_set_rule_source_port(struct mlx5_eswitch *esw, mlx5_eswitch_get_vport_metadata_mask()); spec->match_criteria_enable |=MLX5_MATCH_MISC_PARAMETERS_2 ; - misc =MLX5_ADDR_OF (fte_match_param, spec->match_criteria, misc_parameters); -if (memchr_inv (misc,0 ,MLX5_ST_SZ_BYTES (fte_match_set_misc))) - spec->match_criteria_enable |=MLX5_MATCH_MISC_PARAMETERS ; }else { misc =MLX5_ADDR_OF (fte_match_param, spec->match_value, misc_parameters);MLX5_SET (fte_match_set_misc, misc, source_port, attr->in_rep->vport);
@@ -381,6 +378,9 @@ mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw, flow_act.modify_hdr = attr->modify_hdr;if (split) { +if (MLX5_CAP_ESW_FLOWTABLE (esw->dev, flow_source) && + attr->in_rep->vport ==MLX5_VPORT_UPLINK ) + spec->flow_context.flow_source =MLX5_FLOW_CONTEXT_FLOW_SOURCE_UPLINK ; fdb =esw_vport_tbl_get (esw, attr); }else {if (attr->chain || attr->prio)
drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c +65 -13
125 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlxsw/core.c +5 -3
@@ -1814,7 +1814,7 @@ static int mlxsw_core_reg_access_emad(struct mlxsw_core *mlxsw_core, err =mlxsw_emad_reg_access (mlxsw_core, reg, payload, type, trans, bulk_list, cb, cb_priv, tid);if (err) { -kfree (trans); +kfree_rcu (trans, rcu);return err; }return 0 ;
@@ -2051,11 +2051,13 @@ void mlxsw_core_skb_receive(struct mlxsw_core *mlxsw_core, struct sk_buff *skb,break ; } } -rcu_read_unlock (); -if (!found) +if (!found) { +rcu_read_unlock (); goto drop; + } rxl->func (skb, local_port, rxl_item->priv); +rcu_read_unlock ();return ; drop:
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +26 -24
94 lines not on this page · raw message
drivers/net/ethernet/ni/nixge.c +5 -3
@@ -1298,19 +1298,21 @@ static int nixge_probe(struct platform_device *pdev)netif_napi_add (ndev, &priv->napi, nixge_poll,NAPI_POLL_WEIGHT ); err =nixge_of_get_resources (pdev);if (err) -return err; + goto free_netdev;__nixge_hw_set_mac_address (ndev); priv->tx_irq =platform_get_irq_byname (pdev,"tx" );if (priv->tx_irq <0 ) {netdev_err (ndev,"could not find 'tx' irq" ); -return priv->tx_irq; + err = priv->tx_irq; + goto free_netdev; } priv->rx_irq =platform_get_irq_byname (pdev,"rx" );if (priv->rx_irq <0 ) {netdev_err (ndev,"could not find 'rx' irq" ); -return priv->rx_irq; + err = priv->rx_irq; + goto free_netdev; } priv->coalesce_count_rx =XAXIDMA_DFT_RX_THRESHOLD ;
drivers/net/ethernet/pensando/ionic/ionic_lif.c +3 -1
@@ -1959,7 +1959,7 @@ int ionic_reset_queues(struct ionic_lif *lif, ionic_reset_cb cb, void *arg)netif_device_detach (lif->netdev); err =ionic_stop (lif->netdev);if (err) -return err; + goto reset_out; }if (cb)
@@ -1969,6 +1969,8 @@ int ionic_reset_queues(struct ionic_lif *lif, ionic_reset_cb cb, void *arg) err =ionic_open (lif->netdev);netif_device_attach (lif->netdev); } + +reset_out:mutex_unlock (&lif->queue_lock);return err;
drivers/net/ethernet/qlogic/qed/qed_int.c +2 -1
@@ -1180,7 +1180,8 @@ static int qed_int_attentions(struct qed_hwfn *p_hwfn) index, attn_bits, attn_acks, asserted_bits, deasserted_bits, p_sb_attn_sw->known_attn); }else if (asserted_bits ==0x100 ) { -DP_INFO (p_hwfn,"MFW indication via attention\n" ); +DP_VERBOSE (p_hwfn,NETIF_MSG_INTR , +"MFW indication via attention\n" ); }else {DP_VERBOSE (p_hwfn,NETIF_MSG_INTR ,"MFW indication [deassertion]\n" );
drivers/net/ethernet/renesas/ravb_main.c +24 -2
@@ -1444,6 +1444,7 @@ static void ravb_tx_timeout_work(struct work_struct *work) struct ravb_private *priv = container_of(work, struct ravb_private, work);struct net_device *ndev = priv->ndev; +int error;netif_tx_stop_all_queues (ndev);
@@ -1452,15 +1453,36 @@ static void ravb_tx_timeout_work(struct work_struct *work)ravb_ptp_stop (ndev);/* Wait for DMA stopping */ -ravb_stop_dma (ndev); +if (ravb_stop_dma (ndev)) { +/* If ravb_stop_dma() fails, the hardware is still operating +* for TX and/or RX. So, this should not call the following +* functions because ravb_dmac_init() is possible to fail too. +* Also, this should not retry ravb_stop_dma() again and again +* here because it's possible to wait forever. So, this just +* re-enables the TX and RX and skip the following +* re-initialization procedure. +*/ +ravb_rcv_snd_enable (ndev); + goto out; + }ravb_ring_free (ndev,RAVB_BE );ravb_ring_free (ndev,RAVB_NC );/* Device init */ -ravb_dmac_init (ndev); + error =ravb_dmac_init (ndev); +if (error) { +/* If ravb_dmac_init() fails, descriptors are freed. So, this +* should return here to avoid re-enabling the TX and RX in +* ravb_emac_init(). +*/ +netdev_err (ndev,"%s: ravb_dmac_init() failed, error %d\n" , + __func__, error); +return ; + }ravb_emac_init (ndev); +out:/* Initialise PTP Clock driver */ if (priv->chip_id ==RCAR_GEN2 )ravb_ptp_init (ndev, priv->pdev);
drivers/net/usb/hso.c +3 -2
@@ -1390,8 +1390,9 @@ static void hso_serial_set_termios(struct tty_struct *tty, struct ktermios *old)unsigned long flags;if (old) -hso_dbg (0x16 ,"Termios called with: cflags new[%d] - old[%d]\n" , - tty->termios.c_cflag, old->c_cflag); +hso_dbg (0x16 ,"Termios called with: cflags new[%u] - old[%u]\n" , + (unsigned int )tty->termios.c_cflag, + (unsigned int )old->c_cflag);/* the actual setup */ spin_lock_irqsave (&serial->serial_lock, flags);
drivers/net/usb/lan78xx.c +6 -0
@@ -3759,6 +3759,11 @@ static int lan78xx_probe(struct usb_interface *intf, netdev->max_mtu =MAX_SINGLE_PACKET_SIZE ;netif_set_gso_max_size (netdev,MAX_SINGLE_PACKET_SIZE -MAX_HEADER ); +if (intf->cur_altsetting->desc.bNumEndpoints <3 ) { + ret = -ENODEV ; + goto out3; + } + dev->ep_blkin = (intf->cur_altsetting)->endpoint +0 ; dev->ep_blkout = (intf->cur_altsetting)->endpoint +1 ; dev->ep_intr = (intf->cur_altsetting)->endpoint +2 ;
@@ -3783,6 +3788,7 @@ static int lan78xx_probe(struct usb_interface *intf,usb_fill_int_urb (dev->urb_intr, dev->udev, dev->pipe_intr, buf, maxp, intr_complete, dev, period); + dev->urb_intr->transfer_flags |=URB_FREE_BUFFER ; } }
drivers/net/vxlan.c +4 -2
@@ -2863,8 +2863,10 @@ static void vxlan_flush(struct vxlan_dev *vxlan, bool do_all)if (!do_all && (f->state & (NUD_PERMANENT |NUD_NOARP )))continue ;/* the all_zeros_mac entry is deleted at vxlan_uninit */ -if (!is_zero_ether_addr (f->eth_addr)) -vxlan_fdb_destroy (vxlan, f, true, true); +if (is_zero_ether_addr (f->eth_addr) && + f->vni == vxlan->cfg.vni) +continue ; +vxlan_fdb_destroy (vxlan, f, true, true); }spin_unlock_bh (&vxlan->hash_lock[h]); }
drivers/net/wan/hdlc_x25.c +3 -1
@@ -71,8 +71,10 @@ static int x25_data_indication(struct net_device *dev, struct sk_buff *skb) {unsigned char *ptr; -if (skb_cow (skb,1 )) +if (skb_cow (skb,1 )) { +kfree_skb (skb);return NET_RX_DROP ; + }skb_push (skb,1 );skb_reset_network_header (skb);
drivers/net/wan/lapbether.c +5 -3
@@ -128,10 +128,12 @@ static int lapbeth_data_indication(struct net_device *dev, struct sk_buff *skb) {unsigned char *ptr; -skb_push (skb,1 ); - -if (skb_cow (skb,1 )) +if (skb_cow (skb,1 )) { +kfree_skb (skb);return NET_RX_DROP ; + } + +skb_push (skb,1 ); ptr = skb->data; *ptr =X25_IFACE_DATA ;
drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c +14 -2
@@ -263,6 +263,8 @@ static int iwl_dbg_tlv_alloc_trigger(struct iwl_trans *trans, {struct iwl_fw_ini_trigger_tlv *trig = (void *)tlv->data;u32 tp =le32_to_cpu (trig->time_point); +struct iwl_ucode_tlv *dup =NULL ; +int ret;if (le32_to_cpu (tlv->length) <sizeof (*trig))return -EINVAL ;
@@ -275,10 +277,20 @@ static int iwl_dbg_tlv_alloc_trigger(struct iwl_trans *trans,return -EINVAL ; } -if (!le32_to_cpu (trig->occurrences)) +if (!le32_to_cpu (trig->occurrences)) { + dup =kmemdup (tlv,sizeof (*tlv) +le32_to_cpu (tlv->length), +GFP_KERNEL ); +if (!dup) +return -ENOMEM ; + trig = (void *)dup->data; trig->occurrences =cpu_to_le32 (-1 ); + tlv = dup; + } + + ret =iwl_dbg_tlv_add (tlv, &trans->dbg.time_point[tp].trig_list); +kfree (dup); -return iwl_dbg_tlv_add (tlv, &trans->dbg.time_point[tp].trig_list); +return ret; } static int (*dbg_tlv_alloc[])(struct iwl_trans *trans,
drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c +5 -4
@@ -206,10 +206,11 @@ mt7615_queues_acq(struct seq_file *s, void *data)int i;for (i =0 ; i <16 ; i++) { -int j, acs = i /4 , index = i %4 ; +int j, wmm_idx = i %MT7615_MAX_WMM_SETS ; +int acs = i /MT7615_MAX_WMM_SETS ;u32 ctrl, val, qlen =0 ; - val =mt76_rr (dev,MT_PLE_AC_QEMPTY (acs, index)); + val =mt76_rr (dev,MT_PLE_AC_QEMPTY (acs, wmm_idx)); ctrl =BIT (31 ) |BIT (15 ) | (acs <<8 );for (j =0 ; j <32 ; j++) {
@@ -217,11 +218,11 @@ mt7615_queues_acq(struct seq_file *s, void *data)continue ;mt76_wr (dev,MT_PLE_FL_Q0_CTRL , - ctrl | (j + (index <<5 ))); + ctrl | (j + (wmm_idx <<5 ))); qlen +=mt76_get_field (dev,MT_PLE_FL_Q3_CTRL ,GENMASK (11 ,0 )); } -seq_printf (s,"AC%d%d: queued=%d\n" , acs, index, qlen); +seq_printf (s,"AC%d%d: queued=%d\n" , wmm_idx, acs, qlen); }return 0 ;
drivers/net/xen-netfront.c +42 -22
88 lines not on this page · raw message
drivers/nfc/s3fwrn5/core.c +1 -0
@@ -198,6 +198,7 @@ int s3fwrn5_recv_frame(struct nci_dev *ndev, struct sk_buff *skb,case S3FWRN5_MODE_FW :return s3fwrn5_fw_recv_frame (ndev, skb);default : +kfree_skb (skb);return -ENODEV ; } }
drivers/nvme/host/core.c +3 -12
@@ -1106,6 +1106,9 @@ static int nvme_identify_ns_descs(struct nvme_ctrl *ctrl, unsigned nsid,int pos;int len; +if (ctrl->quirks &NVME_QUIRK_NO_NS_DESC_LIST ) +return 0 ; + c.identify.opcode = nvme_admin_identify; c.identify.nsid =cpu_to_le32 (nsid); c.identify.cns =NVME_ID_CNS_NS_DESC_LIST ;
@@ -1119,18 +1122,6 @@ static int nvme_identify_ns_descs(struct nvme_ctrl *ctrl, unsigned nsid,if (status) {dev_warn (ctrl->device,"Identify Descriptors failed (%d)\n" , status); -/* -* Don't treat non-retryable errors as fatal, as we potentially -* already have a NGUID or EUI-64. If we failed with DNR set, -* we want to silently ignore the error as we can still -* identify the device, but if the status has DNR set, we want -* to propagate the error back specifically for the disk -* revalidation flow to make sure we don't abandon the -* device just because of a temporal retry-able error (such -* as path of transport errors). -*/ -if (status >0 && (status &NVME_SC_DNR )) - status =0 ; goto free_data; }
drivers/nvme/host/nvme.h +7 -0
@@ -126,6 +126,13 @@ enum nvme_quirks {* Don't change the value of the temperature threshold feature */ NVME_QUIRK_NO_TEMP_THRESH_CHANGE = (1 <<14 ), + +/* +* The controller doesn't handle the Identify Namespace +* Identification Descriptor list subcommand despite claiming +* NVMe 1.3 compliance. +*/ + NVME_QUIRK_NO_NS_DESC_LIST = (1 << 15), };/*
drivers/nvme/host/pci.c +2 -0
@@ -3105,6 +3105,8 @@ static const struct pci_device_id nvme_id_table[] = { { PCI_VDEVICE(INTEL, 0x5845), /* Qemu emulated controller */ .driver_data =NVME_QUIRK_IDENTIFY_CNS | NVME_QUIRK_DISABLE_WRITE_ZEROES, }, + { PCI_DEVICE(0x126f, 0x2263), /* Silicon Motion unidentified */ + .driver_data = NVME_QUIRK_NO_NS_DESC_LIST, }, { PCI_DEVICE(0x1bb1, 0x0100), /* Seagate Nytro Flash Storage */ .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY, }, { PCI_DEVICE(0x1c58, 0x0003), /* HGST adapter */
drivers/nvme/host/tcp.c +3 -0
@@ -1392,6 +1392,9 @@ static int nvme_tcp_alloc_queue(struct nvme_ctrl *nctrl, } } +/* Set 10 seconds timeout for icresp recvmsg */ + queue->sock->sk->sk_rcvtimeo =10 *HZ ; + queue->sock->sk->sk_allocation =GFP_ATOMIC ;nvme_tcp_set_queue_io_cpu (queue); queue->request =NULL ;
drivers/pci/quirks.c +13 -0
@@ -2330,6 +2330,19 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10f1, quirk_disable_aspm_l0s);DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x10f4 , quirk_disable_aspm_l0s);DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x1508 , quirk_disable_aspm_l0s); +static void quirk_disable_aspm_l0s_l1 (struct pci_dev *dev) +{ +pci_info (dev,"Disabling ASPM L0s/L1\n" ); +pci_disable_link_state (dev,PCIE_LINK_STATE_L0S |PCIE_LINK_STATE_L1 ); +} + +/* +* ASM1083/1085 PCIe-PCI bridge devices cause AER timeout errors on the +* upstream PCIe root port when ASPM is enabled. At least L0s mode is affected; +* disable both L0s and L1 for now to be safe. +*/ +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_ASMEDIA ,0x1080 , quirk_disable_aspm_l0s_l1); +/* * Some Pericom PCIe-to-PCI bridges in reverse mode need the PCIe Retrain * Link bit cleared after starting the link retrain process to allow this
drivers/pinctrl/qcom/Kconfig +2 -0
@@ -7,6 +7,8 @@ config PINCTRL_MSM select PINCONF select GENERIC_PINCONF select GPIOLIB_IRQCHIP + select IRQ_DOMAIN_HIERARCHY + select IRQ_FASTEOI_HIERARCHY_HANDLERS config PINCTRL_APQ8064 tristate "Qualcomm APQ8064 pin controller driver"
drivers/pinctrl/qcom/pinctrl-msm.c +72 -2
103 lines not on this page · raw message
drivers/pinctrl/qcom/pinctrl-msm.h +4 -0
@@ -113,6 +113,9 @@ struct msm_gpio_wakeirq_map {* @pull_no_keeper: The SoC does not support keeper bias. * @wakeirq_map: The map of wakeup capable GPIOs and the pin at PDC/MPM * @nwakeirq_map: The number of entries in @wakeirq_map +* @wakeirq_dual_edge_errata: If true then GPIOs using the wakeirq_map need +* to be aware that their parent can't handle dual +* edge interrupts. */ struct msm_pinctrl_soc_data {const struct pinctrl_pin_desc *pins;
@@ -128,6 +131,7 @@ struct msm_pinctrl_soc_data {const int *reserved_gpios;const struct msm_gpio_wakeirq_map *wakeirq_map;unsigned int nwakeirq_map; +bool wakeirq_dual_edge_errata; };extern const struct dev_pm_ops msm_pinctrl_dev_pm_ops;
drivers/pinctrl/qcom/pinctrl-sc7180.c +1 -0
@@ -1147,6 +1147,7 @@ static const struct msm_pinctrl_soc_data sc7180_pinctrl = { .ntiles = ARRAY_SIZE(sc7180_tiles), .wakeirq_map = sc7180_pdc_map, .nwakeirq_map = ARRAY_SIZE(sc7180_pdc_map), + .wakeirq_dual_edge_errata = true, };static int sc7180_pinctrl_probe (struct platform_device *pdev)
drivers/scsi/scsi_lib.c +11 -5
@@ -564,6 +564,15 @@ static void scsi_mq_uninit_cmd(struct scsi_cmnd *cmd)scsi_uninit_cmd (cmd); } +static void scsi_run_queue_async (struct scsi_device *sdev) +{ +if (scsi_target (sdev)->single_lun || + !list_empty (&sdev->host->starved_list)) +kblockd_schedule_work (&sdev->requeue_work); +else +blk_mq_run_hw_queues (sdev->request_queue, true); +} +/* Returns false when no more bytes to process, true if there are more */ static bool scsi_end_request (struct request *req,blk_status_t error,unsigned int bytes)
@@ -608,11 +617,7 @@ static bool scsi_end_request(struct request *req, blk_status_t error,__blk_mq_end_request (req, error); -if (scsi_target (sdev)->single_lun || - !list_empty (&sdev->host->starved_list)) -kblockd_schedule_work (&sdev->requeue_work); -else -blk_mq_run_hw_queues (q, true); +scsi_run_queue_async (sdev);percpu_ref_put (&q->q_usage_counter);return false;
@@ -1706,6 +1711,7 @@ static blk_status_t scsi_queue_rq(struct blk_mq_hw_ctx *hctx,*/ if (req->rq_flags &RQF_DONTPREP )scsi_mq_uninit_cmd (cmd); +scsi_run_queue_async (sdev);break ; }return ret;
drivers/vhost/scsi.c +1 -1
@@ -1215,7 +1215,7 @@ vhost_scsi_ctl_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq)continue ; } -switch (v_req.type) { +switch (vhost32_to_cpu (vq, v_req.type)) {case VIRTIO_SCSI_T_TMF : vc.req = &v_req.tmf; vc.req_size =sizeof (struct virtio_scsi_ctrl_tmf_req );
drivers/virtio/virtio_balloon.c +5 -1
@@ -578,10 +578,14 @@ static int init_vqs(struct virtio_balloon *vb)static u32 virtio_balloon_cmd_id_received (struct virtio_balloon *vb) {if (test_and_clear_bit (VIRTIO_BALLOON_CONFIG_READ_CMD_ID , - &vb->config_read_bitmap)) + &vb->config_read_bitmap)) { virtio_cread(vb->vdev, struct virtio_balloon_config, free_page_hint_cmd_id, &vb->cmd_id_received_cache); +/* Legacy balloon config space is LE, unlike all other devices. */ +if (!virtio_has_feature (vb->vdev,VIRTIO_F_VERSION_1 )) + vb->cmd_id_received_cache =le32_to_cpu ((__force __le32 )vb->cmd_id_received_cache); + }return vb->cmd_id_received_cache; }
fs/io_uring.c +9 -4
@@ -4808,7 +4808,9 @@ static int io_timeout_remove_prep(struct io_kiocb *req, {if (unlikely (req->ctx->flags &IORING_SETUP_IOPOLL ))return -EINVAL ; -if (sqe->flags || sqe->ioprio || sqe->buf_index || sqe->len) +if (unlikely (req->flags & (REQ_F_FIXED_FILE |REQ_F_BUFFER_SELECT ))) +return -EINVAL ; +if (sqe->ioprio || sqe->buf_index || sqe->len)return -EINVAL ; req->timeout.addr =READ_ONCE (sqe->addr);
@@ -5014,8 +5016,9 @@ static int io_async_cancel_prep(struct io_kiocb *req, {if (unlikely (req->ctx->flags &IORING_SETUP_IOPOLL ))return -EINVAL ; -if (sqe->flags || sqe->ioprio || sqe->off || sqe->len || - sqe->cancel_flags) +if (unlikely (req->flags & (REQ_F_FIXED_FILE |REQ_F_BUFFER_SELECT ))) +return -EINVAL ; +if (sqe->ioprio || sqe->off || sqe->len || sqe->cancel_flags)return -EINVAL ; req->cancel.addr =READ_ONCE (sqe->addr);
@@ -5033,7 +5036,9 @@ static int io_async_cancel(struct io_kiocb *req)static int io_files_update_prep (struct io_kiocb *req,const struct io_uring_sqe *sqe) { -if (sqe->flags || sqe->ioprio || sqe->rw_flags) +if (unlikely (req->flags & (REQ_F_FIXED_FILE |REQ_F_BUFFER_SELECT ))) +return -EINVAL ; +if (sqe->ioprio || sqe->rw_flags)return -EINVAL ; req->files_update.offset =READ_ONCE (sqe->off);
include/linux/mlx5/mlx5_ifc.h +1 -0
@@ -4347,6 +4347,7 @@ struct mlx5_ifc_query_vport_state_out_bits {enum {MLX5_VPORT_STATE_OP_MOD_VNIC_VPORT =0x0 ,MLX5_VPORT_STATE_OP_MOD_ESW_VPORT =0x1 , +MLX5_VPORT_STATE_OP_MOD_UPLINK =0x2 , };struct mlx5_ifc_arm_monitor_counter_in_bits {
include/linux/rhashtable.h +13 -12
@@ -349,11 +349,11 @@ static inline void rht_unlock(struct bucket_table *tbl,local_bh_enable (); } -static inline struct rhash_head __rcu *__rht_ptr ( -struct rhash_lock_head *const *bkt) +static inline struct rhash_head *__rht_ptr ( +struct rhash_lock_head *p,struct rhash_lock_head __rcu *const *bkt) { -return (struct rhash_head __rcu *) - ((unsigned long )*bkt & ~BIT (0 ) ?: +return (struct rhash_head *) + ((unsigned long )p & ~BIT (0 ) ?: (unsigned long )RHT_NULLS_MARKER (bkt)); }
@@ -365,25 +365,26 @@ static inline struct rhash_head __rcu *__rht_ptr(* access is guaranteed, such as when destroying the table. */ static inline struct rhash_head *rht_ptr_rcu ( -struct rhash_lock_head *const *bkt) +struct rhash_lock_head *const *p) { -struct rhash_head __rcu *p =__rht_ptr (bkt); - -return rcu_dereference (p); +struct rhash_lock_head __rcu *const *bkt = (void *)p; +return __rht_ptr (rcu_dereference (*bkt), bkt); }static inline struct rhash_head *rht_ptr ( -struct rhash_lock_head *const *bkt, +struct rhash_lock_head *const *p,struct bucket_table *tbl,unsigned int hash) { -return rht_dereference_bucket (__rht_ptr (bkt), tbl, hash); +struct rhash_lock_head __rcu *const *bkt = (void *)p; +return __rht_ptr (rht_dereference_bucket (*bkt, tbl, hash), bkt); }static inline struct rhash_head *rht_ptr_exclusive ( -struct rhash_lock_head *const *bkt) +struct rhash_lock_head *const *p) { -return rcu_dereference_protected (__rht_ptr (bkt),1 ); +struct rhash_lock_head __rcu *const *bkt = (void *)p; +return __rht_ptr (rcu_dereference_protected (*bkt,1 ), bkt); } static inline void rht_assign_locked(struct rhash_lock_head **bkt,
include/net/xfrm.h +9 -6
@@ -946,7 +946,7 @@ struct xfrm_dst {static inline struct dst_entry *xfrm_dst_path (const struct dst_entry *dst) {#ifdef CONFIG_XFRM -if (dst->xfrm) { +if (dst->xfrm || (dst->flags &DST_XFRM_QUEUE )) {const struct xfrm_dst *xdst = (const struct xfrm_dst *) dst;return xdst->path;
@@ -958,7 +958,7 @@ static inline struct dst_entry *xfrm_dst_path(const struct dst_entry *dst)static inline struct dst_entry *xfrm_dst_child (const struct dst_entry *dst) {#ifdef CONFIG_XFRM -if (dst->xfrm) { +if (dst->xfrm || (dst->flags &DST_XFRM_QUEUE )) {struct xfrm_dst *xdst = (struct xfrm_dst *) dst;return xdst->child; }
@@ -1633,13 +1633,16 @@ int xfrm_policy_walk(struct net *net, struct xfrm_policy_walk *walk, void *);void xfrm_policy_walk_done (struct xfrm_policy_walk *walk,struct net *net);int xfrm_policy_insert (int dir,struct xfrm_policy *policy,int excl); -struct xfrm_policy *xfrm_policy_bysel_ctx (struct net *net,u32 mark,u32 if_id, -u8 type,int dir, +struct xfrm_policy *xfrm_policy_bysel_ctx (struct net *net, +const struct xfrm_mark *mark, +u32 if_id,u8 type,int dir,struct xfrm_selector *sel,struct xfrm_sec_ctx *ctx,int delete,int *err); -struct xfrm_policy *xfrm_policy_byid (struct net *net,u32 mark,u32 if_id,u8 , -int dir,u32 id,int delete,int *err); +struct xfrm_policy *xfrm_policy_byid (struct net *net, +const struct xfrm_mark *mark,u32 if_id, +u8 type,int dir,u32 id,int delete, +int *err);int xfrm_policy_flush (struct net *net,u8 type,bool task_valid);void xfrm_policy_hash_rebuild (struct net *net);u32 xfrm_get_acqseq (void );
include/rdma/rdmavt_qp.h +19 -0
@@ -278,6 +278,25 @@ struct rvt_rq {spinlock_t lock____cacheline_aligned_in_smp ; }; +/** +* rvt_get_rq_count - count numbers of request work queue entries +* in circular buffer +* @rq: data structure for request queue entry +* @head: head indices of the circular buffer +* @tail: tail indices of the circular buffer +* +* Return - total number of entries in the Receive Queue +*/ + +static inline u32 rvt_get_rq_count (struct rvt_rq *rq,u32 head,u32 tail) +{ +u32 count = head - tail; + +if ((s32 )count <0 ) + count += rq->size; +return count; +} +/* * This structure holds the information that the send tasklet needs * to send a RDMA read response or atomic operation.
kernel/audit.c +0 -1
@@ -1811,7 +1811,6 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, }audit_get_stamp (ab->ctx, &t, &serial); -audit_clear_dummy (ab->ctx);audit_log_format (ab,"audit(%llu.%03lu:%u): " , (unsigned long long )t.tv_sec, t.tv_nsec/1000000 , serial);
kernel/audit.h +0 -8
@@ -290,13 +290,6 @@ extern int audit_signal_info_syscall(struct task_struct *t);extern void audit_filter_inodes (struct task_struct *tsk,struct audit_context *ctx);extern struct list_head *audit_killed_trees (void ); - -static inline void audit_clear_dummy (struct audit_context *ctx) -{ -if (ctx) - ctx->dummy =0 ; -} -#else /* CONFIG_AUDITSYSCALL */ #define auditsc_get_stamp (c, t, s) 0#define audit_put_watch (w) {}
@@ -330,7 +323,6 @@ static inline int audit_signal_info_syscall(struct task_struct *t) }#define audit_filter_inodes (t, c) AUDIT_DISABLED -#define audit_clear_dummy (c) {}#endif /* CONFIG_AUDITSYSCALL */ extern char *audit_unpack_string (void **bufp,size_t *remain,size_t len);
kernel/auditsc.c +3 -0
@@ -1406,6 +1406,9 @@ static void audit_log_proctitle(void)struct audit_context *context =audit_context ();struct audit_buffer *ab; +if (!context || context->dummy) +return ; + ab =audit_log_start (context,GFP_KERNEL ,AUDIT_PROCTITLE );if (!ab)return ;/* audit_panic or being filtered */
kernel/bpf/hashtab.c +9 -3
@@ -779,15 +779,20 @@ static void htab_elem_free_rcu(struct rcu_head *head)htab_elem_free (htab, l); } -static void free_htab_elem (struct bpf_htab *htab,struct htab_elem *l) +static void htab_put_fd_value (struct bpf_htab *htab,struct htab_elem *l) {struct bpf_map *map = &htab->map; +void *ptr;if (map->ops->map_fd_put_ptr) { -void *ptr =fd_htab_map_get_ptr (map, l); - + ptr =fd_htab_map_get_ptr (map, l); map->ops->map_fd_put_ptr (ptr); } +} + +static void free_htab_elem (struct bpf_htab *htab,struct htab_elem *l) +{ +htab_put_fd_value (htab, l);if (htab_is_prealloc (htab)) {__pcpu_freelist_push (&htab->freelist, &l->fnode);
@@ -839,6 +844,7 @@ static struct htab_elem *alloc_htab_elem(struct bpf_htab *htab, void *key,*/ pl_new =this_cpu_ptr (htab->extra_elems); l_new = *pl_new; +htab_put_fd_value (htab, old_elem); *pl_new = old_elem; }else {struct pcpu_freelist_node *l;
net/9p/trans_fd.c +14 -1
@@ -362,6 +362,10 @@ static void p9_read_work(struct work_struct *work)if (m->rreq->status ==REQ_STATUS_SENT ) {list_del (&m->rreq->req_list);p9_client_cb (m->client, m->rreq,REQ_STATUS_RCVD ); + }else if (m->rreq->status ==REQ_STATUS_FLSHD ) { +/* Ignore replies associated with a cancelled request. */ +p9_debug (P9_DEBUG_TRANS , +"Ignore replies associated with a cancelled request\n" ); }else {spin_unlock (&m->client->lock); p9_debug(P9_DEBUG_ERROR,
@@ -703,11 +707,20 @@ static int p9_fd_cancelled(struct p9_client *client, struct p9_req_t *req) {p9_debug (P9_DEBUG_TRANS ,"client %p req %p\n" , client, req); +spin_lock (&client->lock); +/* Ignore cancelled request if message has been received +* before lock. +*/ +if (req->status ==REQ_STATUS_RCVD ) { +spin_unlock (&client->lock); +return 0 ; + } +/* we haven't received a response for oldreq, * remove it from the list. */ -spin_lock (&client->lock);list_del (&req->req_list); + req->status =REQ_STATUS_FLSHD ;spin_unlock (&client->lock);p9_req_put (req);
net/bluetooth/hci_event.c +19 -7
@@ -1305,6 +1305,9 @@ static void store_pending_adv_report(struct hci_dev *hdev, bdaddr_t *bdaddr, {struct discovery_state *d = &hdev->discovery; +if (len >HCI_MAX_AD_LENGTH ) +return ; +bacpy (&d->last_adv_addr, bdaddr); d->last_adv_addr_type = bdaddr_type; d->last_adv_rssi = rssi;
@@ -5317,7 +5320,8 @@ static struct hci_conn *check_pending_le_conn(struct hci_dev *hdev,static void process_adv_report (struct hci_dev *hdev,u8 type,bdaddr_t *bdaddr,u8 bdaddr_type,bdaddr_t *direct_addr, -u8 direct_addr_type,s8 rssi,u8 *data,u8 len) +u8 direct_addr_type,s8 rssi,u8 *data,u8 len, +bool ext_adv) {struct discovery_state *d = &hdev->discovery;struct smp_irk *irk;
@@ -5339,6 +5343,11 @@ static void process_adv_report(struct hci_dev *hdev, u8 type, bdaddr_t *bdaddr,return ; } +if (!ext_adv && len >HCI_MAX_AD_LENGTH ) { +bt_dev_err_ratelimited (hdev,"legacy adv larger than 31 bytes" ); +return ; + } +/* Find the end of the data in case the report contains padded zero * bytes at the end causing an invalid length value. *
@@ -5398,7 +5407,7 @@ static void process_adv_report(struct hci_dev *hdev, u8 type, bdaddr_t *bdaddr,*/ conn =check_pending_le_conn (hdev, bdaddr, bdaddr_type, type, direct_addr); -if (conn && type ==LE_ADV_IND ) { +if (!ext_adv && conn && type ==LE_ADV_IND && len <=HCI_MAX_AD_LENGTH ) {/* Store report for later inclusion by * mgmt_device_connected */
@@ -5452,7 +5461,7 @@ static void process_adv_report(struct hci_dev *hdev, u8 type, bdaddr_t *bdaddr,* event or send an immediate device found event if the data * should not be stored for later. */ -if (!has_pending_adv_report (hdev)) { +if (!ext_adv && !has_pending_adv_report (hdev)) {/* If the report will trigger a SCAN_REQ store it for * later merging. */
@@ -5487,7 +5496,8 @@ static void process_adv_report(struct hci_dev *hdev, u8 type, bdaddr_t *bdaddr,/* If the new report will trigger a SCAN_REQ store it for * later merging. */ -if (type ==LE_ADV_IND || type ==LE_ADV_SCAN_IND ) { +if (!ext_adv && (type ==LE_ADV_IND || + type ==LE_ADV_SCAN_IND )) {store_pending_adv_report (hdev, bdaddr, bdaddr_type, rssi, flags, data, len);return ;
@@ -5527,7 +5537,7 @@ static void hci_le_adv_report_evt(struct hci_dev *hdev, struct sk_buff *skb) rssi = ev->data[ev->length];process_adv_report (hdev, ev->evt_type, &ev->bdaddr, ev->bdaddr_type,NULL ,0 , rssi, - ev->data, ev->length); + ev->data, ev->length, false); }else {bt_dev_err (hdev,"Dropping invalid advertising data" ); }
@@ -5599,7 +5609,8 @@ static void hci_le_ext_adv_report_evt(struct hci_dev *hdev, struct sk_buff *skb)if (legacy_evt_type !=LE_ADV_INVALID ) {process_adv_report (hdev, legacy_evt_type, &ev->bdaddr, ev->bdaddr_type,NULL ,0 , ev->rssi, - ev->data, ev->length); + ev->data, ev->length, + !(evt_type &LE_EXT_ADV_LEGACY_PDU )); } ptr +=sizeof (*ev) + ev->length;
@@ -5797,7 +5808,8 @@ static void hci_le_direct_adv_report_evt(struct hci_dev *hdev,process_adv_report (hdev, ev->evt_type, &ev->bdaddr, ev->bdaddr_type, &ev->direct_addr, - ev->direct_addr_type, ev->rssi,NULL ,0 ); + ev->direct_addr_type, ev->rssi,NULL ,0 , + false); ptr +=sizeof (*ev); }
net/key/af_key.c +2 -2
@@ -2400,7 +2400,7 @@ static int pfkey_spddelete(struct sock *sk, struct sk_buff *skb, const struct sareturn err; } - xp =xfrm_policy_bysel_ctx (net,DUMMY_MARK ,0 ,XFRM_POLICY_TYPE_MAIN , + xp =xfrm_policy_bysel_ctx (net, &dummy_mark,0 ,XFRM_POLICY_TYPE_MAIN , pol->sadb_x_policy_dir -1 , &sel, pol_ctx,1 , &err);security_xfrm_policy_free (pol_ctx);
@@ -2651,7 +2651,7 @@ static int pfkey_spdget(struct sock *sk, struct sk_buff *skb, const struct sadb_return -EINVAL ; delete = (hdr->sadb_msg_type ==SADB_X_SPDDELETE2 ); - xp =xfrm_policy_byid (net,DUMMY_MARK ,0 ,XFRM_POLICY_TYPE_MAIN , + xp =xfrm_policy_byid (net, &dummy_mark,0 ,XFRM_POLICY_TYPE_MAIN , dir, pol->sadb_x_policy_id, delete, &err);if (xp ==NULL )return -ENOENT ;
net/mac80211/cfg.c +1 -0
@@ -2140,6 +2140,7 @@ static int ieee80211_leave_mesh(struct wiphy *wiphy, struct net_device *dev)ieee80211_stop_mesh (sdata);mutex_lock (&sdata->local->mtx);ieee80211_vif_release_channel (sdata); +kfree (sdata->u.mesh.ie);mutex_unlock (&sdata->local->mtx);return 0 ;
net/mac80211/mesh_pathtbl.c +1 -0
@@ -521,6 +521,7 @@ static void mesh_path_free_rcu(struct mesh_table *tbl,del_timer_sync (&mpath->timer);atomic_dec (&sdata->u.mesh.mpaths);atomic_dec (&tbl->entries); +mesh_path_flush_pending (mpath);kfree_rcu (mpath, rcu); }
net/rds/recv.c +2 -1
@@ -450,12 +450,13 @@ static int rds_still_queued(struct rds_sock *rs, struct rds_incoming *inc,int rds_notify_queue_get (struct rds_sock *rs,struct msghdr *msghdr) {struct rds_notifier *notifier; -struct rds_rdma_notify cmsg = {0 };/* fill holes with zero */ +struct rds_rdma_notify cmsg;unsigned int count =0 , max_messages = ~0U ;unsigned long flags;LIST_HEAD (copy);int err =0 ; +memset (&cmsg,0 ,sizeof (cmsg));/* fill holes with zero */ /* put_cmsg copies to user space and thus may sleep. We can't do this * with rs_lock held, so first grab as many notifications as we can stuff
net/sunrpc/sunrpc.h +1 -0
@@ -52,4 +52,5 @@ static inline int sock_is_loopback(struct sock *sk)int rpc_clients_notifier_register (void );void rpc_clients_notifier_unregister (void ); +void auth_domain_cleanup (void );#endif /* _NET_SUNRPC_SUNRPC_H */
net/sunrpc/sunrpc_syms.c +2 -0
@@ -23,6 +23,7 @@#include <linux/sunrpc/rpc_pipe_fs.h> #include <linux/sunrpc/xprtsock.h> +#include "sunrpc.h" #include "netns.h" unsigned int sunrpc_net_id;
@@ -131,6 +132,7 @@ cleanup_sunrpc(void)unregister_rpc_pipefs ();rpc_destroy_mempool ();unregister_pernet_subsys (&sunrpc_net_ops); +auth_domain_cleanup ();#if IS_ENABLED (CONFIG_SUNRPC_DEBUG )rpc_unregister_sysctl ();#endif
net/sunrpc/svcauth.c +25 -0
@@ -21,6 +21,8 @@#include <trace/events/sunrpc.h> +#include "sunrpc.h" +#define RPCDBG_FACILITY RPCDBG_AUTH
@@ -205,3 +207,26 @@ struct auth_domain *auth_domain_find(char *name)return NULL ; }EXPORT_SYMBOL_GPL (auth_domain_find); + +/** +* auth_domain_cleanup - check that the auth_domain table is empty +* +* On module unload the auth_domain_table must be empty. To make it +* easier to catch bugs which don't clean up domains properly, we +* warn if anything remains in the table at cleanup time. +* +* Note that we cannot proactively remove the domains at this stage. +* The ->release() function might be in a module that has already been +* unloaded. +*/ + +void auth_domain_cleanup (void ) +{ +int h; +struct auth_domain *hp; + +for (h =0 ; h <DN_HASHMAX ; h++) +hlist_for_each_entry (hp, &auth_domain_table[h], hash) +pr_warn ("svc: domain %s still present at module unload.\n" , + hp->name); +}
net/x25/x25_subr.c +6 -0
@@ -363,6 +363,12 @@ void x25_disconnect(struct sock *sk, int reason, unsigned char cause, x25->neighbour =NULL ;read_unlock_bh (&x25_list_lock); } +if (x25->neighbour) { +read_lock_bh (&x25_list_lock); +x25_neigh_put (x25->neighbour); + x25->neighbour =NULL ; +read_unlock_bh (&x25_list_lock); + } }/*
net/xfrm/espintcp.c +28 -2
@@ -41,9 +41,32 @@ static void espintcp_rcv(struct strparser *strp, struct sk_buff *skb) struct espintcp_ctx *ctx = container_of(strp, struct espintcp_ctx, strp);struct strp_msg *rxm =strp_msg (skb); +int len = rxm->full_len -2 ;u32 nonesp_marker;int err; +/* keepalive packet? */ +if (unlikely (len ==1 )) { +u8 data; + + err =skb_copy_bits (skb, rxm->offset +2 , &data,1 ); +if (err <0 ) { +kfree_skb (skb); +return ; + } + +if (data ==0xff ) { +kfree_skb (skb); +return ; + } + } + +/* drop other short messages */ +if (unlikely (len <=sizeof (nonesp_marker))) { +kfree_skb (skb); +return ; + } + err =skb_copy_bits (skb, rxm->offset +2 , &nonesp_marker,sizeof (nonesp_marker));if (err <0 ) {
@@ -83,7 +106,7 @@ static int espintcp_parse(struct strparser *strp, struct sk_buff *skb)return err; len =be16_to_cpu (blen); -if (len <6 ) +if (len <2 )return -EINVAL ;return len;
@@ -101,8 +124,11 @@ static int espintcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, flags |= nonblock ?MSG_DONTWAIT :0 ; skb =__skb_recv_datagram (sk, &ctx->ike_queue, flags, &off, &err); -if (!skb) +if (!skb) { +if (err == -EAGAIN && sk->sk_shutdown &RCV_SHUTDOWN ) +return 0 ;return err; + } copied = len;if (copied > skb->len)
net/xfrm/xfrm_policy.c +16 -23
@@ -1433,14 +1433,10 @@ static void xfrm_policy_requeue(struct xfrm_policy *old,spin_unlock_bh (&pq->hold_queue.lock); } -static bool xfrm_policy_mark_match (struct xfrm_policy *policy, -struct xfrm_policy *pol) +static inline bool xfrm_policy_mark_match (const struct xfrm_mark *mark, +struct xfrm_policy *pol) { -if (policy->mark.v == pol->mark.v && - policy->priority == pol->priority) -return true; - -return false; +return mark->v == pol->mark.v && mark->m == pol->mark.m; }static u32 xfrm_pol_bin_key (const void *data,u32 len,u32 seed)
@@ -1503,7 +1499,7 @@ static void xfrm_policy_insert_inexact_list(struct hlist_head *chain,if (pol->type == policy->type && pol->if_id == policy->if_id && !selector_cmp (&pol->selector, &policy->selector) && -xfrm_policy_mark_match (policy, pol) && +xfrm_policy_mark_match (&policy->mark, pol) &&xfrm_sec_ctx_match (pol->security, policy->security) && !WARN_ON (delpol)) { delpol = pol;
@@ -1538,7 +1534,7 @@ static struct xfrm_policy *xfrm_policy_insert_list(struct hlist_head *chain,if (pol->type == policy->type && pol->if_id == policy->if_id && !selector_cmp (&pol->selector, &policy->selector) && -xfrm_policy_mark_match (policy, pol) && +xfrm_policy_mark_match (&policy->mark, pol) &&xfrm_sec_ctx_match (pol->security, policy->security) && !WARN_ON (delpol)) {if (excl)
@@ -1610,9 +1606,8 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl)EXPORT_SYMBOL (xfrm_policy_insert);static struct xfrm_policy * -__xfrm_policy_bysel_ctx (struct hlist_head *chain,u32 mark,u32 if_id, -u8 type,int dir, -struct xfrm_selector *sel, +__xfrm_policy_bysel_ctx (struct hlist_head *chain,const struct xfrm_mark *mark, +u32 if_id,u8 type,int dir,struct xfrm_selector *sel,struct xfrm_sec_ctx *ctx) {struct xfrm_policy *pol;
@@ -1623,7 +1618,7 @@ __xfrm_policy_bysel_ctx(struct hlist_head *chain, u32 mark, u32 if_id,hlist_for_each_entry (pol, chain, bydst) {if (pol->type == type && pol->if_id == if_id && - (mark & pol->mark.m) == pol->mark.v && +xfrm_policy_mark_match (mark, pol) && !selector_cmp (sel, &pol->selector) &&xfrm_sec_ctx_match (ctx, pol->security))return pol;
@@ -1632,11 +1627,10 @@ __xfrm_policy_bysel_ctx(struct hlist_head *chain, u32 mark, u32 if_id,return NULL ; } -struct xfrm_policy *xfrm_policy_bysel_ctx (struct net *net,u32 mark,u32 if_id, -u8 type,int dir, -struct xfrm_selector *sel, -struct xfrm_sec_ctx *ctx,int delete, -int *err) +struct xfrm_policy * +xfrm_policy_bysel_ctx (struct net *net,const struct xfrm_mark *mark,u32 if_id, +u8 type,int dir,struct xfrm_selector *sel, +struct xfrm_sec_ctx *ctx,int delete,int *err) {struct xfrm_pol_inexact_bin *bin =NULL ;struct xfrm_policy *pol, *ret =NULL ;
@@ -1703,9 +1697,9 @@ struct xfrm_policy *xfrm_policy_bysel_ctx(struct net *net, u32 mark, u32 if_id, }EXPORT_SYMBOL (xfrm_policy_bysel_ctx); -struct xfrm_policy *xfrm_policy_byid (struct net *net,u32 mark,u32 if_id, -u8 type,int dir,u32 id,int delete, -int *err) +struct xfrm_policy * +xfrm_policy_byid (struct net *net,const struct xfrm_mark *mark,u32 if_id, +u8 type,int dir,u32 id,int delete,int *err) {struct xfrm_policy *pol, *ret;struct hlist_head *chain;
@@ -1720,8 +1714,7 @@ struct xfrm_policy *xfrm_policy_byid(struct net *net, u32 mark, u32 if_id, ret =NULL ;hlist_for_each_entry (pol, chain, byidx) {if (pol->type == type && pol->index == id && - pol->if_id == if_id && - (mark & pol->mark.m) == pol->mark.v) { + pol->if_id == if_id &&xfrm_policy_mark_match (mark, pol)) {xfrm_pol_hold (pol);if (delete) { *err = security_xfrm_policy_delete(
net/xfrm/xfrm_user.c +11 -7
@@ -1863,7 +1863,6 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh,struct km_event c;int delete;struct xfrm_mark m; -u32 mark =xfrm_mark_get (attrs, &m);u32 if_id =0 ; p =nlmsg_data (nlh);
@@ -1880,8 +1879,11 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh,if (attrs[XFRMA_IF_ID ]) if_id =nla_get_u32 (attrs[XFRMA_IF_ID ]); +xfrm_mark_get (attrs, &m); +if (p->index) - xp =xfrm_policy_byid (net, mark, if_id, type, p->dir, p->index, delete, &err); + xp =xfrm_policy_byid (net, &m, if_id, type, p->dir, + p->index, delete, &err);else {struct nlattr *rt = attrs[XFRMA_SEC_CTX ];struct xfrm_sec_ctx *ctx;
@@ -1898,8 +1900,8 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh,if (err)return err; } - xp =xfrm_policy_bysel_ctx (net, mark, if_id, type, p->dir, &p->sel, - ctx, delete, &err); + xp =xfrm_policy_bysel_ctx (net, &m, if_id, type, p->dir, + &p->sel, ctx, delete, &err);security_xfrm_policy_free (ctx); }if (xp ==NULL )
@@ -2166,7 +2168,6 @@ static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh,u8 type =XFRM_POLICY_TYPE_MAIN ;int err = -ENOENT ;struct xfrm_mark m; -u32 mark =xfrm_mark_get (attrs, &m);u32 if_id =0 ; err =copy_from_user_policy_type (&type, attrs);
@@ -2180,8 +2181,11 @@ static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh,if (attrs[XFRMA_IF_ID ]) if_id =nla_get_u32 (attrs[XFRMA_IF_ID ]); +xfrm_mark_get (attrs, &m); +if (p->index) - xp =xfrm_policy_byid (net, mark, if_id, type, p->dir, p->index,0 , &err); + xp =xfrm_policy_byid (net, &m, if_id, type, p->dir, p->index, +0 , &err);else {struct nlattr *rt = attrs[XFRMA_SEC_CTX ];struct xfrm_sec_ctx *ctx;
@@ -2198,7 +2202,7 @@ static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh,if (err)return err; } - xp =xfrm_policy_bysel_ctx (net, mark, if_id, type, p->dir, + xp =xfrm_policy_bysel_ctx (net, &m, if_id, type, p->dir, &p->sel, ctx,0 , &err);security_xfrm_policy_free (ctx); }
sound/pci/hda/hda_controller.h +1 -1
@@ -41,7 +41,7 @@/* 24 unused */ #define AZX_DCAPS_COUNT_LPIB_DELAY (1 << 25)/* Take LPIB as delay */ #define AZX_DCAPS_PM_RUNTIME (1 << 26)/* runtime PM support */ -/* 27 unused */ +#define AZX_DCAPS_SUSPEND_SPURIOUS_WAKEUP (1 << 27)/* Workaround for spurious wakeups after suspend */ #define AZX_DCAPS_CORBRP_SELF_CLEAR (1 << 28)/* CORBRP clears itself after reset */ #define AZX_DCAPS_NO_MSI64 (1 << 29)/* Stick to 32-bit MSIs */ #define AZX_DCAPS_SEPARATE_STREAM_TAG (1 << 30)/* capture and playback use separate stream tag */
sound/pci/hda/hda_intel.c +14 -3
@@ -298,7 +298,8 @@ enum {/* PCH for HSW/BDW; with runtime PM */ /* no i915 binding for this as HSW/BDW has another controller for HDMI */ #define AZX_DCAPS_INTEL_PCH \ - (AZX_DCAPS_INTEL_PCH_BASE | AZX_DCAPS_PM_RUNTIME) + (AZX_DCAPS_INTEL_PCH_BASE | AZX_DCAPS_PM_RUNTIME |\ + AZX_DCAPS_SUSPEND_SPURIOUS_WAKEUP)/* HSW HDMI */ #define AZX_DCAPS_INTEL_HASWELL \
@@ -1028,7 +1029,14 @@ static int azx_suspend(struct device *dev) chip = card->private_data; bus =azx_bus (chip);snd_power_change_state (card, SNDRV_CTL_POWER_D3hot); -pm_runtime_force_suspend (dev); +/* An ugly workaround: direct call of __azx_runtime_suspend() and +* __azx_runtime_resume() for old Intel platforms that suffer from +* spurious wakeups after S3 suspend +*/ +if (chip->driver_caps &AZX_DCAPS_SUSPEND_SPURIOUS_WAKEUP ) +__azx_runtime_suspend (chip); +else +pm_runtime_force_suspend (dev);if (bus->irq >=0 ) {free_irq (bus->irq, chip); bus->irq =-1 ;
@@ -1057,7 +1065,10 @@ static int azx_resume(struct device *dev)if (azx_acquire_irq (chip,1 ) <0 )return -EIO ; -pm_runtime_force_resume (dev); +if (chip->driver_caps &AZX_DCAPS_SUSPEND_SPURIOUS_WAKEUP ) +__azx_runtime_resume (chip, false); +else +pm_runtime_force_resume (dev);snd_power_change_state (card,SNDRV_CTL_POWER_D0 );trace_azx_resume (chip);
sound/pci/hda/patch_hdmi.c +1 -1
@@ -2439,6 +2439,7 @@ static void generic_acomp_notifier_set(struct drm_audio_component *acomp,mutex_lock (&spec->bind_lock); spec->use_acomp_notifier = use_acomp; spec->codec->relaxed_resume = use_acomp; + spec->codec->bus->keep_power =0 ;/* reprogram each jack detection logic depending on the notifier */ for (i =0 ; i < spec->num_pins; i++) reprogram_jack_detect(spec->codec,
@@ -2533,7 +2534,6 @@ static void generic_acomp_init(struct hda_codec *codec,if (!snd_hdac_acomp_init (&codec->bus->core, &spec->drm_audio_ops, match_bound_vga,0 )) { spec->acomp_registered = true; - codec->bus->keep_power =0 ; } }
sound/pci/hda/patch_realtek.c +31 -5
@@ -5940,6 +5940,16 @@ static void alc_fixup_disable_mic_vref(struct hda_codec *codec,snd_hda_codec_set_pin_target (codec,0x19 ,PIN_VREFHIZ ); } +static void alc285_fixup_hp_gpio_amp_init (struct hda_codec *codec, +const struct hda_fixup *fix,int action) +{ +if (action !=HDA_FIXUP_ACT_INIT ) +return ; + +msleep (100 ); +alc_write_coef_idx (codec,0x65 ,0x0 ); +} +/* for hda_fixup_thinkpad_acpi() */ #include "thinkpad_helper.c"
@@ -6117,8 +6127,10 @@ enum {ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS ,ALC269VC_FIXUP_ACER_HEADSET_MIC ,ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE , -ALC289_FIXUP_ASUS_G401 , +ALC289_FIXUP_ASUS_GA401 , +ALC289_FIXUP_ASUS_GA502 ,ALC256_FIXUP_ACER_MIC_NO_PRESENCE , + ALC285_FIXUP_HP_GPIO_AMP_INIT, }; static const struct hda_fixup alc269_fixups[] = {
@@ -7328,7 +7340,14 @@ static const struct hda_fixup alc269_fixups[] = { .chained = true, .chain_id =ALC269_FIXUP_HEADSET_MIC }, - [ALC289_FIXUP_ASUS_G401] = { + [ALC289_FIXUP_ASUS_GA401] = { + .type = HDA_FIXUP_PINS, + .v.pins = (const struct hda_pintbl []) { + {0x19 ,0x03a11020 },/* headset mic with jack detect */ + { } + }, + }, + [ALC289_FIXUP_ASUS_GA502] = { .type = HDA_FIXUP_PINS, .v.pins = (const struct hda_pintbl []) { {0x19 ,0x03a11020 },/* headset mic with jack detect */
@@ -7344,6 +7363,12 @@ static const struct hda_fixup alc269_fixups[] = { .chained = true, .chain_id =ALC256_FIXUP_ASUS_HEADSET_MODE }, + [ALC285_FIXUP_HP_GPIO_AMP_INIT] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc285_fixup_hp_gpio_amp_init, + .chained = true, + .chain_id =ALC285_FIXUP_HP_GPIO_LED + }, };static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -7494,7 +7519,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {SND_PCI_QUIRK (0x103c ,0x84e7 ,"HP Pavilion 15" ,ALC269_FIXUP_HP_MUTE_LED_MIC3 ),SND_PCI_QUIRK (0x103c ,0x869d ,"HP" ,ALC236_FIXUP_HP_MUTE_LED ),SND_PCI_QUIRK (0x103c ,0x8729 ,"HP" ,ALC285_FIXUP_HP_GPIO_LED ), -SND_PCI_QUIRK (0x103c ,0x8736 ,"HP" ,ALC285_FIXUP_HP_GPIO_LED ), +SND_PCI_QUIRK (0x103c ,0x8736 ,"HP" ,ALC285_FIXUP_HP_GPIO_AMP_INIT ),SND_PCI_QUIRK (0x103c ,0x877a ,"HP" ,ALC285_FIXUP_HP_MUTE_LED ),SND_PCI_QUIRK (0x103c ,0x877d ,"HP" ,ALC236_FIXUP_HP_MUTE_LED ), SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
@@ -7526,7 +7551,8 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {SND_PCI_QUIRK (0x1043 ,0x1bbd ,"ASUS Z550MA" ,ALC255_FIXUP_ASUS_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x1043 ,0x1c23 ,"Asus X55U" ,ALC269_FIXUP_LIMIT_INT_MIC_BOOST ),SND_PCI_QUIRK (0x1043 ,0x1ccd ,"ASUS X555UB" ,ALC256_FIXUP_ASUS_MIC ), -SND_PCI_QUIRK (0x1043 ,0x1f11 ,"ASUS Zephyrus G14" ,ALC289_FIXUP_ASUS_G401 ), +SND_PCI_QUIRK (0x1043 ,0x1e11 ,"ASUS Zephyrus G15" ,ALC289_FIXUP_ASUS_GA502 ), +SND_PCI_QUIRK (0x1043 ,0x1f11 ,"ASUS Zephyrus G14" ,ALC289_FIXUP_ASUS_GA401 ),SND_PCI_QUIRK (0x1043 ,0x3030 ,"ASUS ZN270IE" ,ALC256_FIXUP_ASUS_AIO_GPIO2 ),SND_PCI_QUIRK (0x1043 ,0x831a ,"ASUS P901" ,ALC269_FIXUP_STEREO_DMIC ), SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
@@ -7546,7 +7572,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {SND_PCI_QUIRK (0x10cf ,0x1629 ,"Lifebook U7x7" , ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),SND_PCI_QUIRK (0x10cf ,0x1845 ,"Lifebook U904" ,ALC269_FIXUP_LIFEBOOK_EXTMIC ),SND_PCI_QUIRK (0x10ec ,0x10f2 ,"Intel Reference board" ,ALC700_FIXUP_INTEL_REFERENCE ), -SND_PCI_QUIRK (0x10ec ,0x1230 ,"Intel Reference board" ,ALC225_FIXUP_HEADSET_JACK ), +SND_PCI_QUIRK (0x10ec ,0x1230 ,"Intel Reference board" ,ALC295_FIXUP_CHROME_BOOK ),SND_PCI_QUIRK (0x10f7 ,0x8338 ,"Panasonic CF-SZ6" ,ALC269_FIXUP_HEADSET_MODE ),SND_PCI_QUIRK (0x144d ,0xc109 ,"Samsung Ativ book 9 (NP900X3G)" ,ALC269_FIXUP_INV_DMIC ), SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
sound/usb/pcm.c +1 -0
@@ -367,6 +367,7 @@ static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs, ifnum =0 ; goto add_sync_ep_from_ifnum;case USB_ID (0x07fd ,0x0008 ):/* MOTU M Series */ +case USB_ID (0x31e9 ,0x0001 ):/* Solid State Logic SSL2 */ case USB_ID (0x31e9 ,0x0002 ):/* Solid State Logic SSL2+ */ case USB_ID (0x0d9a ,0x00df ):/* RTX6001 */ ep =0x81 ;
tools/lib/traceevent/plugins/Makefile +1 -1
@@ -197,7 +197,7 @@ define do_generate_dynamic_list_file xargs echo "U w W" | tr 'w ' 'W\n' | sort -u | xargs echo`;\ if [ "$$symbol_type" = "U W" ];then \ (echo '{'; \ - $(NM) -u -D $1 | awk 'NF>1 {print "\t"$$2";"}' | sort -u;\ + $(NM) -u -D $1 | awk 'NF>1 {sub("@.*", "", $$2); print "\t"$$2";"}' | sort -u;\ echo '};'; \ ) > $2; \ else \
tools/perf/arch/arm/util/auxtrace.c +4 -4
@@ -56,7 +56,7 @@ struct auxtrace_recordstruct perf_pmu *cs_etm_pmu;struct evsel *evsel;bool found_etm = false; -bool found_spe = false; +struct perf_pmu *found_spe =NULL ;static struct perf_pmu **arm_spe_pmus =NULL ;static int nr_spes =0 ;int i =0 ;
@@ -74,12 +74,12 @@ struct auxtrace_record evsel->core.attr.type == cs_etm_pmu->type) found_etm = true; -if (!nr_spes) +if (!nr_spes || found_spe)continue ;for (i =0 ; i < nr_spes; i++) {if (evsel->core.attr.type == arm_spe_pmus[i]->type) { - found_spe = true; + found_spe = arm_spe_pmus[i];break ; } }
@@ -96,7 +96,7 @@ struct auxtrace_record#if defined(__aarch64__)if (found_spe) -return arm_spe_recording_init (err, arm_spe_pmus[i]); +return arm_spe_recording_init (err, found_spe);#endif /*
tools/testing/selftests/bpf/test_offload.py +3 -0
@@ -318,6 +318,9 @@ class DebugfsDir: continue if os.path.isfile(p): + # We need to init trap_flow_action_cookie before read it + if f == "trap_flow_action_cookie": + cmd('echo deadbeef > %s/%s' % (path, f)) _, out = cmd('cat %s/%s' % (path, f)) dfs[f] = out.strip() elif os.path.isdir(p):
tools/testing/selftests/net/fib_nexthop_multiprefix.sh +1 -1
@@ -144,7 +144,7 @@ setup() cleanup() { - for n in h1 r1 h2 h3 h4 + for n in h0 r1 h1 h2 h3 do ip netns del ${n} 2>/dev/null done
tools/testing/selftests/net/forwarding/ethtool.sh +0 -2
@@ -252,8 +252,6 @@ check_highest_speed_is_chosen() fi local -a speeds_arr=($(common_speeds_get $h1 $h2 0 1)) - # Remove the first speed, h1 does not advertise this speed. - unset speeds_arr[0] max_speed=${speeds_arr[0]} for current in ${speeds_arr[@]}; do
tools/testing/selftests/net/ip_defrag.sh +2 -0
@@ -6,6 +6,8 @@ set +x set -e +modprobe -q nf_defrag_ipv6 + readonly NETNS="ns-$(mktemp -u XXXXXX)" setup() {
tools/testing/selftests/net/psock_fanout.c +2 -1
@@ -350,7 +350,8 @@ static int test_datapath(uint16_t typeflags, int port_off,int fds[2 ], fds_udp[2 ][2 ], ret;fprintf (stderr,"\ntest: datapath 0x%hx ports %hu,%hu\n" , - typeflags,PORT_BASE ,PORT_BASE + port_off); + typeflags, (uint16_t )PORT_BASE , + (uint16_t )(PORT_BASE + port_off)); fds[0 ] =sock_fanout_open (typeflags,0 ); fds[1 ] =sock_fanout_open (typeflags,0 );
tools/testing/selftests/net/rxtimestamp.c +1 -2
@@ -329,8 +329,7 @@ int main(int argc, char **argv)bool all_tests = true;int arg_index =0 ;int failures =0 ; -int s, t; -char opt; +int s, t, opt;while ((opt =getopt_long (argc, argv,"" , long_options, &arg_index)) !=-1 ) {
tools/testing/selftests/net/so_txtime.c +1 -1
@@ -121,7 +121,7 @@ static bool do_recv_one(int fdr, struct timed_send *ts)if (rbuf[0 ] != ts->data)error (1 ,0 ,"payload mismatch. expected %c" , ts->data); -if (labs (tstop - texpect) > cfg_variance_us) +if (llabs (tstop - texpect) > cfg_variance_us)error (1 ,0 ,"exceeds variance (%d us)" , cfg_variance_us);return false;
tools/testing/selftests/net/tcp_mmap.c +3 -3
@@ -344,7 +344,7 @@ int main(int argc, char *argv[]) {struct sockaddr_storage listenaddr, addr;unsigned int max_pacing_rate =0 ; -size_t total =0 ; +uint64_t total =0 ;char *host =NULL ;int fd, c, on =1 ;char *buffer;
@@ -473,12 +473,12 @@ int main(int argc, char *argv[]) zflg =0 ; }while (total <FILE_SZ ) { -ssize_t wr =FILE_SZ - total; +int64_t wr =FILE_SZ - total;if (wr > chunk_size) wr = chunk_size;/* Note : we just want to fill the pipe with 0 bytes */ - wr =send (fd, buffer, wr, zflg ?MSG_ZEROCOPY :0 ); + wr =send (fd, buffer, (size_t )wr, zflg ?MSG_ZEROCOPY :0 );if (wr <=0 )break ; total += wr;
tools/testing/selftests/net/txtimestamp.sh +1 -1
@@ -75,7 +75,7 @@ main() { fi } -if [[ "$(ip netns identify)" == "root" ]]; then +if [[ -z "$(ip netns identify)" ]]; then ./in_netns.sh $0 $@ else main $@
virt/kvm/arm/mmu.c +6 -5
@@ -1198,7 +1198,7 @@ static bool stage2_get_leaf_entry(struct kvm *kvm, phys_addr_t addr,return true; } -static bool stage2_is_exec (struct kvm *kvm,phys_addr_t addr) +static bool stage2_is_exec (struct kvm *kvm,phys_addr_t addr,unsigned long sz) {pud_t *pudp;pmd_t *pmdp;
@@ -1210,11 +1210,11 @@ static bool stage2_is_exec(struct kvm *kvm, phys_addr_t addr)return false;if (pudp) -return kvm_s2pud_exec (pudp); +return sz <=PUD_SIZE &&kvm_s2pud_exec (pudp);else if (pmdp) -return kvm_s2pmd_exec (pmdp); +return sz <=PMD_SIZE &&kvm_s2pmd_exec (pmdp);else
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.