2020-12-14 19:18:18

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.9 000/105] 5.9.15-rc1 review

This is the start of the stable review cycle for the 5.9.15 release.
There are 105 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.

Responses should be made by Wed, 16 Dec 2020 17:25:32 +0000.
Anything received after that time might be too late.

The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.9.15-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.9.y
and the diffstat can be found below.

thanks,

greg k-h

-------------
Pseudo-Shortlog of commits:

Greg Kroah-Hartman <[email protected]>
Linux 5.9.15-rc1

Arvind Sankar <[email protected]>
compiler.h: fix barrier_data() on clang

Masami Hiramatsu <[email protected]>
x86/kprobes: Fix optprobe to detect INT3 padding correctly

Thomas Gleixner <[email protected]>
x86/apic/vector: Fix ordering in vector assignment

Andy Lutomirski <[email protected]>
x86/membarrier: Get rid of a dubious optimization

Arvind Sankar <[email protected]>
x86/mm/mem_encrypt: Fix definition of PMD_FLAGS_DEC_WP

Dan Carpenter <[email protected]>
scsi: be2iscsi: Revert "Fix a theoretical leak in beiscsi_create_eqs()"

Damien Le Moal <[email protected]>
zonefs: fix page reference and BIO leak

Gerald Schaefer <[email protected]>
mm/hugetlb: clear compound_nr before freeing gigantic pages

Miles Chen <[email protected]>
proc: use untagged_addr() for pagemap_read addresses

Arnd Bergmann <[email protected]>
kbuild: avoid static_assert for genksyms

Stanley.Yang <[email protected]>
drm/amdgpu: fix sdma instance fw version and feature version init

Chris Wilson <[email protected]>
drm/i915/gt: Cancel the preemption timeout on responding to it

Chris Wilson <[email protected]>
drm/i915/gt: Ignore repeated attempts to suspend request flow across reset

Chris Wilson <[email protected]>
drm/i915/gt: Declare gen9 has 64 mocs entries!

Manasi Navare <[email protected]>
drm/i915/display/dp: Compute the correct slice count for VDSC on DP

Chris Wilson <[email protected]>
drm/i915/gem: Propagate error from cancelled submit due to context closure

Alex Deucher <[email protected]>
drm/amdgpu/disply: set num_crtc earlier

Bean Huo <[email protected]>
mmc: block: Fixup condition for CMD13 polling for RPMB requests

Muhammad Husaini Zulkifli <[email protected]>
mmc: sdhci-of-arasan: Fix clock registration error for Keem Bay SOC

Coiby Xu <[email protected]>
pinctrl: amd: remove debounce filter setting in IRQ type setting

Evan Green <[email protected]>
pinctrl: jasperlake: Fix HOSTSW_OWN offset

Chris Chiu <[email protected]>
Input: i8042 - add Acer laptops to the i8042 reset list

Dmitry Torokhov <[email protected]>
Input: cm109 - do not stomp on control URB

Juergen Gross <[email protected]>
xen: don't use page->lru for ZONE_DEVICE memory

Juergen Gross <[email protected]>
xen: add helpers for caching grant mapping pages

Libo Chen <[email protected]>
ktest.pl: Fix incorrect reboot for grub2bls

yong mao <[email protected]>
mmc: mediatek: Extend recheck_sdio_irq fix to more variants

Wenbin Mei <[email protected]>
mmc: mediatek: Fix system suspend/resume support for CQHCI

Hans Verkuil <[email protected]>
media: pulse8-cec: add support for FW v10 and up

Hans Verkuil <[email protected]>
media: pulse8-cec: fix duplicate free at disconnect or probe error

Peter Zijlstra <[email protected]>
intel_idle: Build fix

Heiko Carstens <[email protected]>
s390: fix irq state tracing

Pankaj Sharma <[email protected]>
can: m_can: m_can_dev_setup(): add support for bosch mcan version 3.3.0

Hans de Goede <[email protected]>
platform/x86: touchscreen_dmi: Add info for the Irbis TW118 tablet

Hans de Goede <[email protected]>
platform/x86: touchscreen_dmi: Add info for the Predia Basic tablet

Max Verevkin <[email protected]>
platform/x86: intel-vbtn: Support for tablet mode on HP Pavilion 13 x360 PC

Timo Witte <[email protected]>
platform/x86: acer-wmi: add automatic keyboard background light toggle key as KEY_LIGHTS_TOGGLE

Matthias Maier <[email protected]>
platform/x86: thinkpad_acpi: Whitelist P15 firmware for dual fan control

Hans de Goede <[email protected]>
platform/x86: thinkpad_acpi: Add BAT1 is primary battery quirk for Thinkpad Yoga 11e 4th gen

Hans de Goede <[email protected]>
platform/x86: thinkpad_acpi: Do not report SW_TABLET_MODE on Yoga 11e

Iakov 'Jake' Kirilenko <[email protected]>
platform/x86: thinkpad_acpi: add P1 gen3 second fan support

Jon Hunter <[email protected]>
arm64: tegra: Disable the ACONNECT for Jetson TX2

Peter Zijlstra <[email protected]>
intel_idle: Fix intel_idle() vs tracing

Peter Zijlstra <[email protected]>
sched/idle: Fix arch_cpu_idle() vs tracing

Hao Si <[email protected]>
soc: fsl: dpio: Get the cpumask through cpumask_of(cpu)

Filipe Manana <[email protected]>
btrfs: fix lockdep splat when enabling and disabling qgroups

Filipe Manana <[email protected]>
btrfs: do nofs allocations when adding and removing qgroup relations

Oded Gabbay <[email protected]>
habanalabs/gaudi: fix missing code in ECC handling

John Stultz <[email protected]>
arm-smmu-qcom: Ensure the qcom_scm driver has finished probing

Ran Wang <[email protected]>
spi: spi-nxp-fspi: fix fspi panic by unexpected interrupts

Krzysztof Kozlowski <[email protected]>
drm/exynos: depend on COMMON_CLK to fix compile tests

Xu Qiang <[email protected]>
irqchip/gic-v3-its: Unconditionally save/restore the ITS state on suspend

Lijun Pan <[email protected]>
ibmvnic: skip tx timeout reset while in resetting

Georgi Djakov <[email protected]>
interconnect: qcom: qcs404: Remove GPU and display RPM IDs

Georgi Djakov <[email protected]>
interconnect: qcom: msm8916: Remove rpm-ids from non-RPM nodes

Can Guo <[email protected]>
scsi: ufs: Make sure clk scaling happens only when HBA is runtime ACTIVE

Can Guo <[email protected]>
scsi: ufs: Fix unexpected values from ufshcd_read_desc_param()

Vineet Gupta <[email protected]>
ARC: stack unwinding: don't assume non-current task is sleeping

Zhen Lei <[email protected]>
arm64: dts: broadcom: clear the warnings caused by empty dma-ranges

Michael Ellerman <[email protected]>
powerpc: Drop -me200 addition to build flags

Sara Sharon <[email protected]>
iwlwifi: mvm: fix kernel panic in case of assert during CSA

Johannes Berg <[email protected]>
iwlwifi: pcie: set LTR to avoid completion timeout

Mordechay Goodstein <[email protected]>
iwlwifi: sta: set max HE max A-MPDU according to HE capa

Markus Reichl <[email protected]>
arm64: dts: rockchip: Reorder LED triggers from mmc devices on rk3399-roc-pc.

Markus Reichl <[email protected]>
arm64: dts: rockchip: Assign a fixed index to mmc devices on rk3399 boards.

Johannes Berg <[email protected]>
iwlwifi: pcie: limit memory read spin time

Maciej Matuszczyk <[email protected]>
arm64: dts: rockchip: Remove system-power-controller from pmic on Odroid Go Advance

Al Cooper <[email protected]>
phy: usb: Fix incorrect clearing of tca_drv_sel bit in SETUP reg for 7211

Liu Zixian <[email protected]>
mm/mmap.c: fix mmap return value when vma is merged after call_mmap()

Randy Dunlap <[email protected]>
zlib: export S390 symbols for zlib modules

Linus Walleij <[email protected]>
usb: ohci-omap: Fix descriptor conversion

Namhyung Kim <[email protected]>
perf/x86/intel: Fix a warning on x86_pmu_stop() with large PEBS

Luca Coelho <[email protected]>
iwlwifi: pcie: invert values of NO_160 device config entries

Randy Dunlap <[email protected]>
vdpa: mlx5: fix vdpa/vhost dependencies

Randy Dunlap <[email protected]>
net: broadcom CNIC: requires MMU

Jing Xiangfeng <[email protected]>
scsi: storvsc: Fix error return in storvsc_probe()

Sami Tolvanen <[email protected]>
samples/ftrace: Mark my_tramp[12]? global

Zhang Qilong <[email protected]>
can: kvaser_pciefd: kvaser_pciefd_open(): fix error handling

Zhang Qilong <[email protected]>
can: c_can: c_can_power_up(): fix error handling

Jeroen Hofstee <[email protected]>
can: sun4i_can: sun4i_can_err(): don't count arbitration lose as an error

Jeroen Hofstee <[email protected]>
can: sja1000: sja1000_err(): don't count arbitration lose as an error

Marc Kleine-Budde <[email protected]>
can: m_can: tcan4x5x_can_probe(): fix error path: remove erroneous clk_disable_unprepare()

Sebastian Reichel <[email protected]>
drm/panel: sony-acx565akm: Fix race condition in probe

Paul Kocialkowski <[email protected]>
drm/rockchip: Avoid uninitialized use of endpoint id in LVDS

Dany Madden <[email protected]>
ibmvnic: reduce wait for completion time

Dany Madden <[email protected]>
ibmvnic: send_login should check for crq errors

Sukadev Bhattiprolu <[email protected]>
ibmvnic: track pending login

Sukadev Bhattiprolu <[email protected]>
ibmvnic: delay next reset if hard reset fails

Dany Madden <[email protected]>
ibmvnic: avoid memset null scrq msgs

Dany Madden <[email protected]>
ibmvnic: stop free_all_rwi on failed reset

Dany Madden <[email protected]>
ibmvnic: handle inconsistent login with reset

Wang Hai <[email protected]>
ipvs: fix possible memory leak in ip_vs_control_net_init

Sven Eckelmann <[email protected]>
batman-adv: Don't always reallocate the fragmentation skb head

Sven Eckelmann <[email protected]>
batman-adv: Reserve needed_*room for fragments

Sven Eckelmann <[email protected]>
batman-adv: Consider fragmentation for needed_headroom

