Skip to contentSkip to conversation

5.13.2-rc1 review

PATCH In review Greg Kroah-Hartman 16 participants 841 messages Jul 12, 2021 – Jul 28, 2021 Page 1 of 6

Subsystems (8)
lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

cover 5.13.2-rc1 review

This is the start of the stable review cycle for the 5.13.2 release. There are 800 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, 14 Jul 2021 06:02:46 +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.13.2-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.13.y
and the diffstat can be found below.

thanks,

greg k-h

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

Greg Kroah-Hartman <[email protected]>

    Linux 5.13.2-rc1

Quat Le <[email protected]>
scsi: core: Retry I/O for Notify (Enable Spinup) Required error

Mauro Carvalho Chehab <[email protected]>
media: exynos4-is: remove a now unused integer

Johan Hovold <[email protected]>
mmc: vub3000: fix control-request direction

Bean Huo <[email protected]>
mmc: block: Disable CMDQ on the ioctl path

Jens Axboe <[email protected]>
io_uring: add IOPOLL and reserved field checks to IORING_OP_UNLINKAT

Jens Axboe <[email protected]>
io_uring: add IOPOLL and reserved field checks to IORING_OP_RENAMEAT

Pavel Begunkov <[email protected]>
io_uring: fix blocking inline submission

Long Li <[email protected]>
block: return the correct bvec when checking for gaps

Wei Yongjun <[email protected]>
erofs: fix error return code in erofs_read_superblock()

Jarkko Sakkinen <[email protected]>
tpm: Replace WARN_ONCE() with dev_err_once() in tpm_tis_status()

Eric Biggers <[email protected]>
fscrypt: fix derivation of SipHash keys on big endian CPUs

Eric Biggers <[email protected]>
fscrypt: don't ignore minor_hash when hash is 0

Sibi Sankar <[email protected]>
mailbox: qcom-ipcc: Fix IPCC mbox channel exhaustion

Javed Hasan <[email protected]>
scsi: libfc: Correct the condition check and invalid argument passed

James Smart <[email protected]>
scsi: lpfc: Fix Node recovery when driver is handling simultaneous PLOGIs

James Smart <[email protected]>
scsi: lpfc: Fix unreleased RPIs when NPIV ports are created

Varun Prakash <[email protected]>
scsi: target: cxgbit: Unmap DMA buffer before calling target_execute_cmd()

Javed Hasan <[email protected]>
scsi: fc: Correct RHBA attributes length

Chandrakanth Patil <[email protected]>
scsi: megaraid_sas: Send all non-RW I/Os for TYPE_ENCLOSURE device through firmware

Namjae Jeon <[email protected]>
exfat: handle wrong stream entry size in exfat_readdir()

Guo Ren <[email protected]>
csky: syscache: Fixup duplicate cache flush

Chris Packham <[email protected]>
i2c: mpc: Restore reread of I2C status register

Arnaldo Carvalho de Melo <[email protected]>
perf llvm: Return -ENOMEM when asprintf() fails

Dave Hansen <[email protected]>
selftests/vm/pkeys: refill shadow register after implicit kernel write

Dave Hansen <[email protected]>
selftests/vm/pkeys: handle negative sys_pkey_alloc() return code

Dave Hansen <[email protected]>
selftests/vm/pkeys: fix alloc_random_pkey() to make it really, really random

Trent Piepho <[email protected]>
lib/math/rational.c: fix divide by zero

Marco Elver <[email protected]>
kfence: unconditionally use unbound work queue

Miaohe Lin <[email protected]>
mm/zswap.c: fix two bugs in zswap_writeback_entry()

Muchun Song <[email protected]>
mm: migrate: fix missing update page_private to hugetlb_page_subpool

Miaohe Lin <[email protected]>
mm/z3fold: use release_z3fold_page_locked() to release locked z3fold page

Miaohe Lin <[email protected]>
mm/z3fold: fix potential memory leak in z3fold_destroy_pool()

Mike Kravetz <[email protected]>
hugetlb: address ref count racing in prep_compound_gigantic_page

Mike Kravetz <[email protected]>
hugetlb: remove prep_compound_huge_page cleanup

Miaohe Lin <[email protected]>
mm/huge_memory.c: don't discard hugepage if other processes are mapping it

Miaohe Lin <[email protected]>
mm/huge_memory.c: add missing read-only THP checking in transparent_hugepage_enabled()

Miaohe Lin <[email protected]>
mm/huge_memory.c: remove dedicated macro HPAGE_CACHE_INDEX_MASK

Alex Williamson <[email protected]>
vfio/pci: Handle concurrent vma faults

Nicholas Piggin <[email protected]>

    powerpc/64s/interrupt: preserve regs->softe for NMI interrupts

Nicholas Piggin <[email protected]>
powerpc/64s: fix hash page fault interrupt handler

Pali Rohár <[email protected]>
arm64: dts: marvell: armada-37xx: Fix reg for standard variant of UART

Pali Rohár <[email protected]>
serial: mvebu-uart: correctly calculate minimal possible baudrate

Pali Rohár <[email protected]>
serial: mvebu-uart: do not allow changing baudrate when uartclk is not available

Christophe JAILLET <[email protected]>
ALSA: firewire-lib: Fix 'amdtp_domain_start()' when no AMDTP_OUT_STREAM stream is found

Michael Ellerman <[email protected]>
powerpc: Fix is_kvm_guest() / kvm_para_available()

Vaibhav Jain <[email protected]>
powerpc/papr_scm: Make 'perf_stats' invisible if perf-stats unavailable

Nicholas Piggin <[email protected]>
powerpc/64s: Fix copy-paste data exposure into newly created tasks

Andy Shevchenko <[email protected]>
powerpc/papr_scm: Properly handle UUID types and API

Nicholas Piggin <[email protected]>
powerpc: Offline CPU in stop_this_cpu()

Vignesh Raghavendra <[email protected]>
serial: 8250: 8250_omap: Fix possible interrupt storm on K3 SoCs

Christophe JAILLET <[email protected]>
staging: rtl8723bs: Fix an error handling path

Dave Hansen <[email protected]>
selftests/sgx: remove checks for file execute permissions

Krzysztof Kozlowski <[email protected]>
selftests/ftrace: fix event-no-pid on 1-core machine

Christophe JAILLET <[email protected]>
leds: ktd2692: Fix an error handling path

Zhen Lei <[email protected]>
leds: as3645a: Fix error return code in as3645a_parse_node()

Shengjiu Wang <[email protected]>
ASoC: fsl_spdif: Fix unexpected interrupt after suspend

Kai Vehmanen <[email protected]>
ASoC: Intel: sof_sdw: use mach data for ADL RVP DMIC count

Vamshi Krishna Gopal <[email protected]>
ASoC: Intel: sof_sdw: add quirk support for Brya and BT-offload

Libin Yang <[email protected]>
ASoC: Intel: sof_sdw: add SOF_RT715_DAI_ID_FIX for AlderLake

Chung-Chiang Cheng <[email protected]>
configfs: fix memleak in configfs_release_bin_file

Shengjiu Wang <[email protected]>
ASoC: fsl_xcvr: disable all interrupts when suspend happens

Codrin Ciubotariu <[email protected]>
ASoC: atmel-i2s: Fix usage of capture and playback at the same time

Codrin Ciubotariu <[email protected]>
ASoC: atmel-i2s: Set symmetric sample bits

Nicholas Piggin <[email protected]>
powerpc/powernv: Fix machine check reporting of async store errors

Marek Szyprowski <[email protected]>
extcon: max8997: Add missing modalias string

Stephan Gerhold <[email protected]>
extcon: sm5502: Drop invalid register write in sm5502_reg_data

Christophe JAILLET <[email protected]>
phy: ti: dm816x: Fix the error handling path in 'dm816x_usb_phy_probe()

Kunihiko Hayashi <[email protected]>
phy: uniphier-pcie: Fix updating phy parameters

Richard Fitzgerald <[email protected]>
soundwire: stream: Fix test for DP prepare complete

Zhen Lei <[email protected]>
scsi: mpt3sas: Fix error return value in _scsih_expander_add()

Christophe JAILLET <[email protected]>
habanalabs: Fix an error handling path in 'hl_pci_probe()'

Yang Yingliang <[email protected]>
mtd: rawnand: marvell: add missing clk_disable_unprepare() on error in marvell_nfc_resume()

Geert Uytterhoeven <[email protected]>
of: Fix truncation of memory sizes on 32-bit platforms

Richard Fitzgerald <[email protected]>
ASoC: cs42l42: Correct definition of CS42L42_ADC_PDN_MASK

Jonathan Cameron <[email protected]>
iio: prox: isl29501: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: light: vcnl4035: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Maciej W. Rozycki <[email protected]>
serial: 8250: Actually allow UPF_MAGIC_MULTIPLIER baud rates

Dmitry Osipenko <[email protected]>
usb: phy: tegra: Correct definition of B_SESS_VLD_WAKEUP_EN bit

Dmitry Osipenko <[email protected]>
usb: phy: tegra: Wait for VBUS wakeup status deassertion on suspend

Sergio Paracuellos <[email protected]>
staging: mt7621-dts: fix pci address for PCI memory range

Junhao He <[email protected]>
coresight: core: Fix use of uninitialized pointer

Pavel Skripkin <[email protected]>
staging: rtl8712: fix memory leak in rtl871x_load_fw_cb

Pavel Skripkin <[email protected]>
staging: rtl8712: fix error handling in r871xu_drv_init

Dan Carpenter <[email protected]>
staging: gdm724x: check for overflow in gdm_lte_netif_rx()

Dan Carpenter <[email protected]>
staging: gdm724x: check for buffer overflow in gdm_lte_multi_sdu_pkt()

Shengjiu Wang <[email protected]>
ASoC: fsl_spdif: Fix error handler with pm_runtime_enable

Jonathan Cameron <[email protected]>
iio: light: vcnl4000: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: magn: rm3100: Fix alignment of buffer in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: adc: ti-ads8688: Fix alignment of buffer in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: adc: mxs-lradc: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: adc: hx711: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: adc: at91-sama5d2: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Wei Yongjun <[email protected]>
iio: dummy: Fix build error when CONFIG_IIO_TRIGGERED_BUFFER is not set

David Gow <[email protected]>
kunit: Fix result propagation for parameterised tests

Miquel Raynal <[email protected]>
mtd: spinand: Fix double counting of ECC stats

Mika Westerberg <[email protected]>

    thunderbolt: Bond lanes only when dual_link_port != NULL in alloc_dev_default()

Michael Walle <[email protected]>
mtd: spi-nor: otp: return -EROFS if region is read-only

Michael Walle <[email protected]>
mtd: spi-nor: otp: fix access to security registers in 4 byte mode

Andy Shevchenko <[email protected]>
eeprom: idt_89hpesx: Restore printing the unsupported fwnode name

Andy Shevchenko <[email protected]>

    eeprom: idt_89hpesx: Put fwnode in matching case during ->probe()

Clément Lassieur <[email protected]>
usb: dwc2: Don't reset the core after setting turnaround time

Andrew Gabbasov <[email protected]>
usb: gadget: f_fs: Fix setting of device and driver data cross-references

Christophe JAILLET <[email protected]>
ASoC: mediatek: mtk-btcvsd: Fix an error handling path in 'mtk_btcvsd_snd_probe()'

Bard Liao <[email protected]>
ASoC: rt711-sdca: handle mbq_regmap in rt711_sdca_io_init

Bard Liao <[email protected]>
ASoC: rt711-sdca-sdw: add readable for SDW_SDCA_CTL() registers

Bard Liao <[email protected]>
ASoC: rt5682-sdw: set regcache_cache_only false before reading RT5682_DEVICE_ID

Oder Chiou <[email protected]>
ASoC: rt5682: Fix a problem with error handling in the io init function of the soundwire

Jack Yu <[email protected]>
ASoC: rt715-sdca: fix clock stop prepare timeout issue

Pierre-Louis Bossart <[email protected]>
ASoC: rt715-sdw: use first_hw_init flag on resume

Pierre-Louis Bossart <[email protected]>
ASoC: rt715-sdca-sdw: use first_hw_init flag on resume

Pierre-Louis Bossart <[email protected]>
ASoC: rt711-sdw: use first_hw_init flag on resume

Pierre-Louis Bossart <[email protected]>
ASoC: rt711-sdca-sdw: use first_hw_init flag on resume

Pierre-Louis Bossart <[email protected]>
ASoC: rt700-sdw: use first_hw_init flag on resume

Pierre-Louis Bossart <[email protected]>
ASoC: rt5682-sdw: use first_hw_init flag on resume

Pierre-Louis Bossart <[email protected]>
ASoC: rt1316-sdw: use first_hw_init flag on resume

Pierre-Louis Bossart <[email protected]>
ASoC: rt1308-sdw: use first_hw_init flag on resume

Pierre-Louis Bossart <[email protected]>
ASoC: max98373-sdw: use first_hw_init flag on resume

Pierre-Louis Bossart <[email protected]>
ASoC: max98373-sdw: add missing memory allocation check

Srinath Mannam <[email protected]>
iommu/dma: Fix IOVA reserve dma ranges

Kees Cook <[email protected]>
selftests: splice: Adjust for handler fallback removal

Randy Dunlap <[email protected]>
s390: appldata depends on PROC_SYSCTL

Niklas Schnelle <[email protected]>
s390: enable HAVE_IOREMAP_PROT

Robin Murphy <[email protected]>
iommu/amd: Tidy up DMA ops init

Alexander Monakov <[email protected]>
iommu/amd: Fix extended features logging

Zhen Lei <[email protected]>
visorbus: fix error return code in visorchipset_init()

Joachim Fenkes <[email protected]>
fsi/sbefifo: Fix reset timeout

Joachim Fenkes <[email protected]>
fsi/sbefifo: Clean up correct FIFO when receiving reset request from SBE

Eddie James <[email protected]>
fsi: occ: Don't accept response from un-initialized OCC

Eddie James <[email protected]>
fsi: scom: Reset the FSI2PIB engine for any error

Colin Ian King <[email protected]>
fsi: core: Fix return of error values on failures

Andreas Kemnade <[email protected]>
mfd: rn5t618: Fix IRQ trigger by changing it to level mode

Andy Shevchenko <[email protected]>
mfd: Remove software node conditionally and locate at right place

Randy Dunlap <[email protected]>
mfd: mp2629: Select MFD_CORE to fix build error

Mike Christie <[email protected]>
scsi: iscsi: Flush block work before unblock

Mike Christie <[email protected]>
scsi: iscsi: Fix in-kernel conn failure handling

Mike Christie <[email protected]>
scsi: iscsi: Rel ref after iscsi_lookup_endpoint()

Mike Christie <[email protected]>
scsi: iscsi: Use system_unbound_wq for destroy_work

Mike Christie <[email protected]>
scsi: iscsi: Force immediate failure during shutdown

Mike Christie <[email protected]>
scsi: iscsi: Stop queueing during ep_disconnect

Randy Dunlap <[email protected]>
scsi: FlashPoint: Rename si_flags field

Andy Shevchenko <[email protected]>

    leds: lp50xx: Put fwnode in error case during ->probe()

Andy Shevchenko <[email protected]>
leds: lm3697: Don't spam logs when probe is deferred

Andy Shevchenko <[email protected]>

    leds: lm3692x: Put fwnode in any case during ->probe()

Andy Shevchenko <[email protected]>

    leds: lm36274: Put fwnode in error case during ->probe()

Andy Shevchenko <[email protected]>
leds: lm3532: select regmap I2C API

Andy Shevchenko <[email protected]>
leds: lgm-sso: Fix clock handling

Andy Shevchenko <[email protected]>
leds: class: The -ENOTSUPP should never be seen by user space

Christophe JAILLET <[email protected]>
tty: nozomi: Fix the error handling path of 'nozomi_card_init()'

Christophe JAILLET <[email protected]>
firmware: stratix10-svc: Fix a resource leak in an error handling path

Christophe JAILLET <[email protected]>
misc/pvpanic-mmio: Fix error handling in 'pvpanic_mmio_probe()'

Christophe JAILLET <[email protected]>
misc/pvpanic-pci: Fix error handling in 'pvpanic_pci_probe()'

Yu Kuai <[email protected]>
char: pcmcia: error out if 'num_bytes_read' is greater than 4 in set_protocol()

Dave Stevenson <[email protected]>
staging: mmal-vchiq: Fix incorrect static vchiq_instance.

Miquel Raynal <[email protected]>
mtd: rawnand: arasan: Ensure proper configuration for the asserted target

Ansuel Smith <[email protected]>
mtd: parsers: qcom: Fix leaking of partition name

Corentin Labbe <[email protected]>
mtd: partitions: redboot: seek fis-index-block in the right node

Adrian Hunter <[email protected]>
perf scripting python: Fix tuple_set_u64()

Zhen Lei <[email protected]>
Input: hil_kbd - fix error return code in hil_dev_connect()

Kuninori Morimoto <[email protected]>
ASoC: rsnd: tidyup loop on rsnd_adg_clk_query()

Badhri Jagan Sridharan <[email protected]>
usb: typec: tcpm: Fix up PR_SWAP when vsafe0v is signalled

Andy Shevchenko <[email protected]>

    backlight: lm3630a_bl: Put fwnode in error case during ->probe()

Yang Yingliang <[email protected]>
ASoC: hisilicon: fix missing clk_disable_unprepare() on error in hi6210_i2s_startup()

Yang Yingliang <[email protected]>
ASoC: rk3328: fix missing clk_disable_unprepare() on error in rk3328_platform_probe()

Jonathan Cameron <[email protected]>
iio: potentiostat: lmp91000: Fix alignment of buffer in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: cros_ec_sensors: Fix alignment of buffer in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: chemical: atlas: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: light: tcs3472: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: light: tcs3414: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: light: isl29125: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: magn: bmc150: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: magn: hmc5843: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: prox: as3935: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: prox: pulsed-light: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: prox: srf08: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: humidity: am2315: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: gyro: bmg160: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: adc: vf610: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: adc: ti-ads1015: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: accel: stk8ba50: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: accel: stk8312: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: accel: mxc4005: Fix overread of data and alignment issue.

Jonathan Cameron <[email protected]>
iio: accel: kxcjk-1013: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: accel: hid: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: accel: bma220: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Jonathan Cameron <[email protected]>
iio: accel: bma180: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

Nuno Sa <[email protected]>
iio: adis16475: do not return ints in irq handlers

Nuno Sa <[email protected]>
iio: adis16400: do not return ints in irq handlers

Nuno Sa <[email protected]>
iio: adis_buffer: do not return ints in irq handlers

Arnd Bergmann <[email protected]>
mwifiex: re-fix for unaligned accesses

Sergio Paracuellos <[email protected]>
phy: ralink: phy-mt7621-pci: properly print pointer address

Christophe JAILLET <[email protected]>
tty: nozomi: Fix a resource leak in an error handling function

Dan Carpenter <[email protected]>
serial: 8250_omap: fix a timeout loop condition

Michael Walle <[email protected]>
serial: fsl_lpuart: remove RTSCTS handling from get_mctrl()

Michael Walle <[email protected]>
serial: fsl_lpuart: don't modify arbitrary data on lpuart32

Paul E. McKenney <[email protected]>
rcu: Invoke rcu_spawn_core_kthreads() from rcu_spawn_gp_kthread()

Stephen Boyd <[email protected]>
ASoC: rt5682: Disable irq on shutdown

Andy Shevchenko <[email protected]>
staging: fbtft: Don't spam logs when probe is deferred

Andy Shevchenko <[email protected]>
staging: fbtft: Rectify GPIO handling

Christophe JAILLET <[email protected]>
staging: rtl8712: Fix some tests against some 'data' subtype frames

Wei Li <[email protected]>
MIPS: Fix PKMAP with 32-bit MIPS huge page support

Leon Romanovsky <[email protected]>
RDMA/core: Always release restrack object

Leon Romanovsky <[email protected]>
RDMA/mlx5: Don't access NULL-cleared mpi pointer

Menglong Dong <[email protected]>
net: tipc: fix FB_MTU eat two pages

Pavel Skripkin <[email protected]>
net: sched: fix warning in tcindex_alloc_perfect_hash

Vadim Fedorenko <[email protected]>
net: lwtunnel: handle MTU calculation in forwading

Muchun Song <[email protected]>
writeback: fix obtain a reference to a freeing memcg css

Ravi Bangoria <[email protected]>
bpf, x86: Fix extable offset calculation

Robert Hancock <[email protected]>
clk: si5341: Update initialization magic

Robert Hancock <[email protected]>
clk: si5341: Check for input clock presence and PLL lock on startup

Robert Hancock <[email protected]>
clk: si5341: Avoid divide errors due to bogus register contents

Robert Hancock <[email protected]>
clk: si5341: Wait for DEVICE_READY on startup

Jonathan Marek <[email protected]>
clk: qcom: clk-alpha-pll: fix CAL_L write in alpha_pll_fabia_prepare

Cristian Ciocaltea <[email protected]>
clk: actions: Fix AHPPREDIV-H-AHB clock chain on Owl S500 SoC

Cristian Ciocaltea <[email protected]>
clk: actions: Fix bisp_factor_table based clocks on Owl S500 SoC

Cristian Ciocaltea <[email protected]>
clk: actions: Fix SD clocks factor table on Owl S500 SoC

Cristian Ciocaltea <[email protected]>
clk: actions: Fix UART clock dividers on Owl S500 SoC

Taniya Das <[email protected]>
clk: qcom: gcc: Add support for a new frequency for SC7280

Luiz Augusto von Dentz <[email protected]>
Bluetooth: Fix handling of HCI_LE_Advertising_Set_Terminated event

Luiz Augusto von Dentz <[email protected]>
Bluetooth: Fix Set Extended (Scan Response) Data

Luiz Augusto von Dentz <[email protected]>
Bluetooth: mgmt: Fix slab-out-of-bounds in tlv_data_is_valid

Colin Ian King <[email protected]>
Bluetooth: virtio_bt: add missing null pointer check on alloc_skb call return

Michal Simek <[email protected]>
clk: zynqmp: fix compile testing without ZYNQMP_FIRMWARE

Petr Oros <[email protected]>
Revert "be2net: disable bh with spin_lock in be_process_mcc"

Bailey Forrest <[email protected]>
gve: Fix swapped vars when fetching max queues

Håkon Bugge <[email protected]>
RDMA/cma: Fix incorrect Packet Lifetime calculation

Gary Lin <[email protected]>
bpfilter: Specify the log level for the kmsg message

Vladimir Oltean <[email protected]>
net: dsa: sja1105: fix NULL pointer dereference in sja1105_reload_cbs()

Sasha Neftin <[email protected]>
e1000e: Check the PCIm state

Eric Dumazet <[email protected]>
ipv6: fix out-of-bound access in ip6_parse_tlv()

Antoine Tenart <[email protected]>
net: atlantic: fix the macsec key length

Antoine Tenart <[email protected]>
net: phy: mscc: fix macsec key length

Antoine Tenart <[email protected]>
net: macsec: fix the length used to copy the key for offloading

Håkon Bugge <[email protected]>
RDMA/cma: Protect RMW with qp_mutex

Sukadev Bhattiprolu <[email protected]>
ibmvnic: free tx_pool if tso_pool alloc fails

Sukadev Bhattiprolu <[email protected]>

    ibmvnic: set ltb->buff to NULL after freeing

Sukadev Bhattiprolu <[email protected]>
ibmvnic: account for bufs already saved in indir_buf

Sukadev Bhattiprolu <[email protected]>
ibmvnic: clean pending indirect buffs during reset

Dany Madden <[email protected]>
Revert "ibmvnic: remove duplicate napi_schedule call in open function"

Sukadev Bhattiprolu <[email protected]>
Revert "ibmvnic: simplify reset_long_term_buff function"

Yixing Liu <[email protected]>
RDMA/hns: Add window selection field of congestion control

Weihang Li <[email protected]>
RDMA/hns: Add a check to ensure integer mtu is positive

Jan Sokolowski <[email protected]>
i40e: Fix missing rtnl locking when setting up pf switch

Mateusz Palczewski <[email protected]>
i40e: Fix autoneg disabling for non-10GBaseT links

Dinghao Liu <[email protected]>
i40e: Fix error handling in i40e_vsi_open

Maciej Żenczykowski <[email protected]>
bpf: Do not change gso_size during bpf_skb_change_proto()

Norbert Slusarek <[email protected]>

    can: j1939: j1939_sk_setsockopt(): prevent allocation of j1939 filter for optlen == 0

Eric Dumazet <[email protected]>
ipv6: exthdrs: do not blindly use init_net

Jian-Hong Pan <[email protected]>
net: bcmgenet: Fix attaching to PYH failed on RPi 4B

Ping-Ke Shih <[email protected]>
mac80211: remove iwlwifi specific workaround NDPs of null_response

Zhen Lei <[email protected]>
drm/msm/dpu: Fix error return code in dpu_mdss_init()

Zhen Lei <[email protected]>
drm/msm: Fix error return code in msm_drm_init()

Krishna Manikandan <[email protected]>
drm/msm/disp/dpu1: avoid perf update in frame done event

Kuogee Hsieh <[email protected]>
drm/msm/dp: handle irq_hpd with sink_count = 0 correctly

John Fastabend <[email protected]>
bpf: Fix null ptr deref with mixed tail calls and subprogs

Eric Dumazet <[email protected]>
ieee802154: hwsim: avoid possible crash in hwsim_del_edge_nl()

Dongliang Mu <[email protected]>
ieee802154: hwsim: Fix memory leak in hwsim_add_one

Yixing Liu <[email protected]>
RDMA/hns: Fix uninitialized variable

Lang Cheng <[email protected]>
RDMA/hns: Force rewrite inline flag of WQE

Marcelo Ricardo Leitner <[email protected]>
tc-testing: fix list handling

Vignesh Raghavendra <[email protected]>
net: ti: am65-cpsw-nuss: Fix crash when changing number of TX queues

Rafał Miłecki <[email protected]>
net: broadcom: bcm4908_enet: reset DMA rings sw indexes properly

Miao Wang <[email protected]>
net/ipv4: swap flow ports when validating source

Jakub Kicinski <[email protected]>
ip6_tunnel: fix GRE6 segmentation

Paolo Abeni <[email protected]>
mptcp: avoid race on msk state changes

Bui Quang Minh <[email protected]>
bpf: Fix integer overflow in argument calculation for bpf_map_area_alloc

Eric Dumazet <[email protected]>
vxlan: add missing rcu_read_lock() in neigh_reduce()

Po-Hao Huang <[email protected]>
rtw88: 8822c: fix lc calibration timing

Maciej Żenczykowski <[email protected]>
bpf: Fix regression on BPF_OBJ_GET with non-O_RDWR flags

Luca Coelho <[email protected]>
iwlwifi: increase PNVM load timeout

Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: do not allow to delete table with owner by handle

Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: skip netlink portID validation if zero

Ayush Sawal <[email protected]>
xfrm: Fix xfrm offload fallback fail case

Eric Dumazet <[email protected]>
pkt_sched: sch_qfq: fix qfq_change_class() error path

Eldar Gasanov <[email protected]>
net: dsa: mv88e6xxx: Fix adding vlan 0

Christophe JAILLET <[email protected]>
net: mana: Fix a memory leak in an error handling path in 'mana_create_txq()'

Paolo Abeni <[email protected]>
mptcp: fix 32 bit DSN expansion

Paolo Abeni <[email protected]>
mptcp: fix bad handling of 32 bit ack wrap-around

Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables_offload: check FLOW_DISSECTOR_KEY_BASIC in VLAN transfer logic

Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: memleak in hw offload abort path

Jakub Kicinski <[email protected]>
tls: prevent oversized sendfile() hangs by ignoring MSG_MORE

Jakub Kicinski <[email protected]>
selftests: tls: fix chacha+bidir tests

Jakub Kicinski <[email protected]>
selftests: tls: clean up uninitialized warnings

Yunsheng Lin <[email protected]>
net: sched: add barrier to ensure correct ordering for lockless qdisc

Antoine Tenart <[email protected]>
vrf: do not push non-ND strict packets with a source LLA through packet taps again

Cong Wang <[email protected]>
skmsg: Teach sk_psock_verdict_apply() to return errors

Cong Wang <[email protected]>
skmsg: Fix a memory leak in sk_psock_verdict_apply()

Cong Wang <[email protected]>
skmsg: Clear skb redirect pointer before dropping it

Cong Wang <[email protected]>
udp: Fix a memory leak in udp_read_sock()

Cong Wang <[email protected]>
selftests/bpf: Retry for EAGAIN in udp_redir_to_connected()

Pavel Skripkin <[email protected]>
net: ethernet: ezchip: fix error handling

Pavel Skripkin <[email protected]>
net: ethernet: ezchip: fix UAF in nps_enet_remove

Pavel Skripkin <[email protected]>
net: ethernet: aeroflex: fix UAF in greth_of_remove

Sean Wang <[email protected]>
mt76: mt7921: fix the coredump is being truncated

Sean Wang <[email protected]>
mt76: mt7921: fix kernel warning when reset on vif is not sta

Shayne Chen <[email protected]>
mt76: mt7915: fix rx fcs error count in testmode

Lorenzo Bianconi <[email protected]>
mt76: mt7921: wake the device before dumping power table

Ryder Lee <[email protected]>

    mt76: mt7915: fix MT_EE_CAL_GROUP_SIZE

Ryder Lee <[email protected]>
mt76: mt7615: fix potential overflow on large shift

Lorenzo Bianconi <[email protected]>
mt76: testmode: remove undefined behaviour in mt76_testmode_alloc_skb

Lorenzo Bianconi <[email protected]>
mt76: testmode: fix memory leak in mt76_testmode_alloc_skb

Lorenzo Bianconi <[email protected]>
mt76: mt7921: do not schedule hw reset if the device is not running

Sean Wang <[email protected]>
mt76: mt7921: avoid unnecessary consecutive WiFi resets

Sean Wang <[email protected]>
mt76: mt7921: fix OMAC idx usage

Sean Wang <[email protected]>
mt76: mt7921: fix invalid register access in wake_work

Sean Wang <[email protected]>
mt76: mt7921: add back connection monitor support

Sean Wang <[email protected]>
mt76: mt7921: consider the invalid value for to_rssi

YN Chen <[email protected]>
mt76: connac: fix WoW with disconnetion and bitmap pattern

Sean Wang <[email protected]>
mt76: connac: fw_own rely on all packet memory all being free

Sean Wang <[email protected]>
mt76: mt7921: Don't alter Rx path classifier

Sean Wang <[email protected]>

    mt76: mt7921: fix mt7921_wfsys_reset sequence

Lorenzo Bianconi <[email protected]>
mt76: mt7615: fix NULL pointer dereference in tx_prepare_skb()

Lorenzo Bianconi <[email protected]>
mt76: fix possible NULL pointer dereference in mt76_tx

Dan Carpenter <[email protected]>

    mt76: mt7915: fix a signedness bug in mt7915_mcu_apply_tx_dpd()

Pavel Machek <[email protected]>
net: pxa168_eth: Fix a potential data race in pxa168_eth_remove

Wang Hai <[email protected]>
samples/bpf: Fix the error return code of xdp_redirect's main()

Wang Hai <[email protected]>
samples/bpf: Fix Segmentation fault for xdp_redirect command

Xi Wang <[email protected]>
RDMA/hns: Clear extended doorbell info before using

Jack Wang <[email protected]>
RDMA/rtrs-srv: Set minimal max_send_wr and max_recv_wr

Tony Ambardar <[email protected]>
bpf: Fix libelf endian handling in resolv_btfids

Magnus Karlsson <[email protected]>
xsk: Fix broken Tx ring validation

Magnus Karlsson <[email protected]>
xsk: Fix missing validation for skb and unaligned mode

Andrii Nakryiko <[email protected]>
selftests/bpf: Fix ringbuf test fetching map FD

Daniel Xu <[email protected]>
selftests/bpf: Whitelist test_progs.h from .gitignore

Bob Pearson <[email protected]>
RDMA/rxe: Fix qp reference counting for atomic ops

Pablo Neira Ayuso <[email protected]>
netfilter: nft_tproxy: restrict support to TCP and UDP transport protocols

Pablo Neira Ayuso <[email protected]>
netfilter: nft_osf: check for TCP packet before further processing

Pablo Neira Ayuso <[email protected]>
netfilter: nft_exthdr: check for IPv6 packet before further processing

Leon Romanovsky <[email protected]>
RDMA/mlx5: Don't add slave port to unaffiliated list

Liu Shixin <[email protected]>
netlabel: Fix memory leak in netlbl_mgmt_add_common

Johannes Berg <[email protected]>
wil6210: remove erroneous wiphy locking

Seevalamuthu Mariappan <[email protected]>
ath11k: send beacon template after vdev_start/restart during csa

Yang Li <[email protected]>
ath10k: Fix an error code in ath10k_add_interface()

Christophe JAILLET <[email protected]>
ath11k: Fix an error handling path in ath11k_core_fetch_board_data_api_n()

Hang Zhang <[email protected]>
cw1200: Revert unnecessary patches that fix unreal use-after-free bugs

Christophe JAILLET <[email protected]>
brcmsmac: mac80211_if: Fix a resource leak in an error handling path

Matthias Brugger <[email protected]>
brcmfmac: Delete second brcm folder hierarchy

Tong Tiangen <[email protected]>
brcmfmac: Fix a double-free in brcmf_sdio_bus_reset

Alvin Šipraga <[email protected]>
brcmfmac: correctly report average RSSI in station info

Alvin Šipraga <[email protected]>
brcmfmac: fix setting of station info chains bitmask

Zhen Lei <[email protected]>
ssb: Fix error return code in ssb_bus_scan()

Chris Wilson <[email protected]>
drm/i915/selftests: Reorder tasklet_disable vs local_bh_disable

Sasha Levin <[email protected]>
net: wwan: Fix WWAN config symbols

Bryan O'Donoghue <[email protected]>
wcn36xx: Move hal_buf allocation to devm_kmalloc in probe

Lucas Stach <[email protected]>
clk: imx8mq: remove SYS PLL 1/2 clock gates

Dongliang Mu <[email protected]>
ieee802154: hwsim: Fix possible memory leak in hwsim_subscribe_all_others

Randy Dunlap <[email protected]>
wireless: carl9170: fix LEDS build errors & warnings

Yang Yingliang <[email protected]>
ath10k: add missing error return code in ath10k_pci_probe()

Yang Yingliang <[email protected]>
ath10k: go to path err_unsupported when chip id is not supported

Zhihao Cheng <[email protected]>
tools/bpftool: Fix error return code in do_batch()

Wong Vee Khee <[email protected]>
net: stmmac: Fix potential integer overflow

Matteo Croce <[email protected]>
stmmac: prefetch right address

Colin Ian King <[email protected]>
drm: qxl: ensure surf.data is ininitialized

Luca Ceresoli <[email protected]>
clk: vc5: fix output disabling when enabling a FOD

Maxime Ripard <[email protected]>
drm/vc4: hdmi: Fix error path of hpd-gpios

Kees Cook <[email protected]>
drm/pl111: Actually fix CONFIG_VEXPRESS_CONFIG depends

Kamal Heib <[email protected]>
RDMA/rxe: Fix failure during driver load

Kees Cook <[email protected]>
drm/pl111: depend on CONFIG_VEXPRESS_CONFIG

Mark Zhang <[email protected]>
IB/cm: Improve the calling of cm_init_av_for_lap and cm_init_av_by_path

Mark Zhang <[email protected]>
Revert "IB/cm: Mark stale CM id's whenever the mad agent was unregistered"

Jason Gunthorpe <[email protected]>
IB/cm: Split cm_alloc_msg()

Jason Gunthorpe <[email protected]>
IB/cm: Pair cm_alloc_response_msg() with a cm_free_response_msg()

Leon Romanovsky <[email protected]>
RDMA/core: Sanitize WQ state received from the userspace

Boris Sukholitko <[email protected]>
net/sched: act_vlan: Fix modify to allow 0

Xin Long <[email protected]>
xfrm: remove the fragment check for ipv6 beet mode

Dmitry Osipenko <[email protected]>
clk: tegra30: Use 300MHz for video decoder by default

Zhen Lei <[email protected]>
ehea: fix error return code in ehea_restart_qps()

Gioh Kim <[email protected]>

    RDMA/rtrs-clt: Fix memory leak of not-freed sess->stats and stats->pcpu_stats

Md Haris Iqbal <[email protected]>
RDMA/rtrs-clt: Check if the queue_depth has changed during a reconnection

Jack Wang <[email protected]>
RDMA/rtrs-srv: Fix memory leak when having multiple sessions

Gioh Kim <[email protected]>
RDMA/rtrs-srv: Fix memory leak of unfreed rtrs_srv_stats object

Gioh Kim <[email protected]>
RDMA/rtrs: Do not reset hb_missed_max after re-connection

Md Haris Iqbal <[email protected]>
RDMA/rtrs-clt: Check state of the rtrs_clt_sess before reading its stats

Bart Van Assche <[email protected]>
RDMA/srp: Fix a recently introduced memory leak

Xi Wang <[email protected]>
RDMA/hns: Fix wrong timer context buffer page size

Jianguo Wu <[email protected]>
mptcp: make sure flag signal is set when add addr with port

Jianguo Wu <[email protected]>
mptcp: generate subflow hmac after mptcp_finish_join()

Jianguo Wu <[email protected]>
mptcp: fix pr_debug in mptcp_token_new_connect

Colin Ian King <[email protected]>
drm/rockchip: cdn-dp: fix sign extension on an int multiply for a u64 result

Christophe JAILLET <[email protected]>
drm/rockchip: lvds: Fix an error handling path

Thomas Hebb <[email protected]>
drm/rockchip: dsi: move all lane config except LCDC mux to bind()

Yang Yingliang <[email protected]>
drm/rockchip: cdn-dp-core: add missing clk_disable_unprepare() on error in cdn_dp_grf_write()

Alex Bee <[email protected]>
drm: rockchip: set alpha_en to 0 if it is not used

Maxime Ripard <[email protected]>
drm/vc4: crtc: Lookup the encoder from the register at boot

Maxime Ripard <[email protected]>
drm/vc4: crtc: Fix vc4_get_crtc_encoder logic

Maxime Ripard <[email protected]>
drm/vc4: crtc: Pass the drm_atomic_state to config_pv

Tobias Schramm <[email protected]>
clk: sunxi-ng: v3s: fix incorrect postdivider on pll-audio

Peter Geis <[email protected]>
clk: rockchip: fix rk3568 cpll clk gate bits

Yang Yingliang <[email protected]>
net: ftgmac100: add missing error return code in ftgmac100_probe()

Aurabindo Pillai <[email protected]>
drm/amd/display: take dc_lock in short pulse handler only

Zhan Liu <[email protected]>
drm/amd/display: Avoid HPD IRQ in GPU reset state

Roman Li <[email protected]>
drm/amd/display: fix potential gpu reset deadlock

Jerome Brunet <[email protected]>
clk: meson: g12a: fix gp0 and hifi ranges

Wei Yongjun <[email protected]>
net: qrtr: ns: Fix error return code in qrtr_ns_init()

Stephen Rothwell <[email protected]>
drm/i915: Merge fix for "drm: Switch to %p4cc format modifier"

Andrii Nakryiko <[email protected]>
libbpf: Fix ELF symbol visibility update logic

Thomas Hellstrom <[email protected]>
drm/vmwgfx: Fix cpu updates of coherent multisample surfaces

Thomas Hellstrom <[email protected]>
drm/vmwgfx: Mark a surface gpu-dirty after the SVGA3dCmdDXGenMips command

Yixian Liu <[email protected]>
RDMA/hns: Remove the condition of light load for posting DWQE

Geert Uytterhoeven <[email protected]>
pinctrl: renesas: r8a77990: JTAG pins do not have pull-down capabilities

Geert Uytterhoeven <[email protected]>
pinctrl: renesas: r8a7796: Add missing bias for PRESET# pin

Andy Shevchenko <[email protected]>
net: pch_gbe: Propagate error from devm_gpio_request_one()

Andy Shevchenko <[email protected]>

    net: mvpp2: Put fwnode in error case during ->probe()

Cong Wang <[email protected]>
rtnetlink: avoid RCU read lock when holding RTNL

Lucas Stach <[email protected]>
drm/imx: ipuv3-plane: fix PRG modifiers after drm managed resource conversion

Philipp Zabel <[email protected]>
drm/imx: ipuv3-plane: do not advertise YUV formats on planes without CSC

Christophe JAILLET <[email protected]>
video: fbdev: imxfb: Fix an error message

Adrien Grassein <[email protected]>
drm/bridge: fix LONTIUM_LT8912B dependencies

Hsin-Yi Wang <[email protected]>
drm/bridge: anx7625: Fix power on delay

Takashi Iwai <[email protected]>
drm/ast: Fix missing conversions to managed API

Yingjie Wang <[email protected]>
drm/amd/dc: Fix a missing check bug in dm_dp_mst_detect()

Douglas Anderson <[email protected]>
drm/bridge: Fix the stop condition of drm_bridge_chain_pre_enable()

Robert Foss <[email protected]>
drm/bridge/sii8620: fix dependency on extcon

Sabrina Dubroca <[email protected]>
xfrm: xfrm_state_mtu should return at least 1280 for ipv6

Liu Shixin <[email protected]>
mm/page_alloc: fix counting of managed_pages

Waiman Long <[email protected]>
mm: memcg/slab: properly set up gfp flags for objcg pointer array

Miaohe Lin <[email protected]>
mm/shmem: fix shmem_swapin() race with swapoff

Miaohe Lin <[email protected]>
swap: fix do_swap_page() race with swapoff

Nicolas Saenz Julienne <[email protected]>
mm: mmap_lock: use local locks instead of disabling preemption

Anshuman Khandual <[email protected]>
mm/debug_vm_pgtable: ensure THP availability via has_transparent_hugepage()

Jan Kara <[email protected]>
dax: fix ENOMEM handling in grab_mapping_entry()

Dan Carpenter <[email protected]>
ocfs2: fix snprintf() checking

Ming Lei <[email protected]>

    blk-mq: update hctx->dispatch_busy in case of real scheduler

Edward Hsieh <[email protected]>
block: fix trace completion for chained bio

Chanwoo Choi <[email protected]>
PM / devfreq: passive: Fix get_target_freq when not using required-opp

Rafael J. Wysocki <[email protected]>

    cpufreq: Make cpufreq_online() call driver->offline() on errors

Nathan Chancellor <[email protected]>
ACPI: bgrt: Fix CFI violation

Paolo Valente <[email protected]>
block, bfq: reset waker pointer with shared queues

Paolo Valente <[email protected]>
block, bfq: avoid delayed merge of async queues

Zhang Yi <[email protected]>
blk-wbt: make sure throttle is enabled properly

Zhang Yi <[email protected]>
blk-wbt: introduce a new disable state to prevent false positive by rwb_enabled()

Randy Dunlap <[email protected]>
EDAC/igen6: fix core dependency

Xiaofei Tan <[email protected]>
ACPI: APEI: fix synchronous external aborts in user-mode

Matti Vaittinen <[email protected]>
extcon: extcon-max8997: Fix IRQ freeing at error path

Dan Carpenter <[email protected]>
nvme-tcp: fix error codes in nvme_tcp_setup_ctrl()

Tony Lindgren <[email protected]>
clocksource/drivers/timer-ti-dm: Save and restore timer TIOCP_CFG

Maximilian Luz <[email protected]>
HID: surface-hid: Fix get-report request

Guoqing Jiang <[email protected]>
md: revert io stats accounting

Christoph Hellwig <[email protected]>
mark pstore-blk as broken

Krzysztof Wilczyński <[email protected]>
ACPI: sysfs: Fix a buffer overrun problem with description_show()

Jing Xiangfeng <[email protected]>
ACPI: tables: FPDT: Add missing acpi_put_table() in acpi_init_fpdt()

Mario Limonciello <[email protected]>
nvme-pci: look for StorageD3Enable on companion ACPI device instead

Praveen Kumar <[email protected]>
x86/hyperv: fix logical processor creation

Ming Lei <[email protected]>
block: avoid double io accounting for flush request

Rafael J. Wysocki <[email protected]>
ACPI: PM / fan: Put fan device IDs into separate header file

YueHaibing <[email protected]>
PM / devfreq: Add missing error code in devfreq_add_device()

Arnd Bergmann <[email protected]>
EDAC/aspeed: Use proper format string for printing resource

Marek Szyprowski <[email protected]>
media: s5p-mfc: Fix display delay control creation

Dafna Hirschfeld <[email protected]>
media: mtk-vpu: on suspend, read/write regs only if vpu is running

Philipp Zabel <[email protected]>
media: video-mux: Skip dangling endpoints

Sean Christopherson <[email protected]>
KVM: selftests: Remove errant asm/barrier.h include to fix arm64 build

Hou Wenlong <[email protected]>
KVM: selftests: fix triple fault if ept=0 in dirty_log_test

Zhaoyang Huang <[email protected]>
psi: Fix race between psi_trigger_create/destroy

Josh Poimboeuf <[email protected]>
objtool: Don't make .altinstructions writable

Herbert Xu <[email protected]>
crypto: nx - Fix RCU warning in nx842_OF_upd_status

Peter Zijlstra <[email protected]>
perf: Fix task context PMU for Hetero

Mirko Vogt <mirko-dev|[email protected]>
spi: spi-sun6i: Fix chipselect/clock bug

Joerg Roedel <[email protected]>
x86/sev: Use "SEV: " prefix for messages from sev.c

Peter Zijlstra <[email protected]>
lockdep/selftests: Fix selftests vs PROVE_RAW_LOCK_NESTING

Peter Zijlstra <[email protected]>
lockdep: Fix wait-type for empty stack

Qais Yousef <[email protected]>
sched/uclamp: Fix uclamp_tg_restrict()

Vincent Donnefort <[email protected]>
sched/rt: Fix Deadline utilization tracking during policy change

Vincent Donnefort <[email protected]>
sched/rt: Fix RT utilization tracking during policy change

Joerg Roedel <[email protected]>
x86/sev: Split up runtime #VC handler for correct state tracking

Joerg Roedel <[email protected]>
x86/sev: Make sure IRQs are disabled while GHCB is active

David Sterba <[email protected]>
btrfs: clear log tree recovering status if starting transaction fails

Matti Vaittinen <[email protected]>
regulator: bd9576: Fix the driver name in id table

Axel Lin <[email protected]>
regulator: hi6421v600: Fix setting idle mode

Bhupesh Sharma <[email protected]>

    regulator: qcom-rpmh: Add terminator at the end of pm7325x_vreg_data[] array

Axel Lin <[email protected]>
regulator: hi655x: Fix pass wrong pointer to config.driver_data

Alexandru Elisei <[email protected]>
KVM: arm64: Don't zero the cycle count register when PMCR_EL0.P is set

Tuan Phan <[email protected]>
perf/arm-cmn: Fix invalid pointer when access dtc object sharing the same IRQ number

Kai Huang <[email protected]>
KVM: x86/mmu: Fix pf_fixed count in tdp_mmu_map_handle_target_level()

Kai Huang <[email protected]>
KVM: x86/mmu: Fix return value in tdp_mmu_map_handle_target_level()

Sean Christopherson <[email protected]>
KVM: nVMX: Don't clobber nested MMU's A/D status on EPTP switch

Sean Christopherson <[email protected]>
KVM: nVMX: Ensure 64-bit shift when checking VMFUNC bitmap

Sean Christopherson <[email protected]>
KVM: nVMX: Sync all PGDs on nested transition with shadow paging

Jim Mattson <[email protected]>
KVM: nVMX: Add a return code to vmx_complete_nested_posted_interrupt

Guenter Roeck <[email protected]>
hwmon: (max31790) Fix fan speed reporting for fan7..12

Guenter Roeck <[email protected]>
hwmon: (max31722) Remove non-standard ACPI device IDs

Guenter Roeck <[email protected]>
hwmon: (lm70) Revert "hwmon: (lm70) Add support for ACPI"

Chris Packham <[email protected]>
hwmon: (pmbus/bpa-rs600) Handle Vin readings >= 256V

Jacopo Mondi <[email protected]>

    media: i2c: rdacm21: Power up OV10640 before OV490

Jacopo Mondi <[email protected]>

    media: i2c: rdacm21: Fix OV10640 powerup

Dillon Min <[email protected]>

    media: s5p-g2d: Fix a memory leak on ctx->fh.m2m_ctx

Arnd Bergmann <[email protected]>
media: subdev: remove VIDIOC_DQEVENT_TIME32 handling

Arnd Bergmann <[email protected]>
media: v4l2-core: ignore native time32 ioctls on 64-bit

Anshuman Khandual <[email protected]>
arm64/mm: Fix ttbr0 values stored in struct thread_info for software-pan

Zhen Lei <[email protected]>
mmc: usdhi6rol0: fix error return code in usdhi6_probe()

Hongbo Li <[email protected]>
crypto: sm2 - fix a memory leak in sm2

Hangbin Liu <[email protected]>
crypto: x86/curve25519 - fix cpu feature checking logic in mod_exit

Zhang Qilong <[email protected]>
crypto: omap-sham - Fix PM reference leak in omap sham ops

Tong Tiangen <[email protected]>
crypto: nitrox - fix unchecked variable in nitrox_register_interrupts

Axel Lin <[email protected]>
regulator: fan53880: Fix vsel_mask setting for FAN53880_BUCK

Gustavo A. R. Silva <[email protected]>
media: siano: Fix out-of-bounds warnings in smscore_load_firmware_family2()

Randy Dunlap <[email protected]>
m68k: atari: Fix ATARI_KBD_CORE kconfig unmet dependency warning

Shaokun Zhang <[email protected]>
drivers/perf: hisi: Fix data source control

Axel Lin <[email protected]>
regulator: fan53555: Fix missing slew_reg/mask/shift settings for FAN53526

Johan Hovold <[email protected]>
media: gspca/gl860: fix zero-length control requests

Joe Richey <[email protected]>
media: vicodec: Use _BITUL() macro in UAPI headers

Zhen Lei <[email protected]>

    media: tc358743: Fix error return code in tc358743_probe_of()

Dan Carpenter <[email protected]>
media: au0828: fix a NULL vs IS_ERR() check

Lv Yunlong <[email protected]>
media: exynos4-is: Fix a use after free in isp_video_release

Ezequiel Garcia <[email protected]>
media: rkvdec: Fix .buf_prepare

Stanimir Varbanov <[email protected]>
media: venus: hfi_cmds: Fix conceal color property

Andy Shevchenko <[email protected]>
media: ipu3-cio2: Fix reference counting when looping over ACPI devices

Valentin Schneider <[email protected]>
sched: Don't defer CPU pick to migration_cpu_stop()

Randy Dunlap <[email protected]>
locking/lockdep: Reduce LOCKDEP dependency list

Sergey Shtylyov <[email protected]>
pata_ep93xx: fix deferred probing

Randy Dunlap <[email protected]>
regulator: bd71815: add select to fix build

Christophe JAILLET <[email protected]>
media: rc: i2c: Fix an error message

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

Suman Anna <[email protected]>
crypto: sa2ul - Use of_device_get_match_data() helper

Suman Anna <[email protected]>
crypto: sa2ul - Fix pm_runtime enable in sa_ul_probe()

Suman Anna <[email protected]>
crypto: sa2ul - Fix leaks on failure paths with sa_dma_init()

Joe Richey <[email protected]>
x86/elf: Use _BITUL() macro in UAPI headers

Hui Tang <[email protected]>
crypto: hisilicon/hpre - fix unmapping invalid dma address

Hui Tang <[email protected]>
crypto: testmgr - fix initialization of 'secret_size'

Mimi Zohar <[email protected]>
evm: fix writing <securityfs>/evm overflow

Sergey Shtylyov <[email protected]>
pata_octeon_cf: avoid WARN_ON() in ata_host_activate()

Josh Poimboeuf <[email protected]>
kbuild: Fix objtool dependency for 'OBJECT_FILES_NON_STANDARD_<obj> := n'

Qais Yousef <[email protected]>
sched/uclamp: Fix locking around cpu_util_update_eff()

Qais Yousef <[email protected]>
sched/uclamp: Fix wrong implementation of cpu.uclamp.min

Randy Dunlap <[email protected]>
media: I2C: change 'RST' to "RSET" to fix multiple build errors

Sergey Shtylyov <[email protected]>
pata_rb532_cf: fix deferred probing

Sergey Shtylyov <[email protected]>
sata_highbank: fix deferred probing

Zhen Lei <[email protected]>
crypto: ux500 - Fix error return code in hash_hw_final()

Corentin Labbe <[email protected]>
crypto: ixp4xx - update IV after requests

Corentin Labbe <[email protected]>
crypto: ixp4xx - dma_unmap the correct address

Mauro Carvalho Chehab <[email protected]>
media: hantro: do a PM resume earlier

Mauro Carvalho Chehab <[email protected]>
media: i2c: ccs-core: return the right error code at suspend

Mauro Carvalho Chehab <[email protected]>
media: s5p_cec: decrement usage count if disabled

Mauro Carvalho Chehab <[email protected]>
media: venus: Rework error fail recover logic

Andy Shevchenko <[email protected]>
spi: Avoid undefined behaviour when counting unused native CSs

Andy Shevchenko <[email protected]>
spi: Allow to have all native CSs in use along with GPIOs

Andrii Nakryiko <[email protected]>
kbuild: skip per-CPU BTF generation for pahole v1.18-v1.21

Daniel Axtens <[email protected]>
mm: define default MAX_PTRS_PER_* in include/pgtable.h

Roman Gushchin <[email protected]>
writeback, cgroup: increment isw_nr_in_flight before grabbing an inode

Arnd Bergmann <[email protected]>
ia64: mca_drv: fix incorrect array size calculation

Petr Mladek <[email protected]>
kthread_worker: fix return value when kthread_mod_delayed_work() races with kthread_cancel_delayed_work_sync()

Ming Lei <[email protected]>
block: fix discard request merge

Shawn Guo <[email protected]>
mailbox: qcom: Use PLATFORM_DEVID_AUTO to register platform device

Jan Kara <[email protected]>
bfq: Remove merged request already in bfq_requests_merged()

Steve French <[email protected]>

    cifs: fix missing spinlock around update to ses->status

Jason Gerecke <[email protected]>
HID: wacom: Correct base usage for capacitive ExpressKey status bits

Steve French <[email protected]>
smb3: fix possible access to uninitialized pointer to DACL

Richard Fitzgerald <[email protected]>
ACPI: tables: Add custom DSDT file as makefile prerequisite

Javier Martinez Canillas <[email protected]>
tpm_tis_spi: add missing SPI device ID entries

Paul E. McKenney <[email protected]>
clocksource: Check per-CPU clock synchronization when marked unstable

Paul E. McKenney <[email protected]>
clocksource: Retry clock read if long delays detected

Luca Mariotti <[email protected]>
block, bfq: fix delayed stable merge check

Zhang Rui <[email protected]>
ACPI: EC: trust DSDT GPE for certain HP laptop

Steve French <[email protected]>
cifs: fix SMB1 error path in cifs_get_file_info_unix

Steve French <[email protected]>
smb3: fix uninitialized value for port in witness protocol move

Thiago Rafael Becker <[email protected]>
cifs: retry lookup and readdir when EAGAIN is returned.

Paulo Alcantara <[email protected]>
cifs: fix check of dfs interlinks

Ronnie Sahlberg <[email protected]>
cifs: improve fallocate emulation

Haiyang Zhang <[email protected]>
PCI: hv: Add check for hyperv_initialized in init_hv_pci_drv()

Srinivas Pandruvada <[email protected]>
tools/power/x86/intel-speed-select: Fix uncore memory frequency display

Tony Luck <[email protected]>
EDAC/Intel: Do not load EDAC driver when running as a guest

Hannes Reinecke <[email protected]>
nvmet-fc: do not check for invalid target port in nvmet_fc_handle_fcp_rqst()

JK Kim <[email protected]>
nvme-pci: fix var. type for increasing cq_head

Jiapeng Chong <[email protected]>
platform/x86: toshiba_acpi: Fix missing error code in toshiba_acpi_setup_keyboard()

Luke D. Jones <[email protected]>
platform/x86: asus-nb-wmi: Revert "add support for ASUS ROG Zephyrus G14 and G15"

Luke D. Jones <[email protected]>
platform/x86: asus-nb-wmi: Revert "Drop duplicate DMI quirk structures"

Ming Lei <[email protected]>
block: fix race between adding/removing rq qos and normal IO

Pascal Giard <[email protected]>
HID: sony: fix freeze when inserting ghlive ps3/wii dongles

Zoltan Tamas Vajda <[email protected]>
HID: hid-input: add Surface Go battery quirk

Hui Wang <[email protected]>
ACPI: resources: Add checks for ACPI IRQ override

Hanjun Guo <[email protected]>
ACPI: bus: Call kobject_put() in acpi_init() error path

Erik Kaneda <[email protected]>
ACPICA: Fix memory leak caused by _CID repair function

Alexander Aring <[email protected]>
fs: dlm: fix memory leak when fenced

Alexander Aring <[email protected]>
fs: dlm: fix lowcomms_start error case

Jiapeng Chong <[email protected]>
drivers: hv: Fix missing error code in vmbus_connect()

Christian Brauner <[email protected]>
open: don't silently ignore unknown O-flags in openat2()

Richard Fitzgerald <[email protected]>
random32: Fix implicit truncation warning in prandom_seed_state()

Alexander Aring <[email protected]>
fs: dlm: fix connection tcp EOF handling

Alexander Aring <[email protected]>
fs: dlm: cancel work sync othercon

Alexander Aring <[email protected]>
fs: dlm: reconnect if socket error report occurs

Alexander Aring <[email protected]>
fs: dlm: fix srcu read lock usage

Ming Lei <[email protected]>

    blk-mq: clear stale request in tags->rq[] before freeing one request pool

Ming Lei <[email protected]>

    blk-mq: grab rq->refcount before calling ->fn in blk_mq_tagset_busy_iter

zhangyi (F) <[email protected]>
block_dump: remove block_dump feature in mark_inode_dirty()

Chris Chiu <[email protected]>
ACPI: EC: Make more Asus laptops use ECDT _GPE

Hans de Goede <[email protected]>
platform/x86: touchscreen_dmi: Add info for the Goodix GT912 panel of TM800A550L tablets

Hans de Goede <[email protected]>
platform/x86: touchscreen_dmi: Add an extra entry for the upside down Goodix touchscreen on Teclast X89 tablets

Hans de Goede <[email protected]>
Input: goodix - platform/x86: touchscreen_dmi - Move upside down quirks to touchscreen_dmi.c

Richard Fitzgerald <[email protected]>
lib: vsprintf: Fix handling of number field widths in vsscanf

YueHaibing <[email protected]>
hv_utils: Fix passing zero to 'PTR_ERR' warning

Mario Limonciello <[email protected]>
ACPI: processor idle: Fix up C-state latency if not ordered

Rafael J. Wysocki <[email protected]>
ACPI: scan: Rearrange dep_unmet initialization

Alex Deucher <[email protected]>
ACPI: PM: s2idle: Add missing LPS0 functions for AMD

Bixuan Cui <[email protected]>
EDAC/ti: Add missing MODULE_DEVICE_TABLE

Dmitry Torokhov <[email protected]>
HID: do not use down_interruptible() when unbinding devices

Rodrigo Campos <[email protected]>
seccomp: Support atomic "addfd + send reply"

Shuah Khan <[email protected]>
media: Fix Media Controller API config checks

Axel Lin <[email protected]>
regulator: da9052: Ensure enough delay time for .set_voltage_time_sel

Hsin-Hsiung Wang <[email protected]>
regulator: mt6358: Fix vdram2 .vsel_mask

Heiko Carstens <[email protected]>
KVM: s390: get rid of register asm usage

Boqun Feng <[email protected]>
lockding/lockdep: Avoid to find wrong lock dep path in check_irq_usage()

Boqun Feng <[email protected]>
locking/lockdep: Fix the dep path printing for backwards BFS

Christophe Leroy <[email protected]>
btrfs: disable build on platforms having page size 256K

Qu Wenruo <[email protected]>
btrfs: don't clear page extent mapped if we're not invalidating the full page

David Sterba <[email protected]>
btrfs: sysfs: fix format string for some discard stats

Josef Bacik <[email protected]>
btrfs: always abort the transaction if we abort a trans handle

Josef Bacik <[email protected]>
btrfs: abort transaction if we fail to update the delayed inode

Josef Bacik <[email protected]>
btrfs: fix error handling in __btrfs_update_delayed_inode

Suraj Jitindar Singh <[email protected]>
KVM: PPC: Book3S HV: Fix TLB management on SMT8 POWER9 and POWER10 processors

Marc Zyngier <[email protected]>
KVM: arm64: Restore PMU configuration on first run

Jing Xiangfeng <[email protected]>
drivers/perf: fix the missed ida_simple_remove() in ddr_perf_probe()

Kan Liang <[email protected]>
perf/x86: Reset the dirty counter to prevent the leak for an RDPMC task

Lukasz Luba <[email protected]>
sched/fair: Take thermal pressure into account while estimating energy

Guenter Roeck <[email protected]>
hwmon: (max31790) Fix pwmX_enable attributes

Guenter Roeck <[email protected]>
hwmon: (max31790) Report correct current pwm duty cycles

Steve Longerbeam <[email protected]>
media: imx-csi: Skip first few frames from a BT.656 source

Mauro Carvalho Chehab <[email protected]>
media: siano: fix device register error path

Mauro Carvalho Chehab <[email protected]>
media: dvbdev: fix error logic at dvb_register_device()

Mauro Carvalho Chehab <[email protected]>
media: dvb_net: avoid speculation from net slot

Ard Biesheuvel <[email protected]>
crypto: shash - avoid comparing pointers to exported functions under CFI

Axel Lin <[email protected]>
regulator: mt6315: Fix checking return value of devm_regmap_init_spmi_ext

zpershuai <[email protected]>
spi: meson-spicc: fix memory leak in meson_spicc_probe

zpershuai <[email protected]>
spi: meson-spicc: fix a wrong goto jump for avoiding memory leak.

Andrew Jeffery <[email protected]>
mmc: sdhci-of-aspeed: Turn down a phase correction warning

Zheyu Ma <[email protected]>
mmc: via-sdmmc: add a check against NULL pointer dereference

Krzysztof Kozlowski <[email protected]>
mmc: sdhci-sprd: use sdhci_sprd_writew

Tong Zhang <[email protected]>
memstick: rtsx_usb_ms: fix UAF

Dongliang Mu <[email protected]>
media: dvd_usb: memory leak in cinergyt2_fe_attach

Nick Desaulniers <[email protected]>
Makefile: fix GDB warning with CONFIG_RELR

Mark Rutland <[email protected]>
arm64: entry: don't instrument entry code with KCOV

Kai Ye <[email protected]>
crypto: hisilicon/sec - fixup 3des minimum key size declaration

Evgeny Novikov <[email protected]>
media: st-hva: Fix potential NULL pointer dereferences

Zheyu Ma <[email protected]>
media: bt8xx: Fix a missing check bug in bt878_probe

Lv Yunlong <[email protected]>
media: v4l2-core: Avoid the dangling pointer in v4l2_fh_release

Andrzej Pietrasiewicz <[email protected]>
media: cedrus: Fix .buf_prepare

Andrzej Pietrasiewicz <[email protected]>
media: hantro: Fix .buf_prepare

Igor Matheus Andrade Torrente <[email protected]>
media: em28xx: Fix possible memory leak of em28xx struct

Tong Zhang <[email protected]>
media: bt878: do not schedule tasklet when it is not setup

Dillon Min <[email protected]>
media: i2c: ov2659: Use clk_{prepare_enable,disable_unprepare}() to set xvclk on/off

Roberto Sassu <[email protected]>
ima: Don't remove security.ima if file must not be appraised

Odin Ugedal <[email protected]>
sched/fair: Fix ascii art by relpacing tabs

Tian Tao <[email protected]>
arm64: perf: Convert snprintf to sysfs_emit

Hui Tang <[email protected]>
crypto: ecdh - fix 'ecdh_init'

Hui Tang <[email protected]>
crypto: ecdh - fix ecdh-nist-p192's entry in testmgr

Thara Gopinath <[email protected]>
crypto: qce: skcipher: Fix incorrect sg count for dma transfers

Jack Xu <[email protected]>
crypto: qat - remove unused macro in FW loader

Jack Xu <[email protected]>
crypto: qat - check return code of qat_hal_rd_rel_reg()

Laurent Pinchart <[email protected]>
media: imx: imx7_mipi_csis: Fix logging of only error event counters

Anirudh Rayabharam <[email protected]>
media: pvrusb2: fix warning in pvr2_i2c_core_done

Jernej Skrabec <[email protected]>
media: hevc: Fix dependent slice segment flags

Hans Verkuil <[email protected]>
media: cobalt: fix race condition in setting HPD

Pavel Skripkin <[email protected]>
media: cpia2: fix memory leak in cpia2_usb_probe

Valentin Schneider <[email protected]>
sched: Make the idle task quack like a per-CPU kthread

Mauro Carvalho Chehab <[email protected]>

    media: sti: fix obj-$(config) targets

Bixuan Cui <[email protected]>
crypto: nx - add missing MODULE_DEVICE_TABLE

Łukasz Stelmach <[email protected]>
hwrng: exynos - Fix runtime PM imbalance on error

Valentin Schneider <[email protected]>
sched/core: Initialize the idle task with preemption disabled

Zou Wei <[email protected]>
regulator: uniphier: Add missing MODULE_DEVICE_TABLE

Tian Tao <[email protected]>
spi: omap-100k: Fix the length judgment problem

Jay Fang <[email protected]>
spi: spi-topcliff-pch: Fix potential double free in pch_spi_process_messages()

Jay Fang <[email protected]>
spi: spi-loopback-test: Fix 'tx_buf' might be 'rx_buf'

Mauro Carvalho Chehab <[email protected]>
media: exynos-gsc: fix pm_runtime_get_sync() usage count

Mauro Carvalho Chehab <[email protected]>
media: exynos4-is: fix pm_runtime_get_sync() usage count

Mauro Carvalho Chehab <[email protected]>
media: sti/bdisp: fix pm_runtime_get_sync() usage count

Mauro Carvalho Chehab <[email protected]>
media: sunxi: fix pm_runtime_get_sync() usage count

Mauro Carvalho Chehab <[email protected]>
media: s5p-jpeg: fix pm_runtime_get_sync() usage count

Mauro Carvalho Chehab <[email protected]>
media: mtk-vcodec: fix PM runtime get logic

Mauro Carvalho Chehab <[email protected]>
media: sh_vou: fix pm_runtime_get_sync() usage count

Mauro Carvalho Chehab <[email protected]>
media: am437x: fix pm_runtime_get_sync() usage count

Mauro Carvalho Chehab <[email protected]>
media: s5p: fix pm_runtime_get_sync() usage count

Mauro Carvalho Chehab <[email protected]>
media: mdk-mdp: fix pm_runtime_get_sync() usage count

Mauro Carvalho Chehab <[email protected]>
media: marvel-ccic: fix some issues when getting pm_runtime

Mauro Carvalho Chehab <[email protected]>
media: i2c: imx334: fix the pm runtime get logic

Mauro Carvalho Chehab <[email protected]>
staging: media: rkvdec: fix pm_runtime_get_sync() usage count

Alexey Gladkov <[email protected]>
Add a reference to ucounts for each cred

Charles Keepax <[email protected]>
spi: Make of_register_spi_device also set the fwnode

Lukasz Luba <[email protected]>
thermal/cpufreq_cooling: Update offline CPUs per-cpu thermal_pressure

Miklos Szeredi <[email protected]>
fuse: reject internal errno

Miklos Szeredi <[email protected]>

    fuse: check connected before queueing on fpq->io

Miklos Szeredi <[email protected]>
fuse: ignore PG_workingset after stealing

Greg Kurz <[email protected]>
fuse: Fix infinite loop in sget_fc()

Greg Kurz <[email protected]>
fuse: Fix crash if superblock of submount gets killed early

Greg Kurz <[email protected]>
fuse: Fix crash in fuse_dentry_automount() error path

Roberto Sassu <[email protected]>
evm: Refuse EVM_ALLOW_METADATA_WRITES only if an HMAC key is loaded

Roberto Sassu <[email protected]>
evm: Execute evm_inode_init_security() only when an HMAC key is loaded

Kristian Klausen <[email protected]>
loop: Fix missing discard support when using LOOP_CONFIGURE

Kan Liang <[email protected]>
perf/x86/intel: Fix instructions:ppp support in Sapphire Rapids

Kan Liang <[email protected]>
perf/x86/intel: Add more events requires FRONTEND MSR on Sapphire Rapids

Kan Liang <[email protected]>
perf/x86/intel: Fix fixed counter check warning for some Alder Lake

Tejas Upadhyay <[email protected]>
x86/gpu: add JasperLake to gen11 early quirks

Michael Ellerman <[email protected]>
powerpc/stacktrace: Fix spurious "stale" traces in raise_backtrace_ipi()

Yun Zhou <[email protected]>
seq_buf: Make trace_seq_putmem_hex() support data longer than 8

Steven Rostedt (VMware) <[email protected]>
tracepoint: Add tracepoint_probe_register_may_exist() for BPF tracing

Steven Rostedt (VMware) <[email protected]>
tracing/histograms: Fix parsing of "sym-offset" modifier

Xiaochen Shen <[email protected]>
selftests/resctrl: Fix incorrect parsing of option "-t"

Martin Fuzzey <[email protected]>
rsi: fix AP mode with WPA failure due to encrypted EAPOL

Marek Vasut <[email protected]>
rsi: Assign beacon rate settings to the correct rate_info descriptor field

Michael Buesch <[email protected]>
ssb: sdio: Don't overwrite const buffer if block_write fails

Pali Rohár <[email protected]>
ath9k: Fix kernel NULL pointer dereference during ath_reset_internal()

Ondrej Zary <[email protected]>
serial_cs: remove wrong GLOBETROTTER.cis entry

Ondrej Zary <[email protected]>
serial_cs: Add Option International GSM-Ready 56K/ISDN modem

Yoshihiro Shimoda <[email protected]>
serial: sh-sci: Stop dmaengine transfer in sci_stop_tx()

Pali Rohár <[email protected]>
serial: mvebu-uart: fix calculation of clock divisor

Hans de Goede <[email protected]>
iio: accel: bmc150: Don't make the remove function of the second accelerometer unregister itself

Hans de Goede <[email protected]>
iio: accel: bmc150: Fix dereferencing the wrong pointer in bmc150_get/set_second_device

Stephan Gerhold <[email protected]>
iio: accel: bmc150: Fix bma222 scale unit

Stephan Gerhold <[email protected]>
iio: accel: bma180: Fix BMA25x bandwidth register values

Oliver Lang <[email protected]>
iio: ltr501: ltr501_read_ps(): add missing endianness conversion

Oliver Lang <[email protected]>
iio: ltr501: ltr559: fix initialization of LTR501_ALS_CONTR

Marc Kleine-Budde <[email protected]>
iio: ltr501: mark register holding upper 8 bits of ALS_DATA{0,1} and PS_DATA as volatile, too

frank zago <[email protected]>
iio: light: tcs3472: do not free unallocated IRQ

Yang Yingliang <[email protected]>
iio: frequency: adf4350: disable reg and clk on error in adf4350_probe()

Martin Fuzzey <[email protected]>
rtc: stm32: Fix unbalanced clk_disable_unprepare() on probe error path

Dinh Nguyen <[email protected]>
clk: agilex/stratix10: add support for the 2nd bypass

Dinh Nguyen <[email protected]>
clk: agilex/stratix10: fix bypass representation

Dinh Nguyen <[email protected]>
clk: agilex/stratix10: remove noc_clk

Dinh Nguyen <[email protected]>
clk: agilex/stratix10/n5x: fix how the bypass_reg is handled

Damien Le Moal <[email protected]>

    clk: k210: Fix k210_clk_set_parent()

Shin'ichiro Kawasaki <[email protected]>
f2fs: Prevent swap file in LFS mode

Daniel Rosenberg <[email protected]>
f2fs: Advertise encrypted casefolding in sysfs

Janosch Frank <[email protected]>
s390: mm: Fix secure storage access exception handling

Vineeth Vijayan <[email protected]>
s390/cio: dont call css_wait_for_slow_path() inside a lock

Sean Christopherson <[email protected]>
KVM: x86: Force all MMUs to reinitialize if guest CPUID is modified

Sean Christopherson <[email protected]>
KVM: x86: Properly reset MMU context at vCPU RESET/INIT

Sean Christopherson <[email protected]>
KVM: x86/mmu: Use MMU's role to detect CR4.SMEP value in nested NPT walk

Sean Christopherson <[email protected]>
KVM: x86/mmu: Treat NX as used (not reserved) for all !TDP shadow MMUs

Sean Christopherson <[email protected]>
KVM: x86/mmu: Remove broken WARN that fires on 32-bit KVM w/ nested EPT

Nathan Chancellor <[email protected]>
KVM: PPC: Book3S HV: Workaround high stack usage with clang

Sean Christopherson <[email protected]>
KVM: nVMX: Handle split-lock #AC exceptions that happen in L2

Robin Murphy <[email protected]>
perf/smmuv3: Don't trample existing events with global filter

Jann Horn <[email protected]>
mm/gup: fix try_grab_compound_head() race with split_huge_page()

Christophe JAILLET <[email protected]>
bus: mhi: pci-generic: Add missing 'pci_disable_pcie_error_reporting()' calls

Baochen Qiang <[email protected]>
bus: mhi: Wait for M2 state during system resume

Loic Poulain <[email protected]>
bus: mhi: core: Fix power down latency

Zhang Xiaoxu <[email protected]>
SUNRPC: Should wake up the privileged task firstly.

Zhang Xiaoxu <[email protected]>
SUNRPC: Fix the batch tasks count wraparound.

Abinaya Kalaiselvan <[email protected]>
mac80211: fix NULL ptr dereference during mesh peer connection for non HE devices

Felix Fietkau <[email protected]>
mac80211: remove iwlwifi specific workaround that broke sta NDP tx

Stephane Grosjean <[email protected]>
can: peak_pciefd: pucan_handle_status(): fix a potential starvation issue in TX path

Oleksij Rempel <[email protected]>
can: j1939: j1939_sk_init(): set SOCK_RCU_FREE to call sk_destruct() after RCU is done

Oliver Hartkopp <[email protected]>
can: isotp: isotp_release(): omit unintended hrtimer restart on socket release

Oliver Hartkopp <[email protected]>
can: gw: synchronize rcu operations before removing gw job entry

Thadeu Lima de Souza Cascardo <[email protected]>
can: bcm: delay release of struct bcm_op after synchronize_rcu()

Stephen Brennan <[email protected]>
ext4: use ext4_grp_locked_error in mb_find_extent

Pan Dong <[email protected]>
ext4: fix avefreec in find_group_orlov

Zhang Yi <[email protected]>
ext4: remove check for zero nr_to_scan in ext4_es_scan()

Zhang Yi <[email protected]>
ext4: correct the cache_nr in tracepoint ext4_es_shrink_exit

Yang Yingliang <[email protected]>
ext4: return error code when ext4_fill_flex_info() fails

Jan Kara <[email protected]>
ext4: fix overflow in ext4_iomap_alloc()

Anirudh Rayabharam <[email protected]>
ext4: fix kernel infoleak via ext4_extent_header

Zhang Yi <[email protected]>
ext4: cleanup in-core orphan list if ext4_truncate() failed to get a transaction handle

David Sterba <[email protected]>
btrfs: clear defrag status of a root if starting transaction fails

Naohiro Aota <[email protected]>
btrfs: fix unbalanced unlock in qgroup_account_snapshot()

David Sterba <[email protected]>
btrfs: compression: don't try to compress if we don't have enough pages

Filipe Manana <[email protected]>
btrfs: send: fix invalid path for unlink operations after parent orphanization

Johannes Thumshirn <[email protected]>
btrfs: zoned: bail out if we can't read a reliable write pointer

Naohiro Aota <[email protected]>
btrfs: zoned: print message when zone sanity check type fails

Ludovic Desroches <[email protected]>
ARM: dts: at91: sama5d4: fix pinctrl muxing

Linus Walleij <[email protected]>
ARM: dts: ux500: Fix LED probing

Yang Jihong <[email protected]>
arm_pmu: Fix write counter incorrect in ARMv7 big-endian mode

Joerg Roedel <[email protected]>
crypto: ccp - Annotate SEV Firmware file names

Kees Cook <[email protected]>
crypto: nx - Fix memcpy() over-reading in nonce

Alexander Larkin <[email protected]>
Input: joydev - prevent use of not validated data in JSIOCSBTNMAP ioctl

Takashi Iwai <[email protected]>
Input: elants_i2c - fix NULL dereference at probing

Al Viro <[email protected]>
iov_iter_fault_in_readable() should do nothing in xarray case

Al Viro <[email protected]>
teach copy_page_to_iter() to handle compound pages

Al Viro <[email protected]>
copy_page_to_iter(): fix ITER_DISCARD case

Kees Cook <[email protected]>
selftests/lkdtm: Avoid needing explicit sub-shell

Desmond Cheong Zhi Xi <[email protected]>
ntfs: fix validity check for file name attribute

Andreas Gruenbacher <[email protected]>
gfs2: Fix error handling in init_statfs

Andreas Gruenbacher <[email protected]>
gfs2: Fix underflow in gfs2_page_mkwrite

Mike Rapoport <[email protected]>
mm/page_alloc: fix memory map initialization for descending nodes

Zhangjiantao (Kirin, nanjing) <[email protected]>
xhci: solve a double free problem while doing s4

Jing Xiangfeng <[email protected]>
usb: typec: Add the missed altmode_id_remove() in typec_register_altmode()

Kyle Tso <[email protected]>
usb: typec: tcpm: Relax disconnect threshold during power negotiation

Badhri Jagan Sridharan <[email protected]>
usb: typec: tcpci: Fix up sink disconnect thresholds for PD

Minas Harutyunyan <[email protected]>
usb: dwc3: Fix debugfs creation flow

Hannu Hartikainen <[email protected]>
USB: cdc-acm: blacklist Heimann USB Appset device

Moritz Fischer <[email protected]>
usb: renesas-xhci: Fix handling of unknown ROM state

Linyu Yuan <[email protected]>
usb: gadget: eem: fix echo command packet response issue

Pavel Skripkin <[email protected]>
net: can: ems_usb: fix use-after-free in ems_usb_disconnect()

Johan Hovold <[email protected]>
Input: usbtouchscreen - fix control-request directions

Pavel Skripkin <[email protected]>
media: dvb-usb: fix wrong definition

Frank Schäfer <[email protected]>
ALSA: hda/realtek: fix mute led of the HP Pavilion 15-eh1xxx series

Jeremy Szu <[email protected]>
ALSA: hda/realtek: fix mute/micmute LEDs for HP EliteBook 830 G8 Notebook PC

Takashi Iwai <[email protected]>
ALSA: hda/realtek: Apply LED fixup for HP Dragonfly G1, too

Takashi Iwai <[email protected]>
ALSA: hda/realtek: Fix bass speaker DAC mapping for Asus UM431D

Elia Devito <[email protected]>

    ALSA: hda/realtek: Improve fixup for HP Spectre x360 15-df0xxx

Jeremy Szu <[email protected]>
ALSA: hda/realtek: fix mute/micmute LEDs for HP EliteBook x360 830 G8

Takashi Iwai <[email protected]>
ALSA: hda/realtek: Add another ALC236 variant support

Andy Chi <[email protected]>
ALSA: hda/realtek: fix mute/micmute LEDs for HP ProBook 630 G8

Andy Chi <[email protected]>
ALSA: hda/realtek: fix mute/micmute LEDs for HP ProBook 445 G8

Andy Chi <[email protected]>
ALSA: hda/realtek: fix mute/micmute LEDs for HP ProBook 450 G8

Takashi Iwai <[email protected]>
ALSA: intel8x0: Fix breakage at ac97 clock measurement

Takashi Iwai <[email protected]>
ALSA: usb-audio: scarlett2: Fix wrong resume call

Takashi Sakamoto <[email protected]>
ALSA: firewire-motu: fix stream format for MOTU 8pre FireWire

Takashi Iwai <[email protected]>
ALSA: usb-audio: Fix OOB access at proc output

Daehwan Jung <[email protected]>
ALSA: usb-audio: fix rate on Ozone Z90 USB headset

Takashi Sakamoto <[email protected]>
ALSA: bebob: fix rx packet format for Yamaha GO44/GO46, Terratec Phase 24/x24

Szymon Janc <[email protected]>
Bluetooth: Remove spurious error message

Connor Abbott <[email protected]>
Bluetooth: btqca: Don't modify firmware contents in-place

Pavel Skripkin <[email protected]>
Bluetooth: hci_qca: fix potential GPF

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

Diffstat:

 Documentation/ABI/testing/evm                      |  26 +-
 Documentation/ABI/testing/sysfs-bus-papr-pmem      |   8 +-
 Documentation/admin-guide/kernel-parameters.txt    |   6 +
 Documentation/hwmon/max31790.rst                   |   5 +-
 .../userspace-api/media/v4l/ext-ctrls-codec.rst    |   5 +-
 Documentation/userspace-api/seccomp_filter.rst     |  12 +
 Makefile                                           |   6 +-
 arch/alpha/kernel/smp.c                            |   1 -
 arch/arc/kernel/smp.c                              |   1 -
 arch/arm/boot/dts/sama5d4.dtsi                     |   2 +-
 arch/arm/boot/dts/ste-href.dtsi                    |   7 +
 arch/arm/kernel/perf_event_v7.c                    |   4 +-
 arch/arm/kernel/smp.c                              |   1 -
 arch/arm64/boot/dts/marvell/armada-37xx.dtsi       |   2 +-
 arch/arm64/include/asm/kvm_host.h                  |   1 +
 arch/arm64/include/asm/mmu_context.h               |   4 +-
 arch/arm64/include/asm/preempt.h                   |   2 +-
 arch/arm64/kernel/Makefile                         |   5 +
 arch/arm64/kernel/perf_event.c                     |   2 +-
 arch/arm64/kernel/setup.c                          |   2 +-
 arch/arm64/kernel/smp.c                            |   1 -
 arch/arm64/kvm/arm.c                               |   4 +
 arch/arm64/kvm/pmu-emul.c                          |   4 +
 arch/csky/kernel/smp.c                             |   1 -
 arch/csky/mm/syscache.c                            |  12 +-
 arch/ia64/kernel/mca_drv.c                         |   2 +-
 arch/ia64/kernel/smpboot.c                         |   1 -
 arch/m68k/Kconfig.machine                          |   3 +
 arch/mips/include/asm/highmem.h                    |   2 +-
 arch/mips/kernel/smp.c                             |   1 -
 arch/openrisc/kernel/smp.c                         |   2 -
 arch/parisc/kernel/smp.c                           |   1 -
 arch/powerpc/include/asm/cputhreads.h              |  30 ++
 arch/powerpc/include/asm/interrupt.h               |   3 +
 arch/powerpc/include/asm/kvm_guest.h               |   4 +-
 arch/powerpc/kernel/firmware.c                     |  10 +-
 arch/powerpc/kernel/mce_power.c                    |  48 +-
 arch/powerpc/kernel/process.c                      |  48 +-
 arch/powerpc/kernel/smp.c                          |  12 +-
 arch/powerpc/kernel/stacktrace.c                   |  26 +-
 arch/powerpc/kvm/book3s_hv.c                       |  13 +-
 arch/powerpc/kvm/book3s_hv_builtin.c               |   2 +-
 arch/powerpc/kvm/book3s_hv_nested.c                |   3 +-
 arch/powerpc/kvm/book3s_hv_rm_mmu.c                |   2 +-
 arch/powerpc/mm/book3s64/hash_utils.c              |  24 +-
 arch/powerpc/platforms/pseries/papr_scm.c          |  62 ++-
 arch/powerpc/platforms/pseries/smp.c               |   4 +-
 arch/riscv/kernel/smpboot.c                        |   1 -
 arch/s390/Kconfig                                  |   3 +-
 arch/s390/boot/uv.c                                |   1 +
 arch/s390/include/asm/pgtable.h                    |  21 +-
 arch/s390/include/asm/preempt.h                    |   4 +-
 arch/s390/include/asm/uv.h                         |   8 +-
 arch/s390/kernel/smp.c                             |   1 -
 arch/s390/kernel/uv.c                              |  10 +
 arch/s390/kvm/kvm-s390.c                           |  18 +-
 arch/s390/mm/fault.c                               |  26 ++
 arch/sh/kernel/smp.c                               |   2 -
 arch/sparc/kernel/smp_32.c                         |   1 -
 arch/sparc/kernel/smp_64.c                         |   3 -
 arch/x86/crypto/curve25519-x86_64.c                |   2 +-
 arch/x86/entry/entry_64.S                          |   4 +-
 arch/x86/events/core.c                             |  28 +-
 arch/x86/events/intel/core.c                       |  15 +-
 arch/x86/events/perf_event.h                       |   1 +
 arch/x86/include/asm/idtentry.h                    |  29 +-
 arch/x86/include/asm/kvm_host.h                    |   3 +-
 arch/x86/include/asm/perf_event.h                  |   1 +
 arch/x86/include/asm/preempt.h                     |   2 +-
 arch/x86/include/uapi/asm/hwcap2.h                 |   6 +-
 arch/x86/kernel/cpu/mshyperv.c                     |   2 +-
 arch/x86/kernel/early-quirks.c                     |   1 +
 arch/x86/kernel/sev.c                              | 184 ++++----
 arch/x86/kernel/smpboot.c                          |   1 -
 arch/x86/kernel/tsc.c                              |   3 +-
 arch/x86/kvm/cpuid.c                               |   6 +-
 arch/x86/kvm/hyperv.c                              |   2 +-
 arch/x86/kvm/mmu/mmu.c                             |  22 +-
 arch/x86/kvm/mmu/paging_tmpl.h                     |   3 +-
 arch/x86/kvm/mmu/spte.c                            |   7 -
 arch/x86/kvm/mmu/tdp_mmu.c                         |   8 +-
 arch/x86/kvm/vmx/nested.c                          |  41 +-
 arch/x86/kvm/vmx/vmcs.h                            |   5 +
 arch/x86/kvm/vmx/vmx.c                             |   4 +-
 arch/x86/kvm/vmx/vmx.h                             |   1 +
 arch/x86/kvm/x86.c                                 |  15 +-
 arch/x86/mm/tlb.c                                  |  10 +-
 arch/x86/net/bpf_jit_comp.c                        |   2 +-
 arch/xtensa/kernel/smp.c                           |   1 -
 block/bfq-iosched.c                                |  57 ++-
 block/bio.c                                        |  13 +-
 block/blk-flush.c                                  |   3 +-
 block/blk-merge.c                                  |   8 +-
 block/blk-mq-tag.c                                 |  49 ++-
 block/blk-mq-tag.h                                 |   6 +
 block/blk-mq.c                                     |  63 ++-
 block/blk-mq.h                                     |   1 +
 block/blk-rq-qos.h                                 |  24 +
 block/blk-wbt.c                                    |  11 +-
 block/blk-wbt.h                                    |   1 +
 crypto/ecdh.c                                      |  12 +-
 crypto/shash.c                                     |  18 +-
 crypto/sm2.c                                       |  24 +-
 crypto/testmgr.c                                   |   3 -
 crypto/testmgr.h                                   |  10 +-
 drivers/acpi/Makefile                              |   5 +
 drivers/acpi/acpi_fpdt.c                           |   4 +-
 drivers/acpi/acpica/nsrepair2.c                    |   7 +
 drivers/acpi/apei/ghes.c                           |  81 +++-
 drivers/acpi/bgrt.c                                |  57 +--
 drivers/acpi/bus.c                                 |   1 +
 drivers/acpi/device_pm.c                           |   6 +-
 drivers/acpi/device_sysfs.c                        |   2 +-
 drivers/acpi/ec.c                                  |  37 +-
 drivers/acpi/fan.c                                 |   7 +-
 drivers/acpi/fan.h                                 |  13 +
 drivers/acpi/processor_idle.c                      |  40 ++
 drivers/acpi/resource.c                            |   9 +-
 drivers/acpi/scan.c                                |  60 ++-
 drivers/acpi/x86/s2idle.c                          |   4 +
 drivers/ata/pata_ep93xx.c                          |   2 +-
 drivers/ata/pata_octeon_cf.c                       |   5 +-
 drivers/ata/pata_rb532_cf.c                        |   6 +-
 drivers/ata/sata_highbank.c                        |   6 +-
 drivers/block/loop.c                               |   1 +
 drivers/bluetooth/btqca.c                          |  27 +-
 drivers/bluetooth/hci_qca.c                        |   4 +-
 drivers/bluetooth/virtio_bt.c                      |   3 +
 drivers/bus/mhi/core/pm.c                          |  19 +-
 drivers/bus/mhi/pci_generic.c                      |   5 +-
 drivers/char/hw_random/exynos-trng.c               |   4 +-
 drivers/char/pcmcia/cm4000_cs.c                    |   4 +
 drivers/char/tpm/tpm_tis_core.c                    |  25 +-
 drivers/char/tpm/tpm_tis_core.h                    |   3 +-
 drivers/char/tpm/tpm_tis_spi_main.c                |   2 +
 drivers/clk/actions/owl-s500.c                     |  75 ++--
 drivers/clk/clk-k210.c                             |   1 +
 drivers/clk/clk-si5341.c                           |  77 +++-
 drivers/clk/clk-versaclock5.c                      |  27 +-
 drivers/clk/imx/clk-imx8mq.c                       |  56 +--
 drivers/clk/meson/g12a.c                           |   2 +-
 drivers/clk/qcom/clk-alpha-pll.c                   |   2 +-
 drivers/clk/qcom/gcc-sc7280.c                      |   1 +
 drivers/clk/rockchip/clk-rk3568.c                  |  10 +-
 drivers/clk/socfpga/clk-agilex.c                   |  93 ++--
 drivers/clk/socfpga/clk-gate-s10.c                 | 119 ++++-
 drivers/clk/socfpga/clk-periph-s10.c               |  11 +-
 drivers/clk/socfpga/clk-s10.c                      |  87 ++--
 drivers/clk/socfpga/stratix10-clk.h                |   2 +
 drivers/clk/sunxi-ng/ccu-sun8i-v3s.c               |   4 +-
 drivers/clk/tegra/clk-tegra30.c                    |   2 +-
 drivers/clk/zynqmp/clk-mux-zynqmp.c                |  10 +-
 drivers/clk/zynqmp/pll.c                           |  22 +-
 drivers/clocksource/timer-ti-dm.c                  |   6 +
 drivers/cpufreq/cpufreq.c                          |  11 +-
 drivers/crypto/cavium/nitrox/nitrox_isr.c          |   4 +
 drivers/crypto/ccp/sev-dev.c                       |   4 +
 drivers/crypto/ccp/sp-pci.c                        |   6 +-
 drivers/crypto/hisilicon/hpre/hpre_crypto.c        |  18 +
 drivers/crypto/hisilicon/sec2/sec_crypto.c         |   4 +-
 drivers/crypto/ixp4xx_crypto.c                     |  24 +-
 drivers/crypto/nx/nx-842-pseries.c                 |   9 +-
 drivers/crypto/nx/nx-aes-ctr.c                     |   2 +-
 drivers/crypto/omap-sham.c                         |   4 +-
 drivers/crypto/qat/qat_common/qat_hal.c            |   6 +-
 drivers/crypto/qat/qat_common/qat_uclo.c           |   1 -
 drivers/crypto/qce/skcipher.c                      |  15 +-
 drivers/crypto/sa2ul.c                             |  34 +-
 drivers/crypto/ux500/hash/hash_core.c              |   1 +
 drivers/devfreq/devfreq.c                          |   1 +
 drivers/devfreq/governor_passive.c                 |   3 +-
 drivers/edac/Kconfig                               |   3 +-
 drivers/edac/aspeed_edac.c                         |   4 +-
 drivers/edac/i10nm_base.c                          |   3 +
 drivers/edac/pnd2_edac.c                           |   3 +
 drivers/edac/sb_edac.c                             |   3 +
 drivers/edac/skx_base.c                            |   3 +
 drivers/edac/ti_edac.c                             |   1 +
 drivers/extcon/extcon-max8997.c                    |   3 +-
 drivers/extcon/extcon-sm5502.c                     |   1 -
 drivers/firmware/stratix10-svc.c                   |  22 +-
 drivers/fsi/fsi-core.c                             |   4 +-
 drivers/fsi/fsi-occ.c                              |   1 +
 drivers/fsi/fsi-sbefifo.c                          |  10 +-
 drivers/fsi/fsi-scom.c                             |  16 +-
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |  21 +-
 .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c    |   3 +
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c   |   2 +-
 drivers/gpu/drm/amd/display/dc/inc/dc_link_dp.h    |   4 +
 drivers/gpu/drm/ast/ast_main.c                     |   4 +-
 drivers/gpu/drm/bridge/Kconfig                     |   3 +-
 drivers/gpu/drm/bridge/analogix/anx7625.c          |   2 +-
 drivers/gpu/drm/drm_bridge.c                       |   3 +
 drivers/gpu/drm/i915/display/skl_universal_plane.c |   6 +-
 drivers/gpu/drm/i915/gt/selftest_execlists.c       |  55 ++-
 drivers/gpu/drm/imx/ipuv3-plane.c                  |  57 ++-
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c           |   4 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c           |   8 +-
 drivers/gpu/drm/msm/dp/dp_catalog.c                |   5 +-
 drivers/gpu/drm/msm/dp/dp_ctrl.c                   |  55 +++
 drivers/gpu/drm/msm/dp/dp_ctrl.h                   |   2 +
 drivers/gpu/drm/msm/dp/dp_display.c                |  57 ++-
 drivers/gpu/drm/msm/msm_drv.c                      |   1 +
 drivers/gpu/drm/pl111/Kconfig                      |   1 +
 drivers/gpu/drm/qxl/qxl_dumb.c                     |   2 +
 drivers/gpu/drm/rockchip/cdn-dp-core.c             |   1 +
 drivers/gpu/drm/rockchip/cdn-dp-reg.c              |   2 +-
 drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c    |  36 +-
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c        |   1 +
 drivers/gpu/drm/rockchip/rockchip_lvds.c           |   4 +-
 drivers/gpu/drm/vc4/vc4_crtc.c                     |  63 ++-
 drivers/gpu/drm/vc4/vc4_hdmi.c                     |   4 +-
 .../drm/vmwgfx/device_include/svga3d_surfacedefs.h |   8 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c            |  20 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_surface.c            |  13 +
 drivers/hid/hid-core.c                             |  10 +-
 drivers/hid/hid-ids.h                              |   1 +
 drivers/hid/hid-input.c                            |   2 +
 drivers/hid/hid-sony.c                             |  98 ++---
 drivers/hid/surface-hid/surface_hid.c              |   2 +-
 drivers/hid/wacom_wac.h                            |   2 +-
 drivers/hv/connection.c                            |   4 +-
 drivers/hv/hv_util.c                               |   4 +-
 drivers/hwmon/lm70.c                               |  26 +-
 drivers/hwmon/max31722.c                           |   9 -
 drivers/hwmon/max31790.c                           |  49 ++-
 drivers/hwmon/pmbus/bpa-rs600.c                    |  29 ++
 drivers/hwtracing/coresight/coresight-core.c       |   2 +-
 drivers/i2c/busses/i2c-mpc.c                       |   2 +
 drivers/iio/accel/bma180.c                         |  19 +-
 drivers/iio/accel/bma220_spi.c                     |  10 +-
 drivers/iio/accel/bmc150-accel-core.c              |  21 +-
 drivers/iio/accel/bmc150-accel-i2c.c               |   2 +-
 drivers/iio/accel/bmc150-accel.h                   |   2 +-
 drivers/iio/accel/hid-sensor-accel-3d.c            |  13 +-
 drivers/iio/accel/kxcjk-1013.c                     |  24 +-
 drivers/iio/accel/mxc4005.c                        |  10 +-
 drivers/iio/accel/stk8312.c                        |  12 +-
 drivers/iio/accel/stk8ba50.c                       |  17 +-
 drivers/iio/adc/at91-sama5d2_adc.c                 |   3 +-
 drivers/iio/adc/hx711.c                            |   4 +-
 drivers/iio/adc/mxs-lradc-adc.c                    |   3 +-
 drivers/iio/adc/ti-ads1015.c                       |  12 +-
 drivers/iio/adc/ti-ads8688.c                       |   3 +-
 drivers/iio/adc/vf610_adc.c                        |  10 +-
 drivers/iio/chemical/atlas-sensor.c                |   4 +-
 drivers/iio/dummy/Kconfig                          |   1 +
 drivers/iio/frequency/adf4350.c                    |   6 +-
 drivers/iio/gyro/bmg160_core.c                     |  10 +-
 drivers/iio/humidity/am2315.c                      |  16 +-
 drivers/iio/imu/adis16400.c                        |   3 -
 drivers/iio/imu/adis16475.c                        |   2 +-
 drivers/iio/imu/adis_buffer.c                      |   3 -
 drivers/iio/light/isl29125.c                       |  10 +-
 drivers/iio/light/ltr501.c                         |  15 +-
 drivers/iio/light/tcs3414.c                        |  10 +-
 drivers/iio/light/tcs3472.c                        |  16 +-
 drivers/iio/light/vcnl4000.c                       |   2 +-
 drivers/iio/light/vcnl4035.c                       |   3 +-
 drivers/iio/magnetometer/bmc150_magn.c             |  11 +-
 drivers/iio/magnetometer/hmc5843.h                 |   8 +-
 drivers/iio/magnetometer/hmc5843_core.c            |   4 +-
 drivers/iio/magnetometer/rm3100-core.c             |   3 +-
 drivers/iio/potentiostat/lmp91000.c                |   4 +-
 drivers/iio/proximity/as3935.c                     |  10 +-
 drivers/iio/proximity/isl29501.c                   |   2 +-
 drivers/iio/proximity/pulsedlight-lidar-lite-v2.c  |  10 +-
 drivers/iio/proximity/srf08.c                      |  14 +-
 drivers/infiniband/core/cm.c                       | 427 +++++++++---------
 drivers/infiniband/core/cma.c                      |  28 +-
 drivers/infiniband/core/uverbs_cmd.c               |  21 +-
 drivers/infiniband/hw/hns/hns_roce_hw_v2.c         |  61 ++-
 drivers/infiniband/hw/hns/hns_roce_hw_v2.h         |   3 +
 drivers/infiniband/hw/hns/hns_roce_mr.c            |   2 +-
 drivers/infiniband/hw/mlx4/qp.c                    |   9 +-
 drivers/infiniband/hw/mlx5/main.c                  |   7 +-
 drivers/infiniband/hw/mlx5/qp.c                    |   6 +-
 drivers/infiniband/sw/rxe/rxe_net.c                |  10 +-
 drivers/infiniband/sw/rxe/rxe_qp.c                 |   1 -
 drivers/infiniband/sw/rxe/rxe_resp.c               |   2 -
 drivers/infiniband/ulp/iser/iscsi_iser.c           |   2 +
 drivers/infiniband/ulp/rtrs/rtrs-clt.c             |  28 +-
 drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c       |   1 +
 drivers/infiniband/ulp/rtrs/rtrs-srv.c             |  39 +-
 drivers/infiniband/ulp/rtrs/rtrs.c                 |   1 -
 drivers/infiniband/ulp/srp/ib_srp.c                |  13 +-
 drivers/input/joydev.c                             |   2 +-
 drivers/input/keyboard/Kconfig                     |   3 -
 drivers/input/keyboard/hil_kbd.c                   |   1 +
 drivers/input/touchscreen/elants_i2c.c             |   6 +-
 drivers/input/touchscreen/goodix.c                 |  52 ---
 drivers/input/touchscreen/usbtouchscreen.c         |   8 +-
 drivers/iommu/amd/amd_iommu.h                      |   2 -
 drivers/iommu/amd/init.c                           |   9 +-
 drivers/iommu/amd/iommu.c                          |  31 +-
 drivers/iommu/dma-iommu.c                          |   6 +-
 drivers/leds/Kconfig                               |   1 +
 drivers/leds/blink/leds-lgm-sso.c                  |  44 +-
 drivers/leds/led-class.c                           |   4 -
 drivers/leds/leds-as3645a.c                        |   1 +
 drivers/leds/leds-ktd2692.c                        |  27 +-
 drivers/leds/leds-lm36274.c                        |   1 +
 drivers/leds/leds-lm3692x.c                        |   8 +-
 drivers/leds/leds-lm3697.c                         |   8 +-
 drivers/leds/leds-lp50xx.c                         |   2 +-
 drivers/mailbox/qcom-apcs-ipc-mailbox.c            |   2 +-
 drivers/mailbox/qcom-ipcc.c                        |   6 +
 drivers/md/md.c                                    |  45 --
 drivers/md/md.h                                    |   1 -
 drivers/media/cec/platform/s5p/s5p_cec.c           |   7 +-
 drivers/media/common/siano/smscoreapi.c            |  22 +-
 drivers/media/common/siano/smscoreapi.h            |   4 +-
 drivers/media/common/siano/smsdvb-main.c           |   4 +
 drivers/media/dvb-core/dvb_net.c                   |  25 +-
 drivers/media/dvb-core/dvbdev.c                    |   3 +
 drivers/media/i2c/ccs/ccs-core.c                   |   2 +-
 drivers/media/i2c/imx334.c                         |   7 +-
 drivers/media/i2c/ir-kbd-i2c.c                     |   4 +-
 drivers/media/i2c/ov2659.c                         |  24 +-
 drivers/media/i2c/rdacm21.c                        |  56 ++-
 drivers/media/i2c/s5c73m3/s5c73m3-core.c           |   6 +-
 drivers/media/i2c/s5c73m3/s5c73m3.h                |   2 +-
 drivers/media/i2c/s5k4ecgx.c                       |  10 +-
 drivers/media/i2c/s5k5baf.c                        |   6 +-
 drivers/media/i2c/s5k6aa.c                         |  10 +-
 drivers/media/i2c/tc358743.c                       |   1 +
 drivers/media/mc/Makefile                          |   2 +-
 drivers/media/pci/bt8xx/bt878.c                    |   6 +-
 drivers/media/pci/cobalt/cobalt-driver.c           |   1 +
 drivers/media/pci/cobalt/cobalt-driver.h           |   7 +-
 drivers/media/pci/intel/ipu3/cio2-bridge.c         |  10 +-
 drivers/media/platform/am437x/am437x-vpfe.c        |  15 +-
 drivers/media/platform/exynos-gsc/gsc-m2m.c        |   4 +-
 drivers/media/platform/exynos4-is/fimc-capture.c   |   6 +-
 drivers/media/platform/exynos4-is/fimc-is.c        |   4 +-
 drivers/media/platform/exynos4-is/fimc-isp-video.c |  10 +-
 drivers/media/platform/exynos4-is/fimc-isp.c       |   7 +-
 drivers/media/platform/exynos4-is/fimc-lite.c      |   5 +-
 drivers/media/platform/exynos4-is/fimc-m2m.c       |   5 +-
 drivers/media/platform/exynos4-is/media-dev.c      |  10 +-
 drivers/media/platform/exynos4-is/mipi-csis.c      |  10 +-
 drivers/media/platform/marvell-ccic/mcam-core.c    |   9 +-
 drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c       |   6 +-
 .../media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c |   4 +-
 .../media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c  |   8 +-
 .../media/platform/mtk-vcodec/mtk_vcodec_dec_pm.h  |   2 +-
 drivers/media/platform/mtk-vpu/mtk_vpu.c           |   6 +
 drivers/media/platform/qcom/venus/core.c           |  60 ++-
 drivers/media/platform/qcom/venus/hfi_cmds.c       |  22 +-
 drivers/media/platform/s5p-g2d/g2d.c               |   3 +
 drivers/media/platform/s5p-jpeg/jpeg-core.c        |   5 +-
 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c       |   1 +
 drivers/media/platform/sh_vou.c                    |   6 +-
 drivers/media/platform/sti/bdisp/Makefile          |   2 +-
 drivers/media/platform/sti/bdisp/bdisp-v4l2.c      |   7 +-
 drivers/media/platform/sti/delta/Makefile          |   2 +-
 drivers/media/platform/sti/hva/Makefile            |   2 +-
 drivers/media/platform/sti/hva/hva-hw.c            |   3 +-
 .../platform/sunxi/sun8i-rotate/sun8i_rotate.c     |   2 +-
 drivers/media/platform/video-mux.c                 |  10 +-
 drivers/media/usb/au0828/au0828-core.c             |   4 +-
 drivers/media/usb/cpia2/cpia2.h                    |   1 +
 drivers/media/usb/cpia2/cpia2_core.c               |  12 +
 drivers/media/usb/cpia2/cpia2_usb.c                |  13 +-
 drivers/media/usb/dvb-usb/cinergyT2-core.c         |   2 +
 drivers/media/usb/dvb-usb/cxusb.c                  |   2 +-
 drivers/media/usb/em28xx/em28xx-input.c            |   8 +-
 drivers/media/usb/gspca/gl860/gl860.c              |   4 +-
 drivers/media/usb/pvrusb2/pvrusb2-hdw.c            |   4 +-
 drivers/media/v4l2-core/v4l2-fh.c                  |   1 +
 drivers/media/v4l2-core/v4l2-ioctl.c               |  12 +-
 drivers/media/v4l2-core/v4l2-subdev.c              |  24 -
 drivers/memstick/host/rtsx_usb_ms.c                |  10 +-
 drivers/mfd/Kconfig                                |   1 +
 drivers/mfd/mfd-core.c                             |  15 +-
 drivers/mfd/rn5t618.c                              |   2 +-
 drivers/misc/eeprom/idt_89hpesx.c                  |   8 +-
 drivers/misc/habanalabs/common/habanalabs_drv.c    |   1 +
 drivers/misc/pvpanic/pvpanic-mmio.c                |   3 +-
 drivers/misc/pvpanic/pvpanic-pci.c                 |   9 +-
 drivers/mmc/core/block.c                           |   8 +
 drivers/mmc/host/sdhci-of-aspeed.c                 |   2 +-
 drivers/mmc/host/sdhci-sprd.c                      |   1 +
 drivers/mmc/host/usdhi6rol0.c                      |   1 +
 drivers/mmc/host/via-sdmmc.c                       |   3 +
 drivers/mmc/host/vub300.c                          |   2 +-
 drivers/mtd/nand/raw/arasan-nand-controller.c      |  90 ++--
 drivers/mtd/nand/raw/marvell_nand.c                |   4 +-
 drivers/mtd/nand/spi/core.c                        |  17 +-
 drivers/mtd/parsers/qcomsmempart.c                 |  10 +
 drivers/mtd/parsers/redboot.c                      |   7 +-
 drivers/mtd/spi-nor/otp.c                          |  43 +-
 drivers/net/Kconfig                                |   1 +
 drivers/net/can/peak_canfd/peak_canfd.c            |   4 +-
 drivers/net/can/usb/ems_usb.c                      |   3 +-
 drivers/net/dsa/mv88e6xxx/chip.c                   |   6 +-
 drivers/net/dsa/sja1105/sja1105_main.c             |   6 +
 drivers/net/ethernet/aeroflex/greth.c              |   3 +-
 drivers/net/ethernet/aquantia/atlantic/aq_macsec.h |   4 +-
 drivers/net/ethernet/broadcom/bcm4908_enet.c       |   6 +-
 drivers/net/ethernet/broadcom/genet/bcmgenet.c     |   1 +
 drivers/net/ethernet/emulex/benet/be_cmds.c        |   6 +-
 drivers/net/ethernet/emulex/benet/be_main.c        |   2 +
 drivers/net/ethernet/ezchip/nps_enet.c             |   4 +-
 drivers/net/ethernet/faraday/ftgmac100.c           |   6 +-
 drivers/net/ethernet/google/gve/gve_main.c         |   4 +-
 drivers/net/ethernet/ibm/ehea/ehea_main.c          |   9 +-
 drivers/net/ethernet/ibm/ibmvnic.c                 |  99 ++++-
 drivers/net/ethernet/intel/e1000e/netdev.c         |  24 +-
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c     |   3 +-
 drivers/net/ethernet/intel/i40e/i40e_main.c        |  17 +-
 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c    |   2 +
 drivers/net/ethernet/marvell/pxa168_eth.c          |   2 +-
 drivers/net/ethernet/microsoft/mana/mana_en.c      |   6 +-
 .../net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c   |  10 +-
 drivers/net/ethernet/stmicro/stmmac/stmmac.h       |   2 +-
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c  |   2 +-
 drivers/net/ethernet/ti/am65-cpsw-nuss.c           |  18 +-
 drivers/net/ieee802154/mac802154_hwsim.c           |  11 +-
 drivers/net/macsec.c                               |   4 +-
 drivers/net/phy/mscc/mscc_macsec.c                 |   2 +-
 drivers/net/phy/mscc/mscc_macsec.h                 |   2 +-
 drivers/net/vrf.c                                  |  14 +-
 drivers/net/vxlan.c                                |   2 +
 drivers/net/wireless/ath/ath10k/mac.c              |   1 +
 drivers/net/wireless/ath/ath10k/pci.c              |  14 +-
 drivers/net/wireless/ath/ath11k/core.c             |   3 +-
 drivers/net/wireless/ath/ath11k/mac.c              |  10 +-
 drivers/net/wireless/ath/ath9k/main.c              |   5 +
 drivers/net/wireless/ath/carl9170/Kconfig          |   8 +-
 drivers/net/wireless/ath/wcn36xx/main.c            |  21 +-
 drivers/net/wireless/ath/wil6210/cfg80211.c        |   2 -
 .../broadcom/brcm80211/brcmfmac/cfg80211.c         |  37 +-
 .../wireless/broadcom/brcm80211/brcmfmac/sdio.c    |   5 +-
 .../broadcom/brcm80211/brcmsmac/mac80211_if.c      |   8 +-
 drivers/net/wireless/intel/iwlwifi/fw/pnvm.h       |   4 +-
 drivers/net/wireless/intel/iwlwifi/mvm/tx.c        |   3 +
 drivers/net/wireless/marvell/mwifiex/pcie.c        |  10 +-
 drivers/net/wireless/mediatek/mt76/mt7615/mcu.c    |   3 +
 .../net/wireless/mediatek/mt76/mt7615/pci_mac.c    |   5 +-
 .../net/wireless/mediatek/mt76/mt7615/usb_sdio.c   |   5 +-
 drivers/net/wireless/mediatek/mt76/mt76_connac.h   |   7 +-
 .../net/wireless/mediatek/mt76/mt76_connac_mac.c   |   6 +
 .../net/wireless/mediatek/mt76/mt76_connac_mcu.c   |  11 +-
 .../net/wireless/mediatek/mt76/mt76_connac_mcu.h   |   8 +
 drivers/net/wireless/mediatek/mt76/mt7915/eeprom.h |   2 +-
 drivers/net/wireless/mediatek/mt76/mt7915/mcu.c    |   3 +-
 .../net/wireless/mediatek/mt76/mt7915/testmode.c   |  21 +-
 .../net/wireless/mediatek/mt76/mt7921/debugfs.c    |   3 +
 drivers/net/wireless/mediatek/mt76/mt7921/dma.c    |   6 +-
 drivers/net/wireless/mediatek/mt76/mt7921/init.c   |  22 +-
 drivers/net/wireless/mediatek/mt76/mt7921/mac.c    |  31 +-
 drivers/net/wireless/mediatek/mt76/mt7921/main.c   |  55 +--
 drivers/net/wireless/mediatek/mt76/mt7921/mcu.c    |  32 +-
 drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h |   1 +
 drivers/net/wireless/mediatek/mt76/mt7921/pci.c    |  25 +-
 drivers/net/wireless/mediatek/mt76/testmode.c      |  13 +-
 drivers/net/wireless/mediatek/mt76/tx.c            |   2 +-
 drivers/net/wireless/realtek/rtw88/rtw8822c.c      |  22 +-
 drivers/net/wireless/rsi/rsi_91x_hal.c             |   6 +-
 drivers/net/wireless/rsi/rsi_91x_mac80211.c        |   3 -
 drivers/net/wireless/rsi/rsi_91x_mgmt.c            |   3 +-
 drivers/net/wireless/rsi/rsi_main.h                |   1 -
 drivers/net/wireless/st/cw1200/scan.c              |  17 +-
 drivers/net/wwan/Kconfig                           |  15 +-
 drivers/net/wwan/Makefile                          |   2 +-
 drivers/nvme/host/pci.c                            |  26 +-
 drivers/nvme/host/tcp.c                            |   2 +
 drivers/nvme/target/fc.c                           |  10 +-
 drivers/of/fdt.c                                   |   8 +-
 drivers/of/of_reserved_mem.c                       |   8 +-
 drivers/pci/controller/pci-hyperv.c                |   3 +
 drivers/perf/arm-cmn.c                             |   2 +-
 drivers/perf/arm_smmuv3_pmu.c                      |  18 +-
 drivers/perf/fsl_imx8_ddr_perf.c                   |   6 +-
 drivers/perf/hisilicon/hisi_uncore_hha_pmu.c       |   4 +-
 drivers/phy/ralink/phy-mt7621-pci.c                |   4 +-
 drivers/phy/socionext/phy-uniphier-pcie.c          |  11 +-
 drivers/phy/ti/phy-dm816x-usb.c                    |  17 +-
 drivers/pinctrl/renesas/pfc-r8a7796.c              |   3 +-
 drivers/pinctrl/renesas/pfc-r8a77990.c             |   8 +-
 drivers/platform/x86/asus-nb-wmi.c                 |  77 ----
 drivers/platform/x86/toshiba_acpi.c                |   1 +
 drivers/platform/x86/touchscreen_dmi.c             |  85 ++++
 drivers/regulator/Kconfig                          |   1 +
 drivers/regulator/bd9576-regulator.c               |   4 +-
 drivers/regulator/da9052-regulator.c               |   3 +-
 drivers/regulator/fan53555.c                       |   3 +
 drivers/regulator/fan53880.c                       |   2 +-
 drivers/regulator/hi6421v600-regulator.c           |   9 +-
 drivers/regulator/hi655x-regulator.c               |  16 +-
 drivers/regulator/mt6315-regulator.c               |   4 +-
 drivers/regulator/mt6358-regulator.c               |   2 +-
 drivers/regulator/qcom-rpmh-regulator.c            |   2 +
 drivers/regulator/uniphier-regulator.c             |   1 +
 drivers/rtc/rtc-stm32.c                            |   6 +-
 drivers/s390/cio/chp.c                             |   3 +
 drivers/s390/cio/chsc.c                            |   2 -
 drivers/scsi/FlashPoint.c                          |  32 +-
 drivers/scsi/be2iscsi/be_iscsi.c                   |  19 +-
 drivers/scsi/be2iscsi/be_main.c                    |   1 +
 drivers/scsi/bnx2i/bnx2i_iscsi.c                   |  24 +-
 drivers/scsi/cxgbi/cxgb3i/cxgb3i.c                 |   1 +
 drivers/scsi/cxgbi/cxgb4i/cxgb4i.c                 |   1 +
 drivers/scsi/cxgbi/libcxgbi.c                      |  12 +-
 drivers/scsi/libfc/fc_encode.h                     |   8 +-
 drivers/scsi/libiscsi.c                            |  70 ++-
 drivers/scsi/lpfc/lpfc_debugfs.c                   |   7 +-
 drivers/scsi/lpfc/lpfc_els.c                       | 100 ++++-
 drivers/scsi/lpfc/lpfc_hbadisc.c                   |  27 +-
 drivers/scsi/lpfc/lpfc_init.c                      |   7 -
 drivers/scsi/lpfc/lpfc_nportdisc.c                 |  25 +-
 drivers/scsi/lpfc/lpfc_sli.c                       |  10 +-
 drivers/scsi/megaraid/megaraid_sas_fusion.c        |  10 +-
 drivers/scsi/mpt3sas/mpt3sas_scsih.c               |   4 +-
 drivers/scsi/qedi/qedi_iscsi.c                     |  26 +-
 drivers/scsi/qla4xxx/ql4_os.c                      |   2 +
 drivers/scsi/scsi_lib.c                            |   1 +
 drivers/scsi/scsi_transport_iscsi.c                | 487 ++++++++++++---------
 drivers/soundwire/stream.c                         |  13 +-
 drivers/spi/spi-loopback-test.c                    |   2 +-
 drivers/spi/spi-meson-spicc.c                      |   8 +-
 drivers/spi/spi-omap-100k.c                        |   2 +-
 drivers/spi/spi-sun6i.c                            |   6 +-
 drivers/spi/spi-topcliff-pch.c                     |   4 +-
 drivers/spi/spi.c                                  |   8 +-
 drivers/ssb/scan.c                                 |   1 +
 drivers/ssb/sdio.c                                 |   1 -
 drivers/staging/fbtft/fb_agm1264k-fl.c             |  20 +-
 drivers/staging/fbtft/fb_bd663474.c                |   4 -
 drivers/staging/fbtft/fb_ili9163.c                 |   4 -
 drivers/staging/fbtft/fb_ili9320.c                 |   1 -
 drivers/staging/fbtft/fb_ili9325.c                 |   4 -
 drivers/staging/fbtft/fb_ili9340.c                 |   1 -
 drivers/staging/fbtft/fb_s6d1121.c                 |   4 -
 drivers/staging/fbtft/fb_sh1106.c                  |   1 -
 drivers/staging/fbtft/fb_ssd1289.c                 |   4 -
 drivers/staging/fbtft/fb_ssd1325.c                 |   2 -
 drivers/staging/fbtft/fb_ssd1331.c                 |   6 +-
 drivers/staging/fbtft/fb_ssd1351.c                 |   1 -
 drivers/staging/fbtft/fb_upd161704.c               |   4 -
 drivers/staging/fbtft/fb_watterott.c               |   1 -
 drivers/staging/fbtft/fbtft-bus.c                  |   3 +-
 drivers/staging/fbtft/fbtft-core.c                 |  25 +-
 drivers/staging/fbtft/fbtft-io.c                   |  12 +-
 drivers/staging/gdm724x/gdm_lte.c                  |  20 +-
 drivers/staging/media/hantro/hantro_drv.c          |  33 +-
 drivers/staging/media/hantro/hantro_v4l2.c         |   9 +-
 drivers/staging/media/imx/imx-media-csi.c          |  14 +-
 drivers/staging/media/imx/imx7-mipi-csis.c         |   6 +-
 drivers/staging/media/rkvdec/rkvdec.c              |  12 +-
 drivers/staging/media/sunxi/cedrus/cedrus_h265.c   |   4 +-
 drivers/staging/media/sunxi/cedrus/cedrus_video.c  |   8 +-
 drivers/staging/mt7621-dts/mt7621.dtsi             |   2 +-
 drivers/staging/rtl8712/hal_init.c                 |   3 +
 drivers/staging/rtl8712/os_intfs.c                 |   4 -
 drivers/staging/rtl8712/rtl871x_recv.c             |   2 +-
 drivers/staging/rtl8712/rtl871x_security.c         |  12 +-
 drivers/staging/rtl8712/usb_intf.c                 |  24 +-
 drivers/staging/rtl8723bs/os_dep/ioctl_linux.c     |   4 +-
 .../staging/vc04_services/vchiq-mmal/mmal-vchiq.c  |   2 +-
 drivers/target/iscsi/cxgbit/cxgbit_ddp.c           |  19 +-
 drivers/target/iscsi/cxgbit/cxgbit_target.c        |  21 +-
 drivers/thermal/cpufreq_cooling.c                  |   2 +-
 drivers/thunderbolt/test.c                         |  14 +-
 drivers/tty/nozomi.c                               |   9 +-
 drivers/tty/serial/8250/8250_omap.c                |  22 +-
 drivers/tty/serial/8250/8250_port.c                |  19 +-
 drivers/tty/serial/8250/serial_cs.c                |   2 +-
 drivers/tty/serial/fsl_lpuart.c                    |  14 +-
 drivers/tty/serial/mvebu-uart.c                    |  18 +-
 drivers/tty/serial/sh-sci.c                        |   8 +
 drivers/usb/class/cdc-acm.c                        |   5 +
 drivers/usb/dwc2/core.c                            |  30 +-
 drivers/usb/dwc3/core.c                            |   3 +-
 drivers/usb/gadget/function/f_eem.c                |  43 +-
 drivers/usb/gadget/function/f_fs.c                 |  65 ++-
 drivers/usb/host/xhci-mem.c                        |   1 +
 drivers/usb/host/xhci-pci-renesas.c                |  16 +-
 drivers/usb/phy/phy-tegra-usb.c                    |  15 +-
 drivers/usb/typec/class.c                          |   4 +-
 drivers/usb/typec/tcpm/tcpci.c                     |  18 +-
 drivers/usb/typec/tcpm/tcpm.c                      |  30 ++
 drivers/vfio/pci/vfio_pci.c                        |  29 +-
 drivers/video/backlight/lm3630a_bl.c               |   4 +-
 drivers/video/fbdev/imxfb.c                        |   2 +-
 drivers/visorbus/visorchipset.c                    |   6 +-
 fs/btrfs/Kconfig                                   |   2 +
 fs/btrfs/ctree.c                                   |   5 +-
 fs/btrfs/delayed-inode.c                           |  18 +-
 fs/btrfs/extent-tree.c                             |   1 -
 fs/btrfs/inode.c                                   |  16 +-
 fs/btrfs/send.c                                    |  11 +
 fs/btrfs/super.c                                   |  11 -
 fs/btrfs/sysfs.c                                   |   4 +-
 fs/btrfs/transaction.c                             |  16 +-
 fs/btrfs/transaction.h                             |   1 -
 fs/btrfs/tree-log.c                                |   1 +
 fs/btrfs/zoned.c                                   |  18 +
 fs/cifs/cifs_swn.c                                 |  10 +-
 fs/cifs/cifsacl.c                                  |   2 +-
 fs/cifs/cifsglob.h                                 |   3 +-
 fs/cifs/connect.c                                  |   5 +-
 fs/cifs/dfs_cache.c                                |   7 +-
 fs/cifs/dir.c                                      |   4 +
 fs/cifs/inode.c                                    |   5 +-
 fs/cifs/smb2ops.c                                  | 138 ++++++
 fs/configfs/file.c                                 |  10 +-
 fs/crypto/fname.c                                  |  10 +-
 fs/crypto/keysetup.c                               |  40 +-
 fs/dax.c                                           |   3 +-
 fs/dlm/config.c                                    |   9 +
 fs/dlm/lowcomms.c                                  | 184 ++++++--
 fs/erofs/super.c                                   |   1 +
 fs/exec.c                                          |   4 +
 fs/exfat/dir.c                                     |   8 +-
 fs/ext4/extents.c                                  |   3 +
 fs/ext4/extents_status.c                           |   4 +-
 fs/ext4/ialloc.c                                   |  11 +-
 fs/ext4/inode.c                                    |   2 +-
 fs/ext4/mballoc.c                                  |   9 +-
 fs/ext4/super.c                                    |  10 +-
 fs/f2fs/data.c                                     |   6 +
 fs/f2fs/sysfs.c                                    |   8 +
 fs/fs-writeback.c                                  |  39 +-
 fs/fuse/dev.c                                      |  12 +-
 fs/fuse/dir.c                                      |  25 +-
 fs/gfs2/file.c                                     |   4 +-
 fs/gfs2/ops_fstype.c                               |   1 +
 fs/io_uring.c                                      |  10 +-
 fs/ntfs/inode.c                                    |   2 +-
 fs/ocfs2/filecheck.c                               |   6 +-
 fs/ocfs2/stackglue.c                               |   8 +-
 fs/open.c                                          |  14 +-
 fs/proc/task_mmu.c                                 |   2 +-
 fs/pstore/Kconfig                                  |   1 +
 include/asm-generic/pgtable-nop4d.h                |   1 -
 include/asm-generic/preempt.h                      |   2 +-
 include/clocksource/timer-ti-dm.h                  |   1 +
 include/crypto/internal/hash.h                     |   8 +-
 include/dt-bindings/clock/imx8mq-clock.h           |  19 -
 include/linux/bio.h                                |  12 +-
 include/linux/clocksource.h                        |   2 +-
 include/linux/cred.h                               |   2 +
 include/linux/huge_mm.h                            |  59 ++-
 include/linux/hugetlb.h                            |   5 +
 include/linux/iio/common/cros_ec_sensors_core.h    |   2 +-
 include/linux/kthread.h                            |   2 +
 include/linux/mm.h                                 |   1 -
 include/linux/pgtable.h                            |  22 +
 include/linux/prandom.h                            |   2 +-
 include/linux/swap.h                               |   9 +
 include/linux/tracepoint.h                         |  10 +
 include/linux/user_namespace.h                     |   4 +
 include/media/hevc-ctrls.h                         |   3 +-
 include/media/media-dev-allocator.h                |   2 +-
 include/net/bluetooth/hci.h                        |   6 +-
 include/net/bluetooth/hci_core.h                   |   8 +-
 include/net/ip.h                                   |  12 +-
 include/net/ip6_route.h                            |  16 +-
 include/net/macsec.h                               |   2 +-
 include/net/sch_generic.h                          |  12 +
 include/net/tc_act/tc_vlan.h                       |   1 +
 include/net/xfrm.h                                 |   1 +
 include/net/xsk_buff_pool.h                        |   9 +-
 include/scsi/fc/fc_ms.h                            |   4 +-
 include/scsi/libiscsi.h                            |   1 +
 include/scsi/scsi_transport_iscsi.h                |  12 +-
 include/uapi/linux/seccomp.h                       |   1 +
 include/uapi/linux/v4l2-controls.h                 |  23 +-
 init/main.c                                        |   6 +-
 kernel/bpf/devmap.c                                |   4 +-
 kernel/bpf/inode.c                                 |   2 +-
 kernel/bpf/verifier.c                              |   6 +-
 kernel/cred.c                                      |  40 ++
 kernel/events/core.c                               |   9 +-
 kernel/fork.c                                      |   8 +-
 kernel/kthread.c                                   |  49 ++-
 kernel/locking/lockdep.c                           | 122 +++++-
 kernel/rcu/tree.c                                  |   2 +-
 kernel/sched/core.c                                |  86 ++--
 kernel/sched/deadline.c                            |   2 +
 kernel/sched/fair.c                                |  19 +-
 kernel/sched/psi.c                                 |  12 +-
 kernel/sched/rt.c                                  |  17 +-
 kernel/seccomp.c                                   |  51 ++-
 kernel/smpboot.c                                   |   1 -
 kernel/sys.c                                       |  12 +
 kernel/time/clocksource.c                          | 113 ++++-
 kernel/trace/bpf_trace.c                           |   3 +-
 kernel/trace/trace_events_hist.c                   |   7 +
 kernel/tracepoint.c                                |  33 +-
 kernel/ucount.c                                    |  40 +-
 kernel/user_namespace.c                            |   3 +
 lib/Kconfig.debug                                  |   1 -
 lib/iov_iter.c                                     |  37 +-
 lib/kstrtox.c                                      |  13 +-
 lib/kstrtox.h                                      |   2 +
 lib/kunit/test.c                                   |   7 +-
 lib/locking-selftest.c                             |   1 +
 lib/math/rational.c                                |  16 +-
 lib/seq_buf.c                                      |   4 +-
 lib/vsprintf.c                                     |  82 ++--
 mm/debug_vm_pgtable.c                              |  63 ++-
 mm/gup.c                                           |  58 ++-
 mm/huge_memory.c                                   |  13 +-
 mm/hugetlb.c                                       |  99 +++--
 mm/kfence/core.c                                   |   4 +-
 mm/khugepaged.c                                    |   4 +-
 mm/memcontrol.c                                    |   8 +
 mm/memory.c                                        |  11 +-
 mm/migrate.c                                       |   2 +-
 mm/mmap_lock.c                                     |  33 +-
 mm/page_alloc.c                                    | 107 +++--
 mm/shmem.c                                         |  17 +-
 mm/slab.h                                          |   1 -
 mm/z3fold.c                                        |   3 +-
 mm/zswap.c                                         |  17 +-
 net/bluetooth/hci_event.c                          |  27 +-
 net/bluetooth/hci_request.c                        |  51 ++-
 net/bluetooth/mgmt.c                               |   3 +
 net/bpfilter/main.c                                |   2 +-
 net/can/bcm.c                                      |   7 +-
 net/can/gw.c                                       |   3 +
 net/can/isotp.c                                    |   7 +-
 net/can/j1939/main.c                               |   4 +
 net/can/j1939/socket.c                             |   5 +-
 net/core/filter.c                                  |   4 -
 net/core/rtnetlink.c                               |  26 +-
 net/core/skmsg.c                                   |  30 +-
 net/core/sock_map.c                                |   2 +-
 net/ipv4/devinet.c                                 |   4 +-
 net/ipv4/esp4.c                                    |   2 +-
 net/ipv4/fib_frontend.c                            |   2 +
 net/ipv4/route.c                                   |   3 +-
 net/ipv4/udp.c                                     |   2 +
 net/ipv6/esp6.c                                    |   2 +-
 net/ipv6/exthdrs.c                                 |  31 +-
 net/ipv6/ip6_tunnel.c                              |   4 +-
 net/mac80211/he.c                                  |   4 +-
 net/mac80211/mlme.c                                |   9 -
 net/mac80211/sta_info.c                            |   5 -
 net/mptcp/options.c                                |  29 +-
 net/mptcp/pm_netlink.c                             |   8 +-
 net/mptcp/protocol.c                               |   5 +
 net/mptcp/protocol.h                               |  10 +
 net/mptcp/subflow.c                                |  53 ++-
 net/mptcp/token.c                                  |   6 +-
 net/netfilter/nf_tables_api.c                      |  65 ++-
 net/netfilter/nf_tables_offload.c                  |  34 +-
 net/netfilter/nft_exthdr.c                         |   3 +
 net/netfilter/nft_osf.c                            |   5 +
 net/netfilter/nft_tproxy.c                         |   9 +-
 net/netlabel/netlabel_mgmt.c                       |  19 +-
 net/qrtr/ns.c                                      |   4 +-
 net/sched/act_vlan.c                               |   7 +-
 net/sched/cls_tcindex.c                            |   2 +-
 net/sched/sch_qfq.c                                |   8 +-
 net/sunrpc/sched.c                                 |  12 +-
 net/tipc/bcast.c                                   |   2 +-
 net/tipc/msg.c                                     |  17 +-
 net/tipc/msg.h                                     |   3 +-
 net/tls/tls_sw.c                                   |   2 +-
 net/xdp/xsk_queue.h                                |  11 +-
 net/xfrm/xfrm_device.c                             |   1 +
 net/xfrm/xfrm_output.c                             |   7 -
 net/xfrm/xfrm_state.c                              |  14 +-
 samples/bpf/xdp_redirect_user.c                    |   4 +-
 scripts/Makefile.build                             |   5 +-
 scripts/link-vmlinux.sh                            |   4 +
 scripts/tools-support-relr.sh                      |   3 +-
 security/integrity/evm/evm_main.c                  |   5 +-
 security/integrity/evm/evm_secfs.c                 |  13 +-
 security/integrity/ima/ima_appraise.c              |   2 -
 sound/firewire/amdtp-stream.c                      |   7 +-
 sound/firewire/bebob/bebob_stream.c                |   9 +-
 sound/firewire/motu/motu-protocol-v2.c             |   5 +-
 sound/pci/hda/patch_realtek.c                      |  50 ++-
 sound/pci/intel8x0.c                               |   2 +-
 sound/soc/atmel/atmel-i2s.c                        |  35 +-
 sound/soc/codecs/cs42l42.h                         |   2 +-
 sound/soc/codecs/max98373-sdw.c                    |  14 +-
 sound/soc/codecs/max98373.h                        |   2 +-
 sound/soc/codecs/rk3328_codec.c                    |  28 +-
 sound/soc/codecs/rt1308-sdw.c                      |   2 +-
 sound/soc/codecs/rt1316-sdw.c                      |   2 +-
 sound/soc/codecs/rt5682-i2c.c                      |   1 +
 sound/soc/codecs/rt5682-sdw.c                      |  19 +-
 sound/soc/codecs/rt700-sdw.c                       |   2 +-
 sound/soc/codecs/rt711-sdca-sdw.c                  |  12 +-
 sound/soc/codecs/rt711-sdca.c                      |   4 +
 sound/soc/codecs/rt711-sdw.c                       |   2 +-
 sound/soc/codecs/rt715-sdca-sdw.c                  |   3 +-
 sound/soc/codecs/rt715-sdca-sdw.h                  |   1 +
 sound/soc/codecs/rt715-sdca.c                      |   9 +-
 sound/soc/codecs/rt715-sdca.h                      |   3 +-
 sound/soc/codecs/rt715-sdw.c                       |   2 +-
 sound/soc/fsl/fsl_spdif.c                          |  23 +-
 sound/soc/fsl/fsl_xcvr.c                           |  10 +
 sound/soc/hisilicon/hi6210-i2s.c                   |  14 +-
 sound/soc/intel/boards/sof_sdw.c                   |  16 +-
 sound/soc/mediatek/common/mtk-btcvsd.c             |  24 +-
 sound/soc/sh/rcar/adg.c                            |   4 +-
 sound/usb/format.c                                 |   2 +
 sound/usb/mixer.c                                  |   8 +-
 sound/usb/mixer.h                                  |   1 +
 sound/usb/mixer_scarlett_gen2.c                    |   7 +-
 tools/bpf/bpftool/main.c                           |   4 +-
 tools/bpf/resolve_btfids/main.c                    |   3 +
 tools/lib/bpf/linker.c                             |   2 +-
 tools/objtool/arch/x86/decode.c                    |   2 +-
 tools/perf/util/llvm-utils.c                       |   2 +
 .../util/scripting-engines/trace-event-python.c    | 146 +++---
 tools/power/x86/intel-speed-select/isst-config.c   |  16 +
 tools/power/x86/intel-speed-select/isst-core.c     |  15 +
 tools/power/x86/intel-speed-select/isst-display.c  |   2 +-
 tools/power/x86/intel-speed-select/isst.h          |   2 +
 tools/testing/selftests/bpf/.gitignore             |   1 +
 tools/testing/selftests/bpf/prog_tests/ringbuf.c   |   2 +-
 .../selftests/bpf/prog_tests/sockmap_listen.c      |   7 +-
 .../selftests/ftrace/test.d/event/event-no-pid.tc  |   7 +
 tools/testing/selftests/kvm/dirty_log_test.c       |   1 -
 tools/testing/selftests/kvm/lib/kvm_util.c         |   4 -
 tools/testing/selftests/kvm/lib/x86_64/processor.c |   3 +
 tools/testing/selftests/kvm/steal_time.c           |   2 -
 .../testing/selftests/kvm/x86_64/set_boot_cpu_id.c |   2 -
 tools/testing/selftests/lkdtm/run.sh               |  12 +-
 tools/testing/selftests/net/tls.c                  |  87 ++--
 tools/testing/selftests/resctrl/README             |   2 +-
 tools/testing/selftests/resctrl/resctrl_tests.c    |   4 +-
 tools/testing/selftests/sgx/load.c                 |  16 +-
 .../testing/selftests/splice/short_splice_read.sh  | 119 ++++-
 .../selftests/tc-testing/plugin-lib/scapyPlugin.py |   2 +-
 tools/testing/selftests/vm/protection_keys.c       |  12 +-
 834 files changed, 7624 insertions(+), 3977 deletions(-)
author maintainer
#1 lore raw

PATCH 1/800 Bluetooth: hci_qca: fix potential GPF

From: Pavel Skripkin <[email protected]>

commit 59f90f1351282ea2dbd0c59098fd9bb2634e920e upstream.

In qca_power_shutdown() qcadev local variable is initialized by hu->serdev.dev private data, but hu->serdev can be NULL and there is a check for it.

Since, qcadev is not used before

	if (!hu->serdev)
		return;

we can move its initialization after this "if" to
prevent GPF.

Fixes 5559904ccc08 ("Bluetooth: hci_qca: Add QCA Rome power off support to the qca_power_shutdown()")
Cc Rocky Liao <[email protected]>
---
 drivers/bluetooth/hci_qca.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/bluetooth/hci_qca.c +2 -2
@@ -1835,8 +1835,6 @@ static void qca_power_shutdown(struct hc
 	unsigned long flags;
 	enum qca_btsoc_type soc_type = qca_soc_type(hu);
 
-	qcadev = serdev_device_get_drvdata(hu->serdev);
-
 	/* From this point we go into power off state. But serial port is
 	 * still open, stop queueing the IBS data and flush all the buffered
 	 * data in skb's.
@@ -1852,6 +1850,8 @@ static void qca_power_shutdown(struct hc
 	if (!hu->serdev)
 		return;
 
+	qcadev = serdev_device_get_drvdata(hu->serdev);
+
 	if (qca_is_wcn399x(soc_type)) {
 		host_set_baudrate(hu, 2400);
 		qca_send_power_pulse(hu, false);
author maintainer
#2 lore raw

PATCH 2/800 Bluetooth: btqca: Dont modify firmware contents in-place

In reply to Greg Kroah-Hartman

From: Connor Abbott <[email protected]>

commit b43ca511178ed0ab6fd2405df28cf9e100273020 upstream.

struct firmware::data is marked const, and when the firmware is compressed with xz (default at least with Fedora) it's mapped read-only which results in a crash:

BUG: unable to handle page fault for address: ffffae57c0ca5047
PGD 100000067 P4D 100000067 PUD 1001ce067 PMD 10165a067 PTE 8000000112bba161
Oops: 0003 [#1] SMP NOPTI
CPU: 3 PID: 204 Comm: kworker/u17:0 Not tainted 5.12.1-test+ #1
Hardware name: Dell Inc. XPS 13 9310/0F7M4C, BIOS 1.2.5 12/10/2020
Workqueue: hci0 hci_power_on [bluetooth]
RIP: 0010:qca_download_firmware+0x27c/0x4e0 [btqca]
Code: 1b 75 04 80 48 0c 01 0f b7 c6 8d 54 02 0c 41 39 d7 0f 8e 62 fe ff ff 48 63 c2 4c 01 e8 0f b7 38 0f b7 70 02 66 83 ff 11 75 d3 <80> 48 0c 80 41 83 fc 03 7e 6e 88 58 0d eb ce 41 0f b6 45 0e 48 8b
RSP: 0018:ffffae57c08dfc68 EFLAGS: 00010246
RAX: ffffae57c0ca503b RBX: 000000000000000e RCX: 0000000000000000
RDX: 0000000000000037 RSI: 0000000000000006 RDI: 0000000000000011
RBP: ffff978d9949e000 R08: ffff978d84ed7540 R09: ffffae57c0ca5000
R10: 000000000010cd00 R11: 0000000000000001 R12: 0000000000000005
R13: ffffae57c0ca5004 R14: ffff978d98ca8680 R15: 00000000000016a9
FS:  0000000000000000(0000) GS:ffff9794ef6c0000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffae57c0ca5047 CR3: 0000000113d5a004 CR4: 0000000000770ee0
PKRU: 55555554
Call Trace:
 qca_uart_setup+0x2cb/0x1390 [btqca]
 ? qca_read_soc_version+0x136/0x220 [btqca]
 qca_setup+0x288/0xab0 [hci_uart]
 hci_dev_do_open+0x1f3/0x780 [bluetooth]
 ? try_to_wake_up+0x1c1/0x4f0
 hci_power_on+0x3f/0x200 [bluetooth]
 process_one_work+0x1ec/0x380
 worker_thread+0x53/0x3e0
 ? process_one_work+0x380/0x380
 kthread+0x11b/0x140
 ? kthread_associate_blkcg+0xa0/0xa0
 ret_from_fork+0x1f/0x30
Modules linked in: llc ip_set nf_tables nfnetlink snd_soc_skl_hda_dsp(+) ip6table_filter snd_soc_hdac_hdmi ip6_tables qrtr_mhi iptable_filter snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic s>
 dell_wmi_sysman(+) dell_smbios snd dcdbas mhi vfat videobuf2_vmalloc i2c_i801 videobuf2_memops videobuf2_v4l2 dell_wmi_descriptor fat wmi_bmof soundcore i2c_smbus videobuf2_common libarc4 mei_me mei hid_se>
 i2c_hid_acpi i2c_hid video pinctrl_tigerlake fuse

CR2: ffffae57c0ca5047

This also seems to fix a failure to suspend due to the firmware download on bootup getting interrupted by the crash:

Bluetooth: hci0: SSR or FW download time out
PM: dpm_run_callback(): acpi_subsys_suspend+0x0/0x60 returns -110
PM: Device serial0-0 failed to suspend: error -110
PM: Some devices failed to suspend, or early wake event detected

Fixes 83e8196 ("Bluetooth: btqca: Introduce generic QCA ROME support")
Cc Venkata Lakshmi Narayana Gubba <[email protected]>
---
 drivers/bluetooth/btqca.c |   27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)
drivers/bluetooth/btqca.c +20 -7
@@ -183,7 +183,7 @@ int qca_send_pre_shutdown_cmd(struct hci
 EXPORT_SYMBOL_GPL(qca_send_pre_shutdown_cmd);
 
 static void qca_tlv_check_data(struct qca_fw_config *config,
-		const struct firmware *fw, enum qca_btsoc_type soc_type)
+		u8 *fw_data, enum qca_btsoc_type soc_type)
 {
 	const u8 *data;
 	u32 type_len;
@@ -194,7 +194,7 @@ static void qca_tlv_check_data(struct qc
 	struct tlv_type_nvm *tlv_nvm;
 	uint8_t nvm_baud_rate = config->user_baud_rate;
 
-	tlv = (struct tlv_type_hdr *)fw->data;
+	tlv = (struct tlv_type_hdr *)fw_data;
 
 	type_len = le32_to_cpu(tlv->type_len);
 	length = (type_len >> 8) & 0x00ffffff;
@@ -390,8 +390,9 @@ static int qca_download_firmware(struct
 				 enum qca_btsoc_type soc_type)
 {
 	const struct firmware *fw;
+	u8 *data;
 	const u8 *segment;
-	int ret, remain, i = 0;
+	int ret, size, remain, i = 0;
 
 	bt_dev_info(hdev, "QCA Downloading %s", config->fwname);
 
@@ -402,10 +403,22 @@ static int qca_download_firmware(struct
 		return ret;
 	}
 
-	qca_tlv_check_data(config, fw, soc_type);
+	size = fw->size;
+	data = vmalloc(fw->size);
+	if (!data) {
+		bt_dev_err(hdev, "QCA Failed to allocate memory for file: %s",
+			   config->fwname);
+		release_firmware(fw);
+		return -ENOMEM;
+	}
+
+	memcpy(data, fw->data, size);
+	release_firmware(fw);
+
+	qca_tlv_check_data(config, data, soc_type);
 
-	segment = fw->data;
-	remain = fw->size;
+	segment = data;
+	remain = size;
 	while (remain > 0) {
 		int segsize = min(MAX_SIZE_PER_TLV_SEGMENT, remain);
 
@@ -435,7 +448,7 @@ static int qca_download_firmware(struct
 		ret = qca_inject_cmd_complete_event(hdev);
 
 out:
-	release_firmware(fw);
+	vfree(data);
 
 	return ret;
 }
author maintainer
#3 lore raw

PATCH 3/800 Bluetooth: Remove spurious error message

In reply to Greg Kroah-Hartman

From: Szymon Janc <[email protected]>

commit 1c58e933aba23f68c0d3f192f7cc6eed8fabd694 upstream.

Even with rate limited reporting this is very spammy and since it is remote device that is providing bogus data there is no need to report this as error.

Since real_len variable was used only to allow conditional error message it is now also removed.

[72454.143336] bt_err_ratelimited: 10 callbacks suppressed
[72454.143337] Bluetooth: hci0: advertising data len corrected
[72454.296314] Bluetooth: hci0: advertising data len corrected
[72454.892329] Bluetooth: hci0: advertising data len corrected
[72455.051319] Bluetooth: hci0: advertising data len corrected
[72455.357326] Bluetooth: hci0: advertising data len corrected
[72455.663295] Bluetooth: hci0: advertising data len corrected
[72455.787278] Bluetooth: hci0: advertising data len corrected
[72455.942278] Bluetooth: hci0: advertising data len corrected
[72456.094276] Bluetooth: hci0: advertising data len corrected
[72456.249137] Bluetooth: hci0: advertising data len corrected
[72459.416333] bt_err_ratelimited: 13 callbacks suppressed
[72459.416334] Bluetooth: hci0: advertising data len corrected
[72459.721334] Bluetooth: hci0: advertising data len corrected
[72460.011317] Bluetooth: hci0: advertising data len corrected
[72460.327171] Bluetooth: hci0: advertising data len corrected
[72460.638294] Bluetooth: hci0: advertising data len corrected
[72460.946350] Bluetooth: hci0: advertising data len corrected
[72461.225320] Bluetooth: hci0: advertising data len corrected
[72461.690322] Bluetooth: hci0: advertising data len corrected
[72462.118318] Bluetooth: hci0: advertising data len corrected
[72462.427319] Bluetooth: hci0: advertising data len corrected
[72464.546319] bt_err_ratelimited: 7 callbacks suppressed
[72464.546319] Bluetooth: hci0: advertising data len corrected
[72464.857318] Bluetooth: hci0: advertising data len corrected
[72465.163332] Bluetooth: hci0: advertising data len corrected
[72465.278331] Bluetooth: hci0: advertising data len corrected
[72465.432323] Bluetooth: hci0: advertising data len corrected
[72465.891334] Bluetooth: hci0: advertising data len corrected
[72466.045334] Bluetooth: hci0: advertising data len corrected
[72466.197321] Bluetooth: hci0: advertising data len corrected
[72466.340318] Bluetooth: hci0: advertising data len corrected
[72466.498335] Bluetooth: hci0: advertising data len corrected
[72469.803299] bt_err_ratelimited: 10 callbacks suppressed
---
 net/bluetooth/hci_event.c |   14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)
net/bluetooth/hci_event.c +5 -9
@@ -5441,7 +5441,7 @@ static void process_adv_report(struct hc
 	struct hci_conn *conn;
 	bool match;
 	u32 flags;
-	u8 *ptr, real_len;
+	u8 *ptr;
 
 	switch (type) {
 	case LE_ADV_IND:
@@ -5472,14 +5472,10 @@ static void process_adv_report(struct hc
 			break;
 	}
 
-	real_len = ptr - data;
-
-	/* Adjust for actual length */
-	if (len != real_len) {
-		bt_dev_err_ratelimited(hdev, "advertising data len corrected %u -> %u",
-				       len, real_len);
-		len = real_len;
-	}
+	/* Adjust for actual length. This handles the case when remote
+	 * device is advertising with incorrect data length.
+	 */
+	len = ptr - data;
 
 	/* If the direct address is present, then this report is from
 	 * a LE Direct Advertising Report event. In that case it is
author maintainer
#4 lore raw

PATCH 4/800 ALSA: bebob: fix rx packet format for Yamaha GO44/GO46, Terratec Phase 24/x24

In reply to Greg Kroah-Hartman

From: Takashi Sakamoto <[email protected]>

commit 6b6c17fe6fa58900fa69dd000d5333b679e5e33e upstream.

Below devices reports zero as the number of channels for external output plug with MIDI type:

* Yamaha GO44/GO46
* Terratec Phase 24/X24

As a result, rx packet format is invalid and they generate silent sound. This is a regression added in v5.13.

This commit fixes the bug, addressed at a commit 1bd1b3be8655 ("ALSA:
bebob: perform sequence replay for media clock recovery").

Fixes 5c6ea94f2b7c ("ALSA: bebob: detect the number of available MIDI ports")
---
 sound/firewire/bebob/bebob_stream.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
sound/firewire/bebob/bebob_stream.c +7 -2
@@ -883,6 +883,11 @@ static int detect_midi_ports(struct snd_
 		err = avc_bridgeco_get_plug_ch_count(bebob->unit, addr, &ch_count);
 		if (err < 0)
 			break;
+		// Yamaha GO44, GO46, Terratec Phase 24, Phase x24 reports 0 for the number of
+		// channels in external output plug 3 (MIDI type) even if it has a pair of physical
+		// MIDI jacks. As a workaround, assume it as one.
+		if (ch_count == 0)
+			ch_count = 1;
 		*midi_ports += ch_count;
 	}
 
@@ -961,12 +966,12 @@ int snd_bebob_stream_discover(struct snd
 	if (err < 0)
 		goto end;
 
-	err = detect_midi_ports(bebob, bebob->rx_stream_formations, addr, AVC_BRIDGECO_PLUG_DIR_IN,
+	err = detect_midi_ports(bebob, bebob->tx_stream_formations, addr, AVC_BRIDGECO_PLUG_DIR_IN,
 				plugs[2], &bebob->midi_input_ports);
 	if (err < 0)
 		goto end;
 
-	err = detect_midi_ports(bebob, bebob->tx_stream_formations, addr, AVC_BRIDGECO_PLUG_DIR_OUT,
+	err = detect_midi_ports(bebob, bebob->rx_stream_formations, addr, AVC_BRIDGECO_PLUG_DIR_OUT,
 				plugs[3], &bebob->midi_output_ports);
 	if (err < 0)
 		goto end;
author maintainer
#5 lore raw

PATCH 5/800 ALSA: usb-audio: fix rate on Ozone Z90 USB headset

In reply to Greg Kroah-Hartman

From: Daehwan Jung <[email protected]>

commit aecc19ec404bdc745c781058ac97a373731c3089 upstream.

It mislabels its 96 kHz altsetting and that's why it causes some noise

---
 sound/usb/format.c |    2 ++
 1 file changed, 2 insertions(+)
sound/usb/format.c +2 -0
@@ -223,9 +223,11 @@ static int parse_audio_format_rates_v1(s
 				continue;
 			/* C-Media CM6501 mislabels its 96 kHz altsetting */
 			/* Terratec Aureon 7.1 USB C-Media 6206, too */
+			/* Ozone Z90 USB C-Media, too */
 			if (rate == 48000 && nr_rates == 1 &&
 			    (chip->usb_id == USB_ID(0x0d8c, 0x0201) ||
 			     chip->usb_id == USB_ID(0x0d8c, 0x0102) ||
+			     chip->usb_id == USB_ID(0x0d8c, 0x0078) ||
 			     chip->usb_id == USB_ID(0x0ccd, 0x00b1)) &&
 			    fp->altsetting == 5 && fp->maxpacksize == 392)
 				rate = 96000;
author maintainer
#6 lore raw

PATCH 6/800 ALSA: usb-audio: Fix OOB access at proc output

In reply to Greg Kroah-Hartman

From: Takashi Iwai <[email protected]>

commit 362372ceb6556f338e230f2d90af27b47f82365a upstream.

At extending the available mixer values for 32bit types, we forgot to add the corresponding entries for the format dump in the proc output. This may result in OOB access. Here adds the missing entries.

Fixes bc18e31c3042 ("ALSA: usb-audio: Fix parameter block size for UAC2 control requests")
---
 sound/usb/mixer.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
sound/usb/mixer.c +3 -2
@@ -3294,8 +3294,9 @@ static void snd_usb_mixer_dump_cval(stru
 				    struct usb_mixer_elem_list *list)
 {
 	struct usb_mixer_elem_info *cval = mixer_elem_list_to_info(list);
-	static const char * const val_types[] = {"BOOLEAN", "INV_BOOLEAN",
-				    "S8", "U8", "S16", "U16"};
+	static const char * const val_types[] = {
+		"BOOLEAN", "INV_BOOLEAN", "S8", "U8", "S16", "U16", "S32", "U32",
+	};
 	snd_iprintf(buffer, "    Info: id=%i, control=%i, cmask=0x%x, "
 			    "channels=%i, type=\"%s\"\n", cval->head.id,
 			    cval->control, cval->cmask, cval->channels,
author maintainer
#7 lore raw

PATCH 7/800 ALSA: firewire-motu: fix stream format for MOTU 8pre FireWire

In reply to Greg Kroah-Hartman

From: Takashi Sakamoto <[email protected]>

commit fc36ef80ca2c68b2c9df06178048f08280e4334f upstream.

My previous refactoring for ALSA firewire-motu driver brought regression to handle MOTU 8pre FireWire. The packet format is not operated correctly.

Fixes dfbaa4dc11eb ("ALSA: firewire-motu: add model-specific table of chunk count")
---
 sound/firewire/motu/motu-protocol-v2.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
sound/firewire/motu/motu-protocol-v2.c +3 -2
@@ -353,6 +353,7 @@ const struct snd_motu_spec snd_motu_spec
 	.protocol_version = SND_MOTU_PROTOCOL_V2,
 	.flags = SND_MOTU_SPEC_RX_MIDI_2ND_Q |
 		 SND_MOTU_SPEC_TX_MIDI_2ND_Q,
-	.tx_fixed_pcm_chunks = {10, 6, 0},
-	.rx_fixed_pcm_chunks = {10, 6, 0},
+	// Two dummy chunks always in the end of data block.
+	.tx_fixed_pcm_chunks = {10, 10, 0},
+	.rx_fixed_pcm_chunks = {6, 6, 0},
 };
author maintainer
#8 lore raw

PATCH 8/800 ALSA: usb-audio: scarlett2: Fix wrong resume call

In reply to Greg Kroah-Hartman

From: Takashi Iwai <[email protected]>

commit 785b6f29a795f109685f286b91e0250c206fbffb upstream.

The current way of the scarlett2 mixer code managing the usb_mixer_elem_info object is wrong in two ways: it passes its internal index to the head.id field, and the val_type field is uninitialized. This ended up with the wrong execution at the resume because a bogus unit id is passed wrongly. Also, in the later code extensions, we'll have more mixer elements, and passing the index will overflow the unit id size (of 256).

This patch corrects those issues. It introduces a new value type, USB_MIXER_BESPOKEN, which indicates a non-standard mixer element, and use this type for all scarlett2 mixer elements, as well as initializing the fixed unit id 0 for avoiding the overflow.

---
 sound/usb/mixer.c               |    3 +++
 sound/usb/mixer.h               |    1 +
 sound/usb/mixer_scarlett_gen2.c |    7 ++++++-
 3 files changed, 10 insertions(+), 1 deletion(-)
sound/usb/mixer.c +3 -0
@@ -3606,6 +3606,9 @@ static int restore_mixer_value(struct us
 	struct usb_mixer_elem_info *cval = mixer_elem_list_to_info(list);
 	int c, err, idx;
 
+	if (cval->val_type == USB_MIXER_BESPOKEN)
+		return 0;
+
 	if (cval->cmask) {
 		idx = 0;
 		for (c = 0; c < MAX_CHANNELS; c++) {
sound/usb/mixer.h +1 -0
@@ -55,6 +55,7 @@ enum {
 	USB_MIXER_U16,
 	USB_MIXER_S32,
 	USB_MIXER_U32,
+	USB_MIXER_BESPOKEN,	/* non-standard type */
 };
 
 typedef void (*usb_mixer_elem_dump_func_t)(struct snd_info_buffer *buffer,
sound/usb/mixer_scarlett_gen2.c +6 -1
@@ -949,10 +949,15 @@ static int scarlett2_add_new_ctl(struct
 	if (!elem)
 		return -ENOMEM;
 
+	/* We set USB_MIXER_BESPOKEN type, so that the core USB mixer code
+	 * ignores them for resume and other operations.
+	 * Also, the head.id field is set to 0, as we don't use this field.
+	 */
 	elem->head.mixer = mixer;
 	elem->control = index;
-	elem->head.id = index;
+	elem->head.id = 0;
 	elem->channels = channels;
+	elem->val_type = USB_MIXER_BESPOKEN;
 
 	kctl = snd_ctl_new1(ncontrol, elem);
 	if (!kctl) {
author maintainer
#9 lore raw

PATCH 9/800 ALSA: intel8x0: Fix breakage at ac97 clock measurement

In reply to Greg Kroah-Hartman

From: Takashi Iwai <[email protected]>

commit 24d1e49415be546470b20429d748e240d0518b7e upstream.

The recent workaround for the wild interrupts in commit c1f0616124c4 ("ALSA: intel8x0: Don't update period unless prepared") leaded to a regression, causing the interrupt storm during ac97 clock measurement at the driver probe. We need to handle the interrupt while the clock measurement as well as the proper PCM streams.

---
 sound/pci/intel8x0.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/intel8x0.c +1 -1
@@ -692,7 +692,7 @@ static inline void snd_intel8x0_update(s
 	int status, civ, i, step;
 	int ack = 0;
 
-	if (!ichdev->prepared || ichdev->suspended)
+	if (!(ichdev->prepared || chip->in_measurement) || ichdev->suspended)
 		return;
 
 	spin_lock_irqsave(&chip->reg_lock, flags);
author maintainer
#10 lore raw

PATCH 10/800 ALSA: hda/realtek: fix mute/micmute LEDs for HP ProBook 450 G8

In reply to Greg Kroah-Hartman

From: Andy Chi <[email protected]>

commit 2b70b264d34d398c77a5936e317336f00cf5badb upstream.

The HP ProBook 450 G8 using ALC236 codec which using 0x02 to control mute LED and 0x01 to control micmute LED. Therefore, add a quirk to make it works.

---
 sound/pci/hda/patch_realtek.c |    1 +
 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -8336,6 +8336,7 @@ static const struct snd_pci_quirk alc269
 		      ALC285_FIXUP_HP_GPIO_AMP_INIT),
 	SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
+	SND_PCI_QUIRK(0x103c, 0x87e7, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
author maintainer
#11 lore raw

PATCH 11/800 ALSA: hda/realtek: fix mute/micmute LEDs for HP ProBook 445 G8

In reply to Greg Kroah-Hartman

From: Andy Chi <[email protected]>

commit a3b7f9b8fa2967e1b3c2a402301715124c90306b upstream.

The HP ProBook 445 G8 using ALC236 codec.
COEF index 0x34 bit 5 is used to control the playback mute LED, but the microphone mute LED is controlled using pin VREF instead of a COEF index. Therefore, add a quirk to make it works.

---
 sound/pci/hda/patch_realtek.c |    2 ++
 1 file changed, 2 insertions(+)
sound/pci/hda/patch_realtek.c +2 -0
@@ -8344,6 +8344,8 @@ static const struct snd_pci_quirk alc269
 	SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
+	SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
+	SND_PCI_QUIRK(0x103c, 0x8863, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
 	SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
 	SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
 	SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
author maintainer
#12 lore raw

PATCH 12/800 ALSA: hda/realtek: fix mute/micmute LEDs for HP ProBook 630 G8

In reply to Greg Kroah-Hartman

From: Andy Chi <[email protected]>

commit fb3acdb2ba289aa06a5a995b3abef409bfe0a220 upstream.

The HP ProBook 630 G8 using ALC236 codec which using 0x02 to control mute LED and 0x01 to control micmute LED. Therefore, add a quirk to make it works.

---
 sound/pci/hda/patch_realtek.c |    1 +
 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -8337,6 +8337,7 @@ static const struct snd_pci_quirk alc269
 	SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x87e7, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
+	SND_PCI_QUIRK(0x103c, 0x87f1, "HP ProBook 630 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
author maintainer
#13 lore raw

PATCH 13/800 ALSA: hda/realtek: Add another ALC236 variant support

In reply to Greg Kroah-Hartman

From: Takashi Iwai <[email protected]>

commit 1948fc065a89f18d057b8ffaef6d7242ad99edb8 upstream.

The codec chip 10ec:0230 is another variant of ALC236, combined with a card reader. Apply the equivalent setup as 10ec:0236.

---
 sound/pci/hda/patch_realtek.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)
sound/pci/hda/patch_realtek.c +13 -0
@@ -385,6 +385,7 @@ static void alc_fill_eapd_coef(struct hd
 		alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
 		fallthrough;
 	case 0x10ec0215:
+	case 0x10ec0230:
 	case 0x10ec0233:
 	case 0x10ec0235:
 	case 0x10ec0236:
@@ -3153,6 +3154,7 @@ static void alc_disable_headset_jack_key
 		alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
 		alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0);
 		break;
+	case 0x10ec0230:
 	case 0x10ec0236:
 	case 0x10ec0256:
 		alc_write_coef_idx(codec, 0x48, 0x0);
@@ -3180,6 +3182,7 @@ static void alc_enable_headset_jack_key(
 		alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
 		alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8);
 		break;
+	case 0x10ec0230:
 	case 0x10ec0236:
 	case 0x10ec0256:
 		alc_write_coef_idx(codec, 0x48, 0xd011);
@@ -4744,6 +4747,7 @@ static void alc_headset_mode_unplugged(s
 	case 0x10ec0255:
 		alc_process_coef_fw(codec, coef0255);
 		break;
+	case 0x10ec0230:
 	case 0x10ec0236:
 	case 0x10ec0256:
 		alc_process_coef_fw(codec, coef0256);
@@ -4858,6 +4862,7 @@ static void alc_headset_mode_mic_in(stru
 		alc_process_coef_fw(codec, coef0255);
 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
 		break;
+	case 0x10ec0230:
 	case 0x10ec0236:
 	case 0x10ec0256:
 		alc_write_coef_idx(codec, 0x45, 0xc489);
@@ -5007,6 +5012,7 @@ static void alc_headset_mode_default(str
 	case 0x10ec0255:
 		alc_process_coef_fw(codec, coef0255);
 		break;
+	case 0x10ec0230:
 	case 0x10ec0236:
 	case 0x10ec0256:
 		alc_write_coef_idx(codec, 0x1b, 0x0e4b);
@@ -5105,6 +5111,7 @@ static void alc_headset_mode_ctia(struct
 	case 0x10ec0255:
 		alc_process_coef_fw(codec, coef0255);
 		break;
+	case 0x10ec0230:
 	case 0x10ec0236:
 	case 0x10ec0256:
 		alc_process_coef_fw(codec, coef0256);
@@ -5218,6 +5225,7 @@ static void alc_headset_mode_omtp(struct
 	case 0x10ec0255:
 		alc_process_coef_fw(codec, coef0255);
 		break;
+	case 0x10ec0230:
 	case 0x10ec0236:
 	case 0x10ec0256:
 		alc_process_coef_fw(codec, coef0256);
@@ -5318,6 +5326,7 @@ static void alc_determine_headset_type(s
 		val = alc_read_coef_idx(codec, 0x46);
 		is_ctia = (val & 0x0070) == 0x0070;
 		break;
+	case 0x10ec0230:
 	case 0x10ec0236:
 	case 0x10ec0256:
 		alc_write_coef_idx(codec, 0x1b, 0x0e4b);
@@ -5611,6 +5620,7 @@ static void alc255_set_default_jack_type
 	case 0x10ec0255:
 		alc_process_coef_fw(codec, alc255fw);
 		break;
+	case 0x10ec0230:
 	case 0x10ec0236:
 	case 0x10ec0256:
 		alc_process_coef_fw(codec, alc256fw);
@@ -6211,6 +6221,7 @@ static void alc_combo_jack_hp_jd_restart
 		alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
 		alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
 		break;
+	case 0x10ec0230:
 	case 0x10ec0235:
 	case 0x10ec0236:
 	case 0x10ec0255:
@@ -9345,6 +9356,7 @@ static int patch_alc269(struct hda_codec
 		spec->shutup = alc256_shutup;
 		spec->init_hook = alc256_init;
 		break;
+	case 0x10ec0230:
 	case 0x10ec0236:
 	case 0x10ec0256:
 		spec->codec_variant = ALC269_TYPE_ALC256;
@@ -10636,6 +10648,7 @@ static const struct hda_device_id snd_hd
 	HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
 	HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269),
 	HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
+	HDA_CODEC_ENTRY(0x10ec0230, "ALC236", patch_alc269),
 	HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
 	HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
 	HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
author maintainer
#14 lore raw

PATCH 14/800 ALSA: hda/realtek: fix mute/micmute LEDs for HP EliteBook x360 830 G8

In reply to Greg Kroah-Hartman

From: Jeremy Szu <[email protected]>

commit c3d2c88209e85045a364e80fe12a6cde16745b72 upstream.

The HP EliteBook x360 830 G8 using ALC285 codec which using 0x04 to control mute LED and 0x01 to control micmute LED. Therefore, add a quirk to make it works.

---
 sound/pci/hda/patch_realtek.c |    1 +
 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -8354,6 +8354,7 @@ static const struct snd_pci_quirk alc269
 	SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
 	SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
+	SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
author maintainer
#15 lore raw

PATCH 15/800 ALSA: hda/realtek: Improve fixup for HP Spectre x360 15-df0xxx

In reply to Greg Kroah-Hartman

From: Elia Devito <[email protected]>

commit 434591b2a77def0e78abfa38e5d7c4bca954e68a upstream.

On HP Spectre x360 15-df0xxx, after system boot with plugged headset, the headset mic are not detected.
Moving pincfg and DAC's config to single fixup function fix this.

[ The actual bug in the original code was that it used a chain to
ALC286_FIXUP_SPEAKER2_TO_DAC1, and it contains not only the DAC1 route fix but also another chain to ALC269_FIXUP_THINKPAD_ACPI. I thought the latter one is harmless for non-Thinkpad, but it doesn't seem so; it contains again yet another chain to ALC269_FIXUP_SKI_IGNORE, and this might be bad for some machines, including this HP machine. -- tiwai ]

---
 sound/pci/hda/patch_realtek.c |   27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)
sound/pci/hda/patch_realtek.c +20 -7
@@ -6354,6 +6354,24 @@ static void alc_fixup_no_int_mic(struct
 	}
 }
 
+static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec,
+					  const struct hda_fixup *fix, int action)
+{
+	static const hda_nid_t conn[] = { 0x02 };
+	static const struct hda_pintbl pincfgs[] = {
+		{ 0x14, 0x90170110 },  /* rear speaker */
+		{ }
+	};
+
+	switch (action) {
+	case HDA_FIXUP_ACT_PRE_PROBE:
+		snd_hda_apply_pincfgs(codec, pincfgs);
+		/* force front speaker to DAC1 */
+		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
+		break;
+	}
+}
+
 /* for hda_fixup_thinkpad_acpi() */
 #include "thinkpad_helper.c"
 
@@ -8138,13 +8156,8 @@ static const struct hda_fixup alc269_fix
 		.chain_id = ALC269_FIXUP_HP_LINE1_MIC1_LED,
 	},
 	[ALC285_FIXUP_HP_SPECTRE_X360] = {
-		.type = HDA_FIXUP_PINS,
-		.v.pins = (const struct hda_pintbl[]) {
-			{ 0x14, 0x90170110 }, /* enable top speaker */
-			{}
-		},
-		.chained = true,
-		.chain_id = ALC285_FIXUP_SPEAKER2_TO_DAC1,
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc285_fixup_hp_spectre_x360,
 	},
 	[ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = {
 		.type = HDA_FIXUP_FUNC,
author maintainer
#16 lore raw

PATCH 16/800 ALSA: hda/realtek: Fix bass speaker DAC mapping for Asus UM431D

In reply to Greg Kroah-Hartman

From: Takashi Iwai <[email protected]>

commit f8fbcdfb0665de60997d9746809e1704ed782bbc upstream.

Asus Zenbook 14 UM431D has two speaker pins and a headphone pin, and the auto-parser ends up assigning the bass to the third DAC 0x06. Although the tone comes out, it's inconvenient because this DAC has no volume control unlike two other DACs.

For obtaining the volume control for the bass speaker, this patch enforces the mapping to let both front and bass speaker pins sharing the same DAC. It's not ideal but a little bit of improvement.

Since we've already applied the same workaround for another ASUS machine, we just need to hook the chain to the existing quirk.

---
 sound/pci/hda/patch_realtek.c |    2 ++
 1 file changed, 2 insertions(+)
sound/pci/hda/patch_realtek.c +2 -0
@@ -7839,6 +7839,8 @@ static const struct hda_fixup alc269_fix
 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b },
 			{ }
 		},
+		.chained = true,
+		.chain_id = ALC289_FIXUP_ASUS_GA401,
 	},
 	[ALC285_FIXUP_HP_GPIO_LED] = {
 		.type = HDA_FIXUP_FUNC,
author maintainer
#17 lore raw

PATCH 17/800 ALSA: hda/realtek: Apply LED fixup for HP Dragonfly G1, too

In reply to Greg Kroah-Hartman

From: Takashi Iwai <[email protected]>

commit 0ac05b25c3dd8299204ae9d50c1c2f7f05eef08f upstream.

HP Dragonfly G1 (SSID 103c:861f) also requires the same quirk for the mute and mic-mute LED just as Dragonfly G2 model.

---
 sound/pci/hda/patch_realtek.c |    1 +
 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -8345,6 +8345,7 @@ static const struct snd_pci_quirk alc269
 	SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN),
 	SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
 	SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360),
+	SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT),
 	SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
 	SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO),
 	SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
author maintainer
#18 lore raw

PATCH 18/800 ALSA: hda/realtek: fix mute/micmute LEDs for HP EliteBook 830 G8 Notebook PC

In reply to Greg Kroah-Hartman

From: Jeremy Szu <[email protected]>

commit dfc2e8ae4066a95c7f9c2bb2dfa26651feaa6b83 upstream.

The HP EliteBook 830 G8 Notebook PC using ALC285 codec which using 0x04 to control mute LED and 0x01 to control micmute LED.
Therefore, add a quirk to make it works.

---
 sound/pci/hda/patch_realtek.c |    1 +
 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -8369,6 +8369,7 @@ static const struct snd_pci_quirk alc269
 	SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
+	SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
author maintainer
#19 lore raw

PATCH 19/800 ALSA: hda/realtek: fix mute led of the HP Pavilion 15-eh1xxx series

In reply to Greg Kroah-Hartman

From: Frank Schäfer <[email protected]>

commit 42334fbc219eb110e054cedf9e553a142f735b11 upstream.

The HP Pavilion 15-eh1xxx series uses the HP mainboard 88D0 with ALC287 and needs the ALC287_FIXUP_HP_GPIO_LED quirk to make the mute led working. Tested with a HP Pavilion 15-eh1557ng.

---
 sound/pci/hda/patch_realtek.c |    1 +
 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -8382,6 +8382,7 @@ static const struct snd_pci_quirk alc269
 	SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
 	SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
+	SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
 	SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
 	SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
author maintainer
#20 lore raw

PATCH 20/800 media: dvb-usb: fix wrong definition

In reply to Greg Kroah-Hartman

From: Pavel Skripkin <[email protected]>

commit c680ed46e418e9c785d76cf44eb33bfd1e8cf3f6 upstream.

syzbot reported WARNING in vmalloc. The problem
was in zero size passed to vmalloc.

The root case was in wrong cxusb_bluebird_lgz201_properties definition. adapter array has only 1 entry, but num_adapters was 2.

Call Trace:
 __vmalloc_node mm/vmalloc.c:2963 [inline]
 vmalloc+0x67/0x80 mm/vmalloc.c:2996
 dvb_dmx_init+0xe4/0xb90 drivers/media/dvb-core/dvb_demux.c:1251
 dvb_usb_adapter_dvb_init+0x564/0x860 drivers/media/usb/dvb-usb/dvb-usb-dvb.c:184
 dvb_usb_adapter_init drivers/media/usb/dvb-usb/dvb-usb-init.c:86 [inline]
 dvb_usb_init drivers/media/usb/dvb-usb/dvb-usb-init.c:184 [inline]
 dvb_usb_device_init.cold+0xc94/0x146e drivers/media/usb/dvb-usb/dvb-usb-init.c:308
 cxusb_probe+0x159/0x5e0 drivers/media/usb/dvb-usb/cxusb.c:1634
Fixes 4d43e13f723e ("V4L/DVB (4643): Multi-input patch for DVB-USB device")
Reported-by [email protected]
---
 drivers/media/usb/dvb-usb/cxusb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/usb/dvb-usb/cxusb.c +1 -1
@@ -1947,7 +1947,7 @@ static struct dvb_usb_device_properties
 
 	.size_of_priv     = sizeof(struct cxusb_state),
 
-	.num_adapters = 2,
+	.num_adapters = 1,
 	.adapter = {
 		{
 		.num_frontends = 1,
author maintainer
#21 lore raw

PATCH 21/800 Input: usbtouchscreen - fix control-request directions

In reply to Greg Kroah-Hartman

From: Johan Hovold <[email protected]>

commit 41e81022a04a0294c55cfa7e366bc14b9634c66e upstream.

The direction of the pipe argument must match the request-type direction bit or control requests may fail depending on the host-controller-driver implementation.

Fix the four control requests which erroneously used usb_rcvctrlpipe().

Fixes 1d3e20236d7a ("[PATCH] USB: usbtouchscreen: unified USB touchscreen driver")
Fixes 24ced062a296 ("usbtouchscreen: add support for DMC TSC-10/25 devices")
Fixes 9e3b25837a20 ("Input: usbtouchscreen - add support for e2i touchscreen controller")
Cc [email protected] # 2.6.17
---
 drivers/input/touchscreen/usbtouchscreen.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/input/touchscreen/usbtouchscreen.c +4 -4
@@ -251,7 +251,7 @@ static int e2i_init(struct usbtouch_usb
 	int ret;
 	struct usb_device *udev = interface_to_usbdev(usbtouch->interface);
 
-	ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
+	ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
 	                      0x01, 0x02, 0x0000, 0x0081,
 	                      NULL, 0, USB_CTRL_SET_TIMEOUT);
 
@@ -531,7 +531,7 @@ static int mtouch_init(struct usbtouch_u
 	if (ret)
 		return ret;
 
-	ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
+	ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
 	                      MTOUCHUSB_RESET,
 	                      USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 	                      1, 0, NULL, 0, USB_CTRL_SET_TIMEOUT);
@@ -543,7 +543,7 @@ static int mtouch_init(struct usbtouch_u
 	msleep(150);
 
 	for (i = 0; i < 3; i++) {
-		ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
+		ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
 				      MTOUCHUSB_ASYNC_REPORT,
 				      USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 				      1, 1, NULL, 0, USB_CTRL_SET_TIMEOUT);
@@ -722,7 +722,7 @@ static int dmc_tsc10_init(struct usbtouc
 	}
 
 	/* start sending data */
-	ret = usb_control_msg(dev, usb_rcvctrlpipe (dev, 0),
+	ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
 	                      TSC10_CMD_DATA1,
 	                      USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 	                      0, 0, NULL, 0, USB_CTRL_SET_TIMEOUT);
author maintainer
#22 lore raw

PATCH 22/800 net: can: ems_usb: fix use-after-free in ems_usb_disconnect()

In reply to Greg Kroah-Hartman

From: Pavel Skripkin <[email protected]>

commit ab4a0b8fcb9a95c02909b62049811bd2e586aaa4 upstream.

In ems_usb_disconnect() dev pointer, which is netdev private data, is used after free_candev() call:

| 	if (dev) {
| 		unregister_netdev(dev->netdev);
| 		free_candev(dev->netdev);
|
| 		unlink_all_urbs(dev);
|
| 		usb_free_urb(dev->intr_urb);
|
| 		kfree(dev->intr_in_buffer);
| 		kfree(dev->tx_msg_buffer);
| 	}

Fix it by simply moving free_candev() at the end of the block.

Fail log:

| BUG: KASAN: use-after-free in ems_usb_disconnect
| Read of size 8 at addr ffff88804e041008 by task kworker/1:2/2895
|
| CPU: 1 PID: 2895 Comm: kworker/1:2 Not tainted 5.13.0-rc5+ #164
| Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a-rebuilt.opensuse.4
| Workqueue: usb_hub_wq hub_event
| Call Trace:
|     dump_stack (lib/dump_stack.c:122)
|     print_address_description.constprop.0.cold (mm/kasan/report.c:234)
|     kasan_report.cold (mm/kasan/report.c:420 mm/kasan/report.c:436)
|     ems_usb_disconnect (drivers/net/can/usb/ems_usb.c:683 drivers/net/can/usb/ems_usb.c:1058)
Fixes 702171adeed3 ("ems_usb: Added support for EMS CPC-USB/ARM7 CAN/USB interface")
Cc linux-stable <[email protected]>
---
 drivers/net/can/usb/ems_usb.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/can/usb/ems_usb.c +2 -1
@@ -1053,7 +1053,6 @@ static void ems_usb_disconnect(struct us
 
 	if (dev) {
 		unregister_netdev(dev->netdev);
-		free_candev(dev->netdev);
 
 		unlink_all_urbs(dev);
 
@@ -1061,6 +1060,8 @@ static void ems_usb_disconnect(struct us
 
 		kfree(dev->intr_in_buffer);
 		kfree(dev->tx_msg_buffer);
+
+		free_candev(dev->netdev);
 	}
 }
 
author maintainer
#23 lore raw

PATCH 23/800 usb: gadget: eem: fix echo command packet response issue

In reply to Greg Kroah-Hartman

From: Linyu Yuan <[email protected]>

commit 4249d6fbc10fd997abdf8a1ea49c0389a0edf706 upstream.

when receive eem echo command, it will send a response, but queue this response to the usb request which allocate from gadget device endpoint zero,
and transmit the request to IN endpoint of eem interface.

on dwc3 gadget, it will trigger following warning in function __dwc3_gadget_ep_queue(),

	if (WARN(req->dep != dep, "request %pK belongs to '%s'\n",
				&req->request, req->dep->name))
		return -EINVAL;

fix it by allocating a usb request from IN endpoint of eem interface, and transmit the usb request to same IN endpoint of eem interface.

---
 drivers/usb/gadget/function/f_eem.c |   43 ++++++++++++++++++++++++++++++++----
 1 file changed, 39 insertions(+), 4 deletions(-)
drivers/usb/gadget/function/f_eem.c +39 -4
@@ -30,6 +30,11 @@ struct f_eem {
 	u8				ctrl_id;
 };
 
+struct in_context {
+	struct sk_buff	*skb;
+	struct usb_ep	*ep;
+};
+
 static inline struct f_eem *func_to_eem(struct usb_function *f)
 {
 	return container_of(f, struct f_eem, port.func);
@@ -320,9 +325,12 @@ fail:
 
 static void eem_cmd_complete(struct usb_ep *ep, struct usb_request *req)
 {
-	struct sk_buff *skb = (struct sk_buff *)req->context;
+	struct in_context *ctx = req->context;
 
-	dev_kfree_skb_any(skb);
+	dev_kfree_skb_any(ctx->skb);
+	kfree(req->buf);
+	usb_ep_free_request(ctx->ep, req);
+	kfree(ctx);
 }
 
 /*
@@ -410,7 +418,9 @@ static int eem_unwrap(struct gether *por
 		 * b15:		bmType (0 == data, 1 == command)
 		 */
 		if (header & BIT(15)) {
-			struct usb_request	*req = cdev->req;
+			struct usb_request	*req;
+			struct in_context	*ctx;
+			struct usb_ep		*ep;
 			u16			bmEEMCmd;
 
 			/* EEM command packet format:
@@ -439,11 +449,36 @@ static int eem_unwrap(struct gether *por
 				skb_trim(skb2, len);
 				put_unaligned_le16(BIT(15) | BIT(11) | len,
 							skb_push(skb2, 2));
+
+				ep = port->in_ep;
+				req = usb_ep_alloc_request(ep, GFP_ATOMIC);
+				if (!req) {
+					dev_kfree_skb_any(skb2);
+					goto next;
+				}
+
+				req->buf = kmalloc(skb2->len, GFP_KERNEL);
+				if (!req->buf) {
+					usb_ep_free_request(ep, req);
+					dev_kfree_skb_any(skb2);
+					goto next;
+				}
+
+				ctx = kmalloc(sizeof(*ctx), GFP_KERNEL);
+				if (!ctx) {
+					kfree(req->buf);
+					usb_ep_free_request(ep, req);
+					dev_kfree_skb_any(skb2);
+					goto next;
+				}
+				ctx->skb = skb2;
+				ctx->ep = ep;
+
 				skb_copy_bits(skb2, 0, req->buf, skb2->len);
 				req->length = skb2->len;
 				req->complete = eem_cmd_complete;
 				req->zero = 1;
-				req->context = skb2;
+				req->context = ctx;
 				if (usb_ep_queue(port->in_ep, req, GFP_ATOMIC))
 					DBG(cdev, "echo response queue fail\n");
 				break;
author maintainer
#24 lore raw

PATCH 24/800 usb: renesas-xhci: Fix handling of unknown ROM state

In reply to Greg Kroah-Hartman

From: Moritz Fischer <[email protected]>

commit d143825baf15f204dac60acdf95e428182aa3374 upstream.

The ROM load sometimes seems to return an unknown status (RENESAS_ROM_STATUS_NO_RESULT) instead of success / fail.

If the ROM load indeed failed this leads to failures when trying to communicate with the controller later on.

Attempt to load firmware using RAM load in those cases.

Fixes 2478be82de44 ("usb: renesas-xhci: Add ROM loader for uPD720201")
Cc Mathias Nyman <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Vinod Koul <[email protected]>
---
 drivers/usb/host/xhci-pci-renesas.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/usb/host/xhci-pci-renesas.c +8 -8
@@ -207,7 +207,8 @@ static int renesas_check_rom_state(struc
 			return 0;
 
 		case RENESAS_ROM_STATUS_NO_RESULT: /* No result yet */
-			return 0;
+			dev_dbg(&pdev->dev, "Unknown ROM status ...\n");
+			break;
 
 		case RENESAS_ROM_STATUS_ERROR: /* Error State */
 		default: /* All other states are marked as "Reserved states" */
@@ -224,13 +225,12 @@ static int renesas_fw_check_running(stru
 	u8 fw_state;
 	int err;
 
-	/* Check if device has ROM and loaded, if so skip everything */
-	err = renesas_check_rom(pdev);
-	if (err) { /* we have rom */
-		err = renesas_check_rom_state(pdev);
-		if (!err)
-			return err;
-	}
+	/*
+	 * Only if device has ROM and loaded FW we can skip loading and
+	 * return success. Otherwise (even unknown state), attempt to load FW.
+	 */
+	if (renesas_check_rom(pdev) && !renesas_check_rom_state(pdev))
+		return 0;
 
 	/*
 	 * Test if the device is actually needing the firmware. As most
#25 lore raw

Re: [PATCH 5.13 024/800] usb: renesas-xhci: Fix handling of unknown ROM state

Quoted 13 lines · Greg Kroah-Hartman

From: Moritz Fischer <[email protected]>

commit d143825baf15f204dac60acdf95e428182aa3374 upstream.

The ROM load sometimes seems to return an unknown status (RENESAS_ROM_STATUS_NO_RESULT) instead of success / fail.

If the ROM load indeed failed this leads to failures when trying to communicate with the controller later on.

Attempt to load firmware using RAM load in those cases.

Quoted 11 lines
Fixes 2478be82de44 ("usb: renesas-xhci: Add ROM loader for uPD720201")
Cc Mathias Nyman <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Vinod Koul <[email protected]>

After sending out 5.12.17 for testing, we had a user complain that all of their USB devices disappeared with the error:

Jul 15 23:18:53 kernel: xhci_hcd 0000:04:00.0: Direct firmware load
for renesas_usb_fw.mem failed with error -2
Jul 15 23:18:53 kernel: xhci_hcd 0000:04:00.0: request_firmware failed: -2
Jul 15 23:18:53 kernel: xhci_hcd: probe of 0000:04:00.0 failed with error -2

After first assuming that something was missing in the backport to 5.12, I had the user try 5.13.2, and then 5.14-rc1. Both of those failed in the same way, so it is not working in the current Linus tree either. Reverting this patch fixed the issue.

Justin

Quoted 38 lines
---
 drivers/usb/host/xhci-pci-renesas.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/usb/host/xhci-pci-renesas.c +8 -8
@@ -207,7 +207,8 @@ static int renesas_check_rom_state(struc
                        return 0;
 
                case RENESAS_ROM_STATUS_NO_RESULT: /* No result yet */
-                       return 0;
+                       dev_dbg(&pdev->dev, "Unknown ROM status ...\n");
+                       break;
 
                case RENESAS_ROM_STATUS_ERROR: /* Error State */
                default: /* All other states are marked as "Reserved states" */
@@ -224,13 +225,12 @@ static int renesas_fw_check_running(stru
        u8 fw_state;
        int err;
 
-       /* Check if device has ROM and loaded, if so skip everything */
-       err = renesas_check_rom(pdev);
-       if (err) { /* we have rom */
-               err = renesas_check_rom_state(pdev);
-               if (!err)
-                       return err;
-       }
+       /*
+        * Only if device has ROM and loaded FW we can skip loading and
+        * return success. Otherwise (even unknown state), attempt to load FW.
+        */
+       if (renesas_check_rom(pdev) && !renesas_check_rom_state(pdev))
+               return 0;
 
        /*
         * Test if the device is actually needing the firmware. As most
author maintainer
#26 lore raw

Re: [PATCH 5.13 024/800] usb: renesas-xhci: Fix handling of unknown ROM state

Quoted 35 lines · Justin Forbes
Quoted 13 lines · Greg Kroah-Hartman

From: Moritz Fischer <[email protected]>

commit d143825baf15f204dac60acdf95e428182aa3374 upstream.

The ROM load sometimes seems to return an unknown status (RENESAS_ROM_STATUS_NO_RESULT) instead of success / fail.

If the ROM load indeed failed this leads to failures when trying to communicate with the controller later on.

Attempt to load firmware using RAM load in those cases.

Quoted 11 lines
Fixes 2478be82de44 ("usb: renesas-xhci: Add ROM loader for uPD720201")
Cc Mathias Nyman <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Vinod Koul <[email protected]>

After sending out 5.12.17 for testing, we had a user complain that all of their USB devices disappeared with the error:

Jul 15 23:18:53 kernel: xhci_hcd 0000:04:00.0: Direct firmware load
for renesas_usb_fw.mem failed with error -2
Jul 15 23:18:53 kernel: xhci_hcd 0000:04:00.0: request_firmware failed: -2
Jul 15 23:18:53 kernel: xhci_hcd: probe of 0000:04:00.0 failed with error -2
Quoted 4 lines

After first assuming that something was missing in the backport to 5.12, I had the user try 5.13.2, and then 5.14-rc1. Both of those failed in the same way, so it is not working in the current Linus tree either. Reverting this patch fixed the issue.

Can you send a revert for this so I can get that into Linus's tree and then all stable releases as well?

thanks,

greg k-h

#27 lore raw

Re: [PATCH 5.13 024/800] usb: renesas-xhci: Fix handling of unknown ROM state

Quoted 41 lines · Greg Kroah-Hartman
Quoted 35 lines · Justin Forbes
Quoted 13 lines · Greg Kroah-Hartman

From: Moritz Fischer <[email protected]>

commit d143825baf15f204dac60acdf95e428182aa3374 upstream.

The ROM load sometimes seems to return an unknown status (RENESAS_ROM_STATUS_NO_RESULT) instead of success / fail.

If the ROM load indeed failed this leads to failures when trying to communicate with the controller later on.

Attempt to load firmware using RAM load in those cases.

Quoted 11 lines
Fixes 2478be82de44 ("usb: renesas-xhci: Add ROM loader for uPD720201")
Cc Mathias Nyman <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Vinod Koul <[email protected]>

After sending out 5.12.17 for testing, we had a user complain that all of their USB devices disappeared with the error:

Jul 15 23:18:53 kernel: xhci_hcd 0000:04:00.0: Direct firmware load
for renesas_usb_fw.mem failed with error -2
Jul 15 23:18:53 kernel: xhci_hcd 0000:04:00.0: request_firmware failed: -2
Jul 15 23:18:53 kernel: xhci_hcd: probe of 0000:04:00.0 failed with error -2
Quoted 4 lines

After first assuming that something was missing in the backport to 5.12, I had the user try 5.13.2, and then 5.14-rc1. Both of those failed in the same way, so it is not working in the current Linus tree either. Reverting this patch fixed the issue.

Quoted 6 lines

Can you send a revert for this so I can get that into Linus's tree and then all stable releases as well?

thanks,

greg k-h

Me or Justin? I can do it. This is annoying my system doesn't work without this :-(

Back to the drawing board I guess ...

Justin, any idea if your customer had the eeprom populated and programmed or not, just as additional datapoint.

- Moritz

#28 lore raw

Re: [PATCH 5.13 024/800] usb: renesas-xhci: Fix handling of unknown ROM state

Quoted 50 lines · Moritz Fischer
Quoted 41 lines · Greg Kroah-Hartman
Quoted 35 lines · Justin Forbes
Quoted 13 lines · Greg Kroah-Hartman

From: Moritz Fischer <[email protected]>

commit d143825baf15f204dac60acdf95e428182aa3374 upstream.

The ROM load sometimes seems to return an unknown status (RENESAS_ROM_STATUS_NO_RESULT) instead of success / fail.

If the ROM load indeed failed this leads to failures when trying to communicate with the controller later on.

Attempt to load firmware using RAM load in those cases.

Quoted 11 lines
Fixes 2478be82de44 ("usb: renesas-xhci: Add ROM loader for uPD720201")
Cc Mathias Nyman <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Vinod Koul <[email protected]>

After sending out 5.12.17 for testing, we had a user complain that all of their USB devices disappeared with the error:

Jul 15 23:18:53 kernel: xhci_hcd 0000:04:00.0: Direct firmware load
for renesas_usb_fw.mem failed with error -2
Jul 15 23:18:53 kernel: xhci_hcd 0000:04:00.0: request_firmware failed: -2
Jul 15 23:18:53 kernel: xhci_hcd: probe of 0000:04:00.0 failed with error -2
Quoted 4 lines

After first assuming that something was missing in the backport to 5.12, I had the user try 5.13.2, and then 5.14-rc1. Both of those failed in the same way, so it is not working in the current Linus tree either. Reverting this patch fixed the issue.

Quoted 6 lines

Can you send a revert for this so I can get that into Linus's tree and then all stable releases as well?

thanks,

greg k-h

Quoted 7 lines

Me or Justin? I can do it. This is annoying my system doesn't work without this :-(

Back to the drawing board I guess ...

Justin, any idea if your customer had the eeprom populated and programmed or not, just as additional datapoint.

I am not sure, but I did have another user chime in on the bug saying the test kernel with the revert fixed their system as well. It was a T14s AMD
Generation_1. The original reporter had a ASUS System Product Name/PRIME H370M-PLUS, BIOS 2801 04/13/2021.

Justin

Quoted 1 line

- Moritz

#29 lore raw

Re: [PATCH 5.13 024/800] usb: renesas-xhci: Fix handling of unknown ROM state

Hi,

Quoted 56 lines · Justin Forbes
Quoted 55 lines · Moritz Fischer
Quoted 41 lines · Greg Kroah-Hartman
Quoted 35 lines · Justin Forbes
Quoted 13 lines · Greg Kroah-Hartman

From: Moritz Fischer <[email protected]>

commit d143825baf15f204dac60acdf95e428182aa3374 upstream.

The ROM load sometimes seems to return an unknown status (RENESAS_ROM_STATUS_NO_RESULT) instead of success / fail.

If the ROM load indeed failed this leads to failures when trying to communicate with the controller later on.

Attempt to load firmware using RAM load in those cases.

Quoted 11 lines
Fixes 2478be82de44 ("usb: renesas-xhci: Add ROM loader for uPD720201")
Cc Mathias Nyman <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Vinod Koul <[email protected]>

After sending out 5.12.17 for testing, we had a user complain that all of their USB devices disappeared with the error:

Jul 15 23:18:53 kernel: xhci_hcd 0000:04:00.0: Direct firmware load
for renesas_usb_fw.mem failed with error -2
Jul 15 23:18:53 kernel: xhci_hcd 0000:04:00.0: request_firmware failed: -2
Jul 15 23:18:53 kernel: xhci_hcd: probe of 0000:04:00.0 failed with error -2
Quoted 4 lines

After first assuming that something was missing in the backport to 5.12, I had the user try 5.13.2, and then 5.14-rc1. Both of those failed in the same way, so it is not working in the current Linus tree either. Reverting this patch fixed the issue.

Quoted 6 lines

Can you send a revert for this so I can get that into Linus's tree and then all stable releases as well?

thanks,

greg k-h

Me or Justin? I can do it. This is annoying my system doesn't work without this :-(

Back to the drawing board I guess ...

Quoted 8 lines
Quoted 2 lines

Justin, any idea if your customer had the eeprom populated and programmed or not, just as additional datapoint.

I am not sure, but I did have another user chime in on the bug saying the test kernel with the revert fixed their system as well. It was a T14s AMD
Generation_1. The original reporter had a ASUS System Product Name/PRIME H370M-PLUS, BIOS 2801 04/13/2021.

This solved the same issue on my T14 AMD Gen 1 (non-s variant). I was using 5.13.5 where it was not working and I was able to observe the same error message in dmesg. Reverted the patch, recompiled, rebooted and now it's working just fine.

Sincerely

Signature · 3 lines
Niklaus 'vimja' Hofer
[email protected]
xmpp: [email protected]
#30 lore raw

Re: [PATCH 5.13 024/800] usb: renesas-xhci: Fix handling of unknown ROM state

In reply to Justin Forbes

Justin,

Quoted 27 lines · Justin Forbes
Quoted 13 lines · Greg Kroah-Hartman

From: Moritz Fischer <[email protected]>

commit d143825baf15f204dac60acdf95e428182aa3374 upstream.

The ROM load sometimes seems to return an unknown status (RENESAS_ROM_STATUS_NO_RESULT) instead of success / fail.

If the ROM load indeed failed this leads to failures when trying to communicate with the controller later on.

Attempt to load firmware using RAM load in those cases.

Quoted 11 lines
Fixes 2478be82de44 ("usb: renesas-xhci: Add ROM loader for uPD720201")
Cc Mathias Nyman <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Vinod Koul <[email protected]>
Quoted 7 lines

After sending out 5.12.17 for testing, we had a user complain that all of their USB devices disappeared with the error:

Jul 15 23:18:53 kernel: xhci_hcd 0000:04:00.0: Direct firmware load
for renesas_usb_fw.mem failed with error -2
Jul 15 23:18:53 kernel: xhci_hcd 0000:04:00.0: request_firmware failed: -2
Jul 15 23:18:53 kernel: xhci_hcd: probe of 0000:04:00.0 failed with error -2

This looks like it fails finding the actual firmware file (ENOENT). Any chance you could give this a whirl on top of the original patch?

drivers/usb/host/xhci-pci.c +5 -1
index 18c2bbddf080..cde8f6f1ec5d 100644
@@ -379,7 +379,11 @@ static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
        driver_data = (struct xhci_driver_data *)id->driver_data;
        if (driver_data && driver_data->quirks & XHCI_RENESAS_FW_QUIRK) {
                retval = renesas_xhci_check_request_fw(dev, id);
-               if (retval)
+               /*
+                * If firmware wasn't found there's still a chance this might work without
+                * loading firmware on some systems, so let's try at least.
+                */
+               if (retval && retval != -ENOENT)
                        return retval;
        }
 

Thanks,
Moritz

#31 lore raw

Re: [PATCH 5.13 024/800] usb: renesas-xhci: Fix handling of unknown ROM state

Quoted 34 lines · Moritz Fischer

Justin,

Quoted 30 lines · Justin Forbes
Quoted 13 lines · Greg Kroah-Hartman

From: Moritz Fischer <[email protected]>

commit d143825baf15f204dac60acdf95e428182aa3374 upstream.

The ROM load sometimes seems to return an unknown status (RENESAS_ROM_STATUS_NO_RESULT) instead of success / fail.

If the ROM load indeed failed this leads to failures when trying to communicate with the controller later on.

Attempt to load firmware using RAM load in those cases.

Quoted 11 lines
Fixes 2478be82de44 ("usb: renesas-xhci: Add ROM loader for uPD720201")
Cc Mathias Nyman <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Vinod Koul <[email protected]>

After sending out 5.12.17 for testing, we had a user complain that all of their USB devices disappeared with the error:

Quoted 8 lines
Quoted 4 lines
Jul 15 23:18:53 kernel: xhci_hcd 0000:04:00.0: Direct firmware load
for renesas_usb_fw.mem failed with error -2
Jul 15 23:18:53 kernel: xhci_hcd 0000:04:00.0: request_firmware failed: -2
Jul 15 23:18:53 kernel: xhci_hcd: probe of 0000:04:00.0 failed with error -2

This looks like it fails finding the actual firmware file (ENOENT). Any chance you could give this a whirl on top of the original patch?

Sure. test kernel building now, will let you know when the user reports back.

Justin

Quoted 20 lines
drivers/usb/host/xhci-pci.c +5 -1
index 18c2bbddf080..cde8f6f1ec5d 100644
@@ -379,7 +379,11 @@ static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
        driver_data = (struct xhci_driver_data *)id->driver_data;
        if (driver_data && driver_data->quirks & XHCI_RENESAS_FW_QUIRK) {
                retval = renesas_xhci_check_request_fw(dev, id);
-               if (retval)
+               /*
+                * If firmware wasn't found there's still a chance this might work without
+                * loading firmware on some systems, so let's try at least.
+                */
+               if (retval && retval != -ENOENT)
                        return retval;
        }
 

Thanks,
Moritz

#32 lore raw

Re: [PATCH 5.13 024/800] usb: renesas-xhci: Fix handling of unknown ROM state

Quoted 41 lines · Justin Forbes
Quoted 39 lines · Moritz Fischer

Justin,

Quoted 34 lines · Justin Forbes
Quoted 13 lines · Greg Kroah-Hartman

From: Moritz Fischer <[email protected]>

commit d143825baf15f204dac60acdf95e428182aa3374 upstream.

The ROM load sometimes seems to return an unknown status (RENESAS_ROM_STATUS_NO_RESULT) instead of success / fail.

If the ROM load indeed failed this leads to failures when trying to communicate with the controller later on.

Attempt to load firmware using RAM load in those cases.

Quoted 11 lines
Fixes 2478be82de44 ("usb: renesas-xhci: Add ROM loader for uPD720201")
Cc Mathias Nyman <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Vinod Koul <[email protected]>

After sending out 5.12.17 for testing, we had a user complain that all of their USB devices disappeared with the error:

Jul 15 23:18:53 kernel: xhci_hcd 0000:04:00.0: Direct firmware load
for renesas_usb_fw.mem failed with error -2
Jul 15 23:18:53 kernel: xhci_hcd 0000:04:00.0: request_firmware failed: -2
Jul 15 23:18:53 kernel: xhci_hcd: probe of 0000:04:00.0 failed with error -2
Quoted 5 lines
Quoted 3 lines

This looks like it fails finding the actual firmware file (ENOENT). Any chance you could give this a whirl on top of the original patch?

Sure. test kernel building now, will let you know when the user reports back.

The original user reports success with this patch on top of the original patch.

Justin

Quoted 23 lines

Justin

Quoted 20 lines
drivers/usb/host/xhci-pci.c +5 -1
index 18c2bbddf080..cde8f6f1ec5d 100644
@@ -379,7 +379,11 @@ static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
        driver_data = (struct xhci_driver_data *)id->driver_data;
        if (driver_data && driver_data->quirks & XHCI_RENESAS_FW_QUIRK) {
                retval = renesas_xhci_check_request_fw(dev, id);
-               if (retval)
+               /*
+                * If firmware wasn't found there's still a chance this might work without
+                * loading firmware on some systems, so let's try at least.
+                */
+               if (retval && retval != -ENOENT)
                        return retval;
        }
 

Thanks,
Moritz

#33 lore raw

Re: [PATCH 5.13 024/800] usb: renesas-xhci: Fix handling of unknown ROM state

Quoted 42 lines · Justin Forbes
Quoted 41 lines · Justin Forbes
Quoted 39 lines · Moritz Fischer

Justin,

Quoted 34 lines · Justin Forbes
Quoted 13 lines · Greg Kroah-Hartman

From: Moritz Fischer <[email protected]>

commit d143825baf15f204dac60acdf95e428182aa3374 upstream.

The ROM load sometimes seems to return an unknown status (RENESAS_ROM_STATUS_NO_RESULT) instead of success / fail.

If the ROM load indeed failed this leads to failures when trying to communicate with the controller later on.

Attempt to load firmware using RAM load in those cases.

Quoted 11 lines
Fixes 2478be82de44 ("usb: renesas-xhci: Add ROM loader for uPD720201")
Cc Mathias Nyman <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Vinod Koul <[email protected]>

After sending out 5.12.17 for testing, we had a user complain that all of their USB devices disappeared with the error:

Jul 15 23:18:53 kernel: xhci_hcd 0000:04:00.0: Direct firmware load
for renesas_usb_fw.mem failed with error -2
Jul 15 23:18:53 kernel: xhci_hcd 0000:04:00.0: request_firmware failed: -2
Jul 15 23:18:53 kernel: xhci_hcd: probe of 0000:04:00.0 failed with error -2
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

This looks like it fails finding the actual firmware file (ENOENT). Any chance you could give this a whirl on top of the original patch?

Sure. test kernel building now, will let you know when the user reports back.

The original user reports success with this patch on top of the original patch.

That's good news I guess.

After reading through the datasheet once more I'm even more convinced that the original code with the early return in renesas_check_fw_running() is *very* shady.

There are three statuses to be investigated
- FW load status (fw_state)
- ROM download status (rom_status)
- Firmware version as reported by chip

Currently there the code takes an early return if the latter says the external ROM is there and the 'write firmware to external ROM' worked out, which I think shouldn't be happening, since it doesn't tell us anything about the firmware state at all. In fact I think the early return should not exist at all (a path that the original patch made more likely to happen).

The FW load status indicates whether firmware has been runtime loaded and returns 'No result yet' in your case, too I suspect, which *might* happen if the chip configured itself from external ROM?

So the part that is unclear to me somewhat is should we use either of them at all in trying to determine whether we should load firmware?

Maybe what we should do is:
- Attempt to request_firmware()
- If fail -> proceed and hope for the best
- If success
- Compare the firmware file version with the version reported by the controller
- If they don't match, load firmware, otherwise leave it alone?

- Moritz

Quoted 26 lines

Justin

Quoted 23 lines

Justin

Quoted 20 lines
drivers/usb/host/xhci-pci.c +5 -1
index 18c2bbddf080..cde8f6f1ec5d 100644
@@ -379,7 +379,11 @@ static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
        driver_data = (struct xhci_driver_data *)id->driver_data;
        if (driver_data && driver_data->quirks & XHCI_RENESAS_FW_QUIRK) {
                retval = renesas_xhci_check_request_fw(dev, id);
-               if (retval)
+               /*
+                * If firmware wasn't found there's still a chance this might work without
+                * loading firmware on some systems, so let's try at least.
+                */
+               if (retval && retval != -ENOENT)
                        return retval;
        }
 

Thanks,
Moritz

author maintainer
#34 lore raw

PATCH 25/800 USB: cdc-acm: blacklist Heimann USB Appset device

In reply to Greg Kroah-Hartman

From: Hannu Hartikainen <[email protected]>

commit 4897807753e078655a78de39ed76044d784f3e63 upstream.

The device (32a7:0000 Heimann Sensor GmbH USB appset demo) claims to be a CDC-ACM device in its descriptors but in fact is not. If it is run with echo disabled it returns garbled data, probably due to something that happens in the TTY layer. And when run with echo enabled (the default), it will mess up the calibration data of the sensor the first time any data is sent to the device.

In short, I had a bad time after connecting the sensor and trying to get it to work. I hope blacklisting it in the cdc-acm driver will save someone else a bit of trouble.

---
 drivers/usb/class/cdc-acm.c |    5 +++++
 1 file changed, 5 insertions(+)
drivers/usb/class/cdc-acm.c +5 -0
@@ -1959,6 +1959,11 @@ static const struct usb_device_id acm_id
 	.driver_info = IGNORE_DEVICE,
 	},
 
+	/* Exclude Heimann Sensor GmbH USB appset demo */
+	{ USB_DEVICE(0x32a7, 0x0000),
+	.driver_info = IGNORE_DEVICE,
+	},
+
 	/* control interfaces without any protocol set */
 	{ USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,
 		USB_CDC_PROTO_NONE) },
author maintainer
#35 lore raw

PATCH 26/800 usb: dwc3: Fix debugfs creation flow

In reply to Greg Kroah-Hartman

From: Minas Harutyunyan <[email protected]>

commit 84524d1232ecca7cf8678e851b254f05cff4040a upstream.

Creation EP's debugfs called earlier than debugfs folder for dwc3 device created. As result EP's debugfs are created in '/sys/kernel/debug' instead of '/sys/kernel/debug/usb/dwc3.1.auto'.

Moved dwc3_debugfs_init() function call before calling dwc3_core_init_mode() to allow create dwc3 debugfs parent before creating EP's debugfs's.

---
 drivers/usb/dwc3/core.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/dwc3/core.c +2 -1
@@ -1616,17 +1616,18 @@ static int dwc3_probe(struct platform_de
 	}
 
 	dwc3_check_params(dwc);
+	dwc3_debugfs_init(dwc);
 
 	ret = dwc3_core_init_mode(dwc);
 	if (ret)
 		goto err5;
 
-	dwc3_debugfs_init(dwc);
 	pm_runtime_put(dev);
 
 	return 0;
 
 err5:
+	dwc3_debugfs_exit(dwc);
 	dwc3_event_buffers_cleanup(dwc);
 
 	usb_phy_shutdown(dwc->usb2_phy);
author maintainer
#36 lore raw

PATCH 27/800 usb: typec: tcpci: Fix up sink disconnect thresholds for PD

In reply to Greg Kroah-Hartman

From: Badhri Jagan Sridharan <[email protected]>

commit 4288debeaa4e21d8dd5132739ffba2d343892bbf upstream.

"Table 4-3 VBUS Sink Characteristics" of "Type-C Cable and Connector Specification" defines the disconnect voltage thresholds of various configurations. This change fixes the disconnect threshold voltage calculation based on vSinkPD_min and vSinkDisconnectPD as defined by the table.

Fixes e1a97bf80a022 ("usb: typec: tcpci: Implement Auto discharge disconnect callbacks")
Cc stable <[email protected]>
---
 drivers/usb/typec/tcpm/tcpci.c |   18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
drivers/usb/typec/tcpm/tcpci.c +12 -6
@@ -21,8 +21,12 @@
 #define	PD_RETRY_COUNT_DEFAULT			3
 #define	PD_RETRY_COUNT_3_0_OR_HIGHER		2
 #define	AUTO_DISCHARGE_DEFAULT_THRESHOLD_MV	3500
-#define	AUTO_DISCHARGE_PD_HEADROOM_MV		850
-#define	AUTO_DISCHARGE_PPS_HEADROOM_MV		1250
+#define	VSINKPD_MIN_IR_DROP_MV			750
+#define	VSRC_NEW_MIN_PERCENT			95
+#define	VSRC_VALID_MIN_MV			500
+#define	VPPS_NEW_MIN_PERCENT			95
+#define	VPPS_VALID_MIN_MV			100
+#define	VSINKDISCONNECT_PD_MIN_PERCENT		90
 
 #define tcpc_presenting_rd(reg, cc) \
 	(!(TCPC_ROLE_CTRL_DRP & (reg)) && \
@@ -324,11 +328,13 @@ static int tcpci_set_auto_vbus_discharge
 		threshold = AUTO_DISCHARGE_DEFAULT_THRESHOLD_MV;
 	} else if (mode == TYPEC_PWR_MODE_PD) {
 		if (pps_active)
-			threshold = (95 * requested_vbus_voltage_mv / 100) -
-				AUTO_DISCHARGE_PD_HEADROOM_MV;
+			threshold = ((VPPS_NEW_MIN_PERCENT * requested_vbus_voltage_mv / 100) -
+				     VSINKPD_MIN_IR_DROP_MV - VPPS_VALID_MIN_MV) *
+				     VSINKDISCONNECT_PD_MIN_PERCENT / 100;
 		else
-			threshold = (95 * requested_vbus_voltage_mv / 100) -
-				AUTO_DISCHARGE_PPS_HEADROOM_MV;
+			threshold = ((VSRC_NEW_MIN_PERCENT * requested_vbus_voltage_mv / 100) -
+				     VSINKPD_MIN_IR_DROP_MV - VSRC_VALID_MIN_MV) *
+				     VSINKDISCONNECT_PD_MIN_PERCENT / 100;
 	} else {
 		/* 3.5V for non-pd sink */
 		threshold = AUTO_DISCHARGE_DEFAULT_THRESHOLD_MV;
author maintainer
#37 lore raw

PATCH 28/800 usb: typec: tcpm: Relax disconnect threshold during power negotiation

In reply to Greg Kroah-Hartman

From: Kyle Tso <[email protected]>

commit 2b537cf877eae6d2f2f102052290676e40b74a1d upstream.

If the voltage is being decreased in power negotiation, the Source will set the power supply to operate at the new voltage level before sending PS_RDY. Relax the threshold before sending Request Message so that it will not race with Source which begins to adjust the voltage right after it sends Accept Message (PPS) or tSrcTransition (25~35ms) after it sends Accept Message (non-PPS).

The real threshold will be set after Sink receives PS_RDY Message.

Fixes f321a02caebd ("usb: typec: tcpm: Implement enabling Auto Discharge disconnect support")
Cc stable <[email protected]>
Cc Badhri Jagan Sridharan <[email protected]>
---
 drivers/usb/typec/tcpm/tcpm.c |   27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
drivers/usb/typec/tcpm/tcpm.c +27 -0
@@ -2576,6 +2576,11 @@ static void tcpm_pd_ctrl_request(struct
 			} else {
 				next_state = SNK_WAIT_CAPABILITIES;
 			}
+
+			/* Threshold was relaxed before sending Request. Restore it back. */
+			tcpm_set_auto_vbus_discharge_threshold(port, TYPEC_PWR_MODE_PD,
+							       port->pps_data.active,
+							       port->supply_voltage);
 			tcpm_set_state(port, next_state, 0);
 			break;
 		case SNK_NEGOTIATE_PPS_CAPABILITIES:
@@ -2589,6 +2594,11 @@ static void tcpm_pd_ctrl_request(struct
 			    port->send_discover)
 				port->vdm_sm_running = true;
 
+			/* Threshold was relaxed before sending Request. Restore it back. */
+			tcpm_set_auto_vbus_discharge_threshold(port, TYPEC_PWR_MODE_PD,
+							       port->pps_data.active,
+							       port->supply_voltage);
+
 			tcpm_set_state(port, SNK_READY, 0);
 			break;
 		case DR_SWAP_SEND:
@@ -3308,6 +3318,12 @@ static int tcpm_pd_send_request(struct t
 	if (ret < 0)
 		return ret;
 
+	/*
+	 * Relax the threshold as voltage will be adjusted after Accept Message plus tSrcTransition.
+	 * It is safer to modify the threshold here.
+	 */
+	tcpm_set_auto_vbus_discharge_threshold(port, TYPEC_PWR_MODE_USB, false, 0);
+
 	memset(&msg, 0, sizeof(msg));
 	msg.header = PD_HEADER_LE(PD_DATA_REQUEST,
 				  port->pwr_role,
@@ -3405,6 +3421,9 @@ static int tcpm_pd_send_pps_request(stru
 	if (ret < 0)
 		return ret;
 
+	/* Relax the threshold as voltage will be adjusted right after Accept Message. */
+	tcpm_set_auto_vbus_discharge_threshold(port, TYPEC_PWR_MODE_USB, false, 0);
+
 	memset(&msg, 0, sizeof(msg));
 	msg.header = PD_HEADER_LE(PD_DATA_REQUEST,
 				  port->pwr_role,
@@ -4186,6 +4205,10 @@ static void run_state_machine(struct tcp
 		port->hard_reset_count = 0;
 		ret = tcpm_pd_send_request(port);
 		if (ret < 0) {
+			/* Restore back to the original state */
+			tcpm_set_auto_vbus_discharge_threshold(port, TYPEC_PWR_MODE_PD,
+							       port->pps_data.active,
+							       port->supply_voltage);
 			/* Let the Source send capabilities again. */
 			tcpm_set_state(port, SNK_WAIT_CAPABILITIES, 0);
 		} else {
@@ -4196,6 +4219,10 @@ static void run_state_machine(struct tcp
 	case SNK_NEGOTIATE_PPS_CAPABILITIES:
 		ret = tcpm_pd_send_pps_request(port);
 		if (ret < 0) {
+			/* Restore back to the original state */
+			tcpm_set_auto_vbus_discharge_threshold(port, TYPEC_PWR_MODE_PD,
+							       port->pps_data.active,
+							       port->supply_voltage);
 			port->pps_status = ret;
 			/*
 			 * If this was called due to updates to sink
author maintainer
#38 lore raw

PATCH 29/800 usb: typec: Add the missed altmode_id_remove() in typec_register_altmode()

In reply to Greg Kroah-Hartman

From: Jing Xiangfeng <[email protected]>

commit 03026197bb657d784220b040c6173267a0375741 upstream.

typec_register_altmode() misses to call altmode_id_remove() in an error path. Add the missed function call to fix it.

---
 drivers/usb/typec/class.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/typec/class.c +3 -1
@@ -517,8 +517,10 @@ typec_register_altmode(struct device *pa
 	int ret;
 
 	alt = kzalloc(sizeof(*alt), GFP_KERNEL);
-	if (!alt)
+	if (!alt) {
+		altmode_id_remove(parent, id);
 		return ERR_PTR(-ENOMEM);
+	}
 
 	alt->adev.svid = desc->svid;
 	alt->adev.mode = desc->mode;
author maintainer
#39 lore raw

PATCH 30/800 xhci: solve a double free problem while doing s4

In reply to Greg Kroah-Hartman

From: Zhangjiantao (Kirin, nanjing) <[email protected]>

commit b31d9d6d7abbf6483b871b6370bc31c930d53f54 upstream.

when system is doing s4, the process of xhci_resume may be as below:
1、xhci_mem_cleanup 2、xhci_init->xhci_mem_init->xhci_mem_cleanup(when memory is not enough). xhci_mem_cleanup will be executed twice when system is out of memory. xhci->port_caps is freed in xhci_mem_cleanup,but it isn't set to NULL. It will be freed twice when xhci_mem_cleanup is called the second time.

We got following bug when system resumes from s4:

kernel BUG at mm/slub.c:309!

Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
CPU: 0 PID: 5929 Tainted: G S   W   5.4.96-arm64-desktop #1
pc : __slab_free+0x5c/0x424
lr : kfree+0x30c/0x32c

Call trace:
 __slab_free+0x5c/0x424
 kfree+0x30c/0x32c
 xhci_mem_cleanup+0x394/0x3cc
 xhci_mem_init+0x9ac/0x1070
 xhci_init+0x8c/0x1d0
 xhci_resume+0x1cc/0x5fc
 xhci_plat_resume+0x64/0x70
 platform_pm_thaw+0x28/0x60
 dpm_run_callback+0x54/0x24c
 device_resume+0xd0/0x200
 async_resume+0x24/0x60
 async_run_entry_fn+0x44/0x110
 process_one_work+0x1f0/0x490
 worker_thread+0x5c/0x450
 kthread+0x158/0x160
 ret_from_fork+0x10/0x24

Original patch that caused this issue was backported to 4.4 stable, so this should be backported to 4.4 stabe as well.

Fixes cf0ee7c60c89 ("xhci: Fix memory leak when caching protocol extended capability PSI tables - take 2")
---
 drivers/usb/host/xhci-mem.c |    1 +
 1 file changed, 1 insertion(+)
drivers/usb/host/xhci-mem.c +1 -0
@@ -1924,6 +1924,7 @@ no_bw:
 	xhci->hw_ports = NULL;
 	xhci->rh_bw = NULL;
 	xhci->ext_caps = NULL;
+	xhci->port_caps = NULL;
 
 	xhci->page_size = 0;
 	xhci->page_shift = 0;
author maintainer
#40 lore raw

PATCH 31/800 mm/page_alloc: fix memory map initialization for descending nodes

In reply to Greg Kroah-Hartman

From: Mike Rapoport <[email protected]>

commit 122e093c1734361dedb64f65c99b93e28e4624f4 upstream.

On systems with memory nodes sorted in descending order, for instance Dell Precision WorkStation T5500, the struct pages for higher PFNs and respectively lower nodes, could be overwritten by the initialization of struct pages corresponding to the holes in the memory sections.

For example for the below memory layout

[    0.245624] Early memory node ranges
[    0.248496]   node   1: [mem 0x0000000000001000-0x0000000000090fff]
[    0.251376]   node   1: [mem 0x0000000000100000-0x00000000dbdf8fff]
[    0.254256]   node   1: [mem 0x0000000100000000-0x0000001423ffffff]
[    0.257144]   node   0: [mem 0x0000001424000000-0x0000002023ffffff]

the range 0x1424000000 - 0x1428000000 in the beginning of node 0 starts in the middle of a section and will be considered as a hole during the initialization of the last section in node 1.

The wrong initialization of the memory map causes panic on boot when CONFIG_DEBUG_VM is enabled.

Reorder loop order of the memory map initialization so that the outer loop will always iterate over populated memory regions in the ascending order and the inner loop will select the zone corresponding to the PFN range.

This way initialization of the struct pages for the memory holes will be always done for the ranges that are actually not populated.

[[email protected]: coding style fixes]

Fixes 0740a50b9baa ("mm/page_alloc.c: refactor initialization of struct page for holes in memory layout")
Cc Boris Petkov <[email protected]>
Cc Robert Shteynfeld <[email protected]>
Cc Baoquan He <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc David Hildenbrand <[email protected]>
---
 include/linux/mm.h |    1 
 mm/page_alloc.c    |   96 ++++++++++++++++++++++++++++++++---------------------
 2 files changed, 59 insertions(+), 38 deletions(-)
include/linux/mm.h +0 -1
@@ -2474,7 +2474,6 @@ extern void set_dma_reserve(unsigned lon
 extern void memmap_init_range(unsigned long, int, unsigned long,
 		unsigned long, unsigned long, enum meminit_context,
 		struct vmem_altmap *, int migratetype);
-extern void memmap_init_zone(struct zone *zone);
 extern void setup_per_zone_wmarks(void);
 extern int __meminit init_per_zone_wmark_min(void);
 extern void mem_init(void);
mm/page_alloc.c +59 -37

151 lines not on this page · raw message

author maintainer
#41 lore raw

PATCH 32/800 gfs2: Fix underflow in gfs2_page_mkwrite

In reply to Greg Kroah-Hartman

From: Andreas Gruenbacher <[email protected]>

commit d3c51c55cb9274dd43c156f1f26b5eb4d5f2d58c upstream.

On filesystems with a block size smaller than PAGE_SIZE and non-empty files smaller then PAGE_SIZE, gfs2_page_mkwrite could end up allocating excess blocks beyond the end of the file, similar to fallocate. This doesn't make sense; fix it.

Fixes 184b4e60853d ("gfs2: Fix end-of-file handling in gfs2_page_mkwrite")
---
 fs/gfs2/file.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/gfs2/file.c +2 -2
@@ -450,8 +450,8 @@ static vm_fault_t gfs2_page_mkwrite(stru
 	file_update_time(vmf->vma->vm_file);
 
 	/* page is wholly or partially inside EOF */
-	if (offset > size - PAGE_SIZE)
-		length = offset_in_page(size);
+	if (size - offset < PAGE_SIZE)
+		length = size - offset;
 	else
 		length = PAGE_SIZE;
 
author maintainer
#42 lore raw

PATCH 33/800 gfs2: Fix error handling in init_statfs

In reply to Greg Kroah-Hartman

From: Andreas Gruenbacher <[email protected]>

commit 5d49d3508b3c67201bd3e1bf7f4ef049111b7051 upstream.

On an error path, init_statfs calls iput(pn) after pn has already been put. Fix that by setting pn to NULL after the initial iput.

Fixes 97fd734ba17e ("gfs2: lookup local statfs inodes prior to journal recovery")
Cc [email protected] # v5.10+
---
 fs/gfs2/ops_fstype.c |    1 +
 1 file changed, 1 insertion(+)
fs/gfs2/ops_fstype.c +1 -0
@@ -687,6 +687,7 @@ static int init_statfs(struct gfs2_sbd *
 	}
 
 	iput(pn);
+	pn = NULL;
 	ip = GFS2_I(sdp->sd_sc_inode);
 	error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0,
 				   &sdp->sd_sc_gh);
author maintainer
#43 lore raw

PATCH 34/800 ntfs: fix validity check for file name attribute

In reply to Greg Kroah-Hartman

From: Desmond Cheong Zhi Xi <[email protected]>

commit d98e4d95411bbde2220a7afa38dcc9c14d71acbe upstream.

When checking the file name attribute, we want to ensure that it fits within the bounds of ATTR_RECORD. To do this, we should check that (attr record + file name offset + file name length) < (attr record + attr record length).

However, the original check did not include the file name offset in the calculation. This means that corrupted on-disk metadata might not caught by the incorrect file name check, and lead to an invalid memory access.

An example can be seen in the crash report of a memory corruption error found by Syzbot:
https://syzkaller.appspot.com/bug?id=a1a1e379b225812688566745c3e2f7242bffc246

Adding the file name offset to the validity check fixes this error and passes the Syzbot reproducer test.

---
 fs/ntfs/inode.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ntfs/inode.c +1 -1
@@ -477,7 +477,7 @@ err_corrupt_attr:
 		}
 		file_name_attr = (FILE_NAME_ATTR*)((u8*)attr +
 				le16_to_cpu(attr->data.resident.value_offset));
-		p2 = (u8*)attr + le32_to_cpu(attr->data.resident.value_length);
+		p2 = (u8 *)file_name_attr + le32_to_cpu(attr->data.resident.value_length);
 		if (p2 < (u8*)attr || p2 > p)
 			goto err_corrupt_attr;
 		/* This attribute is ok, but is it in the $Extend directory? */
author maintainer
#44 lore raw

PATCH 35/800 selftests/lkdtm: Avoid needing explicit sub-shell

In reply to Greg Kroah-Hartman

From: Kees Cook <[email protected]>

commit 04831e892b41618914b2123ae3b4fa77252e8656 upstream.

Some environments do not set $SHELL when running tests. There's no need to use $SHELL here anyway, since "cat" can be used to receive any delivered signals from the kernel. Additionally avoid using bash-isms in the command, and record stderr for posterity.

---
 tools/testing/selftests/lkdtm/run.sh |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
tools/testing/selftests/lkdtm/run.sh +8 -4
@@ -76,10 +76,14 @@ fi
 # Save existing dmesg so we can detect new content below
 dmesg > "$DMESG"
 
-# Most shells yell about signals and we're expecting the "cat" process
-# to usually be killed by the kernel. So we have to run it in a sub-shell
-# and silence errors.
-($SHELL -c 'cat <(echo '"$test"') >'"$TRIGGER" 2>/dev/null) || true
+# Since the kernel is likely killing the process writing to the trigger
+# file, it must not be the script's shell itself. i.e. we cannot do:
+#     echo "$test" >"$TRIGGER"
+# Instead, use "cat" to take the signal. Since the shell will yell about
+# the signal that killed the subprocess, we must ignore the failure and
+# continue. However we don't silence stderr since there might be other
+# useful details reported there in the case of other unexpected conditions.
+echo "$test" | cat >"$TRIGGER" || true
 
 # Record and dump the results
 dmesg | comm --nocheck-order -13 "$DMESG" - > "$LOG" || true
author maintainer
#45 lore raw

PATCH 36/800 copy_page_to_iter(): fix ITER_DISCARD case

In reply to Greg Kroah-Hartman

From: Al Viro <[email protected]>

commit a506abc7b644d71966a75337d5a534f531b3cdc4 upstream.

we need to advance the iterator...

---
 lib/iov_iter.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
lib/iov_iter.c +5 -2
@@ -967,9 +967,12 @@ size_t copy_page_to_iter(struct page *pa
 		size_t wanted = copy_to_iter(kaddr + offset, bytes, i);
 		kunmap_atomic(kaddr);
 		return wanted;
-	} else if (unlikely(iov_iter_is_discard(i)))
+	} else if (unlikely(iov_iter_is_discard(i))) {
+		if (unlikely(i->count < bytes))
+			bytes = i->count;
+		i->count -= bytes;
 		return bytes;
-	else if (likely(!iov_iter_is_pipe(i)))
+	} else if (likely(!iov_iter_is_pipe(i)))
 		return copy_page_to_iter_iovec(page, offset, bytes, i);
 	else
 		return copy_page_to_iter_pipe(page, offset, bytes, i);
author maintainer
#46 lore raw

PATCH 37/800 teach copy_page_to_iter() to handle compound pages

In reply to Greg Kroah-Hartman

From: Al Viro <[email protected]>

commit 08aa64796016cb47b2ef3d0924653b4d944b0d65 upstream.

In situation when copy_page_to_iter() got a compound page the current
code would only work on systems with no CONFIG_HIGHMEM. It *is* the majority of real-world setups, or we would've drown in bug reports by now. Still needs fixing.

Current variant works for solitary page; rename that to
__copy_page_to_iter() and turn the handling of compound pages into a loop over subpages.

---
 lib/iov_iter.c |   28 +++++++++++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)
lib/iov_iter.c +25 -3
@@ -957,11 +957,9 @@ static inline bool page_copy_sane(struct
 	return false;
 }
 
-size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes,
+static size_t __copy_page_to_iter(struct page *page, size_t offset, size_t bytes,
 			 struct iov_iter *i)
 {
-	if (unlikely(!page_copy_sane(page, offset, bytes)))
-		return 0;
 	if (i->type & (ITER_BVEC | ITER_KVEC | ITER_XARRAY)) {
 		void *kaddr = kmap_atomic(page);
 		size_t wanted = copy_to_iter(kaddr + offset, bytes, i);
@@ -977,6 +975,30 @@ size_t copy_page_to_iter(struct page *pa
 	else
 		return copy_page_to_iter_pipe(page, offset, bytes, i);
 }
+
+size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes,
+			 struct iov_iter *i)
+{
+	size_t res = 0;
+	if (unlikely(!page_copy_sane(page, offset, bytes)))
+		return 0;
+	page += offset / PAGE_SIZE; // first subpage
+	offset %= PAGE_SIZE;
+	while (1) {
+		size_t n = __copy_page_to_iter(page, offset,
+				min(bytes, (size_t)PAGE_SIZE - offset), i);
+		res += n;
+		bytes -= n;
+		if (!bytes || !n)
+			break;
+		offset += n;
+		if (offset == PAGE_SIZE) {
+			page++;
+			offset = 0;
+		}
+	}
+	return res;
+}
 EXPORT_SYMBOL(copy_page_to_iter);
 
 size_t copy_page_from_iter(struct page *page, size_t offset, size_t bytes,
author maintainer
#47 lore raw

PATCH 38/800 iov_iter_fault_in_readable() should do nothing in xarray case

In reply to Greg Kroah-Hartman

From: Al Viro <[email protected]>

commit 0e8f0d67401589a141950856902c7d0ec8d9c985 upstream.

... and actually should just check it's given an iovec-backed iterator in the first place.

---
 lib/iov_iter.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/iov_iter.c +1 -1
@@ -476,7 +476,7 @@ int iov_iter_fault_in_readable(struct io
 	int err;
 	struct iovec v;
 
-	if (!(i->type & (ITER_BVEC|ITER_KVEC))) {
+	if (iter_is_iovec(i)) {
 		iterate_iovec(i, bytes, v, iov, skip, ({
 			err = fault_in_pages_readable(v.iov_base, v.iov_len);
 			if (unlikely(err))
author maintainer
#48 lore raw

PATCH 39/800 Input: elants_i2c - fix NULL dereference at probing

In reply to Greg Kroah-Hartman

From: Takashi Iwai <[email protected]>

commit b9c0ebb867d67cc4e9e1a7a2abf0ac9a2cc02051 upstream.

The recent change in elants_i2c driver to support more chips introduced a regression leading to Oops at probing. The driver reads id->driver_data, but the id may be NULL depending on the device type the driver gets bound.

Replace the driver data extraction with the device_get_match_data() helper, and define the driver data in OF table, too.

---
 drivers/input/touchscreen/elants_i2c.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/input/touchscreen/elants_i2c.c +3 -3
@@ -1396,7 +1396,7 @@ static int elants_i2c_probe(struct i2c_c
 	init_completion(&ts->cmd_done);
 
 	ts->client = client;
-	ts->chip_id = (enum elants_chip_id)id->driver_data;
+	ts->chip_id = (enum elants_chip_id)(uintptr_t)device_get_match_data(&client->dev);
 	i2c_set_clientdata(client, ts);
 
 	ts->vcc33 = devm_regulator_get(&client->dev, "vcc33");
@@ -1636,8 +1636,8 @@ MODULE_DEVICE_TABLE(acpi, elants_acpi_id
 
 #ifdef CONFIG_OF
 static const struct of_device_id elants_of_match[] = {
-	{ .compatible = "elan,ekth3500" },
-	{ .compatible = "elan,ektf3624" },
+	{ .compatible = "elan,ekth3500", .data = (void *)EKTH3500 },
+	{ .compatible = "elan,ektf3624", .data = (void *)EKTF3624 },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, elants_of_match);
author maintainer
#49 lore raw

PATCH 40/800 Input: joydev - prevent use of not validated data in JSIOCSBTNMAP ioctl

In reply to Greg Kroah-Hartman

From: Alexander Larkin <[email protected]>

commit f8f84af5da9ee04ef1d271528656dac42a090d00 upstream.

Even though we validate user-provided inputs we then traverse past validated data when applying the new map. The issue was originally discovered by Murray McAllister with this simple POC (if the following is executed by an unprivileged user it will instantly panic the system):

int main(void) {
	int fd, ret;
	unsigned int buffer[10000];

	fd = open("/dev/input/js0", O_RDONLY);
	if (fd == -1)
		printf("Error opening file\n");

	ret = ioctl(fd, JSIOCSBTNMAP & ~IOCSIZE_MASK, &buffer);
	printf("%d\n", ret);
}

The solution is to traverse internal buffer which is guaranteed to only contain valid date when constructing the map.

Fixes 182d679b2298 ("Input: joydev - prevent potential read overflow in ioctl")
Fixes 999b874f4aa3 ("Input: joydev - validate axis/button maps before clobbering current ones")
---
 drivers/input/joydev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/joydev.c +1 -1
@@ -499,7 +499,7 @@ static int joydev_handle_JSIOCSBTNMAP(st
 	memcpy(joydev->keypam, keypam, len);
 
 	for (i = 0; i < joydev->nkey; i++)
-		joydev->keymap[keypam[i] - BTN_MISC] = i;
+		joydev->keymap[joydev->keypam[i] - BTN_MISC] = i;
 
  out:
 	kfree(keypam);
author maintainer
#50 lore raw

PATCH 41/800 crypto: nx - Fix memcpy() over-reading in nonce

In reply to Greg Kroah-Hartman

From: Kees Cook <[email protected]>

commit 74c66120fda6596ad57f41e1607b3a5d51ca143d upstream.

Fix typo in memcpy() where size should be CTR_RFC3686_NONCE_SIZE.

Fixes 030f4e968741 ("crypto: nx - Fix reentrancy bugs")
---
 drivers/crypto/nx/nx-aes-ctr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/nx/nx-aes-ctr.c +1 -1
@@ -118,7 +118,7 @@ static int ctr3686_aes_nx_crypt(struct s
 	struct nx_crypto_ctx *nx_ctx = crypto_skcipher_ctx(tfm);
 	u8 iv[16];
 
-	memcpy(iv, nx_ctx->priv.ctr.nonce, CTR_RFC3686_IV_SIZE);
+	memcpy(iv, nx_ctx->priv.ctr.nonce, CTR_RFC3686_NONCE_SIZE);
 	memcpy(iv + CTR_RFC3686_NONCE_SIZE, req->iv, CTR_RFC3686_IV_SIZE);
 	iv[12] = iv[13] = iv[14] = 0;
 	iv[15] = 1;
author maintainer
#51 lore raw

PATCH 42/800 crypto: ccp - Annotate SEV Firmware file names

In reply to Greg Kroah-Hartman

From: Joerg Roedel <[email protected]>

commit c8671c7dc7d51125ab9f651697866bf4a9132277 upstream.

Annotate the firmware files CCP might need using MODULE_FIRMWARE(). This will get them included into an initrd when CCP is also included there. Otherwise the CCP module will not find its firmware when loaded before the root-fs is mounted.
This can cause problems when the pre-loaded SEV firmware is too old to support current SEV and SEV-ES virtualization features.

Fixes e93720606efd ("crypto: ccp - Allow SEV firmware to be chosen based on Family and Model")
Cc [email protected] # v4.20+
---
 drivers/crypto/ccp/sev-dev.c |    4 ++++
 1 file changed, 4 insertions(+)
drivers/crypto/ccp/sev-dev.c +4 -0
@@ -43,6 +43,10 @@ static int psp_probe_timeout = 5;
 module_param(psp_probe_timeout, int, 0644);
 MODULE_PARM_DESC(psp_probe_timeout, " default timeout value, in seconds, during PSP device probe");
 
+MODULE_FIRMWARE("amd/amd_sev_fam17h_model0xh.sbin"); /* 1st gen EPYC */
+MODULE_FIRMWARE("amd/amd_sev_fam17h_model3xh.sbin"); /* 2nd gen EPYC */
+MODULE_FIRMWARE("amd/amd_sev_fam19h_model0xh.sbin"); /* 3rd gen EPYC */
+
 static bool psp_dead;
 static int psp_timeout;
 
author maintainer
#52 lore raw

PATCH 43/800 arm_pmu: Fix write counter incorrect in ARMv7 big-endian mode

In reply to Greg Kroah-Hartman

From: Yang Jihong <[email protected]>

commit fdbef8c4e68ad423416aa6cc93d1616d6f8ac5b3 upstream.

Commit 3a95200d3f89 ("arm_pmu: Change API to support 64bit counter values") changes the input "value" type from 32-bit to 64-bit, which introduces the following problem: ARMv7 PMU counters is 32-bit width, in big-endian mode, write counter uses high 32-bit, which writes an incorrect value.

Before:

Performance counter stats for 'ls':

              2.22 msec task-clock                #    0.675 CPUs utilized
                 0      context-switches          #    0.000 K/sec
                 0      cpu-migrations            #    0.000 K/sec
                49      page-faults               #    0.022 M/sec
        2150476593      cycles                    #  966.663 GHz
        2148588788      instructions              #    1.00  insn per cycle
        2147745484      branches                  # 965435.074 M/sec
        2147508540      branch-misses             #   99.99% of all branches

None of the above hw event counters are correct.

Solution:

"value" forcibly converted to 32-bit type before being written to PMU register.

After:

Performance counter stats for 'ls':

              2.09 msec task-clock                #    0.681 CPUs utilized
                 0      context-switches          #    0.000 K/sec
                 0      cpu-migrations            #    0.000 K/sec
                46      page-faults               #    0.022 M/sec
           2807301      cycles                    #    1.344 GHz
           1060159      instructions              #    0.38  insn per cycle
            250496      branches                  #  119.914 M/sec
             23192      branch-misses             #    9.26% of all branches
---
 arch/arm/kernel/perf_event_v7.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/kernel/perf_event_v7.c +2 -2
@@ -773,10 +773,10 @@ static inline void armv7pmu_write_counte
 		pr_err("CPU%u writing wrong counter %d\n",
 			smp_processor_id(), idx);
 	} else if (idx == ARMV7_IDX_CYCLE_COUNTER) {
-		asm volatile("mcr p15, 0, %0, c9, c13, 0" : : "r" (value));
+		asm volatile("mcr p15, 0, %0, c9, c13, 0" : : "r" ((u32)value));
 	} else {
 		armv7_pmnc_select_counter(idx);
-		asm volatile("mcr p15, 0, %0, c9, c13, 2" : : "r" (value));
+		asm volatile("mcr p15, 0, %0, c9, c13, 2" : : "r" ((u32)value));
 	}
 }
 
author maintainer
#53 lore raw

PATCH 44/800 ARM: dts: ux500: Fix LED probing

In reply to Greg Kroah-Hartman

From: Linus Walleij <[email protected]>

commit 7749510c459c10c431d746a4749e7c9cf2899156 upstream.

The Ux500 HREF LEDs have not been probing properly for a while as this was introduce:

     ret = of_property_read_u32(np, "color", &led_color);
     if (ret)
             return ret;

Since the device tree did not define the new invented color attribute, probe was failing.

Define color attributes for the LEDs so they work again.

Fixes 92a81562e695 ("leds: lp55xx: Add multicolor framework support to lp55xx")
Cc Dan Murphy <[email protected]>
---
 arch/arm/boot/dts/ste-href.dtsi |    7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/boot/dts/ste-href.dtsi +7 -0
@@ -4,6 +4,7 @@
  */
 
 #include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/leds/common.h>
 #include "ste-href-family-pinctrl.dtsi"
 
 / {
@@ -64,17 +65,20 @@
 					reg = <0>;
 					led-cur = /bits/ 8 <0x2f>;
 					max-cur = /bits/ 8 <0x5f>;
+					color = <LED_COLOR_ID_BLUE>;
 					linux,default-trigger = "heartbeat";
 				};
 				chan@1 {
 					reg = <1>;
 					led-cur = /bits/ 8 <0x2f>;
 					max-cur = /bits/ 8 <0x5f>;
+					color = <LED_COLOR_ID_BLUE>;
 				};
 				chan@2 {
 					reg = <2>;
 					led-cur = /bits/ 8 <0x2f>;
 					max-cur = /bits/ 8 <0x5f>;
+					color = <LED_COLOR_ID_BLUE>;
 				};
 			};
 			lp5521@34 {
@@ -88,16 +92,19 @@
 					reg = <0>;
 					led-cur = /bits/ 8 <0x2f>;
 					max-cur = /bits/ 8 <0x5f>;
+					color = <LED_COLOR_ID_BLUE>;
 				};
 				chan@1 {
 					reg = <1>;
 					led-cur = /bits/ 8 <0x2f>;
 					max-cur = /bits/ 8 <0x5f>;
+					color = <LED_COLOR_ID_BLUE>;
 				};
 				chan@2 {
 					reg = <2>;
 					led-cur = /bits/ 8 <0x2f>;
 					max-cur = /bits/ 8 <0x5f>;
+					color = <LED_COLOR_ID_BLUE>;
 				};
 			};
 			bh1780@29 {
author maintainer
#54 lore raw

PATCH 45/800 ARM: dts: at91: sama5d4: fix pinctrl muxing

In reply to Greg Kroah-Hartman

From: Ludovic Desroches <[email protected]>

commit 253adffb0e98eaf6da2e7cf73ae68695e21f2f3c upstream.

Fix pinctrl muxing, PD28, PD29 and PD31 can be muxed to peripheral A. It allows to use SCK0, SCK1 and SPI0_NPCS2 signals.

Fixes 679f8d92bb01 ("ARM: at91/dt: sama5d4: add pioD pin mux mask and enable pioD")
---
 arch/arm/boot/dts/sama5d4.dtsi |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/sama5d4.dtsi +1 -1
@@ -787,7 +787,7 @@
 					0xffffffff 0x3ffcfe7c 0x1c010101	/* pioA */
 					0x7fffffff 0xfffccc3a 0x3f00cc3a	/* pioB */
 					0xffffffff 0x3ff83fff 0xff00ffff	/* pioC */
-					0x0003ff00 0x8002a800 0x00000000	/* pioD */
+					0xb003ff00 0x8002a800 0x00000000	/* pioD */
 					0xffffffff 0x7fffffff 0x76fff1bf	/* pioE */
 					>;
 
author maintainer
#55 lore raw

PATCH 46/800 btrfs: zoned: print message when zone sanity check type fails

In reply to Greg Kroah-Hartman

From: Naohiro Aota <[email protected]>

commit 47cdfb5e1dd60422ec2cbc53b667f73ff9a411dc upstream.

This extends patch 784daf2b9628 ("btrfs: zoned: sanity check zone type"), the message was supposed to be there but was lost during merge. We want to make the error noticeable so add it.

Fixes 784daf2b9628 ("btrfs: zoned: sanity check zone type")
---
 fs/btrfs/zoned.c |    4 ++++
 1 file changed, 4 insertions(+)
fs/btrfs/zoned.c +4 -0
@@ -1140,6 +1140,10 @@ int btrfs_load_block_group_zone_info(str
 		}
 
 		if (zone.type == BLK_ZONE_TYPE_CONVENTIONAL) {
+			btrfs_err_in_rcu(fs_info,
+	"zoned: unexpected conventional zone %llu on device %s (devid %llu)",
+				zone.start << SECTOR_SHIFT,
+				rcu_str_deref(device->name), device->devid);
 			ret = -EIO;
 			goto out;
 		}
author maintainer
#56 lore raw

PATCH 47/800 btrfs: zoned: bail out if we cant read a reliable write pointer

In reply to Greg Kroah-Hartman

From: Johannes Thumshirn <[email protected]>

commit 06e1e7f4223c98965fb721b4b1e12083cfbe777e upstream.

If we can't read a reliable write pointer from a sequential zone fail creating the block group with an I/O error.

Also if the read write pointer is beyond the end of the respective zone, fail the creation of the block group on this zone with an I/O error.

While this could also happen in real world scenarios with misbehaving drives, this issue addresses a problem uncovered by fstests' test case generic/475.

---
 fs/btrfs/zoned.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)
fs/btrfs/zoned.c +14 -0
@@ -1204,6 +1204,13 @@ int btrfs_load_block_group_zone_info(str
 
 	switch (map->type & BTRFS_BLOCK_GROUP_PROFILE_MASK) {
 	case 0: /* single */
+		if (alloc_offsets[0] == WP_MISSING_DEV) {
+			btrfs_err(fs_info,
+			"zoned: cannot recover write pointer for zone %llu",
+				physical);
+			ret = -EIO;
+			goto out;
+		}
 		cache->alloc_offset = alloc_offsets[0];
 		break;
 	case BTRFS_BLOCK_GROUP_DUP:
@@ -1221,6 +1228,13 @@ int btrfs_load_block_group_zone_info(str
 	}
 
 out:
+	if (cache->alloc_offset > fs_info->zone_size) {
+		btrfs_err(fs_info,
+			"zoned: invalid write pointer %llu in block group %llu",
+			cache->alloc_offset, cache->start);
+		ret = -EIO;
+	}
+
 	/* An extent is allocated after the write pointer */
 	if (!ret && num_conventional && last_alloc > cache->alloc_offset) {
 		btrfs_err(fs_info,
author maintainer
#57 lore raw

PATCH 48/800 btrfs: send: fix invalid path for unlink operations after parent orphanization

In reply to Greg Kroah-Hartman

From: Filipe Manana <[email protected]>

commit d8ac76cdd1755b21e8c008c28d0b7251c0b14986 upstream.

During an incremental send operation, when processing the new references for the current inode, we might send an unlink operation for another inode that has a conflicting path and has more than one hard link. However this path was computed and cached before we processed previous new references for the current inode. We may have orphanized a directory of that path while processing a previous new reference, in which case the path will be invalid and cause the receiver process to fail.

The following reproducer triggers the problem and explains how/why it happens in its comments:

  $ cat test-send-unlink.sh
  #!/bin/bash

DEV=/dev/sdi
MNT=/mnt/sdi

mkfs.btrfs -f $DEV >/dev/null
mount $DEV $MNT

# Create our test files and directory. Inode 259 (file3) has two hard

  # links.
  touch $MNT/file1
  touch $MNT/file2
  touch $MNT/file3

mkdir $MNT/A
ln $MNT/file3 $MNT/A/hard_link

# Filesystem looks like:
#

  # .                                     (ino 256)
  # |----- file1                          (ino 257)
  # |----- file2                          (ino 258)
  # |----- file3                          (ino 259)
  # |----- A/                             (ino 260)
  #        |---- hard_link                (ino 259)
  #

# Now create the base snapshot, which is going to be the parent snapshot

  # for a later incremental send.
  btrfs subvolume snapshot -r $MNT $MNT/snap1
  btrfs send -f /tmp/snap1.send $MNT/snap1

# Move inode 257 into directory inode 260. This results in computing the

  # path for inode 260 as "/A" and caching it.
  mv $MNT/file1 $MNT/A/file1

# Move inode 258 (file2) into directory inode 260, with a name of # "hard_link", moving first inode 259 away since it currently has that

  # location and name.
  mv $MNT/A/hard_link $MNT/tmp
  mv $MNT/file2 $MNT/A/hard_link

# Now rename inode 260 to something else (B for example) and then create

  # a hard link for inode 258 that has the old name and location of inode
  # 260 ("/A").
  mv $MNT/A $MNT/B
  ln $MNT/B/hard_link $MNT/A

# Filesystem now looks like:
#

  # .                                     (ino 256)
  # |----- tmp                            (ino 259)
  # |----- file3                          (ino 259)
  # |----- B/                             (ino 260)
  # |      |---- file1                    (ino 257)
  # |      |---- hard_link                (ino 258)
  # |
  # |----- A                              (ino 258)

# Create another snapshot of our subvolume and use it for an incremental

  # send.
  btrfs subvolume snapshot -r $MNT $MNT/snap2
  btrfs send -f /tmp/snap2.send -p $MNT/snap1 $MNT/snap2

# Now unmount the filesystem, create a new one, mount it and try to

  # apply both send streams to recreate both snapshots.
  umount $DEV

mkfs.btrfs -f $DEV >/dev/null

mount $DEV $MNT

# First add the first snapshot to the new filesystem by applying the

  # first send stream.
  btrfs receive -f /tmp/snap1.send $MNT

# The incremental receive operation below used to fail with the

  # following error:
  #
  #    ERROR: unlink A/hard_link failed: No such file or directory
  #
  # This is because when send is processing inode 257, it generates the
  # path for inode 260 as "/A", since that inode is its parent in the send
  # snapshot, and caches that path.
  #
  # Later when processing inode 258, it first processes its new reference
  # that has the path of "/A", which results in orphanizing inode 260
  # because there is a a path collision. This results in issuing a rename
  # operation from "/A" to "/o260-6-0".
  #
  # Finally when processing the new reference "B/hard_link" for inode 258,
  # it notices that it collides with inode 259 (not yet processed, because
  # it has a higher inode number), since that inode has the name
  # "hard_link" under the directory inode 260. It also checks that inode
  # 259 has two hardlinks, so it decides to issue a unlink operation for
  # the name "hard_link" for inode 259. However the path passed to the
  # unlink operation is "/A/hard_link", which is incorrect since currently
  # "/A" does not exists, due to the orphanization of inode 260 mentioned
  # before. The path is incorrect because it was computed and cached
  # before the orphanization. This results in the receiver to fail with
  # the above error.
  btrfs receive -f /tmp/snap2.send $MNT

umount $MNT

When running the test, it fails like this:

  $ ./test-send-unlink.sh
  Create a readonly snapshot of '/mnt/sdi' in '/mnt/sdi/snap1'
  At subvol /mnt/sdi/snap1
  Create a readonly snapshot of '/mnt/sdi' in '/mnt/sdi/snap2'
  At subvol /mnt/sdi/snap2
  At subvol snap1
  At snapshot snap2
  ERROR: unlink A/hard_link failed: No such file or directory

Fix this by recomputing a path before issuing an unlink operation when processing the new references for the current inode if we previously have orphanized a directory.

A test case for fstests will follow soon.

---
 fs/btrfs/send.c |   11 +++++++++++
 1 file changed, 11 insertions(+)
fs/btrfs/send.c +11 -0
@@ -4064,6 +4064,17 @@ static int process_recorded_refs(struct
 				if (ret < 0)
 					goto out;
 			} else {
+				/*
+				 * If we previously orphanized a directory that
+				 * collided with a new reference that we already
+				 * processed, recompute the current path because
+				 * that directory may be part of the path.
+				 */
+				if (orphanized_dir) {
+					ret = refresh_ref_path(sctx, cur);
+					if (ret < 0)
+						goto out;
+				}
 				ret = send_unlink(sctx, cur->full_path);
 				if (ret < 0)
 					goto out;
author maintainer
#58 lore raw

PATCH 49/800 btrfs: compression: dont try to compress if we dont have enough pages

In reply to Greg Kroah-Hartman

From: David Sterba <[email protected]>

commit f2165627319ffd33a6217275e5690b1ab5c45763 upstream.

The early check if we should attempt compression does not take into account the number of input pages. It can happen that there's only one page, eg. a tail page after some ranges of the BTRFS_MAX_UNCOMPRESSED have been processed, or an isolated page that won't be converted to an inline extent.

The single page would be compressed but a later check would drop it again because the result size must be at least one block shorter than the input. That can never work with just one page.

---
 fs/btrfs/inode.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/inode.c +1 -1
@@ -603,7 +603,7 @@ again:
 	 * inode has not been flagged as nocompress.  This flag can
 	 * change at any time if we discover bad compression ratios.
 	 */
-	if (inode_need_compress(BTRFS_I(inode), start, end)) {
+	if (nr_pages > 1 && inode_need_compress(BTRFS_I(inode), start, end)) {
 		WARN_ON(pages);
 		pages = kcalloc(nr_pages, sizeof(struct page *), GFP_NOFS);
 		if (!pages) {
author maintainer
#59 lore raw

PATCH 50/800 btrfs: fix unbalanced unlock in qgroup_account_snapshot()

In reply to Greg Kroah-Hartman

From: Naohiro Aota <[email protected]>

commit 44365827cccc1441d4187509257e5276af133a49 upstream.

qgroup_account_snapshot() is trying to unlock the not taken tree_log_mutex in a error path. Since ret != 0 in this case, we can just return from here.

Fixes 2a4d84c11a87 ("btrfs: move delayed ref flushing for qgroup into qgroup helper")
---
 fs/btrfs/transaction.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/transaction.c +1 -1
@@ -1476,7 +1476,7 @@ static int qgroup_account_snapshot(struc
 	ret = btrfs_run_delayed_refs(trans, (unsigned long)-1);
 	if (ret) {
 		btrfs_abort_transaction(trans, ret);
-		goto out;
+		return ret;
 	}
 
 	/*
author maintainer
#60 lore raw

PATCH 51/800 btrfs: clear defrag status of a root if starting transaction fails

In reply to Greg Kroah-Hartman

From: David Sterba <[email protected]>

commit 6819703f5a365c95488b07066a8744841bf14231 upstream.

The defrag loop processes leaves in batches and starting transaction for each. The whole defragmentation on a given root is protected by a bit but in case the transaction fails, the bit is not cleared

In case the transaction fails the bit would prevent starting defragmentation again, so make sure it's cleared.

---
 fs/btrfs/transaction.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
fs/btrfs/transaction.c +4 -2
@@ -1406,8 +1406,10 @@ int btrfs_defrag_root(struct btrfs_root
 
 	while (1) {
 		trans = btrfs_start_transaction(root, 0);
-		if (IS_ERR(trans))
-			return PTR_ERR(trans);
+		if (IS_ERR(trans)) {
+			ret = PTR_ERR(trans);
+			break;
+		}
 
 		ret = btrfs_defrag_leaves(trans, root);
 
author maintainer
#61 lore raw

PATCH 52/800 ext4: cleanup in-core orphan list if ext4_truncate() failed to get a transaction handle

In reply to Greg Kroah-Hartman

From: Zhang Yi <[email protected]>

commit b9a037b7f3c401d3c63e0423e56aef606b1ffaaf upstream.

In ext4_orphan_cleanup(), if ext4_truncate() failed to get a transaction handle, it didn't remove the inode from the in-core orphan list, which may probably trigger below error dump in ext4_destroy_inode() during the final iput() and could lead to memory corruption on the later orphan list changes.

EXT4-fs (sda): Inode 6291467 (00000000b8247c67): orphan list check failed!

 00000000b8247c67: 0001f30a 00000004 00000000 00000023  ............#...
 00000000e24cde71: 00000006 014082a3 00000000 00000000  ......@.........
 0000000072c6a5ee: 00000000 00000000 00000000 00000000  ................

...

This patch fix this by cleanup in-core orphan list manually if ext4_truncate() return error.

---
 fs/ext4/super.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
fs/ext4/super.c +8 -1
@@ -3101,8 +3101,15 @@ static void ext4_orphan_cleanup(struct s
 			inode_lock(inode);
 			truncate_inode_pages(inode->i_mapping, inode->i_size);
 			ret = ext4_truncate(inode);
-			if (ret)
+			if (ret) {
+				/*
+				 * We need to clean up the in-core orphan list
+				 * manually if ext4_truncate() failed to get a
+				 * transaction handle.
+				 */
+				ext4_orphan_del(NULL, inode);
 				ext4_std_error(inode->i_sb, ret);
+			}
 			inode_unlock(inode);
 			nr_truncates++;
 		} else {
author maintainer
#62 lore raw

PATCH 53/800 ext4: fix kernel infoleak via ext4_extent_header

In reply to Greg Kroah-Hartman

From: Anirudh Rayabharam <[email protected]>

commit ce3aba43599f0b50adbebff133df8d08a3d5fffe upstream.

Initialize eh_generation of struct ext4_extent_header to prevent leaking info to userspace. Fixes KMSAN kernel-infoleak bug reported by syzbot at:
http://syzkaller.appspot.com/bug?id=78e9ad0e6952a3ca16e8234724b2fa92d041b9b8

---
 fs/ext4/extents.c |    3 +++
 1 file changed, 3 insertions(+)
fs/ext4/extents.c +3 -0
@@ -825,6 +825,7 @@ void ext4_ext_tree_init(handle_t *handle
 	eh->eh_entries = 0;
 	eh->eh_magic = EXT4_EXT_MAGIC;
 	eh->eh_max = cpu_to_le16(ext4_ext_space_root(inode, 0));
+	eh->eh_generation = 0;
 	ext4_mark_inode_dirty(handle, inode);
 }
 
@@ -1090,6 +1091,7 @@ static int ext4_ext_split(handle_t *hand
 	neh->eh_max = cpu_to_le16(ext4_ext_space_block(inode, 0));
 	neh->eh_magic = EXT4_EXT_MAGIC;
 	neh->eh_depth = 0;
+	neh->eh_generation = 0;
 
 	/* move remainder of path[depth] to the new leaf */
 	if (unlikely(path[depth].p_hdr->eh_entries !=
@@ -1167,6 +1169,7 @@ static int ext4_ext_split(handle_t *hand
 		neh->eh_magic = EXT4_EXT_MAGIC;
 		neh->eh_max = cpu_to_le16(ext4_ext_space_block_idx(inode, 0));
 		neh->eh_depth = cpu_to_le16(depth - i);
+		neh->eh_generation = 0;
 		fidx = EXT_FIRST_INDEX(neh);
 		fidx->ei_block = border;
 		ext4_idx_store_pblock(fidx, oldblock);
author maintainer
#63 lore raw

PATCH 54/800 ext4: fix overflow in ext4_iomap_alloc()

In reply to Greg Kroah-Hartman

From: Jan Kara <[email protected]>

commit d0b040f5f2557b2f507c01e88ad8cff424fdc6a9 upstream.

A code in iomap alloc may overflow block number when converting it to byte offset. Luckily this is mostly harmless as we will just use more expensive method of writing using unwritten extents even though we are writing beyond i_size.

Fixes 378f32bab371 ("ext4: introduce direct I/O write using iomap infrastructure")
---
 fs/ext4/inode.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/inode.c +1 -1
@@ -3418,7 +3418,7 @@ retry:
 	 * i_disksize out to i_size. This could be beyond where direct I/O is
 	 * happening and thus expose allocated blocks to direct I/O reads.
 	 */
-	else if ((map->m_lblk * (1 << blkbits)) >= i_size_read(inode))
+	else if (((loff_t)map->m_lblk << blkbits) >= i_size_read(inode))
 		m_flags = EXT4_GET_BLOCKS_CREATE;
 	else if (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))
 		m_flags = EXT4_GET_BLOCKS_IO_CREATE_EXT;
author maintainer
#64 lore raw

PATCH 55/800 ext4: return error code when ext4_fill_flex_info() fails

In reply to Greg Kroah-Hartman

From: Yang Yingliang <[email protected]>

commit 8f6840c4fd1e7bd715e403074fb161c1a04cda73 upstream.

After commit c89128a00838 ("ext4: handle errors on ext4_commit_super"), 'ret' may be set to 0 before calling ext4_fill_flex_info(), if ext4_fill_flex_info() fails ext4_mount() doesn't return error code, it makes 'root' is null which causes crash in legacy_get_tree().

---
 fs/ext4/super.c |    1 +
 1 file changed, 1 insertion(+)
fs/ext4/super.c +1 -0
@@ -5065,6 +5065,7 @@ no_journal:
 			ext4_msg(sb, KERN_ERR,
 			       "unable to initialize "
 			       "flex_bg meta info!");
+			ret = -ENOMEM;
 			goto failed_mount6;
 		}
 
author maintainer
#65 lore raw

PATCH 56/800 ext4: correct the cache_nr in tracepoint ext4_es_shrink_exit

In reply to Greg Kroah-Hartman

From: Zhang Yi <[email protected]>

commit 4fb7c70a889ead2e91e184895ac6e5354b759135 upstream.

The cache_cnt parameter of tracepoint ext4_es_shrink_exit means the remaining cache count after shrink, but now it is the cache count before shrink, fix it by read sbi->s_extent_cache_cnt again.

Fixes 1ab6c4997e04 ("fs: convert fs shrinkers to new scan/count API")
---
 fs/ext4/extents_status.c |    1 +
 1 file changed, 1 insertion(+)
fs/ext4/extents_status.c +1 -0
@@ -1579,6 +1579,7 @@ static unsigned long ext4_es_scan(struct
 
 	nr_shrunk = __es_shrink(sbi, nr_to_scan, NULL);
 
+	ret = percpu_counter_read_positive(&sbi->s_es_stats.es_stats_shk_cnt);
 	trace_ext4_es_shrink_scan_exit(sbi->s_sb, nr_shrunk, ret);
 	return nr_shrunk;
 }
author maintainer
#66 lore raw

PATCH 57/800 ext4: remove check for zero nr_to_scan in ext4_es_scan()

In reply to Greg Kroah-Hartman

From: Zhang Yi <[email protected]>

commit e5e7010e5444d923e4091cafff61d05f2d19cada upstream.

After converting fs shrinkers to new scan/count API, we are no longer pass zero nr_to_scan parameter to detect the number of objects to free, just remove this check.

Fixes 1ab6c4997e04 ("fs: convert fs shrinkers to new scan/count API")
---
 fs/ext4/extents_status.c |    3 ---
 1 file changed, 3 deletions(-)
fs/ext4/extents_status.c +0 -3
@@ -1574,9 +1574,6 @@ static unsigned long ext4_es_scan(struct
 	ret = percpu_counter_read_positive(&sbi->s_es_stats.es_stats_shk_cnt);
 	trace_ext4_es_shrink_scan_enter(sbi->s_sb, nr_to_scan, ret);
 
-	if (!nr_to_scan)
-		return ret;
-
 	nr_shrunk = __es_shrink(sbi, nr_to_scan, NULL);
 
 	ret = percpu_counter_read_positive(&sbi->s_es_stats.es_stats_shk_cnt);
author maintainer
#67 lore raw

PATCH 58/800 ext4: fix avefreec in find_group_orlov

In reply to Greg Kroah-Hartman

From: Pan Dong <[email protected]>

commit c89849cc0259f3d33624cc3bd127685c3c0fa25d upstream.

The avefreec should be average free clusters instead of average free blocks, otherwize Orlov's allocator will not work properly when bigalloc enabled.

---
 fs/ext4/ialloc.c |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
fs/ext4/ialloc.c +5 -6
@@ -402,7 +402,7 @@ static void get_orlov_stats(struct super
  *
  * We always try to spread first-level directories.
  *
- * If there are blockgroups with both free inodes and free blocks counts
+ * If there are blockgroups with both free inodes and free clusters counts
  * not worse than average we return one with smallest directory count.
  * Otherwise we simply return a random group.
  *
@@ -411,7 +411,7 @@ static void get_orlov_stats(struct super
  * It's OK to put directory into a group unless
  * it has too many directories already (max_dirs) or
  * it has too few free inodes left (min_inodes) or
- * it has too few free blocks left (min_blocks) or
+ * it has too few free clusters left (min_clusters) or
  * Parent's group is preferred, if it doesn't satisfy these
  * conditions we search cyclically through the rest. If none
  * of the groups look good we just look for a group with more
@@ -427,7 +427,7 @@ static int find_group_orlov(struct super
 	ext4_group_t real_ngroups = ext4_get_groups_count(sb);
 	int inodes_per_group = EXT4_INODES_PER_GROUP(sb);
 	unsigned int freei, avefreei, grp_free;
-	ext4_fsblk_t freeb, avefreec;
+	ext4_fsblk_t freec, avefreec;
 	unsigned int ndirs;
 	int max_dirs, min_inodes;
 	ext4_grpblk_t min_clusters;
@@ -446,9 +446,8 @@ static int find_group_orlov(struct super
 
 	freei = percpu_counter_read_positive(&sbi->s_freeinodes_counter);
 	avefreei = freei / ngroups;
-	freeb = EXT4_C2B(sbi,
-		percpu_counter_read_positive(&sbi->s_freeclusters_counter));
-	avefreec = freeb;
+	freec = percpu_counter_read_positive(&sbi->s_freeclusters_counter);
+	avefreec = freec;
 	do_div(avefreec, ngroups);
 	ndirs = percpu_counter_read_positive(&sbi->s_dirs_counter);
 
author maintainer
#68 lore raw

PATCH 59/800 ext4: use ext4_grp_locked_error in mb_find_extent

In reply to Greg Kroah-Hartman

From: Stephen Brennan <[email protected]>

commit cd84bbbac12a173a381a64c6ec8b76a5277b87b5 upstream.

Commit 5d1b1b3f492f ("ext4: fix BUG when calling ext4_error with locked block group") introduces ext4_grp_locked_error to handle unlocking a group in error cases. Otherwise, there is a possibility of a sleep while atomic. However, since 43c73221b3b1 ("ext4: replace BUG_ON with WARN_ON in mb_find_extent()"), mb_find_extent() has contained a ext4_error() call while a group spinlock is held. Replace this with ext4_grp_locked_error.

---
 fs/ext4/mballoc.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
fs/ext4/mballoc.c +5 -4
@@ -1909,10 +1909,11 @@ static int mb_find_extent(struct ext4_bu
 	if (ex->fe_start + ex->fe_len > EXT4_CLUSTERS_PER_GROUP(e4b->bd_sb)) {
 		/* Should never happen! (but apparently sometimes does?!?) */
 		WARN_ON(1);
-		ext4_error(e4b->bd_sb, "corruption or bug in mb_find_extent "
-			   "block=%d, order=%d needed=%d ex=%u/%d/%d@%u",
-			   block, order, needed, ex->fe_group, ex->fe_start,
-			   ex->fe_len, ex->fe_logical);
+		ext4_grp_locked_error(e4b->bd_sb, e4b->bd_group, 0, 0,
+			"corruption or bug in mb_find_extent "
+			"block=%d, order=%d needed=%d ex=%u/%d/%d@%u",
+			block, order, needed, ex->fe_group, ex->fe_start,
+			ex->fe_len, ex->fe_logical);
 		ex->fe_len = 0;
 		ex->fe_start = 0;
 		ex->fe_group = 0;
author maintainer
#69 lore raw

PATCH 60/800 can: bcm: delay release of struct bcm_op after synchronize_rcu()

In reply to Greg Kroah-Hartman

From: Thadeu Lima de Souza Cascardo <[email protected]>

commit d5f9023fa61ee8b94f37a93f08e94b136cf1e463 upstream.

can_rx_register() callbacks may be called concurrently to the call to can_rx_unregister(). The callbacks and callback data, though, are protected by RCU and the struct sock reference count.

So the callback data is really attached to the life of sk, meaning that it should be released on sk_destruct. However, bcm_remove_op() calls tasklet_kill(), and RCU callbacks may be called under RCU softirq, so that cannot be used on kernels before the introduction of HRTIMER_MODE_SOFT.

However, bcm_rx_handler() is called under RCU protection, so after calling can_rx_unregister(), we may call synchronize_rcu() in order to wait for any RCU read-side critical sections to finish. That is, bcm_rx_handler() won't be called anymore for those ops. So, we only free them, after we do that synchronize_rcu().

---
 net/can/bcm.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
net/can/bcm.c +6 -1
@@ -785,6 +785,7 @@ static int bcm_delete_rx_op(struct list_
 						  bcm_rx_handler, op);
 
 			list_del(&op->list);
+			synchronize_rcu();
 			bcm_remove_op(op);
 			return 1; /* done */
 		}
@@ -1533,9 +1534,13 @@ static int bcm_release(struct socket *so
 					  REGMASK(op->can_id),
 					  bcm_rx_handler, op);
 
-		bcm_remove_op(op);
 	}
 
+	synchronize_rcu();
+
+	list_for_each_entry_safe(op, next, &bo->rx_ops, list)
+		bcm_remove_op(op);
+
 #if IS_ENABLED(CONFIG_PROC_FS)
 	/* remove procfs entry */
 	if (net->can.bcmproc_dir && bo->bcm_proc_read)
author maintainer
#70 lore raw

PATCH 61/800 can: gw: synchronize rcu operations before removing gw job entry

In reply to Greg Kroah-Hartman

From: Oliver Hartkopp <[email protected]>

commit fb8696ab14adadb2e3f6c17c18ed26b3ecd96691 upstream.

can_can_gw_rcv() is called under RCU protection, so after calling can_rx_unregister(), we have to call synchronize_rcu in order to wait for any RCU read-side critical sections to finish before removing the kmem_cache entry with the referenced gw job entry.

Fixes c1aabdf379bc ("can-gw: add netlink based CAN routing")
Cc linux-stable <[email protected]>
---
 net/can/gw.c |    3 +++
 1 file changed, 3 insertions(+)
net/can/gw.c +3 -0
@@ -596,6 +596,7 @@ static int cgw_notifier(struct notifier_
 			if (gwj->src.dev == dev || gwj->dst.dev == dev) {
 				hlist_del(&gwj->list);
 				cgw_unregister_filter(net, gwj);
+				synchronize_rcu();
 				kmem_cache_free(cgw_cache, gwj);
 			}
 		}
@@ -1154,6 +1155,7 @@ static void cgw_remove_all_jobs(struct n
 	hlist_for_each_entry_safe(gwj, nx, &net->can.cgw_list, list) {
 		hlist_del(&gwj->list);
 		cgw_unregister_filter(net, gwj);
+		synchronize_rcu();
 		kmem_cache_free(cgw_cache, gwj);
 	}
 }
@@ -1222,6 +1224,7 @@ static int cgw_remove_job(struct sk_buff
 
 		hlist_del(&gwj->list);
 		cgw_unregister_filter(net, gwj);
+		synchronize_rcu();
 		kmem_cache_free(cgw_cache, gwj);
 		err = 0;
 		break;
author maintainer
#71 lore raw

PATCH 62/800 can: isotp: isotp_release(): omit unintended hrtimer restart on socket release

In reply to Greg Kroah-Hartman

From: Oliver Hartkopp <[email protected]>

commit 14a4696bc3118ba49da28f79280e1d55603aa737 upstream.

When closing the isotp socket, the potentially running hrtimers are canceled before removing the subscription for CAN identifiers via can_rx_unregister().

This may lead to an unintended (re)start of a hrtimer in isotp_rcv_cf() and isotp_rcv_fc() in the case that a CAN frame is received by isotp_rcv() while the subscription removal is processed.

However, isotp_rcv() is called under RCU protection, so after calling can_rx_unregister, we may call synchronize_rcu in order to wait for any RCU read-side critical sections to finish. This prevents the reception of CAN frames after hrtimer_cancel() and therefore the unintended (re)start of the hrtimers.

Fixes e057dd3fc20f ("can: add ISO 15765-2:2016 transport protocol")
Cc linux-stable <[email protected]>
---
 net/can/isotp.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
net/can/isotp.c +4 -3
@@ -1028,9 +1028,6 @@ static int isotp_release(struct socket *
 
 	lock_sock(sk);
 
-	hrtimer_cancel(&so->txtimer);
-	hrtimer_cancel(&so->rxtimer);
-
 	/* remove current filters & unregister */
 	if (so->bound && (!(so->opt.flags & CAN_ISOTP_SF_BROADCAST))) {
 		if (so->ifindex) {
@@ -1042,10 +1039,14 @@ static int isotp_release(struct socket *
 						  SINGLE_MASK(so->rxid),
 						  isotp_rcv, sk);
 				dev_put(dev);
+				synchronize_rcu();
 			}
 		}
 	}
 
+	hrtimer_cancel(&so->txtimer);
+	hrtimer_cancel(&so->rxtimer);
+
 	so->ifindex = 0;
 	so->bound = 0;
 
author maintainer
#72 lore raw

PATCH 63/800 can: j1939: j1939_sk_init(): set SOCK_RCU_FREE to call sk_destruct() after RCU is done

In reply to Greg Kroah-Hartman

From: Oleksij Rempel <[email protected]>

commit 22c696fed25c63c7f67508309820358b94a96b6d upstream.

Set SOCK_RCU_FREE to let RCU to call sk_destruct() on completion. Without this patch, we will run in to j1939_can_recv() after priv was freed by j1939_sk_release()->j1939_sk_sock_destruct()

Fixes 25fe97cb7620 ("can: j1939: move j1939_priv_put() into sk_destruct callback")
Cc linux-stable <[email protected]>
Reported-by [email protected]
---
 net/can/j1939/main.c   |    4 ++++
 net/can/j1939/socket.c |    3 +++
 2 files changed, 7 insertions(+)
net/can/j1939/main.c +4 -0
@@ -193,6 +193,10 @@ static void j1939_can_rx_unregister(stru
 	can_rx_unregister(dev_net(ndev), ndev, J1939_CAN_ID, J1939_CAN_MASK,
 			  j1939_can_recv, priv);
 
+	/* The last reference of priv is dropped by the RCU deferred
+	 * j1939_sk_sock_destruct() of the last socket, so we can
+	 * safely drop this reference here.
+	 */
 	j1939_priv_put(priv);
 }
 
net/can/j1939/socket.c +3 -0
@@ -398,6 +398,9 @@ static int j1939_sk_init(struct sock *sk
 	atomic_set(&jsk->skb_pending, 0);
 	spin_lock_init(&jsk->sk_session_queue_lock);
 	INIT_LIST_HEAD(&jsk->sk_session_queue);
+
+	/* j1939_sk_sock_destruct() depends on SOCK_RCU_FREE flag */
+	sock_set_flag(sk, SOCK_RCU_FREE);
 	sk->sk_destruct = j1939_sk_sock_destruct;
 	sk->sk_protocol = CAN_J1939;
 
author maintainer
#73 lore raw

PATCH 64/800 can: peak_pciefd: pucan_handle_status(): fix a potential starvation issue in TX path

In reply to Greg Kroah-Hartman

From: Stephane Grosjean <[email protected]>

commit b17233d385d0b6b43ecf81d43008cb1bbb008166 upstream.

Rather than just indicating that transmission can start, this patch requires the explicit flushing of the network TX queue when the driver is informed by the device that it can transmit, next to its configuration.

In this way, if frames have already been written by the application, they will actually be transmitted.

Fixes ffd137f7043c ("can: peak/pcie_fd: remove useless code when interface starts")
Cc linux-stable <[email protected]>
---
 drivers/net/can/peak_canfd/peak_canfd.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/can/peak_canfd/peak_canfd.c +2 -2
@@ -351,8 +351,8 @@ static int pucan_handle_status(struct pe
 				return err;
 		}
 
-		/* start network queue (echo_skb array is empty) */
-		netif_start_queue(ndev);
+		/* wake network queue up (echo_skb array is empty) */
+		netif_wake_queue(ndev);
 
 		return 0;
 	}
author maintainer
#74 lore raw

PATCH 65/800 mac80211: remove iwlwifi specific workaround that broke sta NDP tx

In reply to Greg Kroah-Hartman

From: Felix Fietkau <[email protected]>

commit e41eb3e408de27982a5f8f50b2dd8002bed96908 upstream.

Sending nulldata packets is important for sw AP link probing and detecting 4-address mode links. The checks that dropped these packets were apparently added to work around an iwlwifi firmware bug with multi-TID aggregation.

---
 drivers/net/wireless/intel/iwlwifi/mvm/tx.c |    3 +++
 net/mac80211/mlme.c                         |    9 ---------
 2 files changed, 3 insertions(+), 9 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/tx.c +3 -0
@@ -1032,6 +1032,9 @@ static int iwl_mvm_tx_mpdu(struct iwl_mv
 	if (WARN_ON_ONCE(mvmsta->sta_id == IWL_MVM_INVALID_STA))
 		return -1;
 
+	if (unlikely(ieee80211_is_any_nullfunc(fc)) && sta->he_cap.has_he)
+		return -1;
+
 	if (unlikely(ieee80211_is_probe_resp(fc)))
 		iwl_mvm_probe_resp_set_noa(mvm, skb);
 
net/mac80211/mlme.c +0 -9
@@ -1094,11 +1094,6 @@ void ieee80211_send_nullfunc(struct ieee
 	struct ieee80211_hdr_3addr *nullfunc;
 	struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
 
-	/* Don't send NDPs when STA is connected HE */
-	if (sdata->vif.type == NL80211_IFTYPE_STATION &&
-	    !(ifmgd->flags & IEEE80211_STA_DISABLE_HE))
-		return;
-
 	skb = ieee80211_nullfunc_get(&local->hw, &sdata->vif,
 		!ieee80211_hw_check(&local->hw, DOESNT_SUPPORT_QOS_NDP));
 	if (!skb)
@@ -1130,10 +1125,6 @@ static void ieee80211_send_4addr_nullfun
 	if (WARN_ON(sdata->vif.type != NL80211_IFTYPE_STATION))
 		return;
 
-	/* Don't send NDPs when connected HE */
-	if (!(sdata->u.mgd.flags & IEEE80211_STA_DISABLE_HE))
-		return;
-
 	skb = dev_alloc_skb(local->hw.extra_tx_headroom + 30);
 	if (!skb)
 		return;
author maintainer
#75 lore raw

PATCH 66/800 mac80211: fix NULL ptr dereference during mesh peer connection for non HE devices

In reply to Greg Kroah-Hartman

From: Abinaya Kalaiselvan <[email protected]>

commit 95f83ee8d857f006813755e89a126f1048b001e8 upstream.

"sband->iftype_data" is not assigned with any value for non HE supported devices, which causes NULL pointer access during mesh peer connection in those devices. Fix this by accessing the pointer after HE capabilities condition check.

Fixes 7f7aa94bcaf0 (mac80211: reduce peer HE MCS/NSS to own capabilities)
---
 net/mac80211/he.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
net/mac80211/he.c +3 -1
@@ -111,7 +111,7 @@ ieee80211_he_cap_ie_to_sta_he_cap(struct
 				  struct sta_info *sta)
 {
 	struct ieee80211_sta_he_cap *he_cap = &sta->sta.he_cap;
-	struct ieee80211_sta_he_cap own_he_cap = sband->iftype_data->he_cap;
+	struct ieee80211_sta_he_cap own_he_cap;
 	struct ieee80211_he_cap_elem *he_cap_ie_elem = (void *)he_cap_ie;
 	u8 he_ppe_size;
 	u8 mcs_nss_size;
@@ -123,6 +123,8 @@ ieee80211_he_cap_ie_to_sta_he_cap(struct
 	if (!he_cap_ie || !ieee80211_get_he_sta_cap(sband))
 		return;
 
+	own_he_cap = sband->iftype_data->he_cap;
+
 	/* Make sure size is OK */
 	mcs_nss_size = ieee80211_he_mcs_nss_size(he_cap_ie_elem);
 	he_ppe_size =
author maintainer
#76 lore raw

PATCH 67/800 SUNRPC: Fix the batch tasks count wraparound.

In reply to Greg Kroah-Hartman

From: Zhang Xiaoxu <[email protected]>

commit fcb170a9d825d7db4a3fb870b0300f5a40a8d096 upstream.

The 'queue->nr' will wraparound from 0 to 255 when only current priority queue has tasks. This maybe lead a deadlock same as commit dfe1fe75e00e ("NFSv4: Fix deadlock between nfs4_evict_inode() and nfs4_opendata_get_inode()"):

Privileged delegreturn task is queued to privileged list because all the slots are assigned. When non-privileged task complete and release the slot, a non-privileged maybe picked out. It maybe allocate slot failed when the session on draining.

If the 'queue->nr' has wraparound to 255, and no enough slot to service it, then the privileged delegreturn will lost to wake up.

So we should avoid the wraparound on 'queue->nr'.

Fixes 5fcdfacc01f3 ("NFSv4: Return delegations synchronously in evict_inode")
Fixes 1da177e4c3f4 ("Linux-2.6.12-rc2")
---
 net/sunrpc/sched.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/sunrpc/sched.c +2 -1
@@ -595,7 +595,8 @@ static struct rpc_task *__rpc_find_next_
 	 * Service a batch of tasks from a single owner.
 	 */
 	q = &queue->tasks[queue->priority];
-	if (!list_empty(q) && --queue->nr) {
+	if (!list_empty(q) && queue->nr) {
+		queue->nr--;
 		task = list_first_entry(q, struct rpc_task, u.tk_wait.list);
 		goto out;
 	}
author maintainer
#77 lore raw

PATCH 68/800 SUNRPC: Should wake up the privileged task firstly.

In reply to Greg Kroah-Hartman

From: Zhang Xiaoxu <[email protected]>

commit 5483b904bf336948826594610af4c9bbb0d9e3aa upstream.

When find a task from wait queue to wake up, a non-privileged task may be found out, rather than the privileged. This maybe lead a deadlock same as commit dfe1fe75e00e ("NFSv4: Fix deadlock between nfs4_evict_inode() and nfs4_opendata_get_inode()"):

Privileged delegreturn task is queued to privileged list because all the slots are assigned. If there has no enough slot to wake up the non-privileged batch tasks(session less than 8 slot), then the privileged delegreturn task maybe lost waked up because the found out task can't get slot since the session is on draining.

So we should treate the privileged task as the emergency task, and execute it as for as we can.

Fixes 5fcdfacc01f3 ("NFSv4: Return delegations synchronously in evict_inode")
---
 net/sunrpc/sched.c |    9 +++++++++
 1 file changed, 9 insertions(+)
net/sunrpc/sched.c +9 -0
@@ -592,6 +592,15 @@ static struct rpc_task *__rpc_find_next_
 	struct rpc_task *task;
 
 	/*
+	 * Service the privileged queue.
+	 */
+	q = &queue->tasks[RPC_NR_PRIORITY - 1];
+	if (queue->maxpriority > RPC_PRIORITY_PRIVILEGED && !list_empty(q)) {
+		task = list_first_entry(q, struct rpc_task, u.tk_wait.list);
+		goto out;
+	}
+
+	/*
 	 * Service a batch of tasks from a single owner.
 	 */
 	q = &queue->tasks[queue->priority];
author maintainer
#78 lore raw

PATCH 69/800 bus: mhi: core: Fix power down latency

In reply to Greg Kroah-Hartman

From: Loic Poulain <[email protected]>

commit 44b1eba44dc537edf076f131f1eeee7544d0e04f upstream.

On graceful power-down/disable transition, when an MHI reset is performed, the MHI device loses its context, including interrupt configuration. However, the current implementation is waiting for event(irq) driven state change to confirm reset has been completed, which never happens, and causes reset timeout, leading to unexpected high latency of the mhi_power_down procedure (up to 45 seconds).

Fix that by moving to the recently introduced poll_reg_field method, waiting for the reset bit to be cleared, in the same way as the power_on procedure.

---
 drivers/bus/mhi/core/pm.c |   18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)
drivers/bus/mhi/core/pm.c +5 -13
@@ -465,23 +465,15 @@ static void mhi_pm_disable_transition(st
 
 	/* Trigger MHI RESET so that the device will not access host memory */
 	if (!MHI_PM_IN_FATAL_STATE(mhi_cntrl->pm_state)) {
-		u32 in_reset = -1;
-		unsigned long timeout = msecs_to_jiffies(mhi_cntrl->timeout_ms);
-
 		dev_dbg(dev, "Triggering MHI Reset in device\n");
 		mhi_set_mhi_state(mhi_cntrl, MHI_STATE_RESET);
 
 		/* Wait for the reset bit to be cleared by the device */
-		ret = wait_event_timeout(mhi_cntrl->state_event,
-					 mhi_read_reg_field(mhi_cntrl,
-							    mhi_cntrl->regs,
-							    MHICTRL,
-							    MHICTRL_RESET_MASK,
-							    MHICTRL_RESET_SHIFT,
-							    &in_reset) ||
-					!in_reset, timeout);
-		if (!ret || in_reset)
-			dev_err(dev, "Device failed to exit MHI Reset state\n");
+		ret = mhi_poll_reg_field(mhi_cntrl, mhi_cntrl->regs, MHICTRL,
+				 MHICTRL_RESET_MASK, MHICTRL_RESET_SHIFT, 0,
+				 25000);
+		if (ret)
+			dev_err(dev, "Device failed to clear MHI Reset\n");
 
 		/*
 		 * Device will clear BHI_INTVEC as a part of RESET processing,
author maintainer
#79 lore raw

PATCH 70/800 bus: mhi: Wait for M2 state during system resume

In reply to Greg Kroah-Hartman

From: Baochen Qiang <[email protected]>

commit 02b49cd1174527e611768fc2ce0f75a74dfec7ae upstream.

During system resume, MHI host triggers M3->M0 transition and then waits for target device to enter M0 state. Once done, the device queues a state change event into ctrl event ring and notifies MHI host by raising an interrupt, where a tasklet is scheduled to process this event. In most cases, the tasklet is served timely and wait operation succeeds.

However, there are cases where CPU is busy and cannot serve this tasklet for some time. Once delay goes long enough, the device moves itself to M1 state and also interrupts MHI host after inserting a new state change event to ctrl ring. Later when CPU finally has time to process the ring, there will be two events:

1. For M3->M0 event, which is the first event to be processed queued first. The tasklet handler serves the event, updates device state to M0 and wakes up the task.

2. For M0->M1 event, which is processed later, the tasklet handler triggers M1->M2 transition and updates device state to M2 directly, then wakes up the MHI host (if it is still sleeping on this wait queue).

Note that although MHI host has been woken up while processing the first event, it may still has no chance to run before the second event is processed. In other words, MHI host has to keep waiting till timeout causing the M0 state to be missed.

kernel log here:
...

Apr 15 01:45:14 test-NUC8i7HVK kernel: [ 4247.911251] mhi 0000:06:00.0: Entered with PM state: M3, MHI state: M3
Apr 15 01:45:14 test-NUC8i7HVK kernel: [ 4247.917762] mhi 0000:06:00.0: State change event to state: M0
Apr 15 01:45:14 test-NUC8i7HVK kernel: [ 4247.917767] mhi 0000:06:00.0: State change event to state: M1
Apr 15 01:45:14 test-NUC8i7HVK kernel: [ 4338.788231] mhi 0000:06:00.0: Did not enter M0 state, MHI state: M2, PM state: M2

...

Fix this issue by simply adding M2 as a valid state for resume.

Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1

drivers/bus/mhi/core/pm.c +1 -0
index 704a5e225097..bbf6cd04861e 100644
@@ -926,6 +926,7 @@ int mhi_pm_resume(struct mhi_controller *mhi_cntrl)
 
 	ret = wait_event_timeout(mhi_cntrl->state_event,
 				 mhi_cntrl->dev_state == MHI_STATE_M0 ||
+				 mhi_cntrl->dev_state == MHI_STATE_M2 ||
 				 MHI_PM_IN_ERROR_STATE(mhi_cntrl->pm_state),
 				 msecs_to_jiffies(mhi_cntrl->timeout_ms));
 
author maintainer
#80 lore raw

PATCH 71/800 bus: mhi: pci-generic: Add missing pci_disable_pcie_error_reporting() calls

In reply to Greg Kroah-Hartman

From: Christophe JAILLET <[email protected]>

commit a25d144fb883c73506ba384de476bbaff8220a95 upstream.

If an error occurs after a 'pci_enable_pcie_error_reporting()' call, it must be undone by a corresponding 'pci_disable_pcie_error_reporting()' call

Add the missing call in the error handling path of the probe and in the remove function.

---
 drivers/bus/mhi/pci_generic.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/bus/mhi/pci_generic.c +4 -1
@@ -665,7 +665,7 @@ static int mhi_pci_probe(struct pci_dev
 
 	err = mhi_register_controller(mhi_cntrl, mhi_cntrl_config);
 	if (err)
-		return err;
+		goto err_disable_reporting;
 
 	/* MHI bus does not power up the controller by default */
 	err = mhi_prepare_for_power_up(mhi_cntrl);
@@ -699,6 +699,8 @@ err_unprepare:
 	mhi_unprepare_after_power_down(mhi_cntrl);
 err_unregister:
 	mhi_unregister_controller(mhi_cntrl);
+err_disable_reporting:
+	pci_disable_pcie_error_reporting(pdev);
 
 	return err;
 }
@@ -721,6 +723,7 @@ static void mhi_pci_remove(struct pci_de
 		pm_runtime_get_noresume(&pdev->dev);
 
 	mhi_unregister_controller(mhi_cntrl);
+	pci_disable_pcie_error_reporting(pdev);
 }
 
 static void mhi_pci_shutdown(struct pci_dev *pdev)
author maintainer
#81 lore raw

PATCH 72/800 mm/gup: fix try_grab_compound_head() race with split_huge_page()

In reply to Greg Kroah-Hartman

From: Jann Horn <[email protected]>

commit c24d37322548a6ec3caec67100d28b9c1f89f60a upstream.

try_grab_compound_head() is used to grab a reference to a page from get_user_pages_fast(), which is only protected against concurrent freeing of page tables (via local_irq_save()), but not against concurrent TLB flushes, freeing of data pages, or splitting of compound pages.

Because no reference is held to the page when try_grab_compound_head() is called, the page may have been freed and reallocated by the time its refcount has been elevated; therefore, once we're holding a stable reference to the page, the caller re-checks whether the PTE still points to the same page (with the same access rights).

The problem is that try_grab_compound_head() has to grab a reference on the head page; but between the time we look up what the head page is and the time we actually grab a reference on the head page, the compound page may have been split up (either explicitly through split_huge_page() or by freeing the compound page to the buddy allocator and then allocating its individual order-0 pages). If that happens, get_user_pages_fast() may end up returning the right page but lifting the refcount on a now-unrelated page, leading to use-after-free of pages.

To fix it: Re-check whether the pages still belong together after lifting the refcount on the head page. Move anything else that checks compound_head(page) below the refcount increment.

This can't actually happen on bare-metal x86 (because there, disabling IRQs locks out remote TLB flushes), but it can happen on virtualized x86 (e.g. under KVM) and probably also on arm64. The race window is pretty narrow, and constantly allocating and shattering hugepages isn't exactly fast; for now I've only managed to reproduce this in an x86 KVM guest with an artificially widened timing window (by adding a loop that repeatedly calls inl(0x3f8 + 5) in try_get_compound_head() to force VM exits, so that PV TLB flushes are used instead of IPIs).

As requested on the list, also replace the existing VM_BUG_ON_PAGE() with a warning and bailout. Since the existing code only performed the BUG_ON check on DEBUG_VM kernels, ensure that the new code also only performs the check under that configuration - I don't want to mix two logically separate changes together too much. The macro VM_WARN_ON_ONCE_PAGE() doesn't return a value on !DEBUG_VM, so wrap the whole check in an #ifdef block. An alternative would be to change the VM_WARN_ON_ONCE_PAGE() definition for !DEBUG_VM such that it always returns false, but since that would differ from the behavior of the normal WARN macros, it might be too confusing for readers.

Fixes 7aef4172c795 ("mm: handle PTE-mapped tail pages in gerneric fast gup implementaiton")
Cc Matthew Wilcox <[email protected]>
Cc Kirill A. Shutemov <[email protected]>
Cc Jan Kara <[email protected]>
---
 mm/gup.c |   58 +++++++++++++++++++++++++++++++++++++++++++---------------
 1 file changed, 43 insertions(+), 15 deletions(-)
mm/gup.c +43 -15
@@ -44,6 +44,23 @@ static void hpage_pincount_sub(struct pa
 	atomic_sub(refs, compound_pincount_ptr(page));
 }
 
+/* Equivalent to calling put_page() @refs times. */
+static void put_page_refs(struct page *page, int refs)
+{
+#ifdef CONFIG_DEBUG_VM
+	if (VM_WARN_ON_ONCE_PAGE(page_ref_count(page) < refs, page))
+		return;
+#endif
+
+	/*
+	 * Calling put_page() for each ref is unnecessarily slow. Only the last
+	 * ref needs a put_page().
+	 */
+	if (refs > 1)
+		page_ref_sub(page, refs - 1);
+	put_page(page);
+}
+
 /*
  * Return the compound head page with ref appropriately incremented,
  * or NULL if that failed.
@@ -56,6 +73,21 @@ static inline struct page *try_get_compo
 		return NULL;
 	if (unlikely(!page_cache_add_speculative(head, refs)))
 		return NULL;
+
+	/*
+	 * At this point we have a stable reference to the head page; but it
+	 * could be that between the compound_head() lookup and the refcount
+	 * increment, the compound page was split, in which case we'd end up
+	 * holding a reference on a page that has nothing to do with the page
+	 * we were given anymore.
+	 * So now that the head page is stable, recheck that the pages still
+	 * belong together.
+	 */
+	if (unlikely(compound_head(page) != head)) {
+		put_page_refs(head, refs);
+		return NULL;
+	}
+
 	return head;
 }
 
@@ -96,6 +128,14 @@ __maybe_unused struct page *try_grab_com
 			return NULL;
 
 		/*
+		 * CAUTION: Don't use compound_head() on the page before this
+		 * point, the result won't be stable.
+		 */
+		page = try_get_compound_head(page, refs);
+		if (!page)
+			return NULL;
+
+		/*
 		 * When pinning a compound page of order > 1 (which is what
 		 * hpage_pincount_available() checks for), use an exact count to
 		 * track it, via hpage_pincount_add/_sub().
@@ -103,15 +143,10 @@ __maybe_unused struct page *try_grab_com
 		 * However, be sure to *also* increment the normal page refcount
 		 * field at least once, so that the page really is pinned.
 		 */
-		if (!hpage_pincount_available(page))
-			refs *= GUP_PIN_COUNTING_BIAS;
-
-		page = try_get_compound_head(page, refs);
-		if (!page)
-			return NULL;
-
 		if (hpage_pincount_available(page))
 			hpage_pincount_add(page, refs);
+		else
+			page_ref_add(page, refs * (GUP_PIN_COUNTING_BIAS - 1));
 
 		mod_node_page_state(page_pgdat(page), NR_FOLL_PIN_ACQUIRED,
 				    orig_refs);
@@ -135,14 +170,7 @@ static void put_compound_head(struct pag
 			refs *= GUP_PIN_COUNTING_BIAS;
 	}
 
-	VM_BUG_ON_PAGE(page_ref_count(page) < refs, page);
-	/*
-	 * Calling put_page() for each ref is unnecessarily slow. Only the last
-	 * ref needs a put_page().
-	 */
-	if (refs > 1)
-		page_ref_sub(page, refs - 1);
-	put_page(page);
+	put_page_refs(page, refs);
 }
 
 /**
author maintainer
#82 lore raw

PATCH 73/800 perf/smmuv3: Dont trample existing events with global filter

In reply to Greg Kroah-Hartman

From: Robin Murphy <[email protected]>

commit 4c1daba15c209b99d192f147fea3dade30f72ed2 upstream.

With global filtering, we only allow an event to be scheduled if its filter settings exactly match those of any existing events, therefore it is pointless to reapply the filter in that case. Much worse, though, is that in doing that we trample the event type of counter 0 if it's already active, and never touch the appropriate PMEVTYPERn so the new event is likely not counting the right thing either. Don't do that.

---
 drivers/perf/arm_smmuv3_pmu.c |   18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
drivers/perf/arm_smmuv3_pmu.c +10 -8
@@ -277,7 +277,7 @@ static int smmu_pmu_apply_event_filter(s
 				       struct perf_event *event, int idx)
 {
 	u32 span, sid;
-	unsigned int num_ctrs = smmu_pmu->num_counters;
+	unsigned int cur_idx, num_ctrs = smmu_pmu->num_counters;
 	bool filter_en = !!get_filter_enable(event);
 
 	span = filter_en ? get_filter_span(event) :
@@ -285,17 +285,19 @@ static int smmu_pmu_apply_event_filter(s
 	sid = filter_en ? get_filter_stream_id(event) :
 			   SMMU_PMCG_DEFAULT_FILTER_SID;
 
-	/* Support individual filter settings */
-	if (!smmu_pmu->global_filter) {
+	cur_idx = find_first_bit(smmu_pmu->used_counters, num_ctrs);
+	/*
+	 * Per-counter filtering, or scheduling the first globally-filtered
+	 * event into an empty PMU so idx == 0 and it works out equivalent.
+	 */
+	if (!smmu_pmu->global_filter || cur_idx == num_ctrs) {
 		smmu_pmu_set_event_filter(event, idx, span, sid);
 		return 0;
 	}
 
-	/* Requested settings same as current global settings*/
-	idx = find_first_bit(smmu_pmu->used_counters, num_ctrs);
-	if (idx == num_ctrs ||
-	    smmu_pmu_check_global_filter(smmu_pmu->events[idx], event)) {
-		smmu_pmu_set_event_filter(event, 0, span, sid);
+	/* Otherwise, must match whatever's currently scheduled */
+	if (smmu_pmu_check_global_filter(smmu_pmu->events[cur_idx], event)) {
+		smmu_pmu_set_evtyper(smmu_pmu, idx, get_event(event));
 		return 0;
 	}
 
author maintainer
#83 lore raw

PATCH 74/800 KVM: nVMX: Handle split-lock #AC exceptions that happen in L2

In reply to Greg Kroah-Hartman

From: Sean Christopherson <[email protected]>

commit b33bb78a1fada6445c265c585ee0dd0fc6279102 upstream.

Mark #ACs that won't be reinjected to the guest as wanted by L0 so that KVM handles split-lock #AC from L2 instead of forwarding the exception to L1. Split-lock #AC isn't yet virtualized, i.e. L1 will treat it like a regular #AC and do the wrong thing, e.g. reinject it into L2.

Fixes e6f8b6c12f03 ("KVM: VMX: Extend VMXs #AC interceptor to handle split lock #AC in guest")
Cc Xiaoyao Li <[email protected]>

Message-Id: <[email protected]>

---
 arch/x86/kvm/vmx/nested.c |    3 +++
 arch/x86/kvm/vmx/vmcs.h   |    5 +++++
 arch/x86/kvm/vmx/vmx.c    |    4 ++--
 arch/x86/kvm/vmx/vmx.h    |    1 +
 4 files changed, 11 insertions(+), 2 deletions(-)
arch/x86/kvm/vmx/nested.c +3 -0
@@ -5806,6 +5806,9 @@ static bool nested_vmx_l0_wants_exit(str
 		else if (is_breakpoint(intr_info) &&
 			 vcpu->guest_debug & KVM_GUESTDBG_USE_SW_BP)
 			return true;
+		else if (is_alignment_check(intr_info) &&
+			 !vmx_guest_inject_ac(vcpu))
+			return true;
 		return false;
 	case EXIT_REASON_EXTERNAL_INTERRUPT:
 		return true;
arch/x86/kvm/vmx/vmcs.h +5 -0
@@ -117,6 +117,11 @@ static inline bool is_gp_fault(u32 intr_
 	return is_exception_n(intr_info, GP_VECTOR);
 }
 
+static inline bool is_alignment_check(u32 intr_info)
+{
+	return is_exception_n(intr_info, AC_VECTOR);
+}
+
 static inline bool is_machine_check(u32 intr_info)
 {
 	return is_exception_n(intr_info, MC_VECTOR);
arch/x86/kvm/vmx/vmx.c +2 -2
@@ -4829,7 +4829,7 @@ static int handle_machine_check(struct k
  *  - Guest has #AC detection enabled in CR0
  *  - Guest EFLAGS has AC bit set
  */
-static inline bool guest_inject_ac(struct kvm_vcpu *vcpu)
+bool vmx_guest_inject_ac(struct kvm_vcpu *vcpu)
 {
 	if (!boot_cpu_has(X86_FEATURE_SPLIT_LOCK_DETECT))
 		return true;
@@ -4937,7 +4937,7 @@ static int handle_exception_nmi(struct k
 		kvm_run->debug.arch.exception = ex_no;
 		break;
 	case AC_VECTOR:
-		if (guest_inject_ac(vcpu)) {
+		if (vmx_guest_inject_ac(vcpu)) {
 			kvm_queue_exception_e(vcpu, AC_VECTOR, error_code);
 			return 1;
 		}
arch/x86/kvm/vmx/vmx.h +1 -0
@@ -387,6 +387,7 @@ void vmx_get_segment(struct kvm_vcpu *vc
 void vmx_set_segment(struct kvm_vcpu *vcpu, struct kvm_segment *var, int seg);
 u64 construct_eptp(struct kvm_vcpu *vcpu, hpa_t root_hpa, int root_level);
 
+bool vmx_guest_inject_ac(struct kvm_vcpu *vcpu);
 void vmx_update_exception_bitmap(struct kvm_vcpu *vcpu);
 void vmx_update_msr_bitmap(struct kvm_vcpu *vcpu);
 bool vmx_nmi_blocked(struct kvm_vcpu *vcpu);
author maintainer
#84 lore raw

PATCH 75/800 KVM: PPC: Book3S HV: Workaround high stack usage with clang

In reply to Greg Kroah-Hartman

From: Nathan Chancellor <[email protected]>

commit 51696f39cbee5bb684e7959c0c98b5f54548aa34 upstream.

LLVM does not emit optimal byteswap assembly, which results in high stack usage in kvmhv_enter_nested_guest() due to the inlining of byteswap_pt_regs(). With LLVM 12.0.0:

arch/powerpc/kvm/book3s_hv_nested.c:289:6: error: stack frame size of 2512 bytes in function 'kvmhv_enter_nested_guest' [-Werror,-Wframe-larger-than=] long kvmhv_enter_nested_guest(struct kvm_vcpu *vcpu)

     ^

1 error generated.

While this gets fixed in LLVM, mark byteswap_pt_regs() as noinline_for_stack so that it does not get inlined and break the build due to -Werror by default in arch/powerpc/. Not inlining saves approximately 800 bytes with LLVM 12.0.0:

arch/powerpc/kvm/book3s_hv_nested.c:290:6: warning: stack frame size of 1728 bytes in function 'kvmhv_enter_nested_guest' [-Wframe-larger-than=] long kvmhv_enter_nested_guest(struct kvm_vcpu *vcpu)

     ^

1 warning generated.

---
 arch/powerpc/kvm/book3s_hv_nested.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/kvm/book3s_hv_nested.c +2 -1
@@ -53,7 +53,8 @@ void kvmhv_save_hv_regs(struct kvm_vcpu
 	hr->dawrx1 = vcpu->arch.dawrx1;
 }
 
-static void byteswap_pt_regs(struct pt_regs *regs)
+/* Use noinline_for_stack due to https://bugs.llvm.org/show_bug.cgi?id=49610 */
+static noinline_for_stack void byteswap_pt_regs(struct pt_regs *regs)
 {
 	unsigned long *addr = (unsigned long *) regs;
 
author maintainer
#85 lore raw

PATCH 76/800 KVM: x86/mmu: Remove broken WARN that fires on 32-bit KVM w/ nested EPT

In reply to Greg Kroah-Hartman

From: Sean Christopherson <[email protected]>

commit f0d4379087d8a83f478b371ff7786e8df0cc2314 upstream.

Remove a misguided WARN that attempts to detect the scenario where using a special A/D tracking flag will set reserved bits on a non-MMIO spte. The WARN triggers false positives when using EPT with 32-bit KVM because of the !64-bit clause, which is just flat out wrong. The whole A/D tracking goo is specific to EPT, and one of the big selling points of EPT is that EPT is decoupled from the host's native paging mode.

Drop the WARN instead of trying to salvage the check. Keeping a check specific to A/D tracking bits would essentially regurgitate the same code that led to KVM needed the tracking bits in the first place.

A better approach would be to add a generic WARN on reserved bits being set, which would naturally cover the A/D tracking bits, work for all flavors of paging, and be self-documenting to some extent.

Fixes 8a406c89532c ("KVM: x86/mmu: Rename and document A/D scheme for TDP SPTEs")

Message-Id: <[email protected]>

---
 arch/x86/kvm/mmu/spte.c |    7 -------
 1 file changed, 7 deletions(-)
arch/x86/kvm/mmu/spte.c +0 -7
@@ -103,13 +103,6 @@ int make_spte(struct kvm_vcpu *vcpu, uns
 		spte |= SPTE_TDP_AD_WRPROT_ONLY_MASK;
 
 	/*
-	 * Bits 62:52 of PAE SPTEs are reserved.  WARN if said bits are set
-	 * if PAE paging may be employed (shadow paging or any 32-bit KVM).
-	 */
-	WARN_ON_ONCE((!tdp_enabled || !IS_ENABLED(CONFIG_X86_64)) &&
-		     (spte & SPTE_TDP_AD_MASK));
-
-	/*
 	 * For the EPT case, shadow_present_mask is 0 if hardware
 	 * supports exec-only page table entries.  In that case,
 	 * ACC_USER_MASK and shadow_user_mask are used to represent
author maintainer
#86 lore raw

PATCH 77/800 KVM: x86/mmu: Treat NX as used (not reserved) for all !TDP shadow MMUs

In reply to Greg Kroah-Hartman

From: Sean Christopherson <[email protected]>

commit 112022bdb5bc372e00e6e43cb88ee38ea67b97bd upstream.

Mark NX as being used for all non-nested shadow MMUs, as KVM will set the NX bit for huge SPTEs if the iTLB mutli-hit mitigation is enabled. Checking the mitigation itself is not sufficient as it can be toggled on at any time and KVM doesn't reset MMU contexts when that happens. KVM could reset the contexts, but that would require purging all SPTEs in all MMUs, for no real benefit. And, KVM already forces EFER.NX=1 when TDP is disabled (for WP=0, SMEP=1, NX=0), so technically NX is never reserved for shadow MMUs.

Fixes b8e8c8303ff2 ("kvm: mmu: ITLB_MULTIHIT mitigation")

Message-Id: <[email protected]>

---
 arch/x86/kvm/mmu/mmu.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
arch/x86/kvm/mmu/mmu.c +9 -1
@@ -4168,7 +4168,15 @@ static inline u64 reserved_hpa_bits(void
 void
 reset_shadow_zero_bits_mask(struct kvm_vcpu *vcpu, struct kvm_mmu *context)
 {
-	bool uses_nx = context->nx ||
+	/*
+	 * KVM uses NX when TDP is disabled to handle a variety of scenarios,
+	 * notably for huge SPTEs if iTLB multi-hit mitigation is enabled and
+	 * to generate correct permissions for CR0.WP=0/CR4.SMEP=1/EFER.NX=0.
+	 * The iTLB multi-hit workaround can be toggled at any time, so assume
+	 * NX can be used by any non-nested shadow MMU to avoid having to reset
+	 * MMU contexts.  Note, KVM forces EFER.NX=1 when TDP is disabled.
+	 */
+	bool uses_nx = context->nx || !tdp_enabled ||
 		context->mmu_role.base.smep_andnot_wp;
 	struct rsvd_bits_validate *shadow_zero_check;
 	int i;
author maintainer
#87 lore raw

PATCH 78/800 KVM: x86/mmu: Use MMUs role to detect CR4.SMEP value in nested NPT walk

In reply to Greg Kroah-Hartman

From: Sean Christopherson <[email protected]>

commit ef318b9edf66a082f23d00d79b70c17b4c055a26 upstream.

Use the MMU's role to get its effective SMEP value when injecting a fault into the guest. When walking L1's (nested) NPT while L2 is active, vCPU state will reflect L2, whereas NPT uses the host's (L1 in this case) CR0, CR4, EFER, etc... If L1 and L2 have different settings for SMEP and L1 does not have EFER.NX=1, this can result in an incorrect PFEC.FETCH when injecting #NPF.

Fixes e57d4a356ad3 ("KVM: Add instruction fetch checking when walking guest page table")

Message-Id: <[email protected]>

---
 arch/x86/kvm/mmu/paging_tmpl.h |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/x86/kvm/mmu/paging_tmpl.h +1 -2
@@ -471,8 +471,7 @@ retry_walk:
 
 error:
 	errcode |= write_fault | user_fault;
-	if (fetch_fault && (mmu->nx ||
-			    kvm_read_cr4_bits(vcpu, X86_CR4_SMEP)))
+	if (fetch_fault && (mmu->nx || mmu->mmu_role.ext.cr4_smep))
 		errcode |= PFERR_FETCH_MASK;
 
 	walker->fault.vector = PF_VECTOR;
author maintainer
#88 lore raw

PATCH 79/800 KVM: x86: Properly reset MMU context at vCPU RESET/INIT

In reply to Greg Kroah-Hartman

From: Sean Christopherson <[email protected]>

commit 0aa1837533e5f4be8cc21bbc06314c23ba2c5447 upstream.

Reset the MMU context at vCPU INIT (and RESET for good measure) if CR0.PG was set prior to INIT. Simply re-initializing the current MMU is not sufficient as the current root HPA may not be usable in the new context. E.g. if TDP is disabled and INIT arrives while the vCPU is in long mode, KVM will fail to switch to the 32-bit pae_root and bomb on the next VM-Enter due to running with a 64-bit CR3 in 32-bit mode.

This bug was papered over in both VMX and SVM, but still managed to rear its head in the MMU role on VMX. Because EFER.LMA=1 requires CR0.PG=1, kvm_calc_shadow_mmu_root_page_role() checks for EFER.LMA without first checking CR0.PG. VMX's RESET/INIT flow writes CR0 before EFER, and so an INIT with the vCPU in 64-bit mode will cause the hack-a-fix to generate the wrong MMU role.

In VMX, the INIT issue is specific to running without unrestricted guest since unrestricted guest is available if and only if EPT is enabled. Commit 8668a3c468ed ("KVM: VMX: Reset mmu context when entering real mode") resolved the issue by forcing a reset when entering emulated real mode.

In SVM, commit ebae871a509d ("kvm: svm: reset mmu on VCPU reset") forced a MMU reset on every INIT to workaround the flaw in common x86. Note, at the time the bug was fixed, the SVM problem was exacerbated by a complete lack of a CR4 update.

The vendor resets will be reverted in future patches, primarily to aid bisection in case there are non-INIT flows that rely on the existing VMX logic.

Because CR0.PG is unconditionally cleared on INIT, and because CR0.WP and all CR4/EFER paging bits are ignored if CR0.PG=0, simply checking that CR0.PG was '1' prior to INIT/RESET is sufficient to detect a required MMU context reset.

Message-Id: <[email protected]>

---
 arch/x86/kvm/x86.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/x86/kvm/x86.c +13 -0
@@ -10454,6 +10454,8 @@ void kvm_arch_vcpu_destroy(struct kvm_vc
 
 void kvm_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event)
 {
+	unsigned long old_cr0 = kvm_read_cr0(vcpu);
+
 	kvm_lapic_reset(vcpu, init_event);
 
 	vcpu->arch.hflags = 0;
@@ -10522,6 +10524,17 @@ void kvm_vcpu_reset(struct kvm_vcpu *vcp
 	vcpu->arch.ia32_xss = 0;
 
 	static_call(kvm_x86_vcpu_reset)(vcpu, init_event);
+
+	/*
+	 * Reset the MMU context if paging was enabled prior to INIT (which is
+	 * implied if CR0.PG=1 as CR0 will be '0' prior to RESET).  Unlike the
+	 * standard CR0/CR4/EFER modification paths, only CR0.PG needs to be
+	 * checked because it is unconditionally cleared on INIT and all other
+	 * paging related bits are ignored if paging is disabled, i.e. CR0.WP,
+	 * CR4, and EFER changes are all irrelevant if CR0.PG was '0'.
+	 */
+	if (old_cr0 & X86_CR0_PG)
+		kvm_mmu_reset_context(vcpu);
 }
 
 void kvm_vcpu_deliver_sipi_vector(struct kvm_vcpu *vcpu, u8 vector)
author maintainer
#89 lore raw

PATCH 80/800 KVM: x86: Force all MMUs to reinitialize if guest CPUID is modified

In reply to Greg Kroah-Hartman

From: Sean Christopherson <[email protected]>

commit 49c6f8756cdffeb9af1fbcb86bacacced26465d7 upstream.

Invalidate all MMUs' roles after a CPUID update to force reinitizliation of the MMU context/helpers. Despite the efforts of commit de3ccd26fafc ("KVM: MMU: record maximum physical address width in kvm_mmu_extended_role"), there are still a handful of CPUID-based properties that affect MMU behavior but are not incorporated into mmu_role. E.g. 1gb hugepage support, AMD vs. Intel handling of bit 8, and SEV's C-Bit location all factor into the guest's reserved PTE bits.

The obvious alternative would be to add all such properties to mmu_role, but doing so provides no benefit over simply forcing a reinitialization on every CPUID update, as setting guest CPUID is a rare operation.

Note, reinitializing all MMUs after a CPUID update does not fix all of KVM's woes. Specifically, kvm_mmu_page_role doesn't track the CPUID properties, which means that a vCPU can reuse shadow pages that should not exist for the new vCPU model, e.g. that map GPAs that are now illegal (due to MAXPHYADDR changes) or that set bits that are now reserved (PAGE_SIZE for 1gb pages), etc...

Tracking the relevant CPUID properties in kvm_mmu_page_role would address the majority of problems, but fully tracking that much state in the shadow page role comes with an unpalatable cost as it would require a non-trivial increase in KVM's memory footprint. The GBPAGES case is even worse, as neither Intel nor AMD provides a way to disable 1gb hugepage support in the hardware page walker, i.e. it's a virtualization hole that can't be closed when using TDP.

In other words, resetting the MMU after a CPUID update is largely a superficial fix. But, it will allow reverting the tracking of MAXPHYADDR in the mmu_role, and that case in particular needs to mostly work because KVM's shadow_root_level depends on guest MAXPHYADDR when 5-level paging is supported. For cases where KVM botches guest behavior, the damage is limited to that guest. But for the shadow_root_level, a misconfigured MMU can cause KVM to incorrectly access memory, e.g. due to walking off the end of its shadow page tables.

Fixes 7dcd57552008 ("x86/kvm/mmu: check if tdp/shadow MMU reconfiguration is needed")
Cc Yu Zhang <[email protected]>

Message-Id: <[email protected]>

---
 arch/x86/include/asm/kvm_host.h |    1 +
 arch/x86/kvm/cpuid.c            |    6 +++---
 arch/x86/kvm/mmu/mmu.c          |   12 ++++++++++++
 3 files changed, 16 insertions(+), 3 deletions(-)
arch/x86/include/asm/kvm_host.h +1 -0
@@ -1464,6 +1464,7 @@ int kvm_mmu_create(struct kvm_vcpu *vcpu
 void kvm_mmu_init_vm(struct kvm *kvm);
 void kvm_mmu_uninit_vm(struct kvm *kvm);
 
+void kvm_mmu_after_set_cpuid(struct kvm_vcpu *vcpu);
 void kvm_mmu_reset_context(struct kvm_vcpu *vcpu);
 void kvm_mmu_slot_remove_write_access(struct kvm *kvm,
 				      struct kvm_memory_slot *memslot,
arch/x86/kvm/cpuid.c +3 -3
@@ -202,10 +202,10 @@ static void kvm_vcpu_after_set_cpuid(str
 	static_call(kvm_x86_vcpu_after_set_cpuid)(vcpu);
 
 	/*
-	 * Except for the MMU, which needs to be reset after any vendor
-	 * specific adjustments to the reserved GPA bits.
+	 * Except for the MMU, which needs to do its thing any vendor specific
+	 * adjustments to the reserved GPA bits.
 	 */
-	kvm_mmu_reset_context(vcpu);
+	kvm_mmu_after_set_cpuid(vcpu);
 }
 
 static int is_efer_nx(void)
arch/x86/kvm/mmu/mmu.c +12 -0
@@ -4859,6 +4859,18 @@ kvm_mmu_calc_root_page_role(struct kvm_v
 	return role.base;
 }
 
+void kvm_mmu_after_set_cpuid(struct kvm_vcpu *vcpu)
+{
+	/*
+	 * Invalidate all MMU roles to force them to reinitialize as CPUID
+	 * information is factored into reserved bit calculations.
+	 */
+	vcpu->arch.root_mmu.mmu_role.ext.valid = 0;
+	vcpu->arch.guest_mmu.mmu_role.ext.valid = 0;
+	vcpu->arch.nested_mmu.mmu_role.ext.valid = 0;
+	kvm_mmu_reset_context(vcpu);
+}
+
 void kvm_mmu_reset_context(struct kvm_vcpu *vcpu)
 {
 	kvm_mmu_unload(vcpu);
author maintainer
#90 lore raw

PATCH 81/800 s390/cio: dont call css_wait_for_slow_path() inside a lock

In reply to Greg Kroah-Hartman

From: Vineeth Vijayan <[email protected]>

commit c749d8c018daf5fba6dfac7b6c5c78b27efd7d65 upstream.

Currently css_wait_for_slow_path() gets called inside the chp->lock. The path-verification-loop of slowpath inside this lock could lead to deadlock as reported by the lockdep validator.

The ccw_device_get_chp_desc() during the instance of a device-set-online would try to acquire the same 'chp->lock' to read the chp->desc. The instance of this function can get called from multiple scenario, like probing or setting-device online manually. This could, in some corner-cases lead to the deadlock.

lockdep validator reported this as,

        CPU0                    CPU1
        ----                    ----
   lock(&chp->lock);
                                lock(kn->active#43);
                                lock(&chp->lock);

lock((wq_completion)cio);

The chp->lock was introduced to serialize the access of struct channel_path. This lock is not needed for the css_wait_for_slow_path() function, so invoke the slow-path function outside this lock.

Fixes b730f3a93395 ("[S390] cio: add lock to struct channel_path")
---
 drivers/s390/cio/chp.c  |    3 +++
 drivers/s390/cio/chsc.c |    2 --
 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/s390/cio/chp.c +3 -0
@@ -255,6 +255,9 @@ static ssize_t chp_status_write(struct d
 	if (!num_args)
 		return count;
 
+	/* Wait until previous actions have settled. */
+	css_wait_for_slow_path();
+
 	if (!strncasecmp(cmd, "on", 2) || !strcmp(cmd, "1")) {
 		mutex_lock(&cp->lock);
 		error = s390_vary_chpid(cp->chpid, 1);
drivers/s390/cio/chsc.c +0 -2
@@ -801,8 +801,6 @@ int chsc_chp_vary(struct chp_id chpid, i
 {
 	struct channel_path *chp = chpid_to_chp(chpid);
 
-	/* Wait until previous actions have settled. */
-	css_wait_for_slow_path();
 	/*
 	 * Redo PathVerification on the devices the chpid connects to
 	 */
author maintainer
#91 lore raw

PATCH 82/800 s390: mm: Fix secure storage access exception handling

In reply to Greg Kroah-Hartman

From: Janosch Frank <[email protected]>

commit 85b18d7b5e7ffefb2f076186511d39c4990aa005 upstream.

Turns out that the bit 61 in the TEID is not always 1 and if that's the case the address space ID and the address are unpredictable. Without an address and its address space ID we can't export memory and hence we can only send a SIGSEGV to the process or panic the kernel depending on who caused the exception.

Unfortunately bit 61 is only reliable if we have the "misc" UV feature bit.

Fixes 084ea4d611a3d ("s390/mm: add (non)secure page access exceptions handlers")
---
 arch/s390/boot/uv.c        |    1 +
 arch/s390/include/asm/uv.h |    8 +++++++-
 arch/s390/kernel/uv.c      |   10 ++++++++++
 arch/s390/mm/fault.c       |   26 ++++++++++++++++++++++++++
 4 files changed, 44 insertions(+), 1 deletion(-)
arch/s390/boot/uv.c +1 -0
@@ -36,6 +36,7 @@ void uv_query_info(void)
 		uv_info.max_sec_stor_addr = ALIGN(uvcb.max_guest_stor_addr, PAGE_SIZE);
 		uv_info.max_num_sec_conf = uvcb.max_num_sec_conf;
 		uv_info.max_guest_cpu_id = uvcb.max_guest_cpu_id;
+		uv_info.uv_feature_indications = uvcb.uv_feature_indications;
 	}
 
 #ifdef CONFIG_PROTECTED_VIRTUALIZATION_GUEST
arch/s390/include/asm/uv.h +7 -1
@@ -73,6 +73,10 @@ enum uv_cmds_inst {
 	BIT_UVC_CMD_UNPIN_PAGE_SHARED = 22,
 };
 
+enum uv_feat_ind {
+	BIT_UV_FEAT_MISC = 0,
+};
+
 struct uv_cb_header {
 	u16 len;
 	u16 cmd;	/* Command Code */
@@ -97,7 +101,8 @@ struct uv_cb_qui {
 	u64 max_guest_stor_addr;
 	u8  reserved88[158 - 136];
 	u16 max_guest_cpu_id;
-	u8  reserveda0[200 - 160];
+	u64 uv_feature_indications;
+	u8  reserveda0[200 - 168];
 } __packed __aligned(8);
 
 /* Initialize Ultravisor */
@@ -274,6 +279,7 @@ struct uv_info {
 	unsigned long max_sec_stor_addr;
 	unsigned int max_num_sec_conf;
 	unsigned short max_guest_cpu_id;
+	unsigned long uv_feature_indications;
 };
 
 extern struct uv_info uv_info;
arch/s390/kernel/uv.c +10 -0
@@ -364,6 +364,15 @@ static ssize_t uv_query_facilities(struc
 static struct kobj_attribute uv_query_facilities_attr =
 	__ATTR(facilities, 0444, uv_query_facilities, NULL);
 
+static ssize_t uv_query_feature_indications(struct kobject *kobj,
+					    struct kobj_attribute *attr, char *buf)
+{
+	return sysfs_emit(buf, "%lx\n", uv_info.uv_feature_indications);
+}
+
+static struct kobj_attribute uv_query_feature_indications_attr =
+	__ATTR(feature_indications, 0444, uv_query_feature_indications, NULL);
+
 static ssize_t uv_query_max_guest_cpus(struct kobject *kobj,
 				       struct kobj_attribute *attr, char *page)
 {
@@ -396,6 +405,7 @@ static struct kobj_attribute uv_query_ma
 
 static struct attribute *uv_query_attrs[] = {
 	&uv_query_facilities_attr.attr,
+	&uv_query_feature_indications_attr.attr,
 	&uv_query_max_guest_cpus_attr.attr,
 	&uv_query_max_guest_vms_attr.attr,
 	&uv_query_max_guest_addr_attr.attr,
arch/s390/mm/fault.c +26 -0
@@ -792,6 +792,32 @@ void do_secure_storage_access(struct pt_
 	struct page *page;
 	int rc;
 
+	/*
+	 * bit 61 tells us if the address is valid, if it's not we
+	 * have a major problem and should stop the kernel or send a
+	 * SIGSEGV to the process. Unfortunately bit 61 is not
+	 * reliable without the misc UV feature so we need to check
+	 * for that as well.
+	 */
+	if (test_bit_inv(BIT_UV_FEAT_MISC, &uv_info.uv_feature_indications) &&
+	    !test_bit_inv(61, &regs->int_parm_long)) {
+		/*
+		 * When this happens, userspace did something that it
+		 * was not supposed to do, e.g. branching into secure
+		 * memory. Trigger a segmentation fault.
+		 */
+		if (user_mode(regs)) {
+			send_sig(SIGSEGV, current, 0);
+			return;
+		}
+
+		/*
+		 * The kernel should never run into this case and we
+		 * have no way out of this situation.
+		 */
+		panic("Unexpected PGM 0x3d with TEID bit 61=0");
+	}
+
 	switch (get_fault_type(regs)) {
 	case USER_FAULT:
 		mm = current->mm;
author maintainer
#92 lore raw

PATCH 83/800 f2fs: Advertise encrypted casefolding in sysfs

In reply to Greg Kroah-Hartman

From: Daniel Rosenberg <[email protected]>

commit 4c039d5452691fe80260e4c3dd7b629a095bd0a7 upstream.

Older kernels don't support encryption with casefolding. This adds the sysfs entry encrypted_casefold to show support for those combined features. Support for this feature was originally added by commit 7ad08a58bf67 ("f2fs: Handle casefolding with Encryption")

Fixes 7ad08a58bf67 ("f2fs: Handle casefolding with Encryption")
Cc [email protected] # v5.11+
---
 fs/f2fs/sysfs.c |    8 ++++++++
 1 file changed, 8 insertions(+)
fs/f2fs/sysfs.c +8 -0
@@ -562,6 +562,7 @@ enum feat_id {
 	FEAT_CASEFOLD,
 	FEAT_COMPRESSION,
 	FEAT_TEST_DUMMY_ENCRYPTION_V2,
+	FEAT_ENCRYPTED_CASEFOLD,
 };
 
 static ssize_t f2fs_feature_show(struct f2fs_attr *a,
@@ -583,6 +584,7 @@ static ssize_t f2fs_feature_show(struct
 	case FEAT_CASEFOLD:
 	case FEAT_COMPRESSION:
 	case FEAT_TEST_DUMMY_ENCRYPTION_V2:
+	case FEAT_ENCRYPTED_CASEFOLD:
 		return sprintf(buf, "supported\n");
 	}
 	return 0;
@@ -687,7 +689,10 @@ F2FS_GENERAL_RO_ATTR(avg_vblocks);
 #ifdef CONFIG_FS_ENCRYPTION
 F2FS_FEATURE_RO_ATTR(encryption, FEAT_CRYPTO);
 F2FS_FEATURE_RO_ATTR(test_dummy_encryption_v2, FEAT_TEST_DUMMY_ENCRYPTION_V2);
+#ifdef CONFIG_UNICODE
+F2FS_FEATURE_RO_ATTR(encrypted_casefold, FEAT_ENCRYPTED_CASEFOLD);
 #endif
+#endif /* CONFIG_FS_ENCRYPTION */
 #ifdef CONFIG_BLK_DEV_ZONED
 F2FS_FEATURE_RO_ATTR(block_zoned, FEAT_BLKZONED);
 #endif
@@ -786,7 +791,10 @@ static struct attribute *f2fs_feat_attrs
 #ifdef CONFIG_FS_ENCRYPTION
 	ATTR_LIST(encryption),
 	ATTR_LIST(test_dummy_encryption_v2),
+#ifdef CONFIG_UNICODE
+	ATTR_LIST(encrypted_casefold),
 #endif
+#endif /* CONFIG_FS_ENCRYPTION */
 #ifdef CONFIG_BLK_DEV_ZONED
 	ATTR_LIST(block_zoned),
 #endif
author maintainer
#93 lore raw

PATCH 84/800 f2fs: Prevent swap file in LFS mode

In reply to Greg Kroah-Hartman

From: Shin'ichiro Kawasaki <[email protected]>

commit d927ccfccb009ede24448d69c08b12e7c8a6979b upstream.

The kernel writes to swap files on f2fs directly without the assistance of the filesystem. This direct write by kernel can be non-sequential even when the f2fs is in LFS mode. Such non-sequential write conflicts with the LFS semantics. Especially when f2fs is set up on zoned block devices, the non-sequential write causes unaligned write command errors.

To avoid the non-sequential writes to swap files, prevent swap file activation when the filesystem is in LFS mode.

Fixes 4969c06a0d83 ("f2fs: support swap file w/ DIO")
Cc [email protected] # v5.10+
---
 fs/f2fs/data.c |    6 ++++++
 1 file changed, 6 insertions(+)
fs/f2fs/data.c +6 -0
@@ -4067,6 +4067,12 @@ static int f2fs_swap_activate(struct swa
 	if (f2fs_readonly(F2FS_I_SB(inode)->sb))
 		return -EROFS;
 
+	if (f2fs_lfs_mode(F2FS_I_SB(inode))) {
+		f2fs_err(F2FS_I_SB(inode),
+			"Swapfile not supported in LFS mode");
+		return -EINVAL;
+	}
+
 	ret = f2fs_convert_inline_inode(inode);
 	if (ret)
 		return ret;
author maintainer
#94 lore raw

PATCH 85/800 clk: k210: Fix k210_clk_set_parent()

In reply to Greg Kroah-Hartman

From: Damien Le Moal <[email protected]>

commit faa0e307948594b4379a86fff7fb2409067aed6f upstream.

In k210_clk_set_parent(), add missing writel() call to update the mux register of a clock to change its parent. This also fixes a compilation warning with clang when compiling with W=1.

Fixes c6ca7616f7d5 ("clk: Add RISC-V Canaan Kendryte K210 clock driver")
---
 drivers/clk/clk-k210.c |    1 +
 1 file changed, 1 insertion(+)
drivers/clk/clk-k210.c +1 -0
@@ -722,6 +722,7 @@ static int k210_clk_set_parent(struct cl
 		reg |= BIT(cfg->mux_bit);
 	else
 		reg &= ~BIT(cfg->mux_bit);
+	writel(reg, ksc->regs + cfg->mux_reg);
 	spin_unlock_irqrestore(&ksc->clk_lock, flags);
 
 	return 0;
author maintainer
#95 lore raw

PATCH 86/800 clk: agilex/stratix10/n5x: fix how the bypass_reg is handled

In reply to Greg Kroah-Hartman

From: Dinh Nguyen <[email protected]>

commit dfd1427c3769ba51297777dbb296f1802d72dbf6 upstream.

If the bypass_reg is set, then we can return the bypass parent, however, if there is not a bypass_reg, we need to figure what the correct parent mux is.

The previous code never handled the parent mux if there was a bypass_reg.

Fixes 80c6b7a0894f ("clk: socfpga: agilex: add clock driver for the Agilex platform")
---
 drivers/clk/socfpga/clk-periph-s10.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/clk/socfpga/clk-periph-s10.c +8 -3
@@ -64,16 +64,21 @@ static u8 clk_periclk_get_parent(struct
 {
 	struct socfpga_periph_clk *socfpgaclk = to_periph_clk(hwclk);
 	u32 clk_src, mask;
-	u8 parent;
+	u8 parent = 0;
 
+	/* handle the bypass first */
 	if (socfpgaclk->bypass_reg) {
 		mask = (0x1 << socfpgaclk->bypass_shift);
 		parent = ((readl(socfpgaclk->bypass_reg) & mask) >>
 			   socfpgaclk->bypass_shift);
-	} else {
+		if (parent)
+			return parent;
+	}
+
+	if (socfpgaclk->hw.reg) {
 		clk_src = readl(socfpgaclk->hw.reg);
 		parent = (clk_src >> CLK_MGR_FREE_SHIFT) &
-			CLK_MGR_FREE_MASK;
+			  CLK_MGR_FREE_MASK;
 	}
 	return parent;
 }
author maintainer
#96 lore raw

PATCH 87/800 clk: agilex/stratix10: remove noc_clk

In reply to Greg Kroah-Hartman

From: Dinh Nguyen <[email protected]>

commit efbe21df3e889c0f4bf682c2b7e2465d60b0127c upstream.

Early documentation had a noc_clk, but in reality, it's just the noc_free_clk. Remove the noc_clk clock and just use the noc_free_clk.

Fixes 80c6b7a0894f ("clk: socfpga: agilex: add clock driver for the Agilex platform")
---
 drivers/clk/socfpga/clk-agilex.c |   32 +++++++++++++++-----------------
 drivers/clk/socfpga/clk-s10.c    |   32 +++++++++++++++-----------------
 2 files changed, 30 insertions(+), 34 deletions(-)
drivers/clk/socfpga/clk-agilex.c +15 -17
@@ -222,11 +222,9 @@ static const struct stratix10_perip_cnt_
 	{ AGILEX_MPU_FREE_CLK, "mpu_free_clk", NULL, mpu_free_mux, ARRAY_SIZE(mpu_free_mux),
 	   0, 0x3C, 0, 0, 0},
 	{ AGILEX_NOC_FREE_CLK, "noc_free_clk", NULL, noc_free_mux, ARRAY_SIZE(noc_free_mux),
-	  0, 0x40, 0, 0, 1},
-	{ AGILEX_L4_SYS_FREE_CLK, "l4_sys_free_clk", "noc_free_clk", NULL, 1, 0,
-	  0, 4, 0, 0},
-	{ AGILEX_NOC_CLK, "noc_clk", NULL, noc_mux, ARRAY_SIZE(noc_mux),
-	  0, 0, 0, 0x30, 1},
+	  0, 0x40, 0, 0, 0},
+	{ AGILEX_L4_SYS_FREE_CLK, "l4_sys_free_clk", NULL, noc_mux, ARRAY_SIZE(noc_mux), 0,
+	  0, 4, 0x30, 1},
 	{ AGILEX_EMAC_A_FREE_CLK, "emaca_free_clk", NULL, emaca_free_mux, ARRAY_SIZE(emaca_free_mux),
 	  0, 0xD4, 0, 0x88, 0},
 	{ AGILEX_EMAC_B_FREE_CLK, "emacb_free_clk", NULL, emacb_free_mux, ARRAY_SIZE(emacb_free_mux),
@@ -252,24 +250,24 @@ static const struct stratix10_gate_clock
 	  0, 0, 0, 0, 0, 0, 4},
 	{ AGILEX_MPU_CCU_CLK, "mpu_ccu_clk", "mpu_clk", NULL, 1, 0, 0x24,
 	  0, 0, 0, 0, 0, 0, 2},
-	{ AGILEX_L4_MAIN_CLK, "l4_main_clk", "noc_clk", NULL, 1, 0, 0x24,
-	  1, 0x44, 0, 2, 0, 0, 0},
-	{ AGILEX_L4_MP_CLK, "l4_mp_clk", "noc_clk", NULL, 1, 0, 0x24,
-	  2, 0x44, 8, 2, 0, 0, 0},
+	{ AGILEX_L4_MAIN_CLK, "l4_main_clk", NULL, noc_mux, ARRAY_SIZE(noc_mux), 0, 0x24,
+	  1, 0x44, 0, 2, 0x30, 1, 0},
+	{ AGILEX_L4_MP_CLK, "l4_mp_clk", NULL, noc_mux, ARRAY_SIZE(noc_mux), 0, 0x24,
+	  2, 0x44, 8, 2, 0x30, 1, 0},
 	/*
 	 * The l4_sp_clk feeds a 100 MHz clock to various peripherals, one of them
 	 * being the SP timers, thus cannot get gated.
 	 */
-	{ AGILEX_L4_SP_CLK, "l4_sp_clk", "noc_clk", NULL, 1, CLK_IS_CRITICAL, 0x24,
-	  3, 0x44, 16, 2, 0, 0, 0},
-	{ AGILEX_CS_AT_CLK, "cs_at_clk", "noc_clk", NULL, 1, 0, 0x24,
-	  4, 0x44, 24, 2, 0, 0, 0},
-	{ AGILEX_CS_TRACE_CLK, "cs_trace_clk", "noc_clk", NULL, 1, 0, 0x24,
-	  4, 0x44, 26, 2, 0, 0, 0},
+	{ AGILEX_L4_SP_CLK, "l4_sp_clk", NULL, noc_mux, ARRAY_SIZE(noc_mux), CLK_IS_CRITICAL, 0x24,
+	  3, 0x44, 16, 2, 0x30, 1, 0},
+	{ AGILEX_CS_AT_CLK, "cs_at_clk", NULL, noc_mux, ARRAY_SIZE(noc_mux), 0, 0x24,
+	  4, 0x44, 24, 2, 0x30, 1, 0},
+	{ AGILEX_CS_TRACE_CLK, "cs_trace_clk", NULL, noc_mux, ARRAY_SIZE(noc_mux), 0, 0x24,
+	  4, 0x44, 26, 2, 0x30, 1, 0},
 	{ AGILEX_CS_PDBG_CLK, "cs_pdbg_clk", "cs_at_clk", NULL, 1, 0, 0x24,
 	  4, 0x44, 28, 1, 0, 0, 0},
-	{ AGILEX_CS_TIMER_CLK, "cs_timer_clk", "noc_clk", NULL, 1, 0, 0x24,
-	  5, 0, 0, 0, 0, 0, 0},
+	{ AGILEX_CS_TIMER_CLK, "cs_timer_clk", NULL, noc_mux, ARRAY_SIZE(noc_mux), 0, 0x24,
+	  5, 0, 0, 0, 0x30, 1, 0},
 	{ AGILEX_S2F_USER0_CLK, "s2f_user0_clk", NULL, s2f_usr0_mux, ARRAY_SIZE(s2f_usr0_mux), 0, 0x24,
 	  6, 0, 0, 0, 0, 0, 0},
 	{ AGILEX_EMAC0_CLK, "emac0_clk", NULL, emac_mux, ARRAY_SIZE(emac_mux), 0, 0x7C,
drivers/clk/socfpga/clk-s10.c +15 -17
@@ -167,7 +167,7 @@ static const struct stratix10_perip_cnt_
 	{ STRATIX10_MPU_FREE_CLK, "mpu_free_clk", NULL, mpu_free_mux, ARRAY_SIZE(mpu_free_mux),
 	   0, 0x48, 0, 0, 0},
 	{ STRATIX10_NOC_FREE_CLK, "noc_free_clk", NULL, noc_free_mux, ARRAY_SIZE(noc_free_mux),
-	  0, 0x4C, 0, 0, 0},
+	  0, 0x4C, 0, 0x3C, 1},
 	{ STRATIX10_MAIN_EMACA_CLK, "main_emaca_clk", "main_noc_base_clk", NULL, 1, 0,
 	  0x50, 0, 0, 0},
 	{ STRATIX10_MAIN_EMACB_CLK, "main_emacb_clk", "main_noc_base_clk", NULL, 1, 0,
@@ -200,10 +200,8 @@ static const struct stratix10_perip_cnt_
 	  0, 0xD4, 0, 0, 0},
 	{ STRATIX10_PERI_PSI_REF_CLK, "peri_psi_ref_clk", "peri_noc_base_clk", NULL, 1, 0,
 	  0xD8, 0, 0, 0},
-	{ STRATIX10_L4_SYS_FREE_CLK, "l4_sys_free_clk", "noc_free_clk", NULL, 1, 0,
-	  0, 4, 0, 0},
-	{ STRATIX10_NOC_CLK, "noc_clk", NULL, noc_mux, ARRAY_SIZE(noc_mux),
-	  0, 0, 0, 0x3C, 1},
+	{ STRATIX10_L4_SYS_FREE_CLK, "l4_sys_free_clk", NULL, noc_mux, ARRAY_SIZE(noc_mux), 0,
+	  0, 4, 0x3C, 1},
 	{ STRATIX10_EMAC_A_FREE_CLK, "emaca_free_clk", NULL, emaca_free_mux, ARRAY_SIZE(emaca_free_mux),
 	  0, 0, 2, 0xB0, 0},
 	{ STRATIX10_EMAC_B_FREE_CLK, "emacb_free_clk", NULL, emacb_free_mux, ARRAY_SIZE(emacb_free_mux),
@@ -227,20 +225,20 @@ static const struct stratix10_gate_clock
 	  0, 0, 0, 0, 0, 0, 4},
 	{ STRATIX10_MPU_L2RAM_CLK, "mpu_l2ram_clk", "mpu_clk", NULL, 1, 0, 0x30,
 	  0, 0, 0, 0, 0, 0, 2},
-	{ STRATIX10_L4_MAIN_CLK, "l4_main_clk", "noc_clk", NULL, 1, 0, 0x30,
-	  1, 0x70, 0, 2, 0, 0, 0},
-	{ STRATIX10_L4_MP_CLK, "l4_mp_clk", "noc_clk", NULL, 1, 0, 0x30,
-	  2, 0x70, 8, 2, 0, 0, 0},
-	{ STRATIX10_L4_SP_CLK, "l4_sp_clk", "noc_clk", NULL, 1, CLK_IS_CRITICAL, 0x30,
-	  3, 0x70, 16, 2, 0, 0, 0},
-	{ STRATIX10_CS_AT_CLK, "cs_at_clk", "noc_clk", NULL, 1, 0, 0x30,
-	  4, 0x70, 24, 2, 0, 0, 0},
-	{ STRATIX10_CS_TRACE_CLK, "cs_trace_clk", "noc_clk", NULL, 1, 0, 0x30,
-	  4, 0x70, 26, 2, 0, 0, 0},
+	{ STRATIX10_L4_MAIN_CLK, "l4_main_clk", NULL, noc_mux, ARRAY_SIZE(noc_mux), 0, 0x30,
+	  1, 0x70, 0, 2, 0x3C, 1, 0},
+	{ STRATIX10_L4_MP_CLK, "l4_mp_clk", NULL, noc_mux, ARRAY_SIZE(noc_mux), 0, 0x30,
+	  2, 0x70, 8, 2, 0x3C, 1, 0},
+	{ STRATIX10_L4_SP_CLK, "l4_sp_clk", NULL, noc_mux, ARRAY_SIZE(noc_mux), CLK_IS_CRITICAL, 0x30,
+	  3, 0x70, 16, 2, 0x3C, 1, 0},
+	{ STRATIX10_CS_AT_CLK, "cs_at_clk", NULL, noc_mux, ARRAY_SIZE(noc_mux), 0, 0x30,
+	  4, 0x70, 24, 2, 0x3C, 1, 0},
+	{ STRATIX10_CS_TRACE_CLK, "cs_trace_clk", NULL, noc_mux, ARRAY_SIZE(noc_mux), 0, 0x30,
+	  4, 0x70, 26, 2, 0x3C, 1, 0},
 	{ STRATIX10_CS_PDBG_CLK, "cs_pdbg_clk", "cs_at_clk", NULL, 1, 0, 0x30,
 	  4, 0x70, 28, 1, 0, 0, 0},
-	{ STRATIX10_CS_TIMER_CLK, "cs_timer_clk", "noc_clk", NULL, 1, 0, 0x30,
-	  5, 0, 0, 0, 0, 0, 0},
+	{ STRATIX10_CS_TIMER_CLK, "cs_timer_clk", NULL, noc_mux, ARRAY_SIZE(noc_mux), 0, 0x30,
+	  5, 0, 0, 0, 0x3C, 1, 0},
 	{ STRATIX10_S2F_USER0_CLK, "s2f_user0_clk", NULL, s2f_usr0_mux, ARRAY_SIZE(s2f_usr0_mux), 0, 0x30,
 	  6, 0, 0, 0, 0, 0, 0},
 	{ STRATIX10_EMAC0_CLK, "emac0_clk", NULL, emac_mux, ARRAY_SIZE(emac_mux), 0, 0xA4,
author maintainer
#97 lore raw

PATCH 88/800 clk: agilex/stratix10: fix bypass representation

In reply to Greg Kroah-Hartman

From: Dinh Nguyen <[email protected]>

commit 6855ee839699bdabb4b16cf942557fd763bcb1fa upstream.

Each of these clocks(s2f_usr0/1, sdmmc_clk, gpio_db, emac_ptp, emac0/1/2) have a bypass setting that can use the boot_clk. The previous representation was not correct.

Fix the representation.

Fixes 80c6b7a0894f ("clk: socfpga: agilex: add clock driver for the Agilex platform")
---
 drivers/clk/socfpga/clk-agilex.c |   57 +++++++++++++++++++++++++++++++--------
 drivers/clk/socfpga/clk-s10.c    |   55 ++++++++++++++++++++++++++++++-------
 2 files changed, 91 insertions(+), 21 deletions(-)
drivers/clk/socfpga/clk-agilex.c +46 -11
@@ -186,6 +186,41 @@ static const struct clk_parent_data noc_
 	  .name = "boot_clk", },
 };
 
+static const struct clk_parent_data sdmmc_mux[] = {
+	{ .fw_name = "sdmmc_free_clk",
+	  .name = "sdmmc_free_clk", },
+	{ .fw_name = "boot_clk",
+	  .name = "boot_clk", },
+};
+
+static const struct clk_parent_data s2f_user1_mux[] = {
+	{ .fw_name = "s2f_user1_free_clk",
+	  .name = "s2f_user1_free_clk", },
+	{ .fw_name = "boot_clk",
+	  .name = "boot_clk", },
+};
+
+static const struct clk_parent_data psi_mux[] = {
+	{ .fw_name = "psi_ref_free_clk",
+	  .name = "psi_ref_free_clk", },
+	{ .fw_name = "boot_clk",
+	  .name = "boot_clk", },
+};
+
+static const struct clk_parent_data gpio_db_mux[] = {
+	{ .fw_name = "gpio_db_free_clk",
+	  .name = "gpio_db_free_clk", },
+	{ .fw_name = "boot_clk",
+	  .name = "boot_clk", },
+};
+
+static const struct clk_parent_data emac_ptp_mux[] = {
+	{ .fw_name = "emac_ptp_free_clk",
+	  .name = "emac_ptp_free_clk", },
+	{ .fw_name = "boot_clk",
+	  .name = "boot_clk", },
+};
+
 /* clocks in AO (always on) controller */
 static const struct stratix10_pll_clock agilex_pll_clks[] = {
 	{ AGILEX_BOOT_CLK, "boot_clk", boot_mux, ARRAY_SIZE(boot_mux), 0,
@@ -234,7 +269,7 @@ static const struct stratix10_perip_cnt_
 	{ AGILEX_GPIO_DB_FREE_CLK, "gpio_db_free_clk", NULL, gpio_db_free_mux,
 	  ARRAY_SIZE(gpio_db_free_mux), 0, 0xE0, 0, 0x88, 3},
 	{ AGILEX_SDMMC_FREE_CLK, "sdmmc_free_clk", NULL, sdmmc_free_mux,
-	  ARRAY_SIZE(sdmmc_free_mux), 0, 0xE4, 0, 0x88, 4},
+	  ARRAY_SIZE(sdmmc_free_mux), 0, 0xE4, 0, 0, 0},
 	{ AGILEX_S2F_USER0_FREE_CLK, "s2f_user0_free_clk", NULL, s2f_usr0_free_mux,
 	  ARRAY_SIZE(s2f_usr0_free_mux), 0, 0xE8, 0, 0, 0},
 	{ AGILEX_S2F_USER1_FREE_CLK, "s2f_user1_free_clk", NULL, s2f_usr1_free_mux,
@@ -276,16 +311,16 @@ static const struct stratix10_gate_clock
 	  1, 0, 0, 0, 0x94, 27, 0},
 	{ AGILEX_EMAC2_CLK, "emac2_clk", NULL, emac_mux, ARRAY_SIZE(emac_mux), 0, 0x7C,
 	  2, 0, 0, 0, 0x94, 28, 0},
-	{ AGILEX_EMAC_PTP_CLK, "emac_ptp_clk", "emac_ptp_free_clk", NULL, 1, 0, 0x7C,
-	  3, 0, 0, 0, 0, 0, 0},
-	{ AGILEX_GPIO_DB_CLK, "gpio_db_clk", "gpio_db_free_clk", NULL, 1, 0, 0x7C,
-	  4, 0x98, 0, 16, 0, 0, 0},
-	{ AGILEX_SDMMC_CLK, "sdmmc_clk", "sdmmc_free_clk", NULL, 1, 0, 0x7C,
-	  5, 0, 0, 0, 0, 0, 4},
-	{ AGILEX_S2F_USER1_CLK, "s2f_user1_clk", "s2f_user1_free_clk", NULL, 1, 0, 0x7C,
-	  6, 0, 0, 0, 0, 0, 0},
-	{ AGILEX_PSI_REF_CLK, "psi_ref_clk", "psi_ref_free_clk", NULL, 1, 0, 0x7C,
-	  7, 0, 0, 0, 0, 0, 0},
+	{ AGILEX_EMAC_PTP_CLK, "emac_ptp_clk", NULL, emac_ptp_mux, ARRAY_SIZE(emac_ptp_mux), 0, 0x7C,
+	  3, 0, 0, 0, 0x88, 2, 0},
+	{ AGILEX_GPIO_DB_CLK, "gpio_db_clk", NULL, gpio_db_mux, ARRAY_SIZE(gpio_db_mux), 0, 0x7C,
+	  4, 0x98, 0, 16, 0x88, 3, 0},
+	{ AGILEX_SDMMC_CLK, "sdmmc_clk", NULL, sdmmc_mux, ARRAY_SIZE(sdmmc_mux), 0, 0x7C,
+	  5, 0, 0, 0, 0x88, 4, 4},
+	{ AGILEX_S2F_USER1_CLK, "s2f_user1_clk", NULL, s2f_user1_mux, ARRAY_SIZE(s2f_user1_mux), 0, 0x7C,
+	  6, 0, 0, 0, 0x88, 5, 0},
+	{ AGILEX_PSI_REF_CLK, "psi_ref_clk", NULL, psi_mux, ARRAY_SIZE(psi_mux), 0, 0x7C,
+	  7, 0, 0, 0, 0x88, 6, 0},
 	{ AGILEX_USB_CLK, "usb_clk", "l4_mp_clk", NULL, 1, 0, 0x7C,
 	  8, 0, 0, 0, 0, 0, 0},
 	{ AGILEX_SPI_M_CLK, "spi_m_clk", "l4_mp_clk", NULL, 1, 0, 0x7C,
drivers/clk/socfpga/clk-s10.c +45 -10

67 lines not on this page · raw message

author maintainer
#98 lore raw

PATCH 89/800 clk: agilex/stratix10: add support for the 2nd bypass

In reply to Greg Kroah-Hartman

From: Dinh Nguyen <[email protected]>

commit c2c9c5661a48bf2e67dcb4e989003144304acd6a upstream.

The EMAC clocks on Stratix10/Agilex/N5X have an additional bypass that was not being accounted for. The bypass selects between emaca_clk/emacb_clk and boot_clk.

Because the bypass register offset is different between Stratix10 and Agilex/N5X, it's best to create a new function to calculate the bypass.

Fixes 80c6b7a0894f ("clk: socfpga: agilex: add clock driver for the Agilex platform")
---
 drivers/clk/socfpga/clk-agilex.c    |    4 -
 drivers/clk/socfpga/clk-gate-s10.c  |  119 +++++++++++++++++++++++++++++++++++-
 drivers/clk/socfpga/stratix10-clk.h |    2 
 3 files changed, 123 insertions(+), 2 deletions(-)
drivers/clk/socfpga/clk-agilex.c +3 -1
@@ -177,6 +177,8 @@ static const struct clk_parent_data emac
 	  .name = "emaca_free_clk", },
 	{ .fw_name = "emacb_free_clk",
 	  .name = "emacb_free_clk", },
+	{ .fw_name = "boot_clk",
+	  .name = "boot_clk", },
 };
 
 static const struct clk_parent_data noc_mux[] = {
@@ -399,7 +401,7 @@ static int agilex_clk_register_gate(cons
 	int i;
 
 	for (i = 0; i < nums; i++) {
-		hw_clk = s10_register_gate(&clks[i], base);
+		hw_clk = agilex_register_gate(&clks[i], base);
 		if (IS_ERR(hw_clk)) {
 			pr_err("%s: failed to register clock %s\n",
 			       __func__, clks[i].name);
drivers/clk/socfpga/clk-gate-s10.c +118 -1

150 lines not on this page · raw message

drivers/clk/socfpga/stratix10-clk.h +2 -0
@@ -85,4 +85,6 @@ struct clk_hw *s10_register_cnt_periph(c
 				    void __iomem *reg);
 struct clk_hw *s10_register_gate(const struct stratix10_gate_clock *clks,
 			      void __iomem *reg);
+struct clk_hw *agilex_register_gate(const struct stratix10_gate_clock *clks,
+			      void __iomem *reg);
 #endif	/* __STRATIX10_CLK_H */
author maintainer
#99 lore raw

PATCH 90/800 rtc: stm32: Fix unbalanced clk_disable_unprepare() on probe error path

In reply to Greg Kroah-Hartman

From: Martin Fuzzey <[email protected]>

commit 950ac33dbe6ff656a623d862022f0762ec061ba7 upstream.

The STM32MP1 RTC may have 2 clocks, the pclk and the rtc_ck.

If clk_prepare_enable() fails for the second clock (rtc_ck) we must only call clk_disable_unprepare() for the first clock (pclk) but currently we call it on both leading to a WARN:

[   15.629568] WARNING: CPU: 0 PID: 146 at drivers/clk/clk.c:958 clk_core_disable+0xb0/0xc8
[   15.637620] ck_rtc already disabled
[   15.663322] CPU: 0 PID: 146 Comm: systemd-udevd Not tainted 5.4.77-pknbsp-svn5759-atag-v5.4.77-204-gea4235203137-dirty #2413
[   15.674510] Hardware name: STM32 (Device Tree Support)
[   15.679658] [<c0111148>] (unwind_backtrace) from [<c010c0b8>] (show_stack+0x10/0x14)
[   15.687371] [<c010c0b8>] (show_stack) from [<c0ab3d28>] (dump_stack+0xc0/0xe0)
[   15.694574] [<c0ab3d28>] (dump_stack) from [<c012360c>] (__warn+0xc8/0xf0)
[   15.701428] [<c012360c>] (__warn) from [<c0123694>] (warn_slowpath_fmt+0x60/0x94)
[   15.708894] [<c0123694>] (warn_slowpath_fmt) from [<c053b518>] (clk_core_disable+0xb0/0xc8)
[   15.717230] [<c053b518>] (clk_core_disable) from [<c053c190>] (clk_core_disable_lock+0x18/0x24)
[   15.725924] [<c053c190>] (clk_core_disable_lock) from [<bf0adc44>] (stm32_rtc_probe+0x124/0x5e4 [rtc_stm32])
[   15.735739] [<bf0adc44>] (stm32_rtc_probe [rtc_stm32]) from [<c05f7d4c>] (platform_drv_probe+0x48/0x98)
[   15.745095] [<c05f7d4c>] (platform_drv_probe) from [<c05f5cec>] (really_probe+0x1f0/0x458)
[   15.753338] [<c05f5cec>] (really_probe) from [<c05f61c4>] (driver_probe_device+0x70/0x1c4)
[   15.761584] [<c05f61c4>] (driver_probe_device) from [<c05f6580>] (device_driver_attach+0x58/0x60)
[   15.770439] [<c05f6580>] (device_driver_attach) from [<c05f6654>] (__driver_attach+0xcc/0x170)
[   15.779032] [<c05f6654>] (__driver_attach) from [<c05f40d8>] (bus_for_each_dev+0x58/0x7c)
[   15.787191] [<c05f40d8>] (bus_for_each_dev) from [<c05f4ffc>] (bus_add_driver+0xdc/0x1f8)
[   15.795352] [<c05f4ffc>] (bus_add_driver) from [<c05f6ed8>] (driver_register+0x7c/0x110)
[   15.803425] [<c05f6ed8>] (driver_register) from [<c01027bc>] (do_one_initcall+0x70/0x1b8)
[   15.811588] [<c01027bc>] (do_one_initcall) from [<c01a1094>] (do_init_module+0x58/0x1f8)
[   15.819660] [<c01a1094>] (do_init_module) from [<c01a0074>] (load_module+0x1e58/0x23c8)
[   15.827646] [<c01a0074>] (load_module) from [<c01a0860>] (sys_finit_module+0xa0/0xd4)
[   15.835459] [<c01a0860>] (sys_finit_module) from [<c01011e0>] (__sys_trace_return+0x0/0x20)
---
 drivers/rtc/rtc-stm32.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/rtc/rtc-stm32.c +4 -2
@@ -754,7 +754,7 @@ static int stm32_rtc_probe(struct platfo
 
 	ret = clk_prepare_enable(rtc->rtc_ck);
 	if (ret)
-		goto err;
+		goto err_no_rtc_ck;
 
 	if (rtc->data->need_dbp)
 		regmap_update_bits(rtc->dbp, rtc->dbp_reg,
@@ -830,10 +830,12 @@ static int stm32_rtc_probe(struct platfo
 	}
 
 	return 0;
+
 err:
+	clk_disable_unprepare(rtc->rtc_ck);
+err_no_rtc_ck:
 	if (rtc->data->has_pclk)
 		clk_disable_unprepare(rtc->pclk);
-	clk_disable_unprepare(rtc->rtc_ck);
 
 	if (rtc->data->need_dbp)
 		regmap_update_bits(rtc->dbp, rtc->dbp_reg, rtc->dbp_mask, 0);
author maintainer
#100 lore raw

PATCH 91/800 iio: frequency: adf4350: disable reg and clk on error in adf4350_probe()

In reply to Greg Kroah-Hartman

From: Yang Yingliang <[email protected]>

commit c8cc4cf60b000fb9f4b29bed131fb6cf1fe42d67 upstream.

Disable reg and clk when devm_gpiod_get_optional() fails in adf4350_probe().

---
 drivers/iio/frequency/adf4350.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/iio/frequency/adf4350.c +4 -2
@@ -563,8 +563,10 @@ static int adf4350_probe(struct spi_devi
 
 	st->lock_detect_gpiod = devm_gpiod_get_optional(&spi->dev, NULL,
 							GPIOD_IN);
-	if (IS_ERR(st->lock_detect_gpiod))
-		return PTR_ERR(st->lock_detect_gpiod);
+	if (IS_ERR(st->lock_detect_gpiod)) {
+		ret = PTR_ERR(st->lock_detect_gpiod);
+		goto error_disable_reg;
+	}
 
 	if (pdata->power_up_frequency) {
 		ret = adf4350_set_freq(st, pdata->power_up_frequency);
author maintainer
#101 lore raw

PATCH 92/800 iio: light: tcs3472: do not free unallocated IRQ

In reply to Greg Kroah-Hartman

From: frank zago <[email protected]>

commit 7cd04c863f9e1655d607705455e7714f24451984 upstream.

Allocating an IRQ is conditional to the IRQ existence, but freeing it was not. If no IRQ was allocate, the driver would still try to free IRQ 0. Add the missing checks.

This fixes the following trace when the driver is removed:

[  100.667788] Trying to free already-free IRQ 0
[  100.667793] WARNING: CPU: 0 PID: 2315 at kernel/irq/manage.c:1826 free_irq+0x1fd/0x370
...
[  100.667914] Call Trace:
[  100.667920]  tcs3472_remove+0x3a/0x90 [tcs3472]
[  100.667927]  i2c_device_remove+0x2b/0xa0
Fixes 9d2f715d592e ("iio: light: tcs3472: support out-of-threshold events")
---
 drivers/iio/light/tcs3472.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/iio/light/tcs3472.c +4 -2
@@ -531,7 +531,8 @@ static int tcs3472_probe(struct i2c_clie
 	return 0;
 
 free_irq:
-	free_irq(client->irq, indio_dev);
+	if (client->irq)
+		free_irq(client->irq, indio_dev);
 buffer_cleanup:
 	iio_triggered_buffer_cleanup(indio_dev);
 	return ret;
@@ -559,7 +560,8 @@ static int tcs3472_remove(struct i2c_cli
 	struct iio_dev *indio_dev = i2c_get_clientdata(client);
 
 	iio_device_unregister(indio_dev);
-	free_irq(client->irq, indio_dev);
+	if (client->irq)
+		free_irq(client->irq, indio_dev);
 	iio_triggered_buffer_cleanup(indio_dev);
 	tcs3472_powerdown(iio_priv(indio_dev));
 
author maintainer
#102 lore raw

PATCH 93/800 iio: ltr501: mark register holding upper 8 bits of ALS_DATA{0,1} and PS_DATA as volatile, too

In reply to Greg Kroah-Hartman

From: Marc Kleine-Budde <[email protected]>

commit 2ac0b029a04b673ce83b5089368f467c5dca720c upstream.

The regmap is configured for 8 bit registers, uses a RB-Tree cache and marks several registers as volatile (i.e. do not cache).

The ALS and PS data registers in the chip are 16 bit wide and spans two regmap registers. In the current driver only the base register is marked as volatile, resulting in the upper register only read once.

Further the data sheet notes:

| When the I2C read operation starts, all four ALS data registers are | locked until the I2C read operation of register 0x8B is completed.

Which results in the registers never update after the 2nd read.

This patch fixes the problem by marking the upper 8 bits of the ALS and PS registers as volatile, too.

---
 drivers/iio/light/ltr501.c |    6 ++++++
 1 file changed, 6 insertions(+)
drivers/iio/light/ltr501.c +6 -0
@@ -32,9 +32,12 @@
 #define LTR501_PART_ID 0x86
 #define LTR501_MANUFAC_ID 0x87
 #define LTR501_ALS_DATA1 0x88 /* 16-bit, little endian */
+#define LTR501_ALS_DATA1_UPPER 0x89 /* upper 8 bits of LTR501_ALS_DATA1 */
 #define LTR501_ALS_DATA0 0x8a /* 16-bit, little endian */
+#define LTR501_ALS_DATA0_UPPER 0x8b /* upper 8 bits of LTR501_ALS_DATA0 */
 #define LTR501_ALS_PS_STATUS 0x8c
 #define LTR501_PS_DATA 0x8d /* 16-bit, little endian */
+#define LTR501_PS_DATA_UPPER 0x8e /* upper 8 bits of LTR501_PS_DATA */
 #define LTR501_INTR 0x8f /* output mode, polarity, mode */
 #define LTR501_PS_THRESH_UP 0x90 /* 11 bit, ps upper threshold */
 #define LTR501_PS_THRESH_LOW 0x92 /* 11 bit, ps lower threshold */
@@ -1354,9 +1357,12 @@ static bool ltr501_is_volatile_reg(struc
 {
 	switch (reg) {
 	case LTR501_ALS_DATA1:
+	case LTR501_ALS_DATA1_UPPER:
 	case LTR501_ALS_DATA0:
+	case LTR501_ALS_DATA0_UPPER:
 	case LTR501_ALS_PS_STATUS:
 	case LTR501_PS_DATA:
+	case LTR501_PS_DATA_UPPER:
 		return true;
 	default:
 		return false;
author maintainer
#103 lore raw

PATCH 94/800 iio: ltr501: ltr559: fix initialization of LTR501_ALS_CONTR

In reply to Greg Kroah-Hartman

From: Oliver Lang <[email protected]>

commit 421a26f3d7a7c3ca43f3a9dc0f3cb0f562d5bd95 upstream.

The ltr559 chip uses only the lowest bit of the ALS_CONTR register to configure between active and stand-by mode. In the original driver BIT(1) is used, which does a software reset instead.

This patch fixes the problem by using BIT(0) as als_mode_active for the ltr559 chip.

---
 drivers/iio/light/ltr501.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/light/ltr501.c +1 -1
@@ -1208,7 +1208,7 @@ static struct ltr501_chip_info ltr501_ch
 		.als_gain_tbl_size = ARRAY_SIZE(ltr559_als_gain_tbl),
 		.ps_gain = ltr559_ps_gain_tbl,
 		.ps_gain_tbl_size = ARRAY_SIZE(ltr559_ps_gain_tbl),
-		.als_mode_active = BIT(1),
+		.als_mode_active = BIT(0),
 		.als_gain_mask = BIT(2) | BIT(3) | BIT(4),
 		.als_gain_shift = 2,
 		.info = &ltr501_info,
author maintainer
#104 lore raw

PATCH 95/800 iio: ltr501: ltr501_read_ps(): add missing endianness conversion

In reply to Greg Kroah-Hartman

From: Oliver Lang <[email protected]>

commit 71b33f6f93ef9462c84560e2236ed22209d26a58 upstream.

The PS ADC Channel data is spread over 2 registers in little-endian form. This patch adds the missing endianness conversion.

---
 drivers/iio/light/ltr501.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/iio/light/ltr501.c +4 -3
@@ -409,18 +409,19 @@ static int ltr501_read_als(const struct
 
 static int ltr501_read_ps(const struct ltr501_data *data)
 {
-	int ret, status;
+	__le16 status;
+	int ret;
 
 	ret = ltr501_drdy(data, LTR501_STATUS_PS_RDY);
 	if (ret < 0)
 		return ret;
 
 	ret = regmap_bulk_read(data->regmap, LTR501_PS_DATA,
-			       &status, 2);
+			       &status, sizeof(status));
 	if (ret < 0)
 		return ret;
 
-	return status;
+	return le16_to_cpu(status);
 }
 
 static int ltr501_read_intr_prst(const struct ltr501_data *data,
author maintainer
#105 lore raw

PATCH 96/800 iio: accel: bma180: Fix BMA25x bandwidth register values

In reply to Greg Kroah-Hartman

From: Stephan Gerhold <[email protected]>

commit 8090d67421ddab0ae932abab5a60200598bf0bbb upstream.

According to the BMA253 datasheet [1] and BMA250 datasheet [2] the bandwidth value for BMA25x should be set as 01xxx:

"Settings 00xxx result in a bandwidth of 7.81 Hz; [...]
It is recommended [...] to use the range from ´01000b´ to ´01111b´ only in order to be compatible with future products."

However, at the moment the drivers sets bandwidth values from 0 to 6, which is not recommended and always results into 7.81 Hz bandwidth according to the datasheet.

Fix this by introducing a bw_offset = 8 = 01000b for BMA25x, so the additional bit is always set for BMA25x.

[1]: https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bma253-ds000.pdf
[2]: https://datasheet.octopart.com/BMA250-Bosch-datasheet-15540103.pdf

---
 drivers/iio/accel/bma180.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/iio/accel/bma180.c +7 -2
@@ -55,7 +55,7 @@ struct bma180_part_info {
 
 	u8 int_reset_reg, int_reset_mask;
 	u8 sleep_reg, sleep_mask;
-	u8 bw_reg, bw_mask;
+	u8 bw_reg, bw_mask, bw_offset;
 	u8 scale_reg, scale_mask;
 	u8 power_reg, power_mask, lowpower_val;
 	u8 int_enable_reg, int_enable_mask;
@@ -127,6 +127,7 @@ struct bma180_part_info {
 
 #define BMA250_RANGE_MASK	GENMASK(3, 0) /* Range of accel values */
 #define BMA250_BW_MASK		GENMASK(4, 0) /* Accel bandwidth */
+#define BMA250_BW_OFFSET	8
 #define BMA250_SUSPEND_MASK	BIT(7) /* chip will sleep */
 #define BMA250_LOWPOWER_MASK	BIT(6)
 #define BMA250_DATA_INTEN_MASK	BIT(4)
@@ -143,6 +144,7 @@ struct bma180_part_info {
 
 #define BMA254_RANGE_MASK	GENMASK(3, 0) /* Range of accel values */
 #define BMA254_BW_MASK		GENMASK(4, 0) /* Accel bandwidth */
+#define BMA254_BW_OFFSET	8
 #define BMA254_SUSPEND_MASK	BIT(7) /* chip will sleep */
 #define BMA254_LOWPOWER_MASK	BIT(6)
 #define BMA254_DATA_INTEN_MASK	BIT(4)
@@ -283,7 +285,8 @@ static int bma180_set_bw(struct bma180_d
 	for (i = 0; i < data->part_info->num_bw; ++i) {
 		if (data->part_info->bw_table[i] == val) {
 			ret = bma180_set_bits(data, data->part_info->bw_reg,
-				data->part_info->bw_mask, i);
+				data->part_info->bw_mask,
+				i + data->part_info->bw_offset);
 			if (ret) {
 				dev_err(&data->client->dev,
 					"failed to set bandwidth\n");
@@ -876,6 +879,7 @@ static const struct bma180_part_info bma
 		.sleep_mask = BMA250_SUSPEND_MASK,
 		.bw_reg = BMA250_BW_REG,
 		.bw_mask = BMA250_BW_MASK,
+		.bw_offset = BMA250_BW_OFFSET,
 		.scale_reg = BMA250_RANGE_REG,
 		.scale_mask = BMA250_RANGE_MASK,
 		.power_reg = BMA250_POWER_REG,
@@ -905,6 +909,7 @@ static const struct bma180_part_info bma
 		.sleep_mask = BMA254_SUSPEND_MASK,
 		.bw_reg = BMA254_BW_REG,
 		.bw_mask = BMA254_BW_MASK,
+		.bw_offset = BMA254_BW_OFFSET,
 		.scale_reg = BMA254_RANGE_REG,
 		.scale_mask = BMA254_RANGE_MASK,
 		.power_reg = BMA254_POWER_REG,
author maintainer
#106 lore raw

PATCH 97/800 iio: accel: bmc150: Fix bma222 scale unit

In reply to Greg Kroah-Hartman

From: Stephan Gerhold <[email protected]>

commit 6e2a90af0b8d757e850cc023d761ee9a9492e2fe upstream.

According to sysfs-bus-iio documentation the unit for accelerometer values after applying scale/offset should be m/s^2, not g, which explains why the scale values for the other variants in bmc150-accel do not match exactly the values given in the datasheet.

To get the correct values, we need to multiply the BMA222 scale values by g = 9.80665 m/s^2.

---
 drivers/iio/accel/bmc150-accel-core.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/iio/accel/bmc150-accel-core.c +5 -4
@@ -1177,11 +1177,12 @@ static const struct bmc150_accel_chip_in
 		/*
 		 * The datasheet page 17 says:
 		 * 15.6, 31.3, 62.5 and 125 mg per LSB.
+		 * IIO unit is m/s^2 so multiply by g = 9.80665 m/s^2.
 		 */
-		.scale_table = { {156000, BMC150_ACCEL_DEF_RANGE_2G},
-				 {313000, BMC150_ACCEL_DEF_RANGE_4G},
-				 {625000, BMC150_ACCEL_DEF_RANGE_8G},
-				 {1250000, BMC150_ACCEL_DEF_RANGE_16G} },
+		.scale_table = { {152984, BMC150_ACCEL_DEF_RANGE_2G},
+				 {306948, BMC150_ACCEL_DEF_RANGE_4G},
+				 {612916, BMC150_ACCEL_DEF_RANGE_8G},
+				 {1225831, BMC150_ACCEL_DEF_RANGE_16G} },
 	},
 	[bma222e] = {
 		.name = "BMA222E",
author maintainer
#107 lore raw

PATCH 98/800 iio: accel: bmc150: Fix dereferencing the wrong pointer in bmc150_get/set_second_device

In reply to Greg Kroah-Hartman

From: Hans de Goede <[email protected]>

commit f2bf22dc9ea8ead180fc0221874bd556bf1d2685 upstream.

The drvdata for iio-parent devices points to the struct iio_dev for the iio-device. So by directly casting the return from i2c_get_clientdata() to struct bmc150_accel_data * the code was ending up storing the second_dev pointer in (and retrieving it from) some semi-random offset inside struct iio_dev, rather then storing it in the second_dev member of the bmc150_accel_data struct.

Fix the code to get the struct bmc150_accel_data * pointer to call iio_priv() on the struct iio_dev * returned by i2c_get_clientdata(), so that the correct pointer gets dereferenced.

This fixes the following oops on rmmod, caused by trying to dereference the wrong return of bmc150_get_second_device():

[  238.980737] BUG: unable to handle page fault for address: 0000000000004710
[  238.980755] #PF: supervisor read access in kernel mode
[  238.980760] #PF: error_code(0x0000) - not-present page
...
[  238.980841]  i2c_unregister_device.part.0+0x19/0x60
[  238.980856]  0xffffffffc0815016
[  238.980863]  i2c_device_remove+0x25/0xb0
[  238.980869]  __device_release_driver+0x180/0x240
[  238.980876]  driver_detach+0xd4/0x120
[  238.980882]  bus_remove_driver+0x5b/0xd0
[  238.980888]  i2c_del_driver+0x44/0x70

While at it also remove the now no longer sensible checks for data being NULL, iio_priv never returns NULL for an iio_dev with non 0 sized private-data.

Fixes 5bfb3a4bd8f6 ("iio: accel: bmc150: Check for a second ACPI device for BOSC0200")
Cc Jeremy Cline <[email protected]>
---
 drivers/iio/accel/bmc150-accel-core.c |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/iio/accel/bmc150-accel-core.c +3 -7
@@ -1810,10 +1810,7 @@ EXPORT_SYMBOL_GPL(bmc150_accel_core_prob
 
 struct i2c_client *bmc150_get_second_device(struct i2c_client *client)
 {
-	struct bmc150_accel_data *data = i2c_get_clientdata(client);
-
-	if (!data)
-		return NULL;
+	struct bmc150_accel_data *data = iio_priv(i2c_get_clientdata(client));
 
 	return data->second_device;
 }
@@ -1821,10 +1818,9 @@ EXPORT_SYMBOL_GPL(bmc150_get_second_devi
 
 void bmc150_set_second_device(struct i2c_client *client)
 {
-	struct bmc150_accel_data *data = i2c_get_clientdata(client);
+	struct bmc150_accel_data *data = iio_priv(i2c_get_clientdata(client));
 
-	if (data)
-		data->second_device = client;
+	data->second_device = client;
 }
 EXPORT_SYMBOL_GPL(bmc150_set_second_device);
 
author maintainer
#108 lore raw

PATCH 99/800 iio: accel: bmc150: Dont make the remove function of the second accelerometer unregister itself

In reply to Greg Kroah-Hartman

From: Hans de Goede <[email protected]>

commit f407e2dca0f559621114eeaf657880d83f237fbd upstream.

On machines with dual accelerometers described in a single ACPI fwnode, the bmc150_accel_probe() instantiates a second i2c-client for the second accelerometer.

A pointer to this manually instantiated second i2c-client is stored inside the iio_dev's private-data through bmc150_set_second_device(), so that the i2c-client can be unregistered from bmc150_accel_remove().

Before this commit bmc150_set_second_device() took only 1 argument so it would store the pointer in private-data of the iio_dev belonging to the manually instantiated i2c-client, leading to the bmc150_accel_remove() call for the second_dev trying to unregister *itself* while it was being removed, leading to a deadlock and rmmod hanging.

Change bmc150_set_second_device() to take 2 arguments: 1. The i2c-client which is instantiating the second i2c-client for the 2nd accelerometer and
2. The second-device pointer itself (which also is an i2c-client).

This will store the second_device pointer in the private data of the iio_dev belonging to the (ACPI instantiated) i2c-client for the first accelerometer and will make bmc150_accel_remove() unregister the second_device i2c-client when called for the first client, avoiding the deadlock.

Fixes 5bfb3a4bd8f6 ("iio: accel: bmc150: Check for a second ACPI device for BOSC0200")
Cc Jeremy Cline <[email protected]>
---
 drivers/iio/accel/bmc150-accel-core.c |    4 ++--
 drivers/iio/accel/bmc150-accel-i2c.c  |    2 +-
 drivers/iio/accel/bmc150-accel.h      |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/iio/accel/bmc150-accel-core.c +2 -2
@@ -1816,11 +1816,11 @@ struct i2c_client *bmc150_get_second_dev
 }
 EXPORT_SYMBOL_GPL(bmc150_get_second_device);
 
-void bmc150_set_second_device(struct i2c_client *client)
+void bmc150_set_second_device(struct i2c_client *client, struct i2c_client *second_dev)
 {
 	struct bmc150_accel_data *data = iio_priv(i2c_get_clientdata(client));
 
-	data->second_device = client;
+	data->second_device = second_dev;
 }
 EXPORT_SYMBOL_GPL(bmc150_set_second_device);
 
drivers/iio/accel/bmc150-accel-i2c.c +1 -1
@@ -70,7 +70,7 @@ static int bmc150_accel_probe(struct i2c
 
 		second_dev = i2c_acpi_new_device(&client->dev, 1, &board_info);
 		if (!IS_ERR(second_dev))
-			bmc150_set_second_device(second_dev);
+			bmc150_set_second_device(client, second_dev);
 	}
 #endif
 
drivers/iio/accel/bmc150-accel.h +1 -1
@@ -18,7 +18,7 @@ int bmc150_accel_core_probe(struct devic
 			    const char *name, bool block_supported);
 int bmc150_accel_core_remove(struct device *dev);
 struct i2c_client *bmc150_get_second_device(struct i2c_client *second_device);
-void bmc150_set_second_device(struct i2c_client *second_device);
+void bmc150_set_second_device(struct i2c_client *client, struct i2c_client *second_dev);
 extern const struct dev_pm_ops bmc150_accel_pm_ops;
 extern const struct regmap_config bmc150_regmap_conf;
 
author maintainer
#109 lore raw

PATCH 100/800 serial: mvebu-uart: fix calculation of clock divisor

In reply to Greg Kroah-Hartman

From: Pali Rohár <[email protected]>

commit 9078204ca5c33ba20443a8623a41a68a9995a70d upstream.

The clock divisor should be rounded to the closest value.

Fixes 68a0db1d7da2 ("serial: mvebu-uart: add function to change baudrate")
Cc [email protected] # 0e4cf69ede87 ("serial: mvebu-uart: clarify the baud rate derivation")
---
 drivers/tty/serial/mvebu-uart.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/mvebu-uart.c +1 -1
@@ -463,7 +463,7 @@ static int mvebu_uart_baud_rate_set(stru
 	 * makes use of D to configure the desired baudrate.
 	 */
 	m_divisor = OSAMP_DEFAULT_DIVISOR;
-	d_divisor = DIV_ROUND_UP(port->uartclk, baud * m_divisor);
+	d_divisor = DIV_ROUND_CLOSEST(port->uartclk, baud * m_divisor);
 
 	brdv = readl(port->membase + UART_BRDV);
 	brdv &= ~BRDV_BAUD_MASK;
author maintainer
#110 lore raw

PATCH 101/800 serial: sh-sci: Stop dmaengine transfer in sci_stop_tx()

In reply to Greg Kroah-Hartman

From: Yoshihiro Shimoda <[email protected]>

commit 08a84410a04f05c7c1b8e833f552416d8eb9f6fe upstream.

Stop dmaengine transfer in sci_stop_tx(). Otherwise, the following message is possible output when system enters suspend and while transferring data, because clearing TIE bit in SCSCR is not able to stop any dmaengine transfer.

sh-sci e6550000.serial: ttySC1: Unable to drain transmitter

Note that this driver has already used some #ifdef in the .c file so that this patch also uses #ifdef to fix the issue. Otherwise, build errors happens if the CONFIG_SERIAL_SH_SCI_DMA is disabled.

---
 drivers/tty/serial/sh-sci.c |    8 ++++++++
 1 file changed, 8 insertions(+)
drivers/tty/serial/sh-sci.c +8 -0
@@ -610,6 +610,14 @@ static void sci_stop_tx(struct uart_port
 	ctrl &= ~SCSCR_TIE;
 
 	serial_port_out(port, SCSCR, ctrl);
+
+#ifdef CONFIG_SERIAL_SH_SCI_DMA
+	if (to_sci_port(port)->chan_tx &&
+	    !dma_submit_error(to_sci_port(port)->cookie_tx)) {
+		dmaengine_terminate_async(to_sci_port(port)->chan_tx);
+		to_sci_port(port)->cookie_tx = -EINVAL;
+	}
+#endif
 }
 
 static void sci_start_rx(struct uart_port *port)
author maintainer
#111 lore raw

PATCH 102/800 serial_cs: Add Option International GSM-Ready 56K/ISDN modem

In reply to Greg Kroah-Hartman

From: Ondrej Zary <[email protected]>

commit d495dd743d5ecd47288156e25c4d9163294a0992 upstream.

Add support for Option International GSM-Ready 56K/ISDN PCMCIA modem card.

---
 drivers/tty/serial/8250/serial_cs.c |    1 +
 1 file changed, 1 insertion(+)
drivers/tty/serial/8250/serial_cs.c +1 -0
@@ -777,6 +777,7 @@ static const struct pcmcia_device_id ser
 	PCMCIA_DEVICE_PROD_ID12("Multi-Tech", "MT2834LT", 0x5f73be51, 0x4cd7c09e),
 	PCMCIA_DEVICE_PROD_ID12("OEM      ", "C288MX     ", 0xb572d360, 0xd2385b7a),
 	PCMCIA_DEVICE_PROD_ID12("Option International", "V34bis GSM/PSTN Data/Fax Modem", 0x9d7cd6f5, 0x5cb8bf41),
+	PCMCIA_DEVICE_PROD_ID12("Option International", "GSM-Ready 56K/ISDN", 0x9d7cd6f5, 0xb23844aa),
 	PCMCIA_DEVICE_PROD_ID12("PCMCIA   ", "C336MX     ", 0x99bcafe9, 0xaa25bcab),
 	PCMCIA_DEVICE_PROD_ID12("Quatech Inc", "PCMCIA Dual RS-232 Serial Port Card", 0xc4420b35, 0x92abc92f),
 	PCMCIA_DEVICE_PROD_ID12("Quatech Inc", "Dual RS-232 Serial Port PC Card", 0xc4420b35, 0x031a380d),
author maintainer
#112 lore raw

PATCH 103/800 serial_cs: remove wrong GLOBETROTTER.cis entry

In reply to Greg Kroah-Hartman

From: Ondrej Zary <[email protected]>

commit 11b1d881a90fc184cc7d06e9804eb288c24a2a0d upstream.

The GLOBETROTTER.cis entry in serial_cs matches more devices than intended and breaks them. Remove it.

Example: # pccardctl info
PRODID_1="Option International
"
PRODID_2="GSM-Ready 56K/ISDN
"
PRODID_3="021
"
PRODID_4="A
"
MANFID=0013,0000
FUNCID=0

result:
pcmcia 0.0: Direct firmware load for cis/GLOBETROTTER.cis failed with error -2

The GLOBETROTTER.cis is nowhere to be found. There's GLOBETROTTER.cis.ihex at
https://netdev.vger.kernel.narkive.com/h4inqdxM/patch-axnet-cs-fix-phy-id-detection-for-bogus-asix-chip#post41
It's from completely diffetent card:
vers_1 4.1, "Option International", "GSM/GPRS GlobeTrotter", "001", "A"

---
 drivers/tty/serial/8250/serial_cs.c |    1 -
 1 file changed, 1 deletion(-)
drivers/tty/serial/8250/serial_cs.c +0 -1
@@ -805,7 +805,6 @@ static const struct pcmcia_device_id ser
 	PCMCIA_DEVICE_CIS_PROD_ID12("ADVANTECH", "COMpad-32/85B-4", 0x96913a85, 0xcec8f102, "cis/COMpad4.cis"),
 	PCMCIA_DEVICE_CIS_PROD_ID123("ADVANTECH", "COMpad-32/85", "1.0", 0x96913a85, 0x8fbe92ae, 0x0877b627, "cis/COMpad2.cis"),
 	PCMCIA_DEVICE_CIS_PROD_ID2("RS-COM 2P", 0xad20b156, "cis/RS-COM-2P.cis"),
-	PCMCIA_DEVICE_CIS_MANF_CARD(0x0013, 0x0000, "cis/GLOBETROTTER.cis"),
 	PCMCIA_DEVICE_PROD_ID12("ELAN DIGITAL SYSTEMS LTD, c1997.", "SERIAL CARD: SL100  1.00.", 0x19ca78af, 0xf964f42b),
 	PCMCIA_DEVICE_PROD_ID12("ELAN DIGITAL SYSTEMS LTD, c1997.", "SERIAL CARD: SL100", 0x19ca78af, 0x71d98e83),
 	PCMCIA_DEVICE_PROD_ID12("ELAN DIGITAL SYSTEMS LTD, c1997.", "SERIAL CARD: SL232  1.00.", 0x19ca78af, 0x69fb7490),
author maintainer
#113 lore raw

PATCH 104/800 ath9k: Fix kernel NULL pointer dereference during ath_reset_internal()

In reply to Greg Kroah-Hartman

From: Pali Rohár <[email protected]>

commit fb312ac5ccb007e843f982b38d4d6886ba4b32f2 upstream.

I got this crash more times during debugging of PCIe controller and crash happens somehow at the time when PCIe kernel code started link retraining (as part of ASPM code) when at the same time PCIe link went down and ath9k probably executed hw reset procedure.

Currently I'm not able to reproduce this issue as it looks like to be some race condition between link training, ASPM, link down and reset path. And as always, race conditions which depends on more input parameters are hard to reproduce as it depends on precise timings.

But it is clear that pointers are zero in this case and should be properly filled as same code pattern is used in ath9k_stop() function. Anyway I was able to reproduce this crash by manually triggering ath reset worker prior putting card up. I created simple patch to export reset functionality via debugfs and use it to "simulate" of triggering
reset. s proved that NULL-pointer dereference issue is there.

Function ath9k_hw_reset() is dereferencing chan structure pointer, so it needs to be non-NULL pointer.

Function ath9k_stop() already contains code which sets ah->curchan to valid non-NULL pointer prior calling ath9k_hw_reset() function.

Add same code pattern also into ath_reset_internal() function to prevent kernel NULL pointer dereference in ath9k_hw_reset() function.

This change fixes kernel NULL pointer dereference in ath9k_hw_reset() which is caused by calling ath9k_hw_reset() from ath_reset_internal() with NULL chan structure.

    [   45.334305] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008
    [   45.344417] Mem abort info:
    [   45.347301]   ESR = 0x96000005
    [   45.350448]   EC = 0x25: DABT (current EL), IL = 32 bits
    [   45.356166]   SET = 0, FnV = 0
    [   45.359350]   EA = 0, S1PTW = 0
    [   45.362596] Data abort info:
    [   45.365756]   ISV = 0, ISS = 0x00000005
    [   45.369735]   CM = 0, WnR = 0
    [   45.372814] user pgtable: 4k pages, 39-bit VAs, pgdp=000000000685d000
    [   45.379663] [0000000000000008] pgd=0000000000000000, p4d=0000000000000000, pud=0000000000000000
    [   45.388856] Internal error: Oops: 96000005 [#1] SMP
    [   45.393897] Modules linked in: ath9k ath9k_common ath9k_hw
    [   45.399574] CPU: 1 PID: 309 Comm: kworker/u4:2 Not tainted 5.12.0-rc2-dirty #785
    [   45.414746] Workqueue: phy0 ath_reset_work [ath9k]
    [   45.419713] pstate: 40000005 (nZcv daif -PAN -UAO -TCO BTYPE=--)
    [   45.425910] pc : ath9k_hw_reset+0xc4/0x1c48 [ath9k_hw]
    [   45.431234] lr : ath9k_hw_reset+0xc0/0x1c48 [ath9k_hw]
    [   45.436548] sp : ffffffc0118dbca0
    [   45.439961] x29: ffffffc0118dbca0 x28: 0000000000000000
    [   45.445442] x27: ffffff800dee4080 x26: 0000000000000000
    [   45.450923] x25: ffffff800df9b9d8 x24: 0000000000000000
    [   45.456404] x23: ffffffc0115f6000 x22: ffffffc008d0d408
    [   45.461885] x21: ffffff800dee5080 x20: ffffff800df9b9d8
    [   45.467366] x19: 0000000000000000 x18: 0000000000000000
    [   45.472846] x17: 0000000000000000 x16: 0000000000000000
    [   45.478326] x15: 0000000000000010 x14: ffffffffffffffff
    [   45.483807] x13: ffffffc0918db94f x12: ffffffc011498720
    [   45.489289] x11: 0000000000000003 x10: ffffffc0114806e0
    [   45.494770] x9 : ffffffc01014b2ec x8 : 0000000000017fe8
    [   45.500251] x7 : c0000000ffffefff x6 : 0000000000000001
    [   45.505733] x5 : 0000000000000000 x4 : 0000000000000000
    [   45.511213] x3 : 0000000000000000 x2 : ffffff801fece870
    [   45.516693] x1 : ffffffc00eded000 x0 : 000000000000003f
    [   45.522174] Call trace:
    [   45.524695]  ath9k_hw_reset+0xc4/0x1c48 [ath9k_hw]
    [   45.529653]  ath_reset_internal+0x1a8/0x2b8 [ath9k]
    [   45.534696]  ath_reset_work+0x2c/0x40 [ath9k]
    [   45.539198]  process_one_work+0x210/0x480
    [   45.543339]  worker_thread+0x5c/0x510
    [   45.547115]  kthread+0x12c/0x130
    [   45.550445]  ret_from_fork+0x10/0x1c
    [   45.554138] Code: 910922c2 9117e021 95ff0398 b4000294 (b9400a61)
    [   45.560430] ---[ end trace 566410ba90b50e8b ]---
    [   45.565193] Kernel panic - not syncing: Oops: Fatal exception in interrupt
    [   45.572282] SMP: stopping secondary CPUs
    [   45.576331] Kernel Offset: disabled
    [   45.579924] CPU features: 0x00040002,0000200c
    [   45.584416] Memory Limit: none
    [   45.587564] Rebooting in 3 seconds..
---
 drivers/net/wireless/ath/ath9k/main.c |    5 +++++
 1 file changed, 5 insertions(+)
drivers/net/wireless/ath/ath9k/main.c +5 -0
@@ -307,6 +307,11 @@ static int ath_reset_internal(struct ath
 		hchan = ah->curchan;
 	}
 
+	if (!hchan) {
+		fastcc = false;
+		hchan = ath9k_cmn_get_channel(sc->hw, ah, &sc->cur_chan->chandef);
+	}
+
 	if (!ath_prepare_reset(sc))
 		fastcc = false;
 
author maintainer
#114 lore raw

PATCH 105/800 ssb: sdio: Dont overwrite const buffer if block_write fails

In reply to Greg Kroah-Hartman

From: Michael Buesch <[email protected]>

commit 47ec636f7a25aa2549e198c48ecb6b1c25d05456 upstream.

It doesn't make sense to clobber the const driver-side buffer, if a write-to-device attempt failed. All other SSB variants (PCI, PCMCIA and SoC) also don't corrupt the buffer on any failure in block_write. Therefore, remove this memset from the SDIO variant.

---
 drivers/ssb/sdio.c |    1 -
 1 file changed, 1 deletion(-)
drivers/ssb/sdio.c +0 -1
@@ -411,7 +411,6 @@ static void ssb_sdio_block_write(struct
 	sdio_claim_host(bus->host_sdio);
 	if (unlikely(ssb_sdio_switch_core(bus, dev))) {
 		error = -EIO;
-		memset((void *)buffer, 0xff, count);
 		goto err_out;
 	}
 	offset |= bus->sdio_sbaddr & 0xffff;
author maintainer
#115 lore raw

PATCH 106/800 rsi: Assign beacon rate settings to the correct rate_info descriptor field

In reply to Greg Kroah-Hartman

From: Marek Vasut <[email protected]>

commit b1c3a24897bd528f2f4fda9fea7da08a84ae25b6 upstream.

The RSI_RATE_x bits must be assigned to struct rsi_data_desc rate_info field. The rest of the driver does it correctly, except this one place, so fix it. This is also aligned with the RSI downstream vendor driver. Without this patch, an AP operating at 5 GHz does not transmit any beacons at all, this patch fixes that.

Fixes d26a9559403c ("rsi: add beacon changes for AP mode")
Cc Amitkumar Karwar <[email protected]>
Cc Angus Ainslie <[email protected]>
Cc David S. Miller <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc Kalle Valo <[email protected]>
Cc Karun Eagalapati <[email protected]>
Cc Martin Kepplinger <[email protected]>
Cc Prameela Rani Garnepudi <[email protected]>
Cc Sebastian Krzyszkowiak <[email protected]>
Cc Siva Rebbagondla <[email protected]>
---
 drivers/net/wireless/rsi/rsi_91x_hal.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/rsi/rsi_91x_hal.c +2 -2
@@ -470,9 +470,9 @@ int rsi_prepare_beacon(struct rsi_common
 	}
 
 	if (common->band == NL80211_BAND_2GHZ)
-		bcn_frm->bbp_info |= cpu_to_le16(RSI_RATE_1);
+		bcn_frm->rate_info |= cpu_to_le16(RSI_RATE_1);
 	else
-		bcn_frm->bbp_info |= cpu_to_le16(RSI_RATE_6);
+		bcn_frm->rate_info |= cpu_to_le16(RSI_RATE_6);
 
 	if (mac_bcn->data[tim_offset + 2] == 0)
 		bcn_frm->frame_info |= cpu_to_le16(RSI_DATA_DESC_DTIM_BEACON);
author maintainer
#116 lore raw

PATCH 107/800 rsi: fix AP mode with WPA failure due to encrypted EAPOL

In reply to Greg Kroah-Hartman

From: Martin Fuzzey <[email protected]>

commit 314538041b5632ffaf64798faaeabaf2793fe029 upstream.

In AP mode WPA2-PSK connections were not established.

The reason was that the AP was sending the first message of the 4 way handshake encrypted, even though no pairwise key had (correctly) yet been set.

Encryption was enabled if the "security_enable" driver flag was set and encryption was not explicitly disabled by IEEE80211_TX_INTFL_DONT_ENCRYPT.

However security_enable was set when *any* key, including the AP GTK key, had been set which was causing unwanted encryption even if no key was avaialble for the unicast packet to be sent.

Fix this by adding a check that we have a key and drop the old security_enable driver flag which is insufficient and redundant.

The Redpine downstream out of tree driver does it this way too.

Regarding the Fixes tag the actual code being modified was introduced earlier, with the original driver submission, in dad0d04fa7ba ("rsi: Add RS9113 wireless driver"), however at that time AP mode was not yet supported so there was no bug at that point.

So I have tagged the introduction of AP support instead which was part of the patch set "rsi: support for AP mode" [1]

It is not clear whether AP WPA has ever worked, I can see nothing on the kernel side that broke it afterwards yet the AP support patch series says "Tests are performed to confirm aggregation, connections in WEP and WPA/WPA2 security."

One possibility is that the initial tests were done with a modified userspace (hostapd).

[1] https://www.spinics.net/lists/linux-wireless/msg165302.html

---
 drivers/net/wireless/rsi/rsi_91x_hal.c      |    2 +-
 drivers/net/wireless/rsi/rsi_91x_mac80211.c |    3 ---
 drivers/net/wireless/rsi/rsi_91x_mgmt.c     |    3 +--
 drivers/net/wireless/rsi/rsi_main.h         |    1 -
 4 files changed, 2 insertions(+), 7 deletions(-)
drivers/net/wireless/rsi/rsi_91x_hal.c +1 -1
@@ -203,7 +203,7 @@ int rsi_prepare_data_desc(struct rsi_com
 		wh->frame_control |= cpu_to_le16(RSI_SET_PS_ENABLE);
 
 	if ((!(info->flags & IEEE80211_TX_INTFL_DONT_ENCRYPT)) &&
-	    (common->secinfo.security_enable)) {
+	    info->control.hw_key) {
 		if (rsi_is_cipher_wep(common))
 			ieee80211_size += 4;
 		else
drivers/net/wireless/rsi/rsi_91x_mac80211.c +0 -3
@@ -1028,7 +1028,6 @@ static int rsi_mac80211_set_key(struct i
 	mutex_lock(&common->mutex);
 	switch (cmd) {
 	case SET_KEY:
-		secinfo->security_enable = true;
 		status = rsi_hal_key_config(hw, vif, key, sta);
 		if (status) {
 			mutex_unlock(&common->mutex);
@@ -1047,8 +1046,6 @@ static int rsi_mac80211_set_key(struct i
 		break;
 
 	case DISABLE_KEY:
-		if (vif->type == NL80211_IFTYPE_STATION)
-			secinfo->security_enable = false;
 		rsi_dbg(ERR_ZONE, "%s: RSI del key\n", __func__);
 		memset(key, 0, sizeof(struct ieee80211_key_conf));
 		status = rsi_hal_key_config(hw, vif, key, sta);
drivers/net/wireless/rsi/rsi_91x_mgmt.c +1 -2
@@ -1803,8 +1803,7 @@ int rsi_send_wowlan_request(struct rsi_c
 			RSI_WIFI_MGMT_Q);
 	cmd_frame->desc.desc_dword0.frame_type = WOWLAN_CONFIG_PARAMS;
 	cmd_frame->host_sleep_status = sleep_status;
-	if (common->secinfo.security_enable &&
-	    common->secinfo.gtk_cipher)
+	if (common->secinfo.gtk_cipher)
 		flags |= RSI_WOW_GTK_REKEY;
 	if (sleep_status)
 		cmd_frame->wow_flags = flags;
drivers/net/wireless/rsi/rsi_main.h +0 -1
@@ -151,7 +151,6 @@ enum edca_queue {
 };
 
 struct security_info {
-	bool security_enable;
 	u32 ptk_cipher;
 	u32 gtk_cipher;
 };
author maintainer
#117 lore raw

PATCH 108/800 selftests/resctrl: Fix incorrect parsing of option "-t"

In reply to Greg Kroah-Hartman

From: Xiaochen Shen <[email protected]>

commit 1421ec684a43379b2aa3cfda20b03d38282dc990 upstream.

Resctrl test suite accepts command line argument "-t" to specify the unit tests to run in the test list (e.g., -t mbm,mba,cmt,cat) as documented in the help.

When calling strtok() to parse the option, the incorrect delimiters argument ":\t" is used. As a result, passing "-t mbm,mba,cmt,cat" throws an invalid option error.

Fix this by using delimiters argument "," instead of ":\t" for parsing of unit tests list. At the same time, remove the unnecessary "spaces" between the unit tests in help documentation to prevent confusion.

Fixes 790bf585b0ee ("selftests/resctrl: Add Cache Allocation Technology (CAT) selftest")
Fixes 78941183d1b1 ("selftests/resctrl: Add Cache QoS Monitoring (CQM) selftest")
Fixes ecdbb911f22d ("selftests/resctrl: Add MBM test")
Fixes 034c7678dd2c ("selftests/resctrl: Add README for resctrl tests")
---
 tools/testing/selftests/resctrl/README          |    2 +-
 tools/testing/selftests/resctrl/resctrl_tests.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
tools/testing/selftests/resctrl/README +1 -1
@@ -47,7 +47,7 @@ Parameter '-h' shows usage information.
 
 usage: resctrl_tests [-h] [-b "benchmark_cmd [options]"] [-t test list] [-n no_of_bits]
         -b benchmark_cmd [options]: run specified benchmark for MBM, MBA and CMT default benchmark is builtin fill_buf
-        -t test list: run tests specified in the test list, e.g. -t mbm, mba, cmt, cat
+        -t test list: run tests specified in the test list, e.g. -t mbm,mba,cmt,cat
         -n no_of_bits: run cache tests using specified no of bits in cache bit mask
         -p cpu_no: specify CPU number to run the test. 1 is default
         -h: help
tools/testing/selftests/resctrl/resctrl_tests.c +2 -2
@@ -40,7 +40,7 @@ static void cmd_help(void)
 	printf("\t-b benchmark_cmd [options]: run specified benchmark for MBM, MBA and CMT\n");
 	printf("\t   default benchmark is builtin fill_buf\n");
 	printf("\t-t test list: run tests specified in the test list, ");
-	printf("e.g. -t mbm, mba, cmt, cat\n");
+	printf("e.g. -t mbm,mba,cmt,cat\n");
 	printf("\t-n no_of_bits: run cache tests using specified no of bits in cache bit mask\n");
 	printf("\t-p cpu_no: specify CPU number to run the test. 1 is default\n");
 	printf("\t-h: help\n");
@@ -173,7 +173,7 @@ int main(int argc, char **argv)
 
 					return -1;
 				}
-				token = strtok(NULL, ":\t");
+				token = strtok(NULL, ",");
 			}
 			break;
 		case 'p':
author maintainer
#118 lore raw

PATCH 109/800 tracing/histograms: Fix parsing of "sym-offset" modifier

In reply to Greg Kroah-Hartman

From: Steven Rostedt (VMware) <[email protected]>

commit 26c563731056c3ee66f91106c3078a8c36bb7a9e upstream.

With the addition of simple mathematical operations (plus and minus), the parsing of the "sym-offset" modifier broke, as it took the '-' part of the "sym-offset" as a minus, and tried to break it up into a mathematical operation of "field.sym - offset", in which case it failed to parse (unless the event had a field called "offset").

Both .sym and .sym-offset modifiers should not be entered into mathematical calculations anyway. If ".sym-offset" is found in the modifier, then simply make it not an operation that can be calculated on.

Cc Ingo Molnar <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Masami Hiramatsu <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Daniel Bristot de Oliveira <[email protected]>
Fixes 100719dcef447 ("tracing: Add simple expression support to hist triggers")
---
 kernel/trace/trace_events_hist.c |    7 +++++++
 1 file changed, 7 insertions(+)
kernel/trace/trace_events_hist.c +7 -0
@@ -1555,6 +1555,13 @@ static int contains_operator(char *str)
 
 	switch (*op) {
 	case '-':
+		/*
+		 * Unfortunately, the modifier ".sym-offset"
+		 * can confuse things.
+		 */
+		if (op - str >= 4 && !strncmp(op - 4, ".sym-offset", 11))
+			return FIELD_OP_NONE;
+
 		if (*str == '-')
 			field_op = FIELD_OP_UNARY_MINUS;
 		else
author maintainer
#119 lore raw

PATCH 110/800 tracepoint: Add tracepoint_probe_register_may_exist() for BPF tracing

In reply to Greg Kroah-Hartman

From: Steven Rostedt (VMware) <[email protected]>

commit 9913d5745bd720c4266805c8d29952a3702e4eca upstream.

All internal use cases for tracepoint_probe_register() is set to not ever be called with the same function and data. If it is, it is considered a bug, as that means the accounting of handling tracepoints is corrupted. If the function and data for a tracepoint is already registered when tracepoint_probe_register() is called, it will call WARN_ON_ONCE() and return with EEXISTS.

The BPF system call can end up calling tracepoint_probe_register() with the same data, which now means that this can trigger the warning because of a user space process. As WARN_ON_ONCE() should not be called because user space called a system call with bad data, there needs to be a way to register a tracepoint without triggering a warning.

Enter tracepoint_probe_register_may_exist(), which can be called, but will not cause a WARN_ON() if the probe already exists. It will still error out with EEXIST, which will then be sent to the user space that performed the BPF system call.

This keeps the previous testing for issues with other users of the tracepoint code, while letting BPF call it with duplicated data and not warn about it.

Fixes c4f6699dfcb85 ("bpf: introduce BPF_RAW_TRACEPOINT")
---
 include/linux/tracepoint.h |   10 ++++++++++
 kernel/trace/bpf_trace.c   |    3 ++-
 kernel/tracepoint.c        |   33 ++++++++++++++++++++++++++++++---
 3 files changed, 42 insertions(+), 4 deletions(-)
include/linux/tracepoint.h +10 -0
@@ -41,7 +41,17 @@ extern int
 tracepoint_probe_register_prio(struct tracepoint *tp, void *probe, void *data,
 			       int prio);
 extern int
+tracepoint_probe_register_prio_may_exist(struct tracepoint *tp, void *probe, void *data,
+					 int prio);
+extern int
 tracepoint_probe_unregister(struct tracepoint *tp, void *probe, void *data);
+static inline int
+tracepoint_probe_register_may_exist(struct tracepoint *tp, void *probe,
+				    void *data)
+{
+	return tracepoint_probe_register_prio_may_exist(tp, probe, data,
+							TRACEPOINT_DEFAULT_PRIO);
+}
 extern void
 for_each_kernel_tracepoint(void (*fct)(struct tracepoint *tp, void *priv),
 		void *priv);
kernel/trace/bpf_trace.c +2 -1
@@ -1840,7 +1840,8 @@ static int __bpf_probe_register(struct b
 	if (prog->aux->max_tp_access > btp->writable_size)
 		return -EINVAL;
 
-	return tracepoint_probe_register(tp, (void *)btp->bpf_func, prog);
+	return tracepoint_probe_register_may_exist(tp, (void *)btp->bpf_func,
+						   prog);
 }
 
 int bpf_probe_register(struct bpf_raw_event_map *btp, struct bpf_prog *prog)
kernel/tracepoint.c +30 -3
@@ -273,7 +273,8 @@ static void tracepoint_update_call(struc
  * Add the probe function to a tracepoint.
  */
 static int tracepoint_add_func(struct tracepoint *tp,
-			       struct tracepoint_func *func, int prio)
+			       struct tracepoint_func *func, int prio,
+			       bool warn)
 {
 	struct tracepoint_func *old, *tp_funcs;
 	int ret;
@@ -288,7 +289,7 @@ static int tracepoint_add_func(struct tr
 			lockdep_is_held(&tracepoints_mutex));
 	old = func_add(&tp_funcs, func, prio);
 	if (IS_ERR(old)) {
-		WARN_ON_ONCE(PTR_ERR(old) != -ENOMEM);
+		WARN_ON_ONCE(warn && PTR_ERR(old) != -ENOMEM);
 		return PTR_ERR(old);
 	}
 
@@ -344,6 +345,32 @@ static int tracepoint_remove_func(struct
 }
 
 /**
+ * tracepoint_probe_register_prio_may_exist -  Connect a probe to a tracepoint with priority
+ * @tp: tracepoint
+ * @probe: probe handler
+ * @data: tracepoint data
+ * @prio: priority of this function over other registered functions
+ *
+ * Same as tracepoint_probe_register_prio() except that it will not warn
+ * if the tracepoint is already registered.
+ */
+int tracepoint_probe_register_prio_may_exist(struct tracepoint *tp, void *probe,
+					     void *data, int prio)
+{
+	struct tracepoint_func tp_func;
+	int ret;
+
+	mutex_lock(&tracepoints_mutex);
+	tp_func.func = probe;
+	tp_func.data = data;
+	tp_func.prio = prio;
+	ret = tracepoint_add_func(tp, &tp_func, prio, false);
+	mutex_unlock(&tracepoints_mutex);
+	return ret;
+}
+EXPORT_SYMBOL_GPL(tracepoint_probe_register_prio_may_exist);
+
+/**
  * tracepoint_probe_register_prio -  Connect a probe to a tracepoint with priority
  * @tp: tracepoint
  * @probe: probe handler
@@ -366,7 +393,7 @@ int tracepoint_probe_register_prio(struc
 	tp_func.func = probe;
 	tp_func.data = data;
 	tp_func.prio = prio;
-	ret = tracepoint_add_func(tp, &tp_func, prio);
+	ret = tracepoint_add_func(tp, &tp_func, prio, true);
 	mutex_unlock(&tracepoints_mutex);
 	return ret;
 }
author maintainer
#120 lore raw

PATCH 111/800 seq_buf: Make trace_seq_putmem_hex() support data longer than 8

In reply to Greg Kroah-Hartman

From: Yun Zhou <[email protected]>

commit 6a2cbc58d6c9d90cd74288cc497c2b45815bc064 upstream.

Since the raw memory 'data' does not go forward, it will dump repeated data if the data length is more than 8. If we want to dump longer data blocks, we need to repeatedly call macro SEQ_PUT_HEX_FIELD. I think it is a bit redundant, and multiple function calls also affect the performance.

Fixes 6d2289f3faa7 ("tracing: Make trace_seq_putmem_hex() more robust")
---
 lib/seq_buf.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
lib/seq_buf.c +3 -1
@@ -243,12 +243,14 @@ int seq_buf_putmem_hex(struct seq_buf *s
 			break;
 
 		/* j increments twice per loop */
-		len -= j / 2;
 		hex[j++] = ' ';
 
 		seq_buf_putmem(s, hex, j);
 		if (seq_buf_has_overflowed(s))
 			return -1;
+
+		len -= start_len;
+		data += start_len;
 	}
 	return 0;
 }
author maintainer
#121 lore raw

PATCH 112/800 powerpc/stacktrace: Fix spurious "stale" traces in raise_backtrace_ipi()

In reply to Greg Kroah-Hartman

From: Michael Ellerman <[email protected]>

commit 7c6986ade69e3c81bac831645bc72109cd798a80 upstream.

In raise_backtrace_ipi() we iterate through the cpumask of CPUs, sending each an IPI asking them to do a backtrace, but we don't wait for the backtrace to happen.

We then iterate through the CPU mask again, and if any CPU hasn't done the backtrace and cleared itself from the mask, we print a trace on its behalf, noting that the trace may be "stale".

This works well enough when a CPU is not responding, because in that case it doesn't receive the IPI and the sending CPU is left to print the trace. But when all CPUs are responding we are left with a race between the sending and receiving CPUs, if the sending CPU wins the race then it will erroneously print a trace.

This leads to spurious "stale" traces from the sending CPU, which can then be interleaved messily with the receiving CPU, note the CPU numbers, eg:

  [ 1658.929157][    C7] rcu: Stack dump where RCU GP kthread last ran:
  [ 1658.929223][    C7] Sending NMI from CPU 7 to CPUs 1:
  [ 1658.929303][    C1] NMI backtrace for cpu 1
  [ 1658.929303][    C7] CPU 1 didn't respond to backtrace IPI, inspecting paca.
  [ 1658.929362][    C1] CPU: 1 PID: 325 Comm: kworker/1:1H Tainted: G        W   E     5.13.0-rc2+ #46
  [ 1658.929405][    C7] irq_soft_mask: 0x01 in_mce: 0 in_nmi: 0 current: 325 (kworker/1:1H)
  [ 1658.929465][    C1] Workqueue: events_highpri test_work_fn [test_lockup]
  [ 1658.929549][    C7] Back trace of paca->saved_r1 (0xc0000000057fb400) (possibly stale):
  [ 1658.929592][    C1] NIP:  c00000000002cf50 LR: c008000000820178 CTR: c00000000002cfa0

To fix it, change the logic so that the sending CPU waits 5s for the receiving CPU to print its trace. If the receiving CPU prints its trace successfully then the sending CPU just continues, avoiding any spurious "stale" trace.

This has the added benefit of allowing all CPUs to print their traces in order and avoids any interleaving of their output.

Fixes 5cc05910f26e ("powerpc/64s: Wire up arch_trigger_cpumask_backtrace()")
Cc [email protected] # v4.18+
---
 arch/powerpc/kernel/stacktrace.c |   26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)
arch/powerpc/kernel/stacktrace.c +20 -6
@@ -172,17 +172,31 @@ static void handle_backtrace_ipi(struct
 
 static void raise_backtrace_ipi(cpumask_t *mask)
 {
+	struct paca_struct *p;
 	unsigned int cpu;
+	u64 delay_us;
 
 	for_each_cpu(cpu, mask) {
-		if (cpu == smp_processor_id())
+		if (cpu == smp_processor_id()) {
 			handle_backtrace_ipi(NULL);
-		else
-			smp_send_safe_nmi_ipi(cpu, handle_backtrace_ipi, 5 * USEC_PER_SEC);
-	}
+			continue;
+		}
 
-	for_each_cpu(cpu, mask) {
-		struct paca_struct *p = paca_ptrs[cpu];
+		delay_us = 5 * USEC_PER_SEC;
+
+		if (smp_send_safe_nmi_ipi(cpu, handle_backtrace_ipi, delay_us)) {
+			// Now wait up to 5s for the other CPU to do its backtrace
+			while (cpumask_test_cpu(cpu, mask) && delay_us) {
+				udelay(1);
+				delay_us--;
+			}
+
+			// Other CPU cleared itself from the mask
+			if (delay_us)
+				continue;
+		}
+
+		p = paca_ptrs[cpu];
 
 		cpumask_clear_cpu(cpu, mask);
 
author maintainer
#122 lore raw

PATCH 113/800 x86/gpu: add JasperLake to gen11 early quirks

In reply to Greg Kroah-Hartman

From: Tejas Upadhyay <[email protected]>

commit 31b77c70d9bc04d3b024ea56c129523f9edc1328 upstream.

Let's reserve JSL stolen memory for graphics.

JasperLake is a gen11 platform which is compatible with ICL/EHL changes.

This was missed in commit 24ea098b7c0d ("drm/i915/jsl: Split EHL/JSL platform info and PCI ids")

V2:
- Added maintainer list in cc
- Added patch ref in commit message
V1:
- Added Cc: [email protected]

Fixes 24ea098b7c0d ("drm/i915/jsl: Split EHL/JSL platform info and PCI ids")
Cc <[email protected]> # v5.11+
Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc José Roberto de Souza <[email protected]>
---
 arch/x86/kernel/early-quirks.c |    1 +
 1 file changed, 1 insertion(+)
arch/x86/kernel/early-quirks.c +1 -0
@@ -549,6 +549,7 @@ static const struct pci_device_id intel_
 	INTEL_CNL_IDS(&gen9_early_ops),
 	INTEL_ICL_11_IDS(&gen11_early_ops),
 	INTEL_EHL_IDS(&gen11_early_ops),
+	INTEL_JSL_IDS(&gen11_early_ops),
 	INTEL_TGL_12_IDS(&gen11_early_ops),
 	INTEL_RKL_IDS(&gen11_early_ops),
 	INTEL_ADLS_IDS(&gen11_early_ops),
author maintainer
#123 lore raw

PATCH 114/800 perf/x86/intel: Fix fixed counter check warning for some Alder Lake

In reply to Greg Kroah-Hartman

From: Kan Liang <[email protected]>

commit ee72a94ea4a6d8fa304a506859cd07ecdc0cf5c4 upstream.

For some Alder Lake machine, the below fixed counter check warning may be triggered.

[    2.010766] hw perf events fixed 5 > max(4), clipping!

Current perf unconditionally increases the number of the GP counters and the fixed counters for a big core PMU on an Alder Lake system, because the number enumerated in the CPUID only reflects the common counters. The big core may has more counters. However, Alder Lake may have an alternative configuration. With that configuration,
the X86_FEATURE_HYBRID_CPU is not set. The number of the GP counters and fixed counters enumerated in the CPUID is accurate. Perf mistakenly increases the number of counters. The warning is triggered.

Directly use the enumerated value on the system with the alternative configuration.

---
 arch/x86/events/intel/core.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
arch/x86/events/intel/core.c +7 -2
@@ -6157,8 +6157,13 @@ __init int intel_pmu_init(void)
 		pmu = &x86_pmu.hybrid_pmu[X86_HYBRID_PMU_CORE_IDX];
 		pmu->name = "cpu_core";
 		pmu->cpu_type = hybrid_big;
-		pmu->num_counters = x86_pmu.num_counters + 2;
-		pmu->num_counters_fixed = x86_pmu.num_counters_fixed + 1;
+		if (cpu_feature_enabled(X86_FEATURE_HYBRID_CPU)) {
+			pmu->num_counters = x86_pmu.num_counters + 2;
+			pmu->num_counters_fixed = x86_pmu.num_counters_fixed + 1;
+		} else {
+			pmu->num_counters = x86_pmu.num_counters;
+			pmu->num_counters_fixed = x86_pmu.num_counters_fixed;
+		}
 		pmu->max_pebs_events = min_t(unsigned, MAX_PEBS_EVENTS, pmu->num_counters);
 		pmu->unconstrained = (struct event_constraint)
 					__EVENT_CONSTRAINT(0, (1ULL << pmu->num_counters) - 1,
author maintainer
#124 lore raw

PATCH 115/800 perf/x86/intel: Add more events requires FRONTEND MSR on Sapphire Rapids

In reply to Greg Kroah-Hartman

From: Kan Liang <[email protected]>

commit d18216fafecf2a3a7c2b97086892269d6ab3cd5e upstream.

On Sapphire Rapids, there are two more events 0x40ad and 0x04c2 which rely on the FRONTEND MSR. If the FRONTEND MSR is not set correctly, the count value is not correct.

Update intel_spr_extra_regs[] to support them.

Fixes 61b985e3e775 ("perf/x86/intel: Add perf core PMU support for Sapphire Rapids")
---
 arch/x86/events/intel/core.c |    2 ++
 1 file changed, 2 insertions(+)
arch/x86/events/intel/core.c +2 -0
@@ -280,6 +280,8 @@ static struct extra_reg intel_spr_extra_
 	INTEL_UEVENT_EXTRA_REG(0x012b, MSR_OFFCORE_RSP_1, 0x3fffffffffull, RSP_1),
 	INTEL_UEVENT_PEBS_LDLAT_EXTRA_REG(0x01cd),
 	INTEL_UEVENT_EXTRA_REG(0x01c6, MSR_PEBS_FRONTEND, 0x7fff17, FE),
+	INTEL_UEVENT_EXTRA_REG(0x40ad, MSR_PEBS_FRONTEND, 0x7, FE),
+	INTEL_UEVENT_EXTRA_REG(0x04c2, MSR_PEBS_FRONTEND, 0x8, FE),
 	EVENT_EXTRA_END
 };
 
author maintainer
#125 lore raw

PATCH 116/800 perf/x86/intel: Fix instructions:ppp support in Sapphire Rapids

In reply to Greg Kroah-Hartman

From: Kan Liang <[email protected]>

commit 1d5c7880992a06679585e7e568cc679c0c5fd4f2 upstream.

Perf errors out when sampling instructions:ppp.

$ perf record -e instructions:ppp -- true
Error:
The sys_perf_event_open() syscall returned with 22 (Invalid argument)
for event (instructions:ppp).

The instruction PDIR is only available on the fixed counter 0. The event constraint has been updated to fixed0_constraint in icl_get_event_constraints(). The Sapphire Rapids codes unconditionally error out for the event which is not available on the GP counter 0.

Make the instructions:ppp an exception.

Fixes 61b985e3e775 ("perf/x86/intel: Add perf core PMU support for Sapphire Rapids")
---
 arch/x86/events/intel/core.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/x86/events/intel/core.c +3 -1
@@ -4032,8 +4032,10 @@ spr_get_event_constraints(struct cpu_hw_
 	 * The :ppp indicates the Precise Distribution (PDist) facility, which
 	 * is only supported on the GP counter 0. If a :ppp event which is not
 	 * available on the GP counter 0, error out.
+	 * Exception: Instruction PDIR is only available on the fixed counter 0.
 	 */
-	if (event->attr.precise_ip == 3) {
+	if ((event->attr.precise_ip == 3) &&
+	    !constraint_match(&fixed0_constraint, event->hw.config)) {
 		if (c->idxmsk64 & BIT_ULL(0))
 			return &counter0_constraint;
 
author maintainer
#126 lore raw

PATCH 117/800 loop: Fix missing discard support when using LOOP_CONFIGURE

In reply to Greg Kroah-Hartman

From: Kristian Klausen <[email protected]>

commit 2b9ac22b12a266eb4fec246a07b504dd4983b16b upstream.

Without calling loop_config_discard() the discard flag and parameters aren't set/updated for the loop device and worst-case they could indicate discard support when it isn't the case (ex: if the LOOP_SET_STATUS ioctl was used with a different file prior to LOOP_CONFIGURE).

---
 drivers/block/loop.c |    1 +
 1 file changed, 1 insertion(+)
drivers/block/loop.c +1 -0
@@ -1154,6 +1154,7 @@ static int loop_configure(struct loop_de
 	blk_queue_physical_block_size(lo->lo_queue, bsize);
 	blk_queue_io_min(lo->lo_queue, bsize);
 
+	loop_config_discard(lo);
 	loop_update_rotational(lo);
 	loop_update_dio(lo);
 	loop_sysfs_init(lo);
author maintainer
#127 lore raw

PATCH 118/800 evm: Execute evm_inode_init_security() only when an HMAC key is loaded

In reply to Greg Kroah-Hartman

From: Roberto Sassu <[email protected]>

commit 9eea2904292c2d8fa98df141d3bf7c41ec9dc1b5 upstream.

evm_inode_init_security() requires an HMAC key to calculate the HMAC on initial xattrs provided by LSMs. However, it checks generically whether a key has been loaded, including also public keys, which is not correct as public keys are not suitable to calculate the HMAC.

Originally, support for signature verification was introduced to verify a possibly immutable initial ram disk, when no new files are created, and to switch to HMAC for the root filesystem. By that time, an HMAC key should have been loaded and usable to calculate HMACs for new files.

More recently support for requiring an HMAC key was removed from the kernel, so that signature verification can be used alone. Since this is a legitimate use case, evm_inode_init_security() should not return an error when no HMAC key has been loaded.

This patch fixes this problem by replacing the evm_key_loaded() check with a check of the EVM_INIT_HMAC flag in evm_initialized.

Fixes 26ddabfe96b ("evm: enable EVM when X509 certificate is loaded")
---
 security/integrity/evm/evm_main.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
security/integrity/evm/evm_main.c +3 -2
@@ -521,7 +521,7 @@ void evm_inode_post_setattr(struct dentr
 }
 
 /*
- * evm_inode_init_security - initializes security.evm
+ * evm_inode_init_security - initializes security.evm HMAC value
  */
 int evm_inode_init_security(struct inode *inode,
 				 const struct xattr *lsm_xattr,
@@ -530,7 +530,8 @@ int evm_inode_init_security(struct inode
 	struct evm_xattr *xattr_data;
 	int rc;
 
-	if (!evm_key_loaded() || !evm_protected_xattr(lsm_xattr->name))
+	if (!(evm_initialized & EVM_INIT_HMAC) ||
+	    !evm_protected_xattr(lsm_xattr->name))
 		return 0;
 
 	xattr_data = kzalloc(sizeof(*xattr_data), GFP_NOFS);
author maintainer
#128 lore raw

PATCH 119/800 evm: Refuse EVM_ALLOW_METADATA_WRITES only if an HMAC key is loaded

In reply to Greg Kroah-Hartman

From: Roberto Sassu <[email protected]>

commit 9acc89d31f0c94c8e573ed61f3e4340bbd526d0c upstream.

EVM_ALLOW_METADATA_WRITES is an EVM initialization flag that can be set to temporarily disable metadata verification until all xattrs/attrs necessary to verify an EVM portable signature are copied to the file. This flag is cleared when EVM is initialized with an HMAC key, to avoid that the HMAC is calculated on unverified xattrs/attrs.

Currently EVM unnecessarily denies setting this flag if EVM is initialized with a public key, which is not a concern as it cannot be used to trust xattrs/attrs updates. This patch removes this limitation.

Fixes ae1ba1676b88e ("EVM: Allow userland to permit modification of EVM-protected metadata")
Cc [email protected] # 4.16.x
---
 Documentation/ABI/testing/evm      |   26 ++++++++++++++++++++++++--
 security/integrity/evm/evm_secfs.c |    8 ++++----
 2 files changed, 28 insertions(+), 6 deletions(-)
Documentation/ABI/testing/evm +24 -2
@@ -49,8 +49,30 @@ Description:
 		modification of EVM-protected metadata and
 		disable all further modification of policy
 
-		Note that once a key has been loaded, it will no longer be
-		possible to enable metadata modification.
+		Echoing a value is additive, the new value is added to the
+		existing initialization flags.
+
+		For example, after::
+
+		  echo 2 ><securityfs>/evm
+
+		another echo can be performed::
+
+		  echo 1 ><securityfs>/evm
+
+		and the resulting value will be 3.
+
+		Note that once an HMAC key has been loaded, it will no longer
+		be possible to enable metadata modification. Signaling that an
+		HMAC key has been loaded will clear the corresponding flag.
+		For example, if the current value is 6 (2 and 4 set)::
+
+		  echo 1 ><securityfs>/evm
+
+		will set the new value to 3 (4 cleared).
+
+		Loading an HMAC key is the only way to disable metadata
+		modification.
 
 		Until key loading has been signaled EVM can not create
 		or validate the 'security.evm' xattr, but returns
security/integrity/evm/evm_secfs.c +4 -4
@@ -80,12 +80,12 @@ static ssize_t evm_write_key(struct file
 	if (!i || (i & ~EVM_INIT_MASK) != 0)
 		return -EINVAL;
 
-	/* Don't allow a request to freshly enable metadata writes if
-	 * keys are loaded.
+	/*
+	 * Don't allow a request to enable metadata writes if
+	 * an HMAC key is loaded.
 	 */
 	if ((i & EVM_ALLOW_METADATA_WRITES) &&
-	    ((evm_initialized & EVM_KEY_MASK) != 0) &&
-	    !(evm_initialized & EVM_ALLOW_METADATA_WRITES))
+	    (evm_initialized & EVM_INIT_HMAC) != 0)
 		return -EPERM;
 
 	if (i & EVM_INIT_HMAC) {
author maintainer
#129 lore raw

PATCH 120/800 fuse: Fix crash in fuse_dentry_automount() error path

In reply to Greg Kroah-Hartman

From: Greg Kurz <[email protected]>

commit d92d88f0568e97c437eeb79d9c9609bd8277406f upstream.

If fuse_fill_super_submount() returns an error, the error path triggers a crash:

[   26.206673] BUG: kernel NULL pointer dereference, address: 0000000000000000
[...]
[   26.226362] RIP: 0010:__list_del_entry_valid+0x25/0x90
[...]
[   26.247938] Call Trace:
[   26.248300]  fuse_mount_remove+0x2c/0x70 [fuse]
[   26.248892]  virtio_kill_sb+0x22/0x160 [virtiofs]
[   26.249487]  deactivate_locked_super+0x36/0xa0
[   26.250077]  fuse_dentry_automount+0x178/0x1a0 [fuse]

The crash happens because fuse_mount_remove() assumes that the FUSE mount was already added to list under the FUSE connection, but this only done after fuse_fill_super_submount() has returned success.

This means that until fuse_fill_super_submount() has returned success, the FUSE mount isn't actually owned by the superblock. We should thus reclaim ownership by clearing sb->s_fs_info, which will skip the call to fuse_mount_remove(), and perform rollback, like virtio_fs_get_tree() already does for the root sb.

Fixes bf109c64040f ("fuse: implement crossmounts")
Cc [email protected] # v5.10+
---
 fs/fuse/dir.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
fs/fuse/dir.c +5 -1
@@ -339,8 +339,12 @@ static struct vfsmount *fuse_dentry_auto
 
 	/* Initialize superblock, making @mp_fi its root */
 	err = fuse_fill_super_submount(sb, mp_fi);
-	if (err)
+	if (err) {
+		fuse_conn_put(fc);
+		kfree(fm);
+		sb->s_fs_info = NULL;
 		goto out_put_sb;
+	}
 
 	sb->s_flags |= SB_ACTIVE;
 	fsc->root = dget(sb->s_root);
author maintainer
#130 lore raw

PATCH 121/800 fuse: Fix crash if superblock of submount gets killed early

In reply to Greg Kroah-Hartman

From: Greg Kurz <[email protected]>

commit e3a43f2a95393000778f8f302d48795add2fc4a8 upstream.

As soon as fuse_dentry_automount() does up_write(&sb->s_umount), the superblock can theoretically be killed. If this happens before the submount was added to the &fc->mounts list, fuse_mount_remove() later crashes in list_del_init() because it assumes the submount to be already there.

Add the submount before dropping sb->s_umount to fix the inconsistency. It is okay to nest fc->killsb under sb->s_umount, we already do this on the ->kill_sb() path.

Fixes bf109c64040f ("fuse: implement crossmounts")
Cc [email protected] # v5.10+
---
 fs/fuse/dir.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
fs/fuse/dir.c +4 -4
@@ -346,15 +346,15 @@ static struct vfsmount *fuse_dentry_auto
 		goto out_put_sb;
 	}
 
+	down_write(&fc->killsb);
+	list_add_tail(&fm->fc_entry, &fc->mounts);
+	up_write(&fc->killsb);
+
 	sb->s_flags |= SB_ACTIVE;
 	fsc->root = dget(sb->s_root);
 	/* We are done configuring the superblock, so unlock it */
 	up_write(&sb->s_umount);
 
-	down_write(&fc->killsb);
-	list_add_tail(&fm->fc_entry, &fc->mounts);
-	up_write(&fc->killsb);
-
 	/* Create the submount */
 	mnt = vfs_create_mount(fsc);
 	if (IS_ERR(mnt)) {
author maintainer
#131 lore raw

PATCH 122/800 fuse: Fix infinite loop in sget_fc()

In reply to Greg Kroah-Hartman

From: Greg Kurz <[email protected]>

commit e4a9ccdd1c03b3dc58214874399d24331ea0a3ab upstream.

We don't set the SB_BORN flag on submounts. This is wrong as these superblocks are then considered as partially constructed or dying in the rest of the code and can break some assumptions.

One such case is when you have a virtiofs filesystem with submounts and you try to mount it again : virtio_fs_get_tree() tries to obtain a superblock with sget_fc(). The logic in sget_fc() is to loop until it has either found an existing matching superblock with SB_BORN set or to create a brand new one. It is assumed that a superblock without SB_BORN is transient and the loop is restarted. Forgetting to set SB_BORN on submounts hence causes sget_fc() to retry forever.

Setting SB_BORN requires special care, i.e. a write barrier for super_cache_count() which can check SB_BORN without taking any lock. We should call vfs_get_tree() to deal with that but this requires to have a proper ->get_tree() implementation for submounts, which is a bigger piece of work. Go for a simple bug fix in the meatime.

Fixes bf109c64040f ("fuse: implement crossmounts")
Cc [email protected] # v5.10+
---
 fs/fuse/dir.c |   11 +++++++++++
 1 file changed, 11 insertions(+)
fs/fuse/dir.c +11 -0
@@ -352,6 +352,17 @@ static struct vfsmount *fuse_dentry_auto
 
 	sb->s_flags |= SB_ACTIVE;
 	fsc->root = dget(sb->s_root);
+
+	/*
+	 * FIXME: setting SB_BORN requires a write barrier for
+	 *        super_cache_count(). We should actually come
+	 *        up with a proper ->get_tree() implementation
+	 *        for submounts and call vfs_get_tree() to take
+	 *        care of the write barrier.
+	 */
+	smp_wmb();
+	sb->s_flags |= SB_BORN;
+
 	/* We are done configuring the superblock, so unlock it */
 	up_write(&sb->s_umount);
 
author maintainer
#132 lore raw

PATCH 123/800 fuse: ignore PG_workingset after stealing

In reply to Greg Kroah-Hartman

From: Miklos Szeredi <[email protected]>

commit b89ecd60d38ec042d63bdb376c722a16f92bcb88 upstream.

Fix the "fuse: trying to steal weird page" warning.

Description from Johannes Weiner:

"Think of it as similar to PG_active. It's just another usage/heat
indicator of file and anon pages on the reclaim LRU that, unlike PG_active, persists across deactivation and even reclaim (we store it in the page cache / swapper cache tree until the page refaults).

So if fuse accepts pages that can legally have PG_active set, PG_workingset is fine too."

Fixes 1899ad18c607 ("mm: workingset: tell cache transitions from workingset thrashing")
Cc <[email protected]> # v4.20
---
 fs/fuse/dev.c |    1 +
 1 file changed, 1 insertion(+)
fs/fuse/dev.c +1 -0
@@ -783,6 +783,7 @@ static int fuse_check_page(struct page *
 	       1 << PG_uptodate |
 	       1 << PG_lru |
 	       1 << PG_active |
+	       1 << PG_workingset |
 	       1 << PG_reclaim |
 	       1 << PG_waiters))) {
 		dump_page(page, "fuse: trying to steal weird page");
author maintainer
#133 lore raw

PATCH 124/800 fuse: check connected before queueing on fpq->io

In reply to Greg Kroah-Hartman

From: Miklos Szeredi <[email protected]>

commit 80ef08670d4c28a06a3de954bd350368780bcfef upstream.

A request could end up on the fpq->io list after fuse_abort_conn() has reset fpq->connected and aborted requests on that list:

Thread-1 Thread-2
======== ========
->fuse_simple_request() ->shutdown
->__fuse_request_send()

    ->queue_request()		->fuse_abort_conn()
->fuse_dev_do_read()                ->acquire(fpq->lock)
  ->wait_for(fpq->lock) 	  ->set err to all req's in fpq->io
				  ->release(fpq->lock)

->acquire(fpq->lock)
->add req to fpq->io

After the userspace copy is done the request will be ended, but req->out.h.error will remain uninitialized. Also the copy might block despite being already aborted.

Fix both issues by not allowing the request to be queued on the fpq->io list after fuse_abort_conn() has processed this list.

Fixes fd22d62ed0c3 ("fuse: no fc->lock for iqueue parts")
Cc <[email protected]> # v4.2
---
 fs/fuse/dev.c |    9 +++++++++
 1 file changed, 9 insertions(+)
fs/fuse/dev.c +9 -0
@@ -1272,6 +1272,15 @@ static ssize_t fuse_dev_do_read(struct f
 		goto restart;
 	}
 	spin_lock(&fpq->lock);
+	/*
+	 *  Must not put request on fpq->io queue after having been shut down by
+	 *  fuse_abort_conn()
+	 */
+	if (!fpq->connected) {
+		req->out.h.error = err = -ECONNABORTED;
+		goto out_end;
+
+	}
 	list_add(&req->list, &fpq->io);
 	spin_unlock(&fpq->lock);
 	cs->req = req;
author maintainer
#134 lore raw

PATCH 125/800 fuse: reject internal errno

In reply to Greg Kroah-Hartman

From: Miklos Szeredi <[email protected]>

commit 49221cf86d18bb66fe95d3338cb33bd4b9880ca5 upstream.

Don't allow userspace to report errors that could be kernel-internal.

Fixes 334f485df85a ("[PATCH] FUSE - device functions")
Cc <[email protected]> # v2.6.14
---
 fs/fuse/dev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/fuse/dev.c +1 -1
@@ -1867,7 +1867,7 @@ static ssize_t fuse_dev_do_write(struct
 	}
 
 	err = -EINVAL;
-	if (oh.error <= -1000 || oh.error > 0)
+	if (oh.error <= -512 || oh.error > 0)
 		goto copy_finish;
 
 	spin_lock(&fpq->lock);
author maintainer
#135 lore raw

PATCH 126/800 thermal/cpufreq_cooling: Update offline CPUs per-cpu thermal_pressure

In reply to Greg Kroah-Hartman

From: Lukasz Luba <[email protected]>

[ Upstream commit 2ad8ccc17d1e4270cf65a3f2a07a7534aa23e3fb ]

The thermal pressure signal gives information to the scheduler about reduced CPU capacity due to thermal. It is based on a value stored in a per-cpu 'thermal_pressure' variable. The online CPUs will get the new value there, while the offline won't. Unfortunately, when the CPU is back online, the value read from per-cpu variable might be wrong (stale data). This might affect the scheduler decisions, since it sees the CPU capacity differently than what is actually available.

Fix it by making sure that all online+offline CPUs would get the proper value in their per-cpu variable when thermal framework sets capping.

Fixes f12e4f66ab6a3 ("thermal/cpu-cooling: Update thermal pressure in case of a maximum frequency capping")
---
 drivers/thermal/cpufreq_cooling.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/cpufreq_cooling.c +1 -1
index eeb4e4b76c0b..43b1ae8a7789 100644
@@ -478,7 +478,7 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev,
 	ret = freq_qos_update_request(&cpufreq_cdev->qos_req, frequency);
 	if (ret >= 0) {
 		cpufreq_cdev->cpufreq_state = state;
-		cpus = cpufreq_cdev->policy->cpus;
+		cpus = cpufreq_cdev->policy->related_cpus;
 		max_capacity = arch_scale_cpu_capacity(cpumask_first(cpus));
 		capacity = frequency * max_capacity;
 		capacity /= cpufreq_cdev->policy->cpuinfo.max_freq;
Signature · 1 line
2.30.2
author maintainer
#136 lore raw

PATCH 127/800 spi: Make of_register_spi_device also set the fwnode

In reply to Greg Kroah-Hartman

From: Charles Keepax <[email protected]>

[ Upstream commit 0e793ba77c18382f08e440260fe72bc6fce2a3cb ]

Currently, the SPI core doesn't set the struct device fwnode pointer when it creates a new SPI device. This means when the device is registered the fwnode is NULL and the check in device_add which sets the fwnode->dev pointer is skipped. This wasn't previously an issue, however these two patches:

commit 4731210c09f5 ("gpiolib: Bind gpio_device to a driver to enable fw_devlink=on by default")
commit ced2af419528 ("gpiolib: Don't probe gpio_device if it's not the primary device")

Added some code to the GPIO core which relies on using that fwnode->dev pointer to determine if a driver is bound to the fwnode and if not bind a stub GPIO driver. This means the GPIO providers behind SPI will get both the expected driver and this stub driver causing the stub driver to fail if it attempts to request any pin configuration. For example on my system:

madera-pinctrl madera-pinctrl: pin gpio5 already requested by madera-pinctrl; cannot claim for gpiochip3 madera-pinctrl madera-pinctrl: pin-4 (gpiochip3) status -22
madera-pinctrl madera-pinctrl: could not request pin 4 (gpio5) from group aif1 on device madera-pinctrl gpio_stub_drv gpiochip3: Error applying setting, reverse things back
gpio_stub_drv: probe of gpiochip3 failed with error -22

The firmware node on the device created by the GPIO framework is set through the of_node pointer hence things generally actually work, however that fwnode->dev is never set, as the check was skipped at device_add time. This fix appears to match how the I2C subsystem handles the same situation.

---
 drivers/spi/spi.c | 1 +
 1 file changed, 1 insertion(+)
drivers/spi/spi.c +1 -0
index e353b7a9e54e..d83f91a6ab13 100644
@@ -2057,6 +2057,7 @@ of_register_spi_device(struct spi_controller *ctlr, struct device_node *nc)
 	/* Store a pointer to the node in the device structure */
 	of_node_get(nc);
 	spi->dev.of_node = nc;
+	spi->dev.fwnode = of_fwnode_handle(nc);
 
 	/* Register the new device */
 	rc = spi_add_device(spi);
Signature · 1 line
2.30.2