Skip to contentSkip to conversation

5.10.20-rc1 review

PATCH In review Greg Kroah-Hartman 6 participants 673 messages Mar 1, 2021 – Mar 5, 2021 Page 1 of 5

Subsystems (11)
lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

cover 5.10.20-rc1 review

This is the start of the stable review cycle for the 5.10.20 release. There are 663 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, 03 Mar 2021 16:09:49 +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.10.20-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.10.y
and the diffstat can be found below.

thanks,

greg k-h

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

Greg Kroah-Hartman <[email protected]>

    Linux 5.10.20-rc1

Cong Wang <[email protected]>
net_sched: fix RTNL deadlock again caused by request_module()

Takeshi Misawa <[email protected]>
net: qrtr: Fix memory leak in qrtr_tun_open

Vlad Buslov <[email protected]>
net: sched: fix police ext initialization

Jason A. Donenfeld <[email protected]>
wireguard: queueing: get rid of per-peer ring buffers

Jason A. Donenfeld <[email protected]>
wireguard: selftests: test multiple parallel streams

Jason A. Donenfeld <[email protected]>
net: icmp: pass zeroed opts from icmp{,v6}_ndo_send before sending

Leon Romanovsky <[email protected]>
ipv6: silence compilation warning for non-IPV6 builds

Sumit Garg <[email protected]>
kgdb: fix to kill breakpoints on initmem after boot

Ville Syrjälä <[email protected]>

    drm/i915: Reject 446-480MHz HDMI clock on GLK

Nikos Tsironis <[email protected]>
dm era: only resize metadata in preresume

Nikos Tsironis <[email protected]>
dm era: Reinitialize bitset cache before digesting a new writeset

Nikos Tsironis <[email protected]>
dm era: Use correct value size in equality function of writeset tree

Nikos Tsironis <[email protected]>
dm era: Fix bitset memory leaks

Nikos Tsironis <[email protected]>
dm era: Verify the data block size hasn't changed

Nikos Tsironis <[email protected]>
dm era: Update in-core bitset after committing the metadata

Nikos Tsironis <[email protected]>
dm era: Recover committed writeset after crash

Mikulas Patocka <[email protected]>
dm writecache: fix writing beyond end of underlying device when shrinking

Mikulas Patocka <[email protected]>
dm writecache: return the exact table values that were set

Mikulas Patocka <[email protected]>
dm writecache: fix performance degradation in ssd mode

Jeffle Xu <[email protected]>
dm table: fix zoned iterate_devices based device capability checks

Jeffle Xu <[email protected]>
dm table: fix DAX iterate_devices based device capability checks

Jeffle Xu <[email protected]>
dm table: fix iterate_devices based device capability checks

Mikulas Patocka <[email protected]>
dm: fix deadlock when swapping to encrypted device

Andreas Gruenbacher <[email protected]>
gfs2: Recursive gfs2_quota_hold in gfs2_iomap_end

Andreas Gruenbacher <[email protected]>
gfs2: Lock imbalance on error path in gfs2_recover_one

Bob Peterson <[email protected]>
gfs2: Don't skip dlm unlock if glock has an lvb

Bob Peterson <[email protected]>
gfs2: fix glock confusion in function signal_our_withdraw

Masahisa Kojima <[email protected]>
spi: spi-synquacer: fix set_cs handling

Rasmus Villemoes <[email protected]>
spi: fsl: invert spisel_boot signal on MPC8309

Al Viro <[email protected]>
sparc32: fix a user-triggerable oops in clear_user()

Jaegeuk Kim <[email protected]>
f2fs: flush data when enabling checkpoint back

Chao Yu <[email protected]>
f2fs: enforce the immutable flag on open files

Chao Yu <[email protected]>
f2fs: fix out-of-repair __setattr_copy()

Huacai Chen <[email protected]>
irqchip/loongson-pch-msi: Use bitmap_zalloc() to allocate bitmap

Johannes Berg <[email protected]>
um: defer killing userspace on page table update failures

Johannes Berg <[email protected]>
um: mm: check more comprehensively for stub changes

Cornelia Huck <[email protected]>
virtio/s390: implement virtio-ccw revision 2 correctly

Heiko Carstens <[email protected]>
s390/vtime: fix inline assembly clobber list

Jens Axboe <[email protected]>
proc: don't allow async path resolution of /proc/thread-self components

Chen Yu <[email protected]>
cpufreq: intel_pstate: Get per-CPU max freq via MSR_HWP_CAPABILITIES if available

Rafael J. Wysocki <[email protected]>
cpufreq: intel_pstate: Change intel_pstate_get_hwp_max() argument

Shawn Guo <[email protected]>
cpufreq: qcom-hw: drop devm_xxx() calls from init/exit hooks

Viresh Kumar <[email protected]>
thermal: cpufreq_cooling: freq_qos_update_request() returns < 0 on error

Chris Wilson <[email protected]>
kcmp: Support selection of SYS_kcmp without CHECKPOINT_RESTORE

Shin'ichiro Kawasaki <[email protected]>
zonefs: Fix file size of zones in full condition

Namjae Jeon <[email protected]>
exfat: fix shift-out-of-bounds in exfat_fill_super()

Muchun Song <[email protected]>
printk: fix deadlock when kernel panic

Tim Harvey <[email protected]>
mfd: gateworks-gsc: Fix interrupt type

Maxim Kiselev <[email protected]>
gpio: pcf857x: Fix missing first interrupt

Alexander Usyskin <[email protected]>
mei: me: add adler lake point LP DID

Alexander Usyskin <[email protected]>
mei: me: add adler lake point S DID

Tomas Winkler <[email protected]>
mei: me: emmitsburg workstation DID

Alexander Usyskin <[email protected]>
mei: fix transfer over dma with extended header

Subbaraman Narayanamurthy <[email protected]>
spmi: spmi-pmic-arb: Fix hw_irq overflow

Christophe Leroy <[email protected]>
powerpc/32s: Add missing call to kuep_lock on syscall entry

Hari Bathini <[email protected]>
powerpc/kexec_file: fix FDT size estimation for kdump kernel

Christophe Leroy <[email protected]>
powerpc/32: Preserve cr1 in exception prolog stack check to fix build error

Shirley Her <[email protected]>
mmc: sdhci-pci-o2micro: Bug fix for SDR104 HW tuning failure

Frank Li <[email protected]>
mmc: sdhci-esdhc-imx: fix kernel panic when remove module

Fangrui Song <[email protected]>
module: Ignore _GLOBAL_OFFSET_TABLE_ when warning for undefined symbols

Subbaraman Narayanamurthy <[email protected]>
nvmem: qcom-spmi-sdam: Fix uninitialized pdev pointer

Paolo Bonzini <[email protected]>
KVM: nSVM: fix running nested guests when npt=0

Vlastimil Babka <[email protected]>
mm, compaction: make fast_isolate_freepages() stay within zone

Dave Hansen <[email protected]>
mm/vmscan: restore zone_reclaim_mode ABI

Mike Kravetz <[email protected]>
hugetlb: fix copy_huge_page_from_user contig page struct assumption

Mike Kravetz <[email protected]>
hugetlb: fix update_and_free_page contig page struct assumption

Muchun Song <[email protected]>
mm: memcontrol: fix get_active_memcg return value

Muchun Song <[email protected]>
mm: memcontrol: fix swap undercounting in cgroup2

NeilBrown <[email protected]>
x86: fix seq_file iteration for pat/memtype.c

NeilBrown <[email protected]>
seq_file: document how per-entry resources are managed.

Pan Bian <[email protected]>
fs/affs: release old buffer head on error path

Pan Bian <[email protected]>
mtd: spi-nor: hisi-sfc: Put child node np on error path

Takahiro Kuwano <[email protected]>
mtd: spi-nor: core: Add erase size check for erase command initialization

Takahiro Kuwano <[email protected]>
mtd: spi-nor: core: Fix erase type discovery for overlaid region

Takahiro Kuwano <[email protected]>
mtd: spi-nor: sfdp: Fix wrong erase type bitmask for overlaid region

Takahiro Kuwano <[email protected]>
mtd: spi-nor: sfdp: Fix last erase region marking

Suzuki K Poulose <[email protected]>
coresight: etm4x: Handle accesses to TRCSTALLCTLR

Alexander Usyskin <[email protected]>
watchdog: mei_wdt: request stop on unregister

Sai Prakash Ranjan <[email protected]>
watchdog: qcom: Remove incorrect usage of QCOM_WDT_ENABLE_IRQ

Tobias Klauser <[email protected]>
riscv: Disable KSAN_SANITIZE for vDSO

Will Deacon <[email protected]>
arm64: spectre: Prevent lockdep splat on v4 mitigation enable path

Shaoying Xu <[email protected]>

    arm64 module: set plt* section addresses to 0x0

He Zhe <[email protected]>
arm64: uprobe: Return EOPNOTSUPP for AARCH32 instruction probing

qiuguorui1 <[email protected]>
arm64: kexec_file: fix memory leakage in create_dtb() when fdt_open_into() fails

Isaac J. Manjarres <[email protected]>
iommu/arm-smmu-qcom: Fix mask extraction for bootloader programmed SMRs

Suzuki K Poulose <[email protected]>
arm64: Extend workaround for erratum 1024718 to all versions of Cortex-A55

Masami Hiramatsu <[email protected]>
kprobes: Fix to delay the kprobes jump optimization

Frederic Weisbecker <[email protected]>
entry/kvm: Explicitly flush pending rcuog wakeup before last rescheduling point

Frederic Weisbecker <[email protected]>
entry: Explicitly flush pending rcuog wakeup before last rescheduling point

Frederic Weisbecker <[email protected]>
rcu/nocb: Trigger self-IPI on late deferred wake up before user resume

Frederic Weisbecker <[email protected]>
rcu/nocb: Perform deferred wake up before last idle's need_resched() check

Frederic Weisbecker <[email protected]>
rcu: Pull deferred rcuog wake up to rcu_eqs_enter() callers

Cédric Le Goater <[email protected]>
powerpc/prom: Fix "ibm,arch-vec-5-platform-support" scan

Thomas Gleixner <[email protected]>
x86/entry: Fix instrumentation annotation

Andy Lutomirski <[email protected]>
x86/fault: Fix AMD erratum #91 errata fixup for user code

Sean Christopherson <[email protected]>
x86/reboot: Force all cpus to exit VMX root if VMX is supported

Sean Christopherson <[email protected]>
x86/virt: Eat faults on VMXOFF in reboot flows

Sean Young <[email protected]>
media: smipcie: fix interrupt handling and IR timeout

Lubomir Rintel <[email protected]>
media: marvell-ccic: power up the device on mclk enable

Pavel Machek <[email protected]>
media: ipu3-cio2: Fix mbus_code processing in cio2_subdev_set_fmt()

Sean Young <[email protected]>
media: ir_toy: add another IR Droid device

Tomi Valkeinen <[email protected]>
media: i2c: max9286: fix access to unallocated memory

Jiri Kosina <[email protected]>
floppy: reintroduce O_NDELAY fix

Martin Kaiser <[email protected]>
staging: rtl8188eu: Add Edimax EW-7811UN V2 to device table

Amey Narkhede <[email protected]>
staging: gdm724x: Fix DMA from stack

Ilya Lipnitskiy <[email protected]>

    staging/mt7621-dma: mtk-hsdma.c->hsdma-mt7621.c

Dinh Nguyen <[email protected]>
arm64: dts: agilex: fix phy interface bit shift for gmac1 and gmac2

Frank Wunderlich <[email protected]>
dts64: mt7622: fix slow sd card access

Jiri Bohac <[email protected]>
pstore: Fix typo in compression option name

Sabyrzhan Tasbolatov <[email protected]>
drivers/misc/vmw_vmci: restrict too big queue size in qp_host_alloc_queue

Ricky Wu <[email protected]>
misc: rtsx: init of rts522a add OCP power off when no card is present

Timothy E Baldwin <[email protected]>
arm64: ptrace: Fix seccomp of traced syscall -1 (NO_SYSCALL)

Paul Cercueil <[email protected]>
seccomp: Add missing return in non-void function

Krzysztof Kozlowski <[email protected]>
soc: samsung: exynos-asv: handle reading revision register error

Marek Szyprowski <[email protected]>
soc: samsung: exynos-asv: don't defer early on not-supported SoCs

Corentin Labbe <[email protected]>
crypto: sun4i-ss - initialize need_fallback

Corentin Labbe <[email protected]>
crypto: sun4i-ss - handle BigEndian for cipher

Corentin Labbe <[email protected]>
crypto: sun4i-ss - IV register does not work on A10 and A13

Corentin Labbe <[email protected]>
crypto: sun4i-ss - checking sg length is not sufficient

Ard Biesheuvel <[email protected]>
crypto: michael_mic - fix broken misalignment handling

Ard Biesheuvel <[email protected]>
crypto: aesni - prevent misaligned buffers on the stack

Ard Biesheuvel <[email protected]>
crypto: arm64/sha - add missing module aliases

Chris Wilson <[email protected]>
drm/i915/gt: Correct surface base address for renderclear

Chris Wilson <[email protected]>
drm/i915/gt: Flush before changing register state

Filipe Manana <[email protected]>
btrfs: fix extent buffer leak on failure to copy root

Josef Bacik <[email protected]>
btrfs: account for new extents being deleted in total_bytes_pinned

Josef Bacik <[email protected]>
btrfs: handle space_info::total_bytes_pinned inside the delayed ref itself

Josef Bacik <[email protected]>
btrfs: splice remaining dirty_bg's onto the transaction dirty bg list

Josef Bacik <[email protected]>
btrfs: fix reloc root leak with 0 ref reloc roots on recovery

Josef Bacik <[email protected]>
btrfs: abort the transaction if we fail to inc ref in btrfs_copy_root

Josef Bacik <[email protected]>
btrfs: add asserts for deleting backref cache nodes

Josef Bacik <[email protected]>
btrfs: do not warn if we can't find the reloc root when looking up backref

Josef Bacik <[email protected]>
btrfs: do not cleanup upper nodes in btrfs_backref_cleanup_node

Jarkko Sakkinen <[email protected]>
KEYS: trusted: Reserve TPM for seal and unseal operations

Jarkko Sakkinen <[email protected]>
KEYS: trusted: Fix migratable=1 failing

Jarkko Sakkinen <[email protected]>
KEYS: trusted: Fix incorrect handling of tpm_get_random()

James Bottomley <[email protected]>
tpm_tis: Clean up locality release

James Bottomley <[email protected]>
tpm_tis: Fix check_locality for correct locality acquisition

Gao Xiang <[email protected]>
erofs: initialized fields can only be observed after bit is set

Amir Goldstein <[email protected]>
selinux: fix inconsistency between inode_getxattr and inode_listsecurity

Takashi Iwai <[email protected]>
ASoC: siu: Fix build error by a wrong const prefix

Alyssa Rosenzweig <[email protected]>
drm/rockchip: Require the YTR modifier for AFBC

Heiko Stuebner <[email protected]>
drm/panel: kd35t133: allow using non-continuous dsi clock

Andrey Grodzovsky <[email protected]>
drm/sched: Cancel and flush all outstanding jobs before finish.

Ville Syrjälä <[email protected]>
drm/modes: Switch to 64bit maths to avoid integer overflow

Karol Herbst <[email protected]>
drm/nouveau/kms: handle mDP connectors

Alex Deucher <[email protected]>
drm/amdgpu: Set reference clock to 100Mhz on Renoir (v2)

Felix Kuehling <[email protected]>
drm/amdkfd: Fix recursive lock warnings

Rodrigo Siqueira <[email protected]>
drm/amd/display: Add vupdate_no_lock interrupts for DCN2.1

Eric Bernstein <[email protected]>
drm/amd/display: Remove Assert from dcn10_get_dig_frontend

Jan Kokemüller <[email protected]>
drm/amd/display: Add FPU wrappers to dcn21_validate_bandwidth()

Alex Deucher <[email protected]>
Revert "drm/amd/display: Update NV1x SR latency values"

Kai Krakow <[email protected]>
bcache: Move journal work to new flush wq

Kai Krakow <[email protected]>
bcache: Give btree_io_wq correct semantics again

Kai Krakow <[email protected]>
Revert "bcache: Kill btree_io_wq"

Kevin Hao <[email protected]>
Revert "MIPS: Octeon: Remove special handling of CONFIG_MIPS_ELF_APPENDED_DTB=y"

Nathan Chancellor <[email protected]>
MIPS: VDSO: Use CLANG_FLAGS instead of filtering out '--target='

Aurelien Jarno <[email protected]>
MIPS: Support binutils configured with --enable-mips-fix-loongson3-llsc=yes

Paul Cercueil <[email protected]>
MIPS: Ingenic: Disable HPTLB for D0 XBurst CPUs too

Takashi Iwai <[email protected]>
ALSA: hda/realtek: Quirk for HP Spectre x360 14 amp setup

PeiSen Hou <[email protected]>
ALSA: hda/realtek: modify EAPD in the ALC886

Takashi Iwai <[email protected]>
ALSA: hda/hdmi: Drop bogus check at closing a stream

Kai Vehmanen <[email protected]>
ALSA: hda: Add another CometLake-H PCI ID

Takashi Sakamoto <[email protected]>
ALSA: fireface: fix to parse sync status register of latter protocol

Mathias Kresin <[email protected]>
phy: lantiq: rcu-usb2: wait after clock enable

Dan Carpenter <[email protected]>

    USB: serial: mos7720: fix error code in mos7720_write()

Dan Carpenter <[email protected]>

    USB: serial: mos7840: fix error code in mos7840_write()

Johan Hovold <[email protected]>
USB: serial: pl2303: fix line-speed handling on newer chips

Johan Hovold <[email protected]>
USB: serial: ftdi_sio: fix FTX sub-integer prescaler

Thinh Nguyen <[email protected]>

    usb: dwc3: gadget: Fix dep->interval for fullspeed interrupt

Thinh Nguyen <[email protected]>
usb: dwc3: gadget: Fix setting of DEPCFG.bInterval_m1

Paul Cercueil <[email protected]>
usb: musb: Fix runtime PM race in musb_queue_resume_work

Lech Perczak <[email protected]>
USB: serial: option: update interface mapping for ZTE P685M

James Reynolds <[email protected]>
media: mceusb: Fix potential out-of-bounds shift

Marcos Paulo de Souza <[email protected]>
Input: i8042 - add ASUS Zenbook Flip to noselftest list

Dan Carpenter <[email protected]>
Input: joydev - prevent potential read overflow in ioctl

Olivier Crête <[email protected]>
Input: xpad - add support for PowerA Enhanced Wired Controller for Xbox Series X|S

jeffrey.lin <[email protected]>
Input: raydium_ts_i2c - do not send zero length

Jason Gerecke <[email protected]>
HID: wacom: Ignore attempts to overwrite the touch_max value from HID

Filipe Laíns <[email protected]>
HID: logitech-dj: add support for keyboard events in eQUAD step 4 Gaming

Rafael J. Wysocki <[email protected]>
cpufreq: ACPI: Set cpuinfo.max_freq directly if max boost is known

Qinglang Miao <[email protected]>
ACPI: configfs: add missing check after configfs_register_default_group()

Rafael J. Wysocki <[email protected]>
ACPI: property: Fix fwnode string properties matching

Marcin Ślusarz <[email protected]>
soundwire: intel: fix possible crash when no device is detected

Mikulas Patocka <[email protected]>
blk-settings: align max_sectors on "logical_block_size" boundary

Bart Van Assche <[email protected]>
scsi: sd: Fix Opal support

Finn Thain <[email protected]>
ide/falconide: Fix module unload

Christoph Hellwig <[email protected]>
block: reopen the device in blkdev_reread_part

Johannes Thumshirn <[email protected]>
scsi: sd: sd_zbc: Don't pass GFP_NOIO to kvcalloc

Randy Dunlap <[email protected]>
scsi: bnx2fc: Fix Kconfig warning & CNIC build errors

Zhenzhong Duan <[email protected]>
csky: Fix a size determination in gpr_get()

Josef Bacik <[email protected]>
proc: use kvzalloc for our kernel buffer

Miaohe Lin <[email protected]>
mm/rmap: fix potential pte_unmap on an not mapped pte

Dan Williams <[email protected]>
mm: fix memory_failure() handling of dax-namespace metadata

Rik van Riel <[email protected]>
mm,thp,shmem: make khugepaged obey tmpfs mount flags

Mårten Lindahl <[email protected]>
i2c: exynos5: Preserve high speed master code

Maxime Ripard <[email protected]>
i2c: brcmstb: Fix brcmstd_send_i2c_cmd condition

Marc Zyngier <[email protected]>
arm64: Add missing ISB after invalidating TLB in __primary_switch

Sean Christopherson <[email protected]>
KVM: x86/mmu: Expand collapsible SPTE zap for TDP MMU to ZONE_DEVICE and HugeTLB pages

Sean Christopherson <[email protected]>
KVM: SVM: Intercept INVPCID when it's disabled to inject #UD

Trond Myklebust <[email protected]>
NFSv4: Fixes for nfs4_bitmask_adjust()

Heiner Kallweit <[email protected]>
r8169: fix jumbo packet handling on RTL8168e

Wonhyuk Yang <[email protected]>
mm/compaction: fix misbehaviors of fast_find_migrateblock()

Chen Wandun <[email protected]>
mm/hugetlb: suppress wrong warning info when alloc gigantic page

Miaohe Lin <[email protected]>
mm/hugetlb: fix potential double free in hugetlb_register_node() error path

Miaohe Lin <[email protected]>
mm/memory.c: fix potential pte_unmap_unlock pte error

Muchun Song <[email protected]>
mm: memcontrol: fix slub memory accounting

Muchun Song <[email protected]>
mm: memcontrol: fix NR_ANON_THPS accounting in charge moving

Dan Carpenter <[email protected]>
ocfs2: fix a use after free on error

Jason A. Donenfeld <[email protected]>
wireguard: kconfig: use arm chacha even with no neon

Jason A. Donenfeld <[email protected]>
wireguard: device: do not generate ICMP for non-IP packets

Taehee Yoo <[email protected]>
vxlan: move debug check after netdev unregister

Chen-Yu Tsai <[email protected]>
PCI: rockchip: Make 'ep-gpios' DT property optional

Chuhong Yuan <[email protected]>
net/mlx4_core: Add missed mlx4_free_cmd_mailbox()

Song, Yoong Siang <[email protected]>
net: stmmac: fix CBS idleslope and sendslope calculation

Henry Tieman <[email protected]>
ice: update the number of available RSS queues

Dave Ertman <[email protected]>
ice: Fix state bits on LLDP mode switch

Brett Creeley <[email protected]>
ice: Account for port VLAN in VF max packet size calculation

Dave Ertman <[email protected]>
ice: report correct max number of TCs

Alex Williamson <[email protected]>
vfio/type1: Use follow_pte()

Uwe Kleine-König <[email protected]>
pwm: iqs620a: Fix overflow and optimize calculations

Dan Carpenter <[email protected]>
octeontx2-af: Fix an off by one in rvu_dbg_qsize_write()

Mateusz Palczewski <[email protected]>
i40e: Fix add TC filter for IPv6

Andreas Oetken <[email protected]>
nios2: fixed broken sys_clone syscall

Jann Horn <[email protected]>
Take mmap lock in cacheflush syscall

Sylwester Dziedziuch <[email protected]>
i40e: Fix VFs not created

Mateusz Palczewski <[email protected]>
i40e: Fix addition of RX filters after enabling FW LLDP agent

Mateusz Palczewski <[email protected]>
i40e: Fix overwriting flow control settings during driver loading

Mateusz Palczewski <[email protected]>
i40e: Add zero-initialization of AQ command structures

Slawomir Laba <[email protected]>
i40e: Fix flow for IPv6 next header (extension header)

Krzysztof Wilczyński <[email protected]>
PCI: cadence: Fix DMA range mapping early return error

Russell King <[email protected]>
PCI: pci-bridge-emul: Fix array overruns, improve safety

Shiyang Ruan <[email protected]>
device-dax: Fix default return code of range_parse()

Magnum Shan <[email protected]>
mailbox: sprd: correct definition of SPRD_OUTBOX_FIFO_FULL

Geert Uytterhoeven <[email protected]>
ext: EXT4_KUNIT_TESTS should depend on EXT4_FS instead of selecting it

Bard Liao <[email protected]>
regmap: sdw: use _no_pm functions in regmap_read/write

Tzung-Bi Shih <[email protected]>
remoteproc/mediatek: acknowledge watchdog IRQ after handled

Jonathan Marek <[email protected]>
misc: fastrpc: fix incorrect usage of dma_map_sgtable

Pierre-Louis Bossart <[email protected]>
soundwire: bus: fix confusion on device used by pm_runtime

Bard Liao <[email protected]>
soundwire: export sdw_write/read_no_pm functions

Pierre-Louis Bossart <[email protected]>
soundwire: bus: use sdw_write_no_pm when setting the bus scale registers

Pierre-Louis Bossart <[email protected]>
soundwire: bus: use sdw_update_no_pm when initializing a device

Ahmad Fatoum <[email protected]>
nvmem: core: skip child nodes not matching binding

Dan Carpenter <[email protected]>
nvmem: core: Fix a resource leak on error in nvmem_add_cells_from_of()

Suzuki K Poulose <[email protected]>
coresight: etm4x: Skip accessing TRCPDCR in save/restore

Geert Uytterhoeven <[email protected]>
phy: USB_LGM_PHY should depend on X86

Theodore Ts'o <[email protected]>
ext4: fix potential htree index checksum corruption

Max Gurtovoy <[email protected]>
vfio-pci/zdev: fix possible segmentation fault issue

Keqian Zhu <[email protected]>
vfio/iommu_type1: Fix some sanity checks in detach group

Keqian Zhu <[email protected]>
vfio/iommu_type1: Populate full dirty when detach non-pinned group

Judy Hsiao <[email protected]>
drm/msm/dp: trigger unplug event in msm_dp_display_disable

Eric Anholt <[email protected]>
drm/msm: Fix races managing the OOB state for timestamp vs timestamps.

Eric Anholt <[email protected]>
drm/msm: Fix race of GPU init vs timestamp power management.

Iskren Chernev <[email protected]>
drm/msm/mdp5: Fix wait-for-commit for cmd panels

Konrad Dybcio <[email protected]>
drm/msm/dsi: Correct io_start for MSM8994 (20nm PHY)

Iskren Chernev <[email protected]>
drm/msm: Fix MSM_INFO_GET_IOVA with carveout

Alexander Usyskin <[email protected]>
mei: hbm: call mei_set_devstate() on hbm stop response

Heiner Kallweit <[email protected]>
PCI: Align checking of syscall user config accessors

Jorgen Hansen <[email protected]>
VMCI: Use set_page_dirty_lock() when unregistering guest memory

Pan Bian <[email protected]>
PCI: xilinx-cpm: Fix reference count leak on error path

Simon South <[email protected]>
pwm: rockchip: Eliminate potential race condition when probing

Simon South <[email protected]>
pwm: rockchip: rockchip_pwm_probe(): Remove superfluous clk_unprepare()

Simon South <[email protected]>
pwm: rockchip: Enable APB clock during register access while probing

Pierre-Louis Bossart <[email protected]>
soundwire: cadence: fix ACK/NAK handling

Srinivas Kandagatla <[email protected]>
soundwire: debugfs: use controller id instead of link_id

Marek Vasut <[email protected]>
PCI: rcar: Always allocate MSI addresses in 32bit space

Aswath Govindraju <[email protected]>
misc: eeprom_93xx46: Add module alias to avoid breaking support for non device tree users

Dan Carpenter <[email protected]>
phy: cadence-torrent: Fix error code in cdns_torrent_phy_probe()

Chris Ruehl <[email protected]>
phy: rockchip-emmc: emmc_phy_init() always return 0

Aswath Govindraju <[email protected]>
misc: eeprom_93xx46: Fix module alias to enable module autoprobe

Randy Dunlap <[email protected]>
ARM: 9065/1: OABI compat: fix build when EPOLL is not enabled

Dmitry Torokhov <[email protected]>
Input: zinitix - fix return type of zinitix_init_touch()

Randy Dunlap <[email protected]>
sparc: fix led.c driver when PROC_FS is not enabled

Randy Dunlap <[email protected]>
sparc64: only select COMPAT_BINFMT_ELF if BINFMT_ELF is set

Dan Carpenter <[email protected]>
Input: elo - fix an error code in elo_connect()

Namhyung Kim <[email protected]>
perf test: Fix unaligned access in sample parsing test

Adrian Hunter <[email protected]>
perf intel-pt: Fix IPC with CYC threshold

Adrian Hunter <[email protected]>
perf intel-pt: Fix premature IPC

Adrian Hunter <[email protected]>
perf intel-pt: Fix missing CYC processing in PSB

Yang Jihong <[email protected]>
perf record: Fix continue profiling after draining the buffer

Dan Carpenter <[email protected]>
Input: sur40 - fix an error code in sur40_probe()

Jack Wang <[email protected]>
RDMA/rtrs-srv: Do not pass a valid pointer to PTR_ERR()

Gioh Kim <[email protected]>
RDMA/rtrs-srv-sysfs: fix missing put_device

Gioh Kim <[email protected]>
RDMA/rtrs-srv: fix memory leak by missing kobject free

Md Haris Iqbal <[email protected]>
RDMA/rtrs: Only allow addition of path to an already established session

Jack Wang <[email protected]>
RDMA/rtrs-srv: Fix stack-out-of-bounds

Avihai Horon <[email protected]>
RDMA/ucma: Fix use-after-free bug in ucma_create_uevent

Lang Cheng <[email protected]>
RDMA/hns: Fixes missing error code of CMDQ

Jeff Layton <[email protected]>
ceph: fix flush_snap logic after putting caps

Chuck Lever <[email protected]>
svcrdma: Hold private mutex while invoking rdma_accept()

J. Bruce Fields <[email protected]>
nfsd: register pernet ops last, unregister first

Nicholas Fraser <[email protected]>
perf symbols: Fix return value when loading PE DSO

John Ogness <[email protected]>
printk: avoid prb_first_valid_seq() where possible

Nicolas Saenz Julienne <[email protected]>
spi: Skip zero-length transfers in spi_transfer_one_message()

Kees Cook <[email protected]>
spi: dw: Avoid stack content exposure

Matti Vaittinen <[email protected]>
regulator: bd718x7, bd71828, Fix dvs voltage levels

Dmitry Safonov <[email protected]>
perf symbols: Use (long) for iterator for bfd symbols

Tom Zanussi <[email protected]>
selftests/ftrace: Update synthetic event syntax errors

Ryan Chen <[email protected]>
clk: aspeed: Fix APLL calculate formula from ast2600-A2

Jonathan Marek <[email protected]>
regulator: qcom-rpmh: fix pm8009 ldo7

Alexey Kardashevskiy <[email protected]>
powerpc/kuap: Restore AMR after replaying soft interrupts

Alexey Kardashevskiy <[email protected]>
powerpc/uaccess: Avoid might_fault() when user access is enabled

Andy Shevchenko <[email protected]>
spi: pxa2xx: Fix the controller numbering for Wildcat Point

Michael Tretter <[email protected]>
clk: divider: fix initialization with parent_hw

Lijun Ou <[email protected]>
RDMA/hns: Disable RQ inline by default

Weihang Li <[email protected]>
RDMA/hns: Fix type of sq_signal_bits

Kamal Heib <[email protected]>
RDMA/siw: Fix calculation of tx_valid_cpus size

Wenpeng Liang <[email protected]>
RDMA/hns: Fixed wrong judgments in the goto branch

John Stultz <[email protected]>
kselftests: dmabuf-heaps: Fix Makefile's inclusion of the kernel's usr/include dir

Daniel Latypov <[email protected]>
kunit: tool: fix unit test cleanup handling

AngeloGioacchino Del Regno <[email protected]>
clk: qcom: gcc-msm8998: Fix Alpha PLL type for all GPLLs

Christophe Leroy <[email protected]>
powerpc/8xx: Fix software emulation interrupt

Nathan Lynch <[email protected]>
powerpc/pseries/dlpar: handle ibm, configure-connector delay status

Dan Carpenter <[email protected]>
mfd: wm831x-auxadc: Prevent use after free in wm831x_auxadc_read_irq()

Arnd Bergmann <[email protected]>
mfd: altera-sysmgr: Fix physical address storing more

Alain Volmat <[email protected]>
spi: stm32: properly handle 0 byte transfer

Bob Pearson <[email protected]>
RDMA/rxe: Correct skb on loopback path

Bob Pearson <[email protected]>
RDMA/rxe: Fix coding error in rxe_rcv_mcast_pkt

Bob Pearson <[email protected]>
RDMA/rxe: Fix coding error in rxe_recv.c

John Garry <[email protected]>
perf vendor events arm64: Fix Ampere eMag event typo

Arnaldo Carvalho de Melo <[email protected]>
perf tools: Fix DSO filtering when not finding a map for a sampled address

David Gow <[email protected]>
rtc: zynqmp: depend on HAS_IOMEM

Steven Rostedt (VMware) <[email protected]>
tracepoint: Do not fail unregistering a probe due to memory failure

Parav Pandit <[email protected]>
IB/cm: Avoid a loop when device has 255 ports

Parav Pandit <[email protected]>
IB/mlx5: Return appropriate error code instead of ENOMEM

Douglas Anderson <[email protected]>
iommu: Properly pass gfp_t in _iommu_map() to avoid atomic sleeping

Yong Wu <[email protected]>
iommu: Move iotlb_sync_map out from __iommu_map

Uwe Kleine-König <[email protected]>
amba: Fix resource leak for drivers without .remove

Roja Rani Yarubandi <[email protected]>
i2c: i2c-qcom-geni: Add shutdown callback for i2c

Roja Rani Yarubandi <[email protected]>
i2c: qcom-geni: Store DMA mapping data in geni_i2c_dev struct

Vladimir Murzin <[email protected]>
ARM: 9046/1: decompressor: Do not clear SCTLR.nTLSMD for ARMv7+ cores

Takeshi Saito <[email protected]>
mmc: renesas_sdhi_internal_dmac: Fix DMA buffer alignment from 8 to 128-bytes

Christophe JAILLET <[email protected]>
mmc: usdhi6rol0: Fix a resource leak in the error handling path of the probe

Christophe JAILLET <[email protected]>
mmc: sdhci-sprd: Fix some resource leaks in the remove function

Christophe JAILLET <[email protected]>
mmc: owl-mmc: Fix a resource leak in an error handling path and in the remove function

Pingfan Liu <[email protected]>
powerpc/time: Enable sched clock for irqtime

Ananth N Mavinakayanahalli <[email protected]>
powerpc/sstep: Fix incorrect return from analyze_instr()

Christophe Leroy <[email protected]>
powerpc/47x: Disable 256k page size

Cédric Le Goater <[email protected]>
KVM: PPC: Make the VMX instruction emulation routines static

Shay Drory <[email protected]>
IB/umad: Return EPOLLERR in case of when device disassociated

Shay Drory <[email protected]>
IB/umad: Return EIO in case of when device disassociated

Yong Wu <[email protected]>

    iommu: Switch gather->end to the inclusive end

Dan Carpenter <[email protected]>
scsi: lpfc: Fix ancient double free

Josh Poimboeuf <[email protected]>
objtool: Fix ".cold" section suffix check for newer versions of GCC

Josh Poimboeuf <[email protected]>
objtool: Fix retpoline detection in asm code

Josh Poimboeuf <[email protected]>
objtool: Fix error handling for STD/CLD warnings

Geert Uytterhoeven <[email protected]>
auxdisplay: ht16k33: Fix refresh rate handling

Andy Shevchenko <[email protected]>
watchdog: intel-mid_wdt: Postpone IRQ handler registration till SCU is ready

Pan Bian <[email protected]>
isofs: release buffer head before return

Hans de Goede <[email protected]>
regulator: core: Avoid debugfs: Directory ... already present! error

Dmitry Osipenko <[email protected]>
power: supply: smb347-charger: Fix interrupt usage if interrupt is unavailable

Samuel Holland <[email protected]>

    power: supply: axp20x_usb_power: Init work before enabling IRQs

Krzysztof Kozlowski <[email protected]>
regulator: s5m8767: Drop regulators OF node reference

Pan Bian <[email protected]>
spi: atmel: Put allocated master before return

Pan Bian <[email protected]>
regulator: s5m8767: Fix reference count leak

David Howells <[email protected]>
certs: Fix blacklist flag type confusion

Gabriel Krisman Bertazi <[email protected]>
watch_queue: Drop references to /dev/watch_queue

Pan Bian <[email protected]>

    regulator: axp20x: Fix reference cout leak

Evan Benn <[email protected]>
platform/chrome: cros_ec_proto: Add LID and BATTERY to default mask

Evan Benn <[email protected]>
platform/chrome: cros_ec_proto: Use EC_HOST_EVENT_MASK not BIT

Andre Przywara <[email protected]>
clk: sunxi-ng: h6: Fix clock divider range on some clocks

Parav Pandit <[email protected]>
IB/mlx5: Add mutex destroy call to cap_mask_mutex mutex

Yishai Hadas <[email protected]>
RDMA/mlx5: Use the correct obj_id upon DEVX TIR creation

Guido Günther <[email protected]>
spi: imx: Don't print error on -EPROBEDEFER

Tom Rix <[email protected]>
clocksource/drivers/mxs_timer: Add missing semicolon when DEBUG is defined

Arnd Bergmann <[email protected]>
clocksource/drivers/ixp4xx: Select TIMER_OF when needed

Randy Dunlap <[email protected]>
power: supply: fix sbs-charger build, needs REGMAP_I2C

Dave Jiang <[email protected]>
dmaengine: idxd: set DMA channel to be private

Bartosz Golaszewski <[email protected]>
rtc: s5m: select REGMAP_I2C

Claudiu Beznea <[email protected]>
power: reset: at91-sama5d2_shdwc: fix wkupdbc mask

Jack Wang <[email protected]>
RDMA/rtrs-srv: Init wr_cnt as 1

Guoqing Jiang <[email protected]>
RDMA/rtrs-clt: Refactor the failure cases in alloc_clt

Jack Wang <[email protected]>
RDMA/rtrs-srv: Fix missing wr_cqe

Guoqing Jiang <[email protected]>
RDMA/rtrs: Call kobject_put in the failure path

Jack Wang <[email protected]>
RDMA/rtrs-clt: Set mininum limit when create QP

Jack Wang <[email protected]>
RDMA/rtrs-srv: Use sysfs_remove_file_self for disconnect

Jack Wang <[email protected]>
RDMA/rtrs-srv: Release lock before call into close_sess

Jack Wang <[email protected]>
RDMA/rtrs: Extend ibtrs_cq_qp_create

Nicolas Boichat <[email protected]>
of/fdt: Make sure no-map does not remove already reserved regions

KarimAllah Ahmed <[email protected]>
fdt: Properly handle "no-map" field in the memory region

Colin Ian King <[email protected]>
power: supply: cpcap-charger: Fix power_supply_put on null battery pointer

Tony Lindgren <[email protected]>
power: supply: cpcap-battery: Fix missing power_supply_put()

Tony Lindgren <[email protected]>
power: supply: cpcap-charger: Fix missing power_supply_put()

Yoshihiro Shimoda <[email protected]>

    mfd: bd9571mwv: Use devm_mfd_add_devices()

Ferry Toth <[email protected]>
dmaengine: hsu: disable spurious interrupt

Christophe JAILLET <[email protected]>
dmaengine: owl-dma: Fix a resource leak in the remove function

Christophe JAILLET <[email protected]>
dmaengine: fsldma: Fix a resource leak in an error handling path of the probe function

Christophe JAILLET <[email protected]>
dmaengine: fsldma: Fix a resource leak in the remove function

Bernard Metzler <[email protected]>
RDMA/siw: Fix handling of zero-sized Read and Receive Queues.

Randy Dunlap <[email protected]>
HID: core: detect and skip invalid inputs to snto32()

Geert Uytterhoeven <[email protected]>
clk: renesas: r8a779a0: Fix parent of CBFUSA clock

Geert Uytterhoeven <[email protected]>
clk: renesas: r8a779a0: Remove non-existent S2 clock

Andre Przywara <[email protected]>
clk: sunxi-ng: h6: Fix CEC clock

Pratyush Yadav <[email protected]>
spi: cadence-quadspi: Abort read if dummy cycles required are too many

Rayagonda Kokatanur <[email protected]>
i2c: iproc: handle master read request

Rayagonda Kokatanur <[email protected]>
i2c: iproc: update slave isr mask (ISR_MASK_SLAVE)

Rayagonda Kokatanur <[email protected]>
i2c: iproc: handle only slave interrupts which are enabled

Jan Kara <[email protected]>
quota: Fix memory leak when handling corrupted quota file

Dmitry Baryshkov <[email protected]>

    arm64: dts: qcom: qrb5165-rb5: fix pm8009 regulators

Dmitry Baryshkov <[email protected]>
regulator: qcom-rpmh-regulator: add pm8009-1 chip revision

Po-Hsu Lin <[email protected]>
selftests/powerpc: Make the test check in eeh-basic.sh posix compliant

Martin Blumenstingl <[email protected]>
clk: meson: clk-pll: propagate the error from meson_clk_pll_set_rate()

Martin Blumenstingl <[email protected]>
clk: meson: clk-pll: make "ret" a signed integer

Martin Blumenstingl <[email protected]>
clk: meson: clk-pll: fix initializing the old rate (fallback) for a PLL

Tony Lindgren <[email protected]>
power: supply: cpcap: Add missing IRQF_ONESHOT to fix regression

Zhang Qilong <[email protected]>
HSI: Fix PM usage counter unbalance in ssi_hw_init

Eric W. Biederman <[email protected]>
capabilities: Don't allow writing ambiguous v3 file capabilities

Nirmoy Das <[email protected]>
drm/amdgpu/display: remove hdcp_srm sysfs on device removal

Sebastian Andrzej Siewior <[email protected]>
smp: Process pending softirqs in flush_smp_call_function_from_idle()

Geert Uytterhoeven <[email protected]>
irqchip/imx: IMX_INTMUX should not default to y, unconditionally

Wang ShaoBo <[email protected]>
ubifs: Fix error return code in alloc_wbufs()

Arnd Bergmann <[email protected]>
ubifs: replay: Fix high stack usage, again

Dinghao Liu <[email protected]>
ubifs: Fix memleak in ubifs_init_authentication

Tom Rix <[email protected]>
jffs2: fix use after free in jffs2_sum_write_data()

Colin Ian King <[email protected]>
fs/jfs: fix potential integer overflow on shift of a int

Sameer Pujar <[email protected]>
ASoC: simple-card-utils: Fix device module clock

Lakshmi Ramasubramanian <[email protected]>
ima: Free IMA measurement buffer after kexec syscall

Lakshmi Ramasubramanian <[email protected]>
ima: Free IMA measurement buffer on error

Pierre-Louis Bossart <[email protected]>
ASoC: SOF: sof-pci-dev: add missing Up-Extreme quirk

Chaitanya Kulkarni <[email protected]>
nvmet: set status to 0 in case for invalid nsid

Chaitanya Kulkarni <[email protected]>
nvmet: remove extra variable in identify ns

Keith Busch <[email protected]>
nvme-multipath: set nr_zones for zoned namespaces

Sagi Grimberg <[email protected]>
nvmet-tcp: fix potential race of tcp socket closing accept_work

Sagi Grimberg <[email protected]>
nvmet-tcp: fix receive data digest calculation for multiple h2cdata PDUs

Hao Xu <[email protected]>
io_uring: fix possible deadlock in io_uring_poll

Daniele Alessandrelli <[email protected]>
crypto: ecdh_helper - Ensure 'len >= secret.len' in decode_key()

Jan Henrik Weinstock <[email protected]>
hwrng: timeriomem - Fix cooldown period calculation

Imre Deak <[email protected]>
drm/dp_mst: Don't cache EDIDs for physical ports

Qinglang Miao <[email protected]>
drm/lima: fix reference leak in lima_pm_busy

Maxime Ripard <[email protected]>
drm/vc4: hdmi: Update the CEC clock divider on HSM rate change

Maxime Ripard <[email protected]>
drm/vc4: hdmi: Compute the CEC clock divider from the clock rate

Dom Cobley <[email protected]>
drm/vc4: hdmi: Restore cec physical address on reconnect

Dom Cobley <[email protected]>
drm/vc4: hdmi: Fix up CEC registers

Dom Cobley <[email protected]>
drm/vc4: hdmi: Fix register offset with longer CEC messages

Dom Cobley <[email protected]>
drm/vc4: hdmi: Move hdmi reset to bind

Harald Freudenberger <[email protected]>
s390/zcrypt: return EIO when msg retry limit reached

Sean Christopherson <[email protected]>
KVM: x86: Restore all 64 bits of DR6 and DR7 during RSM on x86-64

Qu Wenruo <[email protected]>
btrfs: fix double accounting of ordered extent for subpage case in btrfs_invalidapge

Zhihao Cheng <[email protected]>
btrfs: clarify error returns values in __load_free_space_cache

Hui Wang <[email protected]>
ASoC: SOF: debug: Fix a potential issue on string buffer termination

Sathyanarayana Nujella <[email protected]>
ASoC: rt5682: Fix panic in rt5682_jack_detect_handler happening during system shutdown

Jun Nie <[email protected]>
ASoC: qcom: lpass: Fix i2s ctl register bit map

Peter Zijlstra <[email protected]>
locking/lockdep: Avoid unmatched unlock

Pierre-Louis Bossart <[email protected]>
ASoC: Intel: sof_sdw: add missing TGL_HDMI quirk for Dell SKU 0A3E

Pierre-Louis Bossart <[email protected]>
ASoC: Intel: sof_sdw: add missing TGL_HDMI quirk for Dell SKU 0A5E

Andrea Parri (Microsoft) <[email protected]>
Drivers: hv: vmbus: Avoid use-after-free in vmbus_onoffer_rescind()

Sasha Levin <[email protected]>
drm/mediatek: Fix aal size config

Yongqiang Niu <[email protected]>
drm/mediatek: Check if fb is null

Sean Christopherson <[email protected]>
KVM: nSVM: Don't strip host's C-bit from guest's CR3 when reading PDPTRs

Srinivasa Rao Mandadapu <[email protected]>
ASoC: qcom: Fix typo error in HDMI regmap config callbacks

Dehe Gu <[email protected]>
f2fs: fix a wrong condition in __submit_bio

Dan Carpenter <[email protected]>
drm/amdgpu: Prevent shift wrapping in amdgpu_read_mask()

Yi Chen <[email protected]>
f2fs: fix to avoid inconsistent quota data

Manivannan Sadhasivam <[email protected]>
mtd: parsers: afs: Fix freeing the part name memory in failure

Srinivas Kandagatla <[email protected]>
ASoC: codecs: add missing max_register in regmap config

Sebastian Reichel <[email protected]>
ASoC: cpcap: fix microphone timeslot mask

Florian Fainelli <[email protected]>
ata: ahci_brcm: Add back regulators management

Will Deacon <[email protected]>
mm: proc: Invalidate TLB after clearing soft-dirty page state

Frantisek Hrbata <[email protected]>
drm/nouveau: bail out of nouveau_channel_new if channel init fails

Christophe Leroy <[email protected]>
crypto: talitos - Fix ctr(aes) on SEC1

Christophe Leroy <[email protected]>
crypto: talitos - Work around SEC6 ERRATA (AES-CTR mode data size error)

Dan Carpenter <[email protected]>
mtd: parser: imagetag: fix error codes in bcm963xx_parse_imagetag_partitions()

Robin Murphy <[email protected]>
perf/arm-cmn: Move IRQs when migrating context

Robin Murphy <[email protected]>
perf/arm-cmn: Fix PMU instance naming

Ranjani Sridharan <[email protected]>
ASoC: SOF: Intel: hda: cancel D0i3 work during runtime suspend

Srinivasa Rao Mandadapu <[email protected]>
ASoC: qcom: lpass-cpu: Remove bit clock state check

Chao Yu <[email protected]>
f2fs: compress: fix potential deadlock

Qais Yousef <[email protected]>
sched/eas: Don't update misfit status if the task is pinned

Laurent Pinchart <[email protected]>
media: uvcvideo: Accept invalid bFormatIndex and bFrameIndex values

Tom Rix <[email protected]>
media: pxa_camera: declare variable when DEBUG is defined

Tom Rix <[email protected]>
media: mtk-vcodec: fix argument used when DEBUG is defined

Christophe JAILLET <[email protected]>
media: cx25821: Fix a bug when reallocating some dma memory

Luo Meng <[email protected]>

    media: qm1d1c0042: fix error return code in qm1d1c0042_init()

Dan Carpenter <[email protected]>
media: atomisp: Fix a buffer overflow in debug code

Daniel W. S. Almeida <[email protected]>
media: vidtv: psi: fix missing crc for PMT

Joe Perches <[email protected]>
media: lmedm04: Fix misuse of comma

Daniel Scally <[email protected]>
media: software_node: Fix refcounts in software_node_get_next_child()

Mario Kleiner <[email protected]>
drm/amd/display: Fix HDMI deep color output for DCE 6-11.

Mario Kleiner <[email protected]>
drm/amd/display: Fix 10/12 bpc setup in DCE output bit depth reduction.

Finn Thain <[email protected]>
macintosh/adb-iop: Use big-endian autopoll mask

Pan Bian <[email protected]>
bsg: free the request before return error code

Guchun Chen <[email protected]>
drm/amdgpu: toggle on DF Cstate after finishing xgmi injection

Qinglang Miao <[email protected]>
drm/tegra: Fix reference leak when pm_runtime_get_sync() fails

Nathan Chancellor <[email protected]>
MIPS: Compare __SYNC_loongson3_war against 0

Alexander Lobakin <[email protected]>
MIPS: properly stop .eh_frame generation

Tomi Valkeinen <[email protected]>
media: ti-vpe: cal: fix write to unallocated memory

Rui Miguel Silva <[email protected]>
media: imx7: csi: Fix pad link validation

Fabio Estevam <[email protected]>
media: imx7: csi: Fix regression for parallel cameras on i.MX6UL

Giulio Benetti <[email protected]>
drm/sun4i: tcon: fix inverted DCLK polarity

Xuewen Yan <[email protected]>
sched/fair: Avoid stale CPU util_est value for schedutil in task dequeue

Jiri Olsa <[email protected]>
crypto: bcm - Rename struct device_private to bcm_device_private

Dinghao Liu <[email protected]>
evm: Fix memleak in init_desc

Stephan Gerhold <[email protected]>
ASoC: qcom: qdsp6: Move frontend AIFs to q6asm-dai

Dan Carpenter <[email protected]>
ASoC: cs42l56: fix up error handling in probe

Zhang Changzhong <[email protected]>
media: aspeed: fix error return code in aspeed_video_setup_video()

Dinghao Liu <[email protected]>
media: tm6000: Fix memleak in tm6000_start_stream

Dinghao Liu <[email protected]>
media: media/pci: Fix memleak in empress_init

Dinghao Liu <[email protected]>
media: em28xx: Fix use-after-free in em28xx_alloc_urbs

Christophe JAILLET <[email protected]>
media: vsp1: Fix an error handling path in the probe function

Dan Carpenter <[email protected]>
media: camss: missing error code in msm_video_register()

Zhang Changzhong <[email protected]>
media: mtk-vcodec: fix error return code in vdec_vp9_decode()

Ezequiel Garcia <[email protected]>
media: imx: Fix csc/scaler unregister

Ezequiel Garcia <[email protected]>
media: imx: Unregister csc/scaler only if registered

Jacopo Mondi <[email protected]>
media: i2c: ov5670: Fix PIXEL_RATE minimum value

Andy Shevchenko <[email protected]>
media: ipu3-cio2: Build only for x86

Simon Ser <[email protected]>
drm/fourcc: fix Amlogic format modifier masks

Chia-I Wu <[email protected]>
drm/virtio: make sure context is created in gem open

Nathan Chancellor <[email protected]>
MIPS: lantiq: Explicitly compare LTQ_EBU_PCC_ISTAT against 0

Nathan Chancellor <[email protected]>
MIPS: c-r4k: Fix section mismatch for loongson2_sc_init

Chenyang Li <[email protected]>
drm/amdgpu: Fix macro name _AMDGPU_TRACE_H_ in preprocessor if condition

Laurent Pinchart <[email protected]>
drm: rcar-du: Fix leak of CMM platform device reference

Wang Xiaojun <[email protected]>
drm: rcar-du: Fix the return check of of_parse_phandle and of_find_device_by_node

Laurent Pinchart <[email protected]>
drm: rcar-du: Fix crash when using LVDS1 clock for CRTC

Qinglang Miao <[email protected]>
drm: rcar-du: Fix PM reference leak in rcar_cmm_enable()

Marco Elver <[email protected]>
kcsan: Rewrite kcsan_prandom_u32_max() without prandom_u32_state()

Dan Carpenter <[email protected]>
media: allegro: Fix use after free on error

Christophe JAILLET <[email protected]>
hwrng: ingenic - Fix a resource leak in an error handling path

Ard Biesheuvel <[email protected]>
crypto: arm64/aes-ce - really hide slower algos when faster ones are enabled

Corentin Labbe <[email protected]>
crypto: sun4i-ss - fix kmap usage

Corentin Labbe <[email protected]>
crypto: sun4i-ss - linearize buffers content must be kept

Maxime Ripard <[email protected]>
drm/vc4: hdmi: Take into account the clock doubling flag in atomic_check

Guido Günther <[email protected]>
drm/panel: mantix: Tweak init sequence

Chuhong Yuan <[email protected]>
drm/fb-helper: Add missed unlocks in setcmap_legacy()

Dan Carpenter <[email protected]>
gma500: clean up error handling in init

Jialin Zhang <[email protected]>
drm/gma500: Fix error return code in psb_driver_load()

Randy Dunlap <[email protected]>
fbdev: aty: SPARC64 requires FB_ATY_CT

Linus Torvalds <[email protected]>
tty: implement read_iter

Linus Torvalds <[email protected]>
tty: convert tty_ldisc_ops 'read()' function to take a kernel pointer

Vladimir Oltean <[email protected]>
net: enetc: fix destroyed phylink dereference during unbind

Maxime Chevallier <[email protected]>
net: mvneta: Remove per-cpu queue mapping for Armada 3700

Shyam Sundar S K <[email protected]>
net: amd-xgbe: Fix network fluctuations when using 1G BELFUSE SFP

Shyam Sundar S K <[email protected]>
net: amd-xgbe: Reset link when the link never comes back

Shyam Sundar S K <[email protected]>
net: amd-xgbe: Fix NETDEV WATCHDOG transmit queue timeout warning

Shyam Sundar S K <[email protected]>
net: amd-xgbe: Reset the PHY rx data path when mailbox command timeout

Bjarni Jonasson <[email protected]>
net: phy: mscc: adding LCPLL reset to VSC8514

Vladimir Oltean <[email protected]>
net: dsa: felix: don't deinitialize unused ports

Vladimir Oltean <[email protected]>
net: dsa: felix: perform teardown in reverse order of setup

Lijun Pan <[email protected]>
ibmvnic: skip send_request_unmap for timeout reset

Lijun Pan <[email protected]>
ibmvnic: add memory barrier to protect long term buffer

Ilya Leoshkevich <[email protected]>
bpf: Clear subreg_def for global function return values

Colin Ian King <[email protected]>
b43: N-PHY: Fix the update of coef for the PHY revision >= 3case

Ayush Sawal <[email protected]>
cxgb4/chtls/cxgbit: Keeping the max ofld immediate data size same in cxgb4 and ulds

Robert Hancock <[email protected]>
net: axienet: Handle deferred probe on clock properly

Eric Dumazet <[email protected]>
tcp: fix SO_RCVLOWAT related hangs under mem pressure

Matthieu Baerts <[email protected]>
selftests: mptcp: fix ACKRX debug message

Jesper Dangaard Brouer <[email protected]>
bpf: Fix bpf_fib_lookup helper MTU check for SKB ctx

Jun'ichi Nomura <[email protected]>
bpf, devmap: Use GFP_KERNEL for xdp bulk queue allocation

Yonghong Song <[email protected]>
bpf: Fix an unitialized value in bpf_iter

Martin KaFai Lau <[email protected]>
libbpf: Ignore non function pointer member in struct_ops

Colin Ian King <[email protected]>
mac80211: fix potential overflow when multiplying to u32 integers

Moshe Shemesh <[email protected]>
net/mlx5e: Check tunnel offload is required before setting SWP

Oz Shlomo <[email protected]>
net/mlx5e: CT: manage the lifetime of the ct entry object

Shay Drory <[email protected]>
net/mlx5: Disable devlink reload for lag devices

Shay Drory <[email protected]>
net/mlx5: Disallow RoCE on lag device

Shay Drory <[email protected]>
net/mlx5: Disallow RoCE on multi port slave device

Shay Drory <[email protected]>
net/mlx5: Disable devlink reload for multi port slave device

Maxim Mikityanskiy <[email protected]>
net/mlx5e: kTLS, Use refcounts to free kTLS RX priv context

Maxim Mikityanskiy <[email protected]>
net/mlx5e: Replace synchronize_rcu with synchronize_net

Shay Drory <[email protected]>
net/mlx5: Fix health error state handling

Maxim Mikityanskiy <[email protected]>
net/mlx5e: Change interrupt moderation channel params also when channels are closed

Maxim Mikityanskiy <[email protected]>
net/mlx5e: Don't change interrupt moderation params when DIM is enabled

Heiner Kallweit <[email protected]>
net: phy: consider that suspend2ram may cut off PHY power

Ioana Ciornei <[email protected]>
dpaa2-eth: fix memory leak in XDP_REDIRECT

Juergen Gross <[email protected]>
xen/netback: fix spurious event detection for common event case

Vasundhara Volam <[email protected]>
bnxt_en: Fix devlink info's stored fw.psid version format.

Edwin Peer <[email protected]>
bnxt_en: reverse order of TX disable and carrier off

Sukadev Bhattiprolu <[email protected]>
ibmvnic: Set to CLOSED state even on error

Björn Töpel <[email protected]>
selftests/bpf: Convert test_xdp_redirect.sh to bash

Linus Lüssing <[email protected]>
ath9k: fix data bus crash when setting nf_override via debugfs

Luca Coelho <[email protected]>
iwlwifi: pnvm: increment the pointer before checking the TLV

Luca Coelho <[email protected]>
iwlwifi: pnvm: set the PNVM again if it was already loaded

Marco Elver <[email protected]>
bpf_lru_list: Read double-checked variable once without lock

Sara Sharon <[email protected]>
iwlwifi: mvm: don't check if CSA event is running before removing

Luca Coelho <[email protected]>
iwlwifi: mvm: assign SAR table revision to the command later

Luca Coelho <[email protected]>
iwlwifi: mvm: send stored PPAG command instead of local

Luca Coelho <[email protected]>
iwlwifi: mvm: store PPAG enabled/disabled flag properly

Luca Coelho <[email protected]>
iwlwifi: mvm: fix the type we use in the PPAG table validity checks

Jae Hyun Yoo <[email protected]>
soc: aspeed: snoop: Add clock control logic

Dan Carpenter <[email protected]>
ath11k: fix a locking bug in ath11k_mac_op_start()

Anand K Mistry <[email protected]>
ath10k: Fix lockdep assertion warning in ath10k_sta_statistics

Anand K Mistry <[email protected]>
ath10k: Fix suspicious RCU usage warning in ath10k_wmi_tlv_parse_peer_stats_info()

Arnd Bergmann <[email protected]>
ARM: at91: use proper asm syntax in pm_suspend

Jérôme Pouiller <[email protected]>
staging: wfx: fix possible panic with re-queued frames

Arnd Bergmann <[email protected]>
optee: simplify i2c access

Arnd Bergmann <[email protected]>
ARM: s3c: fix fiq for clang IAS

Luca Coelho <[email protected]>
iwlwifi: mvm: set enabled in the PPAG command properly

Artem Lapkin <[email protected]>
arm64: dts: meson: fix broken wifi node for Khadas VIM3L

Vincent Knecht <[email protected]>
arm64: dts: msm8916: Fix reserved and rfsa nodes unit address

Luca Weiss <[email protected]>
soc: qcom: ocmem: don't return NULL in of_get_ocmem

Jupeng Zhong <[email protected]>
Bluetooth: btusb: Fix memory leak in btusb_mtk_wmt_recv

Dmitry Osipenko <[email protected]>
opp: Correct debug message in _opp_add_static_v2()

Marek Behún <[email protected]>
arm64: dts: armada-3720-turris-mox: rename u-boot mtd partition to a53-firmware

Rosen Penev <[email protected]>
ARM: dts: armada388-helios4: assign pinctrl to each fan

Rosen Penev <[email protected]>
ARM: dts: armada388-helios4: assign pinctrl to LEDs

Marc Kleine-Budde <[email protected]>
can: mcp251xfd: mcp251xfd_probe(): fix errata reference

Geert Uytterhoeven <[email protected]>
arm64: dts: renesas: beacon: Fix EEPROM compatible value

Misono Tomohiro <[email protected]>
x86/MSR: Filter MSR writes through X86_IOC_WRMSR_REGS ioctl too

Chen-Yu Tsai <[email protected]>
staging: rtl8723bs: wifi_regd.c: Fix incorrect number of regulatory rules

Guenter Roeck <[email protected]>
usb: dwc2: Make "trimming xfer length" a debug message

Guenter Roeck <[email protected]>
usb: dwc2: Abort transaction after errors with unknown reason

Guenter Roeck <[email protected]>
usb: dwc2: Do not update data length if it is 0 on inbound transfers

Tony Lindgren <[email protected]>
ARM: dts: Configure missing thermal interrupt for 4430

Pan Bian <[email protected]>
memory: ti-aemif: Drop child node when jumping out loop

Pan Bian <[email protected]>
Bluetooth: Put HCI device if inquiry procedure interrupts

Pan Bian <[email protected]>
Bluetooth: drop HCI device reference before return

Borislav Petkov <[email protected]>
staging: media: atomisp: Fix size_t format specifier in hmm_alloc() debug statemenet

Christophe JAILLET <[email protected]>
soc: ti: pm33xx: Fix some resource leak in the error handling paths of the probe function

Dan Carpenter <[email protected]>
soc: qcom: socinfo: Fix an off by one in qcom_show_pmic_model()

Robert Foss <[email protected]>

    arm64: dts: qcom: sdm845-db845c: Fix reset-pin of ov8856 node

Jack Pham <[email protected]>
usb: gadget: u_audio: Free requests only after callback

Maximilian Luz <[email protected]>
ACPICA: Fix exception code class checks

Chen-Yu Tsai <[email protected]>
arm64: dts: rockchip: rk3328: Add clock_in_out property to gmac2phy node

Christophe JAILLET <[email protected]>

    cpufreq: brcmstb-avs-cpufreq: Fix resource leaks in ->remove()

Christophe JAILLET <[email protected]>
cpufreq: brcmstb-avs-cpufreq: Free resources in error path

Stephan Gerhold <[email protected]>

    arm64: dts: qcom: msm8916-samsung-a2015: Fix sensors

Andre Przywara <[email protected]>
arm64: dts: allwinner: A64: Limit MMC2 bus frequency to 150 MHz

Andre Przywara <[email protected]>
arm64: dts: allwinner: H6: Allow up to 150 MHz MMC bus frequency

Andre Przywara <[email protected]>
arm64: dts: allwinner: Drop non-removable from SoPine/LTS SD card

Andre Przywara <[email protected]>
arm64: dts: allwinner: H6: properly connect USB PHY to port 0

Andre Przywara <[email protected]>
arm64: dts: allwinner: A64: properly connect USB PHY to port 0

Cristian Marussi <[email protected]>
firmware: arm_scmi: Fix call site of scmi_notification_exit

Andrii Nakryiko <[email protected]>
bpf: Avoid warning when re-casting __bpf_call_base into __bpf_call_base_args

Andrii Nakryiko <[email protected]>
bpf: Add bpf_patch_call_args prototype to include/linux/bpf.h

Martin Blumenstingl <[email protected]>
net: stmmac: dwmac-meson8b: fix enabling the timing-adjustment clock

Stephan Gerhold <[email protected]>
arm64: dts: qcom: msm8916-samsung-a5u: Fix iris compatible

Phil Elwell <[email protected]>
staging: vchiq: Fix bulk transfers on 64-bit builds

Phil Elwell <[email protected]>
staging: vchiq: Fix bulk userdata handling

Dinghao Liu <[email protected]>
Bluetooth: hci_qca: Fix memleak in qca_controller_memdump

Zhang Qilong <[email protected]>
memory: mtk-smi: Fix PM usage counter unbalance in mtk_smi ops

Krzysztof Kozlowski <[email protected]>
arm64: dts: exynos: correct PMIC interrupt trigger level on Espresso

Krzysztof Kozlowski <[email protected]>
arm64: dts: exynos: correct PMIC interrupt trigger level on TM2

Krzysztof Kozlowski <[email protected]>
ARM: dts: exynos: correct PMIC interrupt trigger level on Odroid XU3 family

Krzysztof Kozlowski <[email protected]>
ARM: dts: exynos: correct PMIC interrupt trigger level on Arndale Octa

Krzysztof Kozlowski <[email protected]>
ARM: dts: exynos: correct PMIC interrupt trigger level on Spring

Krzysztof Kozlowski <[email protected]>
ARM: dts: exynos: correct PMIC interrupt trigger level on Rinato

Krzysztof Kozlowski <[email protected]>
ARM: dts: exynos: correct PMIC interrupt trigger level on Monk

Krzysztof Kozlowski <[email protected]>
ARM: dts: exynos: correct PMIC interrupt trigger level on Artik 5

Adam Ford <[email protected]>
arm64: dts: renesas: beacon: Fix audio-1.8V pin enable

Adam Ford <[email protected]>
arm64: dts: renesas: beacon kit: Fix choppy Bluetooth Audio

Christopher William Snowhill <[email protected]>
Bluetooth: Fix initializing response id after clearing struct

Claire Chang <[email protected]>
Bluetooth: hci_uart: Fix a race for write_work scheduling

Christophe JAILLET <[email protected]>
Bluetooth: btqcomsmd: Fix a resource leak in error handling paths in the probe function

Rakesh Pillai <[email protected]>
ath10k: Fix error handling in case of CE pipe init failure

Chris Wilson <[email protected]>
drm/i915/gt: One more flush for Baytrail clear residuals

Takashi Iwai <[email protected]>
ALSA: pcm: Don't call sync_stop if it hasn't been stopped

Takashi Iwai <[email protected]>
ALSA: pcm: Assure sync with the pending stop operation at suspend

Takashi Iwai <[email protected]>
ALSA: pcm: Call sync_stop at disconnection

Eric Biggers <[email protected]>
random: fix the RNDRESEEDCRNG ioctl

Nathan Chancellor <[email protected]>
vmlinux.lds.h: Define SANTIZER_DISCARDS with CONFIG_GCOV_KERNEL=y

Alexander Lobakin <[email protected]>
MIPS: vmlinux.lds.S: add missing PAGE_ALIGNED_DATA() section

Takashi Iwai <[email protected]>
ALSA: usb-audio: Fix PCM buffer allocation in non-vmalloc mode

Jan Kara <[email protected]>
bfq: Avoid false bfq queue merging

Hans de Goede <[email protected]>
virt: vbox: Do not use wait_event_interruptible when called from kernel context

Ard Biesheuvel <[email protected]>
PCI: Decline to resize resources if boot config must be preserved

Ansuel Smith <[email protected]>
PCI: qcom: Use PHY_REFCLK_USE_PAD only for ipq8064

Ivan Zaentsev <[email protected]>
w1: w1_therm: Fix conversion result for negative temperatures

Sumit Garg <[email protected]>
kdb: Make memory allocations more robust

Quinn Tran <[email protected]>
scsi: qla2xxx: Fix mailbox Ch erroneous error

Ahmed S. Darwish <[email protected]>
scsi: libsas: docs: Remove notify_ha_event()

Greg Kroah-Hartman <[email protected]>
debugfs: do not attempt to create a new file before the filesystem is initalized

Greg Kroah-Hartman <[email protected]>
debugfs: be more robust at handling improper input in debugfs_lookup()

Stefano Garzarella <[email protected]>
vdpa/mlx5: fix param validation in mlx5_vdpa_get_config()

Nick Desaulniers <[email protected]>
vmlinux.lds.h: add DWARF v5 sections

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

Diffstat:

 Documentation/admin-guide/perf/arm-cmn.rst         |   2 +-
 Documentation/admin-guide/sysctl/vm.rst            |  10 +-
 Documentation/filesystems/seq_file.rst             |   6 +
 Documentation/scsi/libsas.rst                      |   1 -
 Documentation/security/keys/core.rst               |   4 +-
 Makefile                                           |   4 +-
 arch/arm/boot/compressed/head.S                    |   4 +-
 arch/arm/boot/dts/armada-388-helios4.dts           |  28 +-
 arch/arm/boot/dts/exynos3250-artik5.dtsi           |   2 +-
 arch/arm/boot/dts/exynos3250-monk.dts              |   2 +-
 arch/arm/boot/dts/exynos3250-rinato.dts            |   2 +-
 arch/arm/boot/dts/exynos5250-spring.dts            |   2 +-
 arch/arm/boot/dts/exynos5420-arndale-octa.dts      |   2 +-
 arch/arm/boot/dts/exynos5422-odroid-core.dtsi      |   2 +-
 arch/arm/boot/dts/omap443x.dtsi                    |   2 +
 arch/arm/kernel/sys_oabi-compat.c                  |  15 +
 arch/arm/mach-at91/pm_suspend.S                    |   2 +-
 arch/arm/mach-ixp4xx/Kconfig                       |   1 -
 arch/arm/mach-s3c/irq-s3c24xx-fiq.S                |   9 +-
 arch/arm64/Kconfig                                 |   2 +-
 .../boot/dts/allwinner/sun50i-a64-pinebook.dts     |   5 +-
 .../boot/dts/allwinner/sun50i-a64-sopine.dtsi      |   1 -
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi      |   6 +-
 arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi       |   7 +
 .../boot/dts/amlogic/meson-sm1-khadas-vim3l.dts    |   7 +-
 .../boot/dts/exynos/exynos5433-tm2-common.dtsi     |   2 +-
 arch/arm64/boot/dts/exynos/exynos7-espresso.dts    |   2 +-
 arch/arm64/boot/dts/intel/socfpga_agilex.dtsi      |   4 +-
 .../boot/dts/marvell/armada-3720-turris-mox.dts    |   2 +-
 arch/arm64/boot/dts/mediatek/mt7622.dtsi           |   2 +
 .../dts/qcom/msm8916-samsung-a2015-common.dtsi     |   6 +
 .../boot/dts/qcom/msm8916-samsung-a5u-eur.dts      |   2 +-
 arch/arm64/boot/dts/qcom/msm8916.dtsi              |   4 +-
 arch/arm64/boot/dts/qcom/qrb5165-rb5.dts           |   9 +-
 arch/arm64/boot/dts/qcom/sdm845-db845c.dts         |   4 +-
 .../boot/dts/renesas/beacon-renesom-baseboard.dtsi |   2 +-
 .../arm64/boot/dts/renesas/beacon-renesom-som.dtsi |   4 +-
 arch/arm64/boot/dts/rockchip/rk3328.dtsi           |   1 +
 arch/arm64/crypto/aes-glue.c                       |   4 +-
 arch/arm64/crypto/sha1-ce-glue.c                   |   1 +
 arch/arm64/crypto/sha2-ce-glue.c                   |   2 +
 arch/arm64/crypto/sha3-ce-glue.c                   |   4 +
 arch/arm64/crypto/sha512-ce-glue.c                 |   2 +
 arch/arm64/include/asm/module.lds.h                |   6 +-
 arch/arm64/kernel/cpufeature.c                     |   2 +-
 arch/arm64/kernel/head.S                           |   1 +
 arch/arm64/kernel/machine_kexec_file.c             |   4 +-
 arch/arm64/kernel/probes/uprobes.c                 |   2 +-
 arch/arm64/kernel/ptrace.c                         |   2 +-
 arch/arm64/kernel/suspend.c                        |   2 +-
 arch/csky/kernel/ptrace.c                          |   2 +-
 arch/mips/Makefile                                 |  19 ++
 arch/mips/cavium-octeon/setup.c                    |   9 +-
 arch/mips/include/asm/asm.h                        |  18 ++
 arch/mips/include/asm/atomic.h                     |   2 +-
 arch/mips/include/asm/cmpxchg.h                    |   6 +-
 arch/mips/kernel/cpu-probe.c                       |  15 +-
 arch/mips/kernel/vmlinux.lds.S                     |   2 +-
 arch/mips/lantiq/irq.c                             |   2 +-
 arch/mips/loongson64/Platform                      |  22 --
 arch/mips/mm/c-r4k.c                               |   2 +-
 arch/mips/vdso/Makefile                            |   5 +-
 arch/nios2/kernel/entry.S                          |   3 +
 arch/nios2/kernel/sys_nios2.c                      |  11 +-
 arch/powerpc/Kconfig                               |   2 +-
 arch/powerpc/include/asm/kexec.h                   |   1 +
 arch/powerpc/include/asm/uaccess.h                 |  13 +-
 arch/powerpc/kernel/entry_32.S                     |   3 +
 arch/powerpc/kernel/head_32.h                      |   2 +-
 arch/powerpc/kernel/head_8xx.S                     |   2 +-
 arch/powerpc/kernel/head_book3s_32.S               |   6 -
 arch/powerpc/kernel/irq.c                          |  27 +-
 arch/powerpc/kernel/prom_init.c                    |  12 +-
 arch/powerpc/kernel/time.c                         |   2 +
 arch/powerpc/kexec/elf_64.c                        |   2 +-
 arch/powerpc/kexec/file_load_64.c                  |  35 +++
 arch/powerpc/kvm/powerpc.c                         |   8 +-
 arch/powerpc/lib/sstep.c                           |   7 +-
 arch/powerpc/platforms/pseries/dlpar.c             |   7 +-
 arch/riscv/kernel/vdso/Makefile                    |   3 +-
 arch/s390/kernel/vtime.c                           |   3 +-
 arch/sparc/Kconfig                                 |   2 +-
 arch/sparc/kernel/led.c                            |   2 +
 arch/sparc/lib/memset.S                            |   1 +
 arch/um/include/shared/skas/mm_id.h                |   1 +
 arch/um/kernel/tlb.c                               |  19 +-
 arch/um/os-Linux/skas/process.c                    |   4 +
 arch/x86/crypto/aesni-intel_glue.c                 |  28 +-
 arch/x86/entry/common.c                            |   2 +-
 arch/x86/include/asm/virtext.h                     |  17 +-
 arch/x86/kernel/msr.c                              |   7 +
 arch/x86/kernel/reboot.c                           |  30 +-
 arch/x86/kvm/emulate.c                             |   4 +-
 arch/x86/kvm/mmu/tdp_mmu.c                         |   3 +-
 arch/x86/kvm/svm/nested.c                          |  22 +-
 arch/x86/kvm/svm/svm.c                             |   8 +-
 arch/x86/kvm/x86.c                                 |   1 +
 arch/x86/mm/fault.c                                |  27 +-
 arch/x86/mm/pat/memtype.c                          |   4 +-
 block/bfq-iosched.c                                |   1 +
 block/blk-settings.c                               |  12 +
 block/bsg.c                                        |   4 +-
 block/ioctl.c                                      |  21 +-
 certs/blacklist.c                                  |   2 +-
 crypto/ecdh_helper.c                               |   3 +
 crypto/michael_mic.c                               |  31 +-
 drivers/acpi/acpi_configfs.c                       |   7 +-
 drivers/acpi/property.c                            |  44 ++-
 drivers/amba/bus.c                                 |  20 +-
 drivers/ata/ahci_brcm.c                            |  14 +-
 drivers/auxdisplay/ht16k33.c                       |   3 +-
 drivers/base/regmap/regmap-sdw.c                   |   4 +-
 drivers/base/swnode.c                              |   8 +-
 drivers/block/floppy.c                             |  30 +-
 drivers/bluetooth/btqcomsmd.c                      |  27 +-
 drivers/bluetooth/btusb.c                          |  20 +-
 drivers/bluetooth/hci_ldisc.c                      |  41 ++-
 drivers/bluetooth/hci_qca.c                        |   2 +
 drivers/bluetooth/hci_serdev.c                     |   4 +-
 drivers/char/hw_random/ingenic-trng.c              |   6 +-
 drivers/char/hw_random/timeriomem-rng.c            |   2 +-
 drivers/char/random.c                              |   2 +-
 drivers/char/tpm/tpm.h                             |   4 -
 drivers/char/tpm/tpm_tis_core.c                    |  50 +--
 drivers/clk/clk-ast2600.c                          |  37 ++-
 drivers/clk/clk-divider.c                          |   9 +-
 drivers/clk/meson/clk-pll.c                        |  10 +-
 drivers/clk/qcom/gcc-msm8998.c                     | 100 +++---
 drivers/clk/renesas/r8a779a0-cpg-mssr.c            |   3 +-
 drivers/clk/sunxi-ng/ccu-sun50i-h6.c               |  10 +-
 drivers/clocksource/Kconfig                        |   1 +
 drivers/clocksource/mxs_timer.c                    |   5 +-
 drivers/cpufreq/acpi-cpufreq.c                     |  62 +---
 drivers/cpufreq/brcmstb-avs-cpufreq.c              |  24 +-
 drivers/cpufreq/freq_table.c                       |   8 +-
 drivers/cpufreq/intel_pstate.c                     |  21 +-
 drivers/cpufreq/qcom-cpufreq-hw.c                  |  40 ++-
 .../crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c    | 173 ++++++----
 drivers/crypto/allwinner/sun4i-ss/sun4i-ss.h       |   2 +
 drivers/crypto/bcm/cipher.c                        |   2 +-
 drivers/crypto/bcm/cipher.h                        |   4 +-
 drivers/crypto/bcm/util.c                          |   2 +-
 drivers/crypto/talitos.c                           |  50 ++-
 drivers/crypto/talitos.h                           |   1 +
 drivers/dax/bus.c                                  |   2 +-
 drivers/dma/fsldma.c                               |   6 +
 drivers/dma/hsu/pci.c                              |  21 +-
 drivers/dma/idxd/dma.c                             |   1 +
 drivers/dma/owl-dma.c                              |   1 +
 drivers/firmware/arm_scmi/driver.c                 |   4 +-
 drivers/gpio/gpio-pcf857x.c                        |   2 +-
 drivers/gpu/drm/Kconfig                            |   3 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c            |   2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h          |   2 +-
 drivers/gpu/drm/amd/amdgpu/soc15.c                 |   2 +
 .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.h  |   4 +-
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |   2 +-
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c |   3 +-
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.h |   2 +-
 .../gpu/drm/amd/display/dc/bios/command_table.c    |  61 ++++
 .../gpu/drm/amd/display/dc/dce/dce_clock_source.c  |  14 +
 .../drm/amd/display/dc/dce/dce_stream_encoder.c    |   1 +
 drivers/gpu/drm/amd/display/dc/dce/dce_transform.c |   8 +-
 .../drm/amd/display/dc/dcn10/dcn10_link_encoder.c  |   1 -
 .../gpu/drm/amd/display/dc/dcn20/dcn20_resource.c  |   6 +-
 .../gpu/drm/amd/display/dc/dcn21/dcn21_resource.c  |  20 +-
 drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c |   2 +
 .../amd/display/dc/irq/dcn21/irq_service_dcn21.c   |  22 ++
 drivers/gpu/drm/amd/pm/amdgpu_pm.c                 |   6 +-
 drivers/gpu/drm/drm_dp_mst_topology.c              |   3 +-
 drivers/gpu/drm/drm_fb_helper.c                    |  15 +-
 drivers/gpu/drm/drm_modes.c                        |   4 +-
 drivers/gpu/drm/gma500/oaktrail_hdmi_i2c.c         |  22 +-
 drivers/gpu/drm/gma500/psb_drv.c                   |   2 +
 drivers/gpu/drm/i915/display/intel_hdmi.c          |   6 +-
 drivers/gpu/drm/i915/gt/gen7_renderclear.c         |  12 +-
 drivers/gpu/drm/lima/lima_sched.c                  |   2 +-
 drivers/gpu/drm/mediatek/mtk_disp_ovl.c            |   2 +-
 drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c        |   4 +-
 drivers/gpu/drm/msm/adreno/a6xx_gmu.c              |  25 +-
 drivers/gpu/drm/msm/adreno/a6xx_gmu.h              |   8 +
 drivers/gpu/drm/msm/adreno/a6xx_gpu.c              |   8 +-
 drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c          |   2 +-
 drivers/gpu/drm/msm/dp/dp_display.c                |   5 +-
 drivers/gpu/drm/msm/dsi/phy/dsi_phy_20nm.c         |   2 +-
 drivers/gpu/drm/msm/msm_drv.c                      |   3 +-
 .../drm/nouveau/include/nvkm/subdev/bios/conn.h    |   1 +
 drivers/gpu/drm/nouveau/nouveau_chan.c             |   1 +
 drivers/gpu/drm/nouveau/nouveau_connector.c        |   1 +
 drivers/gpu/drm/panel/panel-elida-kd35t133.c       |   3 +-
 drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c   |   5 +
 drivers/gpu/drm/rcar-du/rcar_cmm.c                 |   2 +-
 drivers/gpu/drm/rcar-du/rcar_du_crtc.c             |  10 +-
 drivers/gpu/drm/rcar-du/rcar_du_drv.h              |   6 +-
 drivers/gpu/drm/rcar-du/rcar_du_encoder.c          |   5 +-
 drivers/gpu/drm/rcar-du/rcar_du_kms.c              |  30 +-
 drivers/gpu/drm/rockchip/rockchip_drm_vop.h        |  11 +
 drivers/gpu/drm/scheduler/sched_main.c             |   3 +
 drivers/gpu/drm/sun4i/sun4i_tcon.c                 |  21 +-
 drivers/gpu/drm/sun4i/sun4i_tcon.h                 |   1 +
 drivers/gpu/drm/tegra/dc.c                         |   2 +-
 drivers/gpu/drm/tegra/dsi.c                        |   2 +-
 drivers/gpu/drm/tegra/hdmi.c                       |   2 +-
 drivers/gpu/drm/tegra/hub.c                        |   2 +-
 drivers/gpu/drm/tegra/sor.c                        |   2 +-
 drivers/gpu/drm/tegra/vic.c                        |   2 +-
 drivers/gpu/drm/vc4/vc4_hdmi.c                     |  87 +++--
 drivers/gpu/drm/vc4/vc4_hdmi_regs.h                |   4 +-
 drivers/gpu/drm/virtio/virtgpu_gem.c               |   8 +-
 drivers/hid/hid-core.c                             |   3 +
 drivers/hid/hid-logitech-dj.c                      |   1 +
 drivers/hid/wacom_wac.c                            |   7 +-
 drivers/hsi/controllers/omap_ssi_core.c            |   2 +-
 drivers/hv/channel_mgmt.c                          |   3 +-
 drivers/hwtracing/coresight/coresight-etm4x-core.c |  21 +-
 .../hwtracing/coresight/coresight-etm4x-sysfs.c    |   2 +-
 drivers/i2c/busses/i2c-bcm-iproc.c                 | 231 +++++++++++---
 drivers/i2c/busses/i2c-brcmstb.c                   |   2 +-
 drivers/i2c/busses/i2c-exynos5.c                   |   8 +-
 drivers/i2c/busses/i2c-qcom-geni.c                 |  93 +++++-
 drivers/ide/falconide.c                            |   3 +-
 drivers/infiniband/core/cm.c                       |   8 +-
 drivers/infiniband/core/cma.c                      |  70 +++--
 drivers/infiniband/core/user_mad.c                 |  17 +-
 drivers/infiniband/hw/hns/hns_roce_device.h        |   2 +-
 drivers/infiniband/hw/hns/hns_roce_hw_v2.c         |   8 +-
 drivers/infiniband/hw/hns/hns_roce_main.c          |   3 +-
 drivers/infiniband/hw/mlx5/devx.c                  |   4 +-
 drivers/infiniband/hw/mlx5/main.c                  |  14 +-
 drivers/infiniband/sw/rxe/rxe_net.c                |   5 +
 drivers/infiniband/sw/rxe/rxe_recv.c               |  27 +-
 drivers/infiniband/sw/siw/siw.h                    |   2 +-
 drivers/infiniband/sw/siw/siw_main.c               |   2 +-
 drivers/infiniband/sw/siw/siw_qp.c                 | 271 ++++++++--------
 drivers/infiniband/sw/siw/siw_qp_rx.c              |  26 +-
 drivers/infiniband/sw/siw/siw_qp_tx.c              |   4 +-
 drivers/infiniband/sw/siw/siw_verbs.c              |  20 +-
 drivers/infiniband/ulp/rtrs/rtrs-clt-sysfs.c       |   2 +
 drivers/infiniband/ulp/rtrs/rtrs-clt.c             |  51 +--
 drivers/infiniband/ulp/rtrs/rtrs-clt.h             |   1 +
 drivers/infiniband/ulp/rtrs/rtrs-pri.h             |   9 +-
 drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c       |   9 +-
 drivers/infiniband/ulp/rtrs/rtrs-srv.c             | 117 ++++---
 drivers/infiniband/ulp/rtrs/rtrs.c                 |  14 +-
 drivers/input/joydev.c                             |   7 +-
 drivers/input/joystick/xpad.c                      |   1 +
 drivers/input/serio/i8042-x86ia64io.h              |   4 +
 drivers/input/serio/serport.c                      |   4 +-
 drivers/input/touchscreen/elo.c                    |   4 +-
 drivers/input/touchscreen/raydium_i2c_ts.c         |   3 +-
 drivers/input/touchscreen/sur40.c                  |   1 +
 drivers/input/touchscreen/zinitix.c                |   2 +-
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c        |   2 +-
 drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c         |   2 +
 drivers/iommu/iommu.c                              |  23 +-
 drivers/iommu/mtk_iommu.c                          |   2 +-
 drivers/irqchip/Kconfig                            |   3 +-
 drivers/irqchip/irq-loongson-pch-msi.c             |   2 +-
 drivers/macintosh/adb-iop.c                        |   6 +-
 drivers/mailbox/sprd-mailbox.c                     |   2 +-
 drivers/md/bcache/bcache.h                         |   3 +
 drivers/md/bcache/btree.c                          |  21 +-
 drivers/md/bcache/journal.c                        |   4 +-
 drivers/md/bcache/super.c                          |  20 ++
 drivers/md/dm-core.h                               |   4 +
 drivers/md/dm-crypt.c                              |   1 +
 drivers/md/dm-era-target.c                         |  93 ++++--
 drivers/md/dm-table.c                              | 168 +++++-----
 drivers/md/dm-writecache.c                         |  74 +++--
 drivers/md/dm.c                                    |  62 +++-
 drivers/md/dm.h                                    |   2 +-
 drivers/media/i2c/max9286.c                        |   2 +-
 drivers/media/i2c/ov5670.c                         |   3 +-
 drivers/media/pci/cx25821/cx25821-core.c           |   4 +-
 drivers/media/pci/intel/ipu3/Kconfig               |   3 +-
 drivers/media/pci/intel/ipu3/ipu3-cio2.c           |   2 +-
 drivers/media/pci/saa7134/saa7134-empress.c        |   5 +-
 drivers/media/pci/smipcie/smipcie-ir.c             |  46 +--
 drivers/media/platform/aspeed-video.c              |   6 +-
 drivers/media/platform/marvell-ccic/mcam-core.c    |   2 +
 .../media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c |   4 +-
 .../media/platform/mtk-vcodec/vdec/vdec_vp9_if.c   |   3 +-
 drivers/media/platform/pxa_camera.c                |   3 +
 drivers/media/platform/qcom/camss/camss-video.c    |   1 +
 drivers/media/platform/ti-vpe/cal.c                |   4 +-
 drivers/media/platform/vsp1/vsp1_drv.c             |   4 +-
 drivers/media/rc/ir_toy.c                          |   1 +
 drivers/media/rc/mceusb.c                          |   2 +-
 drivers/media/test-drivers/vidtv/vidtv_psi.c       |   5 +-
 drivers/media/tuners/qm1d1c0042.c                  |   4 +-
 drivers/media/usb/dvb-usb-v2/lmedm04.c             |   2 +-
 drivers/media/usb/em28xx/em28xx-core.c             |   6 +-
 drivers/media/usb/tm6000/tm6000-dvb.c              |   4 +
 drivers/media/usb/uvc/uvc_v4l2.c                   |  18 +-
 drivers/memory/mtk-smi.c                           |   4 +-
 drivers/memory/ti-aemif.c                          |   8 +-
 drivers/mfd/altera-sysmgr.c                        |   3 +-
 drivers/mfd/bd9571mwv.c                            |   6 +-
 drivers/mfd/gateworks-gsc.c                        |   2 +-
 drivers/mfd/wm831x-auxadc.c                        |   3 +-
 drivers/misc/cardreader/rts5227.c                  |   5 +
 drivers/misc/eeprom/eeprom_93xx46.c                |   1 +
 drivers/misc/fastrpc.c                             |   7 +-
 drivers/misc/mei/hbm.c                             |   2 +-
 drivers/misc/mei/hw-me-regs.h                      |   5 +
 drivers/misc/mei/interrupt.c                       |  33 +-
 drivers/misc/mei/pci-me.c                          |   5 +
 drivers/misc/vmw_vmci/vmci_queue_pair.c            |   5 +-
 drivers/mmc/host/owl-mmc.c                         |   9 +-
 drivers/mmc/host/renesas_sdhi_internal_dmac.c      |   4 +-
 drivers/mmc/host/sdhci-esdhc-imx.c                 |   3 +-
 drivers/mmc/host/sdhci-pci-o2micro.c               |  20 ++
 drivers/mmc/host/sdhci-sprd.c                      |   6 +-
 drivers/mmc/host/usdhi6rol0.c                      |   4 +-
 drivers/mtd/parsers/afs.c                          |   4 +-
 drivers/mtd/parsers/parser_imagetag.c              |   4 +
 drivers/mtd/spi-nor/controllers/hisi-sfc.c         |   4 +-
 drivers/mtd/spi-nor/core.c                         |  10 +-
 drivers/mtd/spi-nor/sfdp.c                         |   5 +-
 drivers/net/Kconfig                                |   2 +-
 drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c     |   2 +-
 drivers/net/dsa/ocelot/felix.c                     |  16 +-
 drivers/net/ethernet/amd/xgbe/xgbe-common.h        |  14 +
 drivers/net/ethernet/amd/xgbe/xgbe-drv.c           |   1 +
 drivers/net/ethernet/amd/xgbe/xgbe-mdio.c          |   3 +-
 drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c        |  39 ++-
 drivers/net/ethernet/broadcom/bnxt/bnxt.c          |   3 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c  |   4 +-
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h     |   3 +
 drivers/net/ethernet/chelsio/cxgb4/sge.c           |  11 +-
 .../chelsio/inline_crypto/chtls/chtls_cm.h         |   3 -
 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c   |  14 +-
 drivers/net/ethernet/freescale/enetc/enetc_pf.c    |   5 +-
 drivers/net/ethernet/ibm/ibmvnic.c                 |  16 +-
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c     |  16 +-
 drivers/net/ethernet/intel/i40e/i40e_main.c        |  50 +--
 drivers/net/ethernet/intel/i40e/i40e_txrx.c        |   9 +-
 drivers/net/ethernet/intel/ice/ice.h               |   2 -
 drivers/net/ethernet/intel/ice/ice_dcb_nl.c        |   6 +-
 drivers/net/ethernet/intel/ice/ice_ethtool.c       |  34 +-
 drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c   |  33 +-
 drivers/net/ethernet/marvell/mvneta.c              |   9 +-
 .../ethernet/marvell/octeontx2/af/rvu_debugfs.c    |   2 +-
 .../net/ethernet/mellanox/mlx4/resource_tracker.c  |   1 +
 drivers/net/ethernet/mellanox/mlx5/core/devlink.c  |   9 +
 drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c | 259 +++++++++++----
 drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h   |   2 +-
 .../net/ethernet/mellanox/mlx5/core/en/xsk/setup.c |   2 +-
 .../mellanox/mlx5/core/en_accel/en_accel.h         |   2 +-
 .../ethernet/mellanox/mlx5/core/en_accel/ktls_rx.c |  66 ++--
 .../net/ethernet/mellanox/mlx5/core/en_ethtool.c   |  39 ++-
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c  |   8 +-
 drivers/net/ethernet/mellanox/mlx5/core/health.c   |  22 +-
 drivers/net/ethernet/mellanox/mlx5/core/main.c     |   3 +-
 drivers/net/ethernet/realtek/r8169_main.c          |   4 +-
 .../net/ethernet/stmicro/stmmac/dwmac-meson8b.c    |   2 +-
 drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c    |  30 +-
 drivers/net/ethernet/xilinx/xilinx_axienet_main.c  |  26 +-
 drivers/net/gtp.c                                  |   1 -
 drivers/net/phy/mscc/mscc.h                        |   8 +
 drivers/net/phy/mscc/mscc_main.c                   | 350 ++++++++++++++-------
 drivers/net/phy/phy_device.c                       |  53 +---
 drivers/net/ppp/ppp_async.c                        |   3 +-
 drivers/net/ppp/ppp_synctty.c                      |   3 +-
 drivers/net/vxlan.c                                |  11 +-
 drivers/net/wireguard/device.c                     |  19 +-
 drivers/net/wireguard/device.h                     |  15 +-
 drivers/net/wireguard/peer.c                       |  28 +-
 drivers/net/wireguard/peer.h                       |   4 +-
 drivers/net/wireguard/queueing.c                   |  86 ++++-
 drivers/net/wireguard/queueing.h                   |  45 ++-
 drivers/net/wireguard/receive.c                    |  16 +-
 drivers/net/wireguard/send.c                       |  31 +-
 drivers/net/wireless/ath/ath10k/mac.c              |   2 +
 drivers/net/wireless/ath/ath10k/snoc.c             |   5 +-
 drivers/net/wireless/ath/ath10k/wmi-tlv.c          |   3 +
 drivers/net/wireless/ath/ath11k/mac.c              |  11 +-
 drivers/net/wireless/ath/ath9k/debug.c             |   5 +-
 drivers/net/wireless/broadcom/b43/phy_n.c          |   2 +-
 drivers/net/wireless/intel/iwlwifi/fw/pnvm.c       |  13 +-
 drivers/net/wireless/intel/iwlwifi/mvm/fw.c        |  43 ++-
 .../net/wireless/intel/iwlwifi/mvm/time-event.c    |   3 -
 .../wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c   |  21 +-
 drivers/net/xen-netback/interface.c                |   8 +-
 drivers/nvme/host/multipath.c                      |   4 +
 drivers/nvme/target/admin-cmd.c                    |  33 +-
 drivers/nvme/target/tcp.c                          |  59 +++-
 drivers/nvmem/core.c                               |   5 +-
 drivers/nvmem/qcom-spmi-sdam.c                     |   7 +-
 drivers/of/fdt.c                                   |  12 +-
 drivers/opp/of.c                                   |   4 +-
 drivers/pci/controller/cadence/pcie-cadence-host.c |   5 +-
 drivers/pci/controller/dwc/pcie-qcom.c             |   4 +-
 drivers/pci/controller/pcie-rcar-host.c            |   2 +-
 drivers/pci/controller/pcie-rockchip.c             |  12 +-
 drivers/pci/controller/pcie-xilinx-cpm.c           |   1 +
 drivers/pci/pci-bridge-emul.c                      |  11 +-
 drivers/pci/setup-res.c                            |   6 +
 drivers/pci/syscall.c                              |  10 +-
 drivers/perf/arm-cmn.c                             |  17 +-
 drivers/phy/Kconfig                                |   1 +
 drivers/phy/cadence/phy-cadence-torrent.c          |   1 +
 drivers/phy/lantiq/phy-lantiq-rcu-usb2.c           |  10 +-
 drivers/phy/rockchip/phy-rockchip-emmc.c           |   8 +-
 drivers/platform/chrome/cros_ec_proto.c            |  12 +-
 drivers/power/reset/at91-sama5d2_shdwc.c           |   2 +-
 drivers/power/supply/Kconfig                       |   1 +
 drivers/power/supply/axp20x_usb_power.c            |   2 +-
 drivers/power/supply/cpcap-battery.c               |  12 +-
 drivers/power/supply/cpcap-charger.c               |   4 +-
 drivers/power/supply/smb347-charger.c              |  12 +-
 drivers/pwm/pwm-iqs620a.c                          |   8 +-
 drivers/pwm/pwm-rockchip.c                         |  18 +-
 drivers/regulator/axp20x-regulator.c               |   7 +-
 drivers/regulator/core.c                           |   6 +-
 drivers/regulator/qcom-rpmh-regulator.c            |  26 ++
 drivers/regulator/rohm-regulator.c                 |   9 +-
 drivers/regulator/s5m8767.c                        |  15 +-
 drivers/remoteproc/mtk_common.h                    |   1 +
 drivers/remoteproc/mtk_scp.c                       |  20 +-
 drivers/rtc/Kconfig                                |   3 +-
 drivers/s390/crypto/zcrypt_api.c                   |  14 +
 drivers/s390/virtio/virtio_ccw.c                   |   4 +-
 drivers/scsi/bnx2fc/Kconfig                        |   1 +
 drivers/scsi/lpfc/lpfc_hbadisc.c                   |  15 +-
 drivers/scsi/qla2xxx/qla_dbg.c                     |   1 +
 drivers/scsi/qla2xxx/qla_mbx.c                     |   3 +-
 drivers/scsi/sd.c                                  |   6 +-
 drivers/scsi/sd_zbc.c                              |   6 +-
 drivers/soc/aspeed/aspeed-lpc-snoop.c              |  30 +-
 drivers/soc/qcom/ocmem.c                           |   8 +-
 drivers/soc/qcom/socinfo.c                         |   2 +-
 drivers/soc/samsung/exynos-asv.c                   |  18 +-
 drivers/soc/ti/pm33xx.c                            |   5 +-
 drivers/soundwire/bus.c                            |  47 ++-
 drivers/soundwire/cadence_master.c                 |   8 +-
 drivers/soundwire/debugfs.c                        |   2 +-
 drivers/soundwire/intel_init.c                     |   3 +-
 drivers/spi/spi-atmel.c                            |   2 +-
 drivers/spi/spi-cadence-quadspi.c                  |   2 +-
 drivers/spi/spi-dw-bt1.c                           |   2 +-
 drivers/spi/spi-fsl-spi.c                          |   2 +-
 drivers/spi/spi-imx.c                              |   2 +-
 drivers/spi/spi-pxa2xx-pci.c                       |  27 +-
 drivers/spi/spi-stm32.c                            |   4 +
 drivers/spi/spi-synquacer.c                        |   4 +
 drivers/spi/spi.c                                  |   2 +-
 drivers/spmi/spmi-pmic-arb.c                       |   5 +-
 drivers/staging/gdm724x/gdm_usb.c                  |  10 +-
 drivers/staging/media/allegro-dvt/allegro-core.c   |   3 +-
 drivers/staging/media/atomisp/pci/atomisp_subdev.c |  24 +-
 drivers/staging/media/atomisp/pci/hmm/hmm.c        |   2 +-
 drivers/staging/media/imx/imx-media-csc-scaler.c   |   4 -
 drivers/staging/media/imx/imx-media-dev.c          |   7 +-
 drivers/staging/media/imx/imx7-media-csi.c         |  27 +-
 drivers/staging/mt7621-dma/Makefile                |   2 +-
 .../mt7621-dma/{mtk-hsdma.c => hsdma-mt7621.c}     |   2 +-
 drivers/staging/rtl8188eu/os_dep/usb_intf.c        |   1 +
 drivers/staging/rtl8723bs/os_dep/wifi_regd.c       |   2 +-
 .../vc04_services/interface/vchiq_arm/vchiq_arm.c  |   6 +-
 drivers/staging/wfx/data_tx.c                      |  10 +-
 drivers/staging/wfx/data_tx.h                      |   1 +
 drivers/target/iscsi/cxgbit/cxgbit_target.c        |   3 +-
 drivers/tee/optee/rpc.c                            |  31 +-
 drivers/thermal/cpufreq_cooling.c                  |   2 +-
 drivers/tty/n_gsm.c                                |   3 +-
 drivers/tty/n_hdlc.c                               |  60 ++--
 drivers/tty/n_null.c                               |   3 +-
 drivers/tty/n_r3964.c                              |  10 +-
 drivers/tty/n_tracerouter.c                        |   4 +-
 drivers/tty/n_tracesink.c                          |   4 +-
 drivers/tty/n_tty.c                                |  82 ++---
 drivers/tty/tty_io.c                               |  82 ++++-
 drivers/usb/dwc2/hcd.c                             |  15 +-
 drivers/usb/dwc2/hcd_intr.c                        |  14 +-
 drivers/usb/dwc3/gadget.c                          |  19 +-
 drivers/usb/gadget/function/u_audio.c              |  17 +-
 drivers/usb/musb/musb_core.c                       |  31 +-
 drivers/usb/serial/ftdi_sio.c                      |   5 +-
 drivers/usb/serial/mos7720.c                       |   4 +-
 drivers/usb/serial/mos7840.c                       |   4 +-
 drivers/usb/serial/option.c                        |   3 +-
 drivers/usb/serial/pl2303.c                        |   8 +-
 drivers/vdpa/mlx5/net/mlx5_vnet.c                  |   2 +-
 drivers/vfio/pci/vfio_pci_zdev.c                   |   4 +
 drivers/vfio/vfio_iommu_type1.c                    |  63 ++--
 drivers/video/fbdev/Kconfig                        |   2 +-
 drivers/virt/vboxguest/vboxguest_utils.c           |  18 +-
 drivers/w1/slaves/w1_therm.c                       |  22 +-
 drivers/watchdog/intel-mid_wdt.c                   |   8 +-
 drivers/watchdog/mei_wdt.c                         |   1 +
 drivers/watchdog/qcom-wdt.c                        |  13 +-
 fs/affs/namei.c                                    |   4 +-
 fs/btrfs/backref.c                                 |   9 +-
 fs/btrfs/backref.h                                 |   9 +-
 fs/btrfs/block-group.c                             |  29 +-
 fs/btrfs/ctree.c                                   |   7 +-
 fs/btrfs/delayed-ref.c                             |  56 ++--
 fs/btrfs/delayed-ref.h                             |  16 +-
 fs/btrfs/extent-tree.c                             | 128 ++------
 fs/btrfs/free-space-cache.c                        |   6 +-
 fs/btrfs/inode.c                                   |   3 +-
 fs/btrfs/relocation.c                              |   4 +-
 fs/btrfs/space-info.h                              |  17 +
 fs/ceph/caps.c                                     |  10 +-
 fs/debugfs/inode.c                                 |   5 +-
 fs/erofs/xattr.c                                   |  10 +-
 fs/erofs/zmap.c                                    |  10 +-
 fs/eventpoll.c                                     |   4 +-
 fs/exfat/exfat_raw.h                               |   4 +
 fs/exfat/super.c                                   |  31 +-
 fs/ext4/Kconfig                                    |   3 +-
 fs/ext4/namei.c                                    |   7 +-
 fs/f2fs/compress.c                                 |   5 +-
 fs/f2fs/data.c                                     |  12 +-
 fs/f2fs/f2fs.h                                     |   2 +-
 fs/f2fs/file.c                                     |  24 +-
 fs/f2fs/inline.c                                   |   4 +
 fs/f2fs/super.c                                    |   3 +
 fs/gfs2/bmap.c                                     |   6 +-
 fs/gfs2/lock_dlm.c                                 |   8 +-
 fs/gfs2/recovery.c                                 |   4 +-
 fs/gfs2/util.c                                     |  16 +-
 fs/io_uring.c                                      |  17 +-
 fs/isofs/dir.c                                     |   1 +
 fs/isofs/namei.c                                   |   1 +
 fs/jffs2/summary.c                                 |   3 +
 fs/jfs/jfs_dmap.c                                  |   2 +-
 fs/nfs/nfs4proc.c                                  |  15 +-
 fs/nfsd/nfsctl.c                                   |  14 +-
 fs/ocfs2/cluster/heartbeat.c                       |   8 +-
 fs/proc/proc_sysctl.c                              |   4 +-
 fs/proc/self.c                                     |   2 +-
 fs/proc/task_mmu.c                                 |   9 +-
 fs/proc/thread_self.c                              |   7 +
 fs/pstore/platform.c                               |   4 +-
 fs/quota/quota_v2.c                                |  11 +-
 fs/ubifs/auth.c                                    |   2 +-
 fs/ubifs/replay.c                                  |   4 +-
 fs/ubifs/super.c                                   |   4 +-
 fs/zonefs/super.c                                  |   3 +
 include/acpi/acexcep.h                             |  10 +-
 include/asm-generic/vmlinux.lds.h                  |  16 +-
 include/linux/bpf.h                                |   3 +
 include/linux/device-mapper.h                      |   5 +
 include/linux/entry-kvm.h                          |  14 +
 include/linux/eventpoll.h                          |   2 +-
 include/linux/filter.h                             |   2 +-
 include/linux/icmpv6.h                             |  28 +-
 include/linux/iommu.h                              |   4 +-
 include/linux/ipv6.h                               |   1 -
 include/linux/kexec.h                              |   5 +
 include/linux/key.h                                |   1 +
 include/linux/kgdb.h                               |   2 +
 include/linux/khugepaged.h                         |   2 +
 include/linux/memremap.h                           |   6 +
 include/linux/mfd/rohm-generic.h                   |  14 +-
 include/linux/rcupdate.h                           |   2 +
 include/linux/rmap.h                               |   3 +-
 include/linux/soundwire/sdw.h                      |   2 +
 include/linux/tpm.h                                |   5 +-
 include/linux/tty_ldisc.h                          |   3 +-
 include/net/act_api.h                              |   6 +-
 include/net/icmp.h                                 |   6 +-
 include/net/tcp.h                                  |   9 +-
 include/uapi/drm/drm_fourcc.h                      |   4 +-
 init/Kconfig                                       |  11 +
 init/main.c                                        |   1 +
 kernel/Makefile                                    |   2 +-
 kernel/bpf/bpf_iter.c                              |   2 +-
 kernel/bpf/bpf_lru_list.c                          |   7 +-
 kernel/bpf/devmap.c                                |   4 +-
 kernel/bpf/verifier.c                              |   3 +-
 kernel/debug/debug_core.c                          |  11 +
 kernel/debug/kdb/kdb_private.h                     |   2 +-
 kernel/entry/common.c                              |   7 +
 kernel/kcsan/core.c                                |  26 +-
 kernel/kexec_file.c                                |   5 +
 kernel/kprobes.c                                   |  31 +-
 kernel/locking/lockdep.c                           |   3 +-
 kernel/module.c                                    |  21 +-
 kernel/printk/printk.c                             |  28 +-
 kernel/printk/printk_safe.c                        |  16 +-
 kernel/rcu/tree.c                                  |  53 +++-
 kernel/rcu/tree.h                                  |   2 +-
 kernel/rcu/tree_plugin.h                           |  31 +-
 kernel/sched/fair.c                                |  45 ++-
 kernel/sched/idle.c                                |   1 +
 kernel/seccomp.c                                   |   2 +
 kernel/smp.c                                       |   4 +
 kernel/tracepoint.c                                |  80 ++++-
 mm/compaction.c                                    |  43 +--
 mm/hugetlb.c                                       |  14 +-
 mm/khugepaged.c                                    |  22 +-
 mm/memcontrol.c                                    |  30 +-
 mm/memory-failure.c                                |   6 +
 mm/memory.c                                        |  16 +-
 mm/memremap.c                                      |  15 +
 mm/slab_common.c                                   |   4 +-
 mm/slub.c                                          |   8 +-
 mm/vmscan.c                                        |   9 +-
 net/bluetooth/a2mp.c                               |   3 +-
 net/bluetooth/hci_core.c                           |   6 +-
 net/core/filter.c                                  |  13 +-
 net/ipv4/icmp.c                                    |   5 +-
 net/ipv6/icmp.c                                    |  18 +-
 net/ipv6/ip6_icmp.c                                |  12 +-
 net/mac80211/mesh_hwmp.c                           |   2 +-
 net/nfc/nci/uart.c                                 |   3 +-
 net/qrtr/tun.c                                     |  12 +-
 net/sched/act_api.c                                | 106 ++++---
 net/sched/cls_api.c                                |  12 +-
 net/sunrpc/xprtrdma/svc_rdma_transport.c           |   6 +-
 samples/Kconfig                                    |   2 +-
 samples/watch_queue/watch_test.c                   |   2 +-
 security/commoncap.c                               |  12 +-
 security/integrity/evm/evm_crypto.c                |   7 +-
 security/integrity/ima/ima_kexec.c                 |   3 +
 security/integrity/ima/ima_mok.c                   |   5 +-
 security/keys/Kconfig                              |   8 +-
 security/keys/key.c                                |   2 +
 security/keys/trusted-keys/trusted_tpm1.c          |  22 +-
 security/keys/trusted-keys/trusted_tpm2.c          |  22 +-
 security/selinux/hooks.c                           |   4 +
 sound/core/init.c                                  |   4 +
 sound/core/pcm.c                                   |   4 +
 sound/core/pcm_local.h                             |   1 +
 sound/core/pcm_native.c                            |  27 +-
 sound/firewire/fireface/ff-protocol-latter.c       | 118 +++++--
 sound/pci/hda/hda_intel.c                          |   2 +
 sound/pci/hda/patch_hdmi.c                         |   1 -
 sound/pci/hda/patch_realtek.c                      |  40 +++
 sound/soc/codecs/cpcap.c                           |  12 +-
 sound/soc/codecs/cs42l56.c                         |   3 +-
 sound/soc/codecs/rt5682-i2c.c                      |   3 +
 sound/soc/codecs/wsa881x.c                         |   1 +
 sound/soc/generic/simple-card-utils.c              |  13 +-
 sound/soc/intel/boards/sof_sdw.c                   |   6 +-
 sound/soc/qcom/lpass-apq8016.c                     |   2 +-
 sound/soc/qcom/lpass-cpu.c                         |  30 +-
 sound/soc/qcom/lpass-lpaif-reg.h                   |   3 -
 sound/soc/qcom/lpass.h                             |   1 -
 sound/soc/qcom/qdsp6/q6asm-dai.c                   |  21 ++
 sound/soc/qcom/qdsp6/q6routing.c                   |  18 --
 sound/soc/sh/siu.h                                 |   2 +-
 sound/soc/sh/siu_pcm.c                             |   2 +-
 sound/soc/sof/debug.c                              |   2 +-
 sound/soc/sof/intel/hda-dsp.c                      |   4 +
 sound/soc/sof/sof-pci-dev.c                        |   7 +
 sound/usb/pcm.c                                    |   2 +-
 tools/lib/bpf/libbpf.c                             |  22 +-
 tools/objtool/arch/x86/special.c                   |   2 +-
 tools/objtool/check.c                              |  15 +-
 tools/objtool/check.h                              |  11 +
 tools/perf/builtin-record.c                        |   2 +-
 .../pmu-events/arch/arm64/ampere/emag/cache.json   |   2 +-
 tools/perf/tests/sample-parsing.c                  |   2 +-
 tools/perf/util/event.c                            |   2 +
 tools/perf/util/evlist.c                           |   8 +
 tools/perf/util/evlist.h                           |   4 +
 .../perf/util/intel-pt-decoder/intel-pt-decoder.c  |  41 ++-
 .../perf/util/intel-pt-decoder/intel-pt-decoder.h  |   2 +
 tools/perf/util/intel-pt.c                         |  29 +-
 tools/perf/util/symbol.c                           |   7 +-
 tools/testing/kunit/kunit_tool_test.py             |  14 +-
 tools/testing/selftests/bpf/test_xdp_redirect.sh   |  10 +-
 tools/testing/selftests/dmabuf-heaps/Makefile      |   2 +-
 .../trigger-synthetic_event_syntax_errors.tc       |  35 ++-
 tools/testing/selftests/net/mptcp/mptcp_connect.sh |   2 +-
 tools/testing/selftests/powerpc/eeh/eeh-basic.sh   |   2 +-
 tools/testing/selftests/seccomp/seccomp_bpf.c      |   2 +-
 tools/testing/selftests/wireguard/netns.sh         |  15 +-
 672 files changed, 5877 insertions(+), 3028 deletions(-)
author maintainer
#1 lore raw

PATCH 1/663 vmlinux.lds.h: add DWARF v5 sections

From: Nick Desaulniers <[email protected]>

commit 3c4fa46b30c551b1df2fb1574a684f68bc22067c upstream.

We expect toolchains to produce these new debug info sections as part of DWARF v5. Add explicit placements to prevent the linker warnings from --orphan-section=warn.

Compilers may produce such sections with explicit -gdwarf-5, or based on the implicit default version of DWARF when -g is used via DEBUG_INFO. This implicit default changes over time, and has changed to DWARF v5 with GCC 11.

.debug_sup was mentioned in review, but without compilers producing it today, let's wait to add it until it becomes necessary.

---
 include/asm-generic/vmlinux.lds.h |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
include/asm-generic/vmlinux.lds.h +6 -1
@@ -828,8 +828,13 @@
 		/* DWARF 4 */						\
 		.debug_types	0 : { *(.debug_types) }			\
 		/* DWARF 5 */						\
+		.debug_addr	0 : { *(.debug_addr) }			\
+		.debug_line_str	0 : { *(.debug_line_str) }		\
+		.debug_loclists	0 : { *(.debug_loclists) }		\
 		.debug_macro	0 : { *(.debug_macro) }			\
-		.debug_addr	0 : { *(.debug_addr) }
+		.debug_names	0 : { *(.debug_names) }			\
+		.debug_rnglists	0 : { *(.debug_rnglists) }		\
+		.debug_str_offsets	0 : { *(.debug_str_offsets) }
 
 /* Stabs debugging sections. */
 #define STABS_DEBUG							\
author maintainer
#2 lore raw

PATCH 2/663 vdpa/mlx5: fix param validation in mlx5_vdpa_get_config()

In reply to Greg Kroah-Hartman

From: Stefano Garzarella <[email protected]>

commit dcfde1635e764fd69cc756c7780d144e288608e9 upstream.

It's legal to have 'offset + len' equal to
sizeof(struct virtio_net_config), since 'ndev->config' is a 'struct virtio_net_config', so we can safely copy its content under this condition.

---
 drivers/vdpa/mlx5/net/mlx5_vnet.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vdpa/mlx5/net/mlx5_vnet.c +1 -1
@@ -1805,7 +1805,7 @@ static void mlx5_vdpa_get_config(struct
 	struct mlx5_vdpa_dev *mvdev = to_mvdev(vdev);
 	struct mlx5_vdpa_net *ndev = to_mlx5_vdpa_ndev(mvdev);
 
-	if (offset + len < sizeof(struct virtio_net_config))
+	if (offset + len <= sizeof(struct virtio_net_config))
 		memcpy(buf, (u8 *)&ndev->config + offset, len);
 }
 
author maintainer
#3 lore raw

PATCH 3/663 debugfs: be more robust at handling improper input in debugfs_lookup()

In reply to Greg Kroah-Hartman

From: Greg Kroah-Hartman <[email protected]>

commit bc6de804d36b3709d54fa22bd128cbac91c11526 upstream.

debugfs_lookup() doesn't like it if it is passed an illegal name pointer, or if the filesystem isn't even initialized yet. If either of these happen, it will crash the system, so fix it up by properly testing for valid input and that we are up and running before trying to find a file in the filesystem.

---
 fs/debugfs/inode.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/debugfs/inode.c +1 -1
@@ -297,7 +297,7 @@ struct dentry *debugfs_lookup(const char
 {
 	struct dentry *dentry;
 
-	if (IS_ERR(parent))
+	if (!debugfs_initialized() || IS_ERR_OR_NULL(name) || IS_ERR(parent))
 		return NULL;
 
 	if (!parent)
author maintainer
#4 lore raw

PATCH 4/663 debugfs: do not attempt to create a new file before the filesystem is initalized

In reply to Greg Kroah-Hartman

From: Greg Kroah-Hartman <[email protected]>

commit 56348560d495d2501e87db559a61de717cd3ab02 upstream.

Some subsystems want to add debugfs files at early boot, way before debugfs is initialized. This seems to work somehow as the vfs layer will not allow it to happen, but let's be explicit and test to ensure we are properly up and running before allowing files to be created.

---
 fs/debugfs/inode.c |    3 +++
 1 file changed, 3 insertions(+)
fs/debugfs/inode.c +3 -0
@@ -318,6 +318,9 @@ static struct dentry *start_creating(con
 	if (!(debugfs_allow & DEBUGFS_ALLOW_API))
 		return ERR_PTR(-EPERM);
 
+	if (!debugfs_initialized())
+		return ERR_PTR(-ENOENT);
+
 	pr_debug("creating file '%s'\n", name);
 
 	if (IS_ERR(parent))
author maintainer
#5 lore raw

PATCH 5/663 scsi: libsas: docs: Remove notify_ha_event()

In reply to Greg Kroah-Hartman

From: Ahmed S. Darwish <[email protected]>

commit 3f901c81dfad6930de5d4e6b582c4fde880cdada upstream.

The ->notify_ha_event() hook has long been removed from the libsas event interface.

Remove it from documentation.

---
 Documentation/scsi/libsas.rst |    1 -
 1 file changed, 1 deletion(-)
Documentation/scsi/libsas.rst +0 -1
@@ -189,7 +189,6 @@ num_phys
 The event interface::
 
 	/* LLDD calls these to notify the class of an event. */
-	void (*notify_ha_event)(struct sas_ha_struct *, enum ha_event);
 	void (*notify_port_event)(struct sas_phy *, enum port_event);
 	void (*notify_phy_event)(struct sas_phy *, enum phy_event);
 
author maintainer
#6 lore raw

PATCH 6/663 scsi: qla2xxx: Fix mailbox Ch erroneous error

In reply to Greg Kroah-Hartman

From: Quinn Tran <[email protected]>

commit 044c218b04503858ca4e17f61899c8baa0ae9ba1 upstream.

Mailbox Ch/dump ram extend expects mb register 10 to be set. If not set/clear, firmware can pick up garbage from previous invocation of this mailbox. Example: mctp dump can set mb10. On subsequent flash read which use mailbox cmd Ch, mb10 can retain previous value.

---
 drivers/scsi/qla2xxx/qla_dbg.c |    1 +
 drivers/scsi/qla2xxx/qla_mbx.c |    3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/qla2xxx/qla_dbg.c +1 -0
@@ -202,6 +202,7 @@ qla24xx_dump_ram(struct qla_hw_data *ha,
 		wrt_reg_word(&reg->mailbox0, MBC_DUMP_RISC_RAM_EXTENDED);
 		wrt_reg_word(&reg->mailbox1, LSW(addr));
 		wrt_reg_word(&reg->mailbox8, MSW(addr));
+		wrt_reg_word(&reg->mailbox10, 0);
 
 		wrt_reg_word(&reg->mailbox2, MSW(LSD(dump_dma)));
 		wrt_reg_word(&reg->mailbox3, LSW(LSD(dump_dma)));
drivers/scsi/qla2xxx/qla_mbx.c +2 -1
@@ -4277,7 +4277,8 @@ qla2x00_dump_ram(scsi_qla_host_t *vha, d
 	if (MSW(addr) || IS_FWI2_CAPABLE(vha->hw)) {
 		mcp->mb[0] = MBC_DUMP_RISC_RAM_EXTENDED;
 		mcp->mb[8] = MSW(addr);
-		mcp->out_mb = MBX_8|MBX_0;
+		mcp->mb[10] = 0;
+		mcp->out_mb = MBX_10|MBX_8|MBX_0;
 	} else {
 		mcp->mb[0] = MBC_DUMP_RISC_RAM;
 		mcp->out_mb = MBX_0;
author maintainer
#7 lore raw

PATCH 7/663 kdb: Make memory allocations more robust

In reply to Greg Kroah-Hartman

From: Sumit Garg <[email protected]>

commit 93f7a6d818deef69d0ba652d46bae6fbabbf365c upstream.

Currently kdb uses in_interrupt() to determine whether its library code has been called from the kgdb trap handler or from a saner calling context such as driver init. This approach is broken because in_interrupt() alone isn't able to determine kgdb trap handler entry from normal task context. This can happen during normal use of basic features such as breakpoints and can also be trivially reproduced using:
echo g > /proc/sysrq-trigger

We can improve this by adding check for in_dbg_master() instead which explicitly determines if we are running in debugger context.

---
 kernel/debug/kdb/kdb_private.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/debug/kdb/kdb_private.h +1 -1
@@ -230,7 +230,7 @@ extern struct task_struct *kdb_curr_task
 
 #define kdb_task_has_cpu(p) (task_curr(p))
 
-#define GFP_KDB (in_interrupt() ? GFP_ATOMIC : GFP_KERNEL)
+#define GFP_KDB (in_dbg_master() ? GFP_ATOMIC : GFP_KERNEL)
 
 extern void *debug_kmalloc(size_t size, gfp_t flags);
 extern void debug_kfree(void *);
author maintainer
#8 lore raw

PATCH 8/663 w1: w1_therm: Fix conversion result for negative temperatures

In reply to Greg Kroah-Hartman

From: Ivan Zaentsev <[email protected]>

commit 2f6055c26f1913763eabc66c7c27d0693561e966 upstream.

DS18B20 device driver returns an incorrect value for negative temperatures due to a missing sign-extension in w1_DS18B20_convert_temp().

Fix by using s16 temperature value when converting to int.

Fixes 9ace0b4dab1c (w1: w1_therm: Add support for GXCAS GX20MH01 device.)
Cc stable <[email protected]>
---
 drivers/w1/slaves/w1_therm.c |   22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)
drivers/w1/slaves/w1_therm.c +9 -13
@@ -667,28 +667,24 @@ static inline int w1_DS18B20_get_resolut
  */
 static inline int w1_DS18B20_convert_temp(u8 rom[9])
 {
-	int t;
-	u32 bv;
+	u16 bv;
+	s16 t;
+
+	/* Signed 16-bit value to unsigned, cpu order */
+	bv = le16_to_cpup((__le16 *)rom);
 
 	/* Config register bit R2 = 1 - GX20MH01 in 13 or 14 bit resolution mode */
 	if (rom[4] & 0x80) {
-		/* Signed 16-bit value to unsigned, cpu order */
-		bv = le16_to_cpup((__le16 *)rom);
-
 		/* Insert two temperature bits from config register */
 		/* Avoid arithmetic shift of signed value */
 		bv = (bv << 2) | (rom[4] & 3);
-
-		t = (int) sign_extend32(bv, 17); /* Degrees, lowest bit is 2^-6 */
-		return (t*1000)/64;  /* Millidegrees */
+		t = (s16) bv;	/* Degrees, lowest bit is 2^-6 */
+		return (int)t * 1000 / 64;	/* Sign-extend to int; millidegrees */
 	}
-
-	t = (int)le16_to_cpup((__le16 *)rom);
-	return t*1000/16;
+	t = (s16)bv;	/* Degrees, lowest bit is 2^-4 */
+	return (int)t * 1000 / 16;	/* Sign-extend to int; millidegrees */
 }
 
-
-
 /**
  * w1_DS18S20_convert_temp() - temperature computation for DS18S20
  * @rom: data read from device RAM (8 data bytes + 1 CRC byte)
author maintainer
#9 lore raw

PATCH 9/663 PCI: qcom: Use PHY_REFCLK_USE_PAD only for ipq8064

In reply to Greg Kroah-Hartman

From: Ansuel Smith <[email protected]>

commit 2cfef1971aea6119ee27429181d6cb3383031ac2 upstream.

The use of PHY_REFCLK_USE_PAD introduced a regression for apq8064 devices. It was tested that while apq doesn't require the padding, ipq SoC must use it or the kernel hangs on boot.

---
 drivers/pci/controller/dwc/pcie-qcom.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/pci/controller/dwc/pcie-qcom.c +3 -1
@@ -395,7 +395,9 @@ static int qcom_pcie_init_2_1_0(struct q
 
 	/* enable external reference clock */
 	val = readl(pcie->parf + PCIE20_PARF_PHY_REFCLK);
-	val &= ~PHY_REFCLK_USE_PAD;
+	/* USE_PAD is required only for ipq806x */
+	if (!of_device_is_compatible(node, "qcom,pcie-apq8064"))
+		val &= ~PHY_REFCLK_USE_PAD;
 	val |= PHY_REFCLK_SSP_EN;
 	writel(val, pcie->parf + PCIE20_PARF_PHY_REFCLK);
 
author maintainer
#10 lore raw

PATCH 10/663 PCI: Decline to resize resources if boot config must be preserved

In reply to Greg Kroah-Hartman

From: Ard Biesheuvel <[email protected]>

commit 729e3a669d1b62e9876a671ac03ccba399a23b68 upstream.

The _DSM #5 method in the ACPI host bridge object tells us whether the OS must preserve the resource assignments done by firmware. If this is the case, we should not permit drivers to resize BARs on the fly. Make pci_resize_resource() take this into account.

---
 drivers/pci/setup-res.c |    6 ++++++
 1 file changed, 6 insertions(+)
drivers/pci/setup-res.c +6 -0
@@ -410,10 +410,16 @@ EXPORT_SYMBOL(pci_release_resource);
 int pci_resize_resource(struct pci_dev *dev, int resno, int size)
 {
 	struct resource *res = dev->resource + resno;
+	struct pci_host_bridge *host;
 	int old, ret;
 	u32 sizes;
 	u16 cmd;
 
+	/* Check if we must preserve the firmware's resource assignment */
+	host = pci_find_host_bridge(dev->bus);
+	if (host->preserve_config)
+		return -ENOTSUPP;
+
 	/* Make sure the resource isn't assigned before resizing it. */
 	if (!(res->flags & IORESOURCE_UNSET))
 		return -EBUSY;
author maintainer
#11 lore raw

PATCH 11/663 virt: vbox: Do not use wait_event_interruptible when called from kernel context

In reply to Greg Kroah-Hartman

From: Hans de Goede <[email protected]>

commit c35901b39ddc20077f4ae7b9f7bf344487f62212 upstream.

Do not use wait_event_interruptible when vbg_hgcm_call() gets called from kernel-context, such as it being called by the vboxsf filesystem code.

This fixes some filesystem related system calls on shared folders unexpectedly failing with -EINTR.

Fixes 0532a1b0d045 ("virt: vbox: Implement passing requestor info to the host for VirtualBox 6.0.x")
Cc stable <[email protected]>
---
 drivers/virt/vboxguest/vboxguest_utils.c |   18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
drivers/virt/vboxguest/vboxguest_utils.c +12 -6
@@ -468,7 +468,7 @@ static int hgcm_cancel_call(struct vbg_d
  *               Cancellation fun.
  */
 static int vbg_hgcm_do_call(struct vbg_dev *gdev, struct vmmdev_hgcm_call *call,
-			    u32 timeout_ms, bool *leak_it)
+			    u32 timeout_ms, bool interruptible, bool *leak_it)
 {
 	int rc, cancel_rc, ret;
 	long timeout;
@@ -495,10 +495,15 @@ static int vbg_hgcm_do_call(struct vbg_d
 	else
 		timeout = msecs_to_jiffies(timeout_ms);
 
-	timeout = wait_event_interruptible_timeout(
-					gdev->hgcm_wq,
-					hgcm_req_done(gdev, &call->header),
-					timeout);
+	if (interruptible) {
+		timeout = wait_event_interruptible_timeout(gdev->hgcm_wq,
+							   hgcm_req_done(gdev, &call->header),
+							   timeout);
+	} else {
+		timeout = wait_event_timeout(gdev->hgcm_wq,
+					     hgcm_req_done(gdev, &call->header),
+					     timeout);
+	}
 
 	/* timeout > 0 means hgcm_req_done has returned true, so success */
 	if (timeout > 0)
@@ -631,7 +636,8 @@ int vbg_hgcm_call(struct vbg_dev *gdev,
 	hgcm_call_init_call(call, client_id, function, parms, parm_count,
 			    bounce_bufs);
 
-	ret = vbg_hgcm_do_call(gdev, call, timeout_ms, &leak_it);
+	ret = vbg_hgcm_do_call(gdev, call, timeout_ms,
+			       requestor & VMMDEV_REQUESTOR_USERMODE, &leak_it);
 	if (ret == 0) {
 		*vbox_status = call->header.result;
 		ret = hgcm_call_copy_back_result(call, parms, parm_count,
author maintainer
#12 lore raw

PATCH 12/663 bfq: Avoid false bfq queue merging

In reply to Greg Kroah-Hartman

From: Jan Kara <[email protected]>

commit 41e76c85660c022c6bf5713bfb6c21e64a487cec upstream.

bfq_setup_cooperator() uses bfqd->in_serv_last_pos so detect whether it makes sense to merge current bfq queue with the in-service queue. However if the in-service queue is freshly scheduled and didn't dispatch any requests yet, bfqd->in_serv_last_pos is stale and contains value from the previously scheduled bfq queue which can thus result in a bogus decision that the two queues should be merged. This bug can be observed for example with the following fio jobfile:

[global]
direct=0
ioengine=sync
invalidate=1
size=1g
rw=read

[reader]
numjobs=4
directory=/mnt

where the 4 processes will end up in the one shared bfq queue although they do IO to physically very distant files (for some reason I was able to observe this only with slice_idle=1ms setting).

Fix the problem by invalidating bfqd->in_serv_last_pos when switching in-service queue.

Fixes 058fdecc6de7 ("block, bfq: fix in-service-queue check for queue merging")
---
 block/bfq-iosched.c |    1 +
 1 file changed, 1 insertion(+)
block/bfq-iosched.c +1 -0
@@ -2937,6 +2937,7 @@ static void __bfq_set_in_service_queue(s
 	}
 
 	bfqd->in_service_queue = bfqq;
+	bfqd->in_serv_last_pos = 0;
 }
 
 /*
author maintainer
#13 lore raw

PATCH 13/663 ALSA: usb-audio: Fix PCM buffer allocation in non-vmalloc mode

In reply to Greg Kroah-Hartman

From: Takashi Iwai <[email protected]>

commit fb3c293b82c31a9a68fbcf4e7a45fadd8a47ea2b upstream.

The commit f274baa49be6 ("ALSA: usb-audio: Allow non-vmalloc buffer for PCM buffers") introduced the mode to allocate coherent pages for PCM buffers, and it used bus->controller device as its DMA device. It turned out, however, that bus->sysdev is a more appropriate device to be used for DMA mapping in HCD code.

This patch corrects the device reference accordingly.

Note that, on most platforms, both point to the very same device, hence this patch doesn't change anything practically. But on platforms like xhcd-plat hcd, the change becomes effective.

Fixes f274baa49be6 ("ALSA: usb-audio: Allow non-vmalloc buffer for PCM buffers")
---
 sound/usb/pcm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/usb/pcm.c +1 -1
@@ -1861,7 +1861,7 @@ void snd_usb_preallocate_buffer(struct s
 {
 	struct snd_pcm *pcm = subs->stream->pcm;
 	struct snd_pcm_substream *s = pcm->streams[subs->direction].substream;
-	struct device *dev = subs->dev->bus->controller;
+	struct device *dev = subs->dev->bus->sysdev;
 
 	if (snd_usb_use_vmalloc)
 		snd_pcm_set_managed_buffer(s, SNDRV_DMA_TYPE_VMALLOC,
author maintainer
#14 lore raw

PATCH 14/663 MIPS: vmlinux.lds.S: add missing PAGE_ALIGNED_DATA() section

In reply to Greg Kroah-Hartman

From: Alexander Lobakin <[email protected]>

commit 8ac7c87acdcac156670f9920c8acbd84308ff4b1 upstream.

MIPS uses its own declaration of rwdata, and thus it should be kept in sync with the asm-generic one. Currently PAGE_ALIGNED_DATA() is missing from the linker script, which emits the following ld warnings:

mips-alpine-linux-musl-ld: warning: orphan section .data..page_aligned' from arch/mips/kernel/vdso.o' being placed in section `.data..page_aligned'
mips-alpine-linux-musl-ld: warning: orphan section .data..page_aligned' from arch/mips/vdso/vdso-image.o' being placed in section `.data..page_aligned'

Add the necessary declaration, so the mentioned structures will be placed in vmlinux as intended:

ffffffff80630580 D __end_once
ffffffff80630580 D __start___dyndbg
ffffffff80630580 D __start_once
ffffffff80630580 D __stop___dyndbg
ffffffff80634000 d mips_vdso_data
ffffffff80638000 d vdso_data
ffffffff80638580 D _gp
ffffffff8063c000 T __init_begin
ffffffff8063c000 D _edata
ffffffff8063c000 T _sinittext

->

ffffffff805a4000 D __end_init_task
ffffffff805a4000 D __nosave_begin
ffffffff805a4000 D __nosave_end
ffffffff805a4000 d mips_vdso_data
ffffffff805a8000 d vdso_data
ffffffff805ac000 D mmlist_lock
ffffffff805ac080 D tasklist_lock

Fixes ebb5e78cc634 ("MIPS: Initial implementation of a VDSO")
---
 arch/mips/kernel/vmlinux.lds.S |    1 +
 1 file changed, 1 insertion(+)
arch/mips/kernel/vmlinux.lds.S +1 -0
@@ -90,6 +90,7 @@ SECTIONS
 
 		INIT_TASK_DATA(THREAD_SIZE)
 		NOSAVE_DATA
+		PAGE_ALIGNED_DATA(PAGE_SIZE)
 		CACHELINE_ALIGNED_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
 		READ_MOSTLY_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
 		DATA_DATA
author maintainer
#15 lore raw

PATCH 15/663 vmlinux.lds.h: Define SANTIZER_DISCARDS with CONFIG_GCOV_KERNEL=y

In reply to Greg Kroah-Hartman

From: Nathan Chancellor <[email protected]>

commit f5b6a74d9c08b19740ca056876bf6584acdba582 upstream.

clang produces .eh_frame sections when CONFIG_GCOV_KERNEL is enabled, even when -fno-asynchronous-unwind-tables is in KBUILD_CFLAGS:

$ make CC=clang vmlinux
...
ld: warning: orphan section `.eh_frame' from `init/main.o' being placed in section `.eh_frame'
ld: warning: orphan section `.eh_frame' from `init/version.o' being placed in section `.eh_frame'
ld: warning: orphan section `.eh_frame' from `init/do_mounts.o' being placed in section `.eh_frame'
ld: warning: orphan section `.eh_frame' from `init/do_mounts_initrd.o' being placed in section `.eh_frame'
ld: warning: orphan section `.eh_frame' from `init/initramfs.o' being placed in section `.eh_frame'
ld: warning: orphan section `.eh_frame' from `init/calibrate.o' being placed in section `.eh_frame'
ld: warning: orphan section `.eh_frame' from `init/init_task.o' being placed in section `.eh_frame'
...
$ rg "GCOV_KERNEL|GCOV_PROFILE_ALL" .config
CONFIG_GCOV_KERNEL=y
CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
CONFIG_GCOV_PROFILE_ALL=y

This was already handled for a couple of other options in commit d812db78288d ("vmlinux.lds.h: Avoid KASAN and KCSAN's unwanted sections") and there is an open LLVM bug for this issue. Take advantage of that section for this config as well so that there are no more orphan warnings.

---
 include/asm-generic/vmlinux.lds.h |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
include/asm-generic/vmlinux.lds.h +5 -4
@@ -993,12 +993,13 @@
 #endif
 
 /*
- * Clang's -fsanitize=kernel-address and -fsanitize=thread produce
- * unwanted sections (.eh_frame and .init_array.*), but
- * CONFIG_CONSTRUCTORS wants to keep any .init_array.* sections.
+ * Clang's -fprofile-arcs, -fsanitize=kernel-address, and
+ * -fsanitize=thread produce unwanted sections (.eh_frame
+ * and .init_array.*), but CONFIG_CONSTRUCTORS wants to
+ * keep any .init_array.* sections.
  * https://bugs.llvm.org/show_bug.cgi?id=46478
  */
-#if defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KCSAN)
+#if defined(CONFIG_GCOV_KERNEL) || defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KCSAN)
 # ifdef CONFIG_CONSTRUCTORS
 #  define SANITIZER_DISCARDS						\
 	*(.eh_frame)
author maintainer
#16 lore raw

PATCH 16/663 random: fix the RNDRESEEDCRNG ioctl

In reply to Greg Kroah-Hartman

From: Eric Biggers <[email protected]>

commit 11a0b5e0ec8c13bef06f7414f9e914506140d5cb upstream.

The RNDRESEEDCRNG ioctl reseeds the primary_crng from itself, which doesn't make sense. Reseed it from the input_pool instead.

---
 drivers/char/random.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/random.c +1 -1
@@ -1972,7 +1972,7 @@ static long random_ioctl(struct file *f,
 			return -EPERM;
 		if (crng_init < 2)
 			return -ENODATA;
-		crng_reseed(&primary_crng, NULL);
+		crng_reseed(&primary_crng, &input_pool);
 		crng_global_init_time = jiffies - 1;
 		return 0;
 	default:
author maintainer
#17 lore raw

PATCH 17/663 ALSA: pcm: Call sync_stop at disconnection

In reply to Greg Kroah-Hartman

From: Takashi Iwai <[email protected]>

commit 29bb274e94974669acb5186a75538f20df1508b6 upstream.

The PCM core should perform the sync for the pending stop operations at disconnection. Otherwise it may lead to unexpected access.

Currently the old user of sync_stop, USB-audio driver, has its own sync, so this isn't needed, but it's better to guarantee the sync in the PCM core level.

This patch adds the missing sync_stop call at PCM disconnection callback. It also assures the IRQ sync if it's specified in the card. snd_pcm_sync_stop() is slightly modified to be called also for any PCM substream object now.

Fixes 1e850beea278 ("ALSA: pcm: Add the support for sync-stop operation")
---
 sound/core/init.c       |    4 ++++
 sound/core/pcm.c        |    4 ++++
 sound/core/pcm_local.h  |    1 +
 sound/core/pcm_native.c |   16 ++++++++--------
 4 files changed, 17 insertions(+), 8 deletions(-)
sound/core/init.c +4 -0
@@ -14,6 +14,7 @@
 #include <linux/ctype.h>
 #include <linux/pm.h>
 #include <linux/completion.h>
+#include <linux/interrupt.h>
 
 #include <sound/core.h>
 #include <sound/control.h>
@@ -418,6 +419,9 @@ int snd_card_disconnect(struct snd_card
 	/* notify all devices that we are disconnected */
 	snd_device_disconnect_all(card);
 
+	if (card->sync_irq > 0)
+		synchronize_irq(card->sync_irq);
+
 	snd_info_card_disconnect(card);
 	if (card->registered) {
 		device_del(&card->card_dev);
sound/core/pcm.c +4 -0
@@ -1111,6 +1111,10 @@ static int snd_pcm_dev_disconnect(struct
 		}
 	}
 
+	for (cidx = 0; cidx < 2; cidx++)
+		for (substream = pcm->streams[cidx].substream; substream; substream = substream->next)
+			snd_pcm_sync_stop(substream, false);
+
 	pcm_call_notify(pcm, n_disconnect);
 	for (cidx = 0; cidx < 2; cidx++) {
 		snd_unregister_device(&pcm->streams[cidx].dev);
sound/core/pcm_local.h +1 -0
@@ -63,6 +63,7 @@ static inline void snd_pcm_timer_done(st
 
 void __snd_pcm_xrun(struct snd_pcm_substream *substream);
 void snd_pcm_group_init(struct snd_pcm_group *group);
+void snd_pcm_sync_stop(struct snd_pcm_substream *substream, bool sync_irq);
 
 #ifdef CONFIG_SND_DMA_SGBUF
 struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream,
sound/core/pcm_native.c +8 -8
@@ -583,13 +583,13 @@ static inline void snd_pcm_timer_notify(
 #endif
 }
 
-static void snd_pcm_sync_stop(struct snd_pcm_substream *substream)
+void snd_pcm_sync_stop(struct snd_pcm_substream *substream, bool sync_irq)
 {
-	if (substream->runtime->stop_operating) {
+	if (substream->runtime && substream->runtime->stop_operating) {
 		substream->runtime->stop_operating = false;
-		if (substream->ops->sync_stop)
+		if (substream->ops && substream->ops->sync_stop)
 			substream->ops->sync_stop(substream);
-		else if (substream->pcm->card->sync_irq > 0)
+		else if (sync_irq && substream->pcm->card->sync_irq > 0)
 			synchronize_irq(substream->pcm->card->sync_irq);
 	}
 }
@@ -686,7 +686,7 @@ static int snd_pcm_hw_params(struct snd_
 		if (atomic_read(&substream->mmap_count))
 			return -EBADFD;
 
-	snd_pcm_sync_stop(substream);
+	snd_pcm_sync_stop(substream, true);
 
 	params->rmask = ~0U;
 	err = snd_pcm_hw_refine(substream, params);
@@ -809,7 +809,7 @@ static int do_hw_free(struct snd_pcm_sub
 {
 	int result = 0;
 
-	snd_pcm_sync_stop(substream);
+	snd_pcm_sync_stop(substream, true);
 	if (substream->ops->hw_free)
 		result = substream->ops->hw_free(substream);
 	if (substream->managed_buffer_alloc)
@@ -1736,7 +1736,7 @@ static void snd_pcm_post_resume(struct s
 	snd_pcm_trigger_tstamp(substream);
 	runtime->status->state = runtime->status->suspended_state;
 	snd_pcm_timer_notify(substream, SNDRV_TIMER_EVENT_MRESUME);
-	snd_pcm_sync_stop(substream);
+	snd_pcm_sync_stop(substream, true);
 }
 
 static const struct action_ops snd_pcm_action_resume = {
@@ -1866,7 +1866,7 @@ static int snd_pcm_do_prepare(struct snd
 			      snd_pcm_state_t state)
 {
 	int err;
-	snd_pcm_sync_stop(substream);
+	snd_pcm_sync_stop(substream, true);
 	err = substream->ops->prepare(substream);
 	if (err < 0)
 		return err;
author maintainer
#18 lore raw

PATCH 18/663 ALSA: pcm: Assure sync with the pending stop operation at suspend

In reply to Greg Kroah-Hartman

From: Takashi Iwai <[email protected]>

commit 2c87c1a49c9d113a9f3e8e951d7d64be5ff50ac1 upstream.

The current PCM code calls the sync_stop at the resume action due to the analogy to the PCM prepare call pattern. But, it makes little sense, as the sync should have been done rather at the suspend time, not at the resume time.

This patch corrects the sync_stop call at suspend/resume to assure the sync before finishing the suspend.

Fixes 1e850beea278 ("ALSA: pcm: Add the support for sync-stop operation")
---
 sound/core/pcm_native.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
sound/core/pcm_native.c +7 -1
@@ -1615,6 +1615,7 @@ static int snd_pcm_do_suspend(struct snd
 	if (! snd_pcm_running(substream))
 		return 0;
 	substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_SUSPEND);
+	runtime->stop_operating = true;
 	return 0; /* suspend unconditionally */
 }
 
@@ -1691,6 +1692,12 @@ int snd_pcm_suspend_all(struct snd_pcm *
 				return err;
 		}
 	}
+
+	for (stream = 0; stream < 2; stream++)
+		for (substream = pcm->streams[stream].substream;
+		     substream; substream = substream->next)
+			snd_pcm_sync_stop(substream, false);
+
 	return 0;
 }
 EXPORT_SYMBOL(snd_pcm_suspend_all);
@@ -1736,7 +1743,6 @@ static void snd_pcm_post_resume(struct s
 	snd_pcm_trigger_tstamp(substream);
 	runtime->status->state = runtime->status->suspended_state;
 	snd_pcm_timer_notify(substream, SNDRV_TIMER_EVENT_MRESUME);
-	snd_pcm_sync_stop(substream, true);
 }
 
 static const struct action_ops snd_pcm_action_resume = {
author maintainer
#19 lore raw

PATCH 19/663 ALSA: pcm: Dont call sync_stop if it hasnt been stopped

In reply to Greg Kroah-Hartman

From: Takashi Iwai <[email protected]>

commit 700cb70730777c159a988e01daa93f20a1ae9b58 upstream.

The PCM stop operation sets the stop_operating flag for indicating the sync_stop post-process. This flag is, however, set unconditionally even if the PCM trigger weren't issued. This may lead to inconsistency in the driver side.

Correct the code to set stop_operating flag only after the trigger STOP is actually called.

Fixes 1e850beea278 ("ALSA: pcm: Add the support for sync-stop operation")
---
 sound/core/pcm_native.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
sound/core/pcm_native.c +3 -2
@@ -1421,8 +1421,10 @@ static int snd_pcm_do_stop(struct snd_pc
 			   snd_pcm_state_t state)
 {
 	if (substream->runtime->trigger_master == substream &&
-	    snd_pcm_running(substream))
+	    snd_pcm_running(substream)) {
 		substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_STOP);
+		substream->runtime->stop_operating = true;
+	}
 	return 0; /* unconditonally stop all substreams */
 }
 
@@ -1435,7 +1437,6 @@ static void snd_pcm_post_stop(struct snd
 		runtime->status->state = state;
 		snd_pcm_timer_notify(substream, SNDRV_TIMER_EVENT_MSTOP);
 	}
-	runtime->stop_operating = true;
 	wake_up(&runtime->sleep);
 	wake_up(&runtime->tsleep);
 }
author maintainer
#20 lore raw

PATCH 20/663 drm/i915/gt: One more flush for Baytrail clear residuals

In reply to Greg Kroah-Hartman

From: Chris Wilson <[email protected]>

commit e627d5923cae93fa4188f4c4afba6486169a1337 upstream.

CI reports that Baytail requires one more invalidate after CACHE_MODE for it to be happy.

Fixes ace44e13e577 ("drm/i915/gt: Clear CACHE_MODE prior to clearing residuals")
Cc Mika Kuoppala <[email protected]>
Cc Akeem G Abodunrin <[email protected]>
Cc Hans de Goede <[email protected]>
Cc Diego Calleja <[email protected]>
---
 drivers/gpu/drm/i915/gt/gen7_renderclear.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gt/gen7_renderclear.c +6 -3
@@ -353,19 +353,21 @@ static void gen7_emit_pipeline_flush(str
 
 static void gen7_emit_pipeline_invalidate(struct batch_chunk *batch)
 {
-	u32 *cs = batch_alloc_items(batch, 0, 8);
+	u32 *cs = batch_alloc_items(batch, 0, 10);
 
 	/* ivb: Stall before STATE_CACHE_INVALIDATE */
-	*cs++ = GFX_OP_PIPE_CONTROL(4);
+	*cs++ = GFX_OP_PIPE_CONTROL(5);
 	*cs++ = PIPE_CONTROL_STALL_AT_SCOREBOARD |
 		PIPE_CONTROL_CS_STALL;
 	*cs++ = 0;
 	*cs++ = 0;
+	*cs++ = 0;
 
-	*cs++ = GFX_OP_PIPE_CONTROL(4);
+	*cs++ = GFX_OP_PIPE_CONTROL(5);
 	*cs++ = PIPE_CONTROL_STATE_CACHE_INVALIDATE;
 	*cs++ = 0;
 	*cs++ = 0;
+	*cs++ = 0;
 
 	batch_advance(batch, cs);
 }
@@ -397,6 +399,7 @@ static void emit_batch(struct i915_vma *
 	batch_add(&cmds, 0xffff0000);
 	batch_add(&cmds, i915_mmio_reg_offset(CACHE_MODE_1));
 	batch_add(&cmds, 0xffff0000 | PIXEL_SUBSPAN_COLLECT_OPT_DISABLE);
+	gen7_emit_pipeline_invalidate(&cmds);
 	gen7_emit_pipeline_flush(&cmds);
 
 	/* Switch to the media pipeline and our base address */
author maintainer
#21 lore raw

PATCH 21/663 ath10k: Fix error handling in case of CE pipe init failure

In reply to Greg Kroah-Hartman

From: Rakesh Pillai <[email protected]>

[ Upstream commit 31561e8557cd1eeba5806ac9ce820f8323b2201b ]

Currently if the copy engine pipe init fails for snoc based chipsets, the rri is not freed.

Fix this error handling for copy engine pipe init
failure.

Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.1-01040-QCAHLSWMTPLZ-1

Fixes 4945af5b264f ("ath10k: enable SRRI/DRRI support on ddr for WCN3990")
---
 drivers/net/wireless/ath/ath10k/snoc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath10k/snoc.c +3 -2
index fd41f25456dc4..daae470ecf5aa 100644
@@ -1045,12 +1045,13 @@ static int ath10k_snoc_hif_power_up(struct ath10k *ar,
 	ret = ath10k_snoc_init_pipes(ar);
 	if (ret) {
 		ath10k_err(ar, "failed to initialize CE: %d\n", ret);
-		goto err_wlan_enable;
+		goto err_free_rri;
 	}
 
 	return 0;
 
-err_wlan_enable:
+err_free_rri:
+	ath10k_ce_free_rri(ar);
 	ath10k_snoc_wlan_disable(ar);
 
 	return ret;
Signature · 1 line
2.27.0
author maintainer
#22 lore raw

PATCH 22/663 Bluetooth: btqcomsmd: Fix a resource leak in error handling paths in the probe function

In reply to Greg Kroah-Hartman

From: Christophe JAILLET <[email protected]>

[ Upstream commit 9a39a927be01d89e53f04304ab99a8761e08910d ]

Some resource should be released in the error handling path of the probe function, as already done in the remove function.

The remove function was fixed in commit 5052de8deff5 ("soc: qcom: smd:
Transition client drivers from smd to rpmsg")

Fixes 1511cc750c3d ("Bluetooth: Introduce Qualcomm WCNSS SMD based HCI driver")
---
 drivers/bluetooth/btqcomsmd.c | 27 +++++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)
drivers/bluetooth/btqcomsmd.c +19 -8
index 98d53764871f5..2acb719e596f5 100644
@@ -142,12 +142,16 @@ static int btqcomsmd_probe(struct platform_device *pdev)
 
 	btq->cmd_channel = qcom_wcnss_open_channel(wcnss, "APPS_RIVA_BT_CMD",
 						   btqcomsmd_cmd_callback, btq);
-	if (IS_ERR(btq->cmd_channel))
-		return PTR_ERR(btq->cmd_channel);
+	if (IS_ERR(btq->cmd_channel)) {
+		ret = PTR_ERR(btq->cmd_channel);
+		goto destroy_acl_channel;
+	}
 
 	hdev = hci_alloc_dev();
-	if (!hdev)
-		return -ENOMEM;
+	if (!hdev) {
+		ret = -ENOMEM;
+		goto destroy_cmd_channel;
+	}
 
 	hci_set_drvdata(hdev, btq);
 	btq->hdev = hdev;
@@ -161,14 +165,21 @@ static int btqcomsmd_probe(struct platform_device *pdev)
 	hdev->set_bdaddr = qca_set_bdaddr_rome;
 
 	ret = hci_register_dev(hdev);
-	if (ret < 0) {
-		hci_free_dev(hdev);
-		return ret;
-	}
+	if (ret < 0)
+		goto hci_free_dev;
 
 	platform_set_drvdata(pdev, btq);
 
 	return 0;
+
+hci_free_dev:
+	hci_free_dev(hdev);
+destroy_cmd_channel:
+	rpmsg_destroy_ept(btq->cmd_channel);
+destroy_acl_channel:
+	rpmsg_destroy_ept(btq->acl_channel);
+
+	return ret;
 }
 
 static int btqcomsmd_remove(struct platform_device *pdev)
Signature · 1 line
2.27.0
author maintainer
#23 lore raw

PATCH 23/663 Bluetooth: hci_uart: Fix a race for write_work scheduling

In reply to Greg Kroah-Hartman

From: Claire Chang <[email protected]>

[ Upstream commit afe0b1c86458f121b085271e4f3034017a90d4a3 ]

In hci_uart_write_work, there is a loop/goto checking the value of HCI_UART_TX_WAKEUP. If HCI_UART_TX_WAKEUP is set again, it keeps trying hci_uart_dequeue; otherwise, it clears HCI_UART_SENDING and returns.

In hci_uart_tx_wakeup, if HCI_UART_SENDING is already set, it sets HCI_UART_TX_WAKEUP, skips schedule_work and assumes the running/pending hci_uart_write_work worker will do hci_uart_dequeue properly.

However, if the HCI_UART_SENDING check in hci_uart_tx_wakeup is done after the loop breaks, but before HCI_UART_SENDING is cleared in hci_uart_write_work, the schedule_work is skipped incorrectly.

Fix this race by changing the order of HCI_UART_SENDING and HCI_UART_TX_WAKEUP modification.

Fixes 1da177e4c3f4 ("Linux-2.6.12-rc2")
Fixes 82f5169bf3d3 ("Bluetooth: hci_uart: add serdev driver support library")
---
 drivers/bluetooth/hci_ldisc.c  | 7 +++----
 drivers/bluetooth/hci_serdev.c | 4 ++--
 2 files changed, 5 insertions(+), 6 deletions(-)
drivers/bluetooth/hci_ldisc.c +3 -4
index f83d67eafc9f0..8be4d807d1370 100644
@@ -127,10 +127,9 @@ int hci_uart_tx_wakeup(struct hci_uart *hu)
 	if (!test_bit(HCI_UART_PROTO_READY, &hu->flags))
 		goto no_schedule;
 
-	if (test_and_set_bit(HCI_UART_SENDING, &hu->tx_state)) {
-		set_bit(HCI_UART_TX_WAKEUP, &hu->tx_state);
+	set_bit(HCI_UART_TX_WAKEUP, &hu->tx_state);
+	if (test_and_set_bit(HCI_UART_SENDING, &hu->tx_state))
 		goto no_schedule;
-	}
 
 	BT_DBG("");
 
@@ -174,10 +173,10 @@ restart:
 		kfree_skb(skb);
 	}
 
+	clear_bit(HCI_UART_SENDING, &hu->tx_state);
 	if (test_bit(HCI_UART_TX_WAKEUP, &hu->tx_state))
 		goto restart;
 
-	clear_bit(HCI_UART_SENDING, &hu->tx_state);
 	wake_up_bit(&hu->tx_state, HCI_UART_SENDING);
 }
 
drivers/bluetooth/hci_serdev.c +2 -2
index ef96ad06fa54e..9e03402ef1b37 100644
@@ -83,9 +83,9 @@ static void hci_uart_write_work(struct work_struct *work)
 			hci_uart_tx_complete(hu, hci_skb_pkt_type(skb));
 			kfree_skb(skb);
 		}
-	} while (test_bit(HCI_UART_TX_WAKEUP, &hu->tx_state));
 
-	clear_bit(HCI_UART_SENDING, &hu->tx_state);
+		clear_bit(HCI_UART_SENDING, &hu->tx_state);
+	} while (test_bit(HCI_UART_TX_WAKEUP, &hu->tx_state));
 }
 
 /* ------- Interface to HCI layer ------ */
Signature · 1 line
2.27.0
author maintainer
#24 lore raw

PATCH 24/663 Bluetooth: Fix initializing response id after clearing struct

In reply to Greg Kroah-Hartman

From: Christopher William Snowhill <[email protected]>

[ Upstream commit a5687c644015a097304a2e47476c0ecab2065734 ]

Looks like this was missed when patching the source to clear the structures throughout, causing this one instance to clear the struct after the response id is assigned.

Fixes eddb7732119d ("Bluetooth: A2MP: Fix not initializing all members")
---
 net/bluetooth/a2mp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/a2mp.c +1 -1
index da7fd7c8c2dc0..cc26e4c047ad0 100644
@@ -381,9 +381,9 @@ static int a2mp_getampassoc_req(struct amp_mgr *mgr, struct sk_buff *skb,
 	hdev = hci_dev_get(req->id);
 	if (!hdev || hdev->amp_type == AMP_TYPE_BREDR || tmp) {
 		struct a2mp_amp_assoc_rsp rsp;
-		rsp.id = req->id;
 
 		memset(&rsp, 0, sizeof(rsp));
+		rsp.id = req->id;
 
 		if (tmp) {
 			rsp.status = A2MP_STATUS_COLLISION_OCCURED;
Signature · 1 line
2.27.0
author maintainer
#25 lore raw

PATCH 25/663 arm64: dts: renesas: beacon kit: Fix choppy Bluetooth Audio

In reply to Greg Kroah-Hartman

From: Adam Ford <[email protected]>

[ Upstream commit db030c5a9658846a42fbed4d43a8b5f28a2d7ab7 ]

The Bluetooth chip is capable of operating at 4Mbps, but the max-speed setting was on the UART node instead of the Bluetooth node, so the chip didn't operate at the correct speed resulting in choppy audio. Fix this by setting the max-speed in the proper node.

Fixes a1d8a344f1ca ("arm64: dts: renesas: Introduce r8a774a1-beacon-rzg2m-kit")
---
 arch/arm64/boot/dts/renesas/beacon-renesom-som.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/renesas/beacon-renesom-som.dtsi +1 -1
index 97272f5fa0abf..6d24b36ca0a7c 100644
@@ -88,7 +88,6 @@
 	pinctrl-names = "default";
 	uart-has-rtscts;
 	status = "okay";
-	max-speed = <4000000>;
 
 	bluetooth {
 		compatible = "brcm,bcm43438-bt";
@@ -97,6 +96,7 @@
 		device-wakeup-gpios = <&pca9654 5 GPIO_ACTIVE_HIGH>;
 		clocks = <&osc_32k>;
 		clock-names = "extclk";
+		max-speed = <4000000>;
 	};
 };
 
Signature · 1 line
2.27.0
author maintainer
#26 lore raw

PATCH 26/663 arm64: dts: renesas: beacon: Fix audio-1.8V pin enable

In reply to Greg Kroah-Hartman

From: Adam Ford <[email protected]>

[ Upstream commit 5a5da0b758b327b727c5392d7f11e046e113a195 ]

The fact the audio worked at all was a coincidence because the wrong gpio enable was used. Use the correct GPIO pin to ensure its operation.

Fixes a1d8a344f1ca ("arm64: dts: renesas: Introduce r8a774a1-beacon-rzg2m-kit")
---
 arch/arm64/boot/dts/renesas/beacon-renesom-baseboard.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/renesas/beacon-renesom-baseboard.dtsi +1 -1
index 66c9153b31015..597388f871272 100644
@@ -150,7 +150,7 @@
 		regulator-name = "audio-1.8V";
 		regulator-min-microvolt = <1800000>;
 		regulator-max-microvolt = <1800000>;
-		gpio = <&gpio_exp2 7 GPIO_ACTIVE_HIGH>;
+		gpio = <&gpio_exp4 1 GPIO_ACTIVE_HIGH>;
 		enable-active-high;
 	};
 
Signature · 1 line
2.27.0
author maintainer
#27 lore raw

PATCH 27/663 ARM: dts: exynos: correct PMIC interrupt trigger level on Artik 5

In reply to Greg Kroah-Hartman

From: Krzysztof Kozlowski <[email protected]>

[ Upstream commit cb31334687db31c691901269d65074a7ffaecb18 ]

The Samsung PMIC datasheets describe the interrupt line as active low with a requirement of acknowledge from the CPU. Without specifying the interrupt type in Devicetree, kernel might apply some fixed configuration, not necessarily working for this hardware.

Fixes b004a34bd0ff ("ARM: dts: exynos: Add exynos3250-artik5 dtsi file for ARTIK5 module")
---
 arch/arm/boot/dts/exynos3250-artik5.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/exynos3250-artik5.dtsi +1 -1
index 12887b3924af8..ad525f2accbb4 100644
@@ -79,7 +79,7 @@
 	s2mps14_pmic@66 {
 		compatible = "samsung,s2mps14-pmic";
 		interrupt-parent = <&gpx3>;
-		interrupts = <5 IRQ_TYPE_NONE>;
+		interrupts = <5 IRQ_TYPE_LEVEL_LOW>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&s2mps14_irq>;
 		reg = <0x66>;
Signature · 1 line
2.27.0
author maintainer
#28 lore raw

PATCH 28/663 ARM: dts: exynos: correct PMIC interrupt trigger level on Monk

In reply to Greg Kroah-Hartman

From: Krzysztof Kozlowski <[email protected]>

[ Upstream commit 8528cda2b7c667e9cd173aef1a677c71b7d5a096 ]

The Samsung PMIC datasheets describe the interrupt line as active low with a requirement of acknowledge from the CPU. Without specifying the interrupt type in Devicetree, kernel might apply some fixed configuration, not necessarily working for this hardware.

Fixes e0cefb3f79d3 ("ARM: dts: add board dts file for Exynos3250-based Monk board")
---
 arch/arm/boot/dts/exynos3250-monk.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/exynos3250-monk.dts +1 -1
index c1a68e6120370..7e99e5812a4d3 100644
@@ -200,7 +200,7 @@
 	s2mps14_pmic@66 {
 		compatible = "samsung,s2mps14-pmic";
 		interrupt-parent = <&gpx0>;
-		interrupts = <7 IRQ_TYPE_NONE>;
+		interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
 		reg = <0x66>;
 		wakeup-source;
 
Signature · 1 line
2.27.0
author maintainer
#29 lore raw

PATCH 29/663 ARM: dts: exynos: correct PMIC interrupt trigger level on Rinato

In reply to Greg Kroah-Hartman

From: Krzysztof Kozlowski <[email protected]>

[ Upstream commit 437ae60947716bb479e2f32466f49445c0509b1e ]

The Samsung PMIC datasheets describe the interrupt line as active low with a requirement of acknowledge from the CPU. Without specifying the interrupt type in Devicetree, kernel might apply some fixed configuration, not necessarily working for this hardware.

Fixes faaf348ef468 ("ARM: dts: Add board dts file for exynos3250-rinato")
---
 arch/arm/boot/dts/exynos3250-rinato.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/exynos3250-rinato.dts +1 -1
index b55afaaa691e8..f9e3b13d3aac2 100644
@@ -270,7 +270,7 @@
 	s2mps14_pmic@66 {
 		compatible = "samsung,s2mps14-pmic";
 		interrupt-parent = <&gpx0>;
-		interrupts = <7 IRQ_TYPE_NONE>;
+		interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
 		reg = <0x66>;
 		wakeup-source;
 
Signature · 1 line
2.27.0
author maintainer
#30 lore raw

PATCH 30/663 ARM: dts: exynos: correct PMIC interrupt trigger level on Spring

In reply to Greg Kroah-Hartman

From: Krzysztof Kozlowski <[email protected]>

[ Upstream commit 77e6a5467cb8657cf8b5e610a30a4c502085e4f9 ]

The Samsung PMIC datasheets describe the interrupt line as active low with a requirement of acknowledge from the CPU. Without specifying the interrupt type in Devicetree, kernel might apply some fixed configuration, not necessarily working for this hardware.

Fixes 53dd4138bb0a ("ARM: dts: Add exynos5250-spring device tree")
---
 arch/arm/boot/dts/exynos5250-spring.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/exynos5250-spring.dts +1 -1
index a92ade33779cf..5a9c936407ea3 100644
@@ -109,7 +109,7 @@
 		compatible = "samsung,s5m8767-pmic";
 		reg = <0x66>;
 		interrupt-parent = <&gpx3>;
-		interrupts = <2 IRQ_TYPE_NONE>;
+		interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&s5m8767_irq &s5m8767_dvs &s5m8767_ds>;
 		wakeup-source;
Signature · 1 line
2.27.0
author maintainer
#31 lore raw

PATCH 31/663 ARM: dts: exynos: correct PMIC interrupt trigger level on Arndale Octa

In reply to Greg Kroah-Hartman

From: Krzysztof Kozlowski <[email protected]>

[ Upstream commit 1ac8893c4fa3d4a34915dc5cdab568a39db5086c ]

The Samsung PMIC datasheets describe the interrupt line as active low with a requirement of acknowledge from the CPU. The falling edge interrupt will mostly work but it's not correct.

Fixes 1fed2252713e ("ARM: dts: fix pinctrl for s2mps11-irq on exynos5420-arndale-octa")
---
 arch/arm/boot/dts/exynos5420-arndale-octa.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/exynos5420-arndale-octa.dts +1 -1
index dd7f8385d81e7..3d9b93d2b242c 100644
@@ -349,7 +349,7 @@
 		reg = <0x66>;
 
 		interrupt-parent = <&gpx3>;
-		interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
+		interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&s2mps11_irq>;
 
Signature · 1 line
2.27.0
author maintainer
#32 lore raw

PATCH 32/663 ARM: dts: exynos: correct PMIC interrupt trigger level on Odroid XU3 family

In reply to Greg Kroah-Hartman

From: Krzysztof Kozlowski <[email protected]>

[ Upstream commit 3e7d9a583a24f7582c6bc29a0d4d624feedbc2f9 ]

The Samsung PMIC datasheets describe the interrupt line as active low with a requirement of acknowledge from the CPU. The falling edge interrupt will mostly work but it's not correct.

Fixes aac4e0615341 ("ARM: dts: odroidxu3: Enable wake alarm of S2MPS11 RTC")
---
 arch/arm/boot/dts/exynos5422-odroid-core.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/exynos5422-odroid-core.dtsi +1 -1
index b1cf9414ce17f..d51c1d8620a09 100644
@@ -509,7 +509,7 @@
 		samsung,s2mps11-acokb-ground;
 
 		interrupt-parent = <&gpx0>;
-		interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
+		interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&s2mps11_irq>;
 
Signature · 1 line
2.27.0
author maintainer
#33 lore raw

PATCH 33/663 arm64: dts: exynos: correct PMIC interrupt trigger level on TM2

In reply to Greg Kroah-Hartman

From: Krzysztof Kozlowski <[email protected]>

[ Upstream commit e98e2367dfb4b6d7a80c8ce795c644124eff5f36 ]

The Samsung PMIC datasheets describe the interrupt line as active low with a requirement of acknowledge from the CPU. Without specifying the interrupt type in Devicetree, kernel might apply some fixed configuration, not necessarily working for this hardware.

Fixes 01e5d2352152 ("arm64: dts: exynos: Add dts file for Exynos5433-based TM2 board")
---
 arch/arm64/boot/dts/exynos/exynos5433-tm2-common.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/exynos/exynos5433-tm2-common.dtsi +1 -1
index 829fea23d4ab1..106397a99da6b 100644
@@ -389,7 +389,7 @@
 	s2mps13-pmic@66 {
 		compatible = "samsung,s2mps13-pmic";
 		interrupt-parent = <&gpa0>;
-		interrupts = <7 IRQ_TYPE_NONE>;
+		interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
 		reg = <0x66>;
 		samsung,s2mps11-wrstbi-ground;
 
Signature · 1 line
2.27.0
author maintainer
#34 lore raw

PATCH 34/663 arm64: dts: exynos: correct PMIC interrupt trigger level on Espresso

In reply to Greg Kroah-Hartman

From: Krzysztof Kozlowski <[email protected]>

[ Upstream commit 1fea2eb2f5bbd3fbbe2513d2386b5f6e6db17fd7 ]

The Samsung PMIC datasheets describe the interrupt line as active low with a requirement of acknowledge from the CPU. Without specifying the interrupt type in Devicetree, kernel might apply some fixed configuration, not necessarily working for this hardware.

Fixes 9589f7721e16 ("arm64: dts: Add S2MPS15 PMIC node on exynos7-espresso")
---
 arch/arm64/boot/dts/exynos/exynos7-espresso.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/exynos/exynos7-espresso.dts +1 -1
index 92fecc539c6c7..358b7b6ea84f1 100644
@@ -90,7 +90,7 @@
 	s2mps15_pmic@66 {
 		compatible = "samsung,s2mps15-pmic";
 		reg = <0x66>;
-		interrupts = <2 IRQ_TYPE_NONE>;
+		interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
 		interrupt-parent = <&gpa0>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&pmic_irq>;
Signature · 1 line
2.27.0
author maintainer
#35 lore raw

PATCH 35/663 memory: mtk-smi: Fix PM usage counter unbalance in mtk_smi ops

In reply to Greg Kroah-Hartman

From: Zhang Qilong <[email protected]>

[ Upstream commit a2d522ff0f5cc26915c4ccee9457fd4b4e1edc48 ]

pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in reference leak here. We fix it by replacing it with pm_runtime_resume_and_get to keep usage counter balanced.

Fixes 4f0a1a1ae3519 ("memory: mtk-smi: Invoke pm runtime_callback to enable clocks")
---
 drivers/memory/mtk-smi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/memory/mtk-smi.c +2 -2
index 691e4c344cf84..75f8e0f60d81d 100644
@@ -130,7 +130,7 @@ static void mtk_smi_clk_disable(const struct mtk_smi *smi)
 
 int mtk_smi_larb_get(struct device *larbdev)
 {
-	int ret = pm_runtime_get_sync(larbdev);
+	int ret = pm_runtime_resume_and_get(larbdev);
 
 	return (ret < 0) ? ret : 0;
 }
@@ -366,7 +366,7 @@ static int __maybe_unused mtk_smi_larb_resume(struct device *dev)
 	int ret;
 
 	/* Power on smi-common. */
-	ret = pm_runtime_get_sync(larb->smi_common_dev);
+	ret = pm_runtime_resume_and_get(larb->smi_common_dev);
 	if (ret < 0) {
 		dev_err(dev, "Failed to pm get for smi-common(%d).\n", ret);
 		return ret;
Signature · 1 line
2.27.0
author maintainer
#36 lore raw

PATCH 36/663 Bluetooth: hci_qca: Fix memleak in qca_controller_memdump

In reply to Greg Kroah-Hartman

From: Dinghao Liu <[email protected]>

[ Upstream commit 71f8e707557b9bc25dc90a59a752528d4e7c1cbf ]

When __le32_to_cpu() fails, qca_memdump should be freed just like when vmalloc() fails.

Fixes d841502c79e3f ("Bluetooth: hci_qca: Collect controller memory dump during SSR")
---
 drivers/bluetooth/hci_qca.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/bluetooth/hci_qca.c +2 -0
index 244b8feba5232..5c26c7d941731 100644
@@ -1020,7 +1020,9 @@ static void qca_controller_memdump(struct work_struct *work)
 			dump_size = __le32_to_cpu(dump->dump_size);
 			if (!(dump_size)) {
 				bt_dev_err(hu->hdev, "Rx invalid memdump size");
+				kfree(qca_memdump);
 				kfree_skb(skb);
+				qca->qca_memdump = NULL;
 				mutex_unlock(&qca->hci_memdump_lock);
 				return;
 			}
Signature · 1 line
2.27.0
author maintainer
#37 lore raw

PATCH 37/663 staging: vchiq: Fix bulk userdata handling

In reply to Greg Kroah-Hartman

From: Phil Elwell <[email protected]>

[ Upstream commit 96ae327678eceabf455b11a88ba14ad540d4b046 ]

The addition of the local 'userdata' pointer to vchiq_irq_queue_bulk_tx_rx omitted the case where neither BLOCKING nor WAITING modes are used, in which case the value provided by the caller is not returned to them as expected, but instead it is replaced with a NULL. This lack of a suitable context may cause the application to crash or otherwise malfunction.

---
 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +3 -1
index 01125d9f991bb..5bc9b394212b8 100644
@@ -953,7 +953,7 @@ static int vchiq_irq_queue_bulk_tx_rx(struct vchiq_instance *instance,
 	struct vchiq_service *service;
 	struct bulk_waiter_node *waiter = NULL;
 	bool found = false;
-	void *userdata = NULL;
+	void *userdata;
 	int status = 0;
 	int ret;
 
@@ -992,6 +992,8 @@ static int vchiq_irq_queue_bulk_tx_rx(struct vchiq_instance *instance,
 			"found bulk_waiter %pK for pid %d", waiter,
 			current->pid);
 		userdata = &waiter->bulk_waiter;
+	} else {
+		userdata = args->userdata;
 	}
 
 	/*
Signature · 1 line
2.27.0
author maintainer
#38 lore raw

PATCH 38/663 staging: vchiq: Fix bulk transfers on 64-bit builds

In reply to Greg Kroah-Hartman

From: Phil Elwell <[email protected]>

[ Upstream commit 88753cc19f087abe0d39644b844e67a59cfb5a3d ]

The recent change to the bulk transfer compat function missed the fact the relevant ioctl command is VCHIQ_IOC_QUEUE_BULK_TRANSMIT32, not VCHIQ_IOC_QUEUE_BULK_TRANSMIT, as any attempt to send a bulk block to the VPU would have shown.

---
 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +1 -1
index 5bc9b394212b8..3d378da119e7a 100644
@@ -1714,7 +1714,7 @@ vchiq_compat_ioctl_queue_bulk(struct file *file,
 {
 	struct vchiq_queue_bulk_transfer32 args32;
 	struct vchiq_queue_bulk_transfer args;
-	enum vchiq_bulk_dir dir = (cmd == VCHIQ_IOC_QUEUE_BULK_TRANSMIT) ?
+	enum vchiq_bulk_dir dir = (cmd == VCHIQ_IOC_QUEUE_BULK_TRANSMIT32) ?
 				  VCHIQ_BULK_TRANSMIT : VCHIQ_BULK_RECEIVE;
 
 	if (copy_from_user(&args32, argp, sizeof(args32)))
Signature · 1 line
2.27.0
author maintainer
#39 lore raw

PATCH 39/663 arm64: dts: qcom: msm8916-samsung-a5u: Fix iris compatible

In reply to Greg Kroah-Hartman

From: Stephan Gerhold <[email protected]>

[ Upstream commit 826e6faf49ae1eb065759a30832a2e34740bd8b1 ]

Unlike most MSM8916 boards, samsung-a5u uses WCN3660B instead of WCN3620 to support the 5 GHz band additionally.

WCN3660B has similar requirements as WCN3620, but it needs the XO clock to run at 48 MHz instead of 19.2 MHz. So far it was possible to describe that configuration using the qcom,wcn3680 compatible.

However, as of commit 8490987bdb9a ("wcn36xx: Hook and identify RF_IRIS_WCN3680"), the wcn36xx driver will now use the qcom,wcn3680 compatible
to enable functionality specific to WCN3680. In particular,
WCN3680 supports 802.11ac, which is not available in WCN3660B.

Use the new qcom,wcn3660b compatible to describe the chip properly.

Fixes 0d7051999175 ("arm64: dts: msm8916-samsung-a5u: Override iris compatible")
---
 arch/arm64/boot/dts/qcom/msm8916-samsung-a5u-eur.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/msm8916-samsung-a5u-eur.dts +1 -1
index e39c04d977c25..dd35c3344358c 100644
@@ -38,7 +38,7 @@
 
 &pronto {
 	iris {
-		compatible = "qcom,wcn3680";
+		compatible = "qcom,wcn3660b";
 	};
 };
 
Signature · 1 line
2.27.0
author maintainer
#40 lore raw

PATCH 40/663 net: stmmac: dwmac-meson8b: fix enabling the timing-adjustment clock

In reply to Greg Kroah-Hartman

From: Martin Blumenstingl <[email protected]>

[ Upstream commit 025822884a4fd2d0af51dcf77ddc494e60c5ff63 ]

The timing-adjustment clock only has to be enabled when a) there is a 2ns RX delay configured using device-tree and b) the phy-mode indicates that the RX delay should be enabled.

Only enable the RX delay if both are true, instead of (by accident) also enabling it when there's the 2ns RX delay configured but the phy-mode incicates that the RX delay is not used.

Fixes 9308c47640d515 ("net: stmmac: dwmac-meson8b: add support for the RX delay configuration")
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c +1 -1
index 9ddadae8e4c51..752658ec7beeb 100644
@@ -301,7 +301,7 @@ static int meson8b_init_prg_eth(struct meson8b_dwmac *dwmac)
 		return -EINVAL;
 	};
 
-	if (rx_dly_config & PRG_ETH0_ADJ_ENABLE) {
+	if (delay_config & PRG_ETH0_ADJ_ENABLE) {
 		if (!dwmac->timing_adj_clk) {
 			dev_err(dwmac->dev,
 				"The timing-adjustment clock is mandatory for the RX delay re-timing\n");
Signature · 1 line
2.27.0
author maintainer
#41 lore raw

PATCH 41/663 bpf: Add bpf_patch_call_args prototype to include/linux/bpf.h

In reply to Greg Kroah-Hartman

From: Andrii Nakryiko <[email protected]>

[ Upstream commit a643bff752dcf72a07e1b2ab2f8587e4f51118be ]

Add bpf_patch_call_args() prototype. This function is called from BPF verifier and only if CONFIG_BPF_JIT_ALWAYS_ON is not defined. This fixes compiler warning about missing prototype in some kernel configurations.

---
 include/linux/bpf.h | 3 +++
 1 file changed, 3 insertions(+)
include/linux/bpf.h +3 -0
index 2b16bf48aab61..642ce03f19c4c 100644
@@ -1371,7 +1371,10 @@ static inline void bpf_long_memcpy(void *dst, const void *src, u32 size)
 /* verify correctness of eBPF program */
 int bpf_check(struct bpf_prog **fp, union bpf_attr *attr,
 	      union bpf_attr __user *uattr);
+
+#ifndef CONFIG_BPF_JIT_ALWAYS_ON
 void bpf_patch_call_args(struct bpf_insn *insn, u32 stack_depth);
+#endif
 
 struct btf *bpf_get_btf_vmlinux(void);
 
Signature · 1 line
2.27.0
author maintainer
#42 lore raw

PATCH 42/663 bpf: Avoid warning when re-casting __bpf_call_base into __bpf_call_base_args

In reply to Greg Kroah-Hartman

From: Andrii Nakryiko <[email protected]>

[ Upstream commit 6943c2b05bf09fd5c5729f7d7d803bf3f126cb9a ]

BPF interpreter uses extra input argument, so re-casts __bpf_call_base into __bpf_call_base_args. Avoid compiler warning about incompatible function prototypes by casting to void * first.

---
 include/linux/filter.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/filter.h +1 -1
index 1b62397bd1247..e2ffa02f9067a 100644
@@ -886,7 +886,7 @@ void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp);
 u64 __bpf_call_base(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5);
 #define __bpf_call_base_args \
 	((u64 (*)(u64, u64, u64, u64, u64, const struct bpf_insn *)) \
-	 __bpf_call_base)
+	 (void *)__bpf_call_base)
 
 struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog);
 void bpf_jit_compile(struct bpf_prog *prog);
Signature · 1 line
2.27.0
author maintainer
#43 lore raw

PATCH 43/663 firmware: arm_scmi: Fix call site of scmi_notification_exit

In reply to Greg Kroah-Hartman

From: Cristian Marussi <[email protected]>

[ Upstream commit a90b6543bf062d65292b2c76f1630507d1c9d8ec ]

Call scmi_notification_exit() only when SCMI platform driver instance has been really successfully removed.

Fixes 6b8a69131dc63 ("firmware: arm_scmi: Enable notification core")
[sudeep.holla: Move the call outside the list mutex locking]
---
 drivers/firmware/arm_scmi/driver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/firmware/arm_scmi/driver.c +2 -2
index 3dfd8b6a0ebf7..6b2ce3f28f7b9 100644
@@ -847,8 +847,6 @@ static int scmi_remove(struct platform_device *pdev)
 	struct scmi_info *info = platform_get_drvdata(pdev);
 	struct idr *idr = &info->tx_idr;
 
-	scmi_notification_exit(&info->handle);
-
 	mutex_lock(&scmi_list_mutex);
 	if (info->users)
 		ret = -EBUSY;
@@ -859,6 +857,8 @@ static int scmi_remove(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
+	scmi_notification_exit(&info->handle);
+
 	/* Safe to free channels since no more users */
 	ret = idr_for_each(idr, info->desc->ops->chan_free, idr);
 	idr_destroy(&info->tx_idr);
Signature · 1 line
2.27.0
author maintainer
#44 lore raw

PATCH 44/663 arm64: dts: allwinner: A64: properly connect USB PHY to port 0

In reply to Greg Kroah-Hartman

From: Andre Przywara <[email protected]>

[ Upstream commit cc72570747e43335f4933a24dd74d5653639176a ]

In recent Allwinner SoCs the first USB host controller (HCI0) shares the first PHY with the MUSB controller. Probably to make this sharing work, we were avoiding to declare this in the DT. This has two shortcomings:
- U-Boot (which uses the same .dts) cannot use this port in host mode without a PHY linked, so we were loosing one USB port there.
- It requires the MUSB driver to be enabled and loaded, although we don't actually use it.

To avoid those issues, let's add this PHY link to the A64 .dtsi file. After all PHY port 0 *is* connected to HCI0, so we should describe it as this. Remove the part from the Pinebook DTS which already had this property.

This makes it work in U-Boot, also improves compatiblity when no MUSB driver is loaded (for instance in distribution installers).

Fixes dc03a047df1d ("arm64: allwinner: a64: add EHCI0/OHCI0 nodes to A64 DTSI")
---
 arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts | 4 ----
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi         | 4 ++++
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts +0 -4
index 896f34fd9fc3a..d07cf05549c32 100644
@@ -126,8 +126,6 @@
 };
 
 &ehci0 {
-	phys = <&usbphy 0>;
-	phy-names = "usb";
 	status = "okay";
 };
 
@@ -177,8 +175,6 @@
 };
 
 &ohci0 {
-	phys = <&usbphy 0>;
-	phy-names = "usb";
 	status = "okay";
 };
 
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +4 -0
index dc238814013cb..15f6408e73a27 100644
@@ -593,6 +593,8 @@
 				 <&ccu CLK_USB_OHCI0>;
 			resets = <&ccu RST_BUS_OHCI0>,
 				 <&ccu RST_BUS_EHCI0>;
+			phys = <&usbphy 0>;
+			phy-names = "usb";
 			status = "disabled";
 		};
 
@@ -603,6 +605,8 @@
 			clocks = <&ccu CLK_BUS_OHCI0>,
 				 <&ccu CLK_USB_OHCI0>;
 			resets = <&ccu RST_BUS_OHCI0>;
+			phys = <&usbphy 0>;
+			phy-names = "usb";
 			status = "disabled";
 		};
 
Signature · 1 line
2.27.0
author maintainer
#45 lore raw

PATCH 45/663 arm64: dts: allwinner: H6: properly connect USB PHY to port 0

In reply to Greg Kroah-Hartman

From: Andre Przywara <[email protected]>

[ Upstream commit da2fb8457f71138d455cba82edec0d34f858e506 ]

In recent Allwinner SoCs the first USB host controller (HCI0) shares the first PHY with the MUSB controller. Probably to make this sharing work, we were avoiding to declare this in the DT. This has two shortcomings:
- U-Boot (which uses the same .dts) cannot use this port in host mode without a PHY linked, so we were loosing one USB port there.
- It requires the MUSB driver to be enabled and loaded, although we don't actually use it.

To avoid those issues, let's add this PHY link to the H6 .dtsi file. After all PHY port 0 *is* connected to HCI0, so we should describe it as this.

This makes it work in U-Boot, also improves compatiblity when no MUSB driver is loaded (for instance in distribution installers).

Fixes eabb3d424b6d ("arm64: dts: allwinner: h6: add USB2-related device nodes")
---
 arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +4 -0
index 28c77d6872f64..0361f5f467093 100644
@@ -667,6 +667,8 @@
 				 <&ccu CLK_USB_OHCI0>;
 			resets = <&ccu RST_BUS_OHCI0>,
 				 <&ccu RST_BUS_EHCI0>;
+			phys = <&usb2phy 0>;
+			phy-names = "usb";
 			status = "disabled";
 		};
 
@@ -677,6 +679,8 @@
 			clocks = <&ccu CLK_BUS_OHCI0>,
 				 <&ccu CLK_USB_OHCI0>;
 			resets = <&ccu RST_BUS_OHCI0>;
+			phys = <&usb2phy 0>;
+			phy-names = "usb";
 			status = "disabled";
 		};
 
Signature · 1 line
2.27.0
author maintainer
#46 lore raw

PATCH 46/663 arm64: dts: allwinner: Drop non-removable from SoPine/LTS SD card

In reply to Greg Kroah-Hartman

From: Andre Przywara <[email protected]>

[ Upstream commit 941432d007689f3774646e41a1439228b6c6ee0e ]

The SD card on the SoPine SoM module is somewhat concealed, so was originally defined as "non-removable".
However there is a working card-detect pin (tested on two different SoM versions), and in certain SoM base boards it might be actually accessible at runtime.
Also the Pine64-LTS shares the SoPine base .dtsi, so inherited the non-removable flag, even though the SD card slot is perfectly accessible and usable there. (It turns out that just *my* board has a broken card detect switch, so I originally thought CD wouldn't work on the LTS.)

Drop the "non-removable" flag to describe the SD card slot properly.

Fixes c3904a269891 ("arm64: allwinner: a64: add DTSI file for SoPine SoM")
---
 arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi | 1 -
 1 file changed, 1 deletion(-)
arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi +0 -1
index c48692b06e1fa..3402cec87035b 100644
@@ -32,7 +32,6 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc0_pins>;
 	vmmc-supply = <&reg_dcdc1>;
-	non-removable;
 	disable-wp;
 	bus-width = <4>;
 	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
Signature · 1 line
2.27.0
author maintainer
#47 lore raw

PATCH 47/663 arm64: dts: allwinner: H6: Allow up to 150 MHz MMC bus frequency

In reply to Greg Kroah-Hartman

From: Andre Przywara <[email protected]>

[ Upstream commit cfe6c487b9a1abc6197714ec5605716a5428cf03 ]

The H6 manual explicitly lists a frequency limit of 150 MHz for the bus frequency of the MMC controllers. So far we had no explicit limits in the DT, which limited eMMC to the spec defined frequencies, or whatever the driver defines (both Linux and FreeBSD use 52 MHz here).

Put those maximum frequencies in the SoC .dtsi, to allow higher speed modes (which still would need to be explicitly enabled, per board).

Tested with an eMMC using HS-200 on a Pine H64. Running at the spec'ed 200 MHz indeed fails with I/O errors, but 150 MHz seems to work stably.

Fixes 8f54bd1595b3 ("arm64: allwinner: h6: add device tree nodes for MMC controllers")
---
 arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 3 +++
 1 file changed, 3 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +3 -0
index 0361f5f467093..4592fb7a6161d 100644
@@ -436,6 +436,7 @@
 			interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
 			pinctrl-names = "default";
 			pinctrl-0 = <&mmc0_pins>;
+			max-frequency = <150000000>;
 			status = "disabled";
 			#address-cells = <1>;
 			#size-cells = <0>;
@@ -452,6 +453,7 @@
 			interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
 			pinctrl-names = "default";
 			pinctrl-0 = <&mmc1_pins>;
+			max-frequency = <150000000>;
 			status = "disabled";
 			#address-cells = <1>;
 			#size-cells = <0>;
@@ -468,6 +470,7 @@
 			interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
 			pinctrl-names = "default";
 			pinctrl-0 = <&mmc2_pins>;
+			max-frequency = <150000000>;
 			status = "disabled";
 			#address-cells = <1>;
 			#size-cells = <0>;
Signature · 1 line
2.27.0
author maintainer
#48 lore raw

PATCH 48/663 arm64: dts: allwinner: A64: Limit MMC2 bus frequency to 150 MHz

In reply to Greg Kroah-Hartman

From: Andre Przywara <[email protected]>

[ Upstream commit 948c657cc45e8ce48cb533d4e2106145fa765759 ]

In contrast to the H6 (and later) manuals, the A64 datasheet does not specify any limitations in the maximum possible frequency for eMMC controllers.
However experimentation has found that a 150 MHz limit similar to other SoCs and also the MMC0 and MMC1 controllers on the A64 seems to exist for the MMC2 controller.

Limit the frequency for the MMC2 controller to 150 MHz in the SoC .dtsi. The Pinebook seems to be the an odd exception, since it apparently seems to work with 200 MHz as well, so overwrite this in its board .dts file.

Tested on a Pine64-LTS: 200 MHz HS-200 fails, 150 MHz HS-200 works.

Fixes 22be992faea7 ("arm64: allwinner: a64: Increase the MMC max frequency")
---
 arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts | 1 +
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi         | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts +1 -0
index d07cf05549c32..7ae16541d14f5 100644
@@ -167,6 +167,7 @@
 	pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>;
 	vmmc-supply = <&reg_dcdc1>;
 	vqmmc-supply = <&reg_eldo1>;
+	max-frequency = <200000000>;
 	bus-width = <8>;
 	non-removable;
 	cap-mmc-hw-reset;
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +1 -1
index 15f6408e73a27..7a41015a9ce59 100644
@@ -514,7 +514,7 @@
 			resets = <&ccu RST_BUS_MMC2>;
 			reset-names = "ahb";
 			interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
-			max-frequency = <200000000>;
+			max-frequency = <150000000>;
 			status = "disabled";
 			#address-cells = <1>;
 			#size-cells = <0>;
Signature · 1 line
2.27.0
author maintainer
#49 lore raw

PATCH 49/663 arm64: dts: qcom: msm8916-samsung-a2015: Fix sensors

In reply to Greg Kroah-Hartman

From: Stephan Gerhold <[email protected]>

[ Upstream commit 3716a583fe0bbe3babf4ce260064a7fa13d6d989 ]

When the BMC150 accelerometer/magnetometer was added to the device tree, the sensors were working without specifying any regulator supplies, likely because the regulators were on by default and then never turned off.

For some reason, this is no longer the case for pm8916_l17, which prevents the sensors from working in some cases.

Now that the bmc150_accel/bmc150_magn drivers can enable necessary regulators, declare the necessary regulator supplies to make the sensors work again.

Fixes 079f81acf10f ("arm64: dts: qcom: msm8916-samsung-a2015: Add accelerometer/magnetometer")
---
 arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi +6 -0
index f7ac4c4033db6..7bf2cb01513e3 100644
@@ -106,6 +106,9 @@
 		interrupt-parent = <&msmgpio>;
 		interrupts = <115 IRQ_TYPE_EDGE_RISING>;
 
+		vdd-supply = <&pm8916_l17>;
+		vddio-supply = <&pm8916_l5>;
+
 		pinctrl-names = "default";
 		pinctrl-0 = <&accel_int_default>;
 	};
@@ -113,6 +116,9 @@
 	magnetometer@12 {
 		compatible = "bosch,bmc150_magn";
 		reg = <0x12>;
+
+		vdd-supply = <&pm8916_l17>;
+		vddio-supply = <&pm8916_l5>;
 	};
 };
 
Signature · 1 line
2.27.0
author maintainer
#50 lore raw

PATCH 50/663 cpufreq: brcmstb-avs-cpufreq: Free resources in error path

In reply to Greg Kroah-Hartman

From: Christophe JAILLET <[email protected]>

[ Upstream commit 05f456286fd489558c72a4711d22a5612c965685 ]

If 'cpufreq_register_driver()' fails, we must release the resources allocated in 'brcm_avs_prepare_init()' as already done in the remove function.

To do that, introduce a new function 'brcm_avs_prepare_uninit()' in order to avoid code duplication. This also makes the code more readable (IMHO).

Fixes de322e085995 ("cpufreq: brcmstb-avs-cpufreq: AVS CPUfreq driver for Broadcom STB SoCs")
[ Viresh: Updated Subject ]
---
 drivers/cpufreq/brcmstb-avs-cpufreq.c | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)
drivers/cpufreq/brcmstb-avs-cpufreq.c +16 -5
index 3e31e5d28b79c..e25ccb744187d 100644
@@ -597,6 +597,16 @@ unmap_base:
 	return ret;
 }
 
+static void brcm_avs_prepare_uninit(struct platform_device *pdev)
+{
+	struct private_data *priv;
+
+	priv = platform_get_drvdata(pdev);
+
+	iounmap(priv->avs_intr_base);
+	iounmap(priv->base);
+}
+
 static int brcm_avs_cpufreq_init(struct cpufreq_policy *policy)
 {
 	struct cpufreq_frequency_table *freq_table;
@@ -732,21 +742,22 @@ static int brcm_avs_cpufreq_probe(struct platform_device *pdev)
 
 	brcm_avs_driver.driver_data = pdev;
 
-	return cpufreq_register_driver(&brcm_avs_driver);
+	ret = cpufreq_register_driver(&brcm_avs_driver);
+	if (ret)
+		brcm_avs_prepare_uninit(pdev);
+
+	return ret;
 }
 
 static int brcm_avs_cpufreq_remove(struct platform_device *pdev)
 {
-	struct private_data *priv;
 	int ret;
 
 	ret = cpufreq_unregister_driver(&brcm_avs_driver);
 	if (ret)
 		return ret;
 
-	priv = platform_get_drvdata(pdev);
-	iounmap(priv->base);
-	iounmap(priv->avs_intr_base);
+	brcm_avs_prepare_uninit(pdev);
 
 	return 0;
 }
Signature · 1 line
2.27.0
author maintainer
#51 lore raw

PATCH 51/663 cpufreq: brcmstb-avs-cpufreq: Fix resource leaks in ->remove()

In reply to Greg Kroah-Hartman

From: Christophe JAILLET <[email protected]>

[ Upstream commit 3657f729b6fb5f2c0bf693742de2dcd49c572aa1 ]

If 'cpufreq_unregister_driver()' fails, just WARN and continue, so that other resources are freed.

Fixes de322e085995 ("cpufreq: brcmstb-avs-cpufreq: AVS CPUfreq driver for Broadcom STB SoCs")
[ Viresh: Updated Subject ]
---
 drivers/cpufreq/brcmstb-avs-cpufreq.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/cpufreq/brcmstb-avs-cpufreq.c +1 -2
index e25ccb744187d..4153150e20db5 100644
@@ -754,8 +754,7 @@ static int brcm_avs_cpufreq_remove(struct platform_device *pdev)
 	int ret;
 
 	ret = cpufreq_unregister_driver(&brcm_avs_driver);
-	if (ret)
-		return ret;
+	WARN_ON(ret);
 
 	brcm_avs_prepare_uninit(pdev);
 
Signature · 1 line
2.27.0
author maintainer
#52 lore raw

PATCH 52/663 arm64: dts: rockchip: rk3328: Add clock_in_out property to gmac2phy node

In reply to Greg Kroah-Hartman

From: Chen-Yu Tsai <[email protected]>

[ Upstream commit c6433083f5930fdf52ad47c8c0459719c810dc89 ]

The gmac2phy is integrated with the PHY within the SoC. Any properties related to this integration can be included in the .dtsi file, instead of having board dts files specify them separately.

Add the clock_in_out property to specify the direction of the PHY clock. This is the minimum required to have gmac2phy working on Linux. Other examples include assigned-clocks, assigned-clock-rates, and assigned-clock-parents properties, but the hardware default plus the implementation requesting the appropriate clock rate also works.

Fixes 9c4cc910fe28 ("ARM64: dts: rockchip: Add gmac2phy node support for rk3328")
---
 arch/arm64/boot/dts/rockchip/rk3328.dtsi | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/rockchip/rk3328.dtsi +1 -0
index db0d5c8e5f96a..93c734d8a46c2 100644
@@ -928,6 +928,7 @@
 		phy-mode = "rmii";
 		phy-handle = <&phy>;
 		snps,txpbl = <0x4>;
+		clock_in_out = "output";
 		status = "disabled";
 
 		mdio {
Signature · 1 line
2.27.0
author maintainer
#53 lore raw

PATCH 53/663 ACPICA: Fix exception code class checks

In reply to Greg Kroah-Hartman

From: Maximilian Luz <[email protected]>

[ Upstream commit 3dfaea3811f8b6a89a347e8da9ab862cdf3e30fe ]

ACPICA commit 1a3a549286ea9db07d7ec700e7a70dd8bcc4354e

The macros to classify different AML exception codes are broken. For instance,

ACPI_ENV_EXCEPTION(Status)

will always evaluate to zero due to

  #define AE_CODE_ENVIRONMENTAL      0x0000
  #define ACPI_ENV_EXCEPTION(Status) (Status & AE_CODE_ENVIRONMENTAL)

Similarly, ACPI_AML_EXCEPTION(Status) will evaluate to a non-zero value for error codes of type AE_CODE_PROGRAMMER, AE_CODE_ACPI_TABLES, as well as AE_CODE_AML, and not just AE_CODE_AML as the name suggests.

This commit fixes those checks.

Fixes d46b6537f0ce ("ACPICA: AML Parser: ignore all exceptions resulting from incorrect AML during table load")
---
 include/acpi/acexcep.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
include/acpi/acexcep.h +5 -5
index 2fc624a617690..f8a4afb0279a3 100644
@@ -59,11 +59,11 @@ struct acpi_exception_info {
 
 #define AE_OK                           (acpi_status) 0x0000
 
-#define ACPI_ENV_EXCEPTION(status)      (status & AE_CODE_ENVIRONMENTAL)
-#define ACPI_AML_EXCEPTION(status)      (status & AE_CODE_AML)
-#define ACPI_PROG_EXCEPTION(status)     (status & AE_CODE_PROGRAMMER)
-#define ACPI_TABLE_EXCEPTION(status)    (status & AE_CODE_ACPI_TABLES)
-#define ACPI_CNTL_EXCEPTION(status)     (status & AE_CODE_CONTROL)
+#define ACPI_ENV_EXCEPTION(status)      (((status) & AE_CODE_MASK) == AE_CODE_ENVIRONMENTAL)
+#define ACPI_AML_EXCEPTION(status)      (((status) & AE_CODE_MASK) == AE_CODE_AML)
+#define ACPI_PROG_EXCEPTION(status)     (((status) & AE_CODE_MASK) == AE_CODE_PROGRAMMER)
+#define ACPI_TABLE_EXCEPTION(status)    (((status) & AE_CODE_MASK) == AE_CODE_ACPI_TABLES)
+#define ACPI_CNTL_EXCEPTION(status)     (((status) & AE_CODE_MASK) == AE_CODE_CONTROL)
 
 /*
  * Environmental exceptions
Signature · 1 line
2.27.0
author maintainer
#54 lore raw

PATCH 54/663 usb: gadget: u_audio: Free requests only after callback

In reply to Greg Kroah-Hartman

From: Jack Pham <[email protected]>

[ Upstream commit 7de8681be2cde9f6953d3be1fa6ce05f9fe6e637 ]

As per the kernel doc for usb_ep_dequeue(), it states that "this routine is asynchronous, that is, it may return before the completion routine runs". And indeed since v5.0 the dwc3 gadget driver updated its behavior to place dequeued requests on to a cancelled list to be given back later after the endpoint is stopped.

The free_ep() was incorrectly assuming that a request was ready to be freed after calling dequeue which results in a use-after-free in dwc3 when it traverses its cancelled list. Fix this by moving the usb_ep_free_request() call to the callback itself in case the ep is disabled.

---
 drivers/usb/gadget/function/u_audio.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
drivers/usb/gadget/function/u_audio.c +14 -3
index e6d32c5367812..908e49dafd620 100644
@@ -89,7 +89,12 @@ static void u_audio_iso_complete(struct usb_ep *ep, struct usb_request *req)
 	struct snd_uac_chip *uac = prm->uac;
 
 	/* i/f shutting down */
-	if (!prm->ep_enabled || req->status == -ESHUTDOWN)
+	if (!prm->ep_enabled) {
+		usb_ep_free_request(ep, req);
+		return;
+	}
+
+	if (req->status == -ESHUTDOWN)
 		return;
 
 	/*
@@ -336,8 +341,14 @@ static inline void free_ep(struct uac_rtd_params *prm, struct usb_ep *ep)
 
 	for (i = 0; i < params->req_number; i++) {
 		if (prm->ureq[i].req) {
-			usb_ep_dequeue(ep, prm->ureq[i].req);
-			usb_ep_free_request(ep, prm->ureq[i].req);
+			if (usb_ep_dequeue(ep, prm->ureq[i].req))
+				usb_ep_free_request(ep, prm->ureq[i].req);
+			/*
+			 * If usb_ep_dequeue() cannot successfully dequeue the
+			 * request, the request will be freed by the completion
+			 * callback.
+			 */
+
 			prm->ureq[i].req = NULL;
 		}
 	}
Signature · 1 line
2.27.0
author maintainer
#55 lore raw

PATCH 55/663 arm64: dts: qcom: sdm845-db845c: Fix reset-pin of ov8856 node

In reply to Greg Kroah-Hartman

From: Robert Foss <[email protected]>

[ Upstream commit d4863ef399a29cae3001b3fedfd2864e651055ba ]

Switch reset pin of ov8856 node from GPIO_ACTIVE_HIGH to GPIO_ACTIVE_LOW, this issue prevented the ov8856 from probing properly as it did not respon to I2C messages.

Fixes d4919a44564b ("arm64: dts: qcom: sdm845-db845c: Add ov8856 & ov7251

camera nodes")

---
 arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sdm845-db845c.dts +2 -2
index c0b93813ea9ac..c4ac6f5dc008d 100644
@@ -1114,11 +1114,11 @@
 		reg = <0x10>;
 
 		// CAM0_RST_N
-		reset-gpios = <&tlmm 9 0>;
+		reset-gpios = <&tlmm 9 GPIO_ACTIVE_LOW>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&cam0_default>;
 		gpios = <&tlmm 13 0>,
-			<&tlmm 9 0>;
+			<&tlmm 9 GPIO_ACTIVE_LOW>;
 
 		clocks = <&clock_camcc CAM_CC_MCLK0_CLK>;
 		clock-names = "xvclk";
Signature · 1 line
2.27.0
author maintainer
#56 lore raw

PATCH 56/663 soc: qcom: socinfo: Fix an off by one in qcom_show_pmic_model()

In reply to Greg Kroah-Hartman

From: Dan Carpenter <[email protected]>

[ Upstream commit 5fb33d8960dc7abdabc6fe599a30c2c99b082ef6 ]

These need to be < ARRAY_SIZE() instead of <= ARRAY_SIZE() to prevent accessing one element beyond the end of the array.

---
 drivers/soc/qcom/socinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/qcom/socinfo.c +1 -1
index b44ede48decc0..e0620416e5743 100644
@@ -280,7 +280,7 @@ static int qcom_show_pmic_model(struct seq_file *seq, void *p)
 	if (model < 0)
 		return -EINVAL;
 
-	if (model <= ARRAY_SIZE(pmic_models) && pmic_models[model])
+	if (model < ARRAY_SIZE(pmic_models) && pmic_models[model])
 		seq_printf(seq, "%s\n", pmic_models[model]);
 	else
 		seq_printf(seq, "unknown (%d)\n", model);
Signature · 1 line
2.27.0
author maintainer
#57 lore raw

PATCH 57/663 soc: ti: pm33xx: Fix some resource leak in the error handling paths of the probe function

In reply to Greg Kroah-Hartman

From: Christophe JAILLET <[email protected]>

[ Upstream commit 17ad4662595ea0c4fd7496b664523ef632e63349 ]

'am33xx_pm_rtc_setup()' allocates some resources that must be freed on the error. Commit 2152fbbd47c0 ("soc: ti: pm33xx: Simplify RTC usage to prepare to drop platform data") has introduced the use of these resources but has only updated the remove function.

Fix the error handling path of the probe function now.

Fixes 2152fbbd47c0 ("soc: ti: pm33xx: Simplify RTC usage to prepare to drop platform data")
---
 drivers/soc/ti/pm33xx.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/soc/ti/pm33xx.c +4 -1
index d2f5e7001a93c..dc21aa855a458 100644
@@ -536,7 +536,7 @@ static int am33xx_pm_probe(struct platform_device *pdev)
 
 	ret = am33xx_push_sram_idle();
 	if (ret)
-		goto err_free_sram;
+		goto err_unsetup_rtc;
 
 	am33xx_pm_set_ipc_ops();
 
@@ -566,6 +566,9 @@ static int am33xx_pm_probe(struct platform_device *pdev)
 
 err_put_wkup_m3_ipc:
 	wkup_m3_ipc_put(m3_ipc);
+err_unsetup_rtc:
+	iounmap(rtc_base_virt);
+	clk_put(rtc_fck);
 err_free_sram:
 	am33xx_pm_free_sram();
 	pm33xx_dev = NULL;
Signature · 1 line
2.27.0
author maintainer
#58 lore raw

PATCH 58/663 staging: media: atomisp: Fix size_t format specifier in hmm_alloc() debug statemenet

In reply to Greg Kroah-Hartman

From: Borislav Petkov <[email protected]>

[ Upstream commit bfe21ef195a9f2785747e698dfd19f75554e2d91 ]

Fix this build warning on 32-bit:

drivers/staging/media/atomisp/pci/hmm/hmm.c: In function ‘hmm_alloc’:

  drivers/staging/media/atomisp/pci/hmm/hmm.c:272:3: warning: format ‘%ld’ \
     expects argument of type ‘long int’, but argument 6 has type ‘size_t {aka unsigned int}’ [-Wformat=]
     "%s: pages: 0x%08x (%ld bytes), type: %d from highmem %d, user ptr %p, cached %d\n",
     ^
Fixes 03884c93560c ("media: atomisp: add debug for hmm alloc")
Cc Mauro Carvalho Chehab <[email protected]>
Cc Sakari Ailus <[email protected]>
---
 drivers/staging/media/atomisp/pci/hmm/hmm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/atomisp/pci/hmm/hmm.c +1 -1
index e0eaff0f8a228..6a5ee46070898 100644
@@ -269,7 +269,7 @@ ia_css_ptr hmm_alloc(size_t bytes, enum hmm_bo_type type,
 		hmm_set(bo->start, 0, bytes);
 
 	dev_dbg(atomisp_dev,
-		"%s: pages: 0x%08x (%ld bytes), type: %d from highmem %d, user ptr %p, cached %d\n",
+		"%s: pages: 0x%08x (%zu bytes), type: %d from highmem %d, user ptr %p, cached %d\n",
 		__func__, bo->start, bytes, type, from_highmem, userptr, cached);
 
 	return bo->start;
Signature · 1 line
2.27.0
author maintainer
#59 lore raw

PATCH 59/663 Bluetooth: drop HCI device reference before return

In reply to Greg Kroah-Hartman

From: Pan Bian <[email protected]>

[ Upstream commit 5a3ef03afe7e12982dc3b978f4c5077c907f7501 ]

Call hci_dev_put() to decrement reference count of HCI device hdev if fails to duplicate memory.

Fixes 0b26ab9dce74 ("Bluetooth: AMP: Handle Accept phylink command status evt")
---
 net/bluetooth/a2mp.c | 1 +
 1 file changed, 1 insertion(+)
net/bluetooth/a2mp.c +1 -0
index cc26e4c047ad0..463bad58478b2 100644
@@ -512,6 +512,7 @@ static int a2mp_createphyslink_req(struct amp_mgr *mgr, struct sk_buff *skb,
 		assoc = kmemdup(req->amp_assoc, assoc_len, GFP_KERNEL);
 		if (!assoc) {
 			amp_ctrl_put(ctrl);
+			hci_dev_put(hdev);
 			return -ENOMEM;
 		}
 
Signature · 1 line
2.27.0
author maintainer
#60 lore raw

PATCH 60/663 Bluetooth: Put HCI device if inquiry procedure interrupts

In reply to Greg Kroah-Hartman

From: Pan Bian <[email protected]>

[ Upstream commit 28a758c861ff290e39d4f1ee0aa5df0f0b9a45ee ]

Jump to the label done to decrement the reference count of HCI device hdev on path that the Inquiry procedure is interrupted.

Fixes 3e13fa1e1fab ("Bluetooth: Fix hci_inquiry ioctl usage")
---
 net/bluetooth/hci_core.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
net/bluetooth/hci_core.c +4 -2
index c4aa2cbb92697..555058270f112 100644
@@ -1356,8 +1356,10 @@ int hci_inquiry(void __user *arg)
 		 * cleared). If it is interrupted by a signal, return -EINTR.
 		 */
 		if (wait_on_bit(&hdev->flags, HCI_INQUIRY,
-				TASK_INTERRUPTIBLE))
-			return -EINTR;
+				TASK_INTERRUPTIBLE)) {
+			err = -EINTR;
+			goto done;
+		}
 	}
 
 	/* for unlimited number of responses we will use buffer with
Signature · 1 line
2.27.0
author maintainer
#61 lore raw

PATCH 61/663 memory: ti-aemif: Drop child node when jumping out loop

In reply to Greg Kroah-Hartman

From: Pan Bian <[email protected]>

[ Upstream commit 94e9dd43cf327366388c8f146bccdc6322c0d999 ]

Call of_node_put() to decrement the reference count of the child node child_np when jumping out of the loop body of for_each_available_child_of_node(), which is a macro that increments and decrements the reference count of child node. If the loop is broken, the reference of the child node should be dropped manually.

Fixes 5a7c81547c1d ("memory: ti-aemif: introduce AEMIF driver")
---
 drivers/memory/ti-aemif.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/memory/ti-aemif.c +6 -2
index 159a16f5e7d67..51d20c2ccb755 100644
@@ -378,8 +378,10 @@ static int aemif_probe(struct platform_device *pdev)
 		 */
 		for_each_available_child_of_node(np, child_np) {
 			ret = of_aemif_parse_abus_config(pdev, child_np);
-			if (ret < 0)
+			if (ret < 0) {
+				of_node_put(child_np);
 				goto error;
+			}
 		}
 	} else if (pdata && pdata->num_abus_data > 0) {
 		for (i = 0; i < pdata->num_abus_data; i++, aemif->num_cs++) {
@@ -405,8 +407,10 @@ static int aemif_probe(struct platform_device *pdev)
 		for_each_available_child_of_node(np, child_np) {
 			ret = of_platform_populate(child_np, NULL,
 						   dev_lookup, dev);
-			if (ret < 0)
+			if (ret < 0) {
+				of_node_put(child_np);
 				goto error;
+			}
 		}
 	} else if (pdata) {
 		for (i = 0; i < pdata->num_sub_devices; i++) {
Signature · 1 line
2.27.0
author maintainer
#62 lore raw

PATCH 62/663 ARM: dts: Configure missing thermal interrupt for 4430

In reply to Greg Kroah-Hartman

From: Tony Lindgren <[email protected]>

[ Upstream commit 44f416879a442600b006ef7dec3a6dc98bcf59c6 ]

We have gpio_86 wired internally to the bandgap thermal shutdown interrupt on 4430 like we have it on 4460 according to the TRM. This can be found easily by searching for TSHUT.

For some reason the thermal shutdown interrupt was never added for 4430, let's add it. I believe this is needed for the thermal shutdown interrupt handler ti_bandgap_tshut_irq_handler() to call orderly_poweroff().

Fixes aa9bb4bb8878 ("arm: dts: add omap4430 thermal data")
Cc Carl Philipp Klemm <[email protected]>
Cc Daniel Lezcano <[email protected]>
Cc Eduardo Valentin <[email protected]>
Cc Merlijn Wajer <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Peter Ujfalusi <[email protected]>
Cc Sebastian Reichel <[email protected]>
---
 arch/arm/boot/dts/omap443x.dtsi | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/boot/dts/omap443x.dtsi +2 -0
index cb309743de5da..dd8ef58cbaed4 100644
@@ -33,10 +33,12 @@
 	};
 
 	ocp {
+		/* 4430 has only gpio_86 tshut and no talert interrupt */
 		bandgap: bandgap@4a002260 {
 			reg = <0x4a002260 0x4
 			       0x4a00232C 0x4>;
 			compatible = "ti,omap4430-bandgap";
+			gpios = <&gpio3 22 GPIO_ACTIVE_HIGH>;
 
 			#thermal-sensor-cells = <0>;
 		};
Signature · 1 line
2.27.0
author maintainer
#63 lore raw

PATCH 63/663 usb: dwc2: Do not update data length if it is 0 on inbound transfers

In reply to Greg Kroah-Hartman

From: Guenter Roeck <[email protected]>

[ Upstream commit 415fa1c7305dedbb345e2cc8ac91769bc1c83f1a ]

The DWC2 documentation states that transfers with zero data length should set the number of packets to 1 and the transfer length to 0. This is not currently the case for inbound transfers: the transfer length is set to the maximum packet length. This can have adverse effects if the chip actually does transfer data as it is programmed to do. Follow chip documentation and keep the transfer length set to 0 in that situation.

---
 drivers/usb/dwc2/hcd.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
drivers/usb/dwc2/hcd.c +8 -7
index e9ac215b96633..fc3269f5faf19 100644
@@ -1313,19 +1313,20 @@ static void dwc2_hc_start_transfer(struct dwc2_hsotg *hsotg,
 			if (num_packets > max_hc_pkt_count) {
 				num_packets = max_hc_pkt_count;
 				chan->xfer_len = num_packets * chan->max_packet;
+			} else if (chan->ep_is_in) {
+				/*
+				 * Always program an integral # of max packets
+				 * for IN transfers.
+				 * Note: This assumes that the input buffer is
+				 * aligned and sized accordingly.
+				 */
+				chan->xfer_len = num_packets * chan->max_packet;
 			}
 		} else {
 			/* Need 1 packet for transfer length of 0 */
 			num_packets = 1;
 		}
 
-		if (chan->ep_is_in)
-			/*
-			 * Always program an integral # of max packets for IN
-			 * transfers
-			 */
-			chan->xfer_len = num_packets * chan->max_packet;
-
 		if (chan->ep_type == USB_ENDPOINT_XFER_INT ||
 		    chan->ep_type == USB_ENDPOINT_XFER_ISOC)
 			/*
Signature · 1 line
2.27.0
author maintainer
#64 lore raw

PATCH 64/663 usb: dwc2: Abort transaction after errors with unknown reason

In reply to Greg Kroah-Hartman

From: Guenter Roeck <[email protected]>

[ Upstream commit f74b68c61cbc4b2245022fcce038509333d63f6f ]

In some situations, the following error messages are reported.

dwc2 ff540000.usb: dwc2_hc_chhltd_intr_dma: Channel 1 - ChHltd set, but reason is unknown dwc2 ff540000.usb: hcint 0x00000002, intsts 0x04000021

This is sometimes followed by:

dwc2 ff540000.usb: dwc2_update_urb_state_abn(): trimming xfer length

and then:

WARNING: CPU: 0 PID: 0 at kernel/v4.19/drivers/usb/dwc2/hcd.c:2913
			dwc2_assign_and_init_hc+0x98c/0x990

The warning suggests that an odd buffer address is to be used for DMA.

After an error is observed, the receive buffer may be full (urb->actual_length >= urb->length). However, the urb is still left in the queue unless three errors were observed in a row. When it is queued again, the dwc2 hcd code translates this into a 1-block transfer. If urb->actual_length (ie the total expected receive length) is not DMA-aligned, the buffer pointer programmed into the chip will be unaligned. This results in the observed warning.

To solve the problem, abort input transactions after an error with unknown cause if the entire packet was already received. This may be a bit drastic, but we don't really know why the transfer was aborted even though the entire packet was received. Aborting the transfer in this situation is less risky than accepting a potentially corrupted packet.

With this patch in place, the 'ChHltd set' and 'trimming xfer length' messages are still observed, but there are no more transfer attempts with odd buffer addresses.

---
 drivers/usb/dwc2/hcd_intr.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/usb/dwc2/hcd_intr.c +12 -0
index a052d39b4375e..12819e019e13c 100644
@@ -1977,6 +1977,18 @@ error:
 		qtd->error_count++;
 		dwc2_update_urb_state_abn(hsotg, chan, chnum, qtd->urb,
 					  qtd, DWC2_HC_XFER_XACT_ERR);
+		/*
+		 * We can get here after a completed transaction
+		 * (urb->actual_length >= urb->length) which was not reported
+		 * as completed. If that is the case, and we do not abort
+		 * the transfer, a transfer of size 0 will be enqueued
+		 * subsequently. If urb->actual_length is not DMA-aligned,
+		 * the buffer will then point to an unaligned address, and
+		 * the resulting behavior is undefined. Bail out in that
+		 * situation.
+		 */
+		if (qtd->urb->actual_length >= qtd->urb->length)
+			qtd->error_count = 3;
 		dwc2_hcd_save_data_toggle(hsotg, chan, chnum, qtd);
 		dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_XACT_ERR);
 	}
Signature · 1 line
2.27.0
author maintainer
#65 lore raw

PATCH 65/663 usb: dwc2: Make "trimming xfer length" a debug message

In reply to Greg Kroah-Hartman

From: Guenter Roeck <[email protected]>

[ Upstream commit 1a9e38cabd80356ffb98c2c88fec528ea9644fd5 ]

With some USB network adapters, such as DM96xx, the following message is seen for each maximum size receive packet.

dwc2 ff540000.usb: dwc2_update_urb_state(): trimming xfer length

This happens because the packet size requested by the driver is 1522 bytes, wMaxPacketSize is 64, the dwc2 driver configures the chip to receive 24*64 = 1536 bytes, and the chip does indeed send more than 1522 bytes of data. Since the event does not indicate an error condition, the message is just noise. Demote it to debug level.

---
 drivers/usb/dwc2/hcd_intr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/dwc2/hcd_intr.c +1 -1
index 12819e019e13c..d5f4ec1b73b15 100644
@@ -500,7 +500,7 @@ static int dwc2_update_urb_state(struct dwc2_hsotg *hsotg,
 						      &short_read);
 
 	if (urb->actual_length + xfer_length > urb->length) {
-		dev_warn(hsotg->dev, "%s(): trimming xfer length\n", __func__);
+		dev_dbg(hsotg->dev, "%s(): trimming xfer length\n", __func__);
 		xfer_length = urb->length - urb->actual_length;
 	}
 
Signature · 1 line
2.27.0
author maintainer
#66 lore raw

PATCH 66/663 staging: rtl8723bs: wifi_regd.c: Fix incorrect number of regulatory rules

In reply to Greg Kroah-Hartman

From: Chen-Yu Tsai <[email protected]>

[ Upstream commit 61834c967a929f6b4b7fcb91f43fa225cc29aa19 ]

The custom regulatory ruleset in the rtl8723bs driver lists an incorrect number of rules: one too many. This results in an out-of-bounds access, as detected by KASAN. This was possible thanks to the newly added support for KASAN on ARMv7.

Fix this by filling in the correct number of rules given.

KASAN report:

==================================================================

BUG: KASAN: global-out-of-bounds in cfg80211_does_bw_fit_range+0x14/0x4c [cfg80211]
Read of size 4 at addr bf20c254 by task ip/971

CPU: 2 PID: 971 Comm: ip Tainted: G         C        5.11.0-rc2-00020-gf7fe528a7ebe #1
Hardware name: Allwinner sun8i Family
[<c0113338>] (unwind_backtrace) from [<c010e8a4>] (show_stack+0x10/0x14)
[<c010e8a4>] (show_stack) from [<c0e0f868>] (dump_stack+0x9c/0xb4)
[<c0e0f868>] (dump_stack) from [<c0388284>] (print_address_description.constprop.2+0x1dc/0x2dc)
[<c0388284>] (print_address_description.constprop.2) from [<c03885cc>] (kasan_report+0x1a8/0x1c4)
[<c03885cc>] (kasan_report) from [<bf00a354>] (cfg80211_does_bw_fit_range+0x14/0x4c [cfg80211])
[<bf00a354>] (cfg80211_does_bw_fit_range [cfg80211]) from [<bf00b41c>] (freq_reg_info_regd.part.6+0x108/0x124 [>
[<bf00b41c>] (freq_reg_info_regd.part.6 [cfg80211]) from [<bf00df00>] (handle_channel_custom.constprop.12+0x48/>

[<bf00df00>] (handle_channel_custom.constprop.12 [cfg80211]) from [<bf00e150>] (wiphy_apply_custom_regulatory+0> [<bf00e150>] (wiphy_apply_custom_regulatory [cfg80211]) from [<bf1fb9e8>] (rtw_regd_init+0x60/0x70 [r8723bs]) [<bf1fb9e8>] (rtw_regd_init [r8723bs]) from [<bf1ee5a8>] (rtw_cfg80211_init_wiphy+0x164/0x1e8 [r8723bs]) [<bf1ee5a8>] (rtw_cfg80211_init_wiphy [r8723bs]) from [<bf1f8d50>] (_netdev_open+0xe4/0x28c [r8723bs]) [<bf1f8d50>] (_netdev_open [r8723bs]) from [<bf1f8f58>] (netdev_open+0x60/0x88 [r8723bs]) [<bf1f8f58>] (netdev_open [r8723bs]) from [<c0bb3730>] (__dev_open+0x178/0x220)
[<c0bb3730>] (__dev_open) from [<c0bb3cdc>] (__dev_change_flags+0x258/0x2c4)
[<c0bb3cdc>] (__dev_change_flags) from [<c0bb3d88>] (dev_change_flags+0x40/0x80)
[<c0bb3d88>] (dev_change_flags) from [<c0bc86fc>] (do_setlink+0x538/0x1160)
[<c0bc86fc>] (do_setlink) from [<c0bcf9e8>] (__rtnl_newlink+0x65c/0xad8)
[<c0bcf9e8>] (__rtnl_newlink) from [<c0bcfeb0>] (rtnl_newlink+0x4c/0x6c)
[<c0bcfeb0>] (rtnl_newlink) from [<c0bc67c8>] (rtnetlink_rcv_msg+0x1f8/0x454)
[<c0bc67c8>] (rtnetlink_rcv_msg) from [<c0c330e4>] (netlink_rcv_skb+0xc4/0x1e0)
[<c0c330e4>] (netlink_rcv_skb) from [<c0c32478>] (netlink_unicast+0x2c8/0x3c4)
[<c0c32478>] (netlink_unicast) from [<c0c32894>] (netlink_sendmsg+0x320/0x5f0)
[<c0c32894>] (netlink_sendmsg) from [<c0b75eb0>] (____sys_sendmsg+0x320/0x3e0)
[<c0b75eb0>] (____sys_sendmsg) from [<c0b78394>] (___sys_sendmsg+0xe8/0x12c)
[<c0b78394>] (___sys_sendmsg) from [<c0b78a50>] (__sys_sendmsg+0xc0/0x120)
[<c0b78a50>] (__sys_sendmsg) from [<c0100060>] (ret_fast_syscall+0x0/0x58)

Exception stack(0xc5693fa8 to 0xc5693ff0)

3fa0: 00000074 c7a39800 00000003 b6cee648 00000000 00000000
3fc0: 00000074 c7a39800 00000001 00000128 78d18349 00000000 b6ceeda0 004f7cb0 3fe0: 00000128 b6cee5e8 aeca151f aec1d746

The buggy address belongs to the variable:
 rtw_drv_halt+0xf908/0x6b4 [r8723bs]

Memory state around the buggy address:
 bf20c100: 00 00 00 00 00 00 00 00 00 00 04 f9 f9 f9 f9 f9
 bf20c180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>bf20c200: 00 00 00 00 00 00 00 00 00 00 04 f9 f9 f9 f9 f9
                                         ^
 bf20c280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 bf20c300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
Fixes 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
---
 drivers/staging/rtl8723bs/os_dep/wifi_regd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723bs/os_dep/wifi_regd.c +1 -1
index 578b9f734231e..65592bf84f380 100644
@@ -34,7 +34,7 @@
 	NL80211_RRF_PASSIVE_SCAN)
 
 static const struct ieee80211_regdomain rtw_regdom_rd = {
-	.n_reg_rules = 3,
+	.n_reg_rules = 2,
 	.alpha2 = "99",
 	.reg_rules = {
 		RTW_2GHZ_CH01_11,
Signature · 1 line
2.27.0
author maintainer
#67 lore raw

PATCH 67/663 x86/MSR: Filter MSR writes through X86_IOC_WRMSR_REGS ioctl too

In reply to Greg Kroah-Hartman

From: Misono Tomohiro <[email protected]>

[ Upstream commit 02a16aa13574c8526beadfc9ae8cc9b66315fa2d ]

Commit

a7e1f67ed29f ("x86/msr: Filter MSR writes")

introduced a module parameter to disable writing to the MSR device file and tainted the kernel upon writing. As MSR registers can be written by the X86_IOC_WRMSR_REGS ioctl too, the same filtering and tainting should be applied to the ioctl as well.

[ bp: Massage commit message and space out statements. ]

---
 arch/x86/kernel/msr.c | 7 +++++++
 1 file changed, 7 insertions(+)
arch/x86/kernel/msr.c +7 -0
index c0d4098106589..79f900ffde4c5 100644
@@ -184,6 +184,13 @@ static long msr_ioctl(struct file *file, unsigned int ioc, unsigned long arg)
 		err = security_locked_down(LOCKDOWN_MSR);
 		if (err)
 			break;
+
+		err = filter_write(regs[1]);
+		if (err)
+			return err;
+
+		add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_STILL_OK);
+
 		err = wrmsr_safe_regs_on_cpu(cpu, regs);
 		if (err)
 			break;
Signature · 1 line
2.27.0
author maintainer
#68 lore raw

PATCH 68/663 arm64: dts: renesas: beacon: Fix EEPROM compatible value

In reply to Greg Kroah-Hartman

From: Geert Uytterhoeven <[email protected]>

[ Upstream commit 74477936a828a7c91a61ba7e625b7ce2299c8c98 ]

"make dtbs_check" fails with:

arch/arm64/boot/dts/renesas/r8a774b1-beacon-rzg2n-kit.dt.yaml: eeprom@50: compatible: 'oneOf' conditional failed, one must be fixed:
'microchip,at24c64' does not match '^(atmel|catalyst|microchip|nxp|ramtron|renesas|rohm|st),(24(c|cs|lc|mac)[0-9]+|spd)$'

Fix this by dropping the bogus "at" prefix.

Fixes a1d8a344f1ca0709 ("arm64: dts: renesas: Introduce r8a774a1-beacon-rzg2m-kit")
---
 arch/arm64/boot/dts/renesas/beacon-renesom-som.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/renesas/beacon-renesom-som.dtsi +1 -1
index 6d24b36ca0a7c..289cf711307d6 100644
@@ -147,7 +147,7 @@
 	};
 
 	eeprom@50 {
-		compatible = "microchip,at24c64", "atmel,24c64";
+		compatible = "microchip,24c64", "atmel,24c64";
 		pagesize = <32>;
 		read-only;	/* Manufacturing EEPROM programmed at factory */
 		reg = <0x50>;
Signature · 1 line
2.27.0
author maintainer
#69 lore raw

PATCH 69/663 can: mcp251xfd: mcp251xfd_probe(): fix errata reference

In reply to Greg Kroah-Hartman

From: Marc Kleine-Budde <[email protected]>

[ Upstream commit 28eb119c042e8d3420b577b5b3ea851a111e7b2d ]

This patch fixes the reference to the errata for both the mcp2517fd and the mcp2518fd.

Fixes f5b84dedf7eb ("can: mcp25xxfd: mcp25xxfd_probe(): add SPI clk limit related errata information")
---
 drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c +1 -1
index 59de6b3b5f026..096d818c167e2 100644
@@ -2824,7 +2824,7 @@ static int mcp251xfd_probe(struct spi_device *spi)
 			spi_get_device_id(spi)->driver_data;
 
 	/* Errata Reference:
-	 * mcp2517fd: DS80000789B, mcp2518fd: DS80000792C 4.
+	 * mcp2517fd: DS80000792C 5., mcp2518fd: DS80000789C 4.
 	 *
 	 * The SPI can write corrupted data to the RAM at fast SPI
 	 * speeds:
Signature · 1 line
2.27.0
author maintainer
#70 lore raw

PATCH 70/663 ARM: dts: armada388-helios4: assign pinctrl to LEDs

In reply to Greg Kroah-Hartman

From: Rosen Penev <[email protected]>

[ Upstream commit e011c9025a4691b5c734029577a920bd6c320994 ]

Split up the pins to match earlier definitions. Allows LEDs to flash properly.

Fixes ced8025b569e ("ARM: dts: armada388-helios4")
---
 arch/arm/boot/dts/armada-388-helios4.dts | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
arch/arm/boot/dts/armada-388-helios4.dts +12 -3
index fb49df2a3bce7..e4c274ca26501 100644
@@ -70,6 +70,9 @@
 
 	system-leds {
 		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&helios_system_led_pins>;
+
 		status-led {
 			label = "helios4:green:status";
 			gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
@@ -86,6 +89,9 @@
 
 	io-leds {
 		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&helios_io_led_pins>;
+
 		sata1-led {
 			label = "helios4:green:ata1";
 			gpios = <&gpio1 17 GPIO_ACTIVE_LOW>;
@@ -286,9 +292,12 @@
 						       "mpp39", "mpp40";
 					marvell,function = "sd0";
 				};
-				helios_led_pins: helios-led-pins {
-					marvell,pins = "mpp24", "mpp25",
-						       "mpp49", "mpp50",
+				helios_system_led_pins: helios-system-led-pins {
+					marvell,pins = "mpp24", "mpp25";
+					marvell,function = "gpio";
+				};
+				helios_io_led_pins: helios-io-led-pins {
+					marvell,pins = "mpp49", "mpp50",
 						       "mpp52", "mpp53",
 						       "mpp54";
 					marvell,function = "gpio";
Signature · 1 line
2.27.0
author maintainer
#71 lore raw

PATCH 71/663 ARM: dts: armada388-helios4: assign pinctrl to each fan

In reply to Greg Kroah-Hartman

From: Rosen Penev <[email protected]>

[ Upstream commit 46ecdfc1830eaa40a11d7f832089c82b0e67ea96 ]

Split up the pins for each fan. This is needed in order to control them

Fixes ced8025b569e ("ARM: dts: armada388-helios4")
---
 arch/arm/boot/dts/armada-388-helios4.dts | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
arch/arm/boot/dts/armada-388-helios4.dts +10 -3
index e4c274ca26501..a7ff774d797c8 100644
@@ -127,11 +127,15 @@
 	fan1: j10-pwm {
 		compatible = "pwm-fan";
 		pwms = <&gpio1 9 40000>;	/* Target freq:25 kHz */
+		pinctrl-names = "default";
+		pinctrl-0 = <&helios_fan1_pins>;
 	};
 
 	fan2: j17-pwm {
 		compatible = "pwm-fan";
 		pwms = <&gpio1 23 40000>;	/* Target freq:25 kHz */
+		pinctrl-names = "default";
+		pinctrl-0 = <&helios_fan2_pins>;
 	};
 
 	usb2_phy: usb2-phy {
@@ -302,9 +306,12 @@
 						       "mpp54";
 					marvell,function = "gpio";
 				};
-				helios_fan_pins: helios-fan-pins {
-					marvell,pins = "mpp41", "mpp43",
-						       "mpp48", "mpp55";
+				helios_fan1_pins: helios_fan1_pins {
+					marvell,pins = "mpp41", "mpp43";
+					marvell,function = "gpio";
+				};
+				helios_fan2_pins: helios_fan2_pins {
+					marvell,pins = "mpp48", "mpp55";
 					marvell,function = "gpio";
 				};
 				microsom_spi1_cs_pins: spi1-cs-pins {
Signature · 1 line
2.27.0
author maintainer
#72 lore raw

PATCH 72/663 arm64: dts: armada-3720-turris-mox: rename u-boot mtd partition to a53-firmware

In reply to Greg Kroah-Hartman

From: Marek Behún <[email protected]>

[ Upstream commit a9d9bfcadfb43b856dbcf9419de75f7420d5a225 ]

The partition called "u-boot" in reality contains TF-A and U-Boot, and TF-A is before U-Boot.

Rename this parition to "a53-firmware" to avoid confusion for users, since they cannot simply build U-Boot from U-Boot repository and flash the resulting image there. Instead they have to build the firmware with the sources from the mox-boot-builder repository [1] and flash the a53-firmware.bin binary there.

[1] https://gitlab.nic.cz/turris/mox-boot-builder

Fixes 7109d817db2e ("arm64: dts: marvell: add DTS for Turris Mox")
Cc Gregory CLEMENT <[email protected]>
---
 arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts +1 -1
index bf76ebe463794..cca143e4b6bf8 100644
@@ -204,7 +204,7 @@
 			};
 
 			partition@20000 {
-				label = "u-boot";
+				label = "a53-firmware";
 				reg = <0x20000 0x160000>;
 			};
 
Signature · 9 lines
2.27.0




_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
author maintainer
#73 lore raw

PATCH 73/663 opp: Correct debug message in _opp_add_static_v2()

In reply to Greg Kroah-Hartman

From: Dmitry Osipenko <[email protected]>

[ Upstream commit d7b9d9b31a3e55dcc9b5c289abfafe31efa5b5c4 ]

The debug message always prints rate=0 instead of a proper value, fix it.

Fixes 6c591eec67cb ("OPP: Add helpers for reading the binding properties")
[ Viresh: Added Fixes tag ]
---
 drivers/opp/of.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/opp/of.c +2 -2
index 9faeb83e4b326..363277b31ecbb 100644
@@ -751,7 +751,6 @@ static struct dev_pm_opp *_opp_add_static_v2(struct opp_table *opp_table,
 		struct device *dev, struct device_node *np)
 {
 	struct dev_pm_opp *new_opp;
-	u64 rate = 0;
 	u32 val;
 	int ret;
 	bool rate_not_available = false;
@@ -768,7 +767,8 @@ static struct dev_pm_opp *_opp_add_static_v2(struct opp_table *opp_table,
 
 	/* Check if the OPP supports hardware's hierarchy of versions or not */
 	if (!_opp_is_supported(dev, opp_table, np)) {
-		dev_dbg(dev, "OPP not supported by hardware: %llu\n", rate);
+		dev_dbg(dev, "OPP not supported by hardware: %lu\n",
+			new_opp->rate);
 		goto free_opp;
 	}
 
Signature · 1 line
2.27.0
author maintainer
#74 lore raw

PATCH 74/663 Bluetooth: btusb: Fix memory leak in btusb_mtk_wmt_recv

In reply to Greg Kroah-Hartman

From: Jupeng Zhong <[email protected]>

[ Upstream commit de71a6cb4bf24d8993b9ca90d1ddb131b60251a1 ]

In btusb_mtk_wmt_recv if skb_clone fails, the alocated skb should be released.

Omit the labels “err_out” and “err_free_skb” in this function implementation so that the desired exception handling code would be directly specified in the affected if branches.

Fixes a1c49c434e15 ("btusb: Add protocol support for MediaTek MT7668U USB devices")
---
 drivers/bluetooth/btusb.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/bluetooth/btusb.c +10 -10
index 1c942869baacc..2953b96b3ceda 100644
@@ -2827,7 +2827,7 @@ static void btusb_mtk_wmt_recv(struct urb *urb)
 		skb = bt_skb_alloc(HCI_WMT_MAX_EVENT_SIZE, GFP_ATOMIC);
 		if (!skb) {
 			hdev->stat.err_rx++;
-			goto err_out;
+			return;
 		}
 
 		hci_skb_pkt_type(skb) = HCI_EVENT_PKT;
@@ -2845,13 +2845,18 @@ static void btusb_mtk_wmt_recv(struct urb *urb)
 		 */
 		if (test_bit(BTUSB_TX_WAIT_VND_EVT, &data->flags)) {
 			data->evt_skb = skb_clone(skb, GFP_ATOMIC);
-			if (!data->evt_skb)
-				goto err_out;
+			if (!data->evt_skb) {
+				kfree_skb(skb);
+				return;
+			}
 		}
 
 		err = hci_recv_frame(hdev, skb);
-		if (err < 0)
-			goto err_free_skb;
+		if (err < 0) {
+			kfree_skb(data->evt_skb);
+			data->evt_skb = NULL;
+			return;
+		}
 
 		if (test_and_clear_bit(BTUSB_TX_WAIT_VND_EVT,
 				       &data->flags)) {
@@ -2860,11 +2865,6 @@ static void btusb_mtk_wmt_recv(struct urb *urb)
 			wake_up_bit(&data->flags,
 				    BTUSB_TX_WAIT_VND_EVT);
 		}
-err_out:
-		return;
-err_free_skb:
-		kfree_skb(data->evt_skb);
-		data->evt_skb = NULL;
 		return;
 	} else if (urb->status == -ENOENT) {
 		/* Avoid suspend failed when usb_kill_urb */
Signature · 1 line
2.27.0
author maintainer
#75 lore raw

PATCH 75/663 soc: qcom: ocmem: dont return NULL in of_get_ocmem

In reply to Greg Kroah-Hartman

From: Luca Weiss <[email protected]>

[ Upstream commit 01f937ffc4686837d6c43dea80c6ade6cbd2940a ]

If ocmem probe fails for whatever reason, of_get_ocmem returned NULL. Without this, users must check for both NULL and IS_ERR on the returned pointer - which didn't happen in drivers/gpu/drm/msm/adreno/adreno_gpu.c leading to a NULL pointer dereference.

---
 drivers/soc/qcom/ocmem.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/soc/qcom/ocmem.c +7 -1
index 7f9e9944d1eae..f1875dc31ae2c 100644
@@ -189,6 +189,7 @@ struct ocmem *of_get_ocmem(struct device *dev)
 {
 	struct platform_device *pdev;
 	struct device_node *devnode;
+	struct ocmem *ocmem;
 
 	devnode = of_parse_phandle(dev->of_node, "sram", 0);
 	if (!devnode || !devnode->parent) {
@@ -202,7 +203,12 @@ struct ocmem *of_get_ocmem(struct device *dev)
 		return ERR_PTR(-EPROBE_DEFER);
 	}
 
-	return platform_get_drvdata(pdev);
+	ocmem = platform_get_drvdata(pdev);
+	if (!ocmem) {
+		dev_err(dev, "Cannot get ocmem\n");
+		return ERR_PTR(-ENODEV);
+	}
+	return ocmem;
 }
 EXPORT_SYMBOL(of_get_ocmem);
 
Signature · 1 line
2.27.0
author maintainer
#76 lore raw

PATCH 76/663 arm64: dts: msm8916: Fix reserved and rfsa nodes unit address

In reply to Greg Kroah-Hartman

From: Vincent Knecht <[email protected]>

[ Upstream commit d5ae2528b0b56cf054b27d48b0cb85330900082f ]

Fix reserved and rfsa unit address according to their reg address

Fixes 7258e10e6a0b ("ARM: dts: msm8916: Update reserved-memory")
---
 arch/arm64/boot/dts/qcom/msm8916.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/msm8916.dtsi +2 -2
index aaa21899f1a63..0e34ed48b9fae 100644
@@ -55,7 +55,7 @@
 			no-map;
 		};
 
-		reserved@8668000 {
+		reserved@86680000 {
 			reg = <0x0 0x86680000 0x0 0x80000>;
 			no-map;
 		};
@@ -68,7 +68,7 @@
 			qcom,client-id = <1>;
 		};
 
-		rfsa@867e00000 {
+		rfsa@867e0000 {
 			reg = <0x0 0x867e0000 0x0 0x20000>;
 			no-map;
 		};
Signature · 1 line
2.27.0
author maintainer
#77 lore raw

PATCH 77/663 arm64: dts: meson: fix broken wifi node for Khadas VIM3L

In reply to Greg Kroah-Hartman

From: Artem Lapkin <[email protected]>

[ Upstream commit 39be8f441f78908e97ff913571e10ec03387a63a ]

move &sd_emmc_a ... from /* */ commented area, because cant load wifi fw without sd-uhs-sdr50 option on VIM3L

[   11.686590] brcmfmac: brcmf_chip_cores_check: CPU core not detected
[   11.696382] brcmfmac: brcmf_sdio_probe_attach: brcmf_chip_attach failed!
[   11.706240] brcmfmac: brcmf_sdio_probe: brcmf_sdio_probe_attach failed
[   11.715890] brcmfmac: brcmf_ops_sdio_probe: F2 error, probe failed -19...
[   13.718424] brcmfmac: brcmf_chip_recognition: chip backplane type 15 is not supported
Fixes f1bb924e8f5b ("arm64: dts: meson: fix mmc0 tuning error on Khadas VIM3")
---
 arch/arm64/boot/dts/amlogic/meson-sm1-khadas-vim3l.dts | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/amlogic/meson-sm1-khadas-vim3l.dts +3 -4
index 4b517ca720597..06de0b1ce7267 100644
@@ -89,13 +89,12 @@
 	status = "okay";
 };
 
-&sd_emmc_a {
-	sd-uhs-sdr50;
-};
-
 &usb {
 	phys = <&usb2_phy0>, <&usb2_phy1>;
 	phy-names = "usb2-phy0", "usb2-phy1";
 };
  */
 
+&sd_emmc_a {
+	sd-uhs-sdr50;
+};
Signature · 1 line
2.27.0
author maintainer
#78 lore raw

PATCH 78/663 iwlwifi: mvm: set enabled in the PPAG command properly

In reply to Greg Kroah-Hartman

From: Luca Coelho <[email protected]>

[ Upstream commit efaa85cf2294d5e10a724e24356507eeb3836f72 ]

When version 2 of the PER_PLATFORM_ANT_GAIN_CMD was implemented, we started copying the values from the command that we have stored into a local instance. But we accidentally forgot to copy the enabled flag, so in practice PPAG is never really enabled. Fix this by copying the flag from our stored data a we should.

---
 drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +2 -0
index 6385b9641126b..059ce227151ea 100644
@@ -1034,6 +1034,8 @@ int iwl_mvm_ppag_send_cmd(struct iwl_mvm *mvm)
 		return 0;
 	}
 
+	ppag_table.v1.enabled = mvm->fwrt.ppag_table.v1.enabled;
+
 	cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, PHY_OPS_GROUP,
 					PER_PLATFORM_ANT_GAIN_CMD,
 					IWL_FW_CMD_VER_UNKNOWN);
Signature · 1 line
2.27.0
author maintainer
#79 lore raw

PATCH 79/663 ARM: s3c: fix fiq for clang IAS

In reply to Greg Kroah-Hartman

From: Arnd Bergmann <[email protected]>

[ Upstream commit 7f9942c61fa60eda7cc8e42f04bd25b7d175876e ]

Building with the clang integrated assembler produces a couple of errors for the s3c24xx fiq support:

arch/arm/mach-s3c/irq-s3c24xx-fiq.S:52:2: error: instruction 'subne' can not set flags, but 's' suffix specified
subnes pc, lr, #4 @@ return, still have work to do

arch/arm/mach-s3c/irq-s3c24xx-fiq.S:64:1: error: invalid symbol redefinition

    s3c24xx_spi_fiq_txrx:

There are apparently two problems: one with extraneous or duplicate labels, and one with old-style opcode mnemonics. Stefan Agner has previously fixed other problems like this, but missed this particular file.

---
 arch/arm/mach-s3c/irq-s3c24xx-fiq.S | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
arch/arm/mach-s3c/irq-s3c24xx-fiq.S +3 -6
index b54cbd0122413..5d238d9a798e1 100644
@@ -35,7 +35,6 @@
 	@ and an offset to the irq acknowledgment word
 
 ENTRY(s3c24xx_spi_fiq_rx)
-s3c24xx_spi_fix_rx:
 	.word	fiq_rx_end - fiq_rx_start
 	.word	fiq_rx_irq_ack - fiq_rx_start
 fiq_rx_start:
@@ -49,7 +48,7 @@ fiq_rx_start:
 	strb	fiq_rtmp, [ fiq_rspi, # S3C2410_SPTDAT ]
 
 	subs	fiq_rcount, fiq_rcount, #1
-	subnes	pc, lr, #4		@@ return, still have work to do
+	subsne	pc, lr, #4		@@ return, still have work to do
 
 	@@ set IRQ controller so that next op will trigger IRQ
 	mov	fiq_rtmp, #0
@@ -61,7 +60,6 @@ fiq_rx_irq_ack:
 fiq_rx_end:
 
 ENTRY(s3c24xx_spi_fiq_txrx)
-s3c24xx_spi_fiq_txrx:
 	.word	fiq_txrx_end - fiq_txrx_start
 	.word	fiq_txrx_irq_ack - fiq_txrx_start
 fiq_txrx_start:
@@ -76,7 +74,7 @@ fiq_txrx_start:
 	strb	fiq_rtmp, [ fiq_rspi, # S3C2410_SPTDAT ]
 
 	subs	fiq_rcount, fiq_rcount, #1
-	subnes	pc, lr, #4		@@ return, still have work to do
+	subsne	pc, lr, #4		@@ return, still have work to do
 
 	mov	fiq_rtmp, #0
 	str	fiq_rtmp, [ fiq_rirq, # S3C2410_INTMOD  - S3C24XX_VA_IRQ ]
@@ -88,7 +86,6 @@ fiq_txrx_irq_ack:
 fiq_txrx_end:
 
 ENTRY(s3c24xx_spi_fiq_tx)
-s3c24xx_spi_fix_tx:
 	.word	fiq_tx_end - fiq_tx_start
 	.word	fiq_tx_irq_ack - fiq_tx_start
 fiq_tx_start:
@@ -101,7 +98,7 @@ fiq_tx_start:
 	strb	fiq_rtmp, [ fiq_rspi, # S3C2410_SPTDAT ]
 
 	subs	fiq_rcount, fiq_rcount, #1
-	subnes	pc, lr, #4		@@ return, still have work to do
+	subsne	pc, lr, #4		@@ return, still have work to do
 
 	mov	fiq_rtmp, #0
 	str	fiq_rtmp, [ fiq_rirq, # S3C2410_INTMOD  - S3C24XX_VA_IRQ ]
Signature · 1 line
2.27.0
author maintainer
#80 lore raw

PATCH 80/663 optee: simplify i2c access

In reply to Greg Kroah-Hartman

From: Arnd Bergmann <[email protected]>

[ Upstream commit 67bc809752796acb2641ca343cad5b45eef31d7c ]

Storing a bogus i2c_client structure on the stack adds overhead and causes a compile-time warning:

drivers/tee/optee/rpc.c:493:6: error: stack frame size of 1056 bytes in function 'optee_handle_rpc' [-Werror,-Wframe-larger-than=] void optee_handle_rpc(struct tee_context *ctx, struct optee_rpc_param *param,

Change the implementation of handle_rpc_func_cmd_i2c_transfer() to open-code the i2c_transfer() call, which makes it easier to read and avoids the warning.

Fixes c05210ab9757 ("drivers: optee: allow op-tee to access devices on the i2c bus")
---
 drivers/tee/optee/rpc.c | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)
drivers/tee/optee/rpc.c +16 -15
index 1e3614e4798f0..6cbb3643c6c48 100644
@@ -54,8 +54,9 @@ bad:
 static void handle_rpc_func_cmd_i2c_transfer(struct tee_context *ctx,
 					     struct optee_msg_arg *arg)
 {
-	struct i2c_client client = { 0 };
 	struct tee_param *params;
+	struct i2c_adapter *adapter;
+	struct i2c_msg msg = { };
 	size_t i;
 	int ret = -EOPNOTSUPP;
 	u8 attr[] = {
@@ -85,48 +86,48 @@ static void handle_rpc_func_cmd_i2c_transfer(struct tee_context *ctx,
 			goto bad;
 	}
 
-	client.adapter = i2c_get_adapter(params[0].u.value.b);
-	if (!client.adapter)
+	adapter = i2c_get_adapter(params[0].u.value.b);
+	if (!adapter)
 		goto bad;
 
 	if (params[1].u.value.a & OPTEE_MSG_RPC_CMD_I2C_FLAGS_TEN_BIT) {
-		if (!i2c_check_functionality(client.adapter,
+		if (!i2c_check_functionality(adapter,
 					     I2C_FUNC_10BIT_ADDR)) {
-			i2c_put_adapter(client.adapter);
+			i2c_put_adapter(adapter);
 			goto bad;
 		}
 
-		client.flags = I2C_CLIENT_TEN;
+		msg.flags = I2C_M_TEN;
 	}
 
-	client.addr = params[0].u.value.c;
-	snprintf(client.name, I2C_NAME_SIZE, "i2c%d", client.adapter->nr);
+	msg.addr = params[0].u.value.c;
+	msg.buf  = params[2].u.memref.shm->kaddr;
+	msg.len  = params[2].u.memref.size;
 
 	switch (params[0].u.value.a) {
 	case OPTEE_MSG_RPC_CMD_I2C_TRANSFER_RD:
-		ret = i2c_master_recv(&client, params[2].u.memref.shm->kaddr,
-				      params[2].u.memref.size);
+		msg.flags |= I2C_M_RD;
 		break;
 	case OPTEE_MSG_RPC_CMD_I2C_TRANSFER_WR:
-		ret = i2c_master_send(&client, params[2].u.memref.shm->kaddr,
-				      params[2].u.memref.size);
 		break;
 	default:
-		i2c_put_adapter(client.adapter);
+		i2c_put_adapter(adapter);
 		goto bad;
 	}
 
+	ret = i2c_transfer(adapter, &msg, 1);
+
 	if (ret < 0) {
 		arg->ret = TEEC_ERROR_COMMUNICATION;
 	} else {
-		params[3].u.value.a = ret;
+		params[3].u.value.a = msg.len;
 		if (optee_to_msg_param(arg->params, arg->num_params, params))
 			arg->ret = TEEC_ERROR_BAD_PARAMETERS;
 		else
 			arg->ret = TEEC_SUCCESS;
 	}
 
-	i2c_put_adapter(client.adapter);
+	i2c_put_adapter(adapter);
 	kfree(params);
 	return;
 bad:
Signature · 1 line
2.27.0
author maintainer
#81 lore raw

PATCH 81/663 staging: wfx: fix possible panic with re-queued frames

In reply to Greg Kroah-Hartman

From: Jérôme Pouiller <[email protected]>

[ Upstream commit 26df933d9b83ea668304dc4ec641d52ea1fc4091 ]

When the firmware rejects a frame (because station become asleep or disconnected), the frame is re-queued in mac80211. However, the re-queued frame was 8 bytes longer than the original one (the size of the ICV for the encryption). So, when mac80211 try to send this frame again, it is a little bigger than expected.
If the frame is re-queued secveral time it end with a skb_over_panic because the skb buffer is not large enough.

Note it only happens when device acts as an AP and encryption is enabled.

This patch more or less reverts the commit 049fde130419 ("staging: wfx:
drop useless field from struct wfx_tx_priv").

Fixes 049fde130419 ("staging: wfx: drop useless field from struct wfx_tx_priv")
---
 drivers/staging/wfx/data_tx.c | 10 +++++++++-
 drivers/staging/wfx/data_tx.h |  1 +
 2 files changed, 10 insertions(+), 1 deletion(-)
drivers/staging/wfx/data_tx.c +9 -1
index 36b36ef39d053..77fb104efdec1 100644
@@ -331,6 +331,7 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta,
 {
 	struct hif_msg *hif_msg;
 	struct hif_req_tx *req;
+	struct wfx_tx_priv *tx_priv;
 	struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
 	struct ieee80211_key_conf *hw_key = tx_info->control.hw_key;
 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
@@ -344,11 +345,14 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta,
 
 	// From now tx_info->control is unusable
 	memset(tx_info->rate_driver_data, 0, sizeof(struct wfx_tx_priv));
+	// Fill tx_priv
+	tx_priv = (struct wfx_tx_priv *)tx_info->rate_driver_data;
+	tx_priv->icv_size = wfx_tx_get_icv_len(hw_key);
 
 	// Fill hif_msg
 	WARN(skb_headroom(skb) < wmsg_len, "not enough space in skb");
 	WARN(offset & 1, "attempt to transmit an unaligned frame");
-	skb_put(skb, wfx_tx_get_icv_len(hw_key));
+	skb_put(skb, tx_priv->icv_size);
 	skb_push(skb, wmsg_len);
 	memset(skb->data, 0, wmsg_len);
 	hif_msg = (struct hif_msg *)skb->data;
@@ -484,6 +488,7 @@ static void wfx_tx_fill_rates(struct wfx_dev *wdev,
 
 void wfx_tx_confirm_cb(struct wfx_dev *wdev, const struct hif_cnf_tx *arg)
 {
+	const struct wfx_tx_priv *tx_priv;
 	struct ieee80211_tx_info *tx_info;
 	struct wfx_vif *wvif;
 	struct sk_buff *skb;
@@ -495,6 +500,7 @@ void wfx_tx_confirm_cb(struct wfx_dev *wdev, const struct hif_cnf_tx *arg)
 		return;
 	}
 	tx_info = IEEE80211_SKB_CB(skb);
+	tx_priv = wfx_skb_tx_priv(skb);
 	wvif = wdev_to_wvif(wdev, ((struct hif_msg *)skb->data)->interface);
 	WARN_ON(!wvif);
 	if (!wvif)
@@ -503,6 +509,8 @@ void wfx_tx_confirm_cb(struct wfx_dev *wdev, const struct hif_cnf_tx *arg)
 	// Note that wfx_pending_get_pkt_us_delay() get data from tx_info
 	_trace_tx_stats(arg, skb, wfx_pending_get_pkt_us_delay(wdev, skb));
 	wfx_tx_fill_rates(wdev, tx_info, arg);
+	skb_trim(skb, skb->len - tx_priv->icv_size);
+
 	// From now, you can touch to tx_info->status, but do not touch to
 	// tx_priv anymore
 	// FIXME: use ieee80211_tx_info_clear_status()
drivers/staging/wfx/data_tx.h +1 -0
index 46c9fff7a870e..401363d6b563a 100644
@@ -35,6 +35,7 @@ struct tx_policy_cache {
 
 struct wfx_tx_priv {
 	ktime_t xmit_timestamp;
+	unsigned char icv_size;
 };
 
 void wfx_tx_policy_init(struct wfx_vif *wvif);
Signature · 1 line
2.27.0
author maintainer
#82 lore raw

PATCH 82/663 ARM: at91: use proper asm syntax in pm_suspend

In reply to Greg Kroah-Hartman

From: Arnd Bergmann <[email protected]>

[ Upstream commit d30337da8677cd73cb19444436b311c13e57356f ]

Compiling with the clang integrated assembler warns about a recently added instruction:

<instantiation>:14:13: error: unknown token in expression
ldr tmp1, =#0x00020010UL
arch/arm/mach-at91/pm_suspend.S:542:2: note: while in macro instantiation
at91_plla_enable

Remove the extra '#' character that is not used for the 'ldr' instruction when doing an indirect load of a constant.

---
 arch/arm/mach-at91/pm_suspend.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-at91/pm_suspend.S +1 -1
index 0184de05c1be1..b683c2caa40b9 100644
@@ -442,7 +442,7 @@ ENDPROC(at91_backup_mode)
 	str	tmp1, [pmc, #AT91_PMC_PLL_UPDT]
 
 	/* step 2. */
-	ldr	tmp1, =#AT91_PMC_PLL_ACR_DEFAULT_PLLA
+	ldr	tmp1, =AT91_PMC_PLL_ACR_DEFAULT_PLLA
 	str	tmp1, [pmc, #AT91_PMC_PLL_ACR]
 
 	/* step 3. */
Signature · 1 line
2.27.0
author maintainer
#83 lore raw

PATCH 83/663 ath10k: Fix suspicious RCU usage warning in ath10k_wmi_tlv_parse_peer_stats_info()

In reply to Greg Kroah-Hartman

From: Anand K Mistry <[email protected]>

[ Upstream commit 2615e3cdbd9c0e864f5906279c952a309871d225 ]

The ieee80211_find_sta_by_ifaddr call in ath10k_wmi_tlv_parse_peer_stats_info must be called while holding the RCU read lock. Otherwise, the following warning will be seen when RCU usage checking is enabled:

=============================
WARNING: suspicious RCU usage
5.10.3 #8 Tainted: G W
-----------------------------
include/linux/rhashtable.h:594 suspicious rcu_dereference_check() usage!

other info that might help us debug this:

rcu_scheduler_active = 2, debug_locks = 1
no locks held by ksoftirqd/1/16.

stack backtrace:
CPU: 1 PID: 16 Comm: ksoftirqd/1 Tainted: G        W         5.10.3 #8
Hardware name: HP Grunt/Grunt, BIOS Google_Grunt.11031.104.0 09/05/2019
Call Trace:
 dump_stack+0xab/0x115
 sta_info_hash_lookup+0x71/0x1e9 [mac80211]
 ? lock_is_held_type+0xe6/0x12f
 ? __kasan_kmalloc+0xfb/0x112
 ieee80211_find_sta_by_ifaddr+0x12/0x61 [mac80211]
 ath10k_wmi_tlv_parse_peer_stats_info+0xbd/0x10b [ath10k_core]
 ath10k_wmi_tlv_iter+0x8b/0x1a1 [ath10k_core]
 ? ath10k_wmi_tlv_iter+0x1a1/0x1a1 [ath10k_core]
 ath10k_wmi_tlv_event_peer_stats_info+0x103/0x13b [ath10k_core]
 ath10k_wmi_tlv_op_rx+0x722/0x80d [ath10k_core]
 ath10k_htc_rx_completion_handler+0x16e/0x1d7 [ath10k_core]
 ath10k_pci_process_rx_cb+0x116/0x22c [ath10k_pci]
 ? ath10k_htc_process_trailer+0x332/0x332 [ath10k_core]
 ? _raw_spin_unlock_irqrestore+0x34/0x61
 ? lockdep_hardirqs_on+0x8e/0x12e
 ath10k_ce_per_engine_service+0x55/0x74 [ath10k_core]
 ath10k_ce_per_engine_service_any+0x76/0x84 [ath10k_core]
 ath10k_pci_napi_poll+0x49/0x141 [ath10k_pci]
 net_rx_action+0x11a/0x347
 __do_softirq+0x2d3/0x539
 run_ksoftirqd+0x4b/0x86
 smpboot_thread_fn+0x1d0/0x2ab
 ? cpu_report_death+0x7f/0x7f
 kthread+0x189/0x191
 ? cpu_report_death+0x7f/0x7f
 ? kthread_blkcg+0x31/0x31
 ret_from_fork+0x22/0x30
---
 drivers/net/wireless/ath/ath10k/wmi-tlv.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/wireless/ath/ath10k/wmi-tlv.c +3 -0
index 7b5834157fe51..e6135795719a1 100644
@@ -240,8 +240,10 @@ static int ath10k_wmi_tlv_parse_peer_stats_info(struct ath10k *ar, u16 tag, u16
 		   __le32_to_cpu(stat->last_tx_rate_code),
 		   __le32_to_cpu(stat->last_tx_bitrate_kbps));
 
+	rcu_read_lock();
 	sta = ieee80211_find_sta_by_ifaddr(ar->hw, stat->peer_macaddr.addr, NULL);
 	if (!sta) {
+		rcu_read_unlock();
 		ath10k_warn(ar, "not found station for peer stats\n");
 		return -EINVAL;
 	}
@@ -251,6 +253,7 @@ static int ath10k_wmi_tlv_parse_peer_stats_info(struct ath10k *ar, u16 tag, u16
 	arsta->rx_bitrate_kbps = __le32_to_cpu(stat->last_rx_bitrate_kbps);
 	arsta->tx_rate_code = __le32_to_cpu(stat->last_tx_rate_code);
 	arsta->tx_bitrate_kbps = __le32_to_cpu(stat->last_tx_bitrate_kbps);
+	rcu_read_unlock();
 
 	return 0;
 }
Signature · 1 line
2.27.0
author maintainer
#84 lore raw

PATCH 84/663 ath10k: Fix lockdep assertion warning in ath10k_sta_statistics

In reply to Greg Kroah-Hartman

From: Anand K Mistry <[email protected]>

[ Upstream commit 7df28718928d08034b36168200d67b558ce36f3d ]

ath10k_debug_fw_stats_request just be called with conf_mutex held, otherwise the following warning is seen when lock debugging is enabled:

WARNING: CPU: 0 PID: 793 at drivers/net/wireless/ath/ath10k/debug.c:357 ath10k_debug_fw_stats_request+0x12c/0x133 [ath10k_core]
Modules linked in: snd_hda_codec_hdmi designware_i2s snd_hda_intel snd_intel_dspcfg snd_hda_codec i2c_piix4 snd_hwdep snd_hda_core acpi_als kfifo_buf industrialio snd_soc_max98357a snd_soc_adau7002 snd_soc_acp_da7219mx98357_mach snd_soc_da7219 acp_audio_dma ccm xt_MASQUERADE fuse ath10k_pci ath10k_core lzo_rle ath lzo_compress mac80211 zram cfg80211 r8152 mii joydev
CPU: 0 PID: 793 Comm: wpa_supplicant Tainted: G        W         5.10.9 #5
Hardware name: HP Grunt/Grunt, BIOS Google_Grunt.11031.104.0 09/05/2019
RIP: 0010:ath10k_debug_fw_stats_request+0x12c/0x133 [ath10k_core]
Code: 1e bb a1 ff ff ff 4c 89 ef 48 c7 c6 d3 31 2e c0 89 da 31 c0 e8 bd f8 ff ff 89 d8 eb 02 31 c0 5b 41 5c 41 5d 41 5e 41 5f 5d c3 <0f> 0b e9 04 ff ff ff 0f 1f 44 00 00 55 48 89 e5 41 56 53 48 89 fb
RSP: 0018:ffffb2478099f7d0 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff9e432700cce0 RCX: 11c85cfd6b8e3b00
RDX: ffff9e432700cce0 RSI: ffff9e43127c5668 RDI: ffff9e4318deddf0
RBP: ffffb2478099f7f8 R08: 0000000000000002 R09: 00000003fd7068cc
R10: ffffffffc01b2749 R11: ffffffffc029efaf R12: ffff9e432700c000
R13: ffff9e43127c33e0 R14: ffffb2478099f918 R15: ffff9e43127c33e0
FS:  00007f7ea48e2740(0000) GS:ffff9e432aa00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000059aa799ddf38 CR3: 0000000118de2000 CR4: 00000000001506f0
Call Trace:
 ath10k_sta_statistics+0x4d/0x270 [ath10k_core]
 sta_set_sinfo+0x1be/0xaec [mac80211]
 ieee80211_get_station+0x58/0x76 [mac80211]
 rdev_get_station+0xf1/0x11e [cfg80211]
 nl80211_get_station+0x7f/0x146 [cfg80211]
 genl_rcv_msg+0x32e/0x35e
 ? nl80211_stop_ap+0x19/0x19 [cfg80211]
 ? nl80211_get_station+0x146/0x146 [cfg80211]
 ? genl_rcv+0x19/0x36
 ? genl_rcv+0x36/0x36
 netlink_rcv_skb+0x89/0xfb
 genl_rcv+0x28/0x36
 netlink_unicast+0x169/0x23b
 netlink_sendmsg+0x38a/0x402
 sock_sendmsg+0x72/0x76
 ____sys_sendmsg+0x153/0x1cc
 ? copy_msghdr_from_user+0x5d/0x85
 ___sys_sendmsg+0x7c/0xb5
 ? lock_acquire+0x181/0x23d
 ? syscall_trace_enter+0x15e/0x160
 ? find_held_lock+0x3d/0xb2
 ? syscall_trace_enter+0x15e/0x160
 ? sched_clock_cpu+0x15/0xc6
 __sys_sendmsg+0x62/0x9a
 do_syscall_64+0x43/0x55
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
---
 drivers/net/wireless/ath/ath10k/mac.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/wireless/ath/ath10k/mac.c +2 -0
index 2e3eb5bbe49c8..4bc84cc5e824b 100644
@@ -9116,7 +9116,9 @@ static void ath10k_sta_statistics(struct ieee80211_hw *hw,
 	if (!ath10k_peer_stats_enabled(ar))
 		return;
 
+	mutex_lock(&ar->conf_mutex);
 	ath10k_debug_fw_stats_request(ar);
+	mutex_unlock(&ar->conf_mutex);
 
 	sinfo->rx_duration = arsta->rx_duration;
 	sinfo->filled |= BIT_ULL(NL80211_STA_INFO_RX_DURATION);
Signature · 1 line
2.27.0
author maintainer
#85 lore raw

PATCH 85/663 ath11k: fix a locking bug in ath11k_mac_op_start()

In reply to Greg Kroah-Hartman

From: Dan Carpenter <[email protected]>

[ Upstream commit c202e2ebe1dc454ad54fd0018c023ec553d47284 ]

This error path leads to a Smatch warning:

	drivers/net/wireless/ath/ath11k/mac.c:4269 ath11k_mac_op_start()
	error: double unlocked '&ar->conf_mutex' (orig line 4251)

We're not holding the lock when we do the "goto err;" so it leads to a double unlock. The fix is to hold the lock for a little longer.

Fixes c83c500b55b6 ("ath11k: enable idle power save mode")
[[email protected]: move also rcu_assign_pointer() call]
---
 drivers/net/wireless/ath/ath11k/mac.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/ath11k/mac.c +6 -5
index af427d9051a07..b5bd9b06da89e 100644
@@ -4213,11 +4213,6 @@ static int ath11k_mac_op_start(struct ieee80211_hw *hw)
 	/* Configure the hash seed for hash based reo dest ring selection */
 	ath11k_wmi_pdev_lro_cfg(ar, ar->pdev->pdev_id);
 
-	mutex_unlock(&ar->conf_mutex);
-
-	rcu_assign_pointer(ab->pdevs_active[ar->pdev_idx],
-			   &ab->pdevs[ar->pdev_idx]);
-
 	/* allow device to enter IMPS */
 	if (ab->hw_params.idle_ps) {
 		ret = ath11k_wmi_pdev_set_param(ar, WMI_PDEV_PARAM_IDLE_PS_CONFIG,
@@ -4227,6 +4222,12 @@ static int ath11k_mac_op_start(struct ieee80211_hw *hw)
 			goto err;
 		}
 	}
+
+	mutex_unlock(&ar->conf_mutex);
+
+	rcu_assign_pointer(ab->pdevs_active[ar->pdev_idx],
+			   &ab->pdevs[ar->pdev_idx]);
+
 	return 0;
 
 err:
Signature · 1 line
2.27.0
author maintainer
#86 lore raw

PATCH 86/663 soc: aspeed: snoop: Add clock control logic

In reply to Greg Kroah-Hartman

From: Jae Hyun Yoo <[email protected]>

[ Upstream commit 3f94cf15583be554df7aaa651b8ff8e1b68fbe51 ]

If LPC SNOOP driver is registered ahead of lpc-ctrl module, LPC SNOOP block will be enabled without heart beating of LCLK until lpc-ctrl enables the LCLK. This issue causes improper handling on host interrupts when the host sends interrupt in that time frame. Then kernel eventually forcibly disables the interrupt with dumping stack and printing a 'nobody cared this irq' message out.

To prevent this issue, all LPC sub-nodes should enable LCLK individually so this patch adds clock control logic into the LPC SNOOP driver.

Fixes 3772e5da4454 ("drivers/misc: Aspeed LPC snoop output using misc chardev")
---
 drivers/soc/aspeed/aspeed-lpc-snoop.c | 30 ++++++++++++++++++++++++---
 1 file changed, 27 insertions(+), 3 deletions(-)
drivers/soc/aspeed/aspeed-lpc-snoop.c +27 -3
index f3d8d53ab84de..dbe5325a324d5 100644
@@ -11,6 +11,7 @@
  */
 
 #include <linux/bitops.h>
+#include <linux/clk.h>
 #include <linux/interrupt.h>
 #include <linux/fs.h>
 #include <linux/kfifo.h>
@@ -67,6 +68,7 @@ struct aspeed_lpc_snoop_channel {
 struct aspeed_lpc_snoop {
 	struct regmap		*regmap;
 	int			irq;
+	struct clk		*clk;
 	struct aspeed_lpc_snoop_channel chan[NUM_SNOOP_CHANNELS];
 };
 
@@ -282,22 +284,42 @@ static int aspeed_lpc_snoop_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
+	lpc_snoop->clk = devm_clk_get(dev, NULL);
+	if (IS_ERR(lpc_snoop->clk)) {
+		rc = PTR_ERR(lpc_snoop->clk);
+		if (rc != -EPROBE_DEFER)
+			dev_err(dev, "couldn't get clock\n");
+		return rc;
+	}
+	rc = clk_prepare_enable(lpc_snoop->clk);
+	if (rc) {
+		dev_err(dev, "couldn't enable clock\n");
+		return rc;
+	}
+
 	rc = aspeed_lpc_snoop_config_irq(lpc_snoop, pdev);
 	if (rc)
-		return rc;
+		goto err;
 
 	rc = aspeed_lpc_enable_snoop(lpc_snoop, dev, 0, port);
 	if (rc)
-		return rc;
+		goto err;
 
 	/* Configuration of 2nd snoop channel port is optional */
 	if (of_property_read_u32_index(dev->of_node, "snoop-ports",
 				       1, &port) == 0) {
 		rc = aspeed_lpc_enable_snoop(lpc_snoop, dev, 1, port);
-		if (rc)
+		if (rc) {
 			aspeed_lpc_disable_snoop(lpc_snoop, 0);
+			goto err;
+		}
 	}
 
+	return 0;
+
+err:
+	clk_disable_unprepare(lpc_snoop->clk);
+
 	return rc;
 }
 
@@ -309,6 +331,8 @@ static int aspeed_lpc_snoop_remove(struct platform_device *pdev)
 	aspeed_lpc_disable_snoop(lpc_snoop, 0);
 	aspeed_lpc_disable_snoop(lpc_snoop, 1);
 
+	clk_disable_unprepare(lpc_snoop->clk);
+
 	return 0;
 }
 
Signature · 1 line
2.27.0
author maintainer
#87 lore raw

PATCH 87/663 iwlwifi: mvm: fix the type we use in the PPAG table validity checks

In reply to Greg Kroah-Hartman

From: Luca Coelho <[email protected]>

[ Upstream commit 5a6842455c113920001df83cffa28accceeb0927 ]

The value we receive from ACPI is a long long unsigned integer but the values should be treated as signed char. When comparing the received value with ACPI_PPAG_MIN_LB/HB, we were doing an unsigned comparison, so the negative value would actually be treated as a very high number.

To solve this issue, assign the value to our table of s8's before making the comparison, so the value is already converted when we do so.

---
 drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +13 -6
index 059ce227151ea..c351c91a9ec96 100644
@@ -999,16 +999,23 @@ read_table:
 			union acpi_object *ent;
 
 			ent = &wifi_pkg->package.elements[idx++];
-			if (ent->type != ACPI_TYPE_INTEGER ||
-			    (j == 0 && ent->integer.value > ACPI_PPAG_MAX_LB) ||
-			    (j == 0 && ent->integer.value < ACPI_PPAG_MIN_LB) ||
-			    (j != 0 && ent->integer.value > ACPI_PPAG_MAX_HB) ||
-			    (j != 0 && ent->integer.value < ACPI_PPAG_MIN_HB)) {
-				ppag_table.v1.enabled = cpu_to_le32(0);
+			if (ent->type != ACPI_TYPE_INTEGER) {
 				ret = -EINVAL;
 				goto out_free;
 			}
+
 			gain[i * num_sub_bands + j] = ent->integer.value;
+
+			if ((j == 0 &&
+			     (gain[i * num_sub_bands + j] > ACPI_PPAG_MAX_LB ||
+			      gain[i * num_sub_bands + j] < ACPI_PPAG_MIN_LB)) ||
+			    (j != 0 &&
+			     (gain[i * num_sub_bands + j] > ACPI_PPAG_MAX_HB ||
+			      gain[i * num_sub_bands + j] < ACPI_PPAG_MIN_HB))) {
+				ppag_table.v1.enabled = cpu_to_le32(0);
+				ret = -EINVAL;
+				goto out_free;
+			}
 		}
 	}
 	ret = 0;
Signature · 1 line
2.27.0
author maintainer
#88 lore raw

PATCH 88/663 iwlwifi: mvm: store PPAG enabled/disabled flag properly

In reply to Greg Kroah-Hartman

From: Luca Coelho <[email protected]>

[ Upstream commit 551d793f65364c904921ac168d4b4028bb51be69 ]

When reading the PPAG table from ACPI, we should store everything in our fwrt structure, so it can be accessed later. But we had a local ppag_table variable in the function and were erroneously storing the enabled/disabled flag in it instead of storing it in the fwrt. Fix this by removing the local variable and storing everything directly in fwrt.

---
 drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +3 -4
index c351c91a9ec96..2d2fe45603c8b 100644
@@ -929,7 +929,6 @@ static int iwl_mvm_sar_geo_init(struct iwl_mvm *mvm)
 static int iwl_mvm_get_ppag_table(struct iwl_mvm *mvm)
 {
 	union acpi_object *wifi_pkg, *data, *enabled;
-	union iwl_ppag_table_cmd ppag_table;
 	int i, j, ret, tbl_rev, num_sub_bands;
 	int idx = 2;
 	s8 *gain;
@@ -983,8 +982,8 @@ read_table:
 		goto out_free;
 	}
 
-	ppag_table.v1.enabled = cpu_to_le32(enabled->integer.value);
-	if (!ppag_table.v1.enabled) {
+	mvm->fwrt.ppag_table.v1.enabled = cpu_to_le32(enabled->integer.value);
+	if (!mvm->fwrt.ppag_table.v1.enabled) {
 		ret = 0;
 		goto out_free;
 	}
@@ -1012,7 +1011,7 @@ read_table:
 			    (j != 0 &&
 			     (gain[i * num_sub_bands + j] > ACPI_PPAG_MAX_HB ||
 			      gain[i * num_sub_bands + j] < ACPI_PPAG_MIN_HB))) {
-				ppag_table.v1.enabled = cpu_to_le32(0);
+				mvm->fwrt.ppag_table.v1.enabled = cpu_to_le32(0);
 				ret = -EINVAL;
 				goto out_free;
 			}
Signature · 1 line
2.27.0
author maintainer
#89 lore raw

PATCH 89/663 iwlwifi: mvm: send stored PPAG command instead of local

In reply to Greg Kroah-Hartman

From: Luca Coelho <[email protected]>

[ Upstream commit 659844d391826bfc5c8b4d9a06869ed51d859c76 ]

Some change conflicts apparently cause a confusion between a local variable being used to send the PPAG command and the introduction of a union for this command. Most parts of the local command were never copied from the stored data, so the FW was getting garbage in the tables instead of getting valid values.

Fix this by completely removing the local and using only the union that we have stored in fwrt.

---
 drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +3 -6
index 2d2fe45603c8b..34a44300a15eb 100644
@@ -1027,7 +1027,6 @@ int iwl_mvm_ppag_send_cmd(struct iwl_mvm *mvm)
 {
 	u8 cmd_ver;
 	int i, j, ret, num_sub_bands, cmd_size;
-	union iwl_ppag_table_cmd ppag_table;
 	s8 *gain;
 
 	if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_SET_PPAG)) {
@@ -1040,15 +1039,13 @@ int iwl_mvm_ppag_send_cmd(struct iwl_mvm *mvm)
 		return 0;
 	}
 
-	ppag_table.v1.enabled = mvm->fwrt.ppag_table.v1.enabled;
-
 	cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, PHY_OPS_GROUP,
 					PER_PLATFORM_ANT_GAIN_CMD,
 					IWL_FW_CMD_VER_UNKNOWN);
 	if (cmd_ver == 1) {
 		num_sub_bands = IWL_NUM_SUB_BANDS;
 		gain = mvm->fwrt.ppag_table.v1.gain[0];
-		cmd_size = sizeof(ppag_table.v1);
+		cmd_size = sizeof(mvm->fwrt.ppag_table.v1);
 		if (mvm->fwrt.ppag_ver == 2) {
 			IWL_DEBUG_RADIO(mvm,
 					"PPAG table is v2 but FW supports v1, sending truncated table\n");
@@ -1056,7 +1053,7 @@ int iwl_mvm_ppag_send_cmd(struct iwl_mvm *mvm)
 	} else if (cmd_ver == 2) {
 		num_sub_bands = IWL_NUM_SUB_BANDS_V2;
 		gain = mvm->fwrt.ppag_table.v2.gain[0];
-		cmd_size = sizeof(ppag_table.v2);
+		cmd_size = sizeof(mvm->fwrt.ppag_table.v2);
 		if (mvm->fwrt.ppag_ver == 1) {
 			IWL_DEBUG_RADIO(mvm,
 					"PPAG table is v1 but FW supports v2, sending padded table\n");
@@ -1076,7 +1073,7 @@ int iwl_mvm_ppag_send_cmd(struct iwl_mvm *mvm)
 	IWL_DEBUG_RADIO(mvm, "Sending PER_PLATFORM_ANT_GAIN_CMD\n");
 	ret = iwl_mvm_send_cmd_pdu(mvm, WIDE_ID(PHY_OPS_GROUP,
 						PER_PLATFORM_ANT_GAIN_CMD),
-				   0, cmd_size, &ppag_table);
+				   0, cmd_size, &mvm->fwrt.ppag_table);
 	if (ret < 0)
 		IWL_ERR(mvm, "failed to send PER_PLATFORM_ANT_GAIN_CMD (%d)\n",
 			ret);
Signature · 1 line
2.27.0
author maintainer
#90 lore raw

PATCH 90/663 iwlwifi: mvm: assign SAR table revision to the command later

In reply to Greg Kroah-Hartman

From: Luca Coelho <[email protected]>

[ Upstream commit 28db1862067cb09ebfdccfbc129a52c6fdb4c4d7 ]

The call to iwl_sar_geo_init() was moved to the end of the iwl_mvm_sar_geo_init() function, after the table revision is assigned to the FW command. But the revision is only known after iwl_sar_geo_init() is called, so we were always assigning zero to it.

Fix that by moving the assignment code after the iwl_sar_geo_init() function is called.

---
 drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +10 -2
index 34a44300a15eb..ad374b25e2550 100644
@@ -896,12 +896,10 @@ static int iwl_mvm_sar_geo_init(struct iwl_mvm *mvm)
 	if (cmd_ver == 3) {
 		len = sizeof(cmd.v3);
 		n_bands = ARRAY_SIZE(cmd.v3.table[0]);
-		cmd.v3.table_revision = cpu_to_le32(mvm->fwrt.geo_rev);
 	} else if (fw_has_api(&mvm->fwrt.fw->ucode_capa,
 			      IWL_UCODE_TLV_API_SAR_TABLE_VER)) {
 		len = sizeof(cmd.v2);
 		n_bands = ARRAY_SIZE(cmd.v2.table[0]);
-		cmd.v2.table_revision = cpu_to_le32(mvm->fwrt.geo_rev);
 	} else {
 		len = sizeof(cmd.v1);
 		n_bands = ARRAY_SIZE(cmd.v1.table[0]);
@@ -921,6 +919,16 @@ static int iwl_mvm_sar_geo_init(struct iwl_mvm *mvm)
 	if (ret)
 		return 0;
 
+	/*
+	 * Set the revision on versions that contain it.
+	 * This must be done after calling iwl_sar_geo_init().
+	 */
+	if (cmd_ver == 3)
+		cmd.v3.table_revision = cpu_to_le32(mvm->fwrt.geo_rev);
+	else if (fw_has_api(&mvm->fwrt.fw->ucode_capa,
+			    IWL_UCODE_TLV_API_SAR_TABLE_VER))
+		cmd.v2.table_revision = cpu_to_le32(mvm->fwrt.geo_rev);
+
 	return iwl_mvm_send_cmd_pdu(mvm,
 				    WIDE_ID(PHY_OPS_GROUP, GEO_TX_POWER_LIMIT),
 				    0, len, &cmd);
Signature · 1 line
2.27.0
author maintainer
#91 lore raw

PATCH 91/663 iwlwifi: mvm: dont check if CSA event is running before removing

In reply to Greg Kroah-Hartman

From: Sara Sharon <[email protected]>

[ Upstream commit b8a86164454aa745ecb534d7477d50d440ea05b6 ]

We may want to remove it before it started (i.e. before the actual switch time).

---
 drivers/net/wireless/intel/iwlwifi/mvm/time-event.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/time-event.c +0 -3
index 1db6d8d38822a..3939eccd3d5ac 100644
@@ -1055,9 +1055,6 @@ void iwl_mvm_remove_csa_period(struct iwl_mvm *mvm,
 
 	lockdep_assert_held(&mvm->mutex);
 
-	if (!te_data->running)
-		return;
-
 	spin_lock_bh(&mvm->time_event_lock);
 	id = te_data->id;
 	spin_unlock_bh(&mvm->time_event_lock);
Signature · 1 line
2.27.0
author maintainer
#92 lore raw

PATCH 92/663 bpf_lru_list: Read double-checked variable once without lock

In reply to Greg Kroah-Hartman

From: Marco Elver <[email protected]>

[ Upstream commit 6df8fb83301d68ea0a0c0e1cbcc790fcc333ed12 ]

For double-checked locking in bpf_common_lru_push_free(), node->type is read outside the critical section and then re-checked under the lock. However, concurrent writes to node->type result in data races.

For example, the following concurrent access was observed by KCSAN:

write to 0xffff88801521bc22 of 1 bytes by task 10038 on cpu 1:
__bpf_lru_node_move_in kernel/bpf/bpf_lru_list.c:91
__local_list_flush kernel/bpf/bpf_lru_list.c:298
...
read to 0xffff88801521bc22 of 1 bytes by task 10043 on cpu 0:
bpf_common_lru_push_free kernel/bpf/bpf_lru_list.c:507
bpf_lru_push_free kernel/bpf/bpf_lru_list.c:555
...

Fix the data races where node->type is read outside the critical section (for double-checked locking) by marking the access with READ_ONCE() as well as ensuring the variable is only accessed once.

---
 kernel/bpf/bpf_lru_list.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
kernel/bpf/bpf_lru_list.c +4 -3
index 1b6b9349cb857..d99e89f113c43 100644
@@ -502,13 +502,14 @@ struct bpf_lru_node *bpf_lru_pop_free(struct bpf_lru *lru, u32 hash)
 static void bpf_common_lru_push_free(struct bpf_lru *lru,
 				     struct bpf_lru_node *node)
 {
+	u8 node_type = READ_ONCE(node->type);
 	unsigned long flags;
 
-	if (WARN_ON_ONCE(node->type == BPF_LRU_LIST_T_FREE) ||
-	    WARN_ON_ONCE(node->type == BPF_LRU_LOCAL_LIST_T_FREE))
+	if (WARN_ON_ONCE(node_type == BPF_LRU_LIST_T_FREE) ||
+	    WARN_ON_ONCE(node_type == BPF_LRU_LOCAL_LIST_T_FREE))
 		return;
 
-	if (node->type == BPF_LRU_LOCAL_LIST_T_PENDING) {
+	if (node_type == BPF_LRU_LOCAL_LIST_T_PENDING) {
 		struct bpf_lru_locallist *loc_l;
 
 		loc_l = per_cpu_ptr(lru->common_lru.local_list, node->cpu);
Signature · 1 line
2.27.0
author maintainer
#93 lore raw

PATCH 93/663 iwlwifi: pnvm: set the PNVM again if it was already loaded

In reply to Greg Kroah-Hartman

From: Luca Coelho <[email protected]>

[ Upstream commit 4a81598f0f39cffbf1c29c4a184063d513661c4a ]

When the interface goes up, we have already loaded the PNVM during init, so we don't load it anymore. But we still need to set the PNVM values in the context so that the FW can load it again.

Call set_pnvm when the PNVM is already loaded and change the trans_pcie implementation to accept a second call to set_pnvm when we have already allocated and, in this case, only set the values without allocating again.

---
 drivers/net/wireless/intel/iwlwifi/fw/pnvm.c  |  7 ++++++-
 .../intel/iwlwifi/pcie/ctxt-info-gen3.c       | 21 +++++++++++--------
 2 files changed, 18 insertions(+), 10 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/pnvm.c +6 -1
index 895a907acdf0f..1e16f83b402b8 100644
@@ -227,6 +227,7 @@ int iwl_pnvm_load(struct iwl_trans *trans,
 	struct iwl_notification_wait pnvm_wait;
 	static const u16 ntf_cmds[] = { WIDE_ID(REGULATORY_AND_NVM_GROUP,
 						PNVM_INIT_COMPLETE_NTFY) };
+	int ret;
 
 	/* if the SKU_ID is empty, there's nothing to do */
 	if (!trans->sku_id[0] && !trans->sku_id[1] && !trans->sku_id[2])
@@ -236,7 +237,6 @@ int iwl_pnvm_load(struct iwl_trans *trans,
 	if (!trans->pnvm_loaded) {
 		const struct firmware *pnvm;
 		char pnvm_name[64];
-		int ret;
 
 		/*
 		 * The prefix unfortunately includes a hyphen at the end, so
@@ -264,6 +264,11 @@ int iwl_pnvm_load(struct iwl_trans *trans,
 
 			release_firmware(pnvm);
 		}
+	} else {
+		/* if we already loaded, we need to set it again */
+		ret = iwl_trans_set_pnvm(trans, NULL, 0);
+		if (ret)
+			return ret;
 	}
 
 	iwl_init_notification_wait(notif_wait, &pnvm_wait,
drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c +12 -9
index 2d43899fbdd7a..81ef4fc8d7831 100644
@@ -345,17 +345,20 @@ int iwl_trans_pcie_ctx_info_gen3_set_pnvm(struct iwl_trans *trans,
 	if (trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_AX210)
 		return 0;
 
-	ret = iwl_pcie_ctxt_info_alloc_dma(trans, data, len,
-					   &trans_pcie->pnvm_dram);
-	if (ret < 0) {
-		IWL_DEBUG_FW(trans, "Failed to allocate PNVM DMA %d.\n",
-			     ret);
-		return ret;
+	/* only allocate the DRAM if not allocated yet */
+	if (!trans->pnvm_loaded) {
+		if (WARN_ON(prph_sc_ctrl->pnvm_cfg.pnvm_size))
+			return -EBUSY;
+
+		ret = iwl_pcie_ctxt_info_alloc_dma(trans, data, len,
+						   &trans_pcie->pnvm_dram);
+		if (ret < 0) {
+			IWL_DEBUG_FW(trans, "Failed to allocate PNVM DMA %d.\n",
+				     ret);
+			return ret;
+		}
 	}
 
-	if (WARN_ON(prph_sc_ctrl->pnvm_cfg.pnvm_size))
-		return -EBUSY;
-
 	prph_sc_ctrl->pnvm_cfg.pnvm_base_addr =
 		cpu_to_le64(trans_pcie->pnvm_dram.physical);
 	prph_sc_ctrl->pnvm_cfg.pnvm_size =
Signature · 1 line
2.27.0
author maintainer
#94 lore raw

PATCH 94/663 iwlwifi: pnvm: increment the pointer before checking the TLV

In reply to Greg Kroah-Hartman

From: Luca Coelho <[email protected]>

[ Upstream commit ff11a8ee2d2d0f78514ac9b42fb50c525ca695c7 ]

If the SKU_ID doesn't match, we don't increment the pointer and keep checking the same TLV over and over again.

We need to increment the pointer in all situtations, namely if the TLV is not a SKU_ID, if the SKU_ID matched or if the SKU_ID didn't match. So we can increment the pointer already before checking for these conditions to solve the problem.

---
 drivers/net/wireless/intel/iwlwifi/fw/pnvm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/pnvm.c +3 -3
index 1e16f83b402b8..37ce4fe136c5e 100644
@@ -198,14 +198,14 @@ static int iwl_pnvm_parse(struct iwl_trans *trans, const u8 *data,
 				     le32_to_cpu(sku_id->data[1]),
 				     le32_to_cpu(sku_id->data[2]));
 
+			data += sizeof(*tlv) + ALIGN(tlv_len, 4);
+			len -= ALIGN(tlv_len, 4);
+
 			if (trans->sku_id[0] == le32_to_cpu(sku_id->data[0]) &&
 			    trans->sku_id[1] == le32_to_cpu(sku_id->data[1]) &&
 			    trans->sku_id[2] == le32_to_cpu(sku_id->data[2])) {
 				int ret;
 
-				data += sizeof(*tlv) + ALIGN(tlv_len, 4);
-				len -= ALIGN(tlv_len, 4);
-
 				ret = iwl_pnvm_handle_section(trans, data, len);
 				if (!ret)
 					return 0;
Signature · 1 line
2.27.0
author maintainer
#95 lore raw

PATCH 95/663 ath9k: fix data bus crash when setting nf_override via debugfs

In reply to Greg Kroah-Hartman

From: Linus Lüssing <[email protected]>

[ Upstream commit 12c8f3d1cdd84f01ee777b756db9dddc1f1c9d17 ]

When trying to set the noise floor via debugfs, a "data bus error" crash like the following can happen:

[   88.433133] Data bus error, epc == 80221c28, ra == 83314e60
[   88.438895] Oops[#1]:
[   88.441246] CPU: 0 PID: 7263 Comm: sh Not tainted 4.14.195 #0
[   88.447174] task: 838a1c20 task.stack: 82d5e000
[   88.451847] $ 0   : 00000000 00000030 deadc0de 83141de4
[   88.457248] $ 4   : b810a2c4 0000a2c4 83230fd4 00000000
[   88.462652] $ 8   : 0000000a 00000000 00000001 00000000
[   88.468055] $12   : 7f8ef318 00000000 00000000 77f802a0
[   88.473457] $16   : 83230080 00000002 0000001b 83230080
[   88.478861] $20   : 83a1c3f8 00841000 77f7adb0 ffffff92
[   88.484263] $24   : 00000fa4 77edd860
[   88.489665] $28   : 82d5e000 82d5fda8 00000000 83314e60
[   88.495070] Hi    : 00000000
[   88.498044] Lo    : 00000000
[   88.501040] epc   : 80221c28 ioread32+0x8/0x10
[   88.505671] ra    : 83314e60 ath9k_hw_loadnf+0x88/0x520 [ath9k_hw]
[   88.512049] Status: 1000fc03 KERNEL EXL IE
[   88.516369] Cause : 5080801c (ExcCode 07)
[   88.520508] PrId  : 00019374 (MIPS 24Kc)
[   88.524556] Modules linked in: ath9k ath9k_common pppoe ppp_async l2tp_ppp cdc_mbim batman_adv ath9k_hw ath sr9700 smsc95xx sierra_net rndis_host qmi_wwan pppox ppp_generic pl2303 nf_conntrack_ipv6 mcs7830 mac80211 kalmia iptable_nat ipt_REJECT ipt_MASQUERADE huawei_cdc_ncm ftdi_sio dm9601 cfg80211 cdc_subset cdc_ncm cdc_ether cdc_eem ax88179_178a asix xt_time xt_tcpudp xt_tcpmss xt_statistic xt_state xt_nat xt_multiport xt_mark xt_mac xt_limit xt_length xt_hl xt_ecn xt_dscp xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT xt_NETMAP xt_LOG xt_HL xt_FLOWOFFLOAD xt_DSCP xt_CLASSIFY usbserial usbnet usbhid slhc rtl8150 r8152 pegasus nf_reject_ipv4 nf_nat_redirect nf_nat_masquerade_ipv4 nf_conntrack_ipv4 nf_nat_ipv4 nf_nat nf_log_ipv4 nf_flow_table_hw nf_flow_table nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrack
[   88.597894]  libcrc32c kaweth iptable_mangle iptable_filter ipt_ECN ipheth ip_tables hso hid_generic crc_ccitt compat cdc_wdm cdc_acm br_netfilter hid evdev input_core nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables ip6t_REJECT x_tables nf_reject_ipv6 l2tp_netlink l2tp_core udp_tunnel ip6_udp_tunnel xfrm6_mode_tunnel xfrm6_mode_transport xfrm6_mode_beet ipcomp6 xfrm6_tunnel esp6 ah6 xfrm4_tunnel xfrm4_mode_tunnel xfrm4_mode_transport xfrm4_mode_beet ipcomp esp4 ah4 tunnel6 tunnel4 tun xfrm_user xfrm_ipcomp af_key xfrm_algo sha256_generic sha1_generic jitterentropy_rng drbg md5 hmac echainiv des_generic deflate zlib_inflate zlib_deflate cbc authenc crypto_acompress ehci_platform ehci_hcd gpio_button_hotplug usbcore nls_base usb_common crc16 mii aead crypto_null cryptomgr crc32c_generic
[   88.671671]  crypto_hash
[   88.674292] Process sh (pid: 7263, threadinfo=82d5e000, task=838a1c20, tls=77f81efc)
[   88.682279] Stack : 00008060 00000008 00000200 00000000 00000000 00000000 00000000 00000002
[   88.690916]         80500000 83230080 82d5fe22 00841000 77f7adb0 00000000 00000000 83156858
[   88.699553]         00000000 8352fa00 83ad62b0 835302a8 00000000 300a00f8 00000003 82d5fe38
[   88.708190]         82d5fef4 00000001 77f54dc4 77f80000 77f7adb0 c79fe901 00000000 00000000
[   88.716828]         80510000 00000002 00841000 77f54dc4 77f80000 801ce4cc 0000000b 41824292
[   88.725465]         ...
[   88.727994] Call Trace:
[   88.730532] [<80221c28>] ioread32+0x8/0x10
[   88.734765] Code: 00000000  8c820000  0000000f <03e00008> 00000000  08088708  00000000  aca40000  03e00008
[   88.744846]
[   88.746464] ---[ end trace db226b2de1b69b9e ]---
[   88.753477] Kernel panic - not syncing: Fatal exception
[   88.759981] Rebooting in 3 seconds..

The "REG_READ(ah, AR_PHY_AGC_CONTROL)" in ath9k_hw_loadnf() does not like being called when the hardware is asleep, leading to this crash.

The easiest way to reproduce this is trying to set nf_override while the hardware is down:

  $ ip link set down dev wlan0
  $ echo "-85" > /sys/kernel/debug/ieee80211/phy0/ath9k/nf_override

Fixing this crash by waking the hardware up before trying to set the noise floor. Similar to what other ath9k debugfs files do.

Tested on a Lima board from 8devices, which has a QCA 4531 chipset.

Fixes b90189759a7f ("ath9k: add noise floor override option")
Cc Simon Wunderlich <[email protected]>
---
 drivers/net/wireless/ath/ath9k/debug.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/debug.c +4 -1
index 26ea51a721564..859a865c59950 100644
@@ -1223,8 +1223,11 @@ static ssize_t write_file_nf_override(struct file *file,
 
 	ah->nf_override = val;
 
-	if (ah->curchan)
+	if (ah->curchan) {
+		ath9k_ps_wakeup(sc);
 		ath9k_hw_loadnf(ah, ah->curchan);
+		ath9k_ps_restore(sc);
+	}
 
 	return count;
 }
Signature · 1 line
2.27.0
author maintainer
#96 lore raw

PATCH 96/663 selftests/bpf: Convert test_xdp_redirect.sh to bash

In reply to Greg Kroah-Hartman

From: Björn Töpel <[email protected]>

[ Upstream commit 732fa32330667a80ce4985ca81b6e9d6b2ad2072 ]

The test_xdp_redirect.sh script uses a bash feature, '&>'. On systems, e.g. Debian, where '/bin/sh' is dash, this will not work as expected. Use bash in the shebang to get the expected behavior.

Further, using 'set -e' means that the error of a command cannot be captured without the command being executed with '&&' or '||'. Let us restructure the ping-commands, and use them as an if-expression, so that we can capture the return value.

v4: Added missing Fixes:, and removed local variables. (Andrii)
v3: Reintroduced /bin/bash, and kept 'set -e'. (Andrii)
v2: Kept /bin/sh and removed bashisms. (Randy)

---
 tools/testing/selftests/bpf/test_xdp_redirect.sh | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
tools/testing/selftests/bpf/test_xdp_redirect.sh +3 -7
index dd80f0c84afb4..c033850886f44 100755
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # Create 2 namespaces with two veth peers, and
 # forward packets in-between using generic XDP
 #
@@ -57,12 +57,8 @@ test_xdp_redirect()
 	ip link set dev veth1 $xdpmode obj test_xdp_redirect.o sec redirect_to_222 &> /dev/null
 	ip link set dev veth2 $xdpmode obj test_xdp_redirect.o sec redirect_to_111 &> /dev/null
 
-	ip netns exec ns1 ping -c 1 10.1.1.22 &> /dev/null
-	local ret1=$?
-	ip netns exec ns2 ping -c 1 10.1.1.11 &> /dev/null
-	local ret2=$?
-
-	if [ $ret1 -eq 0 -a $ret2 -eq 0 ]; then
+	if ip netns exec ns1 ping -c 1 10.1.1.22 &> /dev/null &&
+	   ip netns exec ns2 ping -c 1 10.1.1.11 &> /dev/null; then
 		echo "selftests: test_xdp_redirect $xdpmode [PASS]";
 	else
 		ret=1
Signature · 1 line
2.27.0
author maintainer
#97 lore raw

PATCH 97/663 ibmvnic: Set to CLOSED state even on error

In reply to Greg Kroah-Hartman

From: Sukadev Bhattiprolu <[email protected]>

[ Upstream commit d4083d3c00f60a09ad82e3bf17ff57fec69c8aa6 ]

If set_link_state() fails for any reason, we still cleanup the adapter state and cannot recover from a partial close anyway. So set the adapter to CLOSED state. That way if a new soft/hard reset is processed, the adapter will remain in the CLOSED state until the next ibmvnic_open().

Fixes 01d9bd792d16 ("ibmvnic: Reorganize device close")
---
 drivers/net/ethernet/ibm/ibmvnic.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/ethernet/ibm/ibmvnic.c +1 -3
index ee16e0e4fa5fc..d789c3cb7f87b 100644
@@ -1329,10 +1329,8 @@ static int __ibmvnic_close(struct net_device *netdev)
 
 	adapter->state = VNIC_CLOSING;
 	rc = set_link_state(adapter, IBMVNIC_LOGICAL_LNK_DN);
-	if (rc)
-		return rc;
 	adapter->state = VNIC_CLOSED;
-	return 0;
+	return rc;
 }
 
 static int ibmvnic_close(struct net_device *netdev)
Signature · 1 line
2.27.0
author maintainer
#98 lore raw

PATCH 98/663 bnxt_en: reverse order of TX disable and carrier off

In reply to Greg Kroah-Hartman

From: Edwin Peer <[email protected]>

[ Upstream commit 132e0b65dc2b8bfa9721bfce834191f24fd1d7ed ]

A TX queue can potentially immediately timeout after it is stopped and the last TX timestamp on that queue was more than 5 seconds ago with carrier still up. Prevent these intermittent false TX timeouts by bringing down carrier first before calling netif_tx_disable().

Fixes c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +2 -1
index 033bfab24ef2f..c7c5c01a783a0 100644
@@ -8856,9 +8856,10 @@ void bnxt_tx_disable(struct bnxt *bp)
 			txr->dev_state = BNXT_DEV_STATE_CLOSING;
 		}
 	}
+	/* Drop carrier first to prevent TX timeout */
+	netif_carrier_off(bp->dev);
 	/* Stop all TX queues */
 	netif_tx_disable(bp->dev);
-	netif_carrier_off(bp->dev);
 }
 
 void bnxt_tx_enable(struct bnxt *bp)
Signature · 1 line
2.27.0
author maintainer
#99 lore raw

PATCH 99/663 bnxt_en: Fix devlink infos stored fw.psid version format.

In reply to Greg Kroah-Hartman

From: Vasundhara Volam <[email protected]>

[ Upstream commit db28b6c77f4050f62599267a886b61fbd6504633 ]

The running fw.psid version is in decimal format but the stored fw.psid is in hex format. This can mislead the user to reset the NIC to activate the stored version to become the running version.

Fix it to display the stored fw.psid in decimal format.

Fixes 1388875b3916 ("bnxt_en: Add stored FW version info to devlink info_get cb.")
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c +2 -2
index 184b6d0513b2a..8b0e916afe6b1 100644
@@ -474,8 +474,8 @@ static int bnxt_dl_info_get(struct devlink *dl, struct devlink_info_req *req,
 	if (BNXT_PF(bp) && !bnxt_hwrm_get_nvm_cfg_ver(bp, &nvm_cfg_ver)) {
 		u32 ver = nvm_cfg_ver.vu32;
 
-		sprintf(buf, "%X.%X.%X", (ver >> 16) & 0xF, (ver >> 8) & 0xF,
-			ver & 0xF);
+		sprintf(buf, "%d.%d.%d", (ver >> 16) & 0xf, (ver >> 8) & 0xf,
+			ver & 0xf);
 		rc = bnxt_dl_info_put(bp, req, BNXT_VERSION_STORED,
 				      DEVLINK_INFO_VERSION_GENERIC_FW_PSID,
 				      buf);
Signature · 1 line
2.27.0
author maintainer
#100 lore raw

PATCH 100/663 xen/netback: fix spurious event detection for common event case

In reply to Greg Kroah-Hartman

From: Juergen Gross <[email protected]>

[ Upstream commit a3daf3d39132b405781be8d9ede0c449b244b64e ]

In case of a common event for rx and tx queue the event should be regarded to be spurious if no rx and no tx requests are pending.

Unfortunately the condition for testing that is wrong causing to decide a event being spurious if no rx OR no tx requests are pending.

Fix that plus using local variables for rx/tx pending indicators in order to split function calls and if condition.

Fixes 23025393dbeb3b ("xen/netback: use lateeoi irq binding")
---
 drivers/net/xen-netback/interface.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/xen-netback/interface.c +5 -3
index acb786d8b1d8f..e02a4fbb74de5 100644
@@ -162,13 +162,15 @@ irqreturn_t xenvif_interrupt(int irq, void *dev_id)
 {
 	struct xenvif_queue *queue = dev_id;
 	int old;
+	bool has_rx, has_tx;
 
 	old = atomic_fetch_or(NETBK_COMMON_EOI, &queue->eoi_pending);
 	WARN(old, "Interrupt while EOI pending\n");
 
-	/* Use bitwise or as we need to call both functions. */
-	if ((!xenvif_handle_tx_interrupt(queue) |
-	     !xenvif_handle_rx_interrupt(queue))) {
+	has_tx = xenvif_handle_tx_interrupt(queue);
+	has_rx = xenvif_handle_rx_interrupt(queue);
+
+	if (!has_rx && !has_tx) {
 		atomic_andnot(NETBK_COMMON_EOI, &queue->eoi_pending);
 		xen_irq_lateeoi(irq, XEN_EOI_FLAG_SPURIOUS);
 	}
Signature · 1 line
2.27.0
author maintainer
#101 lore raw

PATCH 101/663 dpaa2-eth: fix memory leak in XDP_REDIRECT

In reply to Greg Kroah-Hartman

From: Ioana Ciornei <[email protected]>

[ Upstream commit e12be9139cca26d689fe1a9257054b76752f725b ]

If xdp_do_redirect() fails, the calling driver should handle recycling or freeing of the page associated with the frame. The dpaa2-eth driver didn't do either of them and just incremented a counter. Fix this by trying to DMA map back the page and recycle it or, if the mapping fails, just free it.

Fixes d678be1dc1ec ("dpaa2-eth: add XDP_REDIRECT support")
---
 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +12 -2
index d880ab2a7d962..f91c67489e629 100644
@@ -399,10 +399,20 @@ static u32 dpaa2_eth_run_xdp(struct dpaa2_eth_priv *priv,
 		xdp.frame_sz = DPAA2_ETH_RX_BUF_RAW_SIZE;
 
 		err = xdp_do_redirect(priv->net_dev, &xdp, xdp_prog);
-		if (unlikely(err))
+		if (unlikely(err)) {
+			addr = dma_map_page(priv->net_dev->dev.parent,
+					    virt_to_page(vaddr), 0,
+					    priv->rx_buf_size, DMA_BIDIRECTIONAL);
+			if (unlikely(dma_mapping_error(priv->net_dev->dev.parent, addr))) {
+				free_pages((unsigned long)vaddr, 0);
+			} else {
+				ch->buf_count++;
+				dpaa2_eth_xdp_release_buf(priv, ch, addr);
+			}
 			ch->stats.xdp_drop++;
-		else
+		} else {
 			ch->stats.xdp_redirect++;
+		}
 		break;
 	}
 
Signature · 1 line
2.27.0
author maintainer
#102 lore raw

PATCH 102/663 net: phy: consider that suspend2ram may cut off PHY power

In reply to Greg Kroah-Hartman

From: Heiner Kallweit <[email protected]>

[ Upstream commit 4c0d2e96ba055bd8911bb8287def4f8ebbad15b6 ]

Claudiu reported that on his system S2R cuts off power to the PHY and after resuming certain PHY settings are lost. The PM folks confirmed that cutting off power to selected components in S2R is a valid case. Therefore resuming from S2R, same as from hibernation, has to assume that the PHY has power-on defaults. As a consequence use the restore callback also as resume callback.
In addition make sure that the interrupt configuration is restored. Let's do this in phy_init_hw() and ensure that after this call actual interrupt configuration is in sync with phydev->interrupts. Currently, if interrupt was enabled before hibernation, we would resume with interrupt disabled because that's the power-on default.

This fix applies cleanly only after the commit marked as fixed.

I don't have an affected system, therefore change is compile-tested only.

[0] https://lore.kernel.org/netdev/[email protected]/

Fixes 611d779af7ca ("net: phy: fix MDIO bus PM PHY resuming")
---
 drivers/net/phy/phy_device.c | 53 ++++++++++++------------------------
 1 file changed, 17 insertions(+), 36 deletions(-)
drivers/net/phy/phy_device.c +17 -36
index 5dab6be6fc383..dd1f711140c3d 100644
@@ -300,50 +300,22 @@ static int mdio_bus_phy_resume(struct device *dev)
 
 	phydev->suspended_by_mdio_bus = 0;
 
-	ret = phy_resume(phydev);
+	ret = phy_init_hw(phydev);
 	if (ret < 0)
 		return ret;
 
-no_resume:
-	if (phydev->attached_dev && phydev->adjust_link)
-		phy_start_machine(phydev);
-
-	return 0;
-}
-
-static int mdio_bus_phy_restore(struct device *dev)
-{
-	struct phy_device *phydev = to_phy_device(dev);
-	struct net_device *netdev = phydev->attached_dev;
-	int ret;
-
-	if (!netdev)
-		return 0;
-
-	ret = phy_init_hw(phydev);
+	ret = phy_resume(phydev);
 	if (ret < 0)
 		return ret;
-
+no_resume:
 	if (phydev->attached_dev && phydev->adjust_link)
 		phy_start_machine(phydev);
 
 	return 0;
 }
 
-static const struct dev_pm_ops mdio_bus_phy_pm_ops = {
-	.suspend = mdio_bus_phy_suspend,
-	.resume = mdio_bus_phy_resume,
-	.freeze = mdio_bus_phy_suspend,
-	.thaw = mdio_bus_phy_resume,
-	.restore = mdio_bus_phy_restore,
-};
-
-#define MDIO_BUS_PHY_PM_OPS (&mdio_bus_phy_pm_ops)
-
-#else
-
-#define MDIO_BUS_PHY_PM_OPS NULL
-
+static SIMPLE_DEV_PM_OPS(mdio_bus_phy_pm_ops, mdio_bus_phy_suspend,
+			 mdio_bus_phy_resume);
 #endif /* CONFIG_PM */
 
 /**
@@ -554,7 +526,7 @@ static const struct device_type mdio_bus_phy_type = {
 	.name = "PHY",
 	.groups = phy_dev_groups,
 	.release = phy_device_release,
-	.pm = MDIO_BUS_PHY_PM_OPS,
+	.pm = pm_ptr(&mdio_bus_phy_pm_ops),
 };
 
 static int phy_request_driver_module(struct phy_device *dev, u32 phy_id)
@@ -1143,10 +1115,19 @@ int phy_init_hw(struct phy_device *phydev)
 	if (ret < 0)
 		return ret;
 
-	if (phydev->drv->config_init)
+	if (phydev->drv->config_init) {
 		ret = phydev->drv->config_init(phydev);
+		if (ret < 0)
+			return ret;
+	}
 
-	return ret;
+	if (phydev->drv->config_intr) {
+		ret = phydev->drv->config_intr(phydev);
+		if (ret < 0)
+			return ret;
+	}
+
+	return 0;
 }
 EXPORT_SYMBOL(phy_init_hw);
 
Signature · 1 line
2.27.0
author maintainer
#103 lore raw

PATCH 103/663 net/mlx5e: Dont change interrupt moderation params when DIM is enabled

In reply to Greg Kroah-Hartman

From: Maxim Mikityanskiy <[email protected]>

[ Upstream commit 019f93bc4ba3a0dcb77f448ee77fc4c9c1b89565 ]

When mlx5e_ethtool_set_coalesce doesn't change DIM state (enabled/disabled), it calls mlx5e_set_priv_channels_coalesce unconditionally, which in turn invokes a firmware command to set interrupt moderation parameters. It shouldn't happen while DIM manages those parameters dynamically (it might even be happening at the same time).

This patch fixes it by splitting mlx5e_set_priv_channels_coalesce into two functions (for RX and TX) and calling them only when DIM is disabled (for RX and TX respectively).

Fixes cb3c7fd4f839 ("net/mlx5e: Support adaptive RX coalescing")
---
 .../ethernet/mellanox/mlx5/core/en_ethtool.c   | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +16 -2
index e596f050c4316..eab058ef6e9ff 100644
@@ -522,7 +522,7 @@ static int mlx5e_get_coalesce(struct net_device *netdev,
 #define MLX5E_MAX_COAL_FRAMES		MLX5_MAX_CQ_COUNT
 
 static void
-mlx5e_set_priv_channels_coalesce(struct mlx5e_priv *priv, struct ethtool_coalesce *coal)
+mlx5e_set_priv_channels_tx_coalesce(struct mlx5e_priv *priv, struct ethtool_coalesce *coal)
 {
 	struct mlx5_core_dev *mdev = priv->mdev;
 	int tc;
@@ -537,6 +537,17 @@ mlx5e_set_priv_channels_coalesce(struct mlx5e_priv *priv, struct ethtool_coalesc
 						coal->tx_coalesce_usecs,
 						coal->tx_max_coalesced_frames);
 		}
+	}
+}
+
+static void
+mlx5e_set_priv_channels_rx_coalesce(struct mlx5e_priv *priv, struct ethtool_coalesce *coal)
+{
+	struct mlx5_core_dev *mdev = priv->mdev;
+	int i;
+
+	for (i = 0; i < priv->channels.num; ++i) {
+		struct mlx5e_channel *c = priv->channels.c[i];
 
 		mlx5_core_modify_cq_moderation(mdev, &c->rq.cq.mcq,
 					       coal->rx_coalesce_usecs,
@@ -593,7 +604,10 @@ int mlx5e_ethtool_set_coalesce(struct mlx5e_priv *priv,
 	reset_tx = !!coal->use_adaptive_tx_coalesce != priv->channels.params.tx_dim_enabled;
 
 	if (!reset_rx && !reset_tx) {
-		mlx5e_set_priv_channels_coalesce(priv, coal);
+		if (!coal->use_adaptive_rx_coalesce)
+			mlx5e_set_priv_channels_rx_coalesce(priv, coal);
+		if (!coal->use_adaptive_tx_coalesce)
+			mlx5e_set_priv_channels_tx_coalesce(priv, coal);
 		priv->channels.params = new_channels.params;
 		goto out;
 	}
Signature · 1 line
2.27.0
author maintainer
#104 lore raw

PATCH 104/663 net/mlx5e: Change interrupt moderation channel params also when channels are closed

In reply to Greg Kroah-Hartman

From: Maxim Mikityanskiy <[email protected]>

[ Upstream commit 65ba8594a238c20e458b3d2d39d91067cbffd0b1 ]

struct mlx5e_params contains fields ({rx,tx}_cq_moderation) that depend on two things: whether DIM is enabled and the state of a private flag (MLX5E_PFLAG_{RX,TX}_CQE_BASED_MODER). Whenever the DIM state changes, mlx5e_reset_{rx,tx}_moderation is called to update the fields, however, only if the channels are open. The flow where the channels are closed misses the required update of the fields. This commit moves the calls of mlx5e_reset_{rx,tx}_moderation, so that they run in both flows.

Fixes ebeaf084ad5c ("net/mlx5e: Properly set default values when disabling adaptive moderation")
---
 .../ethernet/mellanox/mlx5/core/en_ethtool.c  | 29 +++++++++----------
 1 file changed, 14 insertions(+), 15 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +14 -15
index eab058ef6e9ff..b8622440243b4 100644
@@ -594,24 +594,9 @@ int mlx5e_ethtool_set_coalesce(struct mlx5e_priv *priv,
 	tx_moder->pkts    = coal->tx_max_coalesced_frames;
 	new_channels.params.tx_dim_enabled = !!coal->use_adaptive_tx_coalesce;
 
-	if (!test_bit(MLX5E_STATE_OPENED, &priv->state)) {
-		priv->channels.params = new_channels.params;
-		goto out;
-	}
-	/* we are opened */
-
 	reset_rx = !!coal->use_adaptive_rx_coalesce != priv->channels.params.rx_dim_enabled;
 	reset_tx = !!coal->use_adaptive_tx_coalesce != priv->channels.params.tx_dim_enabled;
 
-	if (!reset_rx && !reset_tx) {
-		if (!coal->use_adaptive_rx_coalesce)
-			mlx5e_set_priv_channels_rx_coalesce(priv, coal);
-		if (!coal->use_adaptive_tx_coalesce)
-			mlx5e_set_priv_channels_tx_coalesce(priv, coal);
-		priv->channels.params = new_channels.params;
-		goto out;
-	}
-
 	if (reset_rx) {
 		u8 mode = MLX5E_GET_PFLAG(&new_channels.params,
 					  MLX5E_PFLAG_RX_CQE_BASED_MODER);
@@ -625,6 +610,20 @@ int mlx5e_ethtool_set_coalesce(struct mlx5e_priv *priv,
 		mlx5e_reset_tx_moderation(&new_channels.params, mode);
 	}
 
+	if (!test_bit(MLX5E_STATE_OPENED, &priv->state)) {
+		priv->channels.params = new_channels.params;
+		goto out;
+	}
+
+	if (!reset_rx && !reset_tx) {
+		if (!coal->use_adaptive_rx_coalesce)
+			mlx5e_set_priv_channels_rx_coalesce(priv, coal);
+		if (!coal->use_adaptive_tx_coalesce)
+			mlx5e_set_priv_channels_tx_coalesce(priv, coal);
+		priv->channels.params = new_channels.params;
+		goto out;
+	}
+
 	err = mlx5e_safe_switch_channels(priv, &new_channels, NULL, NULL);
 
 out:
Signature · 1 line
2.27.0
author maintainer
#105 lore raw

PATCH 105/663 net/mlx5: Fix health error state handling

In reply to Greg Kroah-Hartman

From: Shay Drory <[email protected]>

[ Upstream commit 51d138c2610a236c1ed0059d034ee4c74f452b86 ]

Currently, when we discover a fatal error, we are queueing a work that will wait for a lock in order to enter the device to error state. Meanwhile, FW commands are still being processed, and gets timeouts. This can block the driver for few minutes before the work will manage to get the lock and enter to error state.

Setting the device to error state before queueing health work, in order to avoid FW commands being processed while the work is waiting for the lock.

Fixes c1d4d2e92ad6 ("net/mlx5: Avoid calling sleeping function by the health poll thread")
---
 .../net/ethernet/mellanox/mlx5/core/health.c  | 22 ++++++++++++-------
 1 file changed, 14 insertions(+), 8 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/health.c +14 -8
index 54523bed16cd3..0c32c485eb588 100644
@@ -190,6 +190,16 @@ static bool reset_fw_if_needed(struct mlx5_core_dev *dev)
 	return true;
 }
 
+static void enter_error_state(struct mlx5_core_dev *dev, bool force)
+{
+	if (mlx5_health_check_fatal_sensors(dev) || force) { /* protected state setting */
+		dev->state = MLX5_DEVICE_STATE_INTERNAL_ERROR;
+		mlx5_cmd_flush(dev);
+	}
+
+	mlx5_notifier_call_chain(dev->priv.events, MLX5_DEV_EVENT_SYS_ERROR, (void *)1);
+}
+
 void mlx5_enter_error_state(struct mlx5_core_dev *dev, bool force)
 {
 	bool err_detected = false;
@@ -208,12 +218,7 @@ void mlx5_enter_error_state(struct mlx5_core_dev *dev, bool force)
 		goto unlock;
 	}
 
-	if (mlx5_health_check_fatal_sensors(dev) || force) { /* protected state setting */
-		dev->state = MLX5_DEVICE_STATE_INTERNAL_ERROR;
-		mlx5_cmd_flush(dev);
-	}
-
-	mlx5_notifier_call_chain(dev->priv.events, MLX5_DEV_EVENT_SYS_ERROR, (void *)1);
+	enter_error_state(dev, force);
 unlock:
 	mutex_unlock(&dev->intf_state_mutex);
 }
@@ -613,7 +618,7 @@ static void mlx5_fw_fatal_reporter_err_work(struct work_struct *work)
 	priv = container_of(health, struct mlx5_priv, health);
 	dev = container_of(priv, struct mlx5_core_dev, priv);
 
-	mlx5_enter_error_state(dev, false);
+	enter_error_state(dev, false);
 	if (IS_ERR_OR_NULL(health->fw_fatal_reporter)) {
 		if (mlx5_health_try_recover(dev))
 			mlx5_core_err(dev, "health recovery failed\n");
@@ -707,8 +712,9 @@ static void poll_health(struct timer_list *t)
 		mlx5_core_err(dev, "Fatal error %u detected\n", fatal_error);
 		dev->priv.health.fatal_error = fatal_error;
 		print_health_info(dev);
+		dev->state = MLX5_DEVICE_STATE_INTERNAL_ERROR;
 		mlx5_trigger_health_work(dev);
-		goto out;
+		return;
 	}
 
 	count = ioread32be(health->health_counter);
Signature · 1 line
2.27.0
author maintainer
#106 lore raw

PATCH 106/663 net/mlx5e: Replace synchronize_rcu with synchronize_net

In reply to Greg Kroah-Hartman

From: Maxim Mikityanskiy <[email protected]>

[ Upstream commit 4d6e6b0c6d4bed8a7128500701354e2dc6098fa3 ]

The commit cited below switched from using napi_synchronize to synchronize_rcu to have a guarantee that it will finish in finite time. However, on average, synchronize_rcu takes more time than napi_synchronize. Given that it's called multiple times per channel on deactivation, it accumulates to a significant amount, which causes timeouts in some applications (for example, when using bonding with NetworkManager).

This commit replaces synchronize_rcu with synchronize_net, which is faster when called under rtnl_lock, allowing to speed up the described flow.

Fixes 9c25a22dfb00 ("net/mlx5e: Use synchronize_rcu to sync with NAPI")
---
 drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h          | 2 +-
 drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c    | 2 +-
 .../net/ethernet/mellanox/mlx5/core/en_accel/ktls_rx.c    | 2 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c         | 8 ++++----
 4 files changed, 7 insertions(+), 7 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h +1 -1
index d487e5e371625..8d991c3b7a503 100644
@@ -83,7 +83,7 @@ static inline void mlx5e_xdp_tx_disable(struct mlx5e_priv *priv)
 
 	clear_bit(MLX5E_STATE_XDP_TX_ENABLED, &priv->state);
 	/* Let other device's napi(s) and XSK wakeups see our new state. */
-	synchronize_rcu();
+	synchronize_net();
 }
 
 static inline bool mlx5e_xdp_tx_is_enabled(struct mlx5e_priv *priv)
drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c +1 -1
index be3465ba38ca1..f95905fc4979e 100644
@@ -106,7 +106,7 @@ err_free_cparam:
 void mlx5e_close_xsk(struct mlx5e_channel *c)
 {
 	clear_bit(MLX5E_CHANNEL_STATE_XSK, c->state);
-	synchronize_rcu(); /* Sync with the XSK wakeup and with NAPI. */
+	synchronize_net(); /* Sync with the XSK wakeup and with NAPI. */
 
 	mlx5e_close_rq(&c->xskrq);
 	mlx5e_close_cq(&c->xskrq.cq);
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_rx.c +1 -1
index 6a1d82503ef8f..0f13b661f7f98 100644
@@ -663,7 +663,7 @@ void mlx5e_ktls_del_rx(struct net_device *netdev, struct tls_context *tls_ctx)
 	priv_rx = mlx5e_get_ktls_rx_priv_ctx(tls_ctx);
 	set_bit(MLX5E_PRIV_RX_FLAG_DELETING, priv_rx->flags);
 	mlx5e_set_ktls_rx_priv_ctx(tls_ctx, NULL);
-	synchronize_rcu(); /* Sync with NAPI */
+	synchronize_net(); /* Sync with NAPI */
 	if (!cancel_work_sync(&priv_rx->rule.work))
 		/* completion is needed, as the priv_rx in the add flow
 		 * is maintained on the wqe info (wi), not on the socket.
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +4 -4
index 42848db8f8dd6..6394f9d8c6851 100644
@@ -919,7 +919,7 @@ void mlx5e_activate_rq(struct mlx5e_rq *rq)
 void mlx5e_deactivate_rq(struct mlx5e_rq *rq)
 {
 	clear_bit(MLX5E_RQ_STATE_ENABLED, &rq->state);
-	synchronize_rcu(); /* Sync with NAPI to prevent mlx5e_post_rx_wqes. */
+	synchronize_net(); /* Sync with NAPI to prevent mlx5e_post_rx_wqes. */
 }
 
 void mlx5e_close_rq(struct mlx5e_rq *rq)
@@ -1380,7 +1380,7 @@ static void mlx5e_deactivate_txqsq(struct mlx5e_txqsq *sq)
 	struct mlx5_wq_cyc *wq = &sq->wq;
 
 	clear_bit(MLX5E_SQ_STATE_ENABLED, &sq->state);
-	synchronize_rcu(); /* Sync with NAPI to prevent netif_tx_wake_queue. */
+	synchronize_net(); /* Sync with NAPI to prevent netif_tx_wake_queue. */
 
 	mlx5e_tx_disable_queue(sq->txq);
 
@@ -1456,7 +1456,7 @@ void mlx5e_activate_icosq(struct mlx5e_icosq *icosq)
 void mlx5e_deactivate_icosq(struct mlx5e_icosq *icosq)
 {
 	clear_bit(MLX5E_SQ_STATE_ENABLED, &icosq->state);
-	synchronize_rcu(); /* Sync with NAPI. */
+	synchronize_net(); /* Sync with NAPI. */
 }
 
 void mlx5e_close_icosq(struct mlx5e_icosq *sq)
@@ -1535,7 +1535,7 @@ void mlx5e_close_xdpsq(struct mlx5e_xdpsq *sq)
 	struct mlx5e_channel *c = sq->channel;
 
 	clear_bit(MLX5E_SQ_STATE_ENABLED, &sq->state);
-	synchronize_rcu(); /* Sync with NAPI. */
+	synchronize_net(); /* Sync with NAPI. */
 
 	mlx5e_destroy_sq(c->mdev, sq->sqn);
 	mlx5e_free_xdpsq_descs(sq);
Signature · 1 line
2.27.0
author maintainer
#107 lore raw

PATCH 107/663 net/mlx5e: kTLS, Use refcounts to free kTLS RX priv context

In reply to Greg Kroah-Hartman

From: Maxim Mikityanskiy <[email protected]>

[ Upstream commit b850bbff965129c34f50962638c0a66c82563536 ]

wait_for_resync is unreliable - if it timeouts, priv_rx will be freed anyway. However, mlx5e_ktls_handle_get_psv_completion will be called sooner or later, leading to use-after-free. For example, it can happen if a CQ error happened, and ICOSQ stopped, but later on the queues are destroyed, and ICOSQ is flushed with mlx5e_free_icosq_descs.

This patch converts the lifecycle of priv_rx to fully refcount-based, so that the struct won't be freed before the refcount goes to zero.

Fixes 0419d8c9d8f8 ("net/mlx5e: kTLS, Add kTLS RX resync support")
---
 .../mellanox/mlx5/core/en_accel/ktls_rx.c     | 64 +++++++++----------
 1 file changed, 30 insertions(+), 34 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_rx.c +30 -34
index 0f13b661f7f98..d06532d0baa43 100644
@@ -57,6 +57,20 @@ struct mlx5e_ktls_offload_context_rx {
 	struct mlx5e_ktls_rx_resync_ctx resync;
 };
 
+static bool mlx5e_ktls_priv_rx_put(struct mlx5e_ktls_offload_context_rx *priv_rx)
+{
+	if (!refcount_dec_and_test(&priv_rx->resync.refcnt))
+		return false;
+
+	kfree(priv_rx);
+	return true;
+}
+
+static void mlx5e_ktls_priv_rx_get(struct mlx5e_ktls_offload_context_rx *priv_rx)
+{
+	refcount_inc(&priv_rx->resync.refcnt);
+}
+
 static int mlx5e_ktls_create_tir(struct mlx5_core_dev *mdev, u32 *tirn, u32 rqtn)
 {
 	int err, inlen;
@@ -326,7 +340,7 @@ static void resync_handle_work(struct work_struct *work)
 	priv_rx = container_of(resync, struct mlx5e_ktls_offload_context_rx, resync);
 
 	if (unlikely(test_bit(MLX5E_PRIV_RX_FLAG_DELETING, priv_rx->flags))) {
-		refcount_dec(&resync->refcnt);
+		mlx5e_ktls_priv_rx_put(priv_rx);
 		return;
 	}
 
@@ -334,7 +348,7 @@ static void resync_handle_work(struct work_struct *work)
 	sq = &c->async_icosq;
 
 	if (resync_post_get_progress_params(sq, priv_rx))
-		refcount_dec(&resync->refcnt);
+		mlx5e_ktls_priv_rx_put(priv_rx);
 }
 
 static void resync_init(struct mlx5e_ktls_rx_resync_ctx *resync,
@@ -377,7 +391,11 @@ unlock:
 	return err;
 }
 
-/* Function is called with elevated refcount, it decreases it. */
+/* Function can be called with the refcount being either elevated or not.
+ * It decreases the refcount and may free the kTLS priv context.
+ * Refcount is not elevated only if tls_dev_del has been called, but GET_PSV was
+ * already in flight.
+ */
 void mlx5e_ktls_handle_get_psv_completion(struct mlx5e_icosq_wqe_info *wi,
 					  struct mlx5e_icosq *sq)
 {
@@ -410,7 +428,7 @@ void mlx5e_ktls_handle_get_psv_completion(struct mlx5e_icosq_wqe_info *wi,
 	tls_offload_rx_resync_async_request_end(priv_rx->sk, cpu_to_be32(hw_seq));
 	priv_rx->stats->tls_resync_req_end++;
 out:
-	refcount_dec(&resync->refcnt);
+	mlx5e_ktls_priv_rx_put(priv_rx);
 	dma_unmap_single(dev, buf->dma_addr, PROGRESS_PARAMS_PADDED_SIZE, DMA_FROM_DEVICE);
 	kfree(buf);
 }
@@ -431,9 +449,9 @@ static bool resync_queue_get_psv(struct sock *sk)
 		return false;
 
 	resync = &priv_rx->resync;
-	refcount_inc(&resync->refcnt);
+	mlx5e_ktls_priv_rx_get(priv_rx);
 	if (unlikely(!queue_work(resync->priv->tls->rx_wq, &resync->work)))
-		refcount_dec(&resync->refcnt);
+		mlx5e_ktls_priv_rx_put(priv_rx);
 
 	return true;
 }
@@ -625,31 +643,6 @@ err_create_key:
 	return err;
 }
 
-/* Elevated refcount on the resync object means there are
- * outstanding operations (uncompleted GET_PSV WQEs) that
- * will read the resync / priv_rx objects once completed.
- * Wait for them to avoid use-after-free.
- */
-static void wait_for_resync(struct net_device *netdev,
-			    struct mlx5e_ktls_rx_resync_ctx *resync)
-{
-#define MLX5E_KTLS_RX_RESYNC_TIMEOUT 20000 /* msecs */
-	unsigned long exp_time = jiffies + msecs_to_jiffies(MLX5E_KTLS_RX_RESYNC_TIMEOUT);
-	unsigned int refcnt;
-
-	do {
-		refcnt = refcount_read(&resync->refcnt);
-		if (refcnt == 1)
-			return;
-
-		msleep(20);
-	} while (time_before(jiffies, exp_time));
-
-	netdev_warn(netdev,
-		    "Failed waiting for kTLS RX resync refcnt to be released (%u).\n",
-		    refcnt);
-}
-
 void mlx5e_ktls_del_rx(struct net_device *netdev, struct tls_context *tls_ctx)
 {
 	struct mlx5e_ktls_offload_context_rx *priv_rx;
@@ -671,8 +664,7 @@ void mlx5e_ktls_del_rx(struct net_device *netdev, struct tls_context *tls_ctx)
 		wait_for_completion(&priv_rx->add_ctx);
 	resync = &priv_rx->resync;
 	if (cancel_work_sync(&resync->work))
-		refcount_dec(&resync->refcnt);
-	wait_for_resync(netdev, resync);
+		mlx5e_ktls_priv_rx_put(priv_rx);
 
 	priv_rx->stats->tls_del++;
 	if (priv_rx->rule.rule)
@@ -680,5 +672,9 @@ void mlx5e_ktls_del_rx(struct net_device *netdev, struct tls_context *tls_ctx)
 
 	mlx5_core_destroy_tir(mdev, priv_rx->tirn);
 	mlx5_ktls_destroy_key(mdev, priv_rx->key_id);
-	kfree(priv_rx);
+	/* priv_rx should normally be freed here, but if there is an outstanding
+	 * GET_PSV, deallocation will be delayed until the CQE for GET_PSV is
+	 * processed.
+	 */
+	mlx5e_ktls_priv_rx_put(priv_rx);
 }
Signature · 1 line
2.27.0
author maintainer
#108 lore raw

PATCH 108/663 net/mlx5: Disable devlink reload for multi port slave device

In reply to Greg Kroah-Hartman

From: Shay Drory <[email protected]>

[ Upstream commit d89ddaae1766f8fe571ea6eb63ec098ff556f1dd ]

Devlink reload can't be allowed on a multi port slave device, because reload of slave device doesn't take effect.

The right flow is to disable devlink reload for multi port slave device. Hence, disabling it in mlx5_core probing.

Fixes 4383cfcc65e7 ("net/mlx5: Add devlink reload")
---
 drivers/net/ethernet/mellanox/mlx5/core/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/main.c +2 -1
index e455a2f31f070..8246b6285d5a4 100644
@@ -1380,7 +1380,8 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *id)
 		dev_err(&pdev->dev, "mlx5_crdump_enable failed with error code %d\n", err);
 
 	pci_save_state(pdev);
-	devlink_reload_enable(devlink);
+	if (!mlx5_core_is_mp_slave(dev))
+		devlink_reload_enable(devlink);
 	return 0;
 
 err_load_one:
Signature · 1 line
2.27.0
author maintainer
#109 lore raw

PATCH 109/663 net/mlx5: Disallow RoCE on multi port slave device

In reply to Greg Kroah-Hartman

From: Shay Drory <[email protected]>

[ Upstream commit c70f8597fcc1399ef6d5b5ce648a31d887d5dba2 ]

In dual port mode, setting roce enabled/disable for the slave device have no effect. e.g.: the slave device roce status remain unchanged. Therefore disable it and add an error message.
Enable or disable roce of the master device affect both master and slave devices.

Fixes cc9defcbb8fa ("net/mlx5: Handle "enable_roce" devlink param")
---
 drivers/net/ethernet/mellanox/mlx5/core/devlink.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/ethernet/mellanox/mlx5/core/devlink.c +4 -0
index a28f95df2901d..7ffc94c4979b2 100644
@@ -282,6 +282,10 @@ static int mlx5_devlink_enable_roce_validate(struct devlink *devlink, u32 id,
 		NL_SET_ERR_MSG_MOD(extack, "Device doesn't support RoCE");
 		return -EOPNOTSUPP;
 	}
+	if (mlx5_core_is_mp_slave(dev)) {
+		NL_SET_ERR_MSG_MOD(extack, "Multi port slave device can't configure RoCE");
+		return -EOPNOTSUPP;
+	}
 
 	return 0;
 }
Signature · 1 line
2.27.0
author maintainer
#110 lore raw

PATCH 110/663 net/mlx5: Disallow RoCE on lag device

In reply to Greg Kroah-Hartman

From: Shay Drory <[email protected]>

[ Upstream commit 7ab91f2b03367f9d25dd807ebdfb0d67295e0e41 ]

In lag mode, setting roce enabled/disable of lag device have no effect. e.g.: bond device (roce/vf_lag) roce status remain unchanged. Therefore disable it and add an error message.

Fixes cc9defcbb8fa ("net/mlx5: Handle "enable_roce" devlink param")
---
 drivers/net/ethernet/mellanox/mlx5/core/devlink.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/devlink.c +2 -2
index 7ffc94c4979b2..0450ab5f5f756 100644
@@ -282,8 +282,8 @@ static int mlx5_devlink_enable_roce_validate(struct devlink *devlink, u32 id,
 		NL_SET_ERR_MSG_MOD(extack, "Device doesn't support RoCE");
 		return -EOPNOTSUPP;
 	}
-	if (mlx5_core_is_mp_slave(dev)) {
-		NL_SET_ERR_MSG_MOD(extack, "Multi port slave device can't configure RoCE");
+	if (mlx5_core_is_mp_slave(dev) || mlx5_lag_is_active(dev)) {
+		NL_SET_ERR_MSG_MOD(extack, "Multi port slave/Lag device can't configure RoCE");
 		return -EOPNOTSUPP;
 	}
 
Signature · 1 line
2.27.0
author maintainer
#111 lore raw

PATCH 111/663 net/mlx5: Disable devlink reload for lag devices

In reply to Greg Kroah-Hartman

From: Shay Drory <[email protected]>

[ Upstream commit edac23c2b3d3ac64cfcd351087295893671adbf5 ]

Devlink reload can't be allowed on lag devices since reloading one lag device will cause traffic on the bond to get stucked.
Users who wish to reload a lag device, need to remove the device from the bond, and only then reload it.

Fixes 4383cfcc65e7 ("net/mlx5: Add devlink reload")
---
 drivers/net/ethernet/mellanox/mlx5/core/devlink.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/ethernet/mellanox/mlx5/core/devlink.c +5 -0
index 0450ab5f5f756..bf5cf022e279d 100644
@@ -137,6 +137,11 @@ static int mlx5_devlink_reload_down(struct devlink *devlink, bool netns_change,
 {
 	struct mlx5_core_dev *dev = devlink_priv(devlink);
 
+	if (mlx5_lag_is_active(dev)) {
+		NL_SET_ERR_MSG_MOD(extack, "reload is unsupported in Lag mode\n");
+		return -EOPNOTSUPP;
+	}
+
 	switch (action) {
 	case DEVLINK_RELOAD_ACTION_DRIVER_REINIT:
 		mlx5_unload_one(dev, false);
Signature · 1 line
2.27.0
author maintainer
#112 lore raw

PATCH 112/663 net/mlx5e: CT: manage the lifetime of the ct entry object

In reply to Greg Kroah-Hartman

From: Oz Shlomo <[email protected]>

[ Upstream commit a2173131526dc845eb1968a15bc192b3fc2ff000 ]

The ct entry object is accessed by the ct add, del, stats and restore methods. In addition, it is referenced from several hash tables.

The lifetime of the ct entry object was not managed which triggered race conditions as in the following kasan dump:

[ 3374.973945] ==================================================================
[ 3374.988552] BUG: KASAN: use-after-free in memcmp+0x4c/0x98
[ 3374.999590] Read of size 1 at addr ffff00036129ea55 by task ksoftirqd/1/15
[ 3375.016415] CPU: 1 PID: 15 Comm: ksoftirqd/1 Tainted: G           O      5.4.31+ #1
[ 3375.055301] Call trace:
[ 3375.060214]  dump_backtrace+0x0/0x238
[ 3375.067580]  show_stack+0x24/0x30
[ 3375.074244]  dump_stack+0xe0/0x118
[ 3375.081085]  print_address_description.isra.9+0x74/0x3d0
[ 3375.091771]  __kasan_report+0x198/0x1e8
[ 3375.099486]  kasan_report+0xc/0x18
[ 3375.106324]  __asan_load1+0x60/0x68
[ 3375.113338]  memcmp+0x4c/0x98
[ 3375.119409]  mlx5e_tc_ct_restore_flow+0x3a4/0x6f8 [mlx5_core]
[ 3375.131073]  mlx5e_rep_tc_update_skb+0x1d4/0x2f0 [mlx5_core]
[ 3375.142553]  mlx5e_handle_rx_cqe_rep+0x198/0x308 [mlx5_core]
[ 3375.154034]  mlx5e_poll_rx_cq+0x2a0/0x1060 [mlx5_core]
[ 3375.164459]  mlx5e_napi_poll+0x1d4/0xa78 [mlx5_core]
[ 3375.174453]  net_rx_action+0x28c/0x7a8
[ 3375.182004]  __do_softirq+0x1b4/0x5d0

Manage the lifetime of the ct entry object by using synchornization mechanisms for concurrent access.

Fixes ac991b48d43c ("net/mlx5e: CT: Offload established flows")
---
 .../ethernet/mellanox/mlx5/core/en/tc_ct.c    | 259 +++++++++++++-----
 1 file changed, 192 insertions(+), 67 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c +192 -67
index 6bc6b48a56dc7..24e2c0d955b99 100644
@@ -12,6 +12,7 @@
 #include <net/flow_offload.h>
 #include <net/netfilter/nf_flow_table.h>
 #include <linux/workqueue.h>
+#include <linux/refcount.h>
 #include <linux/xarray.h>
 
 #include "lib/fs_chains.h"
@@ -51,11 +52,11 @@ struct mlx5_tc_ct_priv {
 	struct mlx5_flow_table *ct_nat;
 	struct mlx5_flow_table *post_ct;
 	struct mutex control_lock; /* guards parallel adds/dels */
-	struct mutex shared_counter_lock;
 	struct mapping_ctx *zone_mapping;
 	struct mapping_ctx *labels_mapping;
 	enum mlx5_flow_namespace_type ns_type;
 	struct mlx5_fs_chains *chains;
+	spinlock_t ht_lock; /* protects ft entries */
 };
 
 struct mlx5_ct_flow {
@@ -124,6 +125,10 @@ struct mlx5_ct_counter {
 	bool is_shared;
 };
 
+enum {
+	MLX5_CT_ENTRY_FLAG_VALID,
+};
+
 struct mlx5_ct_entry {
 	struct rhash_head node;
 	struct rhash_head tuple_node;
@@ -134,6 +139,12 @@ struct mlx5_ct_entry {
 	struct mlx5_ct_tuple tuple;
 	struct mlx5_ct_tuple tuple_nat;
 	struct mlx5_ct_zone_rule zone_rules[2];
+
+	struct mlx5_tc_ct_priv *ct_priv;
+	struct work_struct work;
+
+	refcount_t refcnt;
+	unsigned long flags;
 };
 
 static const struct rhashtable_params cts_ht_params = {
@@ -740,6 +751,87 @@ err_attr:
 	return err;
 }
 
+static bool
+mlx5_tc_ct_entry_valid(struct mlx5_ct_entry *entry)
+{
+	return test_bit(MLX5_CT_ENTRY_FLAG_VALID, &entry->flags);
+}
+
+static struct mlx5_ct_entry *
+mlx5_tc_ct_entry_get(struct mlx5_tc_ct_priv *ct_priv, struct mlx5_ct_tuple *tuple)
+{
+	struct mlx5_ct_entry *entry;
+
+	entry = rhashtable_lookup_fast(&ct_priv->ct_tuples_ht, tuple,
+				       tuples_ht_params);
+	if (entry && mlx5_tc_ct_entry_valid(entry) &&
+	    refcount_inc_not_zero(&entry->refcnt)) {
+		return entry;
+	} else if (!entry) {
+		entry = rhashtable_lookup_fast(&ct_priv->ct_tuples_nat_ht,
+					       tuple, tuples_nat_ht_params);
+		if (entry && mlx5_tc_ct_entry_valid(entry) &&
+		    refcount_inc_not_zero(&entry->refcnt))
+			return entry;
+	}
+
+	return entry ? ERR_PTR(-EINVAL) : NULL;
+}
+
+static void mlx5_tc_ct_entry_remove_from_tuples(struct mlx5_ct_entry *entry)
+{
+	struct mlx5_tc_ct_priv *ct_priv = entry->ct_priv;
+
+	rhashtable_remove_fast(&ct_priv->ct_tuples_nat_ht,
+			       &entry->tuple_nat_node,
+			       tuples_nat_ht_params);
+	rhashtable_remove_fast(&ct_priv->ct_tuples_ht, &entry->tuple_node,
+			       tuples_ht_params);
+}
+
+static void mlx5_tc_ct_entry_del(struct mlx5_ct_entry *entry)
+{
+	struct mlx5_tc_ct_priv *ct_priv = entry->ct_priv;
+
+	mlx5_tc_ct_entry_del_rules(ct_priv, entry);
+
+	spin_lock_bh(&ct_priv->ht_lock);
+	mlx5_tc_ct_entry_remove_from_tuples(entry);
+	spin_unlock_bh(&ct_priv->ht_lock);
+
+	mlx5_tc_ct_counter_put(ct_priv, entry);
+	kfree(entry);
+}
+
+static void
+mlx5_tc_ct_entry_put(struct mlx5_ct_entry *entry)
+{
+	if (!refcount_dec_and_test(&entry->refcnt))
+		return;
+
+	mlx5_tc_ct_entry_del(entry);
+}
+
+static void mlx5_tc_ct_entry_del_work(struct work_struct *work)
+{
+	struct mlx5_ct_entry *entry = container_of(work, struct mlx5_ct_entry, work);
+
+	mlx5_tc_ct_entry_del(entry);
+}
+
+static void
+__mlx5_tc_ct_entry_put(struct mlx5_ct_entry *entry)
+{
+	struct mlx5e_priv *priv;
+
+	if (!refcount_dec_and_test(&entry->refcnt))
+		return;
+
+	priv = netdev_priv(entry->ct_priv->netdev);
+	INIT_WORK(&entry->work, mlx5_tc_ct_entry_del_work);
+	queue_work(priv->wq, &entry->work);
+}
+
 static struct mlx5_ct_counter *
 mlx5_tc_ct_counter_create(struct mlx5_tc_ct_priv *ct_priv)
 {
@@ -792,16 +884,26 @@ mlx5_tc_ct_shared_counter_get(struct mlx5_tc_ct_priv *ct_priv,
 	}
 
 	/* Use the same counter as the reverse direction */
-	mutex_lock(&ct_priv->shared_counter_lock);
-	rev_entry = rhashtable_lookup_fast(&ct_priv->ct_tuples_ht, &rev_tuple,
-					   tuples_ht_params);
-	if (rev_entry) {
-		if (refcount_inc_not_zero(&rev_entry->counter->refcount)) {
-			mutex_unlock(&ct_priv->shared_counter_lock);
-			return rev_entry->counter;
-		}
+	spin_lock_bh(&ct_priv->ht_lock);
+	rev_entry = mlx5_tc_ct_entry_get(ct_priv, &rev_tuple);
+
+	if (IS_ERR(rev_entry)) {
+		spin_unlock_bh(&ct_priv->ht_lock);
+		goto create_counter;
+	}
+
+	if (rev_entry && refcount_inc_not_zero(&rev_entry->counter->refcount)) {
+		ct_dbg("Using shared counter entry=0x%p rev=0x%p\n", entry, rev_entry);
+		shared_counter = rev_entry->counter;
+		spin_unlock_bh(&ct_priv->ht_lock);
+
+		mlx5_tc_ct_entry_put(rev_entry);
+		return shared_counter;
 	}
-	mutex_unlock(&ct_priv->shared_counter_lock);
+
+	spin_unlock_bh(&ct_priv->ht_lock);
+
+create_counter:
 
 	shared_counter = mlx5_tc_ct_counter_create(ct_priv);
 	if (IS_ERR(shared_counter)) {
@@ -866,10 +968,14 @@ mlx5_tc_ct_block_flow_offload_add(struct mlx5_ct_ft *ft,
 	if (!meta_action)
 		return -EOPNOTSUPP;
 
-	entry = rhashtable_lookup_fast(&ft->ct_entries_ht, &cookie,
-				       cts_ht_params);
-	if (entry)
-		return 0;
+	spin_lock_bh(&ct_priv->ht_lock);
+	entry = rhashtable_lookup_fast(&ft->ct_entries_ht, &cookie, cts_ht_params);
+	if (entry && refcount_inc_not_zero(&entry->refcnt)) {
+		spin_unlock_bh(&ct_priv->ht_lock);
+		mlx5_tc_ct_entry_put(entry);
+		return -EEXIST;
+	}
+	spin_unlock_bh(&ct_priv->ht_lock);
 
 	entry = kzalloc(sizeof(*entry), GFP_KERNEL);
 	if (!entry)
@@ -878,6 +984,8 @@ mlx5_tc_ct_block_flow_offload_add(struct mlx5_ct_ft *ft,
 	entry->tuple.zone = ft->zone;
 	entry->cookie = flow->cookie;
 	entry->restore_cookie = meta_action->ct_metadata.cookie;
+	refcount_set(&entry->refcnt, 2);
+	entry->ct_priv = ct_priv;
 
 	err = mlx5_tc_ct_rule_to_tuple(&entry->tuple, flow_rule);
 	if (err)
@@ -888,35 +996,40 @@ mlx5_tc_ct_block_flow_offload_add(struct mlx5_ct_ft *ft,
 	if (err)
 		goto err_set;
 
-	err = rhashtable_insert_fast(&ct_priv->ct_tuples_ht,
-				     &entry->tuple_node,
-				     tuples_ht_params);
+	spin_lock_bh(&ct_priv->ht_lock);
+
+	err = rhashtable_lookup_insert_fast(&ft->ct_entries_ht, &entry->node,
+					    cts_ht_params);
+	if (err)
+		goto err_entries;
+
+	err = rhashtable_lookup_insert_fast(&ct_priv->ct_tuples_ht,
+					    &entry->tuple_node,
+					    tuples_ht_params);
 	if (err)
 		goto err_tuple;
 
 	if (memcmp(&entry->tuple, &entry->tuple_nat, sizeof(entry->tuple))) {
-		err = rhashtable_insert_fast(&ct_priv->ct_tuples_nat_ht,
-					     &entry->tuple_nat_node,
-					     tuples_nat_ht_params);
+		err = rhashtable_lookup_insert_fast(&ct_priv->ct_tuples_nat_ht,
+						    &entry->tuple_nat_node,
+						    tuples_nat_ht_params);
 		if (err)
 			goto err_tuple_nat;
 	}
+	spin_unlock_bh(&ct_priv->ht_lock);
 
 	err = mlx5_tc_ct_entry_add_rules(ct_priv, flow_rule, entry,
 					 ft->zone_restore_id);
 	if (err)
 		goto err_rules;
 
-	err = rhashtable_insert_fast(&ft->ct_entries_ht, &entry->node,
-				     cts_ht_params);
-	if (err)
-		goto err_insert;
+	set_bit(MLX5_CT_ENTRY_FLAG_VALID, &entry->flags);
+	mlx5_tc_ct_entry_put(entry); /* this function reference */
 
 	return 0;
 
-err_insert:
-	mlx5_tc_ct_entry_del_rules(ct_priv, entry);
 err_rules:
+	spin_lock_bh(&ct_priv->ht_lock);
 	if (mlx5_tc_ct_entry_has_nat(entry))
 		rhashtable_remove_fast(&ct_priv->ct_tuples_nat_ht,
 				       &entry->tuple_nat_node, tuples_nat_ht_params);
@@ -925,47 +1038,43 @@ err_tuple_nat:
 			       &entry->tuple_node,
 			       tuples_ht_params);
 err_tuple:
+	rhashtable_remove_fast(&ft->ct_entries_ht,
+			       &entry->node,
+			       cts_ht_params);
+err_entries:
+	spin_unlock_bh(&ct_priv->ht_lock);
 err_set:
 	kfree(entry);
-	netdev_warn(ct_priv->netdev,
-		    "Failed to offload ct entry, err: %d\n", err);
+	if (err != -EEXIST)
+		netdev_warn(ct_priv->netdev, "Failed to offload ct entry, err: %d\n", err);
 	return err;
 }
 
-static void
-mlx5_tc_ct_del_ft_entry(struct mlx5_tc_ct_priv *ct_priv,
-			struct mlx5_ct_entry *entry)
-{
-	mlx5_tc_ct_entry_del_rules(ct_priv, entry);
-	mutex_lock(&ct_priv->shared_counter_lock);
-	if (mlx5_tc_ct_entry_has_nat(entry))
-		rhashtable_remove_fast(&ct_priv->ct_tuples_nat_ht,
-				       &entry->tuple_nat_node,
-				       tuples_nat_ht_params);
-	rhashtable_remove_fast(&ct_priv->ct_tuples_ht, &entry->tuple_node,
-			       tuples_ht_params);
-	mutex_unlock(&ct_priv->shared_counter_lock);
-	mlx5_tc_ct_counter_put(ct_priv, entry);
-
-}
-
 static int
 mlx5_tc_ct_block_flow_offload_del(struct mlx5_ct_ft *ft,
 				  struct flow_cls_offload *flow)
 {
+	struct mlx5_tc_ct_priv *ct_priv = ft->ct_priv;
 	unsigned long cookie = flow->cookie;
 	struct mlx5_ct_entry *entry;
 
-	entry = rhashtable_lookup_fast(&ft->ct_entries_ht, &cookie,
-				       cts_ht_params);
-	if (!entry)
+	spin_lock_bh(&ct_priv->ht_lock);
+	entry = rhashtable_lookup_fast(&ft->ct_entries_ht, &cookie, cts_ht_params);
+	if (!entry) {
+		spin_unlock_bh(&ct_priv->ht_lock);
 		return -ENOENT;
+	}
 
-	mlx5_tc_ct_del_ft_entry(ft->ct_priv, entry);
-	WARN_ON(rhashtable_remove_fast(&ft->ct_entries_ht,
-				       &entry->node,
-				       cts_ht_params));
-	kfree(entry);
+	if (!mlx5_tc_ct_entry_valid(entry)) {
+		spin_unlock_bh(&ct_priv->ht_lock);
+		return -EINVAL;
+	}
+
+	rhashtable_remove_fast(&ft->ct_entries_ht, &entry->node, cts_ht_params);
+	mlx5_tc_ct_entry_remove_from_tuples(entry);
+	spin_unlock_bh(&ct_priv->ht_lock);
+
+	mlx5_tc_ct_entry_put(entry);
 
 	return 0;
 }
@@ -974,19 +1083,30 @@ static int
 mlx5_tc_ct_block_flow_offload_stats(struct mlx5_ct_ft *ft,
 				    struct flow_cls_offload *f)
 {
+	struct mlx5_tc_ct_priv *ct_priv = ft->ct_priv;
 	unsigned long cookie = f->cookie;
 	struct mlx5_ct_entry *entry;
 	u64 lastuse, packets, bytes;
 
-	entry = rhashtable_lookup_fast(&ft->ct_entries_ht, &cookie,
-				       cts_ht_params);
-	if (!entry)
+	spin_lock_bh(&ct_priv->ht_lock);
+	entry = rhashtable_lookup_fast(&ft->ct_entries_ht, &cookie, cts_ht_params);
+	if (!entry) {
+		spin_unlock_bh(&ct_priv->ht_lock);
 		return -ENOENT;
+	}
+
+	if (!mlx5_tc_ct_entry_valid(entry) || !refcount_inc_not_zero(&entry->refcnt)) {
+		spin_unlock_bh(&ct_priv->ht_lock);
+		return -EINVAL;
+	}
+
+	spin_unlock_bh(&ct_priv->ht_lock);
 
 	mlx5_fc_query_cached(entry->counter->counter, &bytes, &packets, &lastuse);
 	flow_stats_update(&f->stats, bytes, packets, 0, lastuse,
 			  FLOW_ACTION_HW_STATS_DELAYED);
 
+	mlx5_tc_ct_entry_put(entry);
 	return 0;
 }
 
@@ -1478,11 +1598,9 @@ err_mapping:
 static void
 mlx5_tc_ct_flush_ft_entry(void *ptr, void *arg)
 {
-	struct mlx5_tc_ct_priv *ct_priv = arg;
 	struct mlx5_ct_entry *entry = ptr;
 
-	mlx5_tc_ct_del_ft_entry(ct_priv, entry);
-	kfree(entry);
+	mlx5_tc_ct_entry_put(entry);
 }
 
 static void
@@ -1960,6 +2078,7 @@ mlx5_tc_ct_init(struct mlx5e_priv *priv, struct mlx5_fs_chains *chains,
 		goto err_mapping_labels;
 	}
 
+	spin_lock_init(&ct_priv->ht_lock);
 	ct_priv->ns_type = ns_type;
 	ct_priv->chains = chains;
 	ct_priv->netdev = priv->netdev;
@@ -1994,7 +2113,6 @@ mlx5_tc_ct_init(struct mlx5e_priv *priv, struct mlx5_fs_chains *chains,
 
 	idr_init(&ct_priv->fte_ids);
 	mutex_init(&ct_priv->control_lock);
-	mutex_init(&ct_priv->shared_counter_lock);
 	rhashtable_init(&ct_priv->zone_ht, &zone_params);
 	rhashtable_init(&ct_priv->ct_tuples_ht, &tuples_ht_params);
 	rhashtable_init(&ct_priv->ct_tuples_nat_ht, &tuples_nat_ht_params);
@@ -2037,7 +2155,6 @@ mlx5_tc_ct_clean(struct mlx5_tc_ct_priv *ct_priv)
 	rhashtable_destroy(&ct_priv->ct_tuples_nat_ht);
 	rhashtable_destroy(&ct_priv->zone_ht);
 	mutex_destroy(&ct_priv->control_lock);
-	mutex_destroy(&ct_priv->shared_counter_lock);
 	idr_destroy(&ct_priv->fte_ids);
 	kfree(ct_priv);
 }
@@ -2059,14 +2176,22 @@ mlx5e_tc_ct_restore_flow(struct mlx5_tc_ct_priv *ct_priv,
 	if (!mlx5_tc_ct_skb_to_tuple(skb, &tuple, zone))
 		return false;
 
-	entry = rhashtable_lookup_fast(&ct_priv->ct_tuples_ht, &tuple,
-				       tuples_ht_params);
-	if (!entry)
-		entry = rhashtable_lookup_fast(&ct_priv->ct_tuples_nat_ht,
-					       &tuple, tuples_nat_ht_params);
-	if (!entry)
+	spin_lock(&ct_priv->ht_lock);
+
+	entry = mlx5_tc_ct_entry_get(ct_priv, &tuple);
+	if (!entry) {
+		spin_unlock(&ct_priv->ht_lock);
+		return false;
+	}
+
+	if (IS_ERR(entry)) {
+		spin_unlock(&ct_priv->ht_lock);
 		return false;
+	}
+	spin_unlock(&ct_priv->ht_lock);
 
 	tcf_ct_flow_table_restore_skb(skb, entry->restore_cookie);
+	__mlx5_tc_ct_entry_put(entry);
+
 	return true;
 }
Signature · 1 line
2.27.0
author maintainer
#113 lore raw

PATCH 113/663 net/mlx5e: Check tunnel offload is required before setting SWP

In reply to Greg Kroah-Hartman

From: Moshe Shemesh <[email protected]>

[ Upstream commit e1c3940c6003d820c787473c65711b49c2d1bc42 ]

Check that tunnel offload is required before setting Software Parser offsets to get Geneve HW offload. In case of Geneve packet we check HW offload support of SWP in mlx5e_tunnel_features_check() and set features accordingly, this should be reflected in skb offload requested by the kernel and we should add the Software Parser offsets only if requested. Otherwise, in case HW doesn't support SWP for Geneve, data path will mistakenly try to offload Geneve SKBs with skb->encapsulation set, regardless of whether offload was requested or not on this specific SKB.

Fixes e3cfc7e6b7bd ("net/mlx5e: TX, Add geneve tunnel stateless offload support")
---
 drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h +1 -1
index 1fae7fab8297e..ff81b69a59a9b 100644
@@ -173,7 +173,7 @@ static inline bool mlx5e_accel_tx_eseg(struct mlx5e_priv *priv,
 #endif
 
 #if IS_ENABLED(CONFIG_GENEVE)
-	if (skb->encapsulation)
+	if (skb->encapsulation && skb->ip_summed == CHECKSUM_PARTIAL)
 		mlx5e_tx_tunnel_accel(skb, eseg, ihs);
 #endif
 
Signature · 1 line
2.27.0
author maintainer
#114 lore raw

PATCH 114/663 mac80211: fix potential overflow when multiplying to u32 integers

In reply to Greg Kroah-Hartman

From: Colin Ian King <[email protected]>

[ Upstream commit 6194f7e6473be78acdc5d03edd116944bdbb2c4e ]

The multiplication of the u32 variables tx_time and estimated_retx is performed using a 32 bit multiplication and the result is stored in a u64 result. This has a potential u32 overflow issue, so avoid this by casting tx_time to a u64 to force a 64 bit multiply.

Addresses-Coverity: ("Unintentional integer overflow")

Fixes 050ac52cbe1f ("mac80211: code for on-demand Hybrid Wireless Mesh Protocol")
---
 net/mac80211/mesh_hwmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/mesh_hwmp.c +1 -1
index 313eee12410ec..3db514c4c63ab 100644
@@ -356,7 +356,7 @@ u32 airtime_link_metric_get(struct ieee80211_local *local,
 	 */
 	tx_time = (device_constant + 10 * test_frame_len / rate);
 	estimated_retx = ((1 << (2 * ARITH_SHIFT)) / (s_unit - err));
-	result = (tx_time * estimated_retx) >> (2 * ARITH_SHIFT);
+	result = ((u64)tx_time * estimated_retx) >> (2 * ARITH_SHIFT);
 	return (u32)result;
 }
 
Signature · 1 line
2.27.0
author maintainer
#115 lore raw

PATCH 115/663 libbpf: Ignore non function pointer member in struct_ops

In reply to Greg Kroah-Hartman

From: Martin KaFai Lau <[email protected]>

[ Upstream commit d2836dddc95d5dd82c7cb23726c97d8c9147f050 ]

When libbpf initializes the kernel's struct_ops in "bpf_map__init_kern_struct_ops()", it enforces all pointer types must be a function pointer and rejects others. It turns out to be too strict. For example, when directly using "struct tcp_congestion_ops" from vmlinux.h, it has a "struct module *owner" member and it is set to NULL in a bpf_tcp_cc.o.

Instead, it only needs to ensure the member is a function pointer if it has been set (relocated) to a bpf-prog. This patch moves the "btf_is_func_proto(kern_mtype)" check after the existing "if (!prog) { continue; }". The original debug message in "if (!prog) { continue; }" is also removed since it is no longer valid. Beside, there is a later debug message to tell which function pointer is set.

The "btf_is_func_proto(mtype)" has already been guaranteed in "bpf_object__collect_st_ops_relos()" which has been run before "bpf_map__init_kern_struct_ops()". Thus, this check is removed.

v2:
- Remove outdated debug message (Andrii) Remove because there is a later debug message to tell which function pointer is set.
- Following mtype->type is no longer needed. Remove:
"skip_mods_and_typedefs(btf, mtype->type, &mtype_id)"
- Do "if (!prog)" test before skip_mods_and_typedefs.

---
 tools/lib/bpf/libbpf.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
tools/lib/bpf/libbpf.c +11 -11
index ad165e6e74bc0..b954db52bb807 100644
@@ -865,24 +865,24 @@ static int bpf_map__init_kern_struct_ops(struct bpf_map *map,
 		if (btf_is_ptr(mtype)) {
 			struct bpf_program *prog;
 
-			mtype = skip_mods_and_typedefs(btf, mtype->type, &mtype_id);
+			prog = st_ops->progs[i];
+			if (!prog)
+				continue;
+
 			kern_mtype = skip_mods_and_typedefs(kern_btf,
 							    kern_mtype->type,
 							    &kern_mtype_id);
-			if (!btf_is_func_proto(mtype) ||
-			    !btf_is_func_proto(kern_mtype)) {
-				pr_warn("struct_ops init_kern %s: non func ptr %s is not supported\n",
+
+			/* mtype->type must be a func_proto which was
+			 * guaranteed in bpf_object__collect_st_ops_relos(),
+			 * so only check kern_mtype for func_proto here.
+			 */
+			if (!btf_is_func_proto(kern_mtype)) {
+				pr_warn("struct_ops init_kern %s: kernel member %s is not a func ptr\n",
 					map->name, mname);
 				return -ENOTSUP;
 			}
 
-			prog = st_ops->progs[i];
-			if (!prog) {
-				pr_debug("struct_ops init_kern %s: func ptr %s is not set\n",
-					 map->name, mname);
-				continue;
-			}
-
 			prog->attach_btf_id = kern_type_id;
 			prog->expected_attach_type = kern_member_idx;
 
Signature · 1 line
2.27.0
author maintainer
#116 lore raw

PATCH 116/663 bpf: Fix an unitialized value in bpf_iter

In reply to Greg Kroah-Hartman

From: Yonghong Song <[email protected]>

[ Upstream commit 17d8beda277a36203585943e70c7909b60775fd5 ]

Commit 15d83c4d7cef ("bpf: Allow loading of a bpf_iter program") cached btf_id in struct bpf_iter_target_info so later on if it can be checked cheaply compared to checking registered names.

syzbot found a bug that uninitialized value may occur to bpf_iter_target_info->btf_id. This is because we allocated bpf_iter_target_info structure with kmalloc and never initialized field btf_id afterwards. This uninitialized btf_id is typically compared to a u32 bpf program func proto btf_id, and the chance of being equal is extremely slim.

This patch fixed the issue by using kzalloc which will also prevent future likely instances due to adding new fields.

Fixes 15d83c4d7cef ("bpf: Allow loading of a bpf_iter program")
Reported-by [email protected]
---
 kernel/bpf/bpf_iter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/bpf/bpf_iter.c +1 -1
index 8f10e30ea0b08..e8957e911de31 100644
@@ -273,7 +273,7 @@ int bpf_iter_reg_target(const struct bpf_iter_reg *reg_info)
 {
 	struct bpf_iter_target_info *tinfo;
 
-	tinfo = kmalloc(sizeof(*tinfo), GFP_KERNEL);
+	tinfo = kzalloc(sizeof(*tinfo), GFP_KERNEL);
 	if (!tinfo)
 		return -ENOMEM;
 
Signature · 1 line
2.27.0
author maintainer
#117 lore raw

PATCH 117/663 bpf, devmap: Use GFP_KERNEL for xdp bulk queue allocation

In reply to Greg Kroah-Hartman

From: Jun'ichi Nomura <[email protected]>

[ Upstream commit 7d4553b69fb335496c597c31590e982485ebe071 ]

The devmap bulk queue is allocated with GFP_ATOMIC and the allocation may fail if there is no available space in existing percpu pool.

Since commit 75ccae62cb8d42 ("xdp: Move devmap bulk queue into struct net_device") moved the bulk queue allocation to NETDEV_REGISTER callback, whose context is allowed to sleep, use GFP_KERNEL instead of GFP_ATOMIC to let percpu allocator extend the pool when needed and avoid possible failure of netdev registration.

As the required alignment is natural, we can simply use alloc_percpu().

Fixes 75ccae62cb8d42 ("xdp: Move devmap bulk queue into struct net_device")
Cc Toke Høiland-Jørgensen <[email protected]>
---
 kernel/bpf/devmap.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
kernel/bpf/devmap.c +1 -3
index 2b5ca93c17dec..b5be9659ab590 100644
@@ -815,9 +815,7 @@ static int dev_map_notification(struct notifier_block *notifier,
 			break;
 
 		/* will be freed in free_netdev() */
-		netdev->xdp_bulkq =
-			__alloc_percpu_gfp(sizeof(struct xdp_dev_bulk_queue),
-					   sizeof(void *), GFP_ATOMIC);
+		netdev->xdp_bulkq = alloc_percpu(struct xdp_dev_bulk_queue);
 		if (!netdev->xdp_bulkq)
 			return NOTIFY_BAD;
 
Signature · 1 line
2.27.0
author maintainer
#118 lore raw

PATCH 118/663 bpf: Fix bpf_fib_lookup helper MTU check for SKB ctx

In reply to Greg Kroah-Hartman

From: Jesper Dangaard Brouer <[email protected]>

[ Upstream commit 2c0a10af688c02adcf127aad29e923e0056c6b69 ]

BPF end-user on Cilium slack-channel (Carlo Carraro) wants to use bpf_fib_lookup for doing MTU-check, but *prior* to extending packet size, by adjusting fib_params 'tot_len' with the packet length plus the expected encap size. (Just like the bpf_check_mtu helper supports). He discovered that for SKB ctx the param->tot_len was not used, instead skb->len was used (via MTU check in is_skb_forwardable() that checks against netdev MTU).

Fix this by using fib_params 'tot_len' for MTU check. If not provided (e.g. zero) then keep existing TC behaviour intact. Notice that 'tot_len' for MTU check is done like XDP code-path, which checks against FIB-dst MTU.

V16:
- Revert V13 optimization, 2nd lookup is against egress/resulting netdev

V13:
- Only do ifindex lookup one time, calling dev_get_by_index_rcu().

V10:
- Use same method as XDP for 'tot_len' MTU check

---
 net/core/filter.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
net/core/filter.c +10 -3
index 2ca5eecebacfa..f0a19a48c0481 100644
@@ -5549,6 +5549,7 @@ BPF_CALL_4(bpf_skb_fib_lookup, struct sk_buff *, skb,
 {
 	struct net *net = dev_net(skb->dev);
 	int rc = -EAFNOSUPPORT;
+	bool check_mtu = false;
 
 	if (plen < sizeof(*params))
 		return -EINVAL;
@@ -5556,22 +5557,28 @@ BPF_CALL_4(bpf_skb_fib_lookup, struct sk_buff *, skb,
 	if (flags & ~(BPF_FIB_LOOKUP_DIRECT | BPF_FIB_LOOKUP_OUTPUT))
 		return -EINVAL;
 
+	if (params->tot_len)
+		check_mtu = true;
+
 	switch (params->family) {
 #if IS_ENABLED(CONFIG_INET)
 	case AF_INET:
-		rc = bpf_ipv4_fib_lookup(net, params, flags, false);
+		rc = bpf_ipv4_fib_lookup(net, params, flags, check_mtu);
 		break;
 #endif
 #if IS_ENABLED(CONFIG_IPV6)
 	case AF_INET6:
-		rc = bpf_ipv6_fib_lookup(net, params, flags, false);
+		rc = bpf_ipv6_fib_lookup(net, params, flags, check_mtu);
 		break;
 #endif
 	}
 
-	if (!rc) {
+	if (rc == BPF_FIB_LKUP_RET_SUCCESS && !check_mtu) {
 		struct net_device *dev;
 
+		/* When tot_len isn't provided by user, check skb
+		 * against MTU of FIB lookup resulting net_device
+		 */
 		dev = dev_get_by_index_rcu(net, params->ifindex);
 		if (!is_skb_forwardable(dev, skb))
 			rc = BPF_FIB_LKUP_RET_FRAG_NEEDED;
Signature · 1 line
2.27.0
author maintainer
#119 lore raw

PATCH 119/663 selftests: mptcp: fix ACKRX debug message

In reply to Greg Kroah-Hartman

From: Matthieu Baerts <[email protected]>

[ Upstream commit f384221a381751508f390b36d0e51bd5a7beb627 ]

Info from received MPCapable SYN were printed instead of the ones from received MPCapable 3rd ACK.

Fixes fed61c4b584c ("selftests: mptcp: make 2nd net namespace use tcp syn cookies unconditionally")
---
 tools/testing/selftests/net/mptcp/mptcp_connect.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/net/mptcp/mptcp_connect.sh +1 -1
index 2cfd87d94db89..e927df83efb91 100755
@@ -493,7 +493,7 @@ do_transfer()
 		echo "${listener_ns} SYNRX: ${cl_proto} -> ${srv_proto}: expect ${expect_synrx}, got ${stat_synrx_now_l}"
 	fi
 	if [ $expect_ackrx -ne $stat_ackrx_now_l ] ;then
-		echo "${listener_ns} ACKRX: ${cl_proto} -> ${srv_proto}: expect ${expect_synrx}, got ${stat_synrx_now_l}"
+		echo "${listener_ns} ACKRX: ${cl_proto} -> ${srv_proto}: expect ${expect_ackrx}, got ${stat_ackrx_now_l} "
 	fi
 
 	if [ $retc -eq 0 ] && [ $rets -eq 0 ];then
Signature · 1 line
2.27.0
author maintainer
#120 lore raw

PATCH 120/663 tcp: fix SO_RCVLOWAT related hangs under mem pressure

In reply to Greg Kroah-Hartman

From: Eric Dumazet <[email protected]>

[ Upstream commit f969dc5a885736842c3511ecdea240fbb02d25d9 ]

While commit 24adbc1676af ("tcp: fix SO_RCVLOWAT hangs with fat skbs") fixed an issue vs too small sk_rcvbuf for given sk_rcvlowat constraint, it missed to address issue caused by memory pressure.

1) If we are under memory pressure and socket receive queue is empty. First incoming packet is allowed to be queued, after commit 76dfa6082032 ("tcp: allow one skb to be received per socket under memory pressure")

But we do not send EPOLLIN yet, in case tcp_data_ready() sees sk_rcvlowat is bigger than skb length.

2) Then, when next packet comes, it is dropped, and we directly call sk->sk_data_ready().

3) If application is using poll(), tcp_poll() will then use tcp_stream_is_readable() and decide the socket receive queue is not yet filled, so nothing will happen.

Even when sender retransmits packets, phases 2) & 3) repeat and flow is effectively frozen, until memory pressure is off.

Fix is to consider tcp_under_memory_pressure() to take care of global memory pressure or memcg pressure.

Fixes 24adbc1676af ("tcp: fix SO_RCVLOWAT hangs with fat skbs")
---
 include/net/tcp.h | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
include/net/tcp.h +7 -2
index fe9747ee70a6f..7d66c61d22c7d 100644
@@ -1424,8 +1424,13 @@ void tcp_cleanup_rbuf(struct sock *sk, int copied);
  */
 static inline bool tcp_rmem_pressure(const struct sock *sk)
 {
-	int rcvbuf = READ_ONCE(sk->sk_rcvbuf);
-	int threshold = rcvbuf - (rcvbuf >> 3);
+	int rcvbuf, threshold;
+
+	if (tcp_under_memory_pressure(sk))
+		return true;
+
+	rcvbuf = READ_ONCE(sk->sk_rcvbuf);
+	threshold = rcvbuf - (rcvbuf >> 3);
 
 	return atomic_read(&sk->sk_rmem_alloc) > threshold;
 }
Signature · 1 line
2.27.0
author maintainer
#121 lore raw

PATCH 121/663 net: axienet: Handle deferred probe on clock properly

In reply to Greg Kroah-Hartman

From: Robert Hancock <[email protected]>

[ Upstream commit 57baf8cc70ea4cf5503c9d42f31f6a86d7f5ff1a ]

This driver is set up to use a clock mapping in the device tree if it is present, but still work without one for backward compatibility. However, if getting the clock returns -EPROBE_DEFER, then we need to abort and return that error from our driver initialization so that the probe can be retried later after the clock is set up.

Move clock initialization to earlier in the process so we do not waste as much effort if the clock is not yet available. Switch to use devm_clk_get_optional and abort initialization on any error reported. Also enable the clock regardless of whether the controller is using an MDIO bus, as the clock is required in any case.

Fixes 09a0354cadec267be7f ("net: axienet: Use clock framework to get device clock rate")
---
 .../net/ethernet/xilinx/xilinx_axienet_main.c | 26 +++++++++----------
 1 file changed, 12 insertions(+), 14 deletions(-)
drivers/net/ethernet/xilinx/xilinx_axienet_main.c +12 -14
index 9aafd3ecdaa4d..eea0bb7c23ede 100644
@@ -1805,6 +1805,18 @@ static int axienet_probe(struct platform_device *pdev)
 	lp->options = XAE_OPTION_DEFAULTS;
 	lp->rx_bd_num = RX_BD_NUM_DEFAULT;
 	lp->tx_bd_num = TX_BD_NUM_DEFAULT;
+
+	lp->clk = devm_clk_get_optional(&pdev->dev, NULL);
+	if (IS_ERR(lp->clk)) {
+		ret = PTR_ERR(lp->clk);
+		goto free_netdev;
+	}
+	ret = clk_prepare_enable(lp->clk);
+	if (ret) {
+		dev_err(&pdev->dev, "Unable to enable clock: %d\n", ret);
+		goto free_netdev;
+	}
+
 	/* Map device registers */
 	ethres = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	lp->regs = devm_ioremap_resource(&pdev->dev, ethres);
@@ -1980,20 +1992,6 @@ static int axienet_probe(struct platform_device *pdev)
 
 	lp->phy_node = of_parse_phandle(pdev->dev.of_node, "phy-handle", 0);
 	if (lp->phy_node) {
-		lp->clk = devm_clk_get(&pdev->dev, NULL);
-		if (IS_ERR(lp->clk)) {
-			dev_warn(&pdev->dev, "Failed to get clock: %ld\n",
-				 PTR_ERR(lp->clk));
-			lp->clk = NULL;
-		} else {
-			ret = clk_prepare_enable(lp->clk);
-			if (ret) {
-				dev_err(&pdev->dev, "Unable to enable clock: %d\n",
-					ret);
-				goto free_netdev;
-			}
-		}
-
 		ret = axienet_mdio_setup(lp);
 		if (ret)
 			dev_warn(&pdev->dev,
Signature · 1 line
2.27.0
author maintainer
#122 lore raw

PATCH 122/663 cxgb4/chtls/cxgbit: Keeping the max ofld immediate data size same in cxgb4 and ulds

In reply to Greg Kroah-Hartman

From: Ayush Sawal <[email protected]>

[ Upstream commit 2355a6773a2cb0d2dce13432dde78497f1d6617b ]

The Max imm data size in cxgb4 is not similar to the max imm data size in the chtls. This caused an mismatch in output of is_ofld_imm() of cxgb4 and chtls. So fixed this by keeping the max wreq size of imm data same in both chtls and cxgb4 as MAX_IMM_OFLD_TX_DATA_WR_LEN.

As cxgb4's max imm. data value for ofld packets is changed to MAX_IMM_OFLD_TX_DATA_WR_LEN. Using the same in cxgbit also.

Fixes 36bedb3f2e5b8 ("crypto: chtls - Inline TLS record Tx")
---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h        |  3 +++
 drivers/net/ethernet/chelsio/cxgb4/sge.c              | 11 ++++++++---
 .../ethernet/chelsio/inline_crypto/chtls/chtls_cm.h   |  3 ---
 drivers/target/iscsi/cxgbit/cxgbit_target.c           |  3 +--
 4 files changed, 12 insertions(+), 8 deletions(-)
drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h +3 -0
index 1b49f2fa9b185..34546f5312eee 100644
@@ -46,6 +46,9 @@
 #define MAX_ULD_QSETS 16
 #define MAX_ULD_NPORTS 4
 
+/* ulp_mem_io + ulptx_idata + payload + padding */
+#define MAX_IMM_ULPTX_WR_LEN (32 + 8 + 256 + 8)
+
 /* CPL message priority levels */
 enum {
 	CPL_PRIORITY_DATA     = 0,  /* data messages */
drivers/net/ethernet/chelsio/cxgb4/sge.c +8 -3
index 196652a114c5f..3334c9e2152ab 100644
@@ -2842,17 +2842,22 @@ int t4_mgmt_tx(struct adapter *adap, struct sk_buff *skb)
  *	@skb: the packet
  *
  *	Returns true if a packet can be sent as an offload WR with immediate
- *	data.  We currently use the same limit as for Ethernet packets.
+ *	data.
+ *	FW_OFLD_TX_DATA_WR limits the payload to 255 bytes due to 8-bit field.
+ *      However, FW_ULPTX_WR commands have a 256 byte immediate only
+ *      payload limit.
  */
 static inline int is_ofld_imm(const struct sk_buff *skb)
 {
 	struct work_request_hdr *req = (struct work_request_hdr *)skb->data;
 	unsigned long opcode = FW_WR_OP_G(ntohl(req->wr_hi));
 
-	if (opcode == FW_CRYPTO_LOOKASIDE_WR)
+	if (unlikely(opcode == FW_ULPTX_WR))
+		return skb->len <= MAX_IMM_ULPTX_WR_LEN;
+	else if (opcode == FW_CRYPTO_LOOKASIDE_WR)
 		return skb->len <= SGE_MAX_WR_LEN;
 	else
-		return skb->len <= MAX_IMM_TX_PKT_LEN;
+		return skb->len <= MAX_IMM_OFLD_TX_DATA_WR_LEN;
 }
 
 /**
drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.h +0 -3
index 47ba81e42f5d0..b1161bdeda4dc 100644
@@ -50,9 +50,6 @@
 #define MIN_RCV_WND (24 * 1024U)
 #define LOOPBACK(x)     (((x) & htonl(0xff000000)) == htonl(0x7f000000))
 
-/* ulp_mem_io + ulptx_idata + payload + padding */
-#define MAX_IMM_ULPTX_WR_LEN (32 + 8 + 256 + 8)
-
 /* for TX: a skb must have a headroom of at least TX_HEADER_LEN bytes */
 #define TX_HEADER_LEN \
 	(sizeof(struct fw_ofld_tx_data_wr) + sizeof(struct sge_opaque_hdr))
drivers/target/iscsi/cxgbit/cxgbit_target.c +1 -2
index 9b3eb2e8c92ad..b926e1d6c7b8e 100644
@@ -86,8 +86,7 @@ static int cxgbit_is_ofld_imm(const struct sk_buff *skb)
 	if (likely(cxgbit_skcb_flags(skb) & SKCBF_TX_ISO))
 		length += sizeof(struct cpl_tx_data_iso);
 
-#define MAX_IMM_TX_PKT_LEN	256
-	return length <= MAX_IMM_TX_PKT_LEN;
+	return length <= MAX_IMM_OFLD_TX_DATA_WR_LEN;
 }
 
 /*
Signature · 1 line
2.27.0
author maintainer
#123 lore raw

PATCH 123/663 b43: N-PHY: Fix the update of coef for the PHY revision >= 3case

In reply to Greg Kroah-Hartman

From: Colin Ian King <[email protected]>

[ Upstream commit 4773acf3d4b50768bf08e9e97a204819e9ea0895 ]

The documentation for the PHY update [1] states:

Loop 4 times with index i

If PHY Revision >= 3
Copy table[i] to coef[i]
Otherwise
Set coef[i] to 0

the copy of the table to coef is currently implemented the wrong way around, table is being updated from uninitialized values in coeff. Fix this by swapping the assignment around.

[1] https://bcm-v4.sipsolutions.net/802.11/PHY/N/RestoreCal/

Fixes 2f258b74d13c ("b43: N-PHY: implement restoring general configuration")

Addresses-Coverity: ("Uninitialized scalar variable")

---
 drivers/net/wireless/broadcom/b43/phy_n.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/broadcom/b43/phy_n.c +1 -1
index b669dff24b6e0..665b737fbb0d8 100644
@@ -5311,7 +5311,7 @@ static void b43_nphy_restore_cal(struct b43_wldev *dev)
 
 	for (i = 0; i < 4; i++) {
 		if (dev->phy.rev >= 3)
-			table[i] = coef[i];
+			coef[i] = table[i];
 		else
 			coef[i] = 0;
 	}
Signature · 1 line
2.27.0
author maintainer
#124 lore raw

PATCH 124/663 bpf: Clear subreg_def for global function return values

In reply to Greg Kroah-Hartman

From: Ilya Leoshkevich <[email protected]>

[ Upstream commit 45159b27637b0fef6d5ddb86fc7c46b13c77960f ]

test_global_func4 fails on s390 as reported by Yauheni in [1].

The immediate problem is that the zext code includes the instruction, whose result needs to be zero-extended, into the zero-extension patchlet, and if this instruction happens to be a branch, then its delta is not adjusted. As a result, the verifier rejects the program later.

However, according to [2], as far as the verifier's algorithm is concerned and as specified by the insn_no_def() function, branching insns do not define anything. This includes call insns, even though one might argue that they define %r0.

This means that the real problem is that zero extension kicks in at all. This happens because clear_caller_saved_regs() sets BPF_REG_0's subreg_def after global function calls. This can be fixed in many ways; this patch mimics what helper function call handling already does.

[1] https://lore.kernel.org/bpf/[email protected]/
[2] https://lore.kernel.org/bpf/CAADnVQ+2RPKcftZw8d+B1UwB35cpBhpF5u3OocNh90D9pETPwg@mail.gmail.com/

Fixes 51c39bb1d5d1 ("bpf: Introduce function-by-function verification")
---
 kernel/bpf/verifier.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/bpf/verifier.c +2 -1
index c09594e70f90a..6c2e4947beaeb 100644
@@ -4786,8 +4786,9 @@ static int check_func_call(struct bpf_verifier_env *env, struct bpf_insn *insn,
 					subprog);
 			clear_caller_saved_regs(env, caller->regs);
 
-			/* All global functions return SCALAR_VALUE */
+			/* All global functions return a 64-bit SCALAR_VALUE */
 			mark_reg_unknown(env, caller->regs, BPF_REG_0);
+			caller->regs[BPF_REG_0].subreg_def = DEF_NOT_SUBREG;
 
 			/* continue with next insn after call */
 			return 0;
Signature · 1 line
2.27.0
author maintainer
#125 lore raw

PATCH 125/663 ibmvnic: add memory barrier to protect long term buffer

In reply to Greg Kroah-Hartman

From: Lijun Pan <[email protected]>

[ Upstream commit 42557dab78edc8235aba5b441f2eb35f725a0ede ]

dma_rmb() barrier is added to load the long term buffer before copying it to socket buffer; and dma_wmb() barrier is added to update the long term buffer before it being accessed by VIOS (virtual i/o server).

Fixes 032c5e82847a ("Driver for IBM System i/p VNIC protocol")
---
 drivers/net/ethernet/ibm/ibmvnic.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/ethernet/ibm/ibmvnic.c +5 -0
index d789c3cb7f87b..d6cd131625525 100644
@@ -1592,6 +1592,9 @@ static netdev_tx_t ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev)
 		skb_copy_from_linear_data(skb, dst, skb->len);
 	}
 
+	/* post changes to long_term_buff *dst before VIOS accessing it */
+	dma_wmb();
+
 	tx_pool->consumer_index =
 	    (tx_pool->consumer_index + 1) % tx_pool->num_buffers;
 
@@ -2432,6 +2435,8 @@ restart_poll:
 		offset = be16_to_cpu(next->rx_comp.off_frame_data);
 		flags = next->rx_comp.flags;
 		skb = rx_buff->skb;
+		/* load long_term_buff before copying to skb */
+		dma_rmb();
 		skb_copy_to_linear_data(skb, rx_buff->data + offset,
 					length);
 
Signature · 1 line
2.27.0
author maintainer
#126 lore raw

PATCH 126/663 ibmvnic: skip send_request_unmap for timeout reset

In reply to Greg Kroah-Hartman

From: Lijun Pan <[email protected]>

[ Upstream commit 7d3a7b9ea59ddb223aec59b45fa1713c633aaed4 ]

Timeout reset will trigger the VIOS to unmap it automatically, similarly as FAILVOER and MOBILITY events. If we unmap it in the linux side, we will see errors like "30000003: Error 4 in REQUEST_UNMAP_RSP".
So, don't call send_request_unmap for timeout reset.

Fixes ed651a10875f ("ibmvnic: Updated reset handling")
---
 drivers/net/ethernet/ibm/ibmvnic.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/ethernet/ibm/ibmvnic.c +6 -1
index d6cd131625525..5e1f4e71af7bc 100644
@@ -249,8 +249,13 @@ static void free_long_term_buff(struct ibmvnic_adapter *adapter,
 	if (!ltb->buff)
 		return;
 
+	/* VIOS automatically unmaps the long term buffer at remote
+	 * end for the following resets:
+	 * FAILOVER, MOBILITY, TIMEOUT.
+	 */
 	if (adapter->reset_reason != VNIC_RESET_FAILOVER &&
-	    adapter->reset_reason != VNIC_RESET_MOBILITY)
+	    adapter->reset_reason != VNIC_RESET_MOBILITY &&
+	    adapter->reset_reason != VNIC_RESET_TIMEOUT)
 		send_request_unmap(adapter, ltb->map_id);
 	dma_free_coherent(dev, ltb->size, ltb->buff, ltb->addr);
 }
Signature · 1 line
2.27.0
author maintainer
#127 lore raw

PATCH 127/663 net: dsa: felix: perform teardown in reverse order of setup

In reply to Greg Kroah-Hartman

From: Vladimir Oltean <[email protected]>

[ Upstream commit d19741b0f54487cf3a11307900f8633935cd2849 ]

In general it is desirable that cleanup is the reverse process of setup. In this case I am not seeing any particular issue, but with the introduction of devlink-sb for felix, a non-obvious decision had to be made as to where to put its cleanup method. When there's a convention in place, that decision becomes obvious.

---
 drivers/net/dsa/ocelot/felix.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/dsa/ocelot/felix.c +5 -5
index 89d7c9b231863..7e506a1d8b2ff 100644
@@ -635,14 +635,14 @@ static void felix_teardown(struct dsa_switch *ds)
 	struct felix *felix = ocelot_to_felix(ocelot);
 	int port;
 
-	if (felix->info->mdio_bus_free)
-		felix->info->mdio_bus_free(ocelot);
+	ocelot_deinit_timestamp(ocelot);
+	ocelot_deinit(ocelot);
 
 	for (port = 0; port < ocelot->num_phys_ports; port++)
 		ocelot_deinit_port(ocelot, port);
-	ocelot_deinit_timestamp(ocelot);
-	/* stop workqueue thread */
-	ocelot_deinit(ocelot);
+
+	if (felix->info->mdio_bus_free)
+		felix->info->mdio_bus_free(ocelot);
 }
 
 static int felix_hwtstamp_get(struct dsa_switch *ds, int port,
Signature · 1 line
2.27.0
author maintainer
#128 lore raw

PATCH 128/663 net: dsa: felix: dont deinitialize unused ports

In reply to Greg Kroah-Hartman

From: Vladimir Oltean <[email protected]>

[ Upstream commit 42b5adbbac03bdb396192316c015fa3e64ffd5a1 ]

ocelot_init_port is called only if dsa_is_unused_port == false, however ocelot_deinit_port is called unconditionally. This causes a warning in the skb_queue_purge inside ocelot_deinit_port saying that the spin lock protecting ocelot_port->tx_skbs was not initialized.

Fixes e5fb512d81d0 ("net: mscc: ocelot: deinitialize only initialized ports")
---
 drivers/net/dsa/ocelot/felix.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/dsa/ocelot/felix.c +5 -1
index 7e506a1d8b2ff..4e53464411edf 100644
@@ -638,8 +638,12 @@ static void felix_teardown(struct dsa_switch *ds)
 	ocelot_deinit_timestamp(ocelot);
 	ocelot_deinit(ocelot);
 
-	for (port = 0; port < ocelot->num_phys_ports; port++)
+	for (port = 0; port < ocelot->num_phys_ports; port++) {
+		if (dsa_is_unused_port(ds, port))
+			continue;
+
 		ocelot_deinit_port(ocelot, port);
+	}
 
 	if (felix->info->mdio_bus_free)
 		felix->info->mdio_bus_free(ocelot);
Signature · 1 line
2.27.0
author maintainer
#129 lore raw

PATCH 129/663 net: phy: mscc: adding LCPLL reset to VSC8514

In reply to Greg Kroah-Hartman

From: Bjarni Jonasson <[email protected]>

[ Upstream commit 3cc2c646be0b22037f31c958e96c0544a073d108 ]

At Power-On Reset, transients may cause the LCPLL to lock onto a clock that is momentarily unstable. This is normally seen in QSGMII setups where the higher speed 6G SerDes is being used. This patch adds an initial LCPLL Reset to the PHY (first instance) to avoid this issue.

Fixes e4f9ba642f0b ("net: phy: mscc: add support for VSC8514 PHY.")
---
 drivers/net/phy/mscc/mscc.h      |   8 +
 drivers/net/phy/mscc/mscc_main.c | 350 ++++++++++++++++++++-----------
 2 files changed, 236 insertions(+), 122 deletions(-)
drivers/net/phy/mscc/mscc.h +8 -0
index 9481bce94c2ed..c2023f93c0b24 100644
@@ -102,6 +102,7 @@ enum rgmii_clock_delay {
 #define PHY_MCB_S6G_READ		  BIT(30)
 
 #define PHY_S6G_PLL5G_CFG0		  0x06
+#define PHY_S6G_PLL5G_CFG2		  0x08
 #define PHY_S6G_LCPLL_CFG		  0x11
 #define PHY_S6G_PLL_CFG			  0x2b
 #define PHY_S6G_COMMON_CFG		  0x2c
@@ -121,6 +122,9 @@ enum rgmii_clock_delay {
 #define PHY_S6G_PLL_FSM_CTRL_DATA_POS	  8
 #define PHY_S6G_PLL_FSM_ENA_POS		  7
 
+#define PHY_S6G_CFG2_FSM_DIS              1
+#define PHY_S6G_CFG2_FSM_CLK_BP          23
+
 #define MSCC_EXT_PAGE_ACCESS		  31
 #define MSCC_PHY_PAGE_STANDARD		  0x0000 /* Standard registers */
 #define MSCC_PHY_PAGE_EXTENDED		  0x0001 /* Extended registers */
@@ -412,6 +416,10 @@ struct vsc8531_edge_rate_table {
 };
 #endif /* CONFIG_OF_MDIO */
 
+enum csr_target {
+	MACRO_CTRL  = 0x07,
+};
+
 #if IS_ENABLED(CONFIG_MACSEC)
 int vsc8584_macsec_init(struct phy_device *phydev);
 void vsc8584_handle_macsec_interrupt(struct phy_device *phydev);
drivers/net/phy/mscc/mscc_main.c +228 -122

429 lines not on this page · raw message

Signature · 1 line
2.27.0
author maintainer
#130 lore raw

PATCH 130/663 net: amd-xgbe: Reset the PHY rx data path when mailbox command timeout

In reply to Greg Kroah-Hartman

From: Shyam Sundar S K <[email protected]>

[ Upstream commit 30b7edc82ec82578f4f5e6706766f0a9535617d3 ]

Sometimes mailbox commands timeout when the RX data path becomes unresponsive. This prevents the submission of new mailbox commands to DXIO. This patch identifies the timeout and resets the RX data path so that the next message can be submitted properly.

Fixes 549b32af9f7c ("amd-xgbe: Simplify mailbox interface rate change code")
---
 drivers/net/ethernet/amd/xgbe/xgbe-common.h | 14 +++++++++++
 drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 28 ++++++++++++++++++++-
 2 files changed, 41 insertions(+), 1 deletion(-)
drivers/net/ethernet/amd/xgbe/xgbe-common.h +14 -0
index b40d4377cc71d..b2cd3bdba9f89 100644
@@ -1279,10 +1279,18 @@
 #define MDIO_PMA_10GBR_FECCTRL		0x00ab
 #endif
 
+#ifndef MDIO_PMA_RX_CTRL1
+#define MDIO_PMA_RX_CTRL1		0x8051
+#endif
+
 #ifndef MDIO_PCS_DIG_CTRL
 #define MDIO_PCS_DIG_CTRL		0x8000
 #endif
 
+#ifndef MDIO_PCS_DIGITAL_STAT
+#define MDIO_PCS_DIGITAL_STAT		0x8010
+#endif
+
 #ifndef MDIO_AN_XNP
 #define MDIO_AN_XNP			0x0016
 #endif
@@ -1358,6 +1366,8 @@
 #define XGBE_KR_TRAINING_ENABLE		BIT(1)
 
 #define XGBE_PCS_CL37_BP		BIT(12)
+#define XGBE_PCS_PSEQ_STATE_MASK	0x1c
+#define XGBE_PCS_PSEQ_STATE_POWER_GOOD	0x10
 
 #define XGBE_AN_CL37_INT_CMPLT		BIT(0)
 #define XGBE_AN_CL37_INT_MASK		0x01
@@ -1375,6 +1385,10 @@
 #define XGBE_PMA_CDR_TRACK_EN_OFF	0x00
 #define XGBE_PMA_CDR_TRACK_EN_ON	0x01
 
+#define XGBE_PMA_RX_RST_0_MASK		BIT(4)
+#define XGBE_PMA_RX_RST_0_RESET_ON	0x10
+#define XGBE_PMA_RX_RST_0_RESET_OFF	0x00
+
 /* Bit setting and getting macros
  *  The get macro will extract the current bit field value from within
  *  the variable
drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c +27 -1
index 859ded0c06b05..087948085ae19 100644
@@ -1953,6 +1953,27 @@ static void xgbe_phy_set_redrv_mode(struct xgbe_prv_data *pdata)
 	xgbe_phy_put_comm_ownership(pdata);
 }
 
+static void xgbe_phy_rx_reset(struct xgbe_prv_data *pdata)
+{
+	int reg;
+
+	reg = XMDIO_READ_BITS(pdata, MDIO_MMD_PCS, MDIO_PCS_DIGITAL_STAT,
+			      XGBE_PCS_PSEQ_STATE_MASK);
+	if (reg == XGBE_PCS_PSEQ_STATE_POWER_GOOD) {
+		/* Mailbox command timed out, reset of RX block is required.
+		 * This can be done by asseting the reset bit and wait for
+		 * its compeletion.
+		 */
+		XMDIO_WRITE_BITS(pdata, MDIO_MMD_PMAPMD, MDIO_PMA_RX_CTRL1,
+				 XGBE_PMA_RX_RST_0_MASK, XGBE_PMA_RX_RST_0_RESET_ON);
+		ndelay(20);
+		XMDIO_WRITE_BITS(pdata, MDIO_MMD_PMAPMD, MDIO_PMA_RX_CTRL1,
+				 XGBE_PMA_RX_RST_0_MASK, XGBE_PMA_RX_RST_0_RESET_OFF);
+		usleep_range(40, 50);
+		netif_err(pdata, link, pdata->netdev, "firmware mailbox reset performed\n");
+	}
+}
+
 static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata,
 					unsigned int cmd, unsigned int sub_cmd)
 {
@@ -1960,9 +1981,11 @@ static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata,
 	unsigned int wait;
 
 	/* Log if a previous command did not complete */
-	if (XP_IOREAD_BITS(pdata, XP_DRIVER_INT_RO, STATUS))
+	if (XP_IOREAD_BITS(pdata, XP_DRIVER_INT_RO, STATUS)) {
 		netif_dbg(pdata, link, pdata->netdev,
 			  "firmware mailbox not ready for command\n");
+		xgbe_phy_rx_reset(pdata);
+	}
 
 	/* Construct the command */
 	XP_SET_BITS(s0, XP_DRIVER_SCRATCH_0, COMMAND, cmd);
@@ -1984,6 +2007,9 @@ static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata,
 
 	netif_dbg(pdata, link, pdata->netdev,
 		  "firmware mailbox command did not complete\n");
+
+	/* Reset on error */
+	xgbe_phy_rx_reset(pdata);
 }
 
 static void xgbe_phy_rrc(struct xgbe_prv_data *pdata)
Signature · 1 line
2.27.0
author maintainer
#131 lore raw

PATCH 131/663 net: amd-xgbe: Fix NETDEV WATCHDOG transmit queue timeout warning

In reply to Greg Kroah-Hartman

From: Shyam Sundar S K <[email protected]>

[ Upstream commit 186edbb510bd60e748f93975989ccba25ee99c50 ]

The current driver calls netif_carrier_off() late in the link tear down which can result in a netdev watchdog timeout.

Calling netif_carrier_off() immediately after netif_tx_stop_all_queues() avoids the warning.

 ------------[ cut here ]------------
 NETDEV WATCHDOG: enp3s0f2 (amd-xgbe): transmit queue 0 timed out
 WARNING: CPU: 3 PID: 0 at net/sched/sch_generic.c:461 dev_watchdog+0x20d/0x220
 Modules linked in: amd_xgbe(E)  amd-xgbe 0000:03:00.2 enp3s0f2: Link is Down
 CPU: 3 PID: 0 Comm: swapper/3 Tainted: G            E
 Hardware name: AMD Bilby-RV2/Bilby-RV2, BIOS RBB1202A 10/18/2019
 RIP: 0010:dev_watchdog+0x20d/0x220
 Code: 00 49 63 4e e0 eb 92 4c 89 e7 c6 05 c6 e2 c1 00 01 e8 e7 ce fc ff 89 d9 48
 RSP: 0018:ffff90cfc28c3e88 EFLAGS: 00010286
 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000006
 RDX: 0000000000000007 RSI: 0000000000000086 RDI: ffff90cfc28d63c0
 RBP: ffff90cfb977845c R08: 0000000000000050 R09: 0000000000196018
 R10: ffff90cfc28c3ef8 R11: 0000000000000000 R12: ffff90cfb9778000
 R13: 0000000000000003 R14: ffff90cfb9778480 R15: 0000000000000010
 FS:  0000000000000000(0000) GS:ffff90cfc28c0000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 CR2: 00007f240ff2d9d0 CR3: 00000001e3e0a000 CR4: 00000000003406e0
 Call Trace:
  <IRQ>
  ? pfifo_fast_reset+0x100/0x100
  call_timer_fn+0x2b/0x130
  run_timer_softirq+0x3e8/0x440
  ? enqueue_hrtimer+0x39/0x90
Fixes e722ec82374b ("amd-xgbe: Update the BelFuse quirk to support SGMII")
---
 drivers/net/ethernet/amd/xgbe/xgbe-drv.c  | 1 +
 drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/amd/xgbe/xgbe-drv.c +1 -0
index 2709a2db56577..395eb0b526802 100644
@@ -1368,6 +1368,7 @@ static void xgbe_stop(struct xgbe_prv_data *pdata)
 		return;
 
 	netif_tx_stop_all_queues(netdev);
+	netif_carrier_off(pdata->netdev);
 
 	xgbe_stop_timers(pdata);
 	flush_workqueue(pdata->dev_workqueue);
drivers/net/ethernet/amd/xgbe/xgbe-mdio.c +0 -1
index 93ef5a30cb8d9..19ee4db0156d6 100644
@@ -1396,7 +1396,6 @@ static void xgbe_phy_stop(struct xgbe_prv_data *pdata)
 	pdata->phy_if.phy_impl.stop(pdata);
 
 	pdata->phy.link = 0;
-	netif_carrier_off(pdata->netdev);
 
 	xgbe_phy_adjust_link(pdata);
 }
Signature · 1 line
2.27.0
author maintainer
#132 lore raw

PATCH 132/663 net: amd-xgbe: Reset link when the link never comes back

In reply to Greg Kroah-Hartman

From: Shyam Sundar S K <[email protected]>

[ Upstream commit 84fe68eb67f9499309cffd97c1ba269de125ff14 ]

Normally, auto negotiation and reconnect should be automatically done by the hardware. But there seems to be an issue where auto negotiation has to be restarted manually. This happens because of link training and so even though still connected to the partner the link never "comes back". This needs an auto-negotiation restart.

Also, a change in xgbe-mdio is needed to get ethtool to recognize the link down and get the link change message. This change is only required in a backplane connection mode.

Fixes abf0a1c2b26a ("amd-xgbe: Add support for SFP+ modules")
---
 drivers/net/ethernet/amd/xgbe/xgbe-mdio.c   | 2 +-
 drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)
drivers/net/ethernet/amd/xgbe/xgbe-mdio.c +1 -1
index 19ee4db0156d6..4e97b48695220 100644
@@ -1345,7 +1345,7 @@ static void xgbe_phy_status(struct xgbe_prv_data *pdata)
 							     &an_restart);
 	if (an_restart) {
 		xgbe_phy_config_aneg(pdata);
-		return;
+		goto adjust_link;
 	}
 
 	if (pdata->phy.link) {
drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c +8 -0
index 087948085ae19..d3f72faecd1da 100644
@@ -2610,6 +2610,14 @@ static int xgbe_phy_link_status(struct xgbe_prv_data *pdata, int *an_restart)
 	if (reg & MDIO_STAT1_LSTATUS)
 		return 1;
 
+	if (pdata->phy.autoneg == AUTONEG_ENABLE &&
+	    phy_data->port_mode == XGBE_PORT_MODE_BACKPLANE) {
+		if (!test_bit(XGBE_LINK_INIT, &pdata->dev_state)) {
+			netif_carrier_off(pdata->netdev);
+			*an_restart = 1;
+		}
+	}
+
 	/* No link, attempt a receiver reset cycle */
 	if (phy_data->rrc_count++ > XGBE_RRC_FREQUENCY) {
 		phy_data->rrc_count = 0;
Signature · 1 line
2.27.0
author maintainer
#133 lore raw

PATCH 133/663 net: amd-xgbe: Fix network fluctuations when using 1G BELFUSE SFP

In reply to Greg Kroah-Hartman

From: Shyam Sundar S K <[email protected]>

[ Upstream commit 9eab3fdb419916f66a72d1572f68d82cd9b3f963 ]

Frequent link up/down events can happen when a Bel Fuse SFP part is connected to the amd-xgbe device. Try to avoid the frequent link issues by resetting the PHY as documented in Bel Fuse SFP datasheets.

Fixes e722ec82374b ("amd-xgbe: Update the BelFuse quirk to support SGMII")
---
 drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c +3 -0
index d3f72faecd1da..18e48b3bc402b 100644
@@ -922,6 +922,9 @@ static bool xgbe_phy_belfuse_phy_quirks(struct xgbe_prv_data *pdata)
 	if ((phy_id & 0xfffffff0) != 0x03625d10)
 		return false;
 
+	/* Reset PHY - wait for self-clearing reset bit to clear */
+	genphy_soft_reset(phy_data->phydev);
+
 	/* Disable RGMII mode */
 	phy_write(phy_data->phydev, 0x18, 0x7007);
 	reg = phy_read(phy_data->phydev, 0x18);
Signature · 1 line
2.27.0
author maintainer
#134 lore raw

PATCH 134/663 net: mvneta: Remove per-cpu queue mapping for Armada 3700

In reply to Greg Kroah-Hartman

From: Maxime Chevallier <[email protected]>

[ Upstream commit cf9bf871280d9e0a8869d98c2602d29caf69dfa3 ]

According to Errata #23 "The per-CPU GbE interrupt is limited to Core 0", we can't use the per-cpu interrupt mechanism on the Armada 3700 familly.

This is correctly checked for RSS configuration, but the initial queue mapping is still done by having the queues spread across all the CPUs in the system, both in the init path and in the cpu_hotplug path.

Fixes 2636ac3cc2b4 ("net: mvneta: Add network support for Armada 3700 SoC")
---
 drivers/net/ethernet/marvell/mvneta.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/net/ethernet/marvell/mvneta.c +8 -1
index ceb4f27898002..c6b735b305156 100644
@@ -3409,7 +3409,9 @@ static int mvneta_txq_sw_init(struct mvneta_port *pp,
 		return -ENOMEM;
 
 	/* Setup XPS mapping */
-	if (txq_number > 1)
+	if (pp->neta_armada3700)
+		cpu = 0;
+	else if (txq_number > 1)
 		cpu = txq->id % num_present_cpus();
 	else
 		cpu = pp->rxq_def % num_present_cpus();
@@ -4187,6 +4189,11 @@ static int mvneta_cpu_online(unsigned int cpu, struct hlist_node *node)
 						  node_online);
 	struct mvneta_pcpu_port *port = per_cpu_ptr(pp->ports, cpu);
 
+	/* Armada 3700's per-cpu interrupt for mvneta is broken, all interrupts
+	 * are routed to CPU 0, so we don't need all the cpu-hotplug support
+	 */
+	if (pp->neta_armada3700)
+		return 0;
 
 	spin_lock(&pp->lock);
 	/*
Signature · 1 line
2.27.0
author maintainer
#135 lore raw

PATCH 135/663 net: enetc: fix destroyed phylink dereference during unbind

In reply to Greg Kroah-Hartman

From: Vladimir Oltean <[email protected]>

[ Upstream commit 3af409ca278d4a8d50e91f9f7c4c33b175645cf3 ]

The following call path suggests that calling unregister_netdev on an interface that is up will first bring it down.

enetc_pf_remove
-> unregister_netdev
-> unregister_netdevice_queue

      -> unregister_netdevice_many
         -> dev_close_many
            -> __dev_close_many
               -> enetc_close
                  -> enetc_stop
                     -> phylink_stop

However, enetc first destroys the phylink instance, then calls unregister_netdev. This is already dissimilar to the setup (and error path teardown path) from enetc_pf_probe, but more than that, it is buggy because it is invalid to call phylink_stop after phylink_destroy.

So let's first unregister the netdev (and let the .ndo_stop events consume themselves), then destroy the phylink instance, then free the netdev.

Fixes 71b77a7a27a3 ("enetc: Migrate to PHYLINK and PCS_LYNX")
---
 drivers/net/ethernet/freescale/enetc/enetc_pf.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/ethernet/freescale/enetc/enetc_pf.c +3 -2
index 06514af0df106..796e3d6f23f09 100644
@@ -1164,14 +1164,15 @@ static void enetc_pf_remove(struct pci_dev *pdev)
 	struct enetc_ndev_priv *priv;
 
 	priv = netdev_priv(si->ndev);
-	enetc_phylink_destroy(priv);
-	enetc_mdiobus_destroy(pf);
 
 	if (pf->num_vfs)
 		enetc_sriov_configure(pdev, 0);
 
 	unregister_netdev(si->ndev);
 
+	enetc_phylink_destroy(priv);
+	enetc_mdiobus_destroy(pf);
+
 	enetc_free_msix(priv);
 
 	enetc_free_si_resources(priv);
Signature · 1 line
2.27.0
author maintainer
#136 lore raw

PATCH 136/663 tty: convert tty_ldisc_ops read() function to take a kernel pointer

In reply to Greg Kroah-Hartman

From: Linus Torvalds <[email protected]>

[ Upstream commit 3b830a9c34d5897be07176ce4e6f2d75e2c8cfd7 ]

The tty line discipline .read() function was passed the final user pointer destination as an argument, which doesn't match the 'write()' function, and makes it very inconvenient to do a splice method for ttys.

This is a conversion to use a kernel buffer instead.

NOTE! It does this by passing the tty line discipline ->read() function an additional "cookie" to fill in, and an offset into the cookie data.

The line discipline can fill in the cookie data with its own private information, and then the reader will repeat the read until either the cookie is cleared or it runs out of data.

The only real user of this is N_HDLC, which can use this to handle big packets, even if the kernel buffer is smaller than the whole packet.

Cc Christoph Hellwig <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Al Viro <[email protected]>
---
 drivers/bluetooth/hci_ldisc.c | 34 +++++++--------
 drivers/input/serio/serport.c |  4 +-
 drivers/net/ppp/ppp_async.c   |  3 +-
 drivers/net/ppp/ppp_synctty.c |  3 +-
 drivers/tty/n_gsm.c           |  3 +-
 drivers/tty/n_hdlc.c          | 60 +++++++++++++++++--------
 drivers/tty/n_null.c          |  3 +-
 drivers/tty/n_r3964.c         | 10 ++---
 drivers/tty/n_tracerouter.c   |  4 +-
 drivers/tty/n_tracesink.c     |  4 +-
 drivers/tty/n_tty.c           | 82 +++++++++++++++--------------------
 drivers/tty/tty_io.c          | 64 +++++++++++++++++++++++++--
 include/linux/tty_ldisc.h     |  3 +-
 net/nfc/nci/uart.c            |  3 +-
 14 files changed, 178 insertions(+), 102 deletions(-)
drivers/bluetooth/hci_ldisc.c +17 -17
index 8be4d807d1370..637c5b8c2aa1a 100644
@@ -801,7 +801,8 @@ static int hci_uart_tty_ioctl(struct tty_struct *tty, struct file *file,
  * We don't provide read/write/poll interface for user space.
  */
 static ssize_t hci_uart_tty_read(struct tty_struct *tty, struct file *file,
-				 unsigned char __user *buf, size_t nr)
+				 unsigned char *buf, size_t nr,
+				 void **cookie, unsigned long offset)
 {
 	return 0;
 }
@@ -818,29 +819,28 @@ static __poll_t hci_uart_tty_poll(struct tty_struct *tty,
 	return 0;
 }
 
+static struct tty_ldisc_ops hci_uart_ldisc = {
+	.owner		= THIS_MODULE,
+	.magic		= TTY_LDISC_MAGIC,
+	.name		= "n_hci",
+	.open		= hci_uart_tty_open,
+	.close		= hci_uart_tty_close,
+	.read		= hci_uart_tty_read,
+	.write		= hci_uart_tty_write,
+	.ioctl		= hci_uart_tty_ioctl,
+	.compat_ioctl	= hci_uart_tty_ioctl,
+	.poll		= hci_uart_tty_poll,
+	.receive_buf	= hci_uart_tty_receive,
+	.write_wakeup	= hci_uart_tty_wakeup,
+};
+
 static int __init hci_uart_init(void)
 {
-	static struct tty_ldisc_ops hci_uart_ldisc;
 	int err;
 
 	BT_INFO("HCI UART driver ver %s", VERSION);
 
 	/* Register the tty discipline */
-
-	memset(&hci_uart_ldisc, 0, sizeof(hci_uart_ldisc));
-	hci_uart_ldisc.magic		= TTY_LDISC_MAGIC;
-	hci_uart_ldisc.name		= "n_hci";
-	hci_uart_ldisc.open		= hci_uart_tty_open;
-	hci_uart_ldisc.close		= hci_uart_tty_close;
-	hci_uart_ldisc.read		= hci_uart_tty_read;
-	hci_uart_ldisc.write		= hci_uart_tty_write;
-	hci_uart_ldisc.ioctl		= hci_uart_tty_ioctl;
-	hci_uart_ldisc.compat_ioctl	= hci_uart_tty_ioctl;
-	hci_uart_ldisc.poll		= hci_uart_tty_poll;
-	hci_uart_ldisc.receive_buf	= hci_uart_tty_receive;
-	hci_uart_ldisc.write_wakeup	= hci_uart_tty_wakeup;
-	hci_uart_ldisc.owner		= THIS_MODULE;
-
 	err = tty_register_ldisc(N_HCI, &hci_uart_ldisc);
 	if (err) {
 		BT_ERR("HCI line discipline registration failed. (%d)", err);
drivers/input/serio/serport.c +3 -1
index 8ac970a423de6..33e9d9bfd036f 100644
@@ -156,7 +156,9 @@ out:
  * returning 0 characters.
  */
 
-static ssize_t serport_ldisc_read(struct tty_struct * tty, struct file * file, unsigned char __user * buf, size_t nr)
+static ssize_t serport_ldisc_read(struct tty_struct * tty, struct file * file,
+				  unsigned char *kbuf, size_t nr,
+				  void **cookie, unsigned long offset)
 {
 	struct serport *serport = (struct serport*) tty->disc_data;
 	struct serio *serio;
drivers/net/ppp/ppp_async.c +2 -1
index 29a0917a81e60..f14a9d190de91 100644
@@ -259,7 +259,8 @@ static int ppp_asynctty_hangup(struct tty_struct *tty)
  */
 static ssize_t
 ppp_asynctty_read(struct tty_struct *tty, struct file *file,
-		  unsigned char __user *buf, size_t count)
+		  unsigned char *buf, size_t count,
+		  void **cookie, unsigned long offset)
 {
 	return -EAGAIN;
 }
drivers/net/ppp/ppp_synctty.c +2 -1
index 0f338752c38b9..f774b7e52da44 100644
@@ -257,7 +257,8 @@ static int ppp_sync_hangup(struct tty_struct *tty)
  */
 static ssize_t
 ppp_sync_read(struct tty_struct *tty, struct file *file,
-	       unsigned char __user *buf, size_t count)
+	      unsigned char *buf, size_t count,
+	      void **cookie, unsigned long offset)
 {
 	return -EAGAIN;
 }
drivers/tty/n_gsm.c +2 -1
index 25f3152089c2a..fea1eeac5b907 100644
@@ -2557,7 +2557,8 @@ static void gsmld_write_wakeup(struct tty_struct *tty)
  */
 
 static ssize_t gsmld_read(struct tty_struct *tty, struct file *file,
-			 unsigned char __user *buf, size_t nr)
+			  unsigned char *buf, size_t nr,
+			  void **cookie, unsigned long offset)
 {
 	return -EOPNOTSUPP;
 }
drivers/tty/n_hdlc.c +41 -19

85 lines not on this page · raw message

drivers/tty/n_null.c +2 -1
index 96feabae47407..ce03ae78f5c6a 100644
@@ -20,7 +20,8 @@ static void n_null_close(struct tty_struct *tty)
 }
 
 static ssize_t n_null_read(struct tty_struct *tty, struct file *file,
-			   unsigned char __user * buf, size_t nr)
+			   unsigned char *buf, size_t nr,
+			   void **cookie, unsigned long offset)
 {
 	return -EOPNOTSUPP;
 }
drivers/tty/n_r3964.c +4 -6
index 934dd2fb2ec80..3161f0a535e37 100644
@@ -129,7 +129,7 @@ static void remove_client_block(struct r3964_info *pInfo,
 static int r3964_open(struct tty_struct *tty);
 static void r3964_close(struct tty_struct *tty);
 static ssize_t r3964_read(struct tty_struct *tty, struct file *file,
-		unsigned char __user * buf, size_t nr);
+		void *cookie, unsigned char *buf, size_t nr);
 static ssize_t r3964_write(struct tty_struct *tty, struct file *file,
 		const unsigned char *buf, size_t nr);
 static int r3964_ioctl(struct tty_struct *tty, struct file *file,
@@ -1058,7 +1058,8 @@ static void r3964_close(struct tty_struct *tty)
 }
 
 static ssize_t r3964_read(struct tty_struct *tty, struct file *file,
-			  unsigned char __user * buf, size_t nr)
+			  unsigned char *kbuf, size_t nr,
+			  void **cookie, unsigned long offset)
 {
 	struct r3964_info *pInfo = tty->disc_data;
 	struct r3964_client_info *pClient;
@@ -1109,10 +1110,7 @@ static ssize_t r3964_read(struct tty_struct *tty, struct file *file,
 		kfree(pMsg);
 		TRACE_M("r3964_read - msg kfree %p", pMsg);
 
-		if (copy_to_user(buf, &theMsg, ret)) {
-			ret = -EFAULT;
-			goto unlock;
-		}
+		memcpy(kbuf, &theMsg, ret);
 
 		TRACE_PS("read - return %d", ret);
 		goto unlock;
drivers/tty/n_tracerouter.c +3 -1
index 4479af4d2fa5c..3490ed51b1a3c 100644
@@ -118,7 +118,9 @@ static void n_tracerouter_close(struct tty_struct *tty)
  *	 -EINVAL
  */
 static ssize_t n_tracerouter_read(struct tty_struct *tty, struct file *file,
-				  unsigned char __user *buf, size_t nr) {
+				  unsigned char *buf, size_t nr,
+				  void **cookie, unsigned long offset)
+{
 	return -EINVAL;
 }
 
drivers/tty/n_tracesink.c +3 -1
index d96ba82cc3569..1d9931041fd8b 100644
@@ -115,7 +115,9 @@ static void n_tracesink_close(struct tty_struct *tty)
  *	 -EINVAL
  */
 static ssize_t n_tracesink_read(struct tty_struct *tty, struct file *file,
-				unsigned char __user *buf, size_t nr) {
+				unsigned char *buf, size_t nr,
+				void **cookie, unsigned long offset)
+{
 	return -EINVAL;
 }
 
drivers/tty/n_tty.c +34 -48

202 lines not on this page · raw message

drivers/tty/tty_io.c +61 -3

77 lines not on this page · raw message

include/linux/tty_ldisc.h +2 -1
index b1e6043e99175..572a079761165 100644
@@ -185,7 +185,8 @@ struct tty_ldisc_ops {
 	void	(*close)(struct tty_struct *);
 	void	(*flush_buffer)(struct tty_struct *tty);
 	ssize_t	(*read)(struct tty_struct *tty, struct file *file,
-			unsigned char __user *buf, size_t nr);
+			unsigned char *buf, size_t nr,
+			void **cookie, unsigned long offset);
 	ssize_t	(*write)(struct tty_struct *tty, struct file *file,
 			 const unsigned char *buf, size_t nr);
 	int	(*ioctl)(struct tty_struct *tty, struct file *file,
net/nfc/nci/uart.c +2 -1
index 11b554ce07ffc..1204c438e87dc 100644
@@ -292,7 +292,8 @@ static int nci_uart_tty_ioctl(struct tty_struct *tty, struct file *file,
 
 /* We don't provide read/write/poll interface for user space. */
 static ssize_t nci_uart_tty_read(struct tty_struct *tty, struct file *file,
-				 unsigned char __user *buf, size_t nr)
+				 unsigned char *buf, size_t nr,
+				 void **cookie, unsigned long offset)
 {
 	return 0;
 }
Signature · 1 line
2.27.0
author maintainer
#137 lore raw

PATCH 137/663 tty: implement read_iter

In reply to Greg Kroah-Hartman

From: Linus Torvalds <[email protected]>

[ Upstream commit dd78b0c483e33225e0e0782b0ed887129b00f956 ]

Now that the ldisc read() function takes kernel pointers, it's fairly straightforward to make the tty file operations use .read_iter() instead of .read().

That automatically gives us vread() and friends, and also makes it possible to do .splice_read() on ttys again.

Fixes 36e2c7421f02 ("fs: don't allow splice read/write without explicit ops")
Cc Christoph Hellwig <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Al Viro <[email protected]>
---
 drivers/tty/tty_io.c | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)
drivers/tty/tty_io.c +18 -18
index a50c8a4318228..3f55fe7293f31 100644
@@ -142,7 +142,7 @@ LIST_HEAD(tty_drivers);			/* linked list of tty drivers */
 /* Mutex to protect creating and releasing a tty */
 DEFINE_MUTEX(tty_mutex);
 
-static ssize_t tty_read(struct file *, char __user *, size_t, loff_t *);
+static ssize_t tty_read(struct kiocb *, struct iov_iter *);
 static ssize_t tty_write(struct kiocb *, struct iov_iter *);
 static __poll_t tty_poll(struct file *, poll_table *);
 static int tty_open(struct inode *, struct file *);
@@ -473,8 +473,9 @@ static void tty_show_fdinfo(struct seq_file *m, struct file *file)
 
 static const struct file_operations tty_fops = {
 	.llseek		= no_llseek,
-	.read		= tty_read,
+	.read_iter	= tty_read,
 	.write_iter	= tty_write,
+	.splice_read	= generic_file_splice_read,
 	.splice_write	= iter_file_splice_write,
 	.poll		= tty_poll,
 	.unlocked_ioctl	= tty_ioctl,
@@ -487,8 +488,9 @@ static const struct file_operations tty_fops = {
 
 static const struct file_operations console_fops = {
 	.llseek		= no_llseek,
-	.read		= tty_read,
+	.read_iter	= tty_read,
 	.write_iter	= redirected_tty_write,
+	.splice_read	= generic_file_splice_read,
 	.splice_write	= iter_file_splice_write,
 	.poll		= tty_poll,
 	.unlocked_ioctl	= tty_ioctl,
@@ -841,16 +843,17 @@ static void tty_update_time(struct timespec64 *time)
  * data or clears the cookie. The cookie may be something that the
  * ldisc maintains state for and needs to free.
  */
-static int iterate_tty_read(struct tty_ldisc *ld, struct tty_struct *tty, struct file *file,
-		char __user *buf, size_t count)
+static int iterate_tty_read(struct tty_ldisc *ld, struct tty_struct *tty,
+		struct file *file, struct iov_iter *to)
 {
 	int retval = 0;
 	void *cookie = NULL;
 	unsigned long offset = 0;
 	char kernel_buf[64];
+	size_t count = iov_iter_count(to);
 
 	do {
-		int size, uncopied;
+		int size, copied;
 
 		size = count > sizeof(kernel_buf) ? sizeof(kernel_buf) : count;
 		size = ld->ops->read(tty, file, kernel_buf, size, &cookie, offset);
@@ -866,10 +869,9 @@ static int iterate_tty_read(struct tty_ldisc *ld, struct tty_struct *tty, struct
 			return size;
 		}
 
-		uncopied = copy_to_user(buf+offset, kernel_buf, size);
-		size -= uncopied;
-		offset += size;
-		count -= size;
+		copied = copy_to_iter(kernel_buf, size, to);
+		offset += copied;
+		count -= copied;
 
 		/*
 		 * If the user copy failed, we still need to do another ->read()
@@ -877,7 +879,7 @@ static int iterate_tty_read(struct tty_ldisc *ld, struct tty_struct *tty, struct
 		 *
 		 * But make sure size is zeroed.
 		 */
-		if (unlikely(uncopied)) {
+		if (unlikely(copied != size)) {
 			count = 0;
 			retval = -EFAULT;
 		}
@@ -904,10 +906,10 @@ static int iterate_tty_read(struct tty_ldisc *ld, struct tty_struct *tty, struct
  *	read calls may be outstanding in parallel.
  */
 
-static ssize_t tty_read(struct file *file, char __user *buf, size_t count,
-			loff_t *ppos)
+static ssize_t tty_read(struct kiocb *iocb, struct iov_iter *to)
 {
 	int i;
+	struct file *file = iocb->ki_filp;
 	struct inode *inode = file_inode(file);
 	struct tty_struct *tty = file_tty(file);
 	struct tty_ldisc *ld;
@@ -920,11 +922,9 @@ static ssize_t tty_read(struct file *file, char __user *buf, size_t count,
 	/* We want to wait for the line discipline to sort out in this
 	   situation */
 	ld = tty_ldisc_ref_wait(tty);
-	if (!ld)
-		return hung_up_tty_read(file, buf, count, ppos);
 	i = -EIO;
-	if (ld->ops->read)
-		i = iterate_tty_read(ld, tty, file, buf, count);
+	if (ld && ld->ops->read)
+		i = iterate_tty_read(ld, tty, file, to);
 	tty_ldisc_deref(ld);
 
 	if (i > 0)
@@ -2943,7 +2943,7 @@ static long tty_compat_ioctl(struct file *file, unsigned int cmd,
 
 static int this_tty(const void *t, struct file *file, unsigned fd)
 {
-	if (likely(file->f_op->read != tty_read))
+	if (likely(file->f_op->read_iter != tty_read))
 		return 0;
 	return file_tty(file) != t ? 0 : fd + 1;
 }
Signature · 1 line
2.27.0
author maintainer
#138 lore raw

PATCH 138/663 fbdev: aty: SPARC64 requires FB_ATY_CT

In reply to Greg Kroah-Hartman

From: Randy Dunlap <[email protected]>

[ Upstream commit c6c90c70db4d9a0989111d6b994d545659410f7a ]

It looks like SPARC64 requires FB_ATY_CT to build without errors, so have FB_ATY select FB_ATY_CT if both SPARC64 and PCI are enabled instead of using "default y if SPARC64 && PCI", which is not strong enough to prevent build errors.

As it currently is, FB_ATY_CT can be disabled, resulting in build errors:

ERROR: modpost: "aty_postdividers" [drivers/video/fbdev/aty/atyfb.ko] undefined!
ERROR: modpost: "aty_ld_pll_ct" [drivers/video/fbdev/aty/atyfb.ko] undefined!

Fixes f7018c213502 ("video: move fbdev to drivers/video/fbdev")
Cc "David S. Miller" <[email protected]>
Cc Tomi Valkeinen <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc David Airlie <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
---
 drivers/video/fbdev/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/Kconfig +1 -1
index cfb7f5612ef0f..4f02db65dedec 100644
@@ -1269,6 +1269,7 @@ config FB_ATY
 	select FB_CFB_IMAGEBLIT
 	select FB_BACKLIGHT if FB_ATY_BACKLIGHT
 	select FB_MACMODES if PPC
+	select FB_ATY_CT if SPARC64 && PCI
 	help
 	  This driver supports graphics boards with the ATI Mach64 chips.
 	  Say Y if you have such a graphics board.
@@ -1279,7 +1280,6 @@ config FB_ATY
 config FB_ATY_CT
 	bool "Mach64 CT/VT/GT/LT (incl. 3D RAGE) support"
 	depends on PCI && FB_ATY
-	default y if SPARC64 && PCI
 	help
 	  Say Y here to support use of ATI's 64-bit Rage boards (or other
 	  boards based on the Mach64 CT, VT, GT, and LT chipsets) as a
Signature · 1 line
2.27.0
author maintainer
#139 lore raw

PATCH 139/663 drm/gma500: Fix error return code in psb_driver_load()

In reply to Greg Kroah-Hartman

From: Jialin Zhang <[email protected]>

[ Upstream commit 6926872ae24452d4f2176a3ba2dee659497de2c4 ]

Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.

---
 drivers/gpu/drm/gma500/psb_drv.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/gma500/psb_drv.c +2 -0
index 34b4aae9a15e3..074f403d7ca07 100644
@@ -313,6 +313,8 @@ static int psb_driver_load(struct drm_device *dev, unsigned long flags)
 	if (ret)
 		goto out_err;
 
+	ret = -ENOMEM;
+
 	dev_priv->mmu = psb_mmu_driver_init(dev, 1, 0, 0);
 	if (!dev_priv->mmu)
 		goto out_err;
Signature · 1 line
2.27.0
author maintainer
#140 lore raw

PATCH 140/663 gma500: clean up error handling in init

In reply to Greg Kroah-Hartman

From: Dan Carpenter <[email protected]>

[ Upstream commit 15ccc39b3aab667c6fa131206f01f31bfbccdf6a ]

The main problem with this error handling was that it didn't clean up if i2c_add_numbered_adapter() failed. This code is pretty old, and doesn't match with today's checkpatch.pl standards so I took the opportunity to tidy it up a bit. I changed the NULL comparison, and removed the WARNING message if kzalloc() fails and updated the label names.

---
 drivers/gpu/drm/gma500/oaktrail_hdmi_i2c.c | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)
drivers/gpu/drm/gma500/oaktrail_hdmi_i2c.c +13 -9
index e281070611480..fc9a34ed58bd1 100644
@@ -279,11 +279,8 @@ int oaktrail_hdmi_i2c_init(struct pci_dev *dev)
 	hdmi_dev = pci_get_drvdata(dev);
 
 	i2c_dev = kzalloc(sizeof(struct hdmi_i2c_dev), GFP_KERNEL);
-	if (i2c_dev == NULL) {
-		DRM_ERROR("Can't allocate interface\n");
-		ret = -ENOMEM;
-		goto exit;
-	}
+	if (!i2c_dev)
+		return -ENOMEM;
 
 	i2c_dev->adap = &oaktrail_hdmi_i2c_adapter;
 	i2c_dev->status = I2C_STAT_INIT;
@@ -300,16 +297,23 @@ int oaktrail_hdmi_i2c_init(struct pci_dev *dev)
 			  oaktrail_hdmi_i2c_adapter.name, hdmi_dev);
 	if (ret) {
 		DRM_ERROR("Failed to request IRQ for I2C controller\n");
-		goto err;
+		goto free_dev;
 	}
 
 	/* Adapter registration */
 	ret = i2c_add_numbered_adapter(&oaktrail_hdmi_i2c_adapter);
-	return ret;
+	if (ret) {
+		DRM_ERROR("Failed to add I2C adapter\n");
+		goto free_irq;
+	}
 
-err:
+	return 0;
+
+free_irq:
+	free_irq(dev->irq, hdmi_dev);
+free_dev:
 	kfree(i2c_dev);
-exit:
+
 	return ret;
 }
 
Signature · 1 line
2.27.0
author maintainer
#141 lore raw

PATCH 141/663 drm/fb-helper: Add missed unlocks in setcmap_legacy()

In reply to Greg Kroah-Hartman

From: Chuhong Yuan <[email protected]>

[ Upstream commit 0a260e731d6c4c17547ac275a2cde888a9eb4a3d ]

setcmap_legacy() does not call drm_modeset_unlock_all() in some exits, add the missed unlocks with goto to fix it.

Fixes 964c60063bff ("drm/fb-helper: separate the fb_setcmap helper into atomic and legacy paths")
---
 drivers/gpu/drm/drm_fb_helper.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/gpu/drm/drm_fb_helper.c +10 -5
index 1543d9d109705..8033467db4bee 100644
@@ -923,11 +923,15 @@ static int setcmap_legacy(struct fb_cmap *cmap, struct fb_info *info)
 	drm_modeset_lock_all(fb_helper->dev);
 	drm_client_for_each_modeset(modeset, &fb_helper->client) {
 		crtc = modeset->crtc;
-		if (!crtc->funcs->gamma_set || !crtc->gamma_size)
-			return -EINVAL;
+		if (!crtc->funcs->gamma_set || !crtc->gamma_size) {
+			ret = -EINVAL;
+			goto out;
+		}
 
-		if (cmap->start + cmap->len > crtc->gamma_size)
-			return -EINVAL;
+		if (cmap->start + cmap->len > crtc->gamma_size) {
+			ret = -EINVAL;
+			goto out;
+		}
 
 		r = crtc->gamma_store;
 		g = r + crtc->gamma_size;
@@ -940,8 +944,9 @@ static int setcmap_legacy(struct fb_cmap *cmap, struct fb_info *info)
 		ret = crtc->funcs->gamma_set(crtc, r, g, b,
 					     crtc->gamma_size, NULL);
 		if (ret)
-			return ret;
+			goto out;
 	}
+out:
 	drm_modeset_unlock_all(fb_helper->dev);
 
 	return ret;
Signature · 1 line
2.27.0
author maintainer
#142 lore raw

PATCH 142/663 drm/panel: mantix: Tweak init sequence

In reply to Greg Kroah-Hartman

From: Guido Günther <[email protected]>

[ Upstream commit dd396dbc4d7811c1567cc43faa4b9ad68094c44d ]

We've seen some (non permanent) burn in and bad white balance on some of the panels. Adding this bit from a vendor supplied sequence fixes it.

---
 drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c +5 -0
index 0c5f22e95c2db..624d17b96a693 100644
@@ -22,6 +22,7 @@
 /* Manufacturer specific Commands send via DSI */
 #define MANTIX_CMD_OTP_STOP_RELOAD_MIPI 0x41
 #define MANTIX_CMD_INT_CANCEL           0x4C
+#define MANTIX_CMD_SPI_FINISH           0x90
 
 struct mantix {
 	struct device *dev;
@@ -66,6 +67,10 @@ static int mantix_init_sequence(struct mantix *ctx)
 	dsi_generic_write_seq(dsi, 0x80, 0x64, 0x00, 0x64, 0x00, 0x00);
 	msleep(20);
 
+	dsi_generic_write_seq(dsi, MANTIX_CMD_SPI_FINISH, 0xA5);
+	dsi_generic_write_seq(dsi, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x00, 0x2F);
+	msleep(20);
+
 	dev_dbg(dev, "Panel init sequence done\n");
 	return 0;
 }
Signature · 1 line
2.27.0
author maintainer
#143 lore raw

PATCH 143/663 drm/vc4: hdmi: Take into account the clock doubling flag in atomic_check

In reply to Greg Kroah-Hartman

From: Maxime Ripard <[email protected]>

[ Upstream commit 320e84dc6111ecc1c957e2b186d4d2bafee6bde2 ]

Commit 63495f6b4aed ("drm/vc4: hdmi: Make sure our clock rate is within limits") was intended to compute the pixel rate to make sure we remain within the boundaries of what the hardware can provide.

However, unlike what mode_valid was checking for, we forgot to take into account the clock doubling flag that can be set for modes. Let's honor that flag if it's there.

---
 drivers/gpu/drm/vc4/vc4_hdmi.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/vc4/vc4_hdmi.c +3 -0
index eaba98e15de46..db06f52de9d91 100644
@@ -791,6 +791,9 @@ static int vc4_hdmi_encoder_atomic_check(struct drm_encoder *encoder,
 		pixel_rate = mode->clock * 1000;
 	}
 
+	if (mode->flags & DRM_MODE_FLAG_DBLCLK)
+		pixel_rate = pixel_rate * 2;
+
 	if (pixel_rate > vc4_hdmi->variant->max_pixel_clock)
 		return -EINVAL;
 
Signature · 1 line
2.27.0
author maintainer
#144 lore raw

PATCH 144/663 crypto: sun4i-ss - linearize buffers content must be kept

In reply to Greg Kroah-Hartman

From: Corentin Labbe <[email protected]>

[ Upstream commit 583513510a7acd2306787865bcd19ebb2f629d42 ]

When running the non-optimized cipher function, SS produce partial random output.
This is due to linearize buffers being reseted after each loop.

For preserving stack, instead of moving them back to start of function, I move them in sun4i_ss_ctx.

Fixes 8d3bcb9900ca ("crypto: sun4i-ss - reduce stack usage")
---
 drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c | 12 ++++--------
 drivers/crypto/allwinner/sun4i-ss/sun4i-ss.h        |  2 ++
 2 files changed, 6 insertions(+), 8 deletions(-)
drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c +4 -8
index b72de8939497b..19f1aa577ed4d 100644
@@ -233,8 +233,6 @@ static int sun4i_ss_cipher_poll(struct skcipher_request *areq)
 
 	while (oleft) {
 		if (ileft) {
-			char buf[4 * SS_RX_MAX];/* buffer for linearize SG src */
-
 			/*
 			 * todo is the number of consecutive 4byte word that we
 			 * can read from current SG
@@ -256,12 +254,12 @@ static int sun4i_ss_cipher_poll(struct skcipher_request *areq)
 				 */
 				todo = min(rx_cnt * 4 - ob, ileft);
 				todo = min_t(size_t, todo, mi.length - oi);
-				memcpy(buf + ob, mi.addr + oi, todo);
+				memcpy(ss->buf + ob, mi.addr + oi, todo);
 				ileft -= todo;
 				oi += todo;
 				ob += todo;
 				if (!(ob % 4)) {
-					writesl(ss->base + SS_RXFIFO, buf,
+					writesl(ss->base + SS_RXFIFO, ss->buf,
 						ob / 4);
 					ob = 0;
 				}
@@ -295,13 +293,11 @@ static int sun4i_ss_cipher_poll(struct skcipher_request *areq)
 				oo = 0;
 			}
 		} else {
-			char bufo[4 * SS_TX_MAX]; /* buffer for linearize SG dst */
-
 			/*
 			 * read obl bytes in bufo, we read at maximum for
 			 * emptying the device
 			 */
-			readsl(ss->base + SS_TXFIFO, bufo, tx_cnt);
+			readsl(ss->base + SS_TXFIFO, ss->bufo, tx_cnt);
 			obl = tx_cnt * 4;
 			obo = 0;
 			do {
@@ -313,7 +309,7 @@ static int sun4i_ss_cipher_poll(struct skcipher_request *areq)
 				 */
 				todo = min_t(size_t,
 					     mo.length - oo, obl - obo);
-				memcpy(mo.addr + oo, bufo + obo, todo);
+				memcpy(mo.addr + oo, ss->bufo + obo, todo);
 				oleft -= todo;
 				obo += todo;
 				oo += todo;
drivers/crypto/allwinner/sun4i-ss/sun4i-ss.h +2 -0
index 163962f9e2845..02105b39fbfec 100644
@@ -148,6 +148,8 @@ struct sun4i_ss_ctx {
 	struct reset_control *reset;
 	struct device *dev;
 	struct resource *res;
+	char buf[4 * SS_RX_MAX];/* buffer for linearize SG src */
+	char bufo[4 * SS_TX_MAX]; /* buffer for linearize SG dst */
 	spinlock_t slock; /* control the use of the device */
 #ifdef CONFIG_CRYPTO_DEV_SUN4I_SS_PRNG
 	u32 seed[SS_SEED_LEN / BITS_PER_LONG];
Signature · 1 line
2.27.0