Nicholas Piggin <[email protected]>
powerpc/64s: Fix hash ISA v3.0 TLBIEL instruction generation

Si-Wei Liu <[email protected]>
vhost-vdpa: fix page pinning leakage in error path (rework)

Zhen Lei <[email protected]>
bpftool: Fix error return value in build_btf_type_table

Björn Töpel <[email protected]>
net, xsk: Avoid taking multiple skbuff references

Masami Hiramatsu <[email protected]>
tools/bootconfig: Fix to check the write failure correctly

Hans de Goede <[email protected]>
ASoC: Intel: bytcr_rt5640: Fix HP Pavilion x2 Detachable quirks

Steven Rostedt (VMware) <[email protected]>
kprobes: Tell lockdep about kprobe nesting

Masami Hiramatsu <[email protected]>
kprobes: Remove NMI context check

Minchan Kim <[email protected]>
mm/zsmalloc.c: drop ZSMALLOC_PGTABLE_MAPPING

Nick Desaulniers <[email protected]>
Kbuild: do not emit debug info for assembly with LLVM_IAS=1


-------------

Diffstat:

Makefile | 7 +-
arch/alpha/kernel/process.c | 2 +-
arch/arc/kernel/stacktrace.c | 23 ++--
arch/arm/configs/omap2plus_defconfig | 1 -
arch/arm/kernel/process.c | 2 +-
arch/arm/mach-omap1/board-osk.c | 2 +-
.../boot/dts/broadcom/stingray/stingray-usb.dtsi | 20 ++--
arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts | 12 --
arch/arm64/boot/dts/rockchip/rk3326-odroid-go2.dts | 1 -
arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi | 4 +-
arch/arm64/boot/dts/rockchip/rk3399.dtsi | 3 +
arch/arm64/kernel/process.c | 2 +-
arch/csky/kernel/process.c | 2 +-
arch/h8300/kernel/process.c | 2 +-
arch/hexagon/kernel/process.c | 2 +-
arch/ia64/kernel/process.c | 2 +-
arch/microblaze/kernel/process.c | 2 +-
arch/mips/kernel/idle.c | 12 +-
arch/nios2/kernel/process.c | 2 +-
arch/openrisc/kernel/process.c | 2 +-
arch/parisc/kernel/process.c | 2 +-
arch/powerpc/Makefile | 1 -
arch/powerpc/kernel/idle.c | 4 +-
arch/powerpc/mm/book3s64/hash_native.c | 2 +-
arch/riscv/kernel/process.c | 2 +-
arch/s390/kernel/entry.S | 15 ---
arch/s390/kernel/idle.c | 6 +-
arch/s390/lib/delay.c | 5 +-
arch/sh/kernel/idle.c | 2 +-
arch/sparc/kernel/leon_pmc.c | 4 +-
arch/sparc/kernel/process_32.c | 2 +-
arch/sparc/kernel/process_64.c | 4 +-
arch/um/kernel/process.c | 2 +-
arch/x86/events/intel/ds.c | 2 +-
arch/x86/include/asm/mwait.h | 2 -
arch/x86/include/asm/pgtable_types.h | 1 +
arch/x86/include/asm/sync_core.h | 9 +-
arch/x86/kernel/apic/vector.c | 24 ++--
arch/x86/kernel/kprobes/opt.c | 22 +++-
arch/x86/kernel/process.c | 12 +-
arch/x86/mm/mem_encrypt_identity.c | 4 +-
arch/x86/mm/tlb.c | 10 +-
drivers/Makefile | 1 +
drivers/block/xen-blkback/blkback.c | 89 +++------------
drivers/block/xen-blkback/common.h | 4 +-
drivers/block/xen-blkback/xenbus.c | 6 +-
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 2 +-
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 +-
drivers/gpu/drm/exynos/Kconfig | 3 +-
drivers/gpu/drm/i915/display/intel_dp.c | 2 +-
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 7 +-
drivers/gpu/drm/i915/gt/intel_lrc.c | 7 +-
drivers/gpu/drm/i915/gt/intel_mocs.c | 7 +-
drivers/gpu/drm/panel/panel-sony-acx565akm.c | 2 +-
drivers/gpu/drm/rockchip/rockchip_lvds.c | 2 +-
drivers/idle/intel_idle.c | 37 ++++---
drivers/input/misc/cm109.c | 7 +-
drivers/input/serio/i8042-x86ia64io.h | 42 +++++++
drivers/interconnect/qcom/msm8916.c | 12 +-
drivers/interconnect/qcom/qcs404.c | 4 +-
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 4 +
drivers/irqchip/irq-gic-v3-its.c | 16 +--
drivers/media/cec/usb/pulse8/pulse8-cec.c | 52 ++++++---
drivers/misc/habanalabs/gaudi/gaudi.c | 2 +
drivers/mmc/core/block.c | 2 +-
drivers/mmc/host/mtk-sd.c | 33 ++++--
drivers/mmc/host/sdhci-of-arasan.c | 3 +
drivers/net/can/c_can/c_can.c | 18 ++-
drivers/net/can/kvaser_pciefd.c | 4 +-
drivers/net/can/m_can/m_can.c | 2 +
drivers/net/can/m_can/tcan4x5x.c | 11 +-
drivers/net/can/sja1000/sja1000.c | 1 -
drivers/net/can/sun4i_can.c | 1 -
drivers/net/ethernet/broadcom/Kconfig | 1 +
drivers/net/ethernet/ibm/ibmvnic.c | 98 ++++++++++------
drivers/net/ethernet/ibm/ibmvnic.h | 1 +
drivers/net/wireless/intel/iwlwifi/fw/api/sta.h | 10 +-
drivers/net/wireless/intel/iwlwifi/iwl-config.h | 4 +-
drivers/net/wireless/intel/iwlwifi/iwl-csr.h | 10 ++
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 2 +-
drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 18 +++
.../wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c | 20 ++++
drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 36 ++++--
drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c | 5 -
drivers/pinctrl/intel/pinctrl-jasperlake.c | 2 +-
drivers/pinctrl/pinctrl-amd.c | 7 --
drivers/platform/x86/acer-wmi.c | 1 +
drivers/platform/x86/intel-vbtn.c | 6 +
drivers/platform/x86/thinkpad_acpi.c | 12 +-
drivers/platform/x86/touchscreen_dmi.c | 50 +++++++++
drivers/scsi/be2iscsi/be_main.c | 4 +-
drivers/scsi/storvsc_drv.c | 4 +-
drivers/scsi/ufs/ufshcd.c | 31 ++++--
drivers/soc/fsl/dpio/dpio-driver.c | 5 +-
drivers/spi/spi-nxp-fspi.c | 7 ++
drivers/usb/host/ohci-omap.c | 4 +-
drivers/vdpa/Kconfig | 1 +
drivers/vhost/vdpa.c | 80 +++++++++++---
drivers/xen/grant-table.c | 123 +++++++++++++++++++++
drivers/xen/unpopulated-alloc.c | 20 ++--
drivers/xen/xen-scsiback.c | 60 ++--------
fs/btrfs/ctree.h | 5 +-
fs/btrfs/qgroup.c | 66 +++++++++--
fs/proc/task_mmu.c | 8 +-
fs/zonefs/super.c | 14 ++-
include/asm-generic/barrier.h | 1 +
include/linux/build_bug.h | 5 +
include/linux/compiler-clang.h | 6 -
include/linux/compiler-gcc.h | 19 ----
include/linux/compiler.h | 18 ++-
include/linux/netdevice.h | 14 ++-
include/linux/zsmalloc.h | 1 -
include/xen/grant_table.h | 17 +++
kernel/kprobes.c | 41 ++++---
kernel/sched/idle.c | 28 ++++-
lib/zlib_dfltcc/dfltcc_inflate.c | 3 +
mm/Kconfig | 13 ---
mm/hugetlb.c | 1 +
mm/mmap.c | 26 ++---
mm/zsmalloc.c | 48 --------
net/batman-adv/fragmentation.c | 26 +++--
net/batman-adv/hard-interface.c | 3 +
net/core/dev.c | 8 +-
net/netfilter/ipvs/ip_vs_ctl.c | 31 +++++-
net/xdp/xsk.c | 8 +-
samples/ftrace/ftrace-direct-modify.c | 2 +
samples/ftrace/ftrace-direct-too.c | 1 +
samples/ftrace/ftrace-direct.c | 1 +
sound/soc/intel/boards/bytcr_rt5640.c | 17 ++-
tools/bootconfig/main.c | 30 ++++-
tools/bpf/bpftool/btf.c | 1 +
tools/testing/ktest/ktest.pl | 2 +-
132 files changed, 1095 insertions(+), 625 deletions(-)



2020-12-14 19:18:26

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.9 039/105] arm64: dts: rockchip: Remove system-power-controller from pmic on Odroid Go Advance

From: Maciej Matuszczyk <[email protected]>

[ Upstream commit 01fe332800d0d2f94337b45c1973f4cf28ae6195 ]

This fixes a poweroff issue when this is supposed to happen
via PSCI.

Signed-off-by: Maciej Matuszczyk <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Heiko Stuebner <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
arch/arm64/boot/dts/rockchip/rk3326-odroid-go2.dts | 1 -
1 file changed, 1 deletion(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3326-odroid-go2.dts b/arch/arm64/boot/dts/rockchip/rk3326-odroid-go2.dts
index 35bd6b904b9c7..3376810385193 100644
--- a/arch/arm64/boot/dts/rockchip/rk3326-odroid-go2.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3326-odroid-go2.dts
@@ -243,7 +243,6 @@
interrupts = <RK_PB2 IRQ_TYPE_LEVEL_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&pmic_int>;
- rockchip,system-power-controller;
wakeup-source;
#clock-cells = <1>;
clock-output-names = "rk808-clkout1", "xin32k";
--
2.27.0



2020-12-14 19:18:49

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.9 006/105] tools/bootconfig: Fix to check the write failure correctly

From: Masami Hiramatsu <[email protected]>

[ Upstream commit a995e6bc0524450adfd6181dfdcd9d0520cfaba5 ]

Fix to check the write(2) failure including partial write
correctly and try to rollback the partial write, because
if there is no BOOTCONFIG_MAGIC string, we can not remove it.

Link: https://lkml.kernel.org/r/160576521135.320071.3883101436675969998.stgit@devnote2

