Linux 4.18.16
Greg KH
maintainerI'm announcing the release of the 4.18.16 kernel.
All users of the 4.18 kernel series must upgrade.
The updated 4.18.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.18.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/arc/Makefile | 24 ------ arch/powerpc/kernel/tm.S | 20 ++++- arch/powerpc/mm/numa.c | 4 - arch/riscv/include/asm/asm-prototypes.h | 7 + arch/x86/boot/compressed/mem_encrypt.S | 19 ---- drivers/clocksource/timer-fttmr010.c | 18 ++-- drivers/clocksource/timer-ti-32k.c | 3 drivers/gpu/drm/arm/malidp_drv.c | 1 drivers/hwtracing/intel_th/pci.c | 5 + drivers/infiniband/core/uverbs_cmd.c | 68 +++++++++++------ drivers/infiniband/hw/bnxt_re/main.c | 93 +++++++++-------------- drivers/input/keyboard/atakbd.c | 74 +++++++----------- drivers/iommu/amd_iommu.c | 6 + drivers/iommu/rockchip-iommu.c | 6 + drivers/media/usb/dvb-usb-v2/af9035.c | 6 + drivers/net/ethernet/chelsio/cxgb4/t4_msg.h | 1 drivers/net/ethernet/ibm/emac/core.c | 15 ++- drivers/net/ethernet/mellanox/mlx4/eq.c | 3 drivers/net/ethernet/qlogic/qed/qed_dcbx.c | 9 ++ drivers/net/ethernet/qlogic/qed/qed_dcbx.h | 1 drivers/net/ethernet/qlogic/qed/qed_dev.c | 15 +++ drivers/net/ethernet/qlogic/qed/qed_hsi.h | 4 + drivers/net/ethernet/renesas/ravb.h | 5 + drivers/net/ethernet/renesas/ravb_main.c | 11 +- drivers/net/ethernet/renesas/ravb_ptp.c | 2 drivers/pci/controller/dwc/pcie-designware.c | 8 +- drivers/pci/controller/dwc/pcie-designware.h | 3 drivers/pinctrl/pinctrl-amd.c | 33 +++++--- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 5 - drivers/scsi/ipr.c | 106 +++++++++++++++------------ drivers/scsi/ipr.h | 1 drivers/scsi/lpfc/lpfc_attr.c | 15 ++- drivers/scsi/lpfc/lpfc_debugfs.c | 10 +- drivers/scsi/lpfc/lpfc_nvme.c | 11 ++ drivers/scsi/sd.c | 3 drivers/soundwire/stream.c | 23 ++++- drivers/spi/spi-gpio.c | 4 - fs/namespace.c | 7 - include/linux/huge_mm.h | 2 kernel/bpf/sockmap.c | 91 ++++++++++++++++++----- mm/huge_memory.c | 10 +- mm/mremap.c | 30 +++---- net/batman-adv/bat_v_elp.c | 10 +- net/batman-adv/bridge_loop_avoidance.c | 10 ++ net/batman-adv/gateway_client.c | 11 ++ net/batman-adv/network-coding.c | 27 +++--- net/batman-adv/soft-interface.c | 25 ++++-- net/batman-adv/sysfs.c | 30 +++++-- net/batman-adv/translation-table.c | 6 + net/batman-adv/tvlv.c | 8 +- net/smc/af_smc.c | 7 + net/smc/smc_clc.c | 14 +-- tools/testing/selftests/bpf/test_maps.c | 10 +- tools/testing/selftests/net/pmtu.sh | 4 - 55 files changed, 562 insertions(+), 384 deletions(-)
Alexander Shishkin (1):
intel_th: pci: Add Ice Lake PCH support
Alexandru Gheorghe (1):
drm: mali-dp: Call drm_crtc_vblank_reset on device init
Alexey Brodkin (2):
ARC: build: Get rid of toolchain check
ARC: build: Don't set CROSS_COMPILE in arch's Makefile
Andreas Schwab (1):
Input: atakbd - fix Atari keymap
Arindam Nath (1):
iommu/amd: Return devid as alias for ACPI HID devices
Christian Lamparter (1):
net: emac: fix fixed-link setup for the RTL8363SB switch
Daniel Kurtz (1):
pinctrl/amd: poll InterruptEnable bits in amd_gpio_irq_set_type
Greg Kroah-Hartman (2):
Revert "vfs: fix freeze protection in mnt_want_write_file() for overlayfs" Linux 4.18.16
Heiko Stuebner (1):
iommu/rockchip: Free irqs in shutdown handler
James Cowgill (1):
RISC-V: include linux/ftrace.h in asm-prototypes.h
James Smart (1):
scsi: lpfc: Synchronize access to remoteport via rport
Jisheng Zhang (1):
PCI: dwc: Fix scheduling while atomic issues
Johannes Thumshirn (1):
scsi: sd: don't crash the host on invalid commands
John Fastabend (3):
bpf: sockmap only allow ESTABLISHED sock state
bpf: sockmap, fix transition through disconnect without close
bpf: test_maps, only support ESTABLISHED socks
Jozef Balga (1):
media: af9035: prevent buffer overflow on write
Kairui Song (1):
x86/boot: Fix kexec booting failure in the SEV bit detection code
Kazuya Mizuguchi (1):
ravb: do not write 1 to reserved bits
Keerthy (1):
clocksource/drivers/ti-32k: Add CLOCK_SOURCE_SUSPEND_NONSTOP flag for non-am43 SoCs
Laura Abbott (2):
scsi: ibmvscsis: Fix a stringop-overflow warning
scsi: ibmvscsis: Ensure partition name is properly NUL terminated
Linus Torvalds (1):
mremap: properly flush TLB before releasing the page
Linus Walleij (1):
spi: gpio: Fix copy-and-paste error
Majd Dibbiny (1):
RDMA/uverbs: Fix validity check for modify QP
Marek Lindner (2):
batman-adv: fix backbone_gw refcount on queue_work() failure
batman-adv: fix hardif_neigh refcount on queue_work() failure
Michael Neuling (2):
powerpc/tm: Fix userspace r13 corruption powerpc/tm: Avoid possible userspace r1 corruption on reclaim
Michael Schmitz (1):
Input: atakbd - fix Atari CapsLock behaviour
Nathan Chancellor (1):
net/mlx4: Use cpumask_available for eq->affinity_mask
Sabrina Dubroca (1):
selftests: pmtu: properly redirect stderr to /dev/null
Sanyog Kale (1):
soundwire: Fix acquiring bus lock twice during master release
Selvin Xavier (1):
RDMA/bnxt_re: Fix system crash during RDMA resource initialization
Shreyas NC (2):
soundwire: Fix duplicate stream state assignment
soundwire: Fix incorrect exit after configuring stream
Srikar Dronamraju (1):
powerpc/numa: Use associativity if VPHN hcall is successful
Steve Wise (1):
cxgb4: fix abort_req_rss6 struct
Sudarsana Reddy Kalluru (2):
qed: Fix populating the invalid stag value in multi function mode.
qed: Do not add VLAN 0 tag to untagged frames in multi-function mode.
Sven Eckelmann (8):
batman-adv: Avoid probe ELP information leak
batman-adv: Fix segfault when writing to throughput_override
batman-adv: Fix segfault when writing to sysfs elp_interval
batman-adv: Prevent duplicated gateway_node entry
batman-adv: Prevent duplicated nc_node entry
batman-adv: Prevent duplicated softif_vlan entry
batman-adv: Prevent duplicated global TT entry
batman-adv: Prevent duplicated tvlv handler
Tao Ren (1):
clocksource/drivers/fttmr010: Fix set_next_event handler
Ursula Braun (1):
net/smc: fix non-blocking connect problem
Wen Xiong (1):
scsi: ipr: System hung while dlpar adding primary ipr adapter back
YueHaibing (1):
net/smc: fix sizeof to int comparison
Greg KH
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 18 -SUBLEVEL = 15 +SUBLEVEL = 16 EXTRAVERSION = NAME = Merciless Moray
arch/arc/Makefile +1 -23
@@ -6,34 +6,12 @@ # published by the Free Software Foundation. # -ifeq ($(CROSS_COMPILE),) -ifndef CONFIG_CPU_BIG_ENDIAN -CROSS_COMPILE := arc-linux- -else -CROSS_COMPILE := arceb-linux- -endif -endif - KBUILD_DEFCONFIG := nsim_700_defconfig cflags-y += -fno-common -pipe -fno-builtin -mmedium-calls -D__linux__ cflags-$(CONFIG_ISA_ARCOMPACT) += -mA7 cflags-$(CONFIG_ISA_ARCV2) += -mcpu=archs -is_700 = $(shell $(CC) -dM -E - < /dev/null | grep -q "ARC700" && echo 1 || echo 0) - -ifdef CONFIG_ISA_ARCOMPACT -ifeq ($(is_700), 0) - $(error Toolchain not configured for ARCompact builds) -endif -endif - -ifdef CONFIG_ISA_ARCV2 -ifeq ($(is_700), 1) - $(error Toolchain not configured for ARCv2 builds) -endif -endif - ifdef CONFIG_ARC_CURR_IN_REG # For a global register defintion, make sure it gets passed to every file # We had a customer reported bug where some code built in kernel was NOT using
@@ -87,7 +65,7 @@ ldflags-$(CONFIG_CPU_BIG_ENDIAN) += -EB # --build-id w/o "-marclinux". Default arc-elf32-ld is OK ldflags-$(upto_gcc44) += -marclinux -LIBGCC := $(shell $(CC) $(cflags-y) --print-libgcc-file-name) +LIBGCC = $(shell $(CC) $(cflags-y) --print-libgcc-file-name) # Modules with short calls might break for calls into builtin-kernel KBUILD_CFLAGS_MODULE += -mlong-calls -mno-millicode
arch/powerpc/kernel/tm.S +17 -3
@@ -175,13 +175,27 @@ _GLOBAL(tm_reclaim) std r1, PACATMSCRATCH(r13) ld r1, PACAR1(r13) - /* Store the PPR in r11 and reset to decent value */ std r11, GPR11(r1) /* Temporary stash */ + /* + * Move the saved user r1 to the kernel stack in case PACATMSCRATCH is + * clobbered by an exception once we turn on MSR_RI below. + */ + ld r11, PACATMSCRATCH(r13) + std r11, GPR1(r1) + + /* + * Store r13 away so we can free up the scratch SPR for the SLB fault + * handler (needed once we start accessing the thread_struct). + */ + GET_SCRATCH0(r11) + std r11, GPR13(r1) + /* Reset MSR RI so we can take SLB faults again */ li r11, MSR_RI mtmsrd r11, 1 + /* Store the PPR in r11 and reset to decent value */ mfspr r11, SPRN_PPR HMT_MEDIUM
@@ -206,11 +220,11 @@ _GLOBAL(tm_reclaim) SAVE_GPR(8, r7) /* user r8 */ SAVE_GPR(9, r7) /* user r9 */ SAVE_GPR(10, r7) /* user r10 */ - ld r3, PACATMSCRATCH(r13) /* user r1 */ + ld r3, GPR1(r1) /* user r1 */ ld r4, GPR7(r1) /* user r7 */ ld r5, GPR11(r1) /* user r11 */ ld r6, GPR12(r1) /* user r12 */ - GET_SCRATCH0(8) /* user r13 */ + ld r8, GPR13(r1) /* user r13 */ std r3, GPR1(r7) std r4, GPR7(r7) std r5, GPR11(r7)
arch/powerpc/mm/numa.c +3 -1
@@ -1204,7 +1204,9 @@ int find_and_online_cpu_nid(int cpu)int new_nid;/* Use associativity from first thread for all siblings */ -vphn_get_associativity (cpu, associativity); +if (vphn_get_associativity (cpu, associativity)) +return cpu_to_node (cpu); + new_nid =associativity_to_nid (associativity);if (new_nid <0 || !node_possible (new_nid)) new_nid = first_online_node;
arch/riscv/include/asm/asm-prototypes.h new file +7 -0
@@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _ASM_RISCV_PROTOTYPES_H + +#include <linux/ftrace.h> +#include <asm-generic/asm-prototypes.h> + +#endif /* _ASM_RISCV_PROTOTYPES_H */
arch/x86/boot/compressed/mem_encrypt.S +0 -19
@@ -25,20 +25,6 @@ ENTRY(get_sev_encryption_bit) push %ebx push %ecx push %edx - push %edi - - /* - * RIP-relative addressing is needed to access the encryption bit - * variable. Since we are running in 32-bit mode we need this call/pop - * sequence to get the proper relative addressing. - */ - call 1f -1: popl %edi - subl $1b, %edi - - movl enc_bit(%edi), %eax - cmpl $0, %eax - jge .Lsev_exit /* Check if running under a hypervisor */ movl $1, %eax
@@ -69,15 +55,12 @@ ENTRY(get_sev_encryption_bit) movl %ebx, %eax andl $0x3f, %eax /* Return the encryption bit location */ - movl %eax, enc_bit(%edi) jmp .Lsev_exit .Lno_sev: xor %eax, %eax - movl %eax, enc_bit(%edi) .Lsev_exit: - pop %edi pop %edx pop %ecx pop %ebx
@@ -113,8 +96,6 @@ ENTRY(set_sev_encryption_mask) ENDPROC(set_sev_encryption_mask) .data -enc_bit: - .int 0xffffffff #ifdef CONFIG_AMD_MEM_ENCRYPT .balign 8
drivers/clocksource/timer-fttmr010.c +11 -7
@@ -130,13 +130,17 @@ static int fttmr010_timer_set_next_event(unsigned long cycles, cr &= ~fttmr010->t1_enable_val;writel (cr, fttmr010->base +TIMER_CR ); -/* Setup the match register forward/backward in time */ - cr =readl (fttmr010->base +TIMER1_COUNT ); -if (fttmr010->count_down) - cr -= cycles; -else - cr += cycles; -writel (cr, fttmr010->base +TIMER1_MATCH1 ); +if (fttmr010->count_down) { +/* +* ASPEED Timer Controller will load TIMER1_LOAD register +* into TIMER1_COUNT register when the timer is re-enabled. +*/ +writel (cycles, fttmr010->base +TIMER1_LOAD ); + }else { +/* Setup the match register forward in time */ + cr =readl (fttmr010->base +TIMER1_COUNT ); +writel (cr + cycles, fttmr010->base +TIMER1_MATCH1 ); + }/* Start */ cr =readl (fttmr010->base +TIMER_CR );
drivers/clocksource/timer-ti-32k.c +3 -0
@@ -98,6 +98,9 @@ static int __init ti_32k_timer_init(struct device_node *np)return -ENXIO ; } +if (!of_machine_is_compatible ("ti,am43" )) + ti_32k_timer.cs.flags |=CLOCK_SOURCE_SUSPEND_NONSTOP ; + ti_32k_timer.counter = ti_32k_timer.base;/*
drivers/gpu/drm/arm/malidp_drv.c +1 -0
@@ -615,6 +615,7 @@ static int malidp_bind(struct device *dev) drm->irq_enabled = true; ret =drm_vblank_init (drm, drm->mode_config.num_crtc); +drm_crtc_vblank_reset (&malidp->crtc);if (ret <0 ) {DRM_ERROR ("failed to initialise vblank\n" ); goto vblank_fail;
drivers/hwtracing/intel_th/pci.c +5 -0
@@ -160,6 +160,11 @@ static const struct pci_device_id intel_th_pci_id_table[] = { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x18e1), .driver_data = (kernel_ulong_t)&intel_th_2x, }, + { +/* Ice Lake PCH */ + PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x34a6), + .driver_data = (kernel_ulong_t)&intel_th_2x, + }, { 0 }, };
drivers/infiniband/core/uverbs_cmd.c +45 -23
78 lines not on this page · raw message
drivers/infiniband/hw/bnxt_re/main.c +38 -55
312 lines not on this page · raw message
drivers/input/keyboard/atakbd.c +28 -46
111 lines not on this page · raw message
drivers/iommu/amd_iommu.c +6 -0
@@ -246,7 +246,13 @@ static u16 get_alias(struct device *dev)/* The callers make sure that get_device_id() does not fail here */ devid =get_device_id (dev); + +/* For ACPI HID devices, we simply return the devid as such */ +if (!dev_is_pci (dev)) +return devid; + ivrs_alias = amd_iommu_alias_table[devid]; +pci_for_each_dma_alias (pdev, __last_alias, &pci_alias);if (ivrs_alias == pci_alias)
drivers/iommu/rockchip-iommu.c +6 -0
@@ -1242,6 +1242,12 @@ static int rk_iommu_probe(struct platform_device *pdev)static void rk_iommu_shutdown (struct platform_device *pdev) { +struct rk_iommu *iommu =platform_get_drvdata (pdev); +int i =0 , irq; + +while ((irq =platform_get_irq (pdev, i++)) != -ENXIO ) +devm_free_irq (iommu->dev, irq, iommu); +pm_runtime_force_suspend (&pdev->dev); }
drivers/media/usb/dvb-usb-v2/af9035.c +4 -2
@@ -402,8 +402,10 @@ static int af9035_i2c_master_xfer(struct i2c_adapter *adap,if (msg[0 ].addr == state->af9033_i2c_addr[1 ]) reg |=0x100000 ; - ret =af9035_wr_regs (d, reg, &msg[0 ].buf[3 ], - msg[0 ].len -3 ); + ret = (msg[0 ].len >=3 ) ?af9035_wr_regs (d, reg, + &msg[0 ].buf[3 ], + msg[0 ].len -3 ) + : -EOPNOTSUPP ; }else {/* I2C write */ u8 buf[MAX_XFER_SIZE ];
drivers/net/ethernet/chelsio/cxgb4/t4_msg.h +0 -1
@@ -753,7 +753,6 @@ struct cpl_abort_req_rss { };struct cpl_abort_req_rss6 { -WR_HDR ;union opcode_tid ot;__u32 srqidx_status; };
drivers/net/ethernet/ibm/emac/core.c +10 -5
@@ -2677,12 +2677,17 @@ static int emac_init_phy(struct emac_instance *dev)if (of_phy_is_fixed_link (np)) {int res =emac_dt_mdio_probe (dev); -if (!res) { - res =of_phy_register_fixed_link (np); -if (res) -mdiobus_unregister (dev->mii_bus); +if (res) +return res; + + res =of_phy_register_fixed_link (np); + dev->phy_dev =of_phy_find_device (np); +if (res || !dev->phy_dev) { +mdiobus_unregister (dev->mii_bus); +return res ? res : -EINVAL ; } -return res; +emac_adjust_link (dev->ndev); +put_device (&dev->phy_dev->mdio.dev); }return 0 ; }
drivers/net/ethernet/mellanox/mlx4/eq.c +2 -1
@@ -240,7 +240,8 @@ static void mlx4_set_eq_affinity_hint(struct mlx4_priv *priv, int vec)struct mlx4_dev *dev = &priv->dev;struct mlx4_eq *eq = &priv->eq_table.eq[vec]; -if (!eq->affinity_mask ||cpumask_empty (eq->affinity_mask)) +if (!cpumask_available (eq->affinity_mask) || +cpumask_empty (eq->affinity_mask))return ; hint_err =irq_set_affinity_hint (eq->irq, eq->affinity_mask);
drivers/net/ethernet/qlogic/qed/qed_dcbx.c +8 -1
@@ -190,6 +190,7 @@ qed_dcbx_dp_protocol(struct qed_hwfn *p_hwfn, struct qed_dcbx_results *p_data) static void qed_dcbx_set_params(struct qed_dcbx_results *p_data, + struct qed_hwfn *p_hwfn, struct qed_hw_info *p_info, bool enable, u8 prio,
@@ -206,6 +207,11 @@ qed_dcbx_set_params(struct qed_dcbx_results *p_data,else p_data->arr[type].update =DONT_UPDATE_DCB_DSCP ; +/* Do not add vlan tag 0 when DCB is enabled and port in UFP/OV mode */ +if ((test_bit (QED_MF_8021Q_TAGGING , &p_hwfn->cdev->mf_bits) || +test_bit (QED_MF_8021AD_TAGGING , &p_hwfn->cdev->mf_bits))) + p_data->arr[type].dont_add_vlan0 = true; +/* QM reconf data */ if (p_info->personality == personality) p_info->offload_tc = tc;
@@ -233,7 +239,7 @@ qed_dcbx_update_app_info(struct qed_dcbx_results *p_data, personality = qed_dcbx_app_update[i].personality; name = qed_dcbx_app_update[i].name; -qed_dcbx_set_params (p_data, p_info, enable, +qed_dcbx_set_params (p_data, p_hwfn, p_info, enable, prio, tc, type, personality); } }
@@ -956,6 +962,7 @@ static void qed_dcbx_update_protocol_data(struct protocol_dcb_data *p_data, p_data->dcb_enable_flag = p_src->arr[type].enable; p_data->dcb_priority = p_src->arr[type].priority; p_data->dcb_tc = p_src->arr[type].tc; + p_data->dcb_dont_add_vlan0 = p_src->arr[type].dont_add_vlan0; }/* Set pf update ramrod command params */
drivers/net/ethernet/qlogic/qed/qed_dcbx.h +1 -0
@@ -55,6 +55,7 @@ struct qed_dcbx_app_data {u8 update;/* Update indication */ u8 priority;/* Priority */ u8 tc;/* Traffic Class */ +bool dont_add_vlan0;/* Do not insert a vlan tag with id 0 */ };#define QED_DCBX_VERSION_DISABLED 0
drivers/net/ethernet/qlogic/qed/qed_dev.c +14 -1
@@ -1636,7 +1636,7 @@ static int qed_vf_start(struct qed_hwfn *p_hwfn,int qed_hw_init (struct qed_dev *cdev,struct qed_hw_init_params *p_params) {struct qed_load_req_params load_req_params; -u32 load_code, param, drv_mb_param; +u32 load_code, resp, param, drv_mb_param;bool b_default_mtu = true;struct qed_hwfn *p_hwfn;int rc =0 , mfw_rc, i;
@@ -1782,6 +1782,19 @@ int qed_hw_init(struct qed_dev *cdev, struct qed_hw_init_params *p_params)if (IS_PF (cdev)) { p_hwfn =QED_LEADING_HWFN (cdev); + +/* Get pre-negotiated values for stag, bandwidth etc. */ +DP_VERBOSE (p_hwfn, +QED_MSG_SPQ , +"Sending GET_OEM_UPDATES command to trigger stag/bandwidth attention handling\n" ); + drv_mb_param =1 <<DRV_MB_PARAM_DUMMY_OEM_UPDATES_OFFSET ; + rc =qed_mcp_cmd (p_hwfn, p_hwfn->p_main_ptt, +DRV_MSG_CODE_GET_OEM_UPDATES , + drv_mb_param, &resp, ¶m); +if (rc) +DP_NOTICE (p_hwfn, +"Failed to send GET_OEM_UPDATES attention request\n" ); + drv_mb_param =STORM_FW_VERSION ; rc = qed_mcp_cmd(p_hwfn, p_hwfn->p_main_ptt, DRV_MSG_CODE_OV_UPDATE_STORM_FW_VER,
drivers/net/ethernet/qlogic/qed/qed_hsi.h +4 -0
@@ -12415,6 +12415,7 @@ struct public_drv_mb {#define DRV_MSG_SET_RESOURCE_VALUE_MSG 0x35000000#define DRV_MSG_CODE_OV_UPDATE_WOL 0x38000000#define DRV_MSG_CODE_OV_UPDATE_ESWITCH_MODE 0x39000000 +#define DRV_MSG_CODE_GET_OEM_UPDATES 0x41000000#define DRV_MSG_CODE_BW_UPDATE_ACK 0x32000000#define DRV_MSG_CODE_NIG_DRAIN 0x30000000
@@ -12540,6 +12541,9 @@ struct public_drv_mb {#define DRV_MB_PARAM_ESWITCH_MODE_VEB 0x1#define DRV_MB_PARAM_ESWITCH_MODE_VEPA 0x2 +#define DRV_MB_PARAM_DUMMY_OEM_UPDATES_MASK 0x1 +#define DRV_MB_PARAM_DUMMY_OEM_UPDATES_OFFSET 0 +#define DRV_MB_PARAM_SET_LED_MODE_OPER 0x0#define DRV_MB_PARAM_SET_LED_MODE_ON 0x1#define DRV_MB_PARAM_SET_LED_MODE_OFF 0x2
drivers/net/ethernet/renesas/ravb.h +5 -0
@@ -431,6 +431,7 @@ enum EIS_BIT {EIS_CULF1 =0x00000080 ,EIS_TFFF =0x00000100 ,EIS_QFS =0x00010000 , + EIS_RESERVED = (GENMASK(31, 17) | GENMASK(15, 11)), };/* RIC0 */
@@ -475,6 +476,7 @@ enum RIS0_BIT {RIS0_FRF15 =0x00008000 ,RIS0_FRF16 =0x00010000 ,RIS0_FRF17 =0x00020000 , + RIS0_RESERVED = GENMASK(31, 18), };/* RIC1 */
@@ -531,6 +533,7 @@ enum RIS2_BIT {RIS2_QFF16 =0x00010000 ,RIS2_QFF17 =0x00020000 ,RIS2_RFFF =0x80000000 , + RIS2_RESERVED = GENMASK(30, 18), };/* TIC */
@@ -547,6 +550,7 @@ enum TIS_BIT {TIS_FTF1 =0x00000002 ,/* Undocumented? */ TIS_TFUF =0x00000100 ,TIS_TFWF =0x00000200 , + TIS_RESERVED = (GENMASK(31, 20) | GENMASK(15, 12) | GENMASK(7, 4)) };/* ISS */
@@ -620,6 +624,7 @@ enum GIC_BIT {enum GIS_BIT {GIS_PTCF =0x00000001 ,/* Undocumented? */ GIS_PTMF =0x00000004 , +GIS_RESERVED =GENMASK (15 ,10 ), };/* GIE (R-Car Gen3 only) */
drivers/net/ethernet/renesas/ravb_main.c +6 -5
@@ -742,10 +742,11 @@ static void ravb_error_interrupt(struct net_device *ndev)u32 eis, ris2; eis =ravb_read (ndev,EIS ); -ravb_write (ndev, ~EIS_QFS ,EIS ); +ravb_write (ndev, ~(EIS_QFS |EIS_RESERVED ),EIS );if (eis &EIS_QFS ) { ris2 =ravb_read (ndev,RIS2 ); -ravb_write (ndev, ~(RIS2_QFF0 |RIS2_RFFF ),RIS2 ); +ravb_write (ndev, ~(RIS2_QFF0 |RIS2_RFFF |RIS2_RESERVED ), +RIS2 );/* Receive Descriptor Empty int */ if (ris2 &RIS2_QFF0 )
@@ -798,7 +799,7 @@ static bool ravb_timestamp_interrupt(struct net_device *ndev)u32 tis =ravb_read (ndev,TIS );if (tis &TIS_TFUF ) { -ravb_write (ndev, ~TIS_TFUF ,TIS ); +ravb_write (ndev, ~(TIS_TFUF |TIS_RESERVED ),TIS );ravb_get_tx_tstamp (ndev);return true; }
@@ -933,7 +934,7 @@ static int ravb_poll(struct napi_struct *napi, int budget)/* Processing RX Descriptor Ring */ if (ris0 & mask) {/* Clear RX interrupt */ -ravb_write (ndev, ~mask,RIS0 ); +ravb_write (ndev, ~(mask |RIS0_RESERVED ),RIS0 );if (ravb_rx (ndev, "a, q)) goto out; }
@@ -941,7 +942,7 @@ static int ravb_poll(struct napi_struct *napi, int budget)if (tis & mask) {spin_lock_irqsave (&priv->lock, flags);/* Clear TX interrupt */ -ravb_write (ndev, ~mask,TIS ); +ravb_write (ndev, ~(mask |TIS_RESERVED ),TIS );ravb_tx_free (ndev, q, true);netif_wake_subqueue (ndev, q);mmiowb ();
drivers/net/ethernet/renesas/ravb_ptp.c +1 -1
@@ -319,7 +319,7 @@ void ravb_ptp_interrupt(struct net_device *ndev) } } -ravb_write (ndev, ~gis,GIS ); +ravb_write (ndev, ~(gis |GIS_RESERVED ),GIS ); }void ravb_ptp_init (struct net_device *ndev,struct platform_device *pdev)
drivers/pci/controller/dwc/pcie-designware.c +4 -4
@@ -135,7 +135,7 @@ static void dw_pcie_prog_outbound_atu_unroll(struct dw_pcie *pci, int index,if (val &PCIE_ATU_ENABLE )return ; -usleep_range (LINK_WAIT_IATU_MIN ,LINK_WAIT_IATU_MAX ); +mdelay (LINK_WAIT_IATU ); }dev_err (pci->dev,"Outbound iATU is not being enabled\n" ); }
@@ -178,7 +178,7 @@ void dw_pcie_prog_outbound_atu(struct dw_pcie *pci, int index, int type,if (val &PCIE_ATU_ENABLE )return ; -usleep_range (LINK_WAIT_IATU_MIN ,LINK_WAIT_IATU_MAX ); +mdelay (LINK_WAIT_IATU ); }dev_err (pci->dev,"Outbound iATU is not being enabled\n" ); }
@@ -236,7 +236,7 @@ static int dw_pcie_prog_inbound_atu_unroll(struct dw_pcie *pci, int index,if (val &PCIE_ATU_ENABLE )return 0 ; -usleep_range (LINK_WAIT_IATU_MIN ,LINK_WAIT_IATU_MAX ); +mdelay (LINK_WAIT_IATU ); }dev_err (pci->dev,"Inbound iATU is not being enabled\n" );
@@ -282,7 +282,7 @@ int dw_pcie_prog_inbound_atu(struct dw_pcie *pci, int index, int bar,if (val &PCIE_ATU_ENABLE )return 0 ; -usleep_range (LINK_WAIT_IATU_MIN ,LINK_WAIT_IATU_MAX ); +mdelay (LINK_WAIT_IATU ); }dev_err (pci->dev,"Inbound iATU is not being enabled\n" );
drivers/pci/controller/dwc/pcie-designware.h +1 -2
@@ -26,8 +26,7 @@/* Parameters for the waiting for iATU enabled routine */ #define LINK_WAIT_MAX_IATU_RETRIES 5 -#define LINK_WAIT_IATU_MIN 9000 -#define LINK_WAIT_IATU_MAX 10000 +#define LINK_WAIT_IATU 9/* Synopsys-specific PCIe configuration registers */ #define PCIE_PORT_LINK_CONTROL 0x710
drivers/pinctrl/pinctrl-amd.c +23 -10
@@ -348,21 +348,12 @@ static void amd_gpio_irq_enable(struct irq_data *d)unsigned long flags;struct gpio_chip *gc =irq_data_get_irq_chip_data (d);struct amd_gpio *gpio_dev =gpiochip_get_data (gc); -u32 mask =BIT (INTERRUPT_ENABLE_OFF ) |BIT (INTERRUPT_MASK_OFF );raw_spin_lock_irqsave (&gpio_dev->lock, flags); pin_reg =readl (gpio_dev->base + (d->hwirq)*4 ); pin_reg |=BIT (INTERRUPT_ENABLE_OFF ); pin_reg |=BIT (INTERRUPT_MASK_OFF );writel (pin_reg, gpio_dev->base + (d->hwirq)*4 ); -/* -* When debounce logic is enabled it takes ~900 us before interrupts -* can be enabled. During this "debounce warm up" period the -* "INTERRUPT_ENABLE" bit will read as 0. Poll the bit here until it -* reads back as 1, signaling that interrupts are now enabled. -*/ -while ((readl (gpio_dev->base + (d->hwirq)*4 ) & mask) != mask) -continue ;raw_spin_unlock_irqrestore (&gpio_dev->lock, flags); }
@@ -426,7 +417,7 @@ static void amd_gpio_irq_eoi(struct irq_data *d)static int amd_gpio_irq_set_type (struct irq_data *d,unsigned int type) {int ret =0 ; -u32 pin_reg; +u32 pin_reg, pin_reg_irq_en, mask;unsigned long flags, irq_flags;struct gpio_chip *gc =irq_data_get_irq_chip_data (d);struct amd_gpio *gpio_dev =gpiochip_get_data (gc);
@@ -495,6 +486,28 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type) } pin_reg |=CLR_INTR_STAT <<INTERRUPT_STS_OFF ; +/* +* If WAKE_INT_MASTER_REG.MaskStsEn is set, a software write to the +* debounce registers of any GPIO will block wake/interrupt status +* generation for *all* GPIOs for a lenght of time that depends on +* WAKE_INT_MASTER_REG.MaskStsLength[11:0]. During this period the +* INTERRUPT_ENABLE bit will read as 0. +* +* We temporarily enable irq for the GPIO whose configuration is +* changing, and then wait for it to read back as 1 to know when +* debounce has settled and then disable the irq again. +* We do this polling with the spinlock held to ensure other GPIO +* access routines do not read an incorrect value for the irq enable +* bit of other GPIOs. We keep the GPIO masked while polling to avoid +* spurious irqs, and disable the irq again after polling. +*/ + mask =BIT (INTERRUPT_ENABLE_OFF ); + pin_reg_irq_en = pin_reg; + pin_reg_irq_en |= mask; + pin_reg_irq_en &= ~BIT (INTERRUPT_MASK_OFF ); +writel (pin_reg_irq_en, gpio_dev->base + (d->hwirq)*4 ); +while ((readl (gpio_dev->base + (d->hwirq)*4 ) & mask) != mask) +continue ;writel (pin_reg, gpio_dev->base + (d->hwirq)*4 );raw_spin_unlock_irqrestore (&gpio_dev->lock, flags);
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c +2 -3
@@ -3475,11 +3475,10 @@ static int ibmvscsis_probe(struct vio_dev *vdev, vscsi->dds.window[LOCAL ].liobn, vscsi->dds.window[REMOTE].liobn); -strcpy (vscsi->eye,"VSCSI " ); -strncat (vscsi->eye, vdev->name,MAX_EYE ); +snprintf (vscsi->eye,sizeof (vscsi->eye),"VSCSI %s" , vdev->name); vscsi->dds.unit_id = vdev->unit_address; -strncpy (vscsi->dds.partition_name, partition_name, +strscpy (vscsi->dds.partition_name, partition_name,sizeof (vscsi->dds.partition_name)); vscsi->dds.partition_num = partition_number;
drivers/scsi/ipr.c +61 -45
135 lines not on this page · raw message
drivers/scsi/ipr.h +1 -0
@@ -1568,6 +1568,7 @@ struct ipr_ioa_cfg {u8 saved_mode_page_len;struct work_struct work_q; +struct work_struct scsi_add_work_q;struct workqueue_struct *reset_work_q;wait_queue_head_t reset_wait_q;
drivers/scsi/lpfc/lpfc_attr.c +10 -5
@@ -320,12 +320,12 @@ lpfc_nvme_info_show(struct device *dev, struct device_attribute *attr, localport->port_id, statep);list_for_each_entry (ndlp, &vport->fc_nodes, nlp_listp) { + nrport =NULL ; +spin_lock (&vport->phba->hbalock); rport =lpfc_ndlp_get_nrport (ndlp); -if (!rport) -continue ; - -/* local short-hand pointer. */ - nrport = rport->remoteport; +if (rport) + nrport = rport->remoteport; +spin_unlock (&vport->phba->hbalock);if (!nrport)continue ;
@@ -3304,6 +3304,7 @@ lpfc_update_rport_devloss_tmo(struct lpfc_vport *vport)struct lpfc_nodelist *ndlp;#if (IS_ENABLED (CONFIG_NVME_FC ))struct lpfc_nvme_rport *rport; +struct nvme_fc_remote_port *remoteport =NULL ;#endif shost =lpfc_shost_from_vport (vport);
@@ -3314,8 +3315,12 @@ lpfc_update_rport_devloss_tmo(struct lpfc_vport *vport)if (ndlp->rport) ndlp->rport->dev_loss_tmo = vport->cfg_devloss_tmo;#if (IS_ENABLED (CONFIG_NVME_FC )) +spin_lock (&vport->phba->hbalock); rport =lpfc_ndlp_get_nrport (ndlp);if (rport) + remoteport = rport->remoteport; +spin_unlock (&vport->phba->hbalock); +if (remoteport)nvme_fc_set_remoteport_devloss (rport->remoteport, vport->cfg_devloss_tmo);#endif
drivers/scsi/lpfc/lpfc_debugfs.c +5 -5
@@ -551,7 +551,7 @@ lpfc_debugfs_nodelist_data(struct lpfc_vport *vport, char *buf, int size)unsigned char *statep;struct nvme_fc_local_port *localport;struct lpfc_nvmet_tgtport *tgtp; -struct nvme_fc_remote_port *nrport; +struct nvme_fc_remote_port *nrport =NULL ;struct lpfc_nvme_rport *rport; cnt = (LPFC_NODELIST_SIZE /LPFC_NODELIST_ENTRY_SIZE );
@@ -696,11 +696,11 @@ lpfc_debugfs_nodelist_data(struct lpfc_vport *vport, char *buf, int size) len +=snprintf (buf + len, size - len,"\tRport List:\n" );list_for_each_entry (ndlp, &vport->fc_nodes, nlp_listp) {/* local short-hand pointer. */ +spin_lock (&phba->hbalock); rport =lpfc_ndlp_get_nrport (ndlp); -if (!rport) -continue ; - - nrport = rport->remoteport; +if (rport) + nrport = rport->remoteport; +spin_unlock (&phba->hbalock);if (!nrport)continue ;
drivers/scsi/lpfc/lpfc_nvme.c +8 -3
@@ -2718,7 +2718,9 @@ lpfc_nvme_register_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) rpinfo.port_name =wwn_to_u64 (ndlp->nlp_portname.u.wwn); rpinfo.node_name =wwn_to_u64 (ndlp->nlp_nodename.u.wwn); +spin_lock_irq (&vport->phba->hbalock); oldrport =lpfc_ndlp_get_nrport (ndlp); +spin_unlock_irq (&vport->phba->hbalock);if (!oldrport)lpfc_nlp_get (ndlp);
@@ -2833,7 +2835,7 @@ lpfc_nvme_unregister_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)struct nvme_fc_local_port *localport;struct lpfc_nvme_lport *lport;struct lpfc_nvme_rport *rport; -struct nvme_fc_remote_port *remoteport; +struct nvme_fc_remote_port *remoteport =NULL ; localport = vport->localport;
@@ -2847,11 +2849,14 @@ lpfc_nvme_unregister_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)if (!lport) goto input_err; +spin_lock_irq (&vport->phba->hbalock); rport =lpfc_ndlp_get_nrport (ndlp); -if (!rport) +if (rport) + remoteport = rport->remoteport; +spin_unlock_irq (&vport->phba->hbalock); +if (!remoteport) goto input_err; - remoteport = rport->remoteport; lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME_DISC, "6033 Unreg nvme remoteport %p, portname x%llx, " "port_id x%06x, portstate x%x port type x%x\n",
drivers/scsi/sd.c +2 -1
@@ -1277,7 +1277,8 @@ static int sd_init_command(struct scsi_cmnd *cmd)case REQ_OP_ZONE_RESET :return sd_zbc_setup_reset_cmnd (cmd);default : -BUG (); +WARN_ON_ONCE (1 ); +return BLKPREP_KILL ; } }
drivers/soundwire/stream.c +17 -6
@@ -899,9 +899,10 @@ static void sdw_release_master_stream(struct sdw_stream_runtime *stream)struct sdw_master_runtime *m_rt = stream->m_rt;struct sdw_slave_runtime *s_rt, *_s_rt; -list_for_each_entry_safe (s_rt, _s_rt, - &m_rt->slave_rt_list, m_rt_node) -sdw_stream_remove_slave (s_rt->slave, stream); +list_for_each_entry_safe (s_rt, _s_rt, &m_rt->slave_rt_list, m_rt_node) { +sdw_slave_port_release (s_rt->slave->bus, s_rt->slave, stream); +sdw_release_slave_stream (s_rt->slave, stream); + }list_del (&m_rt->bus_node); }
@@ -1112,7 +1113,7 @@ int sdw_stream_add_master(struct sdw_bus *bus,"Master runtime config failed for stream:%s" , stream->name); ret = -ENOMEM ; - goto error; + goto unlock; } ret =sdw_config_stream (bus->dev, stream, stream_config, false);
@@ -1123,11 +1124,11 @@ int sdw_stream_add_master(struct sdw_bus *bus,if (ret) goto stream_error; - stream->state =SDW_STREAM_CONFIGURED ; + goto unlock; stream_error:sdw_release_master_stream (stream); -error: +unlock:mutex_unlock (&bus->bus_lock);return ret; }
@@ -1141,6 +1142,10 @@ EXPORT_SYMBOL(sdw_stream_add_master);* @stream: SoundWire stream * @port_config: Port configuration for audio stream * @num_ports: Number of ports +* +* It is expected that Slave is added before adding Master +* to the Stream. +* */ int sdw_stream_add_slave(struct sdw_slave *slave, struct sdw_stream_config *stream_config,
@@ -1186,6 +1191,12 @@ int sdw_stream_add_slave(struct sdw_slave *slave,if (ret) goto stream_error; +/* +* Change stream state to CONFIGURED on first Slave add. +* Bus is not aware of number of Slave(s) in a stream at this +* point so cannot depend on all Slave(s) to be added in order to +* change stream state to CONFIGURED. +*/ stream->state =SDW_STREAM_CONFIGURED ; goto error;
drivers/spi/spi-gpio.c +2 -2
@@ -287,8 +287,8 @@ static int spi_gpio_request(struct device *dev, *mflags |=SPI_MASTER_NO_RX ; spi_gpio->sck =devm_gpiod_get (dev,"sck" ,GPIOD_OUT_LOW ); -if (IS_ERR (spi_gpio->mosi)) -return PTR_ERR (spi_gpio->mosi); +if (IS_ERR (spi_gpio->sck)) +return PTR_ERR (spi_gpio->sck);for (i =0 ; i < num_chipselects; i++) { spi_gpio->cs_gpios[i] = devm_gpiod_get_index(dev, "cs",
fs/namespace.c +3 -4
@@ -446,10 +446,10 @@ int mnt_want_write_file_path(struct file *file) {int ret; -sb_start_write (file_inode (file)->i_sb); +sb_start_write (file->f_path.mnt->mnt_sb); ret =__mnt_want_write_file (file);if (ret) -sb_end_write (file_inode (file)->i_sb); +sb_end_write (file->f_path.mnt->mnt_sb);return ret; }
@@ -540,8 +540,7 @@ void __mnt_drop_write_file(struct file *file)void mnt_drop_write_file_path (struct file *file) { -__mnt_drop_write_file (file); -sb_end_write (file_inode (file)->i_sb); +mnt_drop_write (file->f_path.mnt); }void mnt_drop_write_file (struct file *file)
include/linux/huge_mm.h +1 -1
@@ -42,7 +42,7 @@ extern int mincore_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, unsigned char *vec);extern bool move_huge_pmd (struct vm_area_struct *vma,unsigned long old_addr,unsigned long new_addr,unsigned long old_end, -pmd_t *old_pmd,pmd_t *new_pmd,bool *need_flush); +pmd_t *old_pmd,pmd_t *new_pmd);extern int change_huge_pmd (struct vm_area_struct *vma,pmd_t *pmd,unsigned long addr,pgprot_t newprot,int prot_numa);
kernel/bpf/sockmap.c +71 -20
161 lines not on this page · raw message
mm/huge_memory.c +4 -6
@@ -1778,7 +1778,7 @@ static pmd_t move_soft_dirty_pmd(pmd_t pmd)bool move_huge_pmd (struct vm_area_struct *vma,unsigned long old_addr,unsigned long new_addr,unsigned long old_end, -pmd_t *old_pmd,pmd_t *new_pmd,bool *need_flush) +pmd_t *old_pmd,pmd_t *new_pmd) {spinlock_t *old_ptl, *new_ptl;pmd_t pmd;
@@ -1809,7 +1809,7 @@ bool move_huge_pmd(struct vm_area_struct *vma, unsigned long old_addr,if (new_ptl != old_ptl)spin_lock_nested (new_ptl,SINGLE_DEPTH_NESTING ); pmd =pmdp_huge_get_and_clear (mm, old_addr, old_pmd); -if (pmd_present (pmd) &&pmd_dirty (pmd)) +if (pmd_present (pmd)) force_flush = true;VM_BUG_ON (!pmd_none (*new_pmd));
@@ -1820,12 +1820,10 @@ bool move_huge_pmd(struct vm_area_struct *vma, unsigned long old_addr, } pmd =move_soft_dirty_pmd (pmd);set_pmd_at (mm, new_addr, new_pmd, pmd); -if (new_ptl != old_ptl) -spin_unlock (new_ptl);if (force_flush)flush_tlb_range (vma, old_addr, old_addr +PMD_SIZE ); -else - *need_flush = true; +if (new_ptl != old_ptl) +spin_unlock (new_ptl);spin_unlock (old_ptl);return true; }
mm/mremap.c +13 -17
@@ -115,7 +115,7 @@ static pte_t move_soft_dirty_pte(pte_t pte)static void move_ptes (struct vm_area_struct *vma,pmd_t *old_pmd,unsigned long old_addr,unsigned long old_end,struct vm_area_struct *new_vma,pmd_t *new_pmd, -unsigned long new_addr,bool need_rmap_locks,bool *need_flush) +unsigned long new_addr,bool need_rmap_locks) {struct mm_struct *mm = vma->vm_mm;pte_t *old_pte, *new_pte, pte;
@@ -163,15 +163,17 @@ static void move_ptes(struct vm_area_struct *vma, pmd_t *old_pmd, pte =ptep_get_and_clear (mm, old_addr, old_pte);/* -* If we are remapping a dirty PTE, make sure +* If we are remapping a valid PTE, make sure * to flush TLB before we drop the PTL for the -* old PTE or we may race with page_mkclean(). +* PTE. * -* This check has to be done after we removed the -* old PTE from page tables or another thread may -* dirty it after the check and before the removal. +* NOTE! Both old and new PTL matter: the old one +* for racing with page_mkclean(), the new one to +* make sure the physical page stays valid until +* the TLB entry for the old mapping has been +* flushed. */ -if (pte_present (pte) &&pte_dirty (pte)) +if (pte_present (pte)) force_flush = true; pte =move_pte (pte, new_vma->vm_page_prot, old_addr, new_addr); pte =move_soft_dirty_pte (pte);
@@ -179,13 +181,11 @@ static void move_ptes(struct vm_area_struct *vma, pmd_t *old_pmd, }arch_leave_lazy_mmu_mode (); +if (force_flush) +flush_tlb_range (vma, old_end - len, old_end);if (new_ptl != old_ptl)spin_unlock (new_ptl);pte_unmap (new_pte -1 ); -if (force_flush) -flush_tlb_range (vma, old_end - len, old_end); -else - *need_flush = true;pte_unmap_unlock (old_pte -1 , old_ptl);if (need_rmap_locks)drop_rmap_locks (vma);
@@ -198,7 +198,6 @@ unsigned long move_page_tables(struct vm_area_struct *vma, {unsigned long extent, next, old_end;pmd_t *old_pmd, *new_pmd; -bool need_flush = false;unsigned long mmun_start;/* For mmu_notifiers */ unsigned long mmun_end;/* For mmu_notifiers */
@@ -229,8 +228,7 @@ unsigned long move_page_tables(struct vm_area_struct *vma,if (need_rmap_locks)take_rmap_locks (vma); moved =move_huge_pmd (vma, old_addr, new_addr, - old_end, old_pmd, new_pmd, - &need_flush); + old_end, old_pmd, new_pmd);if (need_rmap_locks)drop_rmap_locks (vma);if (moved)
@@ -246,10 +244,8 @@ unsigned long move_page_tables(struct vm_area_struct *vma,if (extent > next - new_addr) extent = next - new_addr;move_ptes (vma, old_pmd, old_addr, old_addr + extent, new_vma, - new_pmd, new_addr, need_rmap_locks, &need_flush); + new_pmd, new_addr, need_rmap_locks); } -if (need_flush) -flush_tlb_range (vma, old_end-len, old_addr);mmu_notifier_invalidate_range_end (vma->vm_mm, mmun_start, mmun_end);
net/batman-adv/bat_v_elp.c +7 -3
@@ -241,7 +241,7 @@ batadv_v_elp_wifi_neigh_probe(struct batadv_hardif_neigh_node *neigh)* the packet to be exactly of that size to make the link * throughput estimation effective. */ -skb_put (skb, probe_len - hard_iface->bat_v.elp_skb->len); +skb_put_zero (skb, probe_len - hard_iface->bat_v.elp_skb->len); batadv_dbg(BATADV_DBG_BATMAN, bat_priv, "Sending unicast (probe) ELP packet on interface %s to %pM\n",
@@ -268,6 +268,7 @@ static void batadv_v_elp_periodic_work(struct work_struct *work)struct batadv_priv *bat_priv;struct sk_buff *skb;u32 elp_interval; +bool ret; bat_v = container_of(work, struct batadv_hard_iface_bat_v, elp_wq.work); hard_iface = container_of(bat_v, struct batadv_hard_iface, bat_v);
@@ -329,8 +330,11 @@ static void batadv_v_elp_periodic_work(struct work_struct *work)* may sleep and that is not allowed in an rcu protected * context. Therefore schedule a task for that. */ -queue_work (batadv_event_workqueue, - &hardif_neigh->bat_v.metric_work); + ret =queue_work (batadv_event_workqueue, + &hardif_neigh->bat_v.metric_work); + +if (!ret) +batadv_hardif_neigh_put (hardif_neigh); }rcu_read_unlock ();
net/batman-adv/bridge_loop_avoidance.c +8 -2
@@ -1772,6 +1772,7 @@ batadv_bla_loopdetect_check(struct batadv_priv *bat_priv, struct sk_buff *skb, {struct batadv_bla_backbone_gw *backbone_gw;struct ethhdr *ethhdr; +bool ret; ethhdr =eth_hdr (skb);
@@ -1795,8 +1796,13 @@ batadv_bla_loopdetect_check(struct batadv_priv *bat_priv, struct sk_buff *skb,if (unlikely (!backbone_gw))return true; -queue_work (batadv_event_workqueue, &backbone_gw->report_work); -/* backbone_gw is unreferenced in the report work function function */ + ret =queue_work (batadv_event_workqueue, &backbone_gw->report_work); + +/* backbone_gw is unreferenced in the report work function function +* if queue_work() call was successful +*/ +if (!ret) +batadv_backbone_gw_put (backbone_gw);return true; }
net/batman-adv/gateway_client.c +9 -2
@@ -32,6 +32,7 @@#include <linux/kernel.h> #include <linux/kref.h> #include <linux/list.h> +#include <linux/lockdep.h> #include <linux/netdevice.h> #include <linux/netlink.h> #include <linux/rculist.h>
@@ -348,6 +349,9 @@ void batadv_gw_check_election(struct batadv_priv *bat_priv,* @bat_priv: the bat priv with all the soft interface information * @orig_node: originator announcing gateway capabilities * @gateway: announced bandwidth information +* +* Has to be called with the appropriate locks being acquired +* (gw.list_lock). */ static void batadv_gw_node_add(struct batadv_priv *bat_priv, struct batadv_orig_node *orig_node,
@@ -355,6 +359,8 @@ static void batadv_gw_node_add(struct batadv_priv *bat_priv, {struct batadv_gw_node *gw_node; +lockdep_assert_held (&bat_priv->gw.list_lock); +if (gateway->bandwidth_down ==0 )return ;
@@ -369,10 +375,8 @@ static void batadv_gw_node_add(struct batadv_priv *bat_priv, gw_node->bandwidth_down =ntohl (gateway->bandwidth_down); gw_node->bandwidth_up =ntohl (gateway->bandwidth_up); -spin_lock_bh (&bat_priv->gw.list_lock);kref_get (&gw_node->refcount);hlist_add_head_rcu (&gw_node->list, &bat_priv->gw.gateway_list); -spin_unlock_bh (&bat_priv->gw.list_lock); batadv_dbg(BATADV_DBG_BATMAN, bat_priv, "Found new gateway %pM -> gw bandwidth: %u.%u/%u.%u MBit\n",
@@ -428,11 +432,14 @@ void batadv_gw_node_update(struct batadv_priv *bat_priv, {struct batadv_gw_node *gw_node, *curr_gw =NULL ; +spin_lock_bh (&bat_priv->gw.list_lock); gw_node =batadv_gw_node_get (bat_priv, orig_node);if (!gw_node) {batadv_gw_node_add (bat_priv, orig_node, gateway); +spin_unlock_bh (&bat_priv->gw.list_lock); goto out; } +spin_unlock_bh (&bat_priv->gw.list_lock);if (gw_node->bandwidth_down ==ntohl (gateway->bandwidth_down) && gw_node->bandwidth_up ==ntohl (gateway->bandwidth_up))
net/batman-adv/network-coding.c +15 -12
@@ -854,16 +854,27 @@ batadv_nc_get_nc_node(struct batadv_priv *bat_priv,spinlock_t *lock;/* Used to lock list selected by "int in_coding" */ struct list_head *list; +/* Select ingoing or outgoing coding node */ +if (in_coding) { + lock = &orig_neigh_node->in_coding_list_lock; + list = &orig_neigh_node->in_coding_list; + }else { + lock = &orig_neigh_node->out_coding_list_lock; + list = &orig_neigh_node->out_coding_list; + } + +spin_lock_bh (lock); +/* Check if nc_node is already added */ nc_node =batadv_nc_find_nc_node (orig_node, orig_neigh_node, in_coding);/* Node found */ if (nc_node) -return nc_node; + goto unlock; nc_node =kzalloc (sizeof (*nc_node),GFP_ATOMIC );if (!nc_node) -return NULL ; + goto unlock;/* Initialize nc_node */ INIT_LIST_HEAD (&nc_node->list);
@@ -872,22 +883,14 @@ batadv_nc_get_nc_node(struct batadv_priv *bat_priv,kref_get (&orig_neigh_node->refcount); nc_node->orig_node = orig_neigh_node; -/* Select ingoing or outgoing coding node */ -if (in_coding) { - lock = &orig_neigh_node->in_coding_list_lock; - list = &orig_neigh_node->in_coding_list; - }else { - lock = &orig_neigh_node->out_coding_list_lock; - list = &orig_neigh_node->out_coding_list; - } -batadv_dbg (BATADV_DBG_NC , bat_priv,"Adding nc_node %pM -> %pM\n" , nc_node->addr, nc_node->orig_node->orig);/* Add nc_node to orig_node */ -spin_lock_bh (lock);kref_get (&nc_node->refcount);list_add_tail_rcu (&nc_node->list, list); + +unlock:spin_unlock_bh (lock);return nc_node;
net/batman-adv/soft-interface.c +18 -7
@@ -574,15 +574,20 @@ int batadv_softif_create_vlan(struct batadv_priv *bat_priv, unsigned short vid)struct batadv_softif_vlan *vlan;int err; +spin_lock_bh (&bat_priv->softif_vlan_list_lock); + vlan =batadv_softif_vlan_get (bat_priv, vid);if (vlan) {batadv_softif_vlan_put (vlan); +spin_unlock_bh (&bat_priv->softif_vlan_list_lock);return -EEXIST ; } vlan =kzalloc (sizeof (*vlan),GFP_ATOMIC ); -if (!vlan) +if (!vlan) { +spin_unlock_bh (&bat_priv->softif_vlan_list_lock);return -ENOMEM ; + } vlan->bat_priv = bat_priv; vlan->vid = vid;
@@ -590,17 +595,23 @@ int batadv_softif_create_vlan(struct batadv_priv *bat_priv, unsigned short vid)atomic_set (&vlan->ap_isolation,0 ); +kref_get (&vlan->refcount); +hlist_add_head_rcu (&vlan->list, &bat_priv->softif_vlan_list); +spin_unlock_bh (&bat_priv->softif_vlan_list_lock); + +/* batadv_sysfs_add_vlan cannot be in the spinlock section due to the +* sleeping behavior of the sysfs functions and the fs_reclaim lock +*/ err =batadv_sysfs_add_vlan (bat_priv->soft_iface, vlan);if (err) { -kfree (vlan); +/* ref for the function */ +batadv_softif_vlan_put (vlan); + +/* ref for the list */ +batadv_softif_vlan_put (vlan);return err; } -spin_lock_bh (&bat_priv->softif_vlan_list_lock); -kref_get (&vlan->refcount); -hlist_add_head_rcu (&vlan->list, &bat_priv->softif_vlan_list); -spin_unlock_bh (&bat_priv->softif_vlan_list_lock); -/* add a new TT local entry. This one will be marked with the NOPURGE * flag */
net/batman-adv/sysfs.c +20 -10
@@ -188,7 +188,8 @@ ssize_t batadv_store_##_name(struct kobject *kobj, \ \return __batadv_store_uint_attr (buff, count, _min, _max, \ _post_func, attr, \ - &bat_priv->_var, net_dev); \ + &bat_priv->_var, net_dev, \ +NULL ); \ }#define BATADV_ATTR_SIF_SHOW_UINT (_name, _var) \
@@ -262,7 +263,9 @@ ssize_t batadv_store_##_name(struct kobject *kobj, \ \ length =__batadv_store_uint_attr (buff, count, _min, _max, \ _post_func, attr, \ - &hard_iface->_var, net_dev); \ + &hard_iface->_var, \ + hard_iface->soft_iface, \ + net_dev); \ \batadv_hardif_put (hard_iface); \return length; \
@@ -356,10 +359,12 @@ __batadv_store_bool_attr(char *buff, size_t count,static int batadv_store_uint_attr (const char *buff,size_t count,struct net_device *net_dev, +struct net_device *slave_dev,const char *attr_name,unsigned int min,unsigned int max,atomic_t *attr) { +char ifname[IFNAMSIZ +3 ] ="" ;unsigned long uint_val;int ret;
@@ -385,8 +390,11 @@ static int batadv_store_uint_attr(const char *buff, size_t count,if (atomic_read (attr) == uint_val)return count; -batadv_info (net_dev,"%s: Changing from: %i to: %lu\n" , - attr_name,atomic_read (attr), uint_val); +if (slave_dev) +snprintf (ifname,sizeof (ifname),"%s: " , slave_dev->name); + +batadv_info (net_dev,"%s: %sChanging from: %i to: %lu\n" , + attr_name, ifname,atomic_read (attr), uint_val);atomic_set (attr, uint_val);return count;
@@ -397,12 +405,13 @@ static ssize_t __batadv_store_uint_attr(const char *buff, size_t count,void (*post_func)(struct net_device *), const struct attribute *attr, atomic_t *attr_store, - struct net_device *net_dev) + struct net_device *net_dev, + struct net_device *slave_dev) { int ret; - ret =batadv_store_uint_attr (buff, count, net_dev, attr->name, min, max, - attr_store); + ret =batadv_store_uint_attr (buff, count, net_dev, slave_dev, + attr->name, min, max, attr_store);if (post_func && ret)post_func (net_dev);
@@ -571,7 +580,7 @@ static ssize_t batadv_store_gw_sel_class(struct kobject *kobj,return __batadv_store_uint_attr (buff, count,1 ,BATADV_TQ_MAX_VALUE , batadv_post_gw_reselect, attr, &bat_priv->gw.sel_class, - bat_priv->soft_iface); + bat_priv->soft_iface,NULL ); } static ssize_t batadv_show_gw_bwidth(struct kobject *kobj,
@@ -1090,8 +1099,9 @@ static ssize_t batadv_store_throughput_override(struct kobject *kobj,if (old_tp_override == tp_override) goto out; -batadv_info (net_dev,"%s: Changing from: %u.%u MBit to: %u.%u MBit\n" , -"throughput_override" , +batadv_info (hard_iface->soft_iface, +"%s: %s: Changing from: %u.%u MBit to: %u.%u MBit\n" , +"throughput_override" , net_dev->name, old_tp_override /10 , old_tp_override %10 , tp_override /10 , tp_override %10 );
net/batman-adv/translation-table.c +4 -2
@@ -1613,6 +1613,8 @@ batadv_tt_global_orig_entry_add(struct batadv_tt_global_entry *tt_global, {struct batadv_tt_orig_list_entry *orig_entry; +spin_lock_bh (&tt_global->list_lock); + orig_entry =batadv_tt_global_orig_entry_find (tt_global, orig_node);if (orig_entry) {/* refresh the ttvn: the current value could be a bogus one that
@@ -1635,11 +1637,9 @@ batadv_tt_global_orig_entry_add(struct batadv_tt_global_entry *tt_global, orig_entry->flags = flags;kref_init (&orig_entry->refcount); -spin_lock_bh (&tt_global->list_lock);kref_get (&orig_entry->refcount);hlist_add_head_rcu (&orig_entry->list, &tt_global->orig_list); -spin_unlock_bh (&tt_global->list_lock);atomic_inc (&tt_global->orig_list_count); sync_flags:
@@ -1647,6 +1647,8 @@ batadv_tt_global_orig_entry_add(struct batadv_tt_global_entry *tt_global, out:if (orig_entry)batadv_tt_orig_list_entry_put (orig_entry); + +spin_unlock_bh (&tt_global->list_lock); }/**
net/batman-adv/tvlv.c +6 -2
@@ -529,15 +529,20 @@ void batadv_tvlv_handler_register(struct batadv_priv *bat_priv, {struct batadv_tvlv_handler *tvlv_handler; +spin_lock_bh (&bat_priv->tvlv.handler_list_lock); + tvlv_handler =batadv_tvlv_handler_get (bat_priv, type, version);if (tvlv_handler) { +spin_unlock_bh (&bat_priv->tvlv.handler_list_lock);batadv_tvlv_handler_put (tvlv_handler);return ; } tvlv_handler =kzalloc (sizeof (*tvlv_handler),GFP_ATOMIC ); -if (!tvlv_handler) +if (!tvlv_handler) { +spin_unlock_bh (&bat_priv->tvlv.handler_list_lock);return ; + } tvlv_handler->ogm_handler = optr; tvlv_handler->unicast_handler = uptr;
@@ -547,7 +552,6 @@ void batadv_tvlv_handler_register(struct batadv_priv *bat_priv,kref_init (&tvlv_handler->refcount);INIT_HLIST_NODE (&tvlv_handler->list); -spin_lock_bh (&bat_priv->tvlv.handler_list_lock);kref_get (&tvlv_handler->refcount);hlist_add_head_rcu (&tvlv_handler->list, &bat_priv->tvlv.handler_list);spin_unlock_bh (&bat_priv->tvlv.handler_list_lock);
net/smc/af_smc.c +5 -2
@@ -612,7 +612,10 @@ static void smc_connect_work(struct work_struct *work) smc->sk.sk_err = -rc; out: - smc->sk.sk_state_change (&smc->sk); +if (smc->sk.sk_err) + smc->sk.sk_state_change (&smc->sk); +else + smc->sk.sk_write_space (&smc->sk);kfree (smc->connect_info); smc->connect_info =NULL ;release_sock (&smc->sk);
@@ -1345,7 +1348,7 @@ static __poll_t smc_poll(struct file *file, struct socket *sock,return EPOLLNVAL ; smc =smc_sk (sock->sk); -if ((sk->sk_state ==SMC_INIT ) || smc->use_fallback) { +if (smc->use_fallback) {/* delegate to CLC child sock */ mask = smc->clcsock->ops->poll (file, smc->clcsock, wait); sk->sk_err = smc->clcsock->sk->sk_err;
net/smc/smc_clc.c +6 -8
@@ -405,14 +405,12 @@ int smc_clc_send_proposal(struct smc_sock *smc, vec[i++].iov_len =sizeof (trl);/* due to the few bytes needed for clc-handshake this cannot block */ len =kernel_sendmsg (smc->clcsock, &msg, vec, i, plen); -if (len <sizeof (pclc)) { -if (len >=0 ) { - reason_code = -ENETUNREACH ; - smc->sk.sk_err = -reason_code; - }else { - smc->sk.sk_err = smc->clcsock->sk->sk_err; - reason_code = -smc->sk.sk_err; - } +if (len <0 ) { + smc->sk.sk_err = smc->clcsock->sk->sk_err; + reason_code = -smc->sk.sk_err; + }else if (len < (int )sizeof (pclc)) { + reason_code = -ENETUNREACH ; + smc->sk.sk_err = -reason_code; }return reason_code;
tools/testing/selftests/bpf/test_maps.c +7 -3
@@ -566,7 +566,11 @@ static void test_sockmap(int tasks, void *data)/* Test update without programs */ for (i =0 ; i <6 ; i++) { err =bpf_map_update_elem (fd, &i, &sfd[i],BPF_ANY ); -if (err) { +if (i <2 && !err) { +printf ("Allowed update sockmap '%i:%i' not in ESTABLISHED\n" , + i, sfd[i]); + goto out_sockmap; + }else if (i >=2 && err) {printf ("Failed noprog update sockmap '%i:%i'\n" , i, sfd[i]); goto out_sockmap;
@@ -727,7 +731,7 @@ static void test_sockmap(int tasks, void *data) }/* Test map update elem afterwards fd lives in fd and map_fd */ -for (i =0 ; i <6 ; i++) { +for (i =2 ; i <6 ; i++) { err =bpf_map_update_elem (map_fd_rx, &i, &sfd[i],BPF_ANY );if (err) { printf("Failed map_fd_rx update sockmap %i '%i:%i'\n",
@@ -831,7 +835,7 @@ static void test_sockmap(int tasks, void *data) }/* Delete the elems without programs */ -for (i =0 ; i <6 ; i++) { +for (i =2 ; i <6 ; i++) { err =bpf_map_delete_elem (fd, &i);if (err) { printf("Failed delete sockmap %i '%i:%i'\n",
tools/testing/selftests/net/pmtu.sh +2 -2
@@ -178,8 +178,8 @@ setup() { cleanup() { [ ${cleanup_done} -eq 1 ] && return - ip netns del ${NS_A} 2 > /dev/null - ip netns del ${NS_B} 2 > /dev/null + ip netns del ${NS_A} 2> /dev/null + ip netns del ${NS_B} 2> /dev/null cleanup_done=1 }