Fixes: 85c46b78da58 ("bootconfig: Add bootconfig magic word for indicating bootconfig explicitly")
Suggested-by: Linus Torvalds <[email protected]>
Signed-off-by: Masami Hiramatsu <[email protected]>
Signed-off-by: Steven Rostedt (VMware) <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
tools/bootconfig/main.c | 30 ++++++++++++++++++++++++++----
1 file changed, 26 insertions(+), 4 deletions(-)

diff --git a/tools/bootconfig/main.c b/tools/bootconfig/main.c
index e0878f5f74b1b..ffd6a358925da 100644
--- a/tools/bootconfig/main.c
+++ b/tools/bootconfig/main.c
@@ -274,6 +274,7 @@ static void show_xbc_error(const char *data, const char *msg, int pos)

int apply_xbc(const char *path, const char *xbc_path)
{
+ struct stat stat;
u32 size, csum;
char *buf, *data;
int ret, fd;
@@ -330,16 +331,26 @@ int apply_xbc(const char *path, const char *xbc_path)
return fd;
}
/* TODO: Ensure the @path is initramfs/initrd image */
+ if (fstat(fd, &stat) < 0) {
+ pr_err("Failed to get the size of %s\n", path);
+ goto out;
+ }
ret = write(fd, data, size + 8);
- if (ret < 0) {
+ if (ret < size + 8) {
+ if (ret < 0)
+ ret = -errno;
pr_err("Failed to apply a boot config: %d\n", ret);
- goto out;
+ if (ret < 0)
+ goto out;
+ goto out_rollback;
}
/* Write a magic word of the bootconfig */
ret = write(fd, BOOTCONFIG_MAGIC, BOOTCONFIG_MAGIC_LEN);
- if (ret < 0) {
+ if (ret < BOOTCONFIG_MAGIC_LEN) {
+ if (ret < 0)
+ ret = -errno;
pr_err("Failed to apply a boot config magic: %d\n", ret);
- goto out;
+ goto out_rollback;
}
ret = 0;
out:
@@ -347,6 +358,17 @@ out:
free(data);

return ret;
+
+out_rollback:
+ /* Map the partial write to -ENOSPC */
+ if (ret >= 0)
+ ret = -ENOSPC;
+ if (ftruncate(fd, stat.st_size) < 0) {
+ ret = -errno;
+ pr_err("Failed to rollback the write error: %d\n", ret);
+ pr_err("The initrd %s may be corrupted. Recommend to rebuild.\n", path);
+ }
+ goto out;
}

int usage(void)
--
2.27.0



2020-12-14 19:19:07

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.9 016/105] ibmvnic: stop free_all_rwi on failed reset

From: Dany Madden <[email protected]>

[ Upstream commit 18f141bf97d42f65abfdf17fd93fb3a0dac100e7 ]

When ibmvnic fails to reset, it breaks out of the reset loop and frees
all of the remaining resets from the workqueue. Doing so prevents the
adapter from recovering if no reset is scheduled after that. Instead,
have the driver continue to process resets on the workqueue.

Remove the no longer need free_all_rwi().

Fixes: ed651a10875f1 ("ibmvnic: Updated reset handling")
Signed-off-by: Dany Madden <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/net/ethernet/ibm/ibmvnic.c | 22 +++-------------------
1 file changed, 3 insertions(+), 19 deletions(-)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 85c54c061ed91..32fc0266d99b1 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -2186,17 +2186,6 @@ static struct ibmvnic_rwi *get_next_rwi(struct ibmvnic_adapter *adapter)
return rwi;
}

-static void free_all_rwi(struct ibmvnic_adapter *adapter)
-{
- struct ibmvnic_rwi *rwi;
-
- rwi = get_next_rwi(adapter);
- while (rwi) {
- kfree(rwi);
- rwi = get_next_rwi(adapter);
- }
-}
-
static void __ibmvnic_reset(struct work_struct *work)
{
struct ibmvnic_rwi *rwi;
@@ -2265,9 +2254,9 @@ static void __ibmvnic_reset(struct work_struct *work)
else
adapter->state = reset_state;
rc = 0;
- } else if (rc && rc != IBMVNIC_INIT_FAILED &&
- !adapter->force_reset_recovery)
- break;
+ }
+ if (rc)
+ netdev_dbg(adapter->netdev, "Reset failed, rc=%d\n", rc);

rwi = get_next_rwi(adapter);

@@ -2281,11 +2270,6 @@ static void __ibmvnic_reset(struct work_struct *work)
complete(&adapter->reset_done);
}

- if (rc) {
- netdev_dbg(adapter->netdev, "Reset failed\n");
- free_all_rwi(adapter);
- }
-
clear_bit_unlock(0, &adapter->resetting);
}

--
2.27.0



2020-12-14 19:19:40

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.9 040/105] iwlwifi: pcie: limit memory read spin time

From: Johannes Berg <[email protected]>

[ Upstream commit 04516706bb99889986ddfa3a769ed50d2dc7ac13 ]

When we read device memory, we lock a spinlock, write the address we
want to read from the device and then spin in a loop reading the data
in 32-bit quantities from another register.

As the description makes clear, this is rather inefficient, incurring
a PCIe bus transaction for every read. In a typical device today, we
want to read 786k SMEM if it crashes, leading to 192k register reads.
Occasionally, we've seen the whole loop take over 20 seconds and then
triggering the soft lockup detector.

Clearly, it is unreasonable to spin here for such extended periods of
time.

To fix this, break the loop down into an outer and an inner loop, and
break out of the inner loop if more than half a second elapsed. To
avoid too much overhead, check for that only every 128 reads, though
there's no particular reason for that number. Then, unlock and relock
to obtain NIC access again, reprogram the start address and continue.

This will keep (interrupt) latencies on the CPU down to a reasonable
time.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Mordechay Goodstein <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20201022165103.45878a7e49aa.I3b9b9c5a10002915072312ce75b68ed5b3dc6e14@changeid
Signed-off-by: Sasha Levin <[email protected]>
---
.../net/wireless/intel/iwlwifi/pcie/trans.c | 36 ++++++++++++++-----
1 file changed, 27 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
index e5160d6208688..6393e895f95c6 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
@@ -2155,18 +2155,36 @@ static int iwl_trans_pcie_read_mem(struct iwl_trans *trans, u32 addr,
void *buf, int dwords)
{
unsigned long flags;
- int offs, ret = 0;
+ int offs = 0;
u32 *vals = buf;

- if (iwl_trans_grab_nic_access(trans, &flags)) {
- iwl_write32(trans, HBUS_TARG_MEM_RADDR, addr);
- for (offs = 0; offs < dwords; offs++)
- vals[offs] = iwl_read32(trans, HBUS_TARG_MEM_RDAT);
- iwl_trans_release_nic_access(trans, &flags);
- } else {
- ret = -EBUSY;
+ while (offs < dwords) {
+ /* limit the time we spin here under lock to 1/2s */
+ ktime_t timeout = ktime_add_us(ktime_get(), 500 * USEC_PER_MSEC);
+
+ if (iwl_trans_grab_nic_access(trans, &flags)) {
+ iwl_write32(trans, HBUS_TARG_MEM_RADDR,
+ addr + 4 * offs);
+
+ while (offs < dwords) {
+ vals[offs] = iwl_read32(trans,
+ HBUS_TARG_MEM_RDAT);
+ offs++;
+
+ /* calling ktime_get is expensive so
+ * do it once in 128 reads
+ */
+ if (offs % 128 == 0 && ktime_after(ktime_get(),
+ timeout))
+ break;
+ }
+ iwl_trans_release_nic_access(trans, &flags);
+ } else {
+ return -EBUSY;
+ }
}
- return ret;
+
+ return 0;
}

static int iwl_trans_pcie_write_mem(struct iwl_trans *trans, u32 addr,
--
2.27.0



2020-12-14 19:20:00

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.9 012/105] batman-adv: Reserve needed_*room for fragments

From: Sven Eckelmann <[email protected]>

[ Upstream commit c5cbfc87558168ef4c3c27ce36eba6b83391db19 ]

The batadv net_device is trying to propagate the needed_headroom and
needed_tailroom from the lower devices. This is needed to avoid cost
intensive reallocations using pskb_expand_head during the transmission.

But the fragmentation code split the skb's without adding extra room at the
end/beginning of the various fragments. This reduced the performance of
transmissions over complex scenarios (batadv on vxlan on wireguard) because
the lower devices had to perform the reallocations at least once.

Fixes: ee75ed88879a ("batman-adv: Fragment and send skbs larger than mtu")
Signed-off-by: Sven Eckelmann <[email protected]>
Signed-off-by: Simon Wunderlich <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
net/batman-adv/fragmentation.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/net/batman-adv/fragmentation.c b/net/batman-adv/fragmentation.c
index 9fdbe30681537..dbd913bac9dd1 100644
--- a/net/batman-adv/fragmentation.c
+++ b/net/batman-adv/fragmentation.c
@@ -391,6 +391,7 @@ out:

/**
* batadv_frag_create() - create a fragment from skb
+ * @net_dev: outgoing device for fragment
* @skb: skb to create fragment from
* @frag_head: header to use in new fragment
* @fragment_size: size of new fragment
@@ -401,22 +402,25 @@ out:
*
* Return: the new fragment, NULL on error.
*/
-static struct sk_buff *batadv_frag_create(struct sk_buff *skb,
+static struct sk_buff *batadv_frag_create(struct net_device *net_dev,
+ struct sk_buff *skb,
struct batadv_frag_packet *frag_head,
unsigned int fragment_size)
{
+ unsigned int ll_reserved = LL_RESERVED_SPACE(net_dev);
+ unsigned int tailroom = net_dev->needed_tailroom;
struct sk_buff *skb_fragment;
unsigned int header_size = sizeof(*frag_head);
unsigned int mtu = fragment_size + header_size;

- skb_fragment = netdev_alloc_skb(NULL, mtu + ETH_HLEN);
+ skb_fragment = dev_alloc_skb(ll_reserved + mtu + tailroom);
if (!skb_fragment)
goto err;

skb_fragment->priority = skb->priority;

/* Eat the last mtu-bytes of the skb */
- skb_reserve(skb_fragment, header_size + ETH_HLEN);
+ skb_reserve(skb_fragment, ll_reserved + header_size);
skb_split(skb, skb_fragment, skb->len - fragment_size);

/* Add the header */
@@ -439,11 +443,12 @@ int batadv_frag_send_packet(struct sk_buff *skb,
struct batadv_orig_node *orig_node,
struct batadv_neigh_node *neigh_node)
{
+ struct net_device *net_dev = neigh_node->if_incoming->net_dev;
struct batadv_priv *bat_priv;
struct batadv_hard_iface *primary_if = NULL;
struct batadv_frag_packet frag_header;
struct sk_buff *skb_fragment;
- unsigned int mtu = neigh_node->if_incoming->net_dev->mtu;
+ unsigned int mtu = net_dev->mtu;
unsigned int header_size = sizeof(frag_header);
unsigned int max_fragment_size, num_fragments;
int ret;
@@ -503,7 +508,7 @@ int batadv_frag_send_packet(struct sk_buff *skb,
goto put_primary_if;
}

- skb_fragment = batadv_frag_create(skb, &frag_header,
+ skb_fragment = batadv_frag_create(net_dev, skb, &frag_header,
max_fragment_size);
if (!skb_fragment) {
ret = -ENOMEM;
--
2.27.0



2020-12-14 19:20:00

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.9 014/105] ipvs: fix possible memory leak in ip_vs_control_net_init

From: Wang Hai <[email protected]>

[ Upstream commit 4bc3c8dc9f5f1eff0d3bfa59491383ac11308b6b ]

kmemleak report a memory leak as follows:

BUG: memory leak
unreferenced object 0xffff8880759ea000 (size 256):
backtrace:
[<00000000c0bf2deb>] kmem_cache_zalloc include/linux/slab.h:656 [inline]
[<00000000c0bf2deb>] __proc_create+0x23d/0x7d0 fs/proc/generic.c:421
[<000000009d718d02>] proc_create_reg+0x8e/0x140 fs/proc/generic.c:535
[<0000000097bbfc4f>] proc_create_net_data+0x8c/0x1b0 fs/proc/proc_net.c:126
[<00000000652480fc>] ip_vs_control_net_init+0x308/0x13a0 net/netfilter/ipvs/ip_vs_ctl.c:4169
[<000000004c927ebe>] __ip_vs_init+0x211/0x400 net/netfilter/ipvs/ip_vs_core.c:2429
[<00000000aa6b72d9>] ops_init+0xa8/0x3c0 net/core/net_namespace.c:151
[<00000000153fd114>] setup_net+0x2de/0x7e0 net/core/net_namespace.c:341
[<00000000be4e4f07>] copy_net_ns+0x27d/0x530 net/core/net_namespace.c:482
[<00000000f1c23ec9>] create_new_namespaces+0x382/0xa30 kernel/nsproxy.c:110
[<00000000098a5757>] copy_namespaces+0x2e6/0x3b0 kernel/nsproxy.c:179
[<0000000026ce39e9>] copy_process+0x220a/0x5f00 kernel/fork.c:2072
[<00000000b71f4efe>] _do_fork+0xc7/0xda0 kernel/fork.c:2428
[<000000002974ee96>] __do_sys_clone3+0x18a/0x280 kernel/fork.c:2703
[<0000000062ac0a4d>] do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46
[<0000000093f1ce2c>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

In the error path of ip_vs_control_net_init(), remove_proc_entry() needs
to be called to remove the added proc entry, otherwise a memory leak
will occur.

Also, add some '#ifdef CONFIG_PROC_FS' because proc_create_net* return NULL
when PROC is not used.

Fixes: b17fc9963f83 ("IPVS: netns, ip_vs_stats and its procfs")
Fixes: 61b1ab4583e2 ("IPVS: netns, add basic init per netns.")
Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Wang Hai <[email protected]>
Acked-by: Julian Anastasov <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
net/netfilter/ipvs/ip_vs_ctl.c | 31 +++++++++++++++++++++++++------
1 file changed, 25 insertions(+), 6 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 8dbfd84322a88..f6b284a9c480e 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -4167,12 +4167,18 @@ int __net_init ip_vs_control_net_init(struct netns_ipvs *ipvs)

spin_lock_init(&ipvs->tot_stats.lock);

- proc_create_net("ip_vs", 0, ipvs->net->proc_net, &ip_vs_info_seq_ops,
- sizeof(struct ip_vs_iter));
- proc_create_net_single("ip_vs_stats", 0, ipvs->net->proc_net,
- ip_vs_stats_show, NULL);
- proc_create_net_single("ip_vs_stats_percpu", 0, ipvs->net->proc_net,
- ip_vs_stats_percpu_show, NULL);
+#ifdef CONFIG_PROC_FS
+ if (!proc_create_net("ip_vs", 0, ipvs->net->proc_net,
+ &ip_vs_info_seq_ops, sizeof(struct ip_vs_iter)))
+ goto err_vs;
+ if (!proc_create_net_single("ip_vs_stats", 0, ipvs->net->proc_net,
+ ip_vs_stats_show, NULL))
+ goto err_stats;
+ if (!proc_create_net_single("ip_vs_stats_percpu", 0,
+ ipvs->net->proc_net,
+ ip_vs_stats_percpu_show, NULL))
+ goto err_percpu;
+#endif

if (ip_vs_control_net_init_sysctl(ipvs))
goto err;
@@ -4180,6 +4186,17 @@ int __net_init ip_vs_control_net_init(struct netns_ipvs *ipvs)
return 0;

err:
+#ifdef CONFIG_PROC_FS
+ remove_proc_entry("ip_vs_stats_percpu", ipvs->net->proc_net);
+
+err_percpu:
+ remove_proc_entry("ip_vs_stats", ipvs->net->proc_net);
+
+err_stats:
+ remove_proc_entry("ip_vs", ipvs->net->proc_net);
+
+err_vs:
+#endif
free_percpu(ipvs->tot_stats.cpustats);
return -ENOMEM;
}
@@ -4188,9 +4205,11 @@ void __net_exit ip_vs_control_net_cleanup(struct netns_ipvs *ipvs)
{
ip_vs_trash_cleanup(ipvs);
ip_vs_control_net_cleanup_sysctl(ipvs);
+#ifdef CONFIG_PROC_FS
remove_proc_entry("ip_vs_stats_percpu", ipvs->net->proc_net);
remove_proc_entry("ip_vs_stats", ipvs->net->proc_net);
remove_proc_entry("ip_vs", ipvs->net->proc_net);
+#endif
free_percpu(ipvs->tot_stats.cpustats);
}

--
2.27.0



2020-12-14 19:20:02

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.9 029/105] samples/ftrace: Mark my_tramp[12]? global

From: Sami Tolvanen <[email protected]>

[ Upstream commit 983df5f2699f83f78643b19d3399b160d1e64f5b ]

my_tramp[12]? are declared as global functions in C, but they are not
marked global in the inline assembly definition. This mismatch confuses
Clang's Control-Flow Integrity checking. Fix the definitions by adding
.globl.

Link: https://lkml.kernel.org/r/[email protected]

Fixes: 9d907f1ae80b8 ("ftrace/samples: Add a sample module that implements modify_ftrace_direct()")
Reviewed-by: Kees Cook <[email protected]>
Signed-off-by: Sami Tolvanen <[email protected]>
Signed-off-by: Steven Rostedt (VMware) <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
samples/ftrace/ftrace-direct-modify.c | 2 ++
samples/ftrace/ftrace-direct-too.c | 1 +
samples/ftrace/ftrace-direct.c | 1 +
3 files changed, 4 insertions(+)

diff --git a/samples/ftrace/ftrace-direct-modify.c b/samples/ftrace/ftrace-direct-modify.c
index c13a5bc5095be..5b9a09957c6e0 100644
--- a/samples/ftrace/ftrace-direct-modify.c
+++ b/samples/ftrace/ftrace-direct-modify.c
@@ -21,6 +21,7 @@ static unsigned long my_ip = (unsigned long)schedule;
asm (
" .pushsection .text, \"ax\", @progbits\n"
" .type my_tramp1, @function\n"
+" .globl my_tramp1\n"
" my_tramp1:"
" pushq %rbp\n"
" movq %rsp, %rbp\n"
@@ -29,6 +30,7 @@ asm (
" .size my_tramp1, .-my_tramp1\n"
" ret\n"
" .type my_tramp2, @function\n"
+" .globl my_tramp2\n"
" my_tramp2:"
" pushq %rbp\n"
" movq %rsp, %rbp\n"
diff --git a/samples/ftrace/ftrace-direct-too.c b/samples/ftrace/ftrace-direct-too.c
index d5c5022be6642..3f0079c9bd6fa 100644
--- a/samples/ftrace/ftrace-direct-too.c
+++ b/samples/ftrace/ftrace-direct-too.c
@@ -16,6 +16,7 @@ extern void my_tramp(void *);
asm (
" .pushsection .text, \"ax\", @progbits\n"
" .type my_tramp, @function\n"
+" .globl my_tramp\n"
" my_tramp:"
" pushq %rbp\n"
" movq %rsp, %rbp\n"
diff --git a/samples/ftrace/ftrace-direct.c b/samples/ftrace/ftrace-direct.c
index 63ca06d42c803..a2729d1ef17f5 100644
--- a/samples/ftrace/ftrace-direct.c
+++ b/samples/ftrace/ftrace-direct.c
@@ -14,6 +14,7 @@ extern void my_tramp(void *);
asm (
" .pushsection .text, \"ax\", @progbits\n"
" .type my_tramp, @function\n"
+" .globl my_tramp\n"
" my_tramp:"
" pushq %rbp\n"
" movq %rsp, %rbp\n"
--
2.27.0



2020-12-14 19:20:46

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.9 028/105] can: kvaser_pciefd: kvaser_pciefd_open(): fix error handling

From: Zhang Qilong <[email protected]>

[ Upstream commit 13a84cf37a4cf1155a41684236c2314eb40cd65c ]

If kvaser_pciefd_bus_on() failed, we should call close_candev() to avoid
reference leak.

Fixes: 26ad340e582d3 ("can: kvaser_pciefd: Add driver for Kvaser PCIEcan devices")
Signed-off-by: Zhang Qilong <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Marc Kleine-Budde <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/net/can/kvaser_pciefd.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/can/kvaser_pciefd.c b/drivers/net/can/kvaser_pciefd.c
index 72acd1ba162d2..43151dd6cb1c3 100644
--- a/drivers/net/can/kvaser_pciefd.c
+++ b/drivers/net/can/kvaser_pciefd.c
@@ -692,8 +692,10 @@ static int kvaser_pciefd_open(struct net_device *netdev)
return err;

err = kvaser_pciefd_bus_on(can);
- if (err)
+ if (err) {
+ close_candev(netdev);
return err;
+ }

return 0;
}
--
2.27.0



2020-12-14 19:20:46

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.9 032/105] vdpa: mlx5: fix vdpa/vhost dependencies

From: Randy Dunlap <[email protected]>

[ Upstream commit 98701a2a861fa87a5055cf2809758e8725e8b146 ]

drivers/vdpa/mlx5/ uses vhost_iotlb*() interfaces, so select
VHOST_IOTLB to make them be built.

However, if VHOST_IOTLB is the only VHOST symbol that is
set/enabled, the object file still won't be built because
drivers/Makefile won't descend into drivers/vhost/ to build it,
so make drivers/Makefile build the needed binary whenever
VHOST_IOTLB is set, like it does for VHOST_RING.

Fixes these build errors:
ERROR: modpost: "vhost_iotlb_itree_next" [drivers/vdpa/mlx5/mlx5_vdpa.ko] undefined!
ERROR: modpost: "vhost_iotlb_itree_first" [drivers/vdpa/mlx5/mlx5_vdpa.ko] undefined!

Fixes: 29064bfdabd5 ("vdpa/mlx5: Add support library for mlx5 VDPA implementation")
Fixes: aff90770e54c ("vdpa/mlx5: Fix dependency on MLX5_CORE")
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Randy Dunlap <[email protected]>
Cc: Eli Cohen <[email protected]>
Cc: Parav Pandit <[email protected]>
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Jason Wang <[email protected]>
Cc: [email protected]
Cc: Saeed Mahameed <[email protected]>
Cc: Leon Romanovsky <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Jason Wang <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/Makefile | 1 +
drivers/vdpa/Kconfig | 1 +
2 files changed, 2 insertions(+)

diff --git a/drivers/Makefile b/drivers/Makefile
index c0cd1b9075e3d..5762280377186 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -145,6 +145,7 @@ obj-$(CONFIG_OF) += of/
obj-$(CONFIG_SSB) += ssb/
obj-$(CONFIG_BCMA) += bcma/
obj-$(CONFIG_VHOST_RING) += vhost/
+obj-$(CONFIG_VHOST_IOTLB) += vhost/
obj-$(CONFIG_VHOST) += vhost/
obj-$(CONFIG_VLYNQ) += vlynq/
obj-$(CONFIG_GREYBUS) += greybus/
diff --git a/drivers/vdpa/Kconfig b/drivers/vdpa/Kconfig
index 358f6048dd3ce..6caf539091e55 100644
--- a/drivers/vdpa/Kconfig
+++ b/drivers/vdpa/Kconfig
@@ -32,6 +32,7 @@ config IFCVF

config MLX5_VDPA
bool
+ select VHOST_IOTLB
help
Support library for Mellanox VDPA drivers. Provides code that is
common for all types of VDPA drivers. The following drivers are planned:
--
2.27.0



2020-12-14 19:22:43

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.9 019/105] ibmvnic: track pending login

From: Sukadev Bhattiprolu <[email protected]>

[ Upstream commit 76cdc5c5d99ce4856ad0ac38facc33b52fa64f77 ]

If after ibmvnic sends a LOGIN it gets a FAILOVER, it is possible that
the worker thread will start reset process and free the login response
buffer before it gets a (now stale) LOGIN_RSP. The ibmvnic tasklet will
then try to access the login response buffer and crash.

Have ibmvnic track pending logins and discard any stale login responses.

Fixes: 032c5e82847a ("Driver for IBM System i/p VNIC protocol")
Signed-off-by: Sukadev Bhattiprolu <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/net/ethernet/ibm/ibmvnic.c | 17 +++++++++++++++++
drivers/net/ethernet/ibm/ibmvnic.h | 1 +
2 files changed, 18 insertions(+)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 006670f318bf1..9aa63b8b44368 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -3843,6 +3843,8 @@ static int send_login(struct ibmvnic_adapter *adapter)
crq.login.cmd = LOGIN;
crq.login.ioba = cpu_to_be32(buffer_token);
crq.login.len = cpu_to_be32(buffer_size);
+
+ adapter->login_pending = true;
ibmvnic_send_crq(adapter, &crq);

return 0;
@@ -4374,6 +4376,15 @@ static int handle_login_rsp(union ibmvnic_crq *login_rsp_crq,
struct ibmvnic_login_buffer *login = adapter->login_buf;
int i;

+ /* CHECK: Test/set of login_pending does not need to be atomic
+ * because only ibmvnic_tasklet tests/clears this.
+ */
+ if (!adapter->login_pending) {
+ netdev_warn(netdev, "Ignoring unexpected login response\n");
+ return 0;
+ }
+ adapter->login_pending = false;
+
dma_unmap_single(dev, adapter->login_buf_token, adapter->login_buf_sz,
DMA_TO_DEVICE);
dma_unmap_single(dev, adapter->login_rsp_buf_token,
@@ -4721,6 +4732,11 @@ static void ibmvnic_handle_crq(union ibmvnic_crq *crq,
case IBMVNIC_CRQ_INIT:
dev_info(dev, "Partner initialized\n");
adapter->from_passive_init = true;
+ /* Discard any stale login responses from prev reset.
+ * CHECK: should we clear even on INIT_COMPLETE?
+ */
+ adapter->login_pending = false;
+
if (!completion_done(&adapter->init_done)) {
complete(&adapter->init_done);
adapter->init_done_rc = -EIO;
@@ -5188,6 +5204,7 @@ static int ibmvnic_probe(struct vio_dev *dev, const struct vio_device_id *id)
dev_set_drvdata(&dev->dev, netdev);
adapter->vdev = dev;
adapter->netdev = netdev;
+ adapter->login_pending = false;

ether_addr_copy(adapter->mac_addr, mac_addr_p);
ether_addr_copy(netdev->dev_addr, adapter->mac_addr);
diff --git a/drivers/net/ethernet/ibm/ibmvnic.h b/drivers/net/ethernet/ibm/ibmvnic.h
index 31d604fc7bde7..77f43cbdb6dc4 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.h
+++ b/drivers/net/ethernet/ibm/ibmvnic.h
@@ -1084,6 +1084,7 @@ struct ibmvnic_adapter {
struct delayed_work ibmvnic_delayed_reset;
unsigned long resetting;
bool napi_enabled, from_passive_init;
+ bool login_pending;

bool failover_pending;
bool force_reset_recovery;
--
2.27.0



2020-12-14 19:23:12

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.9 011/105] batman-adv: Consider fragmentation for needed_headroom

From: Sven Eckelmann <[email protected]>

[ Upstream commit 4ca23e2c2074465bff55ea14221175fecdf63c5f ]

If a batman-adv packets has to be fragmented, then the original batman-adv
packet header is not stripped away. Instead, only a new header is added in
front of the packet after it was split.

This size must be considered to avoid cost intensive reallocations during
the transmission through the various device layers.

Fixes: 7bca68c7844b ("batman-adv: Add lower layer needed_(head|tail)room to own ones")
Reported-by: Linus Lüssing <[email protected]>
Signed-off-by: Sven Eckelmann <[email protected]>
Signed-off-by: Simon Wunderlich <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
net/batman-adv/hard-interface.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index fa06b51c0144d..d72c183919b44 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -554,6 +554,9 @@ static void batadv_hardif_recalc_extra_skbroom(struct net_device *soft_iface)
needed_headroom = lower_headroom + (lower_header_len - ETH_HLEN);
needed_headroom += batadv_max_header_len();

+ /* fragmentation headers don't strip the unicast/... header */
+ needed_headroom += sizeof(struct batadv_frag_packet);
+
soft_iface->needed_headroom = needed_headroom;
soft_iface->needed_tailroom = lower_tailroom;
}
--
2.27.0



2020-12-14 19:23:14

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.9 015/105] ibmvnic: handle inconsistent login with reset

From: Dany Madden <[email protected]>

[ Upstream commit 31d6b4036098f6b59bcfa20375626b500c7d7417 ]

Inconsistent login with the vnicserver is causing the device to be
removed. This does not give the device a chance to recover from error
state. This patch schedules a FATAL reset instead to bring the adapter
up.

Fixes: 032c5e82847a2 ("Driver for IBM System i/p VNIC protocol")
Signed-off-by: Dany Madden <[email protected]>
Signed-off-by: Lijun Pan <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/net/ethernet/ibm/ibmvnic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 3654be5772c85..85c54c061ed91 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -4400,7 +4400,7 @@ static int handle_login_rsp(union ibmvnic_crq *login_rsp_crq,
adapter->req_rx_add_queues !=
be32_to_cpu(login_rsp->num_rxadd_subcrqs))) {
dev_err(dev, "FATAL: Inconsistent login and login rsp\n");
- ibmvnic_remove(adapter->vdev);
+ ibmvnic_reset(adapter, VNIC_RESET_FATAL);
return -EIO;
}
release_login_buffer(adapter);
--
2.27.0



2020-12-14 19:23:55

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.9 002/105] mm/zsmalloc.c: drop ZSMALLOC_PGTABLE_MAPPING

From: Minchan Kim <[email protected]>

commit e91d8d78237de8d7120c320b3645b7100848f24d upstream.

While I was doing zram testing, I found sometimes decompression failed
since the compression buffer was corrupted. With investigation, I found
below commit calls cond_resched unconditionally so it could make a
problem in atomic context if the task is reschedule.

BUG: sleeping function called from invalid context at mm/vmalloc.c:108
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 946, name: memhog
3 locks held by memhog/946:
#0: ffff9d01d4b193e8 (&mm->mmap_lock#2){++++}-{4:4}, at: __mm_populate+0x103/0x160
#1: ffffffffa3d53de0 (fs_reclaim){+.+.}-{0:0}, at: __alloc_pages_slowpath.constprop.0+0xa98/0x1160
#2: ffff9d01d56b8110 (&zspage->lock){.+.+}-{3:3}, at: zs_map_object+0x8e/0x1f0
CPU: 0 PID: 946 Comm: memhog Not tainted 5.9.3-00011-gc5bfc0287345-dirty #316
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1 04/01/2014
Call Trace:
unmap_kernel_range_noflush+0x2eb/0x350
unmap_kernel_range+0x14/0x30
zs_unmap_object+0xd5/0xe0
zram_bvec_rw.isra.0+0x38c/0x8e0
zram_rw_page+0x90/0x101
bdev_write_page+0x92/0xe0
__swap_writepage+0x94/0x4a0
pageout+0xe3/0x3a0
shrink_page_list+0xb94/0xd60
shrink_inactive_list+0x158/0x460

We can fix this by removing the ZSMALLOC_PGTABLE_MAPPING feature (which
contains the offending calling code) from zsmalloc.

Even though this option showed some amount improvement(e.g., 30%) in
some arm32 platforms, it has been headache to maintain since it have
abused APIs[1](e.g., unmap_kernel_range in atomic context).

Since we are approaching to deprecate 32bit machines and already made
the config option available for only builtin build since v5.8, lastly it
has been not default option in zsmalloc, it's time to drop the option
for better maintenance.

[1] http://lore.kernel.org/linux-mm/[email protected]

Fixes: e47110e90584 ("mm/vunmap: add cond_resched() in vunmap_pmd_range")
Signed-off-by: Minchan Kim <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Reviewed-by: Sergey Senozhatsky <[email protected]>
Cc: Tony Lindgren <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Harish Sriram <[email protected]>
Cc: Uladzislau Rezki <[email protected]>
Cc: <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
arch/arm/configs/omap2plus_defconfig | 1
include/linux/zsmalloc.h | 1
mm/Kconfig | 13 ---------
mm/zsmalloc.c | 48 -----------------------------------
4 files changed, 63 deletions(-)

--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -81,7 +81,6 @@ CONFIG_PARTITION_ADVANCED=y
CONFIG_BINFMT_MISC=y
CONFIG_CMA=y
CONFIG_ZSMALLOC=m
-CONFIG_ZSMALLOC_PGTABLE_MAPPING=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
--- a/include/linux/zsmalloc.h
+++ b/include/linux/zsmalloc.h
@@ -20,7 +20,6 @@
* zsmalloc mapping modes
*
* NOTE: These only make a difference when a mapped object spans pages.
- * They also have no effect when ZSMALLOC_PGTABLE_MAPPING is selected.
*/
enum zs_mapmode {
ZS_MM_RW, /* normal read-write mapping */
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -706,19 +706,6 @@ config ZSMALLOC
returned by an alloc(). This handle must be mapped in order to
access the allocated space.

-config ZSMALLOC_PGTABLE_MAPPING
- bool "Use page table mapping to access object in zsmalloc"
- depends on ZSMALLOC=y
- help
- By default, zsmalloc uses a copy-based object mapping method to
- access allocations that span two pages. However, if a particular
- architecture (ex, ARM) performs VM mapping faster than copying,
- then you should select this. This causes zsmalloc to use page table
- mapping rather than copying for object mapping.
-
- You can check speed with zsmalloc benchmark:
- https://github.com/spartacus06/zsmapbench
-
config ZSMALLOC_STAT
bool "Export zsmalloc statistics"
depends on ZSMALLOC
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -293,11 +293,7 @@ struct zspage {
};

struct mapping_area {
-#ifdef CONFIG_ZSMALLOC_PGTABLE_MAPPING
- struct vm_struct *vm; /* vm area for mapping object that span pages */
-#else
char *vm_buf; /* copy buffer for objects that span pages */
-#endif
char *vm_addr; /* address of kmap_atomic()'ed pages */
enum zs_mapmode vm_mm; /* mapping mode */
};
@@ -1113,48 +1109,6 @@ static struct zspage *find_get_zspage(st
return zspage;
}

-#ifdef CONFIG_ZSMALLOC_PGTABLE_MAPPING
-static inline int __zs_cpu_up(struct mapping_area *area)
-{
- /*
- * Make sure we don't leak memory if a cpu UP notification
- * and zs_init() race and both call zs_cpu_up() on the same cpu
- */
- if (area->vm)
- return 0;
- area->vm = alloc_vm_area(PAGE_SIZE * 2, NULL);
- if (!area->vm)
- return -ENOMEM;
- return 0;
-}
-
-static inline void __zs_cpu_down(struct mapping_area *area)
-{
- if (area->vm)
- free_vm_area(area->vm);
- area->vm = NULL;
-}
-
-static inline void *__zs_map_object(struct mapping_area *area,
- struct page *pages[2], int off, int size)
-{
- unsigned long addr = (unsigned long)area->vm->addr;
-
- BUG_ON(map_kernel_range(addr, PAGE_SIZE * 2, PAGE_KERNEL, pages) < 0);
- area->vm_addr = area->vm->addr;
- return area->vm_addr + off;
-}
-
-static inline void __zs_unmap_object(struct mapping_area *area,
- struct page *pages[2], int off, int size)
-{
- unsigned long addr = (unsigned long)area->vm_addr;
-
- unmap_kernel_range(addr, PAGE_SIZE * 2);
-}
-
-#else /* CONFIG_ZSMALLOC_PGTABLE_MAPPING */
-
static inline int __zs_cpu_up(struct mapping_area *area)
{
/*
@@ -1235,8 +1189,6 @@ out:
pagefault_enable();
}

-#endif /* CONFIG_ZSMALLOC_PGTABLE_MAPPING */
-
static int zs_cpu_prepare(unsigned int cpu)
{
struct mapping_area *area;


2020-12-14 19:29:33

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.9 031/105] net: broadcom CNIC: requires MMU

From: Randy Dunlap <[email protected]>

[ Upstream commit 14483cbf040fcb38113497161088a1ce8ce5d713 ]

The CNIC kconfig symbol selects UIO and UIO depends on MMU.
Since 'select' does not follow dependency chains, add the same MMU
dependency to CNIC.

Quietens this kconfig warning:

WARNING: unmet direct dependencies detected for UIO
Depends on [n]: MMU [=n]
Selected by [m]:
- CNIC [=m] && NETDEVICES [=y] && ETHERNET [=y] && NET_VENDOR_BROADCOM [=y] && PCI [=y] && (IPV6 [=m] || IPV6 [=m]=n)

Fixes: adfc5217e9db ("broadcom: Move the Broadcom drivers")
Signed-off-by: Randy Dunlap <[email protected]>
Cc: Jeff Kirsher <[email protected]>
Cc: Rasesh Mody <[email protected]>
Cc: [email protected]
Cc: "David S. Miller" <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/net/ethernet/broadcom/Kconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/broadcom/Kconfig b/drivers/net/ethernet/broadcom/Kconfig
index 7fb42f388d591..7b79528d6eed2 100644
--- a/drivers/net/ethernet/broadcom/Kconfig
+++ b/drivers/net/ethernet/broadcom/Kconfig
@@ -88,6 +88,7 @@ config BNX2
config CNIC
tristate "QLogic CNIC support"
depends on PCI && (IPV6 || IPV6=n)
+ depends on MMU
select BNX2
select UIO
help
--
2.27.0



2020-12-14 19:31:06

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.9 001/105] Kbuild: do not emit debug info for assembly with LLVM_IAS=1

From: Nick Desaulniers <[email protected]>

commit b8a9092330da2030496ff357272f342eb970d51b upstream.

Clang's integrated assembler produces the warning for assembly files:

warning: DWARF2 only supports one section per compilation unit

If -Wa,-gdwarf-* is unspecified, then debug info is not emitted for
assembly sources (it is still emitted for C sources). This will be
re-enabled for newer DWARF versions in a follow up patch.

Enables defconfig+CONFIG_DEBUG_INFO to build cleanly with
LLVM=1 LLVM_IAS=1 for x86_64 and arm64.

Cc: <[email protected]>
Link: https://github.com/ClangBuiltLinux/linux/issues/716
Reported-by: Dmitry Golovin <[email protected]>
Reported-by: Nathan Chancellor <[email protected]>
Suggested-by: Dmitry Golovin <[email protected]>
Suggested-by: Nathan Chancellor <[email protected]>
Suggested-by: Sedat Dilek <[email protected]>
Reviewed-by: Fangrui Song <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Signed-off-by: Nick Desaulniers <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
[nd: backport to avoid conflicts from:
commit 695afd3d7d58 ("kbuild: Simplify DEBUG_INFO Kconfig handling")]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
Makefile | 3 +++
1 file changed, 3 insertions(+)

--- a/Makefile
+++ b/Makefile
@@ -821,8 +821,11 @@ DEBUG_CFLAGS += -gsplit-dwarf
else
DEBUG_CFLAGS += -g
endif
+ifneq ($(LLVM_IAS),1)
KBUILD_AFLAGS += -Wa,-gdwarf-2
endif
+endif
+
ifdef CONFIG_DEBUG_INFO_DWARF4
DEBUG_CFLAGS += -gdwarf-4
endif


2020-12-14 22:10:42

by Jeffrin Thalakkottoor

[permalink] [raw]
Subject: Re: [PATCH 5.9 000/105] 5.9.15-rc1 review

On Mon, 2020-12-14 at 18:27 +0100, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 5.9.15 release.
> There are 105 patches in this series, all will be posted as a
> response
> to this one.  If anyone has any issues with these being applied,
> please
> let me know.
>
> Responses should be made by Wed, 16 Dec 2020 17:25:32 +0000.
> Anything received after that time might be too late.
>
> The whole patch series can be found in one patch at:
>         https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.9.15-rc1.gz
> or in the git tree and branch at:
>         git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-
> stable-rc.git linux-5.9.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h
hello,

Compiled and booted 5.9.15-rc1+ . No typical dmesg regression or
regressions

Tested-by: Jeffrin Jose T <[email protected]>

--
software engineer
rajagiri school of engineering and technology - autonomous


2020-12-14 23:55:11

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.9 101/105] x86/mm/mem_encrypt: Fix definition of PMD_FLAGS_DEC_WP

From: Arvind Sankar <[email protected]>

commit 29ac40cbed2bc06fa218ca25d7f5e280d3d08a25 upstream.

The PAT bit is in different locations for 4k and 2M/1G page table
entries.

Add a definition for _PAGE_LARGE_CACHE_MASK to represent the three
caching bits (PWT, PCD, PAT), similar to _PAGE_CACHE_MASK for 4k pages,
and use it in the definition of PMD_FLAGS_DEC_WP to get the correct PAT
index for write-protected pages.

Fixes: 6ebcb060713f ("x86/mm: Add support to encrypt the kernel in-place")
Signed-off-by: Arvind Sankar <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Tested-by: Tom Lendacky <[email protected]>
Cc: [email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
arch/x86/include/asm/pgtable_types.h | 1 +
arch/x86/mm/mem_encrypt_identity.c | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)

--- a/arch/x86/include/asm/pgtable_types.h
+++ b/arch/x86/include/asm/pgtable_types.h
@@ -155,6 +155,7 @@ enum page_cache_mode {
#define _PAGE_ENC (_AT(pteval_t, sme_me_mask))

#define _PAGE_CACHE_MASK (_PAGE_PWT | _PAGE_PCD | _PAGE_PAT)
+#define _PAGE_LARGE_CACHE_MASK (_PAGE_PWT | _PAGE_PCD | _PAGE_PAT_LARGE)

#define _PAGE_NOCACHE (cachemode2protval(_PAGE_CACHE_MODE_UC))
#define _PAGE_CACHE_WP (cachemode2protval(_PAGE_CACHE_MODE_WP))
--- a/arch/x86/mm/mem_encrypt_identity.c
+++ b/arch/x86/mm/mem_encrypt_identity.c
@@ -45,8 +45,8 @@
#define PMD_FLAGS_LARGE (__PAGE_KERNEL_LARGE_EXEC & ~_PAGE_GLOBAL)

#define PMD_FLAGS_DEC PMD_FLAGS_LARGE
-#define PMD_FLAGS_DEC_WP ((PMD_FLAGS_DEC & ~_PAGE_CACHE_MASK) | \
- (_PAGE_PAT | _PAGE_PWT))
+#define PMD_FLAGS_DEC_WP ((PMD_FLAGS_DEC & ~_PAGE_LARGE_CACHE_MASK) | \
+ (_PAGE_PAT_LARGE | _PAGE_PWT))

#define PMD_FLAGS_ENC (PMD_FLAGS_LARGE | _PAGE_ENC)



2020-12-15 00:03:53

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.9 027/105] can: c_can: c_can_power_up(): fix error handling

From: Zhang Qilong <[email protected]>

[ Upstream commit 44cef0c0ffbd8d61143712ce874be68a273b7884 ]

In the error handling in c_can_power_up(), there are two bugs:

1) c_can_pm_runtime_get_sync() will increase usage counter if device is not
empty. Forgetting to call c_can_pm_runtime_put_sync() will result in a
reference leak here.

2) c_can_reset_ram() operation will set start bit when enable is true. We
should clear it in the error handling.

We fix it by adding c_can_pm_runtime_put_sync() for 1), and
c_can_reset_ram(enable is false) for 2) in the error handling.

Fixes: 8212003260c60 ("can: c_can: Add d_can suspend resume support")
Fixes: 52cde85acc23f ("can: c_can: Add d_can raminit support")
Signed-off-by: Zhang Qilong <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[mkl: return "0" instead of "ret"]
Signed-off-by: Marc Kleine-Budde <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/net/can/c_can/c_can.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
index 8e9f5620c9a21..095505fa09de3 100644
--- a/drivers/net/can/c_can/c_can.c
+++ b/drivers/net/can/c_can/c_can.c
@@ -1304,12 +1304,22 @@ int c_can_power_up(struct net_device *dev)
time_after(time_out, jiffies))
cpu_relax();

- if (time_after(jiffies, time_out))
- return -ETIMEDOUT;
+ if (time_after(jiffies, time_out)) {
+ ret = -ETIMEDOUT;
+ goto err_out;
+ }

ret = c_can_start(dev);
- if (!ret)
- c_can_irq_control(priv, true);
+ if (ret)
+ goto err_out;
+
+ c_can_irq_control(priv, true);
+
+ return 0;
+
+err_out:
+ c_can_reset_ram(priv, false);
+ c_can_pm_runtime_put_sync(priv);

return ret;
}
--
2.27.0



2020-12-15 00:08:20

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.9 044/105] iwlwifi: pcie: set LTR to avoid completion timeout

From: Johannes Berg <[email protected]>

[ Upstream commit edb625208d84aef179e3f16590c1c582fc5fdae6 ]

On some platforms, the preset values aren't correct and then we may
get a completion timeout in the firmware. Change the LTR configuration
to avoid that. The firmware will do some more complex reinit of this
later, but for the boot process we use ~250usec.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20201107104557.d83d591c05ba.I42885c9fb500bc08b9a4c07c4ff3d436cc7a3c84@changeid
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/net/wireless/intel/iwlwifi/iwl-csr.h | 10 ++++++++++
.../intel/iwlwifi/pcie/ctxt-info-gen3.c | 20 +++++++++++++++++++
2 files changed, 30 insertions(+)

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-csr.h b/drivers/net/wireless/intel/iwlwifi/iwl-csr.h
index cb9e8e189a1a4..1d48c7d7fffd4 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-csr.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-csr.h
@@ -147,6 +147,16 @@
#define CSR_MAC_SHADOW_REG_CTL2 (CSR_BASE + 0x0AC)
#define CSR_MAC_SHADOW_REG_CTL2_RX_WAKE 0xFFFF

+/* LTR control (since IWL_DEVICE_FAMILY_22000) */
+#define CSR_LTR_LONG_VAL_AD (CSR_BASE + 0x0D4)
+#define CSR_LTR_LONG_VAL_AD_NO_SNOOP_REQ 0x80000000
+#define CSR_LTR_LONG_VAL_AD_NO_SNOOP_SCALE 0x1c000000
+#define CSR_LTR_LONG_VAL_AD_NO_SNOOP_VAL 0x03ff0000
+#define CSR_LTR_LONG_VAL_AD_SNOOP_REQ 0x00008000
+#define CSR_LTR_LONG_VAL_AD_SNOOP_SCALE 0x00001c00
+#define CSR_LTR_LONG_VAL_AD_SNOOP_VAL 0x000003ff
+#define CSR_LTR_LONG_VAL_AD_SCALE_USEC 2
+
/* GIO Chicken Bits (PCI Express bus link power management) */
#define CSR_GIO_CHICKEN_BITS (CSR_BASE+0x100)

diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c
index 1ab1366004159..0fc2a6e49f9ee 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c
@@ -252,6 +252,26 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans,

iwl_set_bit(trans, CSR_CTXT_INFO_BOOT_CTRL,
CSR_AUTO_FUNC_BOOT_ENA);
+
+ if (trans->trans_cfg->device_family == IWL_DEVICE_FAMILY_AX210) {
+ /*
+ * The firmware initializes this again later (to a smaller
+ * value), but for the boot process initialize the LTR to
+ * ~250 usec.
+ */
+ u32 val = CSR_LTR_LONG_VAL_AD_NO_SNOOP_REQ |
+ u32_encode_bits(CSR_LTR_LONG_VAL_AD_SCALE_USEC,
+ CSR_LTR_LONG_VAL_AD_NO_SNOOP_SCALE) |
+ u32_encode_bits(250,
+ CSR_LTR_LONG_VAL_AD_NO_SNOOP_VAL) |
+ CSR_LTR_LONG_VAL_AD_SNOOP_REQ |
+ u32_encode_bits(CSR_LTR_LONG_VAL_AD_SCALE_USEC,
+ CSR_LTR_LONG_VAL_AD_SNOOP_SCALE) |
+ u32_encode_bits(250, CSR_LTR_LONG_VAL_AD_SNOOP_VAL);
+
+ iwl_write32(trans, CSR_LTR_LONG_VAL_AD, val);
+ }
+
if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210)
iwl_write_umac_prph(trans, UREG_CPU_INIT_RUN, 1);
else
--
2.27.0



2020-12-15 00:08:24

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.9 045/105] iwlwifi: mvm: fix kernel panic in case of assert during CSA

From: Sara Sharon <[email protected]>

[ Upstream commit fe56d05ee6c87f6a1a8c7267affd92c9438249cc ]

During CSA, we briefly nullify the phy context, in __iwl_mvm_unassign_vif_chanctx.
In case we have a FW assert right after it, it remains NULL though.
We end up running into endless loop due to mac80211 trying repeatedly to
move us to ASSOC state, and we keep returning -EINVAL. Later down the road
we hit a kernel panic.

Detect and avoid this endless loop.

Signed-off-by: Sara Sharon <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20201107104557.d64de2c17bff.Iedd0d2afa20a2aacba5259a5cae31cb3a119a4eb@changeid
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index 34362dc0d4612..f2d65e8384105 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -3057,7 +3057,7 @@ static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw,

/* this would be a mac80211 bug ... but don't crash */
if (WARN_ON_ONCE(!mvmvif->phy_ctxt))
- return -EINVAL;
+ return test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status) ? 0 : -EINVAL;

/*
* If we are in a STA removal flow and in DQA mode:
--
2.27.0



2020-12-15 00:35:15

by Shuah Khan

[permalink] [raw]
Subject: Re: [PATCH 5.9 000/105] 5.9.15-rc1 review

On 12/14/20 10:27 AM, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 5.9.15 release.
> There are 105 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Wed, 16 Dec 2020 17:25:32 +0000.
> Anything received after that time might be too late.
>
> The whole patch series can be found in one patch at:
> https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.9.15-rc1.gz
> or in the git tree and branch at:
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.9.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h
>

Compiled and booted on my test system. No dmesg regressions.

Tested-by: Shuah Khan <[email protected]>

thanks,
-- Shuah

2020-12-15 01:34:33

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.9 042/105] arm64: dts: rockchip: Reorder LED triggers from mmc devices on rk3399-roc-pc.

From: Markus Reichl <[email protected]>

[ Upstream commit 7327c8b98e2e14c47021eea14d1ab268086a6408 ]

After patch [1] SD-card becomes mmc1 and eMMC becomes mmc2.
Correct trigger of LEDs accordingly.

[1]
https://patchwork.kernel.org/patch/11881427

Signed-off-by: Markus Reichl <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Heiko Stuebner <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
index b85ec31cd2835..78ef0037ad4b5 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
@@ -74,14 +74,14 @@
label = "red:diy";
gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>;
default-state = "off";
- linux,default-trigger = "mmc1";
+ linux,default-trigger = "mmc2";
};

yellow_led: led-2 {
label = "yellow:yellow-led";
gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
default-state = "off";
- linux,default-trigger = "mmc0";
+ linux,default-trigger = "mmc1";
};
};

--
2.27.0



2020-12-15 01:34:51

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.9 079/105] mmc: mediatek: Extend recheck_sdio_irq fix to more variants

From: yong mao <[email protected]>

commit 903a72eca4abf241293dcc1385896fd428e15fe9 upstream.

The SDIO recheck fix is required for more of the supported variants. Let's
add it to those that needs it.

Reported-by: Fabien Parent <[email protected]>
Reported-by: Mattijs Korpershoek <[email protected]>
Signed-off-by: Yong Mao <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Fixes: 9e2582e57407 ("mmc: mediatek: fix SDIO irq issue")
Cc: [email protected]
[Ulf: Clarified commitmsg ]
Signed-off-by: Ulf Hansson <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/mmc/host/mtk-sd.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

--- a/drivers/mmc/host/mtk-sd.c
+++ b/drivers/mmc/host/mtk-sd.c
@@ -447,7 +447,7 @@ struct msdc_host {

static const struct mtk_mmc_compatible mt8135_compat = {
.clk_div_bits = 8,
- .recheck_sdio_irq = false,
+ .recheck_sdio_irq = true,
.hs400_tune = false,
.pad_tune_reg = MSDC_PAD_TUNE,
.async_fifo = false,
@@ -486,7 +486,7 @@ static const struct mtk_mmc_compatible m

static const struct mtk_mmc_compatible mt2701_compat = {
.clk_div_bits = 12,
- .recheck_sdio_irq = false,
+ .recheck_sdio_irq = true,
.hs400_tune = false,
.pad_tune_reg = MSDC_PAD_TUNE0,
.async_fifo = true,
@@ -512,7 +512,7 @@ static const struct mtk_mmc_compatible m

static const struct mtk_mmc_compatible mt7622_compat = {
.clk_div_bits = 12,
- .recheck_sdio_irq = false,
+ .recheck_sdio_irq = true,
.hs400_tune = false,
.pad_tune_reg = MSDC_PAD_TUNE0,
.async_fifo = true,
@@ -525,7 +525,7 @@ static const struct mtk_mmc_compatible m

static const struct mtk_mmc_compatible mt8516_compat = {
.clk_div_bits = 12,
- .recheck_sdio_irq = false,
+ .recheck_sdio_irq = true,
.hs400_tune = false,
.pad_tune_reg = MSDC_PAD_TUNE0,
.async_fifo = true,
@@ -536,7 +536,7 @@ static const struct mtk_mmc_compatible m

static const struct mtk_mmc_compatible mt7620_compat = {
.clk_div_bits = 8,
- .recheck_sdio_irq = false,
+ .recheck_sdio_irq = true,
.hs400_tune = false,
.pad_tune_reg = MSDC_PAD_TUNE,
.async_fifo = false,
@@ -549,6 +549,7 @@ static const struct mtk_mmc_compatible m

static const struct mtk_mmc_compatible mt6779_compat = {
.clk_div_bits = 12,
+ .recheck_sdio_irq = false,
.hs400_tune = false,
.pad_tune_reg = MSDC_PAD_TUNE0,
.async_fifo = true,


2020-12-15 01:35:45

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.9 013/105] batman-adv: Dont always reallocate the fragmentation skb head

From: Sven Eckelmann <[email protected]>

[ Upstream commit 992b03b88e36254e26e9a4977ab948683e21bd9f ]

When a packet is fragmented by batman-adv, the original batman-adv header
is not modified. Only a new fragmentation is inserted between the original
one and the ethernet header. The code must therefore make sure that it has
a writable region of this size in the skbuff head.

But it is not useful to always reallocate the skbuff by this size even when
there would be more than enough headroom still in the skb. The reallocation
is just to costly during in this codepath.

Fixes: ee75ed88879a ("batman-adv: Fragment and send skbs larger than mtu")
Signed-off-by: Sven Eckelmann <[email protected]>
Signed-off-by: Simon Wunderlich <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
net/batman-adv/fragmentation.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/net/batman-adv/fragmentation.c b/net/batman-adv/fragmentation.c
index dbd913bac9dd1..b7169c4147f55 100644
--- a/net/batman-adv/fragmentation.c
+++ b/net/batman-adv/fragmentation.c
@@ -527,13 +527,14 @@ int batadv_frag_send_packet(struct sk_buff *skb,
frag_header.no++;
}

- /* Make room for the fragment header. */
- if (batadv_skb_head_push(skb, header_size) < 0 ||
- pskb_expand_head(skb, header_size + ETH_HLEN, 0, GFP_ATOMIC) < 0) {
- ret = -ENOMEM;
+ /* make sure that there is at least enough head for the fragmentation
+ * and ethernet headers
+ */
+ ret = skb_cow_head(skb, ETH_HLEN + header_size);
+ if (ret < 0)
goto put_primary_if;
- }

+ skb_push(skb, header_size);
memcpy(skb->data, &frag_header, header_size);

/* Send the last fragment */
--
2.27.0



2020-12-15 01:35:52

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.9 033/105] iwlwifi: pcie: invert values of NO_160 device config entries

From: Luca Coelho <[email protected]>

[ Upstream commit 568d3434178b00274615190a19d29c3d235b4e6d ]

The NO_160 flag specifies if the device doesn't have 160 MHz support,
but we errorneously assumed the opposite. If the flag was set, we
were considering that 160 MHz was supported, but it's actually the
opposite. Fix it by inverting the bits, i.e. NO_160 is 0x1 and 160
is 0x0.

Fixes: d6f2134a3831 ("iwlwifi: add mac/rf types and 160MHz to the device tables")
Signed-off-by: Luca Coelho <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20201202143859.375bec857ccb.I83884286b688965293e9810381808039bd7eedae@changeid
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/net/wireless/intel/iwlwifi/iwl-config.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-config.h b/drivers/net/wireless/intel/iwlwifi/iwl-config.h
index e27c13263a232..44abe44c04632 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-config.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-config.h
@@ -488,8 +488,8 @@ struct iwl_cfg {
#define IWL_CFG_RF_ID_HR 0x7
#define IWL_CFG_RF_ID_HR1 0x4

-#define IWL_CFG_NO_160 0x0
-#define IWL_CFG_160 0x1
+#define IWL_CFG_NO_160 0x1
+#define IWL_CFG_160 0x0

#define IWL_CFG_CORES_BT 0x0
#define IWL_CFG_CORES_BT_GNSS 0x5
--
2.27.0



2020-12-15 01:35:59

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.9 068/105] platform/x86: thinkpad_acpi: Whitelist P15 firmware for dual fan control

From: Matthias Maier <[email protected]>

[ Upstream commit 80a8c3185f5047dc7438ed226b72385bf93b4071 ]

This commit enables dual fan control for the following new Lenovo
models: P15, P15v.

Signed-off-by: Matthias Maier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/platform/x86/thinkpad_acpi.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index c7e9c0d29ed93..55a94a2dc562e 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -8777,6 +8777,7 @@ static const struct tpacpi_quirk fan_quirk_table[] __initconst = {
TPACPI_Q_LNV3('N', '2', 'E', TPACPI_FAN_2CTL), /* P1 / X1 Extreme (1st gen) */
TPACPI_Q_LNV3('N', '2', 'O', TPACPI_FAN_2CTL), /* P1 / X1 Extreme (2nd gen) */
TPACPI_Q_LNV3('N', '2', 'V', TPACPI_FAN_2CTL), /* P1 / X1 Extreme (3nd gen) */
+ TPACPI_Q_LNV3('N', '3', '0', TPACPI_FAN_2CTL), /* P15 (1st gen) / P15v (1st gen) */
};

static int __init fan_init(struct ibm_init_struct *iibm)
--
2.27.0



2020-12-15 02:54:08

by Naresh Kamboju

[permalink] [raw]
Subject: Re: [PATCH 5.9 000/105] 5.9.15-rc1 review

On Mon, 14 Dec 2020 at 23:06, Greg Kroah-Hartman
<[email protected]> wrote:
>
> This is the start of the stable review cycle for the 5.9.15 release.
> There are 105 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Wed, 16 Dec 2020 17:25:32 +0000.
> Anything received after that time might be too late.
>
> The whole patch series can be found in one patch at:
> https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.9.15-rc1.gz
> or in the git tree and branch at:
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.9.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h

Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.

Tested-by: Linux Kernel Functional Testing <[email protected]>

NOTE:
Following warning(s) reported on arm64 Juno-r2 device.
sched: core.c:7270 Illegal context switch in RCU-bh read-side critical section!
https://lore.kernel.org/stable/CA+G9fYtu1zOz8ErUzftNG4Dc9=cv1grsagBojJraGhm4arqXyw@mail.gmail.com/T/#u

Summary
------------------------------------------------------------------------

kernel: 5.9.15-rc1
git repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git branch: linux-5.9.y
git commit: 609d95a959259ea4ab7ecdc39c3151321a6a7032
git describe: v5.9.14-106-g609d95a95925
Test details: https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-5.9.y/build/v5.9.14-106-g609d95a95925

No regressions (compared to build v5.9.14)

No fixes (compared to build v5.9.14)

Ran 53718 total tests in the following environments and test suites.

Environments
--------------
- arc
- arm
- arm64
- dragonboard-410c
- hi6220-hikey
- i386
- juno-r2
- juno-r2-compat
- juno-r2-kasan
- mips
- nxp-ls2088
- parisc
- powerpc
- qemu-arm-clang
- qemu-arm64-clang
- qemu-arm64-kasan
- qemu-i386-clang
- qemu-x86_64-clang
- qemu-x86_64-kasan
- qemu-x86_64-kcsan
- qemu_arm
- qemu_arm64
- qemu_arm64-compat
- qemu_i386
- qemu_x86_64
- qemu_x86_64-compat
- riscv
- s390
- sh
- sparc
- x15
- x86
- x86-kasan

Test Suites
-----------
* build
* linux-log-parser
* install-android-platform-tools-r2600
* kselftest
* libhugetlbfs
* ltp-commands-tests
* ltp-containers-tests
* ltp-cve-tests
* ltp-dio-tests
* ltp-fcntl-locktests-tests
* ltp-filecaps-tests
* ltp-fs-tests
* ltp-fs_bind-tests
* ltp-fs_perms_simple-tests
* ltp-fsx-tests
* ltp-io-tests
* ltp-math-tests
* ltp-sched-tests
* v4l2-compliance
* kvm-unit-tests
* ltp-cap_bounds-tests
* ltp-cpuhotplug-tests
* ltp-crypto-tests
* ltp-hugetlb-tests
* ltp-mm-tests
* ltp-nptl-tests
* ltp-pty-tests
* ltp-securebits-tests
* ltp-syscalls-tests
* network-basic-tests
* perf
* ltp-controllers-tests
* ltp-ipc-tests
* ltp-open-posix-tests
* ltp-tracing-tests
* fwts
* kunit
* rcutorture
* kselftest-vsyscall-mode-native
* kselftest-vsyscall-mode-none

--
Linaro LKFT
https://lkft.linaro.org

2020-12-15 20:36:06

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH 5.9 000/105] 5.9.15-rc1 review

On Mon, Dec 14, 2020 at 06:27:34PM +0100, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 5.9.15 release.
> There are 105 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Wed, 16 Dec 2020 17:25:32 +0000.
> Anything received after that time might be too late.
>

Build results:
total: 154 pass: 154 fail: 0
Qemu test results:
total: 427 pass: 427 fail: 0

Tested-by: Guenter Roeck <[email protected]>

Guenter