6.1.28-rc1 review
Subsystems (10)
Greg Kroah-Hartman
maintainerPATCH 604/611 block/blk-iocost (gcc13): keep large values in a new enum
In reply to Greg Kroah-HartmanFrom: Jiri Slaby (SUSE) <[email protected]>
commit ff1cc97b1f4c10db224f276d9615b22835b8c424 upstream.
Since gcc13, each member of an enum has the same type as the enum [1]. And that is inherited from its members. Provided:
VTIME_PER_SEC_SHIFT = 37,
VTIME_PER_SEC = 1LLU << VTIME_PER_SEC_SHIFT,
...
AUTOP_CYCLE_NSEC = 10LLU * NSEC_PER_SEC,
the named type is unsigned long.
This generates warnings with gcc-13:
block/blk-iocost.c: In function 'ioc_weight_prfill':
block/blk-iocost.c:3037:37: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int'
block/blk-iocost.c: In function 'ioc_weight_show':
block/blk-iocost.c:3047:34: error: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int'
So split the anonymous enum with large values to a separate enum, so that they don't affect other members.
[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36113
--- block/blk-iocost.c | 2 ++ 1 file changed, 2 insertions(+)
block/blk-iocost.c +2 -0
@@ -232,7 +232,9 @@ enum {/* 1/64k is granular enough and can easily be handled w/ u32 */ WEIGHT_ONE = 1 << 16, +}; +enum {/* * As vtime is used to calculate the cost of each IO, it needs to * be fairly high precision. For example, it should be able to
Greg Kroah-Hartman
maintainerPATCH 1/611 ASOC: Intel: sof_sdw: add quirk for Intel Rooks County NUC M15
In reply to Greg Kroah-HartmanFrom: Eugene Huang <[email protected]>
[ Upstream commit 3c728b1bc5b99c5275ac5c7788ef814c0e51ef54 ]
Same quirks as the 'Bishop County' NUC M15, except the rt711 is in the 'JD2 100K' jack detection mode.
--- sound/soc/intel/boards/sof_sdw.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
sound/soc/intel/boards/sof_sdw.c +11 -0
@@ -213,6 +213,17 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {SOF_SDW_PCH_DMIC | RT711_JD1), }, + { +/* NUC15 'Rooks County' LAPRC510 and LAPRC710 skews */ + .callback = sof_sdw_quirk_cb, + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Intel(R) Client Systems" ), + DMI_MATCH(DMI_PRODUCT_NAME, "LAPRC"), + }, + .driver_data = (void *)(SOF_SDW_TGL_HDMI | +SOF_SDW_PCH_DMIC | + RT711_JD2_100K), + }, /* TigerLake-SDCA devices */ { .callback = sof_sdw_quirk_cb,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainercover 6.1.28-rc1 review
This is the start of the stable review cycle for the 6.1.28 release. There are 611 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, 10 May 2023 09:42:40 +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/v6.x/stable-review/patch-6.1.28-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-6.1.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 6.1.28-rc1
Xingui Yang <[email protected]>
scsi: libsas: Grab the ATA port lock in sas_ata_device_link_abort()
Thomas Gleixner <[email protected]>
debugobject: Ensure pool refill (again)
Jiri Slaby (SUSE) <[email protected]>
drm/amd/display (gcc13): fix enum mismatch
Jan Sokolowski <[email protected]>
i40e: use int for i40e_status
Jan Sokolowski <[email protected]>
i40e: Remove string printing for i40e_status
Jan Sokolowski <[email protected]>
i40e: Remove unused i40e status codes
Jiri Slaby (SUSE) <[email protected]>
sfc (gcc13): synchronize ef100_enqueue_skb()'s return type
Jiri Slaby (SUSE) <[email protected]>
block/blk-iocost (gcc13): keep large values in a new enum
Adrian Hunter <[email protected]>
perf intel-pt: Fix CYC timestamps after standalone CBR
Adrian Hunter <[email protected]>
perf auxtrace: Fix address filter entire kernel size
Jiri Slaby (SUSE) <[email protected]>
wifi: ath11k: synchronize ath11k_mac_he_gi_to_nl80211_he_gi()'s return type
Jiri Slaby (SUSE) <[email protected]>
bonding (gcc13): synchronize bond_{a,t}lb_xmit() types
Jiri Slaby (SUSE) <[email protected]>
thunderbolt: Use correct type in tb_port_is_clx_enabled() prototype
Paulo Alcantara <[email protected]>
cifs: protect session status check in smb2_reconnect()
Paulo Alcantara <[email protected]>
cifs: fix potential use-after-free bugs in TCP_Server_Info::hostname
Arnd Bergmann <[email protected]>
blk-iocost: avoid 64-bit division in ioc_timer_fn
Li Lingfeng <[email protected]>
dm: don't lock fs when the map is NULL in process of resume
Mike Snitzer <[email protected]>
dm ioctl: fix nested locking in table_clear() to remove deadlock concern
Mikulas Patocka <[email protected]>
dm flakey: fix a crash with invalid table line
Mike Snitzer <[email protected]>
dm integrity: call kmem_cache_destroy() in dm_integrity_init() error path
Mike Snitzer <[email protected]>
dm clone: call kmem_cache_destroy() in dm_clone_init() error path
Yeongjin Gil <[email protected]>
dm verity: fix error handling for check_at_most_once on FEC
Cindy Lu <[email protected]>
vhost_vdpa: fix unmap process in no-batch mode
Lorenzo Stoakes <[email protected]>
mm/mempolicy: correctly update prev when policy is equal on mbind
Hugh Dickins <[email protected]>
ia64: fix an addr to taddr in huge_pte_offset()
Stefan Haberland <[email protected]>
s390/dasd: fix hanging blockdevice after request requeue
Qu Wenruo <[email protected]>
btrfs: scrub: reject unsupported scrub flags
Peng Liu <[email protected]>
scripts/gdb: fix lx-timerlist for Python3
Quentin Schulz <[email protected]>
clk: rockchip: rk3399: allow clk_cifout to force clk_cifout_src to reparent
Conor Dooley <[email protected]>
clk: microchip: fix potential UAF in auxdev release callback
Ping-Ke Shih <[email protected]>
wifi: rtw89: fix potential race condition between napi_init and napi_enable
Bitterblue Smith <[email protected]>
wifi: rtl8xxxu: RTL8192EU always needs full init
Tanmay Shah <[email protected]>
mailbox: zynqmp: Fix typo in IPI documentation
Marco Elver <[email protected]>
kcsan: Avoid READ_ONCE() in read_instrumented_memory()
Tanmay Shah <[email protected]>
mailbox: zynqmp: Fix IPI isr handling
Tudor Ambarus <[email protected]>
mtd: spi-nor: core: Update flash's current address mode when changing address mode
Michael Walle <[email protected]>
mtd: core: fix error path for nvmem provider
Michael Walle <[email protected]>
mtd: core: fix nvmem error reporting
Michael Walle <[email protected]>
mtd: core: provide unique name for nvmem device, take two
Mark Rutland <[email protected]>
kasan: hw_tags: avoid invalid virt_to_page()
Jan Kara <[email protected]>
md/raid5: Improve performance for sequential IO
Li Nan <[email protected]>
md/raid10: fix null-ptr-deref in raid10_sync_request
Christoph Böhmwalder <[email protected]>
drbd: correctly submit flush bio on barrier
Jan Kara <[email protected]>
mm: do not reclaim private data from pinned page
Ryusuke Konishi <[email protected]>
nilfs2: fix infinite loop in nilfs_mdt_get_block()
Ryusuke Konishi <[email protected]>
nilfs2: do not write dirty data after degenerating to read-only
Kai-Heng Feng <[email protected]>
ALSA: hda/realtek: Fix mute and micmute LEDs for an HP laptop
Caleb Harper <[email protected]>
ALSA: hda/realtek: support HP Pavilion Aero 13-be0xxx Mute LED
Mark Asselstine <[email protected]>
ALSA: hda/realtek: Add quirk for ASUS UM3402YAR using CS35L41
Vitaly Rodionov <[email protected]>
ALSA: hda/realtek: Add quirk for ThinkPad P1 Gen 6
Geraldo Nascimento <[email protected]>
ALSA: usb-audio: Add quirk for Pioneer DDJ-800
Helge Deller <[email protected]>
parisc: Ensure page alignment in flush functions
Helge Deller <[email protected]>
parisc: Fix argument pointer in real64_call_asm()
Marc Dionne <[email protected]>
afs: Avoid endless loop if file is larger than expected
David Howells <[email protected]>
afs: Fix getattr to report server i_size on dirs, not local size
Marc Dionne <[email protected]>
afs: Fix updating of i_size with dv jump from server
Chen Yu <[email protected]>
PM: hibernate: Do not get block device exclusively in test_resume mode
Chen Yu <[email protected]>
PM: hibernate: Turn snapshot_test into global variable
Hans de Goede <[email protected]>
ACPI: PM: Do not turn of unused power resources on the Toshiba Click Mini
Dan Carpenter <[email protected]>
hte: tegra-194: Fix off by one in tegra_hte_map_to_line_id()
Arnd Bergmann <[email protected]>
hte: tegra: fix 'struct of_device_id' build error
Charles Keepax <[email protected]>
mfd: arizona-spi: Add missing MODULE_DEVICE_TABLE
Colin Foster <[email protected]>
mfd: ocelot-spi: Fix unsupported bulk read
Matthias Schiffer <[email protected]>
mfd: tqmx86: Correct board names for TQMxE39x
Matthias Schiffer <[email protected]>
mfd: tqmx86: Specify IO port register range more precisely
Matthias Schiffer <[email protected]>
mfd: tqmx86: Do not access I2C_DETECT register through io_base
Kang Chen <[email protected]>
thermal/drivers/mediatek: Use devm_of_iomap to avoid resource leak in mtk_thermal_probe
Hans Verkuil <[email protected]>
pinctrl-bcm2835.c: fix race condition when setting gpio dir
Claudiu Beznea <[email protected]>
dmaengine: at_xdmac: do not enable all cyclic channels
Shunsuke Mie <[email protected]>
dmaengine: dw-edma: Fix to enable to issue dma request on DMA processing
Shunsuke Mie <[email protected]>
dmaengine: dw-edma: Fix to change for continuous transfer
Dmitry Baryshkov <[email protected]>
dma: gpi: remove spurious unlock in gpi_ch_init
Siddharth Vadapalli <[email protected]>
phy: ti: j721e-wiz: Fix unreachable code in wiz_mode_select()
Gaosheng Cui <[email protected]>
phy: tegra: xusb: Add missing tegra_xusb_port_unregister for usb2_port and ulpi_port
Pierre-Louis Bossart <[email protected]>
soundwire: intel: don't save hw_params for use in prepare
Pierre-Louis Bossart <[email protected]>
soundwire: cadence: rename sdw_cdns_dai_dma_data as sdw_cdns_dai_runtime
AngeloGioacchino Del Regno <[email protected]>
pwm: mtk-disp: Configure double buffering before reading in .get_state()
AngeloGioacchino Del Regno <[email protected]>
pwm: mtk-disp: Disable shadow registers before setting backlight values
H. Nikolaus Schaller <[email protected]>
leds: tca6507: Fix error handling of using fwnode_property_read_string
Christophe JAILLET <[email protected]>
dmaengine: mv_xor_v2: Fix an error code.
Arınç ÜNAL <[email protected]>
pinctrl: ralink: reintroduce ralink,rt2880-pinmux compatible string
Randy Dunlap <[email protected]>
leds: TI_LMU_COMMON: select REGMAP instead of depending on it
Geert Uytterhoeven <[email protected]>
pinctrl: renesas: r8a779g0: Fix ERROROUTC function names
Geert Uytterhoeven <[email protected]>
pinctrl: renesas: r8a779g0: Fix Group 6/7 pin functions
Geert Uytterhoeven <[email protected]>
pinctrl: renesas: r8a779g0: Fix Group 4/5 pin functions
Phong Hoang <[email protected]>
pinctrl: renesas: r8a779f0: Fix tsn1_avtp_pps pin group
Hai Pham <[email protected]>
pinctrl: renesas: r8a779a0: Remove incorrect AVB[01] pinmux configuration
Ye Bin <[email protected]>
ext4: fix use-after-free read in ext4_find_extent for bigalloc + inline
Zhihao Cheng <[email protected]>
ext4: fix i_disksize exceeding i_size problem in paritally written case
Bharath SM <[email protected]>
SMB3: Close deferred file handles in case of handle lease break
Bharath SM <[email protected]>
SMB3: Add missing locks to protect deferred close file list
Geert Uytterhoeven <[email protected]>
timekeeping: Fix references to nonexistent ktime_get_fast_ns()
Stafford Horne <[email protected]>
openrisc: Properly store r31 to pt_regs on unhandled exceptions
Qinrun Dai <[email protected]>
clocksource/drivers/davinci: Fix memory leak in davinci_timer_register when init fails
Mark Zhang <[email protected]>
RDMA/mlx5: Use correct device num_ports when modify DC
Dai Ngo <[email protected]>
SUNRPC: remove the maximum number of retries in call_bind_status
Mark Bloch <[email protected]>
RDMA/mlx5: Fix flow counter query via DEVX
Avihai Horon <[email protected]>
RDMA/mlx5: Check pcie_relaxed_ordering_enabled() in UMR
Michael Kelley <[email protected]>
swiotlb: fix debugfs reporting of reserved memory pools
Doug Berger <[email protected]>
swiotlb: relocate PageHighMem test away from rmem_swiotlb_setup
Miaoqian Lin <[email protected]>
Input: raspberrypi-ts - fix refcount leak in rpi_ts_probe
Konrad Dybcio <[email protected]>
clk: qcom: dispcc-qcm2290: Remove inexistent DSI1PHY clk
Dmitry Baryshkov <[email protected]>
clk: qcom: dispcc-qcm2290: get rid of test clock
Dmitry Baryshkov <[email protected]>
clk: qcom: gcc-sm8350: fix PCIe PIPE clocks handling
Mohammad Rafi Shaik <[email protected]>
clk: qcom: lpassaudiocc-sc7280: Add required gdsc power domain clks in lpass_cc_sc7280_desc
Srinivasa Rao Mandadapu <[email protected]>
clk: qcom: lpasscc-sc7280: Skip qdsp6ss clock registration
Jerry Snitselaar <[email protected]>
iommu/amd: Set page size bitmap during V2 domain allocation
Trond Myklebust <[email protected]>
NFSv4.1: Always send a RECLAIM_COMPLETE after establishing lease
Peng Fan <[email protected]>
clk: imx: imx8ulp: Fix XBAR_DIVBUS and AD_SLOW clock parents
Peng Fan <[email protected]>
clk: imx: fracn-gppll: disable hardware select control
Peng Fan <[email protected]>
clk: imx: fracn-gppll: fix the rate table
Patrick Kelsey <[email protected]>
IB/hfi1: Fix bugs with non-PAGE_SIZE-end multi-iovec user SDMA requests
Patrick Kelsey <[email protected]>
IB/hfi1: Fix SDMA mmu_rb_node not being evicted in LRU order
Saravanan Vajravel <[email protected]>
RDMA/srpt: Add a check for valid 'mad_agent' pointer
Mark Zhang <[email protected]>
RDMA/cm: Trace icm_send_rej event before the cm state is reset
Chris Morgan <[email protected]>
power: supply: rk817: Fix low SOC bugs
Konrad Dybcio <[email protected]>
clk: qcom: gcc-sm6115: Mark RCGs shared where applicable
Tetsuo Handa <[email protected]>
RDMA/siw: Remove namespace check from siw_netdev_event()
Clément Léger <[email protected]>
clk: add missing of_node_put() in "assigned-clocks" property parsing
Sebastian Reichel <[email protected]>
power: supply: generic-adc-battery: fix unit scaling
Yong Wu <[email protected]>
iommu/mediatek: Set dma_mask for PGTABLE_PA_35_EN
Zeng Heng <[email protected]>
fs/ntfs3: Fix slab-out-of-bounds read in hdr_delete_de()
ZhangPeng <[email protected]>
fs/ntfs3: Fix OOB read in indx_insert_into_buffer
ZhangPeng <[email protected]>
fs/ntfs3: Fix null-ptr-deref on inode->i_op in ntfs_lookup()
Jiasheng Jiang <[email protected]>
fs/ntfs3: Add check for kmemdup
Chen Zhongjin <[email protected]>
fs/ntfs3: Fix memory leak if ntfs_read_mft failed
Cheng Xu <[email protected]>
RDMA/erdma: Use fixed hardware page size
Dhruva Gole <[email protected]>
rtc: k3: handle errors while enabling wake irq
Martin Blumenstingl <[email protected]>
rtc: meson-vrtc: Use ktime_get_real_ts64() to get the current time
Dan Carpenter <[email protected]>
RDMA/mlx4: Prevent shift wrapping in set_user_sq_size()
Krzysztof Kozlowski <[email protected]>
rtc: omap: include header for omap_rtc_power_off_program prototype
Petr Mladek <[email protected]>
workqueue: Fix hung time report of worker pools
Konrad Dybcio <[email protected]>
clk: qcom: gcc-qcm2290: Fix up gcc_sdcc2_apps_clk_src
Natalia Petrova <[email protected]>
RDMA/rdmavt: Delete unnecessary NULL check
AngeloGioacchino Del Regno <[email protected]>
clk: mediatek: mt8135: Properly use CLK_IS_CRITICAL flag
AngeloGioacchino Del Regno <[email protected]>
clk: mediatek: mt7622: Properly use CLK_IS_CRITICAL flag
AngeloGioacchino Del Regno <[email protected]>
clk: mediatek: Consistently use GATE_MTK() macro
AngeloGioacchino Del Regno <[email protected]>
clk: mediatek: mt2712: Add error handling to clk_mt2712_apmixed_probe()
Daniil Dulov <[email protected]>
RDMA/siw: Fix potential page_array out of range access
Kang Chen <[email protected]>
IB/hifi1: add a null check of kzalloc_node in hfi1_ipoib_txreq_init
Claudiu Beznea <[email protected]>
clk: at91: clk-sam9x60-pll: fix return value check
Beau Belgrave <[email protected]>
tracing/user_events: Ensure write index cannot be negative
Schspa Shi <[email protected]>
sched/rt: Fix bad task migration for rt tasks
Alexandre Ghiti <[email protected]>
riscv: Fix ptdump when KASAN is enabled
Josh Poimboeuf <[email protected]>
Revert "objtool: Support addition to set CFA base"
Yang Jihong <[email protected]>
perf/core: Fix hardlockup failure caused by perf throttle
Libo Chen <[email protected]>
sched/fair: Fix inaccurate tally of ttwu_move_affine
Nathan Lynch <[email protected]>
powerpc/rtas: use memmove for potentially overlapping buffer copy
Randy Dunlap <[email protected]>
macintosh: via-pmu-led: requires ATA to be set
Randy Dunlap <[email protected]>
powerpc/sysdev/tsi108: fix resource printk format warnings
Randy Dunlap <[email protected]>
powerpc/wii: fix resource printk format warnings
Randy Dunlap <[email protected]>
powerpc/mpc512x: fix resource printk format warning
Christophe Leroy <[email protected]>
powerpc/perf: Properly detect mpc7450 family
Liang He <[email protected]>
macintosh/windfarm_smu_sat: Add missing of_node_put()
Kajol Jain <[email protected]>
selftests/powerpc/pmu: Fix sample field check in the mmcra_thresh_marked_sample_test
Christophe JAILLET <[email protected]>
fbdev: mmp: Fix deferred clk handling in mmphw_probe()
Dhruva Gole <[email protected]>
spi: bcm63xx: remove PM_SLEEP based conditional compilation
Albert Huang <[email protected]>
virtio_ring: don't update event idx on get_buf
Jishnu Prakash <[email protected]>
spmi: Add a check for remove callback when removing a SPMI driver
Philipp Hortmann <[email protected]>
staging: rtl8192e: Fix W_DISABLE# does not work after stop/start
Dhruva Gole <[email protected]>
spi: cadence-quadspi: use macro DEFINE_SIMPLE_DEV_PM_OPS
Florian Fainelli <[email protected]>
serial: 8250: Add missing wakeup event reporting
Shenwei Wang <[email protected]>
tty: serial: fsl_lpuart: adjust buffer length to the intended size
Dan Carpenter <[email protected]>
firmware: stratix10-svc: Fix an NULL vs IS_ERR() bug in probe
Chunfeng Yun <[email protected]>
usb: mtu3: fix kernel panic at qmu transfer done irq handler
Yinhao Hu <[email protected]>
usb: chipidea: fix missing goto in ci_hdrc_probe
Jon Hunter <[email protected]>
usb: gadget: tegra-xudc: Fix crash in vbus_draw
John Paul Adrian Glaubitz <[email protected]>
sh: sq: Fix incorrect element size for allocating bitmap buffer
Kevin Brodsky <[email protected]>
uapi/linux/const.h: prefer ISO-friendly __typeof__
Florian Fainelli <[email protected]>
scripts/gdb: raise error with reduced debugging information
Lars-Peter Clausen <[email protected]>
i2c: xiic: xiic_xfer(): Fix runtime PM leak on error path
Lars-Peter Clausen <[email protected]>
i2c: cadence: cdns_i2c_master_xfer(): Fix runtime PM leak on error path
Dhruva Gole <[email protected]>
spi: cadence-quadspi: fix suspend-resume implementations
Konrad Dybcio <[email protected]>
drm/panel: novatek-nt35950: Only unregister DSI1 if it exists
Alex Williamson <[email protected]>
PCI/PM: Extend D3hot delay for NVIDIA HDA controllers
Liliang Ye <[email protected]>
ASoC: fsl_mqs: move of_node_put() to the correct location
Konrad Dybcio <[email protected]>
drm/panel: novatek-nt35950: Improve error handling
Suzuki K Poulose <[email protected]>
coresight: etm_pmu: Set the module field
Pierre Gondois <[email protected]>
cacheinfo: Check sib_leaf in cache_leaves_are_shared()
Basavaraj Natikar <[email protected]>
HID: amd_sfh: Handle "no sensors" enabled for SFH1.1
Basavaraj Natikar <[email protected]>
HID: amd_sfh: Increase sensor command timeout for SFH1.1
Basavaraj Natikar <[email protected]>
HID: amd_sfh: Correct the stop all command
Basavaraj Natikar <[email protected]>
HID: amd_sfh: Add support for shutdown operation
Basavaraj Natikar <[email protected]>
HID: amd_sfh: Fix illuminance value
Basavaraj Natikar <[email protected]>
HID: amd_sfh: Correct the sensor enable and disable command
Basavaraj Natikar <[email protected]>
HID: amd_sfh: Correct the structure fields
Florian Fainelli <[email protected]>
scripts/gdb: bail early if there are no generic PD
Florian Fainelli <[email protected]>
scripts/gdb: bail early if there are no clocks
Randy Dunlap <[email protected]>
ia64: salinfo: placate defined-but-not-used warning
Randy Dunlap <[email protected]>
ia64: mm/contig: fix section mismatch warning/error
Kuppuswamy Sathyanarayanan <[email protected]>
PCI/EDR: Clear Device Status after EDR error recovery
Miquel Raynal <[email protected]>
of: Fix modalias string generation
Dae R. Jeong <[email protected]>
vmci_host: fix a race condition in vmci_host_poll() causing GPF
Christophe Leroy <[email protected]>
spi: fsl-spi: Fix CPM/QE mode Litte Endian
Johan Hovold <[email protected]>
interconnect: qcom: rpm: drop bogus pm domain attach
Uwe Kleine-König <[email protected]>
spi: qup: Don't skip cleanup in remove's error path
Randy Dunlap <[email protected]>
linux/vt_buffer.h: allow either builtin or modular for macros
Cristian Ciocaltea <[email protected]>
ASoC: es8316: Handle optional IRQ assignment
H. Nikolaus Schaller <[email protected]>
PCI: imx6: Install the fault handler only on compatible match
Daniel Baluta <[email protected]>
ASoC: soc-compress: Inherit atomicity from DAI link for Compress FE
Zheng Wang <[email protected]>
usb: gadget: udc: renesas_usb3: Fix use after free bug in renesas_usb3_remove due to race condition
Uwe Kleine-König <[email protected]>
spi: imx: Don't skip cleanup in remove's error path
Uwe Kleine-König <[email protected]>
spi: atmel-quadspi: Free resources even if runtime resume failed in .remove()
Uwe Kleine-König <[email protected]>
spi: atmel-quadspi: Don't leak clk enable count in pm resume
Doug Berger <[email protected]>
serial: 8250_bcm7271: Fix arbitration handling
Krzysztof Kozlowski <[email protected]>
iio: light: max44009: add missing OF device matching
Marco Pagani <[email protected]>
fpga: bridge: fix kernel-doc parameter description
Marek Vasut <[email protected]>
serial: stm32: Re-assert RTS/DE GPIO in RS485 mode only if more data are transmitted
Prashanth K <[email protected]>
usb: dwc3: gadget: Change condition for processing suspend event
Wolfram Sang <[email protected]>
usb: host: xhci-rcar: remove leftover quirk handling
John Stultz <[email protected]>
pstore: Revert pmsg_lock back to a normal mutex
Hans de Goede <[email protected]>
drivers: staging: rtl8723bs: Fix locking in rtw_scan_timeout_handler()
Hans de Goede <[email protected]>
drivers: staging: rtl8723bs: Fix locking in _rtw_join_timeout_handler()
Lucas Tanure <[email protected]>
ASoC: cs35l41: Only disable internal boost
Randy Dunlap <[email protected]>
ipmi: ASPEED_BT_IPMI_BMC: select REGMAP_MMIO instead of depending on it
Kuniyuki Iwashima <[email protected]>
tcp/udp: Fix memleaks of sk and zerocopy skbs with TX timestamp.
Gencen Gan <[email protected]>
net: amd: Fix link leak when verifying config failed
Kuniyuki Iwashima <[email protected]>
netlink: Use copy_to_user() for optval in netlink_getsockopt().
Liu Jian <[email protected]>
Revert "Bluetooth: btsdio: fix use after free bug in btsdio_remove due to unfinished work"
Ziyang Xuan <[email protected]>
ipv4: Fix potential uninit variable access bug in __ip_make_skb()
Davide Caratti <[email protected]>
net/sched: sch_fq: fix integer overflow of "credit"
Dan Carpenter <[email protected]>
net: dpaa: Fix uninitialized variable in dpaa_stop()
Florian Westphal <[email protected]>
netfilter: nf_tables: don't write table validation state without mutex
Stanislav Fomichev <[email protected]>
bpf: Don't EFAULT for getsockopt with optval=NULL
Alexei Starovoitov <[email protected]>
bpf: Fix race between btf_put and btf_idr walk.
Yan Wang <[email protected]>
net: stmmac:fix system hang when setting up tag_8021q VLAN for DSA ports
Aya Levin <[email protected]>
net/mlx5e: Nullify table pointer when failing to create
Moshe Shemesh <[email protected]>
net/mlx5: Use recovery timeout on sync reset flow
Moshe Shemesh <[email protected]>
Revert "net/mlx5: Remove "recovery" arg from mlx5_load_one() function"
Jiri Pirko <[email protected]>
net/mlx5: Suspend auxiliary devices only in case of PCI device suspend
Jiri Pirko <[email protected]>
net/mlx5: Remove "recovery" arg from mlx5_load_one() function
Roi Dayan <[email protected]>
net/mlx5e: Fix error flow in representor failing to add vport rx rule
Chris Mi <[email protected]>
net/mlx5: E-switch, Don't destroy indirect table in split rule
Chris Mi <[email protected]>
net/mlx5: E-switch, Create per vport table based on devlink encap mode
Vlad Buslov <[email protected]>
net/mlx5e: Don't clone flow post action attributes second time
Joe Damato <[email protected]>
ixgbe: Enable setting RSS table to default values
Joe Damato <[email protected]>
ixgbe: Allow flow hash to be set via ethtool
Johannes Berg <[email protected]>
wifi: iwlwifi: fw: fix memory leak in debugfs
Tzung-Bi Shih <[email protected]>
netfilter: conntrack: fix wrong ct->timeout value
Pablo Neira Ayuso <[email protected]>
netfilter: conntrack: restore IPS_CONFIRMED out of nf_conntrack_hash_check_insert()
Johannes Berg <[email protected]>
wifi: iwlwifi: mvm: check firmware response size
Ryder Lee <[email protected]>
wifi: mt76: connac: fix txd multicast rate setting
Quan Zhou <[email protected]>
wifi: mt76: mt7921e: stop chip reset worker in unregister hook
Quan Zhou <[email protected]>
wifi: mt76: mt7921e: improve reliability of dma reset
Jiefeng Li <[email protected]>
wifi: mt76: mt7921: fix missing unwind goto in `mt7921u_probe`
Sean Wang <[email protected]>
mt76: mt7921: fix kernel panic by accessing unallocated eeprom.data
Ming Yen Hsieh <[email protected]>
wifi: mt76: fix 6GHz high channel not be scanned
Quan Zhou <[email protected]>
wifi: mt76: mt7921e: fix probe timeout after reboot
Deren Wu <[email protected]>
wifi: mt76: add flexible polling wait-interval support
Kang Chen <[email protected]>
wifi: mt76: handle failure of vzalloc in mt7615_coredump_work
Lorenz Brun <[email protected]>
wifi: mt76: mt7915: expose device tree match table
Emmanuel Grumbach <[email protected]>
wifi: iwlwifi: make the loop for card preparation effective
Pavel Begunkov <[email protected]>
io_uring/rsrc: use nospec'ed indexes
Jan Kara <[email protected]>
jdb2: Don't refuse invalidation of already invalidated buffers
Tom Rix <[email protected]>
wifi: iwlwifi: fw: move memset before early return
Tom Rix <[email protected]>
wifi: iwlwifi: mvm: initialize seq variable
Daniel Gabay <[email protected]>
wifi: iwlwifi: yoyo: Fix possible division by zero
Daniel Gabay <[email protected]>
wifi: iwlwifi: yoyo: skip dump correctly on hw error
Ayala Beker <[email protected]>
wifi: iwlwifi: mvm: don't drop unencrypted MCAST frames
Yu Kuai <[email protected]>
md/raid10: don't call bio_start_io_acct twice for bio which experienced read error
Yu Kuai <[email protected]>
md/raid10: fix memleak of md thread
Yu Kuai <[email protected]>
md/raid10: fix memleak for 'conf->bio_split'
Yu Kuai <[email protected]>
md/raid10: fix leak of 'r10bio->remaining' for recovery
Li Nan <[email protected]>
md/raid10: fix task hung in raid10d
Chao Yu <[email protected]>
f2fs: fix to check return value of inc_valid_block_count()
Chao Yu <[email protected]>
f2fs: fix to check return value of f2fs_do_truncate_blocks()
Daniel Borkmann <[email protected]>
bpf, sockmap: Revert buggy deadlock fix in the sockhash and sockmap
Avraham Stern <[email protected]>
wifi: iwlwifi: mvm: don't set CHECKSUM_COMPLETE for unsupported protocols
Avraham Stern <[email protected]>
wifi: iwlwifi: trans: don't trigger d3 interrupt twice
Johannes Berg <[email protected]>
wifi: iwlwifi: debug: fix crash in __iwl_err()
Christoph Hellwig <[email protected]>
blk-mq: don't plug for head insertions in blk_execute_rq_nowait
Song Liu <[email protected]>
selftests/bpf: Fix leaked bpf_link in get_stackid_cannot_attach
Song Liu <[email protected]>
selftests/bpf: Use read_perf_max_sample_freq() in perf_event_stackmap
Ming Lei <[email protected]>
nvme-fcloop: fix "inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage"Keith Busch <[email protected]>
nvme: fix async event trace event
Damien Le Moal <[email protected]>
nvmet: fix I/O Command Set specific Identify Controller
Damien Le Moal <[email protected]>
nvmet: fix Identify Active Namespace ID list handling
Damien Le Moal <[email protected]>
nvmet: fix Identify Controller handling
Damien Le Moal <[email protected]>
nvmet: fix Identify Namespace handling
Damien Le Moal <[email protected]>
nvmet: fix error handling in nvmet_execute_identify_cns_cs_ns()
Xin Liu <[email protected]>
bpf, sockmap: fix deadlocks in the sockhash and sockmap
P Praneesh <[email protected]>
wifi: ath11k: fix writing to unintended memory region
Sebastian Reichel <[email protected]>
net: ethernet: stmmac: dwmac-rk: fix optional phy regulator handling
Sebastian Reichel <[email protected]>
net: ethernet: stmmac: dwmac-rk: rework optional clock handling
Shuchang Li <[email protected]>
scsi: lpfc: Fix ioremap issues in lpfc_sli4_pci_mem_setup()
Feng Zhou <[email protected]>
bpf/btf: Fix is_int_ptr()
Gregory Greenman <[email protected]>
wifi: iwlwifi: fix duplicate entry in iwl_dev_info_table
Chao Yu <[email protected]>
f2fs: fix to avoid use-after-free for cached IPU bio
Kal Conley <[email protected]>
xsk: Fix unaligned descriptor validation
Herbert Xu <[email protected]>
crypto: drbg - Only fail when jent is unavailable in FIPS mode
Quentin Monnet <[email protected]>
bpftool: Fix bug for long instructions in program CFG dumps
YiFei Zhu <[email protected]>
selftests/bpf: Wait for receive in cg_storage_multi test
Kal Conley <[email protected]>
selftests: xsk: Deflakify STATS_RX_DROPPED test
Kal Conley <[email protected]>
selftests: xsk: Disable IPv6 on VETH1
Kal Conley <[email protected]>
selftests: xsk: Use correct UMEM size in testapp_invalid_desc
Simon Horman <[email protected]>
net: qrtr: correct types of trace event parameters
Qilin Tan <[email protected]>
f2fs: fix iostat lock protection
Armin Wolf <[email protected]>
wifi: rt2x00: Fix memory leak when handling surveys
Xingui Yang <[email protected]>
scsi: hisi_sas: Handle NCQ error when IPTT is valid
John Garry <[email protected]>
scsi: libsas: Add sas_ata_device_link_abort()
Wei Chen <[email protected]>
wifi: rtlwifi: fix incorrect error codes in rtl_debugfs_set_write_reg()
Wei Chen <[email protected]>
wifi: rtlwifi: fix incorrect error codes in rtl_debugfs_set_write_rfreg()
Suman Anna <[email protected]>
crypto: sa2ul - Select CRYPTO_DES
Christophe JAILLET <[email protected]>
crypto: caam - Clear some memory in instantiate_rng
Jaegeuk Kim <[email protected]>
f2fs: fix scheduling while atomic in decompression path
Yangtao Li <[email protected]>
f2fs: compress: fix to call f2fs_wait_on_page_writeback() in f2fs_write_raw_pages()
Jaegeuk Kim <[email protected]>
f2fs: apply zone capacity to all zone type
Yonggil Song <[email protected]>
f2fs: fix uninitialized skipped_gc_rwsem
Yangtao Li <[email protected]>
f2fs: handle dqget error in f2fs_transfer_project_quota()
Sean Anderson <[email protected]>
net: sunhme: Fix uninitialized return code
Danila Chernetsov <[email protected]>
scsi: megaraid: Fix mega_cmd_done() CMDID_INT_CMDS
Mike Christie <[email protected]>
scsi: target: iscsit: Fix TAS handling during conn cleanup
Mike Christie <[email protected]>
scsi: target: Fix multiple LUN_RESET handling
Mike Christie <[email protected]>
scsi: target: iscsit: Stop/wait on cmds during conn close
Mike Christie <[email protected]>
scsi: target: iscsit: isert: Alloc per conn cmd counter
Mike Christie <[email protected]>
scsi: target: Pass in cmd counter to use during cmd setup
Mike Christie <[email protected]>
scsi: target: Move cmd counter allocation
Mike Christie <[email protected]>
scsi: target: Move sess cmd counter to new struct
Anastasia Kovaleva <[email protected]>
scsi: target: core: Change the way target_xcopy_do_work() sets restiction on max I/O
Daniel Borkmann <[email protected]>
bpf: Fix __reg_bound_offset 64->32 var_off subreg propagation
Madhu Koriginja <[email protected]>
netfilter: keep conntrack reference until IPsecv6 policy checks are done
Russell King (Oracle) <[email protected]>
net: dsa: qca8k: remove assignment of an_enabled in pcs_get_state()
Alexei Starovoitov <[email protected]>
libbpf: Fix ld_imm64 copy logic for ksym in light skeleton.
Eric Dumazet <[email protected]>
net/packet: convert po->auxdata to an atomic flag
Eric Dumazet <[email protected]>
net/packet: convert po->origdev to an atomic flag
Eric Dumazet <[email protected]>
net/packet: annotate accesses to po->xmit
Vadim Fedorenko <[email protected]>
vlan: partially enable SIOCSHWTSTAMP in container
Russell King (Oracle) <[email protected]>
net: pcs: xpcs: remove double-read of link state when using AN
Luis Gerhorst <[email protected]>
bpf: Remove misleading spec_v1 check on var-offset stack read
Martin KaFai Lau <[email protected]>
selftests/bpf: Fix a fd leak in an error path in network_helpers.c
Aditya Kumar Singh <[email protected]>
wifi: ath11k: fix deinitialization of firmware resources
Alexander Mikhalitsyn <[email protected]>
scm: fix MSG_CTRUNC setting condition for SO_PASSSEC
Shashank Gupta <[email protected]>
crypto: qat - fix concurrency issue when device state changes
Andrii Nakryiko <[email protected]>
bpf: fix precision propagation verbose logging
Andrii Nakryiko <[email protected]>
bpf: take into account liveness when propagating precision
Martin Blumenstingl <[email protected]>
wifi: rtw88: mac: Return the original error from rtw_mac_power_switch()
Martin Blumenstingl <[email protected]>
wifi: rtw88: mac: Return the original error from rtw_pwr_seq_parser()
Luis Gerhorst <[email protected]>
tools: bpftool: Remove invalid \' json escape
Fedor Pchelkin <[email protected]>
wifi: ath6kl: reduce WARN to dev_dbg() in callback
John Keeping <[email protected]>
wifi: brcmfmac: support CQM RSSI notification with older firmware
Christian Marangi <[email protected]>
wifi: ath11k: fix SAC bug on peer addition with sta band migration
Dan Carpenter <[email protected]>
wifi: ath5k: fix an off by one check in ath5k_eeprom_read_freq_list()
Douglas Anderson <[email protected]>
wifi: ath5k: Use platform_get_irq() to get the interrupt
Douglas Anderson <[email protected]>
wifi: ath11k: Use platform_get_irq() to get the interrupt
Fedor Pchelkin <[email protected]>
wifi: ath9k: hif_usb: fix memory leak of remain_skbs
Alexey V. Vissarionov <[email protected]>
wifi: ath6kl: minor fix for allocation size
Liang He <[email protected]>
platform/chrome: cros_typec_switch: Add missing fwnode_handle_put()
Tomáš Pecka <[email protected]>
hwmon: (pmbus/fsp-3y) Fix functionality bitmask in FSP-3Y YM-2151E
Bjorn Andersson <[email protected]>
rpmsg: glink: Propagate TX failures in intentless mode as well
Sanjay Chandrashekara <[email protected]>
cpufreq: use correct unit when verify cur freq
Rafael J. Wysocki <[email protected]>
ACPI: bus: Ensure that notify handlers are not running after removal
Sebastian Andrzej Siewior <[email protected]>
tick/common: Align tick period with the HZ tick.
Ville Syrjälä <[email protected]>
drm/i915: Make intel_get_crtc_new_encoder() less oopsy
Thomas Gleixner <[email protected]>
debugobject: Prevent init race with static objects
Yunfei Dong <[email protected]>
media: mediatek: vcodec: add remove function for decoder platform driver
Yunfei Dong <[email protected]>
media: mediatek: vcodec: fix decoder disable pm crash
Robin Murphy <[email protected]>
perf/arm-cmn: Fix port detection for CMN-700
Sumit Garg <[email protected]>
arm64: kgdb: Set PSTATE.SS to 1 to re-enable single-step
Saurabh Sengar <[email protected]>
x86/ioapic: Don't return 0 from arch_dynirq_lower_bound()
YAN SHI <[email protected]>
regulator: stm32-pwr: fix of_iomap leak
Javier Martinez Canillas <[email protected]>
media: venus: dec: Fix capture formats enumeration order
Michał Krawczyk <[email protected]>
media: venus: dec: Fix handling of the start cmd
Florian Fainelli <[email protected]>
media: rc: gpio-ir-recv: Fix support for wake-up
Igor Artemiev <[email protected]>
drm/amd/display: Fix potential null dereference
Wei Chen <[email protected]>
media: hi846: Fix memleak in hi846_init_controls()
Sakari Ailus <[email protected]>
media: v4l: async: Return async sub-devices to subnotifier list
Miaoqian Lin <[email protected]>
media: rcar_fdp1: Fix refcount leak in probe and remove function
Moudy Ho <[email protected]>
media: platform: mtk-mdp3: fix potential frame size overflow in mdp_try_fmt_mplane()
Zheng Wang <[email protected]>
media: saa7134: fix use after free bug in saa7134_finidev due to race condition
Zheng Wang <[email protected]>
media: dm1105: Fix use after free bug in dm1105_remove due to race condition
Shyam Sundar S K <[email protected]>
platform/x86/amd: pmc: Move out of BIOS SMN pair for STB init
Shyam Sundar S K <[email protected]>
platform/x86/amd: pmc: Utilize SMN index 0 for driver probe
Mario Limonciello <[email protected]>
platform/x86/amd: pmc: Move idlemask check into amd_pmc_idlemask_read
Mario Limonciello <[email protected]>
platform/x86/amd: pmc: Don't dump data after resume from s0i3 on picasso
Mario Limonciello <[email protected]>
platform/x86/amd: pmc: Hide SMU version and program attributes for Picasso
Mario Limonciello <[email protected]>
platform/x86/amd: pmc: Don't try to read SMU version on Picasso
Shyam Sundar S K <[email protected]>
platform/x86/amd/pmf: Move out of BIOS SMN pair for driver probe
Zheng Wang <[email protected]>
media: rkvdec: fix use after free bug in rkvdec_remove
Zheng Wang <[email protected]>
media: cedrus: fix use after free bug in cedrus_remove due to race condition
Yunfei Dong <[email protected]>
media: mediatek: vcodec: change lat thread decode error condition
Yunfei Dong <[email protected]>
media: mediatek: vcodec: making sure queue_work successfully
Yunfei Dong <[email protected]>
media: mediatek: vcodec: remove unused lat_buf
Yunfei Dong <[email protected]>
media: mediatek: vcodec: add core decode done event
Yunfei Dong <[email protected]>
media: mediatek: vcodec: move lat_buf to the top of core list
Yunfei Dong <[email protected]>
media: mediatek: vcodec: using each instance lat_buf count replace core ready list
Yunfei Dong <[email protected]>
media: mediatek: vcodec: add params to record lat and core lat_buf count
Yunfei Dong <[email protected]>
media: mediatek: vcodec: Force capture queue format to MM21
Yunfei Dong <[email protected]>
media: mediatek: vcodec: Make MM21 the default capture format
Pin-yen Lin <[email protected]>
media: mediatek: vcodec: Use 4K frame size when supported by stateful decoder
Douglas Anderson <[email protected]>
arm64: dts: sc7280: Rename qspi data12 as data23
Douglas Anderson <[email protected]>
arm64: dts: sc7180: Rename qspi data12 as data23
Petr Vorel <[email protected]>
arm64: dts: qcom: msm8994-angler: removed clash with smem_region
Petr Vorel <[email protected]>
arm64: dts: qcom: msm8994-angler: Fix cont_splash_mem mapping
Uros Bizjak <[email protected]>
x86/apic: Fix atomic update of offset in reserve_eilvt_offset()
Douglas Anderson <[email protected]>
regulator: core: Avoid lockdep reports when resolving supplies
Douglas Anderson <[email protected]>
regulator: core: Consistently set mutex_owner when using ww_mutex_lock_slow()
Thomas Hellström <[email protected]>
drm/ttm/pool: Fix ttm_pool_alloc error path
Christian König <[email protected]>
drm/ttm: optimize pool allocations a bit v2
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: apq8096-db820c: drop unit address from PMI8994 regulator
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: msm8994-msft-lumia-octagon: drop unit address from PMI8994 regulator
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: msm8994-kitakami: drop unit address from PMI8994 regulator
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sc7180-trogdor-pazquel: correct trackpad supply
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sc7180-trogdor-lazor: correct trackpad supply
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sc7280-herobrine-villager: correct trackpad supply
Yang Yingliang <[email protected]>
gpu: host1x: Fix memory leak of device names
Yang Yingliang <[email protected]>
gpu: host1x: Fix potential double free if IOMMU is disabled
Li Yang <[email protected]>
soc: renesas: renesas-soc: Release 'chipid' from ioremap()
Zhaoyang Li <[email protected]>
soc: bcm: brcmstb: biuctrl: fix of_iomap leak
Conor Dooley <[email protected]>
mailbox: mpfs: switch to txdone_poll
Xinlei Lee <[email protected]>
drm/mediatek: dp: Change the aux retries times when receiving AUX_DEFER
Harshit Mogalapalli <[email protected]>
drm/lima/lima_drv: Add missing unwind goto in lima_pdev_probe()
Jean-Philippe Brucker <[email protected]>
ACPI: VIOT: Initialize the correct IOMMU fwspec
AngeloGioacchino Del Regno <[email protected]>
arm64: dts: mediatek: mt8192-asurada: Fix voltage constraint for Vgpu
Bjorn Andersson <[email protected]>
cpufreq: qcom-cpufreq-hw: Revert adding cpufreq qos
AngeloGioacchino Del Regno <[email protected]>
cpufreq: mediatek: Raise proc and sram max voltage for MT7622/7623
Jia-Wei Chang <[email protected]>
cpufreq: mediatek: raise proc/sram max voltage for MT8516
Jia-Wei Chang <[email protected]>
cpufreq: mediatek: fix KP caused by handler usage after regulator_put/clk_put
Jia-Wei Chang <[email protected]>
cpufreq: mediatek: fix passing zero to 'PTR_ERR'
Janne Grunau <[email protected]>
arm64: dts: apple: t8103: Disable unused PCIe ports
Alexandre Torgue <[email protected]>
ARM: dts: stm32: fix spi1 pin assignment on stm32mp15
Ilkka Koskinen <[email protected]>
perf/arm-cmn: Move overlapping wp_combine field
Cristian Marussi <[email protected]>
firmware: arm_scmi: Fix xfers allocation on Rx channel
H. Nikolaus Schaller <[email protected]>
ARM: dts: gta04: fix excess dma channel usage
Dan Carpenter <[email protected]>
drm: rcar-du: Fix a NULL vs IS_ERR() bug
Neil Armstrong <[email protected]>
arm64: dts: qcom: sm8450: fix pcie1 gpios properties name
Georgii Kruglov <[email protected]>
mmc: sdhci-of-esdhc: fix quirk to ignore command inhibit for data
Roger Pau Monne <[email protected]>
ACPI: processor: Fix evaluating _PDC method when running as Xen dom0
Lee Jones <[email protected]>
drm/amd/display/dc/dce60/Makefile: Fix previous attempt to silence known override-init warnings
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sm8350-microsoft-surface: fix USB dual-role mode property
Dionna Glaze <[email protected]>
virt/coco/sev-guest: Double-buffer messages
Adam Skladowski <[email protected]>
drm: msm: adreno: Disable preemption on Adreno 510
Johan Hovold <[email protected]>
drm/msm/adreno: drop bogus pm_runtime_set_active()
Vignesh Raghavendra <[email protected]>
arm64: dts: ti: k3-am62a7: Correct L2 cache size to 512KB
Vignesh Raghavendra <[email protected]>
arm64: dts: ti: k3-am625: Correct L2 cache size to 512KB
Laurent Pinchart <[email protected]>
media: max9286: Free control handler
Adam Ford <[email protected]>
drm/bridge: adv7533: Fix adv7533_mode_valid for adv7533 and adv7535
Mukesh Ojha <[email protected]>
firmware: qcom_scm: Clear download bit during reboot
Dan Carpenter <[email protected]>
media: av7110: prevent underflow in write_ts_to_decoder()
Ming Qian <[email protected]>
media: amphion: decoder implement display delay enable
Jiasheng Jiang <[email protected]>
media: platform: mtk-mdp3: Add missing check and free for ida_alloc
Jiasheng Jiang <[email protected]>
media: bdisp: Add missing check for create_workqueue
Muralidhara M K <[email protected]>
x86/MCE/AMD: Use an u64 for bank_map
Manivannan Sadhasivam <[email protected]>
ARM: dts: qcom: sdx55: Fix the unit address of PCIe EP node
Manivannan Sadhasivam <[email protected]>
ARM: dts: qcom: ipq8064: Fix the PCI I/O port range
Manivannan Sadhasivam <[email protected]>
ARM: dts: qcom: ipq4019: Fix the PCI I/O port range
Manivannan Sadhasivam <[email protected]>
arm64: dts: qcom: sm8450: Fix the PCI I/O port range
Manivannan Sadhasivam <[email protected]>
arm64: dts: qcom: sm8150: Fix the PCI I/O port range
Manivannan Sadhasivam <[email protected]>
arm64: dts: qcom: sm8250: Fix the PCI I/O port range
Manivannan Sadhasivam <[email protected]>
arm64: dts: qcom: msm8996: Fix the PCI I/O port range
Manivannan Sadhasivam <[email protected]>
arm64: dts: qcom: ipq6018: Fix the PCI I/O port range
Manivannan Sadhasivam <[email protected]>
arm64: dts: qcom: ipq8074: Fix the PCI I/O port range
Manivannan Sadhasivam <[email protected]>
arm64: dts: qcom: sc7280: Fix the PCI I/O port range
Manivannan Sadhasivam <[email protected]>
arm64: dts: qcom: msm8998: Fix the PCI I/O port range
Manivannan Sadhasivam <[email protected]>
arm64: dts: qcom: sdm845: Fix the PCI I/O port range
Vincent Guittot <[email protected]>
arm64: dts: qcom: sdm845: correct dynamic power coefficients
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sc7280: fix EUD port properties
Konrad Dybcio <[email protected]>
arm64: dts: qcom: msm8998: Fix stm-stimulus-base reg name
Rafał Miłecki <[email protected]>
arm64: dts: broadcom: bcmbca: bcm4908: fix procmon nodename
Rafał Miłecki <[email protected]>
arm64: dts: broadcom: bcmbca: bcm4908: fix LED nodenames
Rafał Miłecki <[email protected]>
arm64: dts: broadcom: bcmbca: bcm4908: fix NAND interrupt name
Bhavya Kapoor <[email protected]>
arm64: dts: ti: k3-j721e-main: Remove ti,strobe-sel property
Devarsh Thakkar <[email protected]>
arm64: dts: ti: k3-am62a7-sk: Fix DDR size to full 4GB
Nitin Yadav <[email protected]>
arm64: dts: ti: k3-am62-main: Fix GPIO numbers in DT
Douglas Anderson <[email protected]>
regulator: core: Shorten off-on-delay-us for always-on/boot-on by time since booted
Konrad Dybcio <[email protected]>
ARM: dts: qcom-apq8064: Fix opp table child name
Qiuxu Zhuo <[email protected]>
EDAC/skx: Fix overflows on the DRAM row address mapping arrays
Vinod Polimera <[email protected]>
drm/msm/disp/dpu: check for crtc enable rather than crtc active to release shared resources
Chen-Yu Tsai <[email protected]>
drm/mediatek: dp: Only trigger DRM HPD events if bridge is attached
Lad Prabhakar <[email protected]>
arm64: dts: renesas: r9a07g043: Update IRQ numbers for SSI channels
Lad Prabhakar <[email protected]>
arm64: dts: renesas: r9a07g043: Introduce SOC_PERIPHERAL_IRQ() macro to specify interrupt property
Lad Prabhakar <[email protected]>
arm64: dts: renesas: r9a07g054: Update IRQ numbers for SSI channels
Lad Prabhakar <[email protected]>
arm64: dts: renesas: r9a07g044: Update IRQ numbers for SSI channels
Geert Uytterhoeven <[email protected]>
arm64: dts: renesas: r8a774c0: Remove bogus voltages from OPP table
Geert Uytterhoeven <[email protected]>
arm64: dts: renesas: r8a77990: Remove bogus voltages from OPP table
Miaoqian Lin <[email protected]>
soc: ti: pm33xx: Fix refcount leak in am33xx_pm_probe
Terry Bowman <[email protected]>
tools/x86/kcpuid: Fix avx512bw and avx512lvl fields in Fn00000007
Orlando Chamberlain <[email protected]>
drm/amdgpu: register a vga_switcheroo client for MacBooks with apple-gmux
Dom Cobley <[email protected]>
drm/probe-helper: Cancel previous job before starting new one
Maíra Canal <[email protected]>
drm/vgem: add missing mutex_destroy
Matt Roper <[email protected]>
drm/i915/dg2: Drop one PCI ID
Rob Clark <[email protected]>
drm/rockchip: Drop unbalanced obj unref
Jingbo Xu <[email protected]>
erofs: fix potential overflow calculating xattr_isize
Jingbo Xu <[email protected]>
erofs: initialize packed inode after root inode is assigned
Gao Xiang <[email protected]>
erofs: stop parsing non-compact HEAD index if clusterofs is invalid
Lino Sanfilippo <[email protected]>
tpm, tpm_tis: Claim locality when interrupts are reenabled on resume
Lino Sanfilippo <[email protected]>
tpm, tpm: Implement usage counter for locality
Lino Sanfilippo <[email protected]>
tpm, tpm_tis: Claim locality before writing interrupt registers
Lino Sanfilippo <[email protected]>
tpm, tpm_tis: Disable interrupts if tpm_tis_probe_irq() failed
Lino Sanfilippo <[email protected]>
tpm, tpm_tis: Claim locality before writing TPM_INT_ENABLE register
Lino Sanfilippo <[email protected]>
tpm, tpm_tis: Do not skip reset of original interrupt vector
Paul Moore <[email protected]>
selinux: ensure av_permissions.h is built when needed
Ondrej Mosnacek <[email protected]>
selinux: fix Makefile dependencies of flask.h
Ilpo Järvinen <[email protected]>
selftests/resctrl: Check for return value after write_schemata()
Ilpo Järvinen <[email protected]>
selftests/resctrl: Allow ->setup() to return errors
Ilpo Järvinen <[email protected]>
selftests/resctrl: Move ->setup() call outside of test specific branches
Ilpo Järvinen <[email protected]>
selftests/resctrl: Return NULL if malloc_and_init_memory() did not alloc mem
Zqiang <[email protected]>
rcu: Fix missing TICK_DEP_MASK_RCU_EXP dependency check
Rae Moar <[email protected]>
kunit: fix bug in the order of lines in debugfs logs
Rae Moar <[email protected]>
kunit: improve KTAP compliance of KUnit test output
Krzysztof Kozlowski <[email protected]>
ASoC: dt-bindings: qcom,lpass-rx-macro: correct minItems for clocks
Jeffrey Hugo <[email protected]>
bus: mhi: host: Range check CHDBOFF and ERDBOFF
Jeffrey Hugo <[email protected]>
bus: mhi: host: Use mhi_tryset_pm_state() for setting fw error state
Jeffrey Hugo <[email protected]>
bus: mhi: host: Remove duplicate ee check for syserr
Dan Williams <[email protected]>
cxl/hdm: Fail upon detecting 0-sized decoders
Dave Chinner <[email protected]>
xfs: don't consider future format versions valid
Xiubo Li <[email protected]>
ceph: fix potential use-after-free bug when trimming caps
Mårten Lindahl <[email protected]>
ubifs: Fix memory leak in do_rename
Mårten Lindahl <[email protected]>
ubifs: Free memory for tmpfile name
Wang YanQing <[email protected]>
ubi: Fix return value overwrite issue in try_write_vid_and_data()
Zhihao Cheng <[email protected]>
ubifs: Fix memleak when insert_old_idx() failed
Zhihao Cheng <[email protected]>
Revert "ubifs: dirty_cow_znode: Fix memleak in error handling path"
Andrew Jones <[email protected]>
RISC-V: Align SBI probe implementation with spec
Kishon Vijay Abraham I <[email protected]>
iommu/amd: Fix "Guest Virtual APIC Table Root Pointer" configuration in IRTE
Tim Huang <[email protected]>
drm/amd/pm: re-enable the gfx imu when smu resume
Yu Songping <[email protected]>
swsmu/amdgpu_smu: Fix the wrong if-condition
Ondrej Mosnacek <[email protected]>
tracing: Fix permissions for the buffer_percent file
Song Shuai <[email protected]>
riscv: mm: remove redundant parameter of create_fdt_early_page_table
Reid Tonking <[email protected]>
i2c: omap: Fix standard mode false ACK readings
Hans de Goede <[email protected]>
ACPI: video: Remove acpi_backlight=video quirk for Lenovo ThinkPad W530
Namjae Jeon <[email protected]>
ksmbd: fix deadlock in ksmbd_find_crypto_ctx()
Namjae Jeon <[email protected]>
ksmbd: not allow guest user on multichannel
Namjae Jeon <[email protected]>
ksmbd: fix memleak in session setup
Namjae Jeon <[email protected]>
ksmbd: fix NULL pointer dereference in smb2_get_info_filesystem()
Namjae Jeon <[email protected]>
ksmbd: call rcu_barrier() in ksmbd_server_exit()
Namjae Jeon <[email protected]>
ksmbd: fix racy issue under cocurrent smb2 tree disconnect
David Matlack <[email protected]>
KVM: RISC-V: Retry fault if vma_lookup() results become invalid
Alex Hung <[email protected]>
drm/amd/display: fix a divided-by-zero error
Hamza Mahfooz <[email protected]>
drm/amd/display: fix PSR-SU/DSC interoperability support
Daniel Miess <[email protected]>
drm/amd/display: limit timing for single dimm memory
Nasir Osman <[email protected]>
drm/amd/display: Remove stutter only configurations
Zhang Zhengming <[email protected]>
relayfs: fix out-of-bounds access in relay_file_read
Oliver Upton <[email protected]>
KVM: arm64: vgic: Don't acquire its_lock before config_lock
Oliver Upton <[email protected]>
KVM: arm64: Use config_lock to protect vgic state
Oliver Upton <[email protected]>
KVM: arm64: Use config_lock to protect data ordered against KVM_RUN
Oliver Upton <[email protected]>
KVM: arm64: Avoid lock inversion when setting the VM register width
Oliver Upton <[email protected]>
KVM: arm64: Avoid vcpu->mutex v. kvm->lock inversion in CPU_ON
Sean Christopherson <[email protected]>
KVM: nVMX: Emulate NOPs in L2, and PAUSE if it's not intercepted
Roberto Sassu <[email protected]>
reiserfs: Add security prefix to xattr name in reiserfs_security_write()
Zheng Yejian <[email protected]>
rcu: Avoid stack overflow due to __rcu_irq_enter_check_tick() being kprobe-ed
Mario Limonciello <[email protected]>
crypto: ccp - Don't initialize CCP for PSP 0x1649
Eric Biggers <[email protected]>
crypto: arm64/aes-neonbs - fix crash with CFI enabled
Jonathan McDowell <[email protected]>
crypto: safexcel - Cleanup ring IRQ workqueues on load failure
Toke Høiland-Jørgensen <[email protected]>
crypto: api - Demote BUG_ON() in crypto_unregister_alg() to a WARN_ON()
Johannes Berg <[email protected]>
ring-buffer: Sync IRQ works before buffer destruction
Tze-nan Wu <[email protected]>
ring-buffer: Ensure proper resetting of atomic variables in ring_buffer_reset_online_cpus
Krzysztof Kozlowski <[email protected]>
pinctrl: qcom: lpass-lpi: set output value before enabling output
Krzysztof Kozlowski <[email protected]>
soundwire: qcom: correct setting ignore bit on v1.5.1
Heiner Kallweit <[email protected]>
pwm: meson: Fix g12a ao clk81 name
Heiner Kallweit <[email protected]>
pwm: meson: Fix axg ao mux parents
Felix Fietkau <[email protected]>
wifi: mt76: add missing locking to protect against concurrent rx/status calls
Kees Cook <[email protected]>
kheaders: Use array declaration instead of char
William Breathitt Gray <[email protected]>
iio: addac: stx104: Fix race condition for stx104_write_raw()
William Breathitt Gray <[email protected]>
iio: addac: stx104: Fix race condition when converting analog-to-digital
Zhang Yuchen <[email protected]>
ipmi: fix SSIF not responding under certain cond.
Corey Minyard <[email protected]>
ipmi:ssif: Add send_retries increment
Jiaxun Yang <[email protected]>
MIPS: fw: Allow firmware to pass a empty env
Kefeng Wang <[email protected]>
fs: fix sysctls.c built
Joel Fernandes (Google) <[email protected]>
tick/nohz: Fix cpu_is_hotpluggable() by checking with nohz subsystem
Jan Kundrát <[email protected]>
serial: max310x: fix IO data corruption in batched operations
Ilpo Järvinen <[email protected]>
serial: 8250: Fix serial8250_tx_empty() race with DMA Tx
Johan Hovold <[email protected]>
serial: fix TIOCSRS485 locking
Johan Hovold <[email protected]>
xhci: fix debugfs register accesses while suspended
Ilpo Järvinen <[email protected]>
tty: Prevent writing chars during tcsetattr TCSADRAIN/FLUSH
Nuno Sá <[email protected]>
staging: iio: resolver: ads1210: fix config mode
Eric Biggers <[email protected]>
blk-crypto: make blk_crypto_evict_key() more robust
Eric Biggers <[email protected]>
blk-crypto: make blk_crypto_evict_key() return void
Eric Biggers <[email protected]>
blk-mq: release crypto keyslot before reporting I/O complete
Bart Van Assche <[email protected]>
blk-crypto: Add a missing include directive
Christoph Hellwig <[email protected]>
blk-crypto: move internal only declarations to blk-crypto-internal.h
Christoph Hellwig <[email protected]>
blk-crypto: add a blk_crypto_config_supported_natively helper
Christoph Hellwig <[email protected]>
blk-crypto: don't use struct request_queue for public interfaces
Chengming Zhou <[email protected]>
blk-stat: fix QUEUE_FLAG_STATS clear
Ricardo Ribalda <[email protected]>
media: ov8856: Do not check for for module version
Thomas Gleixner <[email protected]>
posix-cpu-timers: Implement the missing timer_wait_running callback
Jarkko Sakkinen <[email protected]>
tpm: Add !tpm_amd_is_rng_defective() to the hwrng_unregister() call site
Chris Packham <[email protected]>
hwmon: (adt7475) Use device_property APIs when configuring polarity
Babu Moger <[email protected]>
hwmon: (k10temp) Check range scale when CUR_TEMP register is read-write
Johan Hovold <[email protected]>
USB: dwc3: fix runtime pm imbalance on unbind
Johan Hovold <[email protected]>
USB: dwc3: fix runtime pm imbalance on probe errors
Wesley Cheng <[email protected]>
usb: dwc3: gadget: Stall and restart EP0 if host is unresponsive
Badhri Jagan Sridharan <[email protected]>
usb: gadget: udc: core: Prevent redundant calls to pullup
Badhri Jagan Sridharan <[email protected]>
usb: gadget: udc: core: Invoke usb_gadget_connect only when started
Randy Dunlap <[email protected]>
IMA: allow/fix UML builds
Dmitry Baryshkov <[email protected]>
phy: qcom-qmp-pcie: sc8180x PCIe PHY has 2 lanes
Manivannan Sadhasivam <[email protected]>
PCI: qcom: Fix the incorrect register usage in v2.7.0 config
Lukas Wunner <[email protected]>
PCI: pciehp: Fix AB-BA deadlock between reset_lock and device_lock
Josh Triplett <[email protected]>
PCI: kirin: Select REGMAP_MMIO
Nicholas Piggin <[email protected]>
powerpc/boot: Fix boot wrapper code generation with CONFIG_POWER10_CPU
Ard Biesheuvel <[email protected]>
arm64: Stash shadow stack pointer in the task struct on interrupt
Ard Biesheuvel <[email protected]>
arm64: Always load shadow stack pointer directly from the task struct
Syed Saba Kareem <[email protected]>
ASoC: amd: ps: update the acp clock source.
syed saba kareem <[email protected]>
ASoC: amd: fix ACP version typo mistake
Mario Limonciello <[email protected]>
wifi: mt76: mt7921e: Set memory space enable in PCI_COMMAND if unset
Jiri Slaby (SUSE) <[email protected]>
wireguard: timers: cast enum limits members to int in prints
Tony Luck <[email protected]>
x86/cpu: Add model number for Intel Arrow Lake processor
Vladimir Oltean <[email protected]>
asm-generic/io.h: suppress endianness warnings for readq() and writeq()
Steven Rostedt (Google) <[email protected]>
tracing: Error if a trace event has an array for a __field()
Kalle Valo <[email protected]>
wifi: ath11k: reduce the MHI timeout to 20s
Benjamin Asbach <[email protected]>
platform/x86: thinkpad_acpi: Add missing T14s Gen1 type to s2idle quirk list
Daniel Golle <[email protected]>
net: sfp: add quirk enabling 2500Base-x for HG MXPD-483II
Ranjan Kumar <[email protected]>
scsi: mpi3mr: Handle soft reset in progress fault code (0xF002)
Anh Tuan Phan <[email protected]>
selftests mount: Fix mount_setattr_test builds failed
Jiri Slaby (SUSE) <[email protected]>
net: wwan: t7xx: do not compile with -Werror
Duy Nguyen <[email protected]>
ASoC: da7213.c: add missing pm_runtime_disable()
Hans de Goede <[email protected]>
ASoC: Intel: bytcr_rt5640: Add quirk for the Acer Iconia One 7 B1-750
Patrik Dahlström <[email protected]>
iio: adc: palmas_gpadc: fix NULL dereference on rmmod
Ge-org Brohammer <[email protected]>
ASoC: amd: yc: Add DMI entries to support Victus by HP Laptop 16-e1xxx (8A22)
Michael Kelley <[email protected]>
x86/hyperv: Block root partition functionality in a Confidential VM
Shengjiu Wang <[email protected]>
ASoC: soc-pcm: fix hw->formats cleared by soc_pcm_hw_init() for dpcm
Eugene Huang <[email protected]>
ASoC: Intel: soc-acpi: add table for Intel 'Rooks County' NUC M15
Eugene Huang <[email protected]>
ASOC: Intel: sof_sdw: add quirk for Intel 'Rooks County' NUC M15
-------------
Diffstat:
Documentation/block/inline-encryption.rst | 12 +-
.../bindings/sound/qcom,lpass-rx-macro.yaml | 1 +
Makefile | 4 +-
arch/arm/boot/dts/omap3-gta04.dtsi | 16 +
arch/arm/boot/dts/qcom-apq8064.dtsi | 2 +-
arch/arm/boot/dts/qcom-ipq4019.dtsi | 4 +-
arch/arm/boot/dts/qcom-ipq8064.dtsi | 12 +-
arch/arm/boot/dts/qcom-sdx55.dtsi | 78 +-
arch/arm/boot/dts/stm32mp15-pinctrl.dtsi | 30 +-
arch/arm64/boot/dts/apple/t8103-j274.dts | 10 +
arch/arm64/boot/dts/apple/t8103-j293.dts | 15 -
arch/arm64/boot/dts/apple/t8103-j313.dts | 15 -
arch/arm64/boot/dts/apple/t8103-j456.dts | 10 +
arch/arm64/boot/dts/apple/t8103-j457.dts | 11 +-
arch/arm64/boot/dts/apple/t8103.dtsi | 4 +
.../dts/broadcom/bcmbca/bcm4908-asus-gt-ac5300.dts | 10 +-
arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi | 4 +-
arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi | 2 +-
arch/arm64/boot/dts/qcom/apq8096-db820c.dts | 3 +-
arch/arm64/boot/dts/qcom/ipq6018.dtsi | 6 +-
arch/arm64/boot/dts/qcom/ipq8074.dtsi | 12 +-
arch/arm64/boot/dts/qcom/msm8992-lg-bullhead.dtsi | 5 -
.../dts/qcom/msm8994-huawei-angler-rev-101.dts | 11 +-
.../boot/dts/qcom/msm8994-msft-lumia-octagon.dtsi | 3 +-
.../dts/qcom/msm8994-sony-xperia-kitakami.dtsi | 3 +-
arch/arm64/boot/dts/qcom/msm8994.dtsi | 5 +
arch/arm64/boot/dts/qcom/msm8996.dtsi | 12 +-
arch/arm64/boot/dts/qcom/msm8998.dtsi | 4 +-
arch/arm64/boot/dts/qcom/pmi8994.dtsi | 2 -
.../qcom/sc7180-trogdor-lazor-limozeen-nots-r4.dts | 2 +-
.../boot/dts/qcom/sc7180-trogdor-pazquel.dtsi | 2 +-
arch/arm64/boot/dts/qcom/sc7180.dtsi | 2 +-
.../boot/dts/qcom/sc7280-herobrine-villager.dtsi | 2 +-
arch/arm64/boot/dts/qcom/sc7280.dtsi | 13 +-
arch/arm64/boot/dts/qcom/sdm845.dtsi | 14 +-
arch/arm64/boot/dts/qcom/sm8150.dtsi | 6 +-
arch/arm64/boot/dts/qcom/sm8250.dtsi | 8 +-
.../dts/qcom/sm8350-microsoft-surface-duo2.dts | 3 +
arch/arm64/boot/dts/qcom/sm8450.dtsi | 12 +-
arch/arm64/boot/dts/renesas/r8a774c0.dtsi | 3 -
arch/arm64/boot/dts/renesas/r8a77990.dtsi | 3 -
arch/arm64/boot/dts/renesas/r9a07g043.dtsi | 304 +++---
arch/arm64/boot/dts/renesas/r9a07g043u.dtsi | 12 +
arch/arm64/boot/dts/renesas/r9a07g043u11-smarc.dts | 2 +-
arch/arm64/boot/dts/renesas/r9a07g044.dtsi | 19 +-
arch/arm64/boot/dts/renesas/r9a07g054.dtsi | 19 +-
arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 4 +-
arch/arm64/boot/dts/ti/k3-am625.dtsi | 2 +-
arch/arm64/boot/dts/ti/k3-am62a7-sk.dts | 5 +-
arch/arm64/boot/dts/ti/k3-am62a7.dtsi | 2 +-
arch/arm64/boot/dts/ti/k3-j721e-main.dtsi | 1 -
arch/arm64/crypto/aes-neonbs-core.S | 9 +-
arch/arm64/include/asm/debug-monitors.h | 1 +
arch/arm64/include/asm/kvm_host.h | 4 +
arch/arm64/include/asm/scs.h | 7 +-
arch/arm64/kernel/debug-monitors.c | 5 +
arch/arm64/kernel/entry.S | 16 +-
arch/arm64/kernel/head.S | 2 +-
arch/arm64/kernel/kgdb.c | 2 +
arch/arm64/kvm/arm.c | 53 +-
arch/arm64/kvm/guest.c | 2 +
arch/arm64/kvm/hypercalls.c | 4 +-
arch/arm64/kvm/pmu-emul.c | 23 +-
arch/arm64/kvm/psci.c | 28 +-
arch/arm64/kvm/reset.c | 15 +-
arch/arm64/kvm/vgic/vgic-debug.c | 8 +-
arch/arm64/kvm/vgic/vgic-init.c | 36 +-
arch/arm64/kvm/vgic/vgic-its.c | 33 +-
arch/arm64/kvm/vgic/vgic-kvm-device.c | 47 +-
arch/arm64/kvm/vgic/vgic-mmio-v3.c | 4 +-
arch/arm64/kvm/vgic/vgic-mmio.c | 12 +-
arch/arm64/kvm/vgic/vgic-v4.c | 11 +-
arch/arm64/kvm/vgic/vgic.c | 12 +-
arch/ia64/kernel/salinfo.c | 2 +-
arch/ia64/mm/contig.c | 2 +-
arch/ia64/mm/hugetlbpage.c | 2 +-
arch/mips/fw/lib/cmdline.c | 2 +-
arch/openrisc/kernel/entry.S | 6 +-
arch/parisc/kernel/pacache.S | 2 +
arch/parisc/kernel/real2.S | 5 +-
arch/powerpc/boot/Makefile | 2 +
arch/powerpc/include/asm/reg.h | 5 +
arch/powerpc/kernel/rtas.c | 2 +-
arch/powerpc/perf/mpc7450-pmu.c | 6 +-
arch/powerpc/platforms/512x/clock-commonclk.c | 2 +-
arch/powerpc/platforms/embedded6xx/flipper-pic.c | 2 +-
arch/powerpc/platforms/embedded6xx/hlwd-pic.c | 2 +-
arch/powerpc/platforms/embedded6xx/wii.c | 4 +-
arch/powerpc/sysdev/tsi108_pci.c | 5 +-
arch/riscv/include/asm/sbi.h | 2 +-
arch/riscv/kernel/cpu_ops.c | 2 +-
arch/riscv/kernel/sbi.c | 17 +-
arch/riscv/kvm/main.c | 2 +-
arch/riscv/kvm/mmu.c | 25 +-
arch/riscv/mm/init.c | 6 +-
arch/riscv/mm/ptdump.c | 24 +-
arch/sh/kernel/cpu/sh4/sq.c | 2 +-
arch/x86/include/asm/intel-family.h | 2 +
arch/x86/kernel/apic/apic.c | 5 +-
arch/x86/kernel/apic/io_apic.c | 14 +-
arch/x86/kernel/cpu/mce/amd.c | 14 +-
arch/x86/kernel/cpu/mshyperv.c | 12 +-
arch/x86/kvm/vmx/vmx.c | 15 +
block/blk-crypto-internal.h | 37 +-
block/blk-crypto-profile.c | 47 +-
block/blk-crypto.c | 95 +-
block/blk-iocost.c | 10 +-
block/blk-merge.c | 2 +
block/blk-mq.c | 17 +-
block/blk-stat.c | 4 +-
crypto/algapi.c | 4 +-
crypto/drbg.c | 2 +-
drivers/acpi/bus.c | 1 +
drivers/acpi/power.c | 19 +
drivers/acpi/processor_pdc.c | 11 +
drivers/acpi/video_detect.c | 14 -
drivers/acpi/viot.c | 5 +-
drivers/base/cacheinfo.c | 5 +-
drivers/base/cpu.c | 3 +-
drivers/block/drbd/drbd_receiver.c | 2 +-
drivers/bluetooth/btsdio.c | 1 -
drivers/bus/mhi/host/boot.c | 16 +-
drivers/bus/mhi/host/init.c | 12 +
drivers/bus/mhi/host/main.c | 2 +-
drivers/char/ipmi/Kconfig | 3 +-
drivers/char/ipmi/ipmi_ssif.c | 8 +-
drivers/char/tpm/tpm-chip.c | 3 +-
drivers/char/tpm/tpm_tis_core.c | 131 ++-
drivers/char/tpm/tpm_tis_core.h | 2 +
drivers/clk/at91/clk-sam9x60-pll.c | 2 +-
drivers/clk/clk-conf.c | 12 +-
drivers/clk/imx/clk-fracn-gppll.c | 22 +-
drivers/clk/imx/clk-imx8ulp.c | 4 +-
drivers/clk/mediatek/clk-mt2701-aud.c | 40 +-
drivers/clk/mediatek/clk-mt2701-bdp.c | 20 +-
drivers/clk/mediatek/clk-mt2701-eth.c | 10 +-
drivers/clk/mediatek/clk-mt2701-g3d.c | 10 +-
drivers/clk/mediatek/clk-mt2701-hif.c | 10 +-
drivers/clk/mediatek/clk-mt2701-img.c | 10 +-
drivers/clk/mediatek/clk-mt2701-mm.c | 20 +-
drivers/clk/mediatek/clk-mt2701-vdec.c | 20 +-
drivers/clk/mediatek/clk-mt2701.c | 40 +-
drivers/clk/mediatek/clk-mt2712-bdp.c | 10 +-
drivers/clk/mediatek/clk-mt2712-img.c | 10 +-
drivers/clk/mediatek/clk-mt2712-jpgdec.c | 10 +-
drivers/clk/mediatek/clk-mt2712-mfg.c | 10 +-
drivers/clk/mediatek/clk-mt2712-mm.c | 34 +-
drivers/clk/mediatek/clk-mt2712-vdec.c | 20 +-
drivers/clk/mediatek/clk-mt2712-venc.c | 10 +-
drivers/clk/mediatek/clk-mt2712.c | 78 +-
drivers/clk/mediatek/clk-mt6765-audio.c | 20 +-
drivers/clk/mediatek/clk-mt6765-cam.c | 10 +-
drivers/clk/mediatek/clk-mt6765-img.c | 10 +-
drivers/clk/mediatek/clk-mt6765-mipi0a.c | 10 +-
drivers/clk/mediatek/clk-mt6765-mm.c | 10 +-
drivers/clk/mediatek/clk-mt6765-vcodec.c | 10 +-
drivers/clk/mediatek/clk-mt6765.c | 80 +-
drivers/clk/mediatek/clk-mt6797-img.c | 10 +-
drivers/clk/mediatek/clk-mt6797-mm.c | 20 +-
drivers/clk/mediatek/clk-mt6797-vdec.c | 20 +-
drivers/clk/mediatek/clk-mt6797-venc.c | 10 +-
drivers/clk/mediatek/clk-mt6797.c | 42 +-
drivers/clk/mediatek/clk-mt7622-aud.c | 40 +-
drivers/clk/mediatek/clk-mt7622-eth.c | 20 +-
drivers/clk/mediatek/clk-mt7622-hif.c | 20 +-
drivers/clk/mediatek/clk-mt7622.c | 90 +-
drivers/clk/mediatek/clk-mt7629-eth.c | 20 +-
drivers/clk/mediatek/clk-mt7629-hif.c | 20 +-
drivers/clk/mediatek/clk-mt7629.c | 40 +-
drivers/clk/mediatek/clk-mt7986-eth.c | 24 +-
drivers/clk/mediatek/clk-mt7986-infracfg.c | 24 +-
drivers/clk/mediatek/clk-mt8135.c | 44 +-
drivers/clk/mediatek/clk-mt8167-aud.c | 11 +-
drivers/clk/mediatek/clk-mt8167-img.c | 10 +-
drivers/clk/mediatek/clk-mt8167-mfgcfg.c | 10 +-
drivers/clk/mediatek/clk-mt8167-mm.c | 22 +-
drivers/clk/mediatek/clk-mt8167-vdec.c | 20 +-
drivers/clk/mediatek/clk-mt8173-mm.c | 22 +-
drivers/clk/mediatek/clk-mt8516-aud.c | 10 +-
drivers/clk/mediatek/clk-mt8516.c | 60 +-
drivers/clk/microchip/clk-mpfs.c | 3 +-
drivers/clk/qcom/dispcc-qcm2290.c | 9 -
drivers/clk/qcom/gcc-qcm2290.c | 3 +-
drivers/clk/qcom/gcc-sm6115.c | 50 +-
drivers/clk/qcom/gcc-sm8350.c | 47 +-
drivers/clk/qcom/lpassaudiocc-sc7280.c | 2 +
drivers/clk/qcom/lpasscc-sc7280.c | 16 +-
drivers/clk/rockchip/clk-rk3399.c | 2 +-
drivers/clocksource/timer-davinci.c | 30 +-
drivers/cpufreq/cpufreq.c | 2 +-
drivers/cpufreq/mediatek-cpufreq.c | 98 +-
drivers/cpufreq/qcom-cpufreq-hw.c | 14 -
drivers/cpuidle/cpuidle-riscv-sbi.c | 2 +-
drivers/crypto/Kconfig | 1 +
drivers/crypto/caam/ctrl.c | 6 +-
drivers/crypto/ccp/sp-pci.c | 2 +-
drivers/crypto/inside-secure/safexcel.c | 37 +-
drivers/crypto/qat/qat_common/adf_accel_devices.h | 1 +
drivers/crypto/qat/qat_common/adf_common_drv.h | 3 +
drivers/crypto/qat/qat_common/adf_dev_mgr.c | 2 +
drivers/crypto/qat/qat_common/adf_init.c | 64 ++
drivers/crypto/qat/qat_common/adf_sysfs.c | 23 +-
drivers/cxl/core/hdm.c | 15 +-
drivers/dma/at_xdmac.c | 5 +-
drivers/dma/dw-edma/dw-edma-core.c | 27 +-
drivers/dma/mv_xor_v2.c | 2 +-
drivers/dma/qcom/gpi.c | 1 -
drivers/edac/skx_base.c | 4 +-
drivers/firmware/arm_scmi/driver.c | 2 +-
drivers/firmware/qcom_scm.c | 3 +-
drivers/firmware/stratix10-svc.c | 4 +-
drivers/fpga/fpga-bridge.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 21 +-
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +-
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c | 3 +
.../dc/clk_mgr/dcn21/rn_clk_mgr_vbios_smu.h | 4 +-
drivers/gpu/drm/amd/display/dc/dce60/Makefile | 2 +-
.../gpu/drm/amd/display/dc/dcn30/dcn30_resource.c | 16 +-
.../gpu/drm/amd/display/dc/dcn30/dcn30_resource.h | 3 +-
.../gpu/drm/amd/display/dc/dcn31/dcn31_resource.c | 2 +-
.../drm/amd/display/dc/dcn314/dcn314_resource.c | 77 +-
.../drm/amd/display/dc/dcn314/dcn314_resource.h | 4 +
.../gpu/drm/amd/display/dc/dml/dcn30/dcn30_fpu.c | 2 +-
.../drm/amd/display/modules/power/power_helpers.c | 35 +
.../drm/amd/display/modules/power/power_helpers.h | 3 +
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 40 +-
drivers/gpu/drm/bridge/adv7511/adv7533.c | 25 +-
drivers/gpu/drm/drm_probe_helper.c | 5 +-
drivers/gpu/drm/i915/display/intel_display.c | 2 +-
drivers/gpu/drm/lima/lima_drv.c | 6 +-
drivers/gpu/drm/mediatek/mtk_dp.c | 15 +-
drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 8 +-
drivers/gpu/drm/msm/adreno/adreno_device.c | 3 -
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 2 +-
drivers/gpu/drm/panel/panel-novatek-nt35950.c | 10 +-
drivers/gpu/drm/rcar-du/rcar_du_encoder.c | 4 +-
drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 3 -
drivers/gpu/drm/ttm/ttm_pool.c | 161 ++-
drivers/gpu/drm/vgem/vgem_fence.c | 1 +
drivers/gpu/host1x/context.c | 24 +-
drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 9 +
drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_desc.c | 2 +-
drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c | 11 +
drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c | 10 +-
drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.h | 8 +-
drivers/hte/hte-tegra194-test.c | 1 +
drivers/hte/hte-tegra194.c | 2 +-
drivers/hwmon/adt7475.c | 6 +-
drivers/hwmon/k10temp.c | 4 +-
drivers/hwmon/pmbus/fsp-3y.c | 1 -
drivers/hwtracing/coresight/coresight-etm-perf.c | 1 +
drivers/i2c/busses/i2c-cadence.c | 6 +-
drivers/i2c/busses/i2c-omap.c | 2 +-
drivers/i2c/busses/i2c-xiic.c | 4 +-
drivers/iio/adc/palmas_gpadc.c | 2 +-
drivers/iio/addac/stx104.c | 12 +
drivers/iio/light/max44009.c | 13 +-
drivers/infiniband/core/cm.c | 3 +-
drivers/infiniband/hw/erdma/erdma_hw.h | 4 +
drivers/infiniband/hw/erdma/erdma_verbs.c | 17 +-
drivers/infiniband/hw/hfi1/ipoib_tx.c | 6 +-
drivers/infiniband/hw/hfi1/mmu_rb.c | 73 +-
drivers/infiniband/hw/hfi1/mmu_rb.h | 8 +-
drivers/infiniband/hw/hfi1/sdma.c | 21 +-
drivers/infiniband/hw/hfi1/sdma.h | 16 +-
drivers/infiniband/hw/hfi1/sdma_txreq.h | 1 +
drivers/infiniband/hw/hfi1/trace_mmu.h | 4 -
drivers/infiniband/hw/hfi1/user_sdma.c | 600 ++++++++----
drivers/infiniband/hw/hfi1/user_sdma.h | 5 -
drivers/infiniband/hw/hfi1/verbs.c | 4 +-
drivers/infiniband/hw/hfi1/vnic_sdma.c | 1 +
drivers/infiniband/hw/mlx4/qp.c | 8 +-
drivers/infiniband/hw/mlx5/devx.c | 31 +-
drivers/infiniband/hw/mlx5/qp.c | 2 +-
drivers/infiniband/hw/mlx5/umr.c | 6 +-
drivers/infiniband/sw/rdmavt/qp.c | 2 -
drivers/infiniband/sw/siw/siw_main.c | 3 -
drivers/infiniband/sw/siw/siw_qp_tx.c | 2 +-
drivers/infiniband/ulp/isert/ib_isert.c | 4 +-
drivers/infiniband/ulp/srpt/ib_srpt.c | 23 +-
drivers/input/touchscreen/raspberrypi-ts.c | 3 +-
drivers/interconnect/qcom/icc-rpm.c | 7 -
drivers/interconnect/qcom/icc-rpm.h | 1 -
drivers/interconnect/qcom/msm8996.c | 1 -
drivers/iommu/amd/amd_iommu_types.h | 4 +-
drivers/iommu/amd/iommu.c | 6 +-
drivers/iommu/iommu.c | 9 +-
drivers/iommu/mtk_iommu.c | 8 +
drivers/leds/Kconfig | 2 +-
drivers/leds/leds-tca6507.c | 5 +-
drivers/macintosh/Kconfig | 1 +
drivers/macintosh/windfarm_smu_sat.c | 1 +
drivers/mailbox/mailbox-mpfs.c | 12 +-
drivers/mailbox/zynqmp-ipi-mailbox.c | 6 +-
drivers/md/dm-clone-target.c | 1 +
drivers/md/dm-flakey.c | 4 +-
drivers/md/dm-integrity.c | 8 +-
drivers/md/dm-ioctl.c | 12 +-
drivers/md/dm-table.c | 19 +-
drivers/md/dm-verity-target.c | 2 +-
drivers/md/raid10.c | 96 +-
drivers/md/raid5.c | 45 +-
drivers/media/i2c/hi846.c | 11 +-
drivers/media/i2c/max9286.c | 1 +
drivers/media/i2c/ov8856.c | 40 -
drivers/media/pci/dm1105/dm1105.c | 1 +
drivers/media/pci/saa7134/saa7134-ts.c | 1 +
drivers/media/pci/saa7134/saa7134-vbi.c | 1 +
drivers/media/pci/saa7134/saa7134-video.c | 1 +
drivers/media/platform/amphion/vdec.c | 32 +
drivers/media/platform/amphion/vpu_codec.h | 3 +-
drivers/media/platform/amphion/vpu_malone.c | 4 +-
.../media/platform/mediatek/mdp3/mtk-mdp3-m2m.c | 8 +-
.../media/platform/mediatek/mdp3/mtk-mdp3-regs.c | 10 +-
.../platform/mediatek/vcodec/mtk_vcodec_dec.c | 24 +-
.../platform/mediatek/vcodec/mtk_vcodec_dec_drv.c | 3 +-
.../platform/mediatek/vcodec/mtk_vcodec_dec_hw.c | 8 +
.../mediatek/vcodec/mtk_vcodec_dec_stateful.c | 12 +-
.../mediatek/vcodec/mtk_vcodec_dec_stateless.c | 14 +-
.../mediatek/vcodec/vdec/vdec_h264_req_multi_if.c | 2 +-
.../mediatek/vcodec/vdec/vdec_vp9_req_lat_if.c | 2 +-
.../platform/mediatek/vcodec/vdec_msg_queue.c | 95 +-
.../platform/mediatek/vcodec/vdec_msg_queue.h | 12 +
drivers/media/platform/qcom/venus/vdec.c | 16 +-
drivers/media/platform/renesas/rcar_fdp1.c | 11 +-
drivers/media/platform/st/sti/bdisp/bdisp-v4l2.c | 2 +
drivers/media/rc/gpio-ir-recv.c | 2 +
drivers/media/v4l2-core/v4l2-async.c | 13 +-
drivers/mfd/arizona-spi.c | 1 +
drivers/mfd/ocelot-spi.c | 1 +
drivers/mfd/tqmx86.c | 52 +-
drivers/misc/vmw_vmci/vmci_host.c | 8 +-
drivers/mmc/host/sdhci-of-esdhc.c | 24 +-
drivers/mtd/mtdcore.c | 23 +-
drivers/mtd/spi-nor/core.c | 4 +-
drivers/mtd/ubi/eba.c | 19 +-
drivers/net/dsa/qca/qca8k-8xxx.c | 1 -
drivers/net/ethernet/amd/nmclan_cs.c | 2 +-
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 3 +-
drivers/net/ethernet/intel/i40e/i40e.h | 6 +-
drivers/net/ethernet/intel/i40e/i40e_adminq.c | 68 +-
drivers/net/ethernet/intel/i40e/i40e_alloc.h | 22 +-
drivers/net/ethernet/intel/i40e/i40e_client.c | 12 +-
drivers/net/ethernet/intel/i40e/i40e_common.c | 1034 +++++++++-----------
drivers/net/ethernet/intel/i40e/i40e_dcb.c | 60 +-
drivers/net/ethernet/intel/i40e/i40e_dcb.h | 28 +-
drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c | 16 +-
drivers/net/ethernet/intel/i40e/i40e_ddp.c | 14 +-
drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 8 +-
drivers/net/ethernet/intel/i40e/i40e_diag.c | 12 +-
drivers/net/ethernet/intel/i40e/i40e_diag.h | 4 +-
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 65 +-
drivers/net/ethernet/intel/i40e/i40e_hmc.c | 56 +-
drivers/net/ethernet/intel/i40e/i40e_hmc.h | 46 +-
drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c | 94 +-
drivers/net/ethernet/intel/i40e/i40e_lan_hmc.h | 34 +-
drivers/net/ethernet/intel/i40e/i40e_main.c | 404 ++++----
drivers/net/ethernet/intel/i40e/i40e_nvm.c | 252 ++---
drivers/net/ethernet/intel/i40e/i40e_osdep.h | 1 -
drivers/net/ethernet/intel/i40e/i40e_prototype.h | 677 +++++++------
drivers/net/ethernet/intel/i40e/i40e_status.h | 35 -
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 94 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 23 +-
drivers/net/ethernet/mellanox/mlx5/core/dev.c | 4 +-
drivers/net/ethernet/mellanox/mlx5/core/devlink.c | 6 +-
.../ethernet/mellanox/mlx5/core/en/tc/post_act.c | 11 +-
.../ethernet/mellanox/mlx5/core/en/tc/post_act.h | 2 +-
.../net/ethernet/mellanox/mlx5/core/en/tc/sample.c | 4 +-
drivers/net/ethernet/mellanox/mlx5/core/en_fs.c | 5 +-
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 1 +
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 2 +
.../net/ethernet/mellanox/mlx5/core/esw/vporttbl.c | 12 +-
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | 2 +-
.../ethernet/mellanox/mlx5/core/eswitch_offloads.c | 4 +-
drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c | 8 +-
drivers/net/ethernet/mellanox/mlx5/core/health.c | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/main.c | 16 +-
.../net/ethernet/mellanox/mlx5/core/mlx5_core.h | 6 +-
.../ethernet/mellanox/mlx5/core/sf/dev/driver.c | 2 +-
drivers/net/ethernet/sfc/ef100_tx.c | 3 +-
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 197 ++--
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 12 +-
drivers/net/ethernet/sun/sunhme.c | 2 +-
drivers/net/pcs/pcs-xpcs.c | 13 +-
drivers/net/phy/sfp.c | 4 +
drivers/net/wireguard/timers.c | 8 +-
drivers/net/wireless/ath/ath11k/ahb.c | 14 +-
drivers/net/wireless/ath/ath11k/dbring.c | 12 +-
drivers/net/wireless/ath/ath11k/mac.h | 2 +-
drivers/net/wireless/ath/ath11k/mhi.c | 2 +-
drivers/net/wireless/ath/ath11k/peer.c | 5 +-
drivers/net/wireless/ath/ath5k/ahb.c | 10 +-
drivers/net/wireless/ath/ath5k/eeprom.c | 2 +-
drivers/net/wireless/ath/ath6kl/bmi.c | 2 +-
drivers/net/wireless/ath/ath6kl/htc_pipe.c | 4 +-
drivers/net/wireless/ath/ath9k/hif_usb.c | 19 +
.../broadcom/brcm80211/brcmfmac/cfg80211.c | 14 +-
drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 8 +-
drivers/net/wireless/intel/iwlwifi/fw/debugfs.c | 4 +-
drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c | 6 +
drivers/net/wireless/intel/iwlwifi/iwl-debug.c | 3 +-
drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 1 +
drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c | 10 +
drivers/net/wireless/intel/iwlwifi/mvm/rx.c | 5 +-
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 5 +-
drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 1 -
drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 12 +-
drivers/net/wireless/mediatek/mt76/dma.c | 2 +
drivers/net/wireless/mediatek/mt76/mt76.h | 9 +-
drivers/net/wireless/mediatek/mt76/mt7603/mac.c | 5 +-
drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 13 +-
.../net/wireless/mediatek/mt76/mt76_connac_mac.c | 3 +-
.../net/wireless/mediatek/mt76/mt76_connac_mcu.c | 13 +-
drivers/net/wireless/mediatek/mt76/mt76x02_mac.c | 5 +-
drivers/net/wireless/mediatek/mt76/mt7915/soc.c | 2 +
drivers/net/wireless/mediatek/mt76/mt7921/dma.c | 40 +-
drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 20 -
drivers/net/wireless/mediatek/mt76/mt7921/pci.c | 9 +-
drivers/net/wireless/mediatek/mt76/mt7921/usb.c | 2 +-
drivers/net/wireless/mediatek/mt76/tx.c | 4 +
drivers/net/wireless/mediatek/mt76/util.c | 10 +-
drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | 1 +
.../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c | 1 +
drivers/net/wireless/realtek/rtlwifi/debug.c | 12 +-
drivers/net/wireless/realtek/rtw88/mac.c | 8 +-
drivers/net/wireless/realtek/rtw89/core.c | 10 +-
drivers/net/wireless/realtek/rtw89/pci.c | 19 +-
drivers/net/wwan/t7xx/Makefile | 2 -
drivers/nvme/host/core.c | 5 +-
drivers/nvme/host/trace.h | 15 +-
drivers/nvme/target/admin-cmd.c | 45 +-
drivers/nvme/target/fcloop.c | 48 +-
drivers/nvme/target/nvmet.h | 2 +-
drivers/nvme/target/zns.c | 18 +-
drivers/of/device.c | 7 +-
drivers/pci/controller/dwc/Kconfig | 1 +
drivers/pci/controller/dwc/pci-imx6.c | 7 +
drivers/pci/controller/dwc/pcie-qcom.c | 8 +-
drivers/pci/hotplug/pciehp_pci.c | 15 +
drivers/pci/pcie/edr.c | 1 +
drivers/pci/quirks.c | 13 +
drivers/perf/arm-cmn.c | 59 +-
drivers/perf/riscv_pmu_sbi.c | 2 +-
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 2 +-
drivers/phy/tegra/xusb.c | 2 +
drivers/phy/ti/phy-j721e-wiz.c | 11 +-
drivers/pinctrl/bcm/pinctrl-bcm2835.c | 19 +-
drivers/pinctrl/qcom/pinctrl-lpass-lpi.c | 14 +-
drivers/pinctrl/ralink/pinctrl-mt7620.c | 1 +
drivers/pinctrl/ralink/pinctrl-mt7621.c | 1 +
drivers/pinctrl/ralink/pinctrl-rt2880.c | 1 +
drivers/pinctrl/ralink/pinctrl-rt305x.c | 1 +
drivers/pinctrl/ralink/pinctrl-rt3883.c | 1 +
drivers/pinctrl/renesas/pfc-r8a779a0.c | 8 -
drivers/pinctrl/renesas/pfc-r8a779f0.c | 2 +-
drivers/pinctrl/renesas/pfc-r8a779g0.c | 990 ++++++++++---------
drivers/platform/chrome/cros_typec_switch.c | 1 +
drivers/platform/x86/amd/Kconfig | 2 +-
drivers/platform/x86/amd/pmc.c | 157 ++-
drivers/platform/x86/amd/pmf/Kconfig | 1 +
drivers/platform/x86/amd/pmf/core.c | 22 +-
drivers/platform/x86/thinkpad_acpi.c | 8 +
drivers/power/supply/generic-adc-battery.c | 3 +
drivers/power/supply/rk817_charger.c | 33 +-
drivers/pwm/pwm-meson.c | 6 +-
drivers/pwm/pwm-mtk-disp.c | 34 +-
drivers/regulator/core.c | 100 +-
drivers/regulator/stm32-pwr.c | 7 +-
drivers/rpmsg/qcom_glink_native.c | 10 +-
drivers/rtc/rtc-meson-vrtc.c | 4 +-
drivers/rtc/rtc-omap.c | 1 +
drivers/rtc/rtc-ti-k3.c | 3 +-
drivers/s390/block/dasd.c | 2 +-
drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 6 +-
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 6 +-
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 6 +-
drivers/scsi/libsas/sas_ata.c | 18 +
drivers/scsi/lpfc/lpfc_init.c | 10 +-
drivers/scsi/megaraid.c | 1 +
drivers/scsi/mpi3mr/mpi3mr_fw.c | 2 +-
drivers/soc/bcm/brcmstb/biuctrl.c | 4 +
drivers/soc/renesas/renesas-soc.c | 5 +-
drivers/soc/ti/pm33xx.c | 5 +-
drivers/soundwire/cadence_master.c | 30 +-
drivers/soundwire/cadence_master.h | 6 +-
drivers/soundwire/intel.c | 99 +-
drivers/soundwire/qcom.c | 2 +-
drivers/spi/atmel-quadspi.c | 30 +-
drivers/spi/spi-bcm63xx.c | 2 -
drivers/spi/spi-cadence-quadspi.c | 32 +-
drivers/spi/spi-fsl-spi.c | 12 +-
drivers/spi/spi-imx.c | 12 +-
drivers/spi/spi-qup.c | 22 +-
drivers/spmi/spmi.c | 3 +-
drivers/staging/iio/resolver/ad2s1210.c | 2 +-
.../media/deprecated/saa7146/av7110/av7110_av.c | 4 +-
drivers/staging/media/rkvdec/rkvdec.c | 2 +
drivers/staging/media/sunxi/cedrus/cedrus.c | 1 +
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 1 +
drivers/staging/rtl8723bs/core/rtw_mlme.c | 8 +-
drivers/target/iscsi/iscsi_target.c | 36 +-
drivers/target/iscsi/iscsi_target_login.c | 7 +
drivers/target/target_core_device.c | 1 +
drivers/target/target_core_internal.h | 1 -
drivers/target/target_core_tmr.c | 26 +-
drivers/target/target_core_tpg.c | 2 +-
drivers/target/target_core_transport.c | 199 ++--
drivers/target/target_core_xcopy.c | 120 ++-
drivers/target/target_core_xcopy.h | 2 +-
drivers/thermal/mtk_thermal.c | 14 +-
drivers/thunderbolt/tb.h | 2 +-
drivers/tty/serial/8250/8250.h | 12 +
drivers/tty/serial/8250/8250_bcm7271.c | 18 +-
drivers/tty/serial/8250/8250_port.c | 11 +-
drivers/tty/serial/fsl_lpuart.c | 2 +-
drivers/tty/serial/max310x.c | 17 +-
drivers/tty/serial/serial_core.c | 4 +-
drivers/tty/serial/stm32-usart.c | 5 +-
drivers/tty/tty.h | 2 +
drivers/tty/tty_io.c | 4 +-
drivers/tty/tty_ioctl.c | 45 +-
drivers/usb/chipidea/core.c | 2 +-
drivers/usb/dwc3/core.c | 15 +-
drivers/usb/dwc3/gadget.c | 60 +-
drivers/usb/gadget/function/f_tcm.c | 4 +-
drivers/usb/gadget/udc/core.c | 151 ++-
drivers/usb/gadget/udc/renesas_usb3.c | 1 +
drivers/usb/gadget/udc/tegra-xudc.c | 2 +-
drivers/usb/host/xhci-debugfs.c | 1 +
drivers/usb/host/xhci-rcar.c | 3 -
drivers/usb/mtu3/mtu3_qmu.c | 5 +-
drivers/vhost/vdpa.c | 8 +-
drivers/video/fbdev/mmp/hw/mmp_ctrl.c | 2 +-
drivers/virt/coco/sev-guest/sev-guest.c | 27 +-
drivers/virtio/virtio_ring.c | 22 +-
drivers/xen/pcpu.c | 20 +
fs/Makefile | 3 +-
fs/afs/dir.c | 4 +
fs/afs/inode.c | 10 +-
fs/btrfs/ioctl.c | 5 +
fs/ceph/caps.c | 2 +-
fs/ceph/debugfs.c | 18 +-
fs/ceph/mds_client.c | 72 +-
fs/ceph/mds_client.h | 3 +-
fs/ceph/super.h | 2 +
fs/cifs/cifs_debug.c | 7 +-
fs/cifs/cifs_debug.h | 12 +-
fs/cifs/connect.c | 10 +-
fs/cifs/file.c | 16 +
fs/cifs/misc.c | 8 +-
fs/cifs/sess.c | 7 +-
fs/cifs/smb2pdu.c | 15 +-
fs/crypto/inline_crypt.c | 14 +-
fs/erofs/internal.h | 3 +-
fs/erofs/super.c | 22 +-
fs/erofs/zmap.c | 4 +
fs/ext4/extents.c | 3 +-
fs/ext4/inode.c | 3 +
fs/f2fs/compress.c | 13 +-
fs/f2fs/data.c | 5 +-
fs/f2fs/f2fs.h | 1 +
fs/f2fs/file.c | 21 +-
fs/f2fs/gc.c | 2 +-
fs/f2fs/segment.c | 73 +-
fs/f2fs/segment.h | 3 +
fs/f2fs/super.c | 2 +-
fs/f2fs/sysfs.c | 4 +-
fs/jbd2/transaction.c | 3 +
fs/ksmbd/auth.c | 19 +-
fs/ksmbd/mgmt/tree_connect.c | 10 +-
fs/ksmbd/mgmt/tree_connect.h | 3 +
fs/ksmbd/server.c | 1 +
fs/ksmbd/smb2pdu.c | 21 +-
fs/nfs/nfs4state.c | 4 +
fs/nilfs2/bmap.c | 16 +-
fs/nilfs2/segment.c | 5 +-
fs/ntfs3/fslog.c | 6 +-
fs/ntfs3/index.c | 8 +
fs/ntfs3/inode.c | 2 +-
fs/ntfs3/namei.c | 10 +
fs/ntfs3/ntfs_fs.h | 1 +
fs/pstore/pmsg.c | 7 +-
fs/reiserfs/xattr_security.c | 8 +-
fs/ubifs/dir.c | 7 +-
fs/ubifs/tnc.c | 142 +--
fs/xfs/libxfs/xfs_sb.c | 11 +-
include/asm-generic/io.h | 4 +-
include/drm/i915_pciids.h | 1 -
include/linux/blk-crypto-profile.h | 12 -
include/linux/blk-crypto.h | 15 +-
include/linux/mailbox/zynqmp-ipi-message.h | 2 +-
include/linux/mlx5/mlx5_ifc.h | 3 +-
include/linux/netfilter/nfnetlink.h | 1 -
include/linux/posix-timers.h | 17 +-
include/linux/sunrpc/sched.h | 3 +-
include/linux/tick.h | 2 +
include/linux/vt_buffer.h | 2 +-
include/net/bond_alb.h | 4 +-
include/net/netfilter/nf_conntrack_core.h | 6 +-
include/net/scm.h | 13 +-
include/net/xsk_buff_pool.h | 9 +-
include/scsi/sas_ata.h | 6 +
...chip_offset_byte.h => acp63_chip_offset_byte.h} | 2 +-
include/target/iscsi/iscsi_target_core.h | 1 +
include/target/target_core_base.h | 14 +-
include/target/target_core_fabric.h | 15 +-
include/trace/events/qrtr.h | 33 +-
include/trace/events/timer.h | 3 +-
include/trace/stages/stage5_get_offsets.h | 21 +-
include/uapi/linux/btrfs.h | 1 +
include/uapi/linux/const.h | 2 +-
include/xen/xen.h | 11 +
io_uring/rsrc.c | 2 +-
kernel/bpf/btf.c | 16 +-
kernel/bpf/cgroup.c | 9 +-
kernel/bpf/verifier.c | 32 +-
kernel/dma/swiotlb.c | 16 +-
kernel/events/core.c | 4 +-
kernel/kcsan/core.c | 17 +-
kernel/kheaders.c | 10 +-
kernel/power/hibernate.c | 15 +-
kernel/power/power.h | 1 +
kernel/power/swap.c | 8 +-
kernel/rcu/tree.c | 1 +
kernel/relay.c | 3 +-
kernel/sched/deadline.c | 1 +
kernel/sched/fair.c | 2 +-
kernel/sched/rt.c | 4 +
kernel/time/posix-cpu-timers.c | 81 +-
kernel/time/posix-timers.c | 4 +
kernel/time/tick-common.c | 12 +-
kernel/time/tick-sched.c | 16 +-
kernel/time/timekeeping.c | 4 +-
kernel/trace/ring_buffer.c | 20 +-
kernel/trace/trace.c | 2 +-
kernel/trace/trace_events_user.c | 3 +
kernel/workqueue.c | 10 +-
lib/debugobjects.c | 146 +--
lib/kunit/debugfs.c | 16 +-
lib/kunit/executor.c | 6 +-
lib/kunit/test.c | 28 +-
mm/kasan/hw_tags.c | 4 +-
mm/mempolicy.c | 4 +-
mm/vmscan.c | 10 +
net/8021q/vlan_dev.c | 2 +-
net/core/skbuff.c | 3 +
net/dccp/ipv6.c | 1 +
net/ipv4/ip_output.c | 16 +-
net/ipv6/ip6_input.c | 14 +-
net/ipv6/raw.c | 5 +-
net/ipv6/tcp_ipv6.c | 2 +
net/ipv6/udp.c | 2 +
net/netfilter/nf_conntrack_bpf.c | 1 +
net/netfilter/nf_conntrack_core.c | 1 -
net/netfilter/nf_conntrack_netlink.c | 16 +-
net/netfilter/nf_tables_api.c | 8 +-
net/netfilter/nfnetlink.c | 2 -
net/netlink/af_netlink.c | 75 +-
net/packet/af_packet.c | 30 +-
net/packet/diag.c | 4 +-
net/packet/internal.h | 26 +-
net/sched/sch_fq.c | 6 +-
net/sunrpc/clnt.c | 3 -
net/sunrpc/sched.c | 1 -
net/xdp/xsk_queue.h | 1 +
scripts/gdb/linux/clk.py | 2 +
scripts/gdb/linux/constants.py.in | 2 +
scripts/gdb/linux/genpd.py | 4 +-
scripts/gdb/linux/timerlist.py | 4 +-
scripts/gdb/linux/utils.py | 5 +-
scripts/gdb/vmlinux-gdb.py | 5 +-
security/integrity/ima/Kconfig | 2 +-
security/selinux/Makefile | 4 +-
sound/pci/hda/patch_realtek.c | 5 +
sound/soc/amd/Kconfig | 4 +-
sound/soc/amd/ps/{acp62.h => acp63.h} | 10 +-
sound/soc/amd/ps/pci-ps.c | 130 ++-
sound/soc/amd/ps/ps-mach.c | 30 +-
sound/soc/amd/ps/ps-pdm-dma.c | 188 ++--
sound/soc/amd/yc/acp6x-mach.c | 7 +
sound/soc/codecs/cs35l41.c | 34 +-
sound/soc/codecs/da7213.c | 6 +
sound/soc/codecs/es8316.c | 14 +-
sound/soc/fsl/fsl_mqs.c | 15 +-
sound/soc/intel/boards/bytcr_rt5640.c | 12 +
sound/soc/intel/boards/sof_sdw.c | 11 +
sound/soc/intel/common/soc-acpi-intel-adl-match.c | 20 +
sound/soc/soc-compress.c | 3 +
sound/soc/soc-pcm.c | 4 +
sound/usb/quirks-table.h | 58 ++
tools/arch/x86/kcpuid/cpuid.csv | 4 +-
tools/bpf/bpftool/json_writer.c | 3 -
tools/bpf/bpftool/xlated_dumper.c | 7 +
tools/lib/bpf/gen_loader.c | 10 +-
tools/objtool/check.c | 11 -
tools/perf/util/auxtrace.c | 5 +-
.../perf/util/intel-pt-decoder/intel-pt-decoder.c | 2 +
tools/testing/selftests/bpf/network_helpers.c | 2 +-
tools/testing/selftests/bpf/prog_tests/align.c | 4 +-
.../selftests/bpf/prog_tests/cg_storage_multi.c | 8 +-
.../bpf/prog_tests/get_stackid_cannot_attach.c | 1 +
.../selftests/bpf/prog_tests/perf_event_stackmap.c | 3 +-
.../bpf/prog_tests/stacktrace_build_id_nmi.c | 15 -
tools/testing/selftests/bpf/test_xsk.sh | 1 +
tools/testing/selftests/bpf/testing_helpers.c | 20 +
tools/testing/selftests/bpf/testing_helpers.h | 2 +
tools/testing/selftests/bpf/xskxceiver.c | 19 +-
tools/testing/selftests/bpf/xskxceiver.h | 1 -
.../selftests/mount_setattr/mount_setattr_test.c | 1 +
.../mmcra_thresh_marked_sample_test.c | 4 +-
tools/testing/selftests/resctrl/cache.c | 4 +-
tools/testing/selftests/resctrl/cat_test.c | 2 +-
tools/testing/selftests/resctrl/cmt_test.c | 2 +-
tools/testing/selftests/resctrl/fill_buf.c | 2 +
tools/testing/selftests/resctrl/mba_test.c | 9 +-
tools/testing/selftests/resctrl/mbm_test.c | 2 +-
tools/testing/selftests/resctrl/resctrl.h | 2 +
tools/testing/selftests/resctrl/resctrl_val.c | 21 +-
.../selftests/tc-testing/tc-tests/qdiscs/fq.json | 22 +
tools/testing/selftests/user_events/ftrace_test.c | 5 +
720 files changed, 7886 insertions(+), 6580 deletions(-)Greg Kroah-Hartman
maintainerPATCH 3/611 ASoC: soc-pcm: fix hw->formats cleared by soc_pcm_hw_init() for dpcm
From: Shengjiu Wang <[email protected]>
[ Upstream commit 083a25b18d6ad9f1f540e629909aa3eaaaf01823 ]
The hw->formats may be set by snd_dmaengine_pcm_refine_runtime_hwparams() in component's startup()/open(), but soc_pcm_hw_init() will init hw->formats in dpcm_runtime_setup_fe() after component's startup()/open(), which causes the valuable hw->formats to be cleared.
So need to store the hw->formats before initialization, then restore it after initialization.
--- sound/soc/soc-pcm.c | 4 ++++ 1 file changed, 4 insertions(+)
sound/soc/soc-pcm.c +4 -0
@@ -1649,10 +1649,14 @@ static void dpcm_runtime_setup_fe(struct snd_pcm_substream *substream)struct snd_pcm_hardware *hw = &runtime->hw;struct snd_soc_dai *dai;int stream = substream->stream; +u64 formats = hw->formats;int i;soc_pcm_hw_init (hw); +if (formats) + hw->formats &= formats; +for_each_rtd_cpu_dais (fe, i, dai) {struct snd_soc_pcm_stream *cpu_stream;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 12/611 net: sfp: add quirk enabling 2500Base-x for HG MXPD-483II
In reply to Greg Kroah-HartmanFrom: Daniel Golle <[email protected]>
[ Upstream commit ad651d68cee75e9ac20002254c4e5d09ee67a84b ]
The HG MXPD-483II 1310nm SFP module is meant to operate with 2500Base-X, however, in their EEPROM they incorrectly specify:
Transceiver type : Ethernet: 1000BASE-LX
...
BR, Nominal : 2600MBd
Use sfp_quirk_2500basex for this module to allow 2500Base-X mode anyway.
https://forum.banana-pi.org/t/bpi-r3-sfp-module-compatibility/14573/60
--- drivers/net/phy/sfp.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/phy/sfp.c +4 -0
@@ -395,6 +395,10 @@ static const struct sfp_quirk sfp_quirks[] = {SFP_QUIRK_F ("HALNy" ,"HL-GSFP" , sfp_fixup_halny_gsfp), +// HG MXPD-483II-F 2.5G supports 2500Base-X, but incorrectly reports +// 2600MBd in their EERPOM +SFP_QUIRK_M ("HG GENUINE" ,"MXPD-483II" , sfp_quirk_2500basex), +// Huawei MA5671A can operate at 2500base-X, but report 1.2GBd NRZ in // their EEPROM SFP_QUIRK("HUAWEI", "MA5671A", sfp_quirk_2500basex,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 13/611 platform/x86: thinkpad_acpi: Add missing T14s Gen1 type to s2idle quirk list
In reply to Greg Kroah-HartmanFrom: Benjamin Asbach <[email protected]>
[ Upstream commit 9a469c6dfab38326f99f105386db84230be09ee3 ]
Quoted 9 lines
From the commit message adding the first s2idle quirks:
Lenovo laptops that contain NVME SSDs across a variety of generations have trouble resuming from suspend to idle when the IOMMU translation layer is active for the NVME storage device.
This generally manifests as a large resume delay or page faults. These delays and page faults occur as a result of a Lenovo BIOS specific SMI that runs during the
D3->D0transition on NVME devices.
Add the DMI ids for another variant of the T14s Gen1, which also needs the s2idle quirk.
--- drivers/platform/x86/thinkpad_acpi.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/platform/x86/thinkpad_acpi.c +8 -0
@@ -4481,6 +4481,14 @@ static const struct dmi_system_id fwbug_list[] __initconst = { DMI_MATCH(DMI_PRODUCT_NAME, "20UH"), } }, + { + .ident = "T14s Gen1 AMD", + .driver_data = &quirk_s2idle_bug, + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_NAME, "20UJ"), + } + }, { .ident ="P14s Gen1 AMD" , .driver_data = &quirk_s2idle_bug,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 14/611 wifi: ath11k: reduce the MHI timeout to 20s
In reply to Greg Kroah-HartmanFrom: Kalle Valo <[email protected]>
[ Upstream commit cf5fa3ca0552f1b7ba8490de40700bbfb6979b17 ]
Currently ath11k breaks after hibernation, the reason being that ath11k expects that the wireless device will have power during suspend and the firmware will continue running. But of course during hibernation the power from the device is cut off and firmware is not running when resuming, so ath11k will fail.
(The reason why ath11k needs the firmware running is the interaction between mac80211 and MHI stack, it's a long story and more info in the bugzilla report.)
In SUSE kernels the watchdog timeout is reduced from the default 120 to 60 seconds:
CONFIG_DPM_WATCHDOG_TIMEOUT=60
But as the ath11k MHI timeout is 90 seconds the kernel will crash before will ath11k will recover in resume callback. To avoid the crash reduce the MHI timeout to just 20 seconds.
Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.9
--- drivers/net/wireless/ath/ath11k/mhi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath11k/mhi.c +1 -1
@@ -16,7 +16,7 @@#include "pci.h" #include "pcic.h" -#define MHI_TIMEOUT_DEFAULT_MS 90000 +#define MHI_TIMEOUT_DEFAULT_MS 20000#define RDDM_DUMP_SIZE 0x420000static struct mhi_channel_config ath11k_mhi_channels_qca6390[] = {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 15/611 tracing: Error if a trace event has an array for a __field()
In reply to Greg Kroah-HartmanFrom: Steven Rostedt (Google) <[email protected]>
[ Upstream commit f82e7ca019dfad3b006fd3b772f7ac569672db55 ]
A __field() in the TRACE_EVENT() macro is used to set up the fields of the trace event data. It is for single storage units (word, char, int, pointer, etc) and not for complex structures or arrays. Unfortunately, there's nothing preventing the build from accepting:
__field(int, arr[5]);
from building. It will turn into a array value. This use to work fine, as the offset and size use to be determined by the macro using the field name, but things have changed and the offset and size are now determined by the type. So the above would only be size 4, and the next field will be located 4 bytes from it (instead of 20).
The proper way to declare static arrays is to use the __array() macro.
Instead of __field(int, arr[5]) it should be __array(int, arr, 5).
Add some macro tricks to the building of a trace event from the TRACE_EVENT() macro such that __field(int, arr[5]) will fail to build. A comment by the failure will explain why the build failed.
--- include/trace/stages/stage5_get_offsets.h | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)
include/trace/stages/stage5_get_offsets.h +17 -4
@@ -9,17 +9,30 @@#undef __entry#define __entry entry +/* +* Fields should never declare an array: i.e. __field(int, arr[5]) +* If they do, it will cause issues in parsing and possibly corrupt the +* events. To prevent that from happening, test the sizeof() a fictitious +* type called "struct _test_no_array_##item" which will fail if "item" +* contains array elements (like "arr[5]"). +* +* If you hit this, use __array(int, arr, 5) instead. +*/ #undef __field -#define __field (type, item) +#define __field (type, item) \ + { (void)sizeof(struct _test_no_array_##item *); }#undef __field_ext -#define __field_ext (type, item, filter_type) +#define __field_ext (type, item, filter_type) \ + { (void)sizeof(struct _test_no_array_##item *); }#undef __field_struct -#define __field_struct (type, item) +#define __field_struct (type, item) \ + { (void)sizeof(struct _test_no_array_##item *); }#undef __field_struct_ext -#define __field_struct_ext (type, item, filter_type) +#define __field_struct_ext (type, item, filter_type) \ + { (void)sizeof(struct _test_no_array_##item *); }#undef __array#define __array (type, item, len)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 16/611 asm-generic/io.h: suppress endianness warnings for readq() and writeq()
In reply to Greg Kroah-HartmanFrom: Vladimir Oltean <[email protected]>
[ Upstream commit d564fa1ff19e893e2971d66e5c8f49dc1cdc8ffc ]
Commit c1d55d50139b ("asm-generic/io.h: Fix sparse warnings on big-endian architectures") missed fixing the 64-bit accessors.
Arnd explains in the attached link why the casts are necessary, even if __raw_readq() and __raw_writeq() do not take endian-specific types.
--- include/asm-generic/io.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/asm-generic/io.h +2 -2
@@ -236,7 +236,7 @@ static inline u64 readq(const volatile void __iomem *addr)log_read_mmio (64 , addr, _THIS_IP_);__io_br (); - val =__le64_to_cpu (__raw_readq (addr)); + val =__le64_to_cpu ((__le64 __force )__raw_readq (addr));__io_ar (val);log_post_read_mmio (val,64 , addr, _THIS_IP_);return val;
@@ -287,7 +287,7 @@ static inline void writeq(u64 value, volatile void __iomem *addr) {log_write_mmio (value,64 , addr, _THIS_IP_);__io_bw (); -__raw_writeq (__cpu_to_le64 (value), addr); +__raw_writeq ((u64 __force )__cpu_to_le64 (value), addr);__io_aw ();log_post_write_mmio (value,64 , addr, _THIS_IP_); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 17/611 x86/cpu: Add model number for Intel Arrow Lake processor
In reply to Greg Kroah-HartmanFrom: Tony Luck <[email protected]>
[ Upstream commit 81515ecf155a38f3532bf5ddef88d651898df6be ]
Successor to Lunar Lake.
--- arch/x86/include/asm/intel-family.h | 2 ++ 1 file changed, 2 insertions(+)
arch/x86/include/asm/intel-family.h +2 -0
@@ -125,6 +125,8 @@#define INTEL_FAM6_LUNARLAKE_M 0xBD +#define INTEL_FAM6_ARROWLAKE 0xC6 +/* "Small Core" Processors (Atom/E-Core) */ #define INTEL_FAM6_ATOM_BONNELL 0x1C/* Diamondville, Pineview */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 18/611 wireguard: timers: cast enum limits members to int in prints
In reply to Greg Kroah-HartmanFrom: Jiri Slaby (SUSE) <[email protected]>
commit 2d4ee16d969c97996e80e4c9cb6de0acaff22c9f upstream.
Since gcc13, each member of an enum has the same type as the enum. And that is inherited from its members. Provided "REKEY_AFTER_MESSAGES = 1ULL << 60", the named type is unsigned long.
This generates warnings with gcc-13:
error: format '%d' expects argument of type 'int', but argument 6 has type 'long unsigned int'
Cast those particular enum members to int when printing them.
--- drivers/net/wireguard/timers.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireguard/timers.c +4 -4
@@ -46,7 +46,7 @@ static void wg_expired_retransmit_handshif (peer->timer_handshake_attempts >MAX_TIMER_HANDSHAKES ) {pr_debug ("%s: Handshake for peer %llu (%pISpfsc) did not complete after %d attempts, giving up\n" , peer->device->dev->name, peer->internal_id, - &peer->endpoint.addr,MAX_TIMER_HANDSHAKES +2 ); + &peer->endpoint.addr, (int )MAX_TIMER_HANDSHAKES +2 );del_timer (&peer->timer_send_keepalive);/* We drop all packets without a keypair and don't try again,
@@ -64,7 +64,7 @@ static void wg_expired_retransmit_handsh ++peer->timer_handshake_attempts;pr_debug ("%s: Handshake for peer %llu (%pISpfsc) did not complete after %d seconds, retrying (try %d)\n" , peer->device->dev->name, peer->internal_id, - &peer->endpoint.addr,REKEY_TIMEOUT , + &peer->endpoint.addr, (int )REKEY_TIMEOUT , peer->timer_handshake_attempts +1 );/* We clear the endpoint address src address, in case this is
@@ -94,7 +94,7 @@ static void wg_expired_new_handshake(strpr_debug ("%s: Retrying handshake with peer %llu (%pISpfsc) because we stopped hearing back after %d seconds\n" , peer->device->dev->name, peer->internal_id, - &peer->endpoint.addr,KEEPALIVE_TIMEOUT +REKEY_TIMEOUT ); + &peer->endpoint.addr, (int )(KEEPALIVE_TIMEOUT +REKEY_TIMEOUT ));/* We clear the endpoint address src address, in case this is the cause * of trouble. */
@@ -126,7 +126,7 @@ static void wg_queued_expired_zero_key_mpr_debug ("%s: Zeroing out all keys for peer %llu (%pISpfsc), since we haven't received a new one in %d seconds\n" , peer->device->dev->name, peer->internal_id, - &peer->endpoint.addr,REJECT_AFTER_TIME *3 ); + &peer->endpoint.addr, (int )REJECT_AFTER_TIME *3 );wg_noise_handshake_clear (&peer->handshake);wg_noise_keypairs_clear (&peer->keypairs);wg_peer_put (peer);
Greg Kroah-Hartman
maintainerPATCH 19/611 wifi: mt76: mt7921e: Set memory space enable in PCI_COMMAND if unset
In reply to Greg Kroah-HartmanFrom: Mario Limonciello <[email protected]>
commit 09d4d6da1b65d09414e7bce61459593f3c80ead1 upstream.
When the BIOS has been configured for Fast Boot, systems with mt7921e have non-functional wifi. Turning on Fast boot caused both bus master enable and memory space enable bits in PCI_COMMAND not to get configured.
The mt7921 driver already sets bus master enable, but explicitly check and set memory access enable as well to fix this problem.
--- drivers/net/wireless/mediatek/mt76/mt7921/pci.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/wireless/mediatek/mt76/mt7921/pci.c +6 -0
@@ -256,6 +256,7 @@ static int mt7921_pci_probe(struct pci_dstruct mt7921_dev *dev;struct mt76_dev *mdev;int ret; +u16 cmd; ret =pcim_enable_device (pdev);if (ret)
@@ -265,6 +266,11 @@ static int mt7921_pci_probe(struct pci_dif (ret)return ret; +pci_read_config_word (pdev,PCI_COMMAND , &cmd); +if (!(cmd &PCI_COMMAND_MEMORY )) { + cmd |=PCI_COMMAND_MEMORY ; +pci_write_config_word (pdev,PCI_COMMAND , cmd); + }pci_set_master (pdev); ret =pci_alloc_irq_vectors (pdev,1 ,1 ,PCI_IRQ_ALL_TYPES );
Greg Kroah-Hartman
maintainerPATCH 20/611 ASoC: amd: fix ACP version typo mistake
In reply to Greg Kroah-HartmanFrom: syed saba kareem <[email protected]>
commit 4b19211435950a78af032c26ad64a5268e6012be upstream.
Pink Sardine is based on ACP6.3 architecture. This patch fixes the typo mistake acp6.2 -> acp6.3
---
include/sound/acp62_chip_offset_byte.h | 444 ---------------------------------
include/sound/acp63_chip_offset_byte.h | 444 +++++++++++++++++++++++++++++++++
sound/soc/amd/Kconfig | 4
sound/soc/amd/ps/acp62.h | 98 -------
sound/soc/amd/ps/acp63.h | 98 +++++++
sound/soc/amd/ps/pci-ps.c | 132 ++++-----
sound/soc/amd/ps/ps-mach.c | 30 +-
sound/soc/amd/ps/ps-pdm-dma.c | 188 ++++++-------
8 files changed, 719 insertions(+), 719 deletions(-)
rename include/sound/{acp62_chip_offset_byte.h => acp63_chip_offset_byte.h} (99%)
rename sound/soc/amd/ps/{acp62.h => acp63.h} (90%)include/sound/acp62_chip_offset_byte.h deleted +0 -444
@@ -1,444 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* -* AMD ACP 6.2 Register Documentation -* -* Copyright 2022 Advanced Micro Devices, Inc. -*/ - -#ifndef _acp_ip_OFFSET_HEADER -#define _acp_ip_OFFSET_HEADER - -/* Registers from ACP_DMA block */ -#define ACP_DMA_CNTL_0 0x0000000 -#define ACP_DMA_CNTL_1 0x0000004 -#define ACP_DMA_CNTL_2 0x0000008 -#define ACP_DMA_CNTL_3 0x000000C -#define ACP_DMA_CNTL_4 0x0000010 -#define ACP_DMA_CNTL_5 0x0000014 -#define ACP_DMA_CNTL_6 0x0000018 -#define ACP_DMA_CNTL_7 0x000001C -#define ACP_DMA_DSCR_STRT_IDX_0 0x0000020 -#define ACP_DMA_DSCR_STRT_IDX_1 0x0000024 -#define ACP_DMA_DSCR_STRT_IDX_2 0x0000028 -#define ACP_DMA_DSCR_STRT_IDX_3 0x000002C -#define ACP_DMA_DSCR_STRT_IDX_4 0x0000030 -#define ACP_DMA_DSCR_STRT_IDX_5 0x0000034 -#define ACP_DMA_DSCR_STRT_IDX_6 0x0000038 -#define ACP_DMA_DSCR_STRT_IDX_7 0x000003C -#define ACP_DMA_DSCR_CNT_0 0x0000040 -#define ACP_DMA_DSCR_CNT_1 0x0000044 -#define ACP_DMA_DSCR_CNT_2 0x0000048 -#define ACP_DMA_DSCR_CNT_3 0x000004C -#define ACP_DMA_DSCR_CNT_4 0x0000050 -#define ACP_DMA_DSCR_CNT_5 0x0000054 -#define ACP_DMA_DSCR_CNT_6 0x0000058 -#define ACP_DMA_DSCR_CNT_7 0x000005C -#define ACP_DMA_PRIO_0 0x0000060 -#define ACP_DMA_PRIO_1 0x0000064 -#define ACP_DMA_PRIO_2 0x0000068 -#define ACP_DMA_PRIO_3 0x000006C -#define ACP_DMA_PRIO_4 0x0000070 -#define ACP_DMA_PRIO_5 0x0000074 -#define ACP_DMA_PRIO_6 0x0000078 -#define ACP_DMA_PRIO_7 0x000007C -#define ACP_DMA_CUR_DSCR_0 0x0000080 -#define ACP_DMA_CUR_DSCR_1 0x0000084 -#define ACP_DMA_CUR_DSCR_2 0x0000088 -#define ACP_DMA_CUR_DSCR_3 0x000008C -#define ACP_DMA_CUR_DSCR_4 0x0000090 -#define ACP_DMA_CUR_DSCR_5 0x0000094 -#define ACP_DMA_CUR_DSCR_6 0x0000098 -#define ACP_DMA_CUR_DSCR_7 0x000009C -#define ACP_DMA_CUR_TRANS_CNT_0 0x00000A0 -#define ACP_DMA_CUR_TRANS_CNT_1 0x00000A4 -#define ACP_DMA_CUR_TRANS_CNT_2 0x00000A8 -#define ACP_DMA_CUR_TRANS_CNT_3 0x00000AC -#define ACP_DMA_CUR_TRANS_CNT_4 0x00000B0 -#define ACP_DMA_CUR_TRANS_CNT_5 0x00000B4 -#define ACP_DMA_CUR_TRANS_CNT_6 0x00000B8 -#define ACP_DMA_CUR_TRANS_CNT_7 0x00000BC -#define ACP_DMA_ERR_STS_0 0x00000C0 -#define ACP_DMA_ERR_STS_1 0x00000C4 -#define ACP_DMA_ERR_STS_2 0x00000C8 -#define ACP_DMA_ERR_STS_3 0x00000CC -#define ACP_DMA_ERR_STS_4 0x00000D0 -#define ACP_DMA_ERR_STS_5 0x00000D4 -#define ACP_DMA_ERR_STS_6 0x00000D8 -#define ACP_DMA_ERR_STS_7 0x00000DC -#define ACP_DMA_DESC_BASE_ADDR 0x00000E0 -#define ACP_DMA_DESC_MAX_NUM_DSCR 0x00000E4 -#define ACP_DMA_CH_STS 0x00000E8 -#define ACP_DMA_CH_GROUP 0x00000EC -#define ACP_DMA_CH_RST_STS 0x00000F0 - -/* Registers from ACP_AXI2AXIATU block */ -#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_1 0x0000C00 -#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_1 0x0000C04 -#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_2 0x0000C08 -#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_2 0x0000C0C -#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_3 0x0000C10 -#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_3 0x0000C14 -#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_4 0x0000C18 -#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_4 0x0000C1C -#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_5 0x0000C20 -#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_5 0x0000C24 -#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_6 0x0000C28 -#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_6 0x0000C2C -#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_7 0x0000C30 -#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_7 0x0000C34 -#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_8 0x0000C38 -#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_8 0x0000C3C -#define ACPAXI2AXI_ATU_CTRL 0x0000C40 -#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_9 0x0000C44 -#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_9 0x0000C48 -#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_10 0x0000C4C -#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_10 0x0000C50 -#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_11 0x0000C54 -#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_11 0x0000C58 -#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_12 0x0000C5C -#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_12 0x0000C60 -#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_13 0x0000C64 -#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_13 0x0000C68 -#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_14 0x0000C6C -#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_14 0x0000C70 -#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_15 0x0000C74 -#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_15 0x0000C78 -#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_16 0x0000C7C -#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_16 0x0000C80 - -/* Registers from ACP_CLKRST block */ -#define ACP_SOFT_RESET 0x0001000 -#define ACP_CONTROL 0x0001004 -#define ACP_STATUS 0x0001008 -#define ACP_DYNAMIC_CG_MASTER_CONTROL 0x0001010 -#define ACP_ZSC_DSP_CTRL 0x0001014 -#define ACP_ZSC_STS 0x0001018 -#define ACP_PGFSM_CONTROL 0x0001024 -#define ACP_PGFSM_STATUS 0x0001028 -#define ACP_CLKMUX_SEL 0x000102C - -/* Registers from ACP_AON block */ -#define ACP_PME_EN 0x0001400 -#define ACP_DEVICE_STATE 0x0001404 -#define AZ_DEVICE_STATE 0x0001408 -#define ACP_PIN_CONFIG 0x0001440 -#define ACP_PAD_PULLUP_CTRL 0x0001444 -#define ACP_PAD_PULLDOWN_CTRL 0x0001448 -#define ACP_PAD_DRIVE_STRENGTH_CTRL 0x000144C -#define ACP_PAD_SCHMEN_CTRL 0x0001450 -#define ACP_SW_PAD_KEEPER_EN 0x0001454 -#define ACP_SW_WAKE_EN 0x0001458 -#define ACP_I2S_WAKE_EN 0x000145C -#define ACP_SW1_WAKE_EN 0x0001460 - -/* Registers from ACP_P1_MISC block */ -#define ACP_EXTERNAL_INTR_ENB 0x0001A00 -#define ACP_EXTERNAL_INTR_CNTL 0x0001A04 -#define ACP_EXTERNAL_INTR_CNTL1 0x0001A08 -#define ACP_EXTERNAL_INTR_STAT 0x0001A0C -#define ACP_EXTERNAL_INTR_STAT1 0x0001A10 -#define ACP_ERROR_STATUS 0x0001A4C -#define ACP_P1_SW_I2S_ERROR_REASON 0x0001A50 -#define ACP_P1_SW_POS_TRACK_I2S_TX_CTRL 0x0001A6C -#define ACP_P1_SW_I2S_TX_DMA_POS 0x0001A70 -#define ACP_P1_SW_POS_TRACK_I2S_RX_CTRL 0x0001A74 -#define ACP_P1_SW_I2S_RX_DMA_POS 0x0001A78 -#define ACP_P1_DMIC_I2S_GPIO_INTR_CTRL 0x0001A7C -#define ACP_P1_DMIC_I2S_GPIO_INTR_STATUS 0x0001A80 -#define ACP_SCRATCH_REG_BASE_ADDR 0x0001A84 -#define ACP_P1_SW_POS_TRACK_BT_TX_CTRL 0x0001A88 -#define ACP_P1_SW_BT_TX_DMA_POS 0x0001A8C -#define ACP_P1_SW_POS_TRACK_HS_TX_CTRL 0x0001A90 -#define ACP_P1_SW_HS_TX_DMA_POS 0x0001A94 -#define ACP_P1_SW_POS_TRACK_BT_RX_CTRL 0x0001A98 -#define ACP_P1_SW_BT_RX_DMA_POS 0x0001A9C -#define ACP_P1_SW_POS_TRACK_HS_RX_CTRL 0x0001AA0 -#define ACP_P1_SW_HS_RX_DMA_POS 0x0001AA4 - -/* Registers from ACP_AUDIO_BUFFERS block */ -#define ACP_I2S_RX_RINGBUFADDR 0x0002000 -#define ACP_I2S_RX_RINGBUFSIZE 0x0002004 -#define ACP_I2S_RX_LINKPOSITIONCNTR 0x0002008 -#define ACP_I2S_RX_FIFOADDR 0x000200C -#define ACP_I2S_RX_FIFOSIZE 0x0002010 -#define ACP_I2S_RX_DMA_SIZE 0x0002014 -#define ACP_I2S_RX_LINEARPOSITIONCNTR_HIGH 0x0002018 -#define ACP_I2S_RX_LINEARPOSITIONCNTR_LOW 0x000201C -#define ACP_I2S_RX_INTR_WATERMARK_SIZE 0x0002020 -#define ACP_I2S_TX_RINGBUFADDR 0x0002024 -#define ACP_I2S_TX_RINGBUFSIZE 0x0002028 -#define ACP_I2S_TX_LINKPOSITIONCNTR 0x000202C -#define ACP_I2S_TX_FIFOADDR 0x0002030 -#define ACP_I2S_TX_FIFOSIZE 0x0002034 -#define ACP_I2S_TX_DMA_SIZE 0x0002038 -#define ACP_I2S_TX_LINEARPOSITIONCNTR_HIGH 0x000203C -#define ACP_I2S_TX_LINEARPOSITIONCNTR_LOW 0x0002040 -#define ACP_I2S_TX_INTR_WATERMARK_SIZE 0x0002044 -#define ACP_BT_RX_RINGBUFADDR 0x0002048 -#define ACP_BT_RX_RINGBUFSIZE 0x000204C -#define ACP_BT_RX_LINKPOSITIONCNTR 0x0002050 -#define ACP_BT_RX_FIFOADDR 0x0002054 -#define ACP_BT_RX_FIFOSIZE 0x0002058 -#define ACP_BT_RX_DMA_SIZE 0x000205C -#define ACP_BT_RX_LINEARPOSITIONCNTR_HIGH 0x0002060 -#define ACP_BT_RX_LINEARPOSITIONCNTR_LOW 0x0002064 -#define ACP_BT_RX_INTR_WATERMARK_SIZE 0x0002068 -#define ACP_BT_TX_RINGBUFADDR 0x000206C -#define ACP_BT_TX_RINGBUFSIZE 0x0002070 -#define ACP_BT_TX_LINKPOSITIONCNTR 0x0002074 -#define ACP_BT_TX_FIFOADDR 0x0002078 -#define ACP_BT_TX_FIFOSIZE 0x000207C -#define ACP_BT_TX_DMA_SIZE 0x0002080 -#define ACP_BT_TX_LINEARPOSITIONCNTR_HIGH 0x0002084 -#define ACP_BT_TX_LINEARPOSITIONCNTR_LOW 0x0002088 -#define ACP_BT_TX_INTR_WATERMARK_SIZE 0x000208C -#define ACP_HS_RX_RINGBUFADDR 0x0002090 -#define ACP_HS_RX_RINGBUFSIZE 0x0002094 -#define ACP_HS_RX_LINKPOSITIONCNTR 0x0002098 -#define ACP_HS_RX_FIFOADDR 0x000209C -#define ACP_HS_RX_FIFOSIZE 0x00020A0 -#define ACP_HS_RX_DMA_SIZE 0x00020A4 -#define ACP_HS_RX_LINEARPOSITIONCNTR_HIGH 0x00020A8 -#define ACP_HS_RX_LINEARPOSITIONCNTR_LOW 0x00020AC -#define ACP_HS_RX_INTR_WATERMARK_SIZE 0x00020B0 -#define ACP_HS_TX_RINGBUFADDR 0x00020B4 -#define ACP_HS_TX_RINGBUFSIZE 0x00020B8 -#define ACP_HS_TX_LINKPOSITIONCNTR 0x00020BC -#define ACP_HS_TX_FIFOADDR 0x00020C0 -#define ACP_HS_TX_FIFOSIZE 0x00020C4 -#define ACP_HS_TX_DMA_SIZE 0x00020C8 -#define ACP_HS_TX_LINEARPOSITIONCNTR_HIGH 0x00020CC -#define ACP_HS_TX_LINEARPOSITIONCNTR_LOW 0x00020D0 -#define ACP_HS_TX_INTR_WATERMARK_SIZE 0x00020D4 - -/* Registers from ACP_I2S_TDM block */ -#define ACP_I2STDM_IER 0x0002400 -#define ACP_I2STDM_IRER 0x0002404 -#define ACP_I2STDM_RXFRMT 0x0002408 -#define ACP_I2STDM_ITER 0x000240C -#define ACP_I2STDM_TXFRMT 0x0002410 -#define ACP_I2STDM0_MSTRCLKGEN 0x0002414 -#define ACP_I2STDM1_MSTRCLKGEN 0x0002418 -#define ACP_I2STDM2_MSTRCLKGEN 0x000241C -#define ACP_I2STDM_REFCLKGEN 0x0002420 - -/* Registers from ACP_BT_TDM block */ -#define ACP_BTTDM_IER 0x0002800 -#define ACP_BTTDM_IRER 0x0002804 -#define ACP_BTTDM_RXFRMT 0x0002808 -#define ACP_BTTDM_ITER 0x000280C -#define ACP_BTTDM_TXFRMT 0x0002810 -#define ACP_HSTDM_IER 0x0002814 -#define ACP_HSTDM_IRER 0x0002818 -#define ACP_HSTDM_RXFRMT 0x000281C -#define ACP_HSTDM_ITER 0x0002820 -#define ACP_HSTDM_TXFRMT 0x0002824 - -/* Registers from ACP_WOV block */ -#define ACP_WOV_PDM_ENABLE 0x0002C04 -#define ACP_WOV_PDM_DMA_ENABLE 0x0002C08 -#define ACP_WOV_RX_RINGBUFADDR 0x0002C0C -#define ACP_WOV_RX_RINGBUFSIZE 0x0002C10 -#define ACP_WOV_RX_LINKPOSITIONCNTR 0x0002C14 -#define ACP_WOV_RX_LINEARPOSITIONCNTR_HIGH 0x0002C18 -#define ACP_WOV_RX_LINEARPOSITIONCNTR_LOW 0x0002C1C -#define ACP_WOV_RX_INTR_WATERMARK_SIZE 0x0002C20 -#define ACP_WOV_PDM_FIFO_FLUSH 0x0002C24 -#define ACP_WOV_PDM_NO_OF_CHANNELS 0x0002C28 -#define ACP_WOV_PDM_DECIMATION_FACTOR 0x0002C2C -#define ACP_WOV_PDM_VAD_CTRL 0x0002C30 -#define ACP_WOV_WAKE 0x0002C54 -#define ACP_WOV_BUFFER_STATUS 0x0002C58 -#define ACP_WOV_MISC_CTRL 0x0002C5C -#define ACP_WOV_CLK_CTRL 0x0002C60 -#define ACP_PDM_VAD_DYNAMIC_CLK_GATING_EN 0x0002C64 -#define ACP_WOV_ERROR_STATUS_REGISTER 0x0002C68 -#define ACP_PDM_CLKDIV 0x0002C6C - -/* Registers from ACP_P1_AUDIO_BUFFERS block */ -#define ACP_P1_I2S_RX_RINGBUFADDR 0x0003A00 -#define ACP_P1_I2S_RX_RINGBUFSIZE 0x0003A04 -#define ACP_P1_I2S_RX_LINKPOSITIONCNTR 0x0003A08 -#define ACP_P1_I2S_RX_FIFOADDR 0x0003A0C -#define ACP_P1_I2S_RX_FIFOSIZE 0x0003A10 -#define ACP_P1_I2S_RX_DMA_SIZE 0x0003A14 -#define ACP_P1_I2S_RX_LINEARPOSITIONCNTR_HIGH 0x0003A18 -#define ACP_P1_I2S_RX_LINEARPOSITIONCNTR_LOW 0x0003A1C -#define ACP_P1_I2S_RX_INTR_WATERMARK_SIZE 0x0003A20 -#define ACP_P1_I2S_TX_RINGBUFADDR 0x0003A24 -#define ACP_P1_I2S_TX_RINGBUFSIZE 0x0003A28 -#define ACP_P1_I2S_TX_LINKPOSITIONCNTR 0x0003A2C -#define ACP_P1_I2S_TX_FIFOADDR 0x0003A30 -#define ACP_P1_I2S_TX_FIFOSIZE 0x0003A34 -#define ACP_P1_I2S_TX_DMA_SIZE 0x0003A38 -#define ACP_P1_I2S_TX_LINEARPOSITIONCNTR_HIGH 0x0003A3C -#define ACP_P1_I2S_TX_LINEARPOSITIONCNTR_LOW 0x0003A40 -#define ACP_P1_I2S_TX_INTR_WATERMARK_SIZE 0x0003A44 -#define ACP_P1_BT_RX_RINGBUFADDR 0x0003A48 -#define ACP_P1_BT_RX_RINGBUFSIZE 0x0003A4C -#define ACP_P1_BT_RX_LINKPOSITIONCNTR 0x0003A50 -#define ACP_P1_BT_RX_FIFOADDR 0x0003A54 -#define ACP_P1_BT_RX_FIFOSIZE 0x0003A58 -#define ACP_P1_BT_RX_DMA_SIZE 0x0003A5C -#define ACP_P1_BT_RX_LINEARPOSITIONCNTR_HIGH 0x0003A60 -#define ACP_P1_BT_RX_LINEARPOSITIONCNTR_LOW 0x0003A64 -#define ACP_P1_BT_RX_INTR_WATERMARK_SIZE 0x0003A68 -#define ACP_P1_BT_TX_RINGBUFADDR 0x0003A6C -#define ACP_P1_BT_TX_RINGBUFSIZE 0x0003A70 -#define ACP_P1_BT_TX_LINKPOSITIONCNTR 0x0003A74 -#define ACP_P1_BT_TX_FIFOADDR 0x0003A78 -#define ACP_P1_BT_TX_FIFOSIZE 0x0003A7C -#define ACP_P1_BT_TX_DMA_SIZE 0x0003A80 -#define ACP_P1_BT_TX_LINEARPOSITIONCNTR_HIGH 0x0003A84 -#define ACP_P1_BT_TX_LINEARPOSITIONCNTR_LOW 0x0003A88 -#define ACP_P1_BT_TX_INTR_WATERMARK_SIZE 0x0003A8C -#define ACP_P1_HS_RX_RINGBUFADDR 0x0003A90 -#define ACP_P1_HS_RX_RINGBUFSIZE 0x0003A94 -#define ACP_P1_HS_RX_LINKPOSITIONCNTR 0x0003A98 -#define ACP_P1_HS_RX_FIFOADDR 0x0003A9C -#define ACP_P1_HS_RX_FIFOSIZE 0x0003AA0 -#define ACP_P1_HS_RX_DMA_SIZE 0x0003AA4 -#define ACP_P1_HS_RX_LINEARPOSITIONCNTR_HIGH 0x0003AA8 -#define ACP_P1_HS_RX_LINEARPOSITIONCNTR_LOW 0x0003AAC -#define ACP_P1_HS_RX_INTR_WATERMARK_SIZE 0x0003AB0 -#define ACP_P1_HS_TX_RINGBUFADDR 0x0003AB4 -#define ACP_P1_HS_TX_RINGBUFSIZE 0x0003AB8 -#define ACP_P1_HS_TX_LINKPOSITIONCNTR 0x0003ABC -#define ACP_P1_HS_TX_FIFOADDR 0x0003AC0 -#define ACP_P1_HS_TX_FIFOSIZE 0x0003AC4 -#define ACP_P1_HS_TX_DMA_SIZE 0x0003AC8 -#define ACP_P1_HS_TX_LINEARPOSITIONCNTR_HIGH 0x0003ACC -#define ACP_P1_HS_TX_LINEARPOSITIONCNTR_LOW 0x0003AD0 -#define ACP_P1_HS_TX_INTR_WATERMARK_SIZE 0x0003AD4 - -/* Registers from ACP_SCRATCH block */ -#define ACP_SCRATCH_REG_0 0x0010000 -#define ACP_SCRATCH_REG_1 0x0010004 -#define ACP_SCRATCH_REG_2 0x0010008 -#define ACP_SCRATCH_REG_3 0x001000C -#define ACP_SCRATCH_REG_4 0x0010010 -#define ACP_SCRATCH_REG_5 0x0010014 -#define ACP_SCRATCH_REG_6 0x0010018 -#define ACP_SCRATCH_REG_7 0x001001C -#define ACP_SCRATCH_REG_8 0x0010020 -#define ACP_SCRATCH_REG_9 0x0010024 -#define ACP_SCRATCH_REG_10 0x0010028 -#define ACP_SCRATCH_REG_11 0x001002C -#define ACP_SCRATCH_REG_12 0x0010030 -#define ACP_SCRATCH_REG_13 0x0010034 -#define ACP_SCRATCH_REG_14 0x0010038 -#define ACP_SCRATCH_REG_15 0x001003C -#define ACP_SCRATCH_REG_16 0x0010040 -#define ACP_SCRATCH_REG_17 0x0010044 -#define ACP_SCRATCH_REG_18 0x0010048 -#define ACP_SCRATCH_REG_19 0x001004C -#define ACP_SCRATCH_REG_20 0x0010050 -#define ACP_SCRATCH_REG_21 0x0010054 -#define ACP_SCRATCH_REG_22 0x0010058 -#define ACP_SCRATCH_REG_23 0x001005C -#define ACP_SCRATCH_REG_24 0x0010060 -#define ACP_SCRATCH_REG_25 0x0010064 -#define ACP_SCRATCH_REG_26 0x0010068 -#define ACP_SCRATCH_REG_27 0x001006C -#define ACP_SCRATCH_REG_28 0x0010070 -#define ACP_SCRATCH_REG_29 0x0010074 -#define ACP_SCRATCH_REG_30 0x0010078 -#define ACP_SCRATCH_REG_31 0x001007C -#define ACP_SCRATCH_REG_32 0x0010080 -#define ACP_SCRATCH_REG_33 0x0010084 -#define ACP_SCRATCH_REG_34 0x0010088 -#define ACP_SCRATCH_REG_35 0x001008C -#define ACP_SCRATCH_REG_36 0x0010090 -#define ACP_SCRATCH_REG_37 0x0010094 -#define ACP_SCRATCH_REG_38 0x0010098 -#define ACP_SCRATCH_REG_39 0x001009C -#define ACP_SCRATCH_REG_40 0x00100A0 -#define ACP_SCRATCH_REG_41 0x00100A4 -#define ACP_SCRATCH_REG_42 0x00100A8 -#define ACP_SCRATCH_REG_43 0x00100AC -#define ACP_SCRATCH_REG_44 0x00100B0 -#define ACP_SCRATCH_REG_45 0x00100B4 -#define ACP_SCRATCH_REG_46 0x00100B8 -#define ACP_SCRATCH_REG_47 0x00100BC -#define ACP_SCRATCH_REG_48 0x00100C0 -#define ACP_SCRATCH_REG_49 0x00100C4 -#define ACP_SCRATCH_REG_50 0x00100C8 -#define ACP_SCRATCH_REG_51 0x00100CC -#define ACP_SCRATCH_REG_52 0x00100D0 -#define ACP_SCRATCH_REG_53 0x00100D4 -#define ACP_SCRATCH_REG_54 0x00100D8 -#define ACP_SCRATCH_REG_55 0x00100DC -#define ACP_SCRATCH_REG_56 0x00100E0 -#define ACP_SCRATCH_REG_57 0x00100E4 -#define ACP_SCRATCH_REG_58 0x00100E8 -#define ACP_SCRATCH_REG_59 0x00100EC -#define ACP_SCRATCH_REG_60 0x00100F0 -#define ACP_SCRATCH_REG_61 0x00100F4 -#define ACP_SCRATCH_REG_62 0x00100F8 -#define ACP_SCRATCH_REG_63 0x00100FC -#define ACP_SCRATCH_REG_64 0x0010100 -#define ACP_SCRATCH_REG_65 0x0010104 -#define ACP_SCRATCH_REG_66 0x0010108 -#define ACP_SCRATCH_REG_67 0x001010C -#define ACP_SCRATCH_REG_68 0x0010110 -#define ACP_SCRATCH_REG_69 0x0010114 -#define ACP_SCRATCH_REG_70 0x0010118 -#define ACP_SCRATCH_REG_71 0x001011C -#define ACP_SCRATCH_REG_72 0x0010120 -#define ACP_SCRATCH_REG_73 0x0010124 -#define ACP_SCRATCH_REG_74 0x0010128 -#define ACP_SCRATCH_REG_75 0x001012C -#define ACP_SCRATCH_REG_76 0x0010130 -#define ACP_SCRATCH_REG_77 0x0010134 -#define ACP_SCRATCH_REG_78 0x0010138 -#define ACP_SCRATCH_REG_79 0x001013C -#define ACP_SCRATCH_REG_80 0x0010140 -#define ACP_SCRATCH_REG_81 0x0010144 -#define ACP_SCRATCH_REG_82 0x0010148 -#define ACP_SCRATCH_REG_83 0x001014C -#define ACP_SCRATCH_REG_84 0x0010150 -#define ACP_SCRATCH_REG_85 0x0010154 -#define ACP_SCRATCH_REG_86 0x0010158 -#define ACP_SCRATCH_REG_87 0x001015C -#define ACP_SCRATCH_REG_88 0x0010160 -#define ACP_SCRATCH_REG_89 0x0010164 -#define ACP_SCRATCH_REG_90 0x0010168 -#define ACP_SCRATCH_REG_91 0x001016C -#define ACP_SCRATCH_REG_92 0x0010170 -#define ACP_SCRATCH_REG_93 0x0010174 -#define ACP_SCRATCH_REG_94 0x0010178 -#define ACP_SCRATCH_REG_95 0x001017C -#define ACP_SCRATCH_REG_96 0x0010180 -#define ACP_SCRATCH_REG_97 0x0010184 -#define ACP_SCRATCH_REG_98 0x0010188 -#define ACP_SCRATCH_REG_99 0x001018C -#define ACP_SCRATCH_REG_100 0x0010190 -#define ACP_SCRATCH_REG_101 0x0010194 -#define ACP_SCRATCH_REG_102 0x0010198 -#define ACP_SCRATCH_REG_103 0x001019C -#define ACP_SCRATCH_REG_104 0x00101A0 -#define ACP_SCRATCH_REG_105 0x00101A4 -#define ACP_SCRATCH_REG_106 0x00101A8 -#define ACP_SCRATCH_REG_107 0x00101AC -#define ACP_SCRATCH_REG_108 0x00101B0 -#define ACP_SCRATCH_REG_109 0x00101B4 -#define ACP_SCRATCH_REG_110 0x00101B8 -#define ACP_SCRATCH_REG_111 0x00101BC -#define ACP_SCRATCH_REG_112 0x00101C0 -#define ACP_SCRATCH_REG_113 0x00101C4 -#define ACP_SCRATCH_REG_114 0x00101C8 -#define ACP_SCRATCH_REG_115 0x00101CC -#define ACP_SCRATCH_REG_116 0x00101D0 -#define ACP_SCRATCH_REG_117 0x00101D4 -#define ACP_SCRATCH_REG_118 0x00101D8 -#define ACP_SCRATCH_REG_119 0x00101DC -#define ACP_SCRATCH_REG_120 0x00101E0 -#define ACP_SCRATCH_REG_121 0x00101E4 -#define ACP_SCRATCH_REG_122 0x00101E8 -#define ACP_SCRATCH_REG_123 0x00101EC -#define ACP_SCRATCH_REG_124 0x00101F0 -#define ACP_SCRATCH_REG_125 0x00101F4 -#define ACP_SCRATCH_REG_126 0x00101F8 -#define ACP_SCRATCH_REG_127 0x00101FC -#define ACP_SCRATCH_REG_128 0x0010200 -#endif
include/sound/acp63_chip_offset_byte.h new file +444 -0
444 lines not on this page · raw message
sound/soc/amd/Kconfig +2 -2
@@ -129,10 +129,10 @@ config SND_SOC_AMD_RPL_ACP6x If unsure select "N". config SND_SOC_AMD_PS - tristate "AMD Audio Coprocessor-v6.2 Pink Sardine support" + tristate "AMD Audio Coprocessor-v6.3 Pink Sardine support" depends on X86 && PCI && ACPI help - This option enables Audio Coprocessor i.e ACP v6.2 support on + This option enables Audio Coprocessor i.e ACP v6.3 support on AMD Pink sardine platform. By enabling this flag build will be triggered for ACP PCI driver, ACP PDM DMA driver. Say m if you have such a device.
sound/soc/amd/ps/acp62.h deleted +0 -98
98 lines not on this page · raw message
sound/soc/amd/ps/acp63.h new file +98 -0
98 lines not on this page · raw message
sound/soc/amd/ps/pci-ps.c +66 -66
320 lines not on this page · raw message
sound/soc/amd/ps/ps-mach.c +15 -15
@@ -13,11 +13,11 @@#include <linux/io.h> #include <linux/dmi.h> -#include "acp62.h" +#include "acp63.h" #define DRV_NAME "acp_ps_mach" -SND_SOC_DAILINK_DEF (acp62_pdm, +SND_SOC_DAILINK_DEF (acp63_pdm,DAILINK_COMP_ARRAY (COMP_CPU ("acp_ps_pdm_dma.0" ))); SND_SOC_DAILINK_DEF(dmic_codec,
@@ -27,31 +27,31 @@ SND_SOC_DAILINK_DEF(dmic_codec,SND_SOC_DAILINK_DEF (pdm_platform,DAILINK_COMP_ARRAY (COMP_PLATFORM ("acp_ps_pdm_dma.0" ))); -static struct snd_soc_dai_link acp62_dai_pdm[] = { +static struct snd_soc_dai_link acp63_dai_pdm[] = { { - .name ="acp62-dmic-capture" , + .name ="acp63-dmic-capture" , .stream_name ="DMIC capture" , .capture_only =1 , -SND_SOC_DAILINK_REG (acp62_pdm, dmic_codec, pdm_platform), +SND_SOC_DAILINK_REG (acp63_pdm, dmic_codec, pdm_platform), }, }; -static struct snd_soc_card acp62_card = { - .name ="acp62" , +static struct snd_soc_card acp63_card = { + .name ="acp63" , .owner =THIS_MODULE , - .dai_link = acp62_dai_pdm, + .dai_link = acp63_dai_pdm, .num_links =1 , }; -static int acp62_probe (struct platform_device *pdev) +static int acp63_probe (struct platform_device *pdev) { -struct acp62_pdm *machine =NULL ; +struct acp63_pdm *machine =NULL ;struct snd_soc_card *card;int ret; -platform_set_drvdata (pdev, &acp62_card); +platform_set_drvdata (pdev, &acp63_card); card =platform_get_drvdata (pdev); - acp62_card.dev = &pdev->dev; + acp63_card.dev = &pdev->dev;snd_soc_card_set_drvdata (card, machine); ret =devm_snd_soc_register_card (&pdev->dev, card);
@@ -64,15 +64,15 @@ static int acp62_probe(struct platform_dreturn 0 ; } -static struct platform_driver acp62_mach_driver = { +static struct platform_driver acp63_mach_driver = { .driver = { .name ="acp_ps_mach" , .pm = &snd_soc_pm_ops, }, - .probe = acp62_probe, + .probe = acp63_probe, }; -module_platform_driver (acp62_mach_driver); +module_platform_driver (acp63_mach_driver);MODULE_AUTHOR ("[email protected]" );MODULE_LICENSE ("GPL v2" );
sound/soc/amd/ps/ps-pdm-dma.c +94 -94
445 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 21/611 ASoC: amd: ps: update the acp clock source.
In reply to Greg Kroah-HartmanFrom: Syed Saba Kareem <[email protected]>
commit a4d432e9132c0b29d857b09ca2ec4c1f455b5948 upstream.
Updating the clock source from ACLK to default clock
--- sound/soc/amd/ps/pci-ps.c | 2 -- 1 file changed, 2 deletions(-)
sound/soc/amd/ps/pci-ps.c +0 -2
@@ -98,7 +98,6 @@ static int acp63_init(void __iomem *acp_dev_err (dev,"ACP reset failed\n" );return ret; } -acp63_writel (0x03 , acp_base +ACP_CLKMUX_SEL );acp63_enable_interrupts (acp_base);return 0 ; }
@@ -113,7 +112,6 @@ static int acp63_deinit(void __iomem *acdev_err (dev,"ACP reset failed\n" );return ret; } -acp63_writel (0 , acp_base +ACP_CLKMUX_SEL );acp63_writel (0 , acp_base +ACP_CONTROL );return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 4/611 x86/hyperv: Block root partition functionality in a Confidential VM
In reply to Greg Kroah-HartmanFrom: Michael Kelley <[email protected]>
[ Upstream commit f8acb24aaf89fc46cd953229462ea8abe31b395f ]
Hyper-V should never specify a VM that is a Confidential VM and also running in the root partition. Nonetheless, explicitly block such a combination to guard against a compromised Hyper-V maliciously trying to exploit root partition functionality in a Confidential VM to expose Confidential VM secrets. No known bug is being fixed, but the attack surface for Confidential VMs on Hyper-V is reduced.
--- arch/x86/kernel/cpu/mshyperv.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
arch/x86/kernel/cpu/mshyperv.c +8 -4
@@ -291,12 +291,16 @@ static void __init ms_hyperv_init_platform(void)* To mirror what Windows does we should extract CPU management * features and use the ReservedIdentityBit to detect if Linux is the * root partition. But that requires negotiating CPU management -* interface (a process to be finalized). +* interface (a process to be finalized). For now, use the privilege +* flag as the indicator for running as root. * -* For now, use the privilege flag as the indicator for running as -* root. +* Hyper-V should never specify running as root and as a Confidential +* VM. But to protect against a compromised/malicious Hyper-V trying +* to exploit root behavior to expose Confidential VM memory, ignore +* the root partition setting if also a Confidential VM. */ -if (cpuid_ebx (HYPERV_CPUID_FEATURES ) &HV_CPU_MANAGEMENT ) { +if ((ms_hyperv.priv_high &HV_CPU_MANAGEMENT ) && + !(ms_hyperv.priv_high &HV_ISOLATION )) { hv_root_partition = true;pr_info ("Hyper-V: running as root partition\n" ); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 22/611 arm64: Always load shadow stack pointer directly from the task struct
In reply to Greg Kroah-HartmanFrom: Ard Biesheuvel <[email protected]>
commit 2198d07c509f1db4a1185d1f65aaada794c6ea59 upstream.
All occurrences of the scs_load macro load the value of the shadow call stack pointer from the task which is current at that point. So instead of taking a task struct register argument in the scs_load macro to specify the task struct to load from, let's always reference the current task directly. This should make it much harder to exploit any instruction sequences reloading the shadow call stack pointer register from memory.
--- arch/arm64/include/asm/scs.h | 7 ++++--- arch/arm64/kernel/entry.S | 4 ++-- arch/arm64/kernel/head.S | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-)
arch/arm64/include/asm/scs.h +4 -3
@@ -9,15 +9,16 @@#ifdef CONFIG_SHADOW_CALL_STACK scs_sp .req x18 - .macro scs_load tsk - ldr scs_sp, [\tsk, #TSK_TI_SCS_SP] + .macro scs_load_current + get_current_task scs_sp + ldr scs_sp, [scs_sp, #TSK_TI_SCS_SP] .endm .macro scs_save tsk str scs_sp, [\tsk, #TSK_TI_SCS_SP] .endm #else - .macro scs_load tsk + .macro scs_load_current .endm .macro scs_save tsk
arch/arm64/kernel/entry.S +2 -2
@@ -272,7 +272,7 @@ alternative_if ARM64_HAS_ADDRESS_AUTH alternative_else_nop_endif 1: - scs_load tsk + scs_load_current .else add x21, sp, #PT_REGS_SIZE get_current_task tsk
@@ -845,7 +845,7 @@ SYM_FUNC_START(cpu_switch_to) msr sp_el0, x1 ptrauth_keys_install_kernel x1, x8, x9, x10 scs_save x0 - scs_load x1 + scs_load_current ret SYM_FUNC_END(cpu_switch_to) NOKPROBE(cpu_switch_to)
arch/arm64/kernel/head.S +1 -1
@@ -404,7 +404,7 @@ SYM_FUNC_END(create_kernel_mapping) stp xzr, xzr, [sp, #S_STACKFRAME] add x29, sp, #S_STACKFRAME - scs_load \tsk + scs_load_current adr_l \tmp1, __per_cpu_offset ldr w\tmp2, [\tsk, #TSK_TI_CPU]
Greg Kroah-Hartman
maintainerPATCH 23/611 arm64: Stash shadow stack pointer in the task struct on interrupt
In reply to Greg Kroah-HartmanFrom: Ard Biesheuvel <[email protected]>
commit 59b37fe52f49955791a460752c37145f1afdcad1 upstream.
Instead of reloading the shadow call stack pointer from the ordinary stack, which may be vulnerable to the kind of gadget based attacks shadow call stacks were designed to prevent, let's store a task's shadow call stack pointer in the task struct when switching to the shadow IRQ stack.
Given that currently, the task_struct::scs_sp field is only used to preserve the shadow call stack pointer while a task is scheduled out or running in user space, reusing this field to preserve and restore it while running off the IRQ stack must be safe, as those occurrences are guaranteed to never overlap. (The stack switching logic only switches stacks when running from the task stack, and so the value being saved here always corresponds to the task mode shadow stack)
While at it, fold a mov/add/mov sequence into a single add.
--- arch/arm64/kernel/entry.S | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
arch/arm64/kernel/entry.S +5 -7
@@ -873,19 +873,19 @@ NOKPROBE(ret_from_fork) */ SYM_FUNC_START(call_on_irq_stack) #ifdef CONFIG_SHADOW_CALL_STACK - stp scs_sp, xzr, [sp, #-16]! + get_current_task x16 + scs_save x16 ldr_this_cpu scs_sp, irq_shadow_call_stack_ptr, x17 #endif + /* Create a frame record to save our LR and SP (implicit in FP) */ stp x29, x30, [sp, #-16]! mov x29, sp ldr_this_cpu x16, irq_stack_ptr, x17 - mov x15, #IRQ_STACK_SIZE - add x16, x16, x15 /* Move to the new stack and call the function there */ - mov sp, x16 + add sp, x16, #IRQ_STACK_SIZE blr x1 /*
@@ -894,9 +894,7 @@ SYM_FUNC_START(call_on_irq_stack) */ mov sp, x29 ldp x29, x30, [sp], #16 -#ifdef CONFIG_SHADOW_CALL_STACK - ldp scs_sp, xzr, [sp], #16 -#endif + scs_load_current ret SYM_FUNC_END(call_on_irq_stack) NOKPROBE(call_on_irq_stack)
Greg Kroah-Hartman
maintainerPATCH 24/611 powerpc/boot: Fix boot wrapper code generation with CONFIG_POWER10_CPU
In reply to Greg Kroah-HartmanFrom: Nicholas Piggin <[email protected]>
commit 648a1783fe2551f5a091c9a5f8f463cb2cbf8745 upstream.
-mcpu=power10 will generate prefixed and pcrel code by default, which we do not support. The general kernel disables these with cflags, but those were missed for the boot wrapper.
--- arch/powerpc/boot/Makefile | 2 ++ 1 file changed, 2 insertions(+)
arch/powerpc/boot/Makefile +2 -0
@@ -34,6 +34,8 @@ endif BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -fno-strict-aliasing -O2 -msoft-float -mno-altivec -mno-vsx \ + $(call cc-option,-mno-prefixed) $(call cc-option,-mno-pcrel) \ + $(call cc-option,-mno-mma) \ $(call cc-option,-mno-spe) $(call cc-option,-mspe=no) \ -pipe -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \ $(LINUXINCLUDE)
Greg Kroah-Hartman
maintainerPATCH 25/611 PCI: kirin: Select REGMAP_MMIO
In reply to Greg Kroah-HartmanFrom: Josh Triplett <[email protected]>
commit 3a2776e8a0e156a61f5b59ae341d8fffc730b962 upstream.
pcie-kirin uses regmaps, and needs to pull them in; otherwise, with CONFIG_PCIE_KIRIN=y and without CONFIG_REGMAP_MMIO pcie-kirin produces a linker failure looking for __devm_regmap_init_mmio_clk().
--- drivers/pci/controller/dwc/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/pci/controller/dwc/Kconfig +1 -0
@@ -294,6 +294,7 @@ config PCI_MESON default m if ARCH_MESON depends on PCI_MSI_IRQ_DOMAIN select PCIE_DW_HOST + select REGMAP_MMIO help Say Y here if you want to enable PCI controller support on Amlogic SoCs. The PCI controller on Amlogic is based on DesignWare hardware
Greg Kroah-Hartman
maintainerPATCH 26/611 PCI: pciehp: Fix AB-BA deadlock between reset_lock and device_lock
In reply to Greg Kroah-HartmanFrom: Lukas Wunner <[email protected]>
commit f5eff5591b8f9c5effd25c92c758a127765f74c1 upstream.
In 2013, commits
2e35afaefe64 ("PCI: pciehp: Add reset_slot() method") 608c388122c7 ("PCI: Add slot reset option to pci_dev_reset()")
amended PCIe hotplug to mask Presence Detect Changed events during a Secondary Bus Reset. The reset thus no longer causes gratuitous slot bringdown and bringup.
However the commits neglected to serialize reset with code paths reading slot registers. For instance, a slot bringup due to an earlier hotplug event may see the Presence Detect State bit cleared during a concurrent Secondary Bus Reset.
In 2018, commit
5b3f7b7d062b ("PCI: pciehp: Avoid slot access during reset")
retrofitted the missing locking. It introduced a reset_lock which serializes a Secondary Bus Reset with other parts of pciehp.
Unfortunately the locking turns out to be overzealous: reset_lock is held for the entire enumeration and de-enumeration of hotplugged devices, including driver binding and unbinding.
Driver binding and unbinding acquires device_lock while the reset_lock of the ancestral hotplug port is held. A concurrent Secondary Bus Reset acquires the ancestral reset_lock while already holding the device_lock. The asymmetric locking order in the two code paths can lead to AB-BA deadlocks.
Michael Haeuptle reports such deadlocks on simultaneous hot-removal and vfio release (the latter implies a Secondary Bus Reset):
pciehp_ist() # down_read(reset_lock)
pciehp_handle_presence_or_link_change()
pciehp_disable_slot()
__pciehp_disable_slot()
remove_board()
pciehp_unconfigure_device()
pci_stop_and_remove_bus_device()
pci_stop_bus_device()
pci_stop_dev()
device_release_driver()
device_release_driver_internal()
__device_driver_lock() # device_lock() SYS_munmap()
vfio_device_fops_release()
vfio_device_group_close()
vfio_device_close()
vfio_device_last_close()
vfio_pci_core_close_device()
vfio_pci_core_disable() # device_lock()
__pci_reset_function_locked()
pci_reset_bus_function()
pci_dev_reset_slot_function()
pci_reset_hotplug_slot()
pciehp_reset_slot() # down_write(reset_lock)
Ian May reports the same deadlock on simultaneous hot-removal and an AER-induced Secondary Bus Reset:
aer_recover_work_func()
pcie_do_recovery()
aer_root_reset()
pci_bus_error_reset()
pci_slot_reset()
pci_slot_lock() # device_lock()
pci_reset_hotplug_slot()
pciehp_reset_slot() # down_write(reset_lock)
Fix by releasing the reset_lock during driver binding and unbinding, thereby splitting and shrinking the critical section.
Driver binding and unbinding is protected by the device_lock() and thus serialized with a Secondary Bus Reset. There's no need to additionally protect it with the reset_lock. However, pciehp does not bind and unbind devices directly, but rather invokes PCI core functions which also perform certain enumeration and de-enumeration steps.
The reset_lock's purpose is to protect slot registers, not enumeration and de-enumeration of hotplugged devices. That would arguably be the job of the PCI core, not the PCIe hotplug driver. After all, an AER-induced Secondary Bus Reset may as well happen during boot-time enumeration of the PCI hierarchy and there's no locking to prevent that either.
Exempting *de-enumeration* from the reset_lock is relatively harmless:
A concurrent Secondary Bus Reset may foil config space accesses such as PME interrupt disablement. But if the device is physically gone, those accesses are pointless anyway. If the device is physically present and only logically removed through an Attention Button press or the sysfs "power" attribute, PME interrupts as well as DMA cannot come through because pciehp_unconfigure_device() disables INTx and Bus Master bits. That's still protected by the reset_lock in the present commit.
Exempting *enumeration* from the reset_lock also has limited impact:
The exempted call to pci_bus_add_device() may perform device accesses through pcibios_bus_add_device() and pci_fixup_device() which are now no longer protected from a concurrent Secondary Bus Reset. Otherwise there should be no impact.
In essence, the present commit seeks to fix the AB-BA deadlocks while still retaining a best-effort reset protection for enumeration and de-enumeration of hotplugged devices -- until a general solution is implemented in the PCI core.
--- drivers/pci/hotplug/pciehp_pci.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
drivers/pci/hotplug/pciehp_pci.c +15 -0
@@ -63,7 +63,14 @@ int pciehp_configure_device(struct contrpci_assign_unassigned_bridge_resources (bridge);pcie_bus_configure_settings (parent); + +/* +* Release reset_lock during driver binding +* to avoid AB-BA deadlock with device_lock. +*/ +up_read (&ctrl->reset_lock);pci_bus_add_devices (parent); +down_read_nested (&ctrl->reset_lock, ctrl->depth); out:pci_unlock_rescan_remove ();
@@ -104,7 +111,15 @@ void pciehp_unconfigure_device(struct colist_for_each_entry_safe_reverse (dev, temp, &parent->devices, bus_list) {pci_dev_get (dev); + +/* +* Release reset_lock during driver unbinding +* to avoid AB-BA deadlock with device_lock. +*/ +up_read (&ctrl->reset_lock);pci_stop_and_remove_bus_device (dev); +down_read_nested (&ctrl->reset_lock, ctrl->depth); +/* * Ensure that no new Requests will be generated from * the device.
Greg Kroah-Hartman
maintainerPATCH 27/611 PCI: qcom: Fix the incorrect register usage in v2.7.0 config
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
commit 2542e16c392508800f1d9037feee881a9c444951 upstream.
Qcom PCIe IP version v2.7.0 and its derivatives don't contain the PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT register. Instead, they have the new PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT_V2 register. So fix the incorrect register usage which is modifying a different register.
Also in this IP version, this register change doesn't depend on MSI being enabled. So remove that check also.
--- drivers/pci/controller/dwc/pcie-qcom.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/pci/controller/dwc/pcie-qcom.c +3 -5
@@ -1276,11 +1276,9 @@ static int qcom_pcie_init_2_7_0(struct q val &= ~REQ_NOT_ENTR_L1 ;writel (val, pcie->parf +PCIE20_PARF_PM_CTRL ); -if (IS_ENABLED (CONFIG_PCI_MSI )) { - val =readl (pcie->parf +PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT ); - val |=BIT (31 ); -writel (val, pcie->parf +PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT ); - } + val =readl (pcie->parf +PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT_V2 ); + val |=BIT (31 ); +writel (val, pcie->parf +PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT_V2 );return 0 ; err_disable_clocks:
Greg Kroah-Hartman
maintainerPATCH 28/611 phy: qcom-qmp-pcie: sc8180x PCIe PHY has 2 lanes
In reply to Greg Kroah-HartmanFrom: Dmitry Baryshkov <[email protected]>
commit 1db6b0a4246ce708b89f5136571130b9987741d1 upstream.
All PCIe PHYs on sc8180x platform have 2 lanes, so change the number of lanes to 2.
--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +1 -1
@@ -1738,7 +1738,7 @@ static const struct qmp_phy_cfg msm8998_ };static const struct qmp_phy_cfg sc8180x_pciephy_cfg = { - .lanes =1 , + .lanes =2 , .tables = { .serdes = sc8180x_qmp_pcie_serdes_tbl,
Greg Kroah-Hartman
maintainerPATCH 29/611 IMA: allow/fix UML builds
In reply to Greg Kroah-HartmanFrom: Randy Dunlap <[email protected]>
commit 644f17412f5acf01a19af9d04a921937a2bc86c6 upstream.
UML supports HAS_IOMEM since 0bbadafdc49d (um: allow disabling NO_IOMEM).
Current IMA build on UML fails on allmodconfig (with TCG_TPM=m):
ld: security/integrity/ima/ima_queue.o: in function `ima_add_template_entry':
ima_queue.c:(.text+0x2d9): undefined reference to `tpm_pcr_extend'
ld: security/integrity/ima/ima_init.o: in function `ima_init':
ima_init.c:(.init.text+0x43f): undefined reference to `tpm_default_chip'
ld: security/integrity/ima/ima_crypto.o: in function `ima_calc_boot_aggregate_tfm':
ima_crypto.c:(.text+0x1044): undefined reference to `tpm_pcr_read'
ld: ima_crypto.c:(.text+0x10d8): undefined reference to `tpm_pcr_read'
Modify the IMA Kconfig entry so that it selects TCG_TPM if HAS_IOMEM is set, regardless of the UML Kconfig setting.
This updates TCG_TPM from =m to =y and fixes the linker errors.
--- security/integrity/ima/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
security/integrity/ima/Kconfig +1 -1
@@ -8,7 +8,7 @@ config IMA select CRYPTO_HMAC select CRYPTO_SHA1 select CRYPTO_HASH_INFO - select TCG_TPM if HAS_IOMEM && !UML + select TCG_TPM if HAS_IOMEM select TCG_TIS if TCG_TPM && X86 select TCG_CRB if TCG_TPM && ACPI select TCG_IBMVTPM if TCG_TPM && PPC_PSERIES
Greg Kroah-Hartman
maintainerPATCH 30/611 usb: gadget: udc: core: Invoke usb_gadget_connect only when started
In reply to Greg Kroah-HartmanFrom: Badhri Jagan Sridharan <[email protected]>
commit 0db213ea8eed5534a5169e807f28103cbc9d23df upstream.
usb_udc_connect_control does not check to see if the udc has already been started. This causes gadget->ops->pullup to be called through usb_gadget_connect when invoked from usb_udc_vbus_handler even before usb_gadget_udc_start is called. Guard this by checking for udc->started in usb_udc_connect_control before invoking usb_gadget_connect.
Guarding udc->vbus, udc->started, gadget->connect, gadget->deactivate related functions with connect_lock. usb_gadget_connect_locked, usb_gadget_disconnect_locked, usb_udc_connect_control_locked, usb_gadget_udc_start_locked, usb_gadget_udc_stop_locked are called with this lock held as they can be simulataneously invoked from different code paths.
Adding an additional check to make sure udc is started(udc->started) before pullup callback is invoked.
--- drivers/usb/gadget/udc/core.c | 148 +++++++++++++++++++++++++++++------------- 1 file changed, 104 insertions(+), 44 deletions(-)
drivers/usb/gadget/udc/core.c +104 -44
@@ -37,6 +37,10 @@ static struct bus_type gadget_bus_type;* @vbus: for udcs who care about vbus status, this value is real vbus status; * for udcs who do not care about vbus status, this value is always true * @started: the UDC's started state. True if the UDC had started. +* @connect_lock: protects udc->vbus, udc->started, gadget->connect, gadget->deactivate related +* functions. usb_gadget_connect_locked, usb_gadget_disconnect_locked, +* usb_udc_connect_control_locked, usb_gadget_udc_start_locked, usb_gadget_udc_stop_locked are +* called with this lock held. * * This represents the internal data structure which is used by the UDC-class * to hold information about udc driver and gadget together.
@@ -48,6 +52,7 @@ struct usb_udc {struct list_head list;bool vbus;bool started; +struct mutex connect_lock; };static struct class *udc_class;
@@ -660,17 +665,9 @@ out: }EXPORT_SYMBOL_GPL (usb_gadget_vbus_disconnect); -/** -* usb_gadget_connect - software-controlled connect to USB host -* @gadget:the peripheral being connected -* -* Enables the D+ (or potentially D-) pullup. The host will start -* enumerating this gadget when the pullup is active and a VBUS session -* is active (the link is powered). -* -* Returns zero on success, else negative errno. -*/ -int usb_gadget_connect (struct usb_gadget *gadget) +/* Internal version of usb_gadget_connect needs to be called with connect_lock held. */ +static int usb_gadget_connect_locked (struct usb_gadget *gadget) + __must_hold(&gadget->udc->connect_lock) {int ret =0 ;
@@ -679,10 +676,12 @@ int usb_gadget_connect(struct usb_gadget goto out; } -if (gadget->deactivated) { +if (gadget->deactivated || !gadget->udc->started) {/* * If gadget is deactivated we only save new state. * Gadget will be connected automatically after activation. +* +* udc first needs to be started before gadget can be pulled up. */ gadget->connected = true; goto out;
@@ -697,22 +696,32 @@ out:return ret; } -EXPORT_SYMBOL_GPL (usb_gadget_connect);/** -* usb_gadget_disconnect - software-controlled disconnect from USB host -* @gadget:the peripheral being disconnected -* -* Disables the D+ (or potentially D-) pullup, which the host may see -* as a disconnect (when a VBUS session is active). Not all systems -* support software pullup controls. +* usb_gadget_connect - software-controlled connect to USB host +* @gadget:the peripheral being connected * -* Following a successful disconnect, invoke the ->disconnect() callback -* for the current gadget driver so that UDC drivers don't need to. +* Enables the D+ (or potentially D-) pullup. The host will start +* enumerating this gadget when the pullup is active and a VBUS session +* is active (the link is powered). * * Returns zero on success, else negative errno. */ -int usb_gadget_disconnect (struct usb_gadget *gadget) +int usb_gadget_connect (struct usb_gadget *gadget) +{ +int ret; + +mutex_lock (&gadget->udc->connect_lock); + ret =usb_gadget_connect_locked (gadget); +mutex_unlock (&gadget->udc->connect_lock); + +return ret; +} +EXPORT_SYMBOL_GPL (usb_gadget_connect); + +/* Internal version of usb_gadget_disconnect needs to be called with connect_lock held. */ +static int usb_gadget_disconnect_locked (struct usb_gadget *gadget) + __must_hold(&gadget->udc->connect_lock) {int ret =0 ;
@@ -724,10 +733,12 @@ int usb_gadget_disconnect(struct usb_gadif (!gadget->connected) goto out; -if (gadget->deactivated) { +if (gadget->deactivated || !gadget->udc->started) {/* * If gadget is deactivated we only save new state. * Gadget will stay disconnected after activation. +* +* udc should have been started before gadget being pulled down. */ gadget->connected = false; goto out;
@@ -747,6 +758,30 @@ out:return ret; } + +/** +* usb_gadget_disconnect - software-controlled disconnect from USB host +* @gadget:the peripheral being disconnected +* +* Disables the D+ (or potentially D-) pullup, which the host may see +* as a disconnect (when a VBUS session is active). Not all systems +* support software pullup controls. +* +* Following a successful disconnect, invoke the ->disconnect() callback +* for the current gadget driver so that UDC drivers don't need to. +* +* Returns zero on success, else negative errno. +*/ +int usb_gadget_disconnect (struct usb_gadget *gadget) +{ +int ret; + +mutex_lock (&gadget->udc->connect_lock); + ret =usb_gadget_disconnect_locked (gadget); +mutex_unlock (&gadget->udc->connect_lock); + +return ret; +}EXPORT_SYMBOL_GPL (usb_gadget_disconnect);/**
@@ -767,10 +802,11 @@ int usb_gadget_deactivate(struct usb_gadif (gadget->deactivated) goto out; +mutex_lock (&gadget->udc->connect_lock);if (gadget->connected) { - ret =usb_gadget_disconnect (gadget); + ret =usb_gadget_disconnect_locked (gadget);if (ret) - goto out; + goto unlock;/* * If gadget was being connected before deactivation, we want
@@ -780,6 +816,8 @@ int usb_gadget_deactivate(struct usb_gad } gadget->deactivated = true; +unlock: +mutex_unlock (&gadget->udc->connect_lock); out:trace_usb_gadget_deactivate (gadget, ret);
@@ -803,6 +841,7 @@ int usb_gadget_activate(struct usb_gadgeif (!gadget->deactivated) goto out; +mutex_lock (&gadget->udc->connect_lock); gadget->deactivated = false;/*
@@ -810,7 +849,8 @@ int usb_gadget_activate(struct usb_gadge* while it was being deactivated, we call usb_gadget_connect(). */ if (gadget->connected) - ret =usb_gadget_connect (gadget); + ret =usb_gadget_connect_locked (gadget); +mutex_unlock (&gadget->udc->connect_lock); out:trace_usb_gadget_activate (gadget, ret);
@@ -1051,12 +1091,13 @@ EXPORT_SYMBOL_GPL(usb_gadget_set_state);/* ------------------------------------------------------------------------- */ -static void usb_udc_connect_control (struct usb_udc *udc) +/* Acquire connect_lock before calling this function. */ +static void usb_udc_connect_control_locked(struct usb_udc *udc) __must_hold(&udc->connect_lock) { -if (udc->vbus) -usb_gadget_connect (udc->gadget); +if (udc->vbus && udc->started) +usb_gadget_connect_locked (udc->gadget);else -usb_gadget_disconnect (udc->gadget); +usb_gadget_disconnect_locked (udc->gadget); }/**
@@ -1072,10 +1113,12 @@ void usb_udc_vbus_handler(struct usb_gad {struct usb_udc *udc = gadget->udc; +mutex_lock (&udc->connect_lock);if (udc) { udc->vbus = status; -usb_udc_connect_control (udc); +usb_udc_connect_control_locked (udc); } +mutex_unlock (&udc->connect_lock); }EXPORT_SYMBOL_GPL (usb_udc_vbus_handler);
@@ -1097,7 +1140,7 @@ void usb_gadget_udc_reset(struct usb_gadEXPORT_SYMBOL_GPL (usb_gadget_udc_reset);/** -* usb_gadget_udc_start - tells usb device controller to start up +* usb_gadget_udc_start_locked - tells usb device controller to start up * @udc: The UDC to be started * * This call is issued by the UDC Class driver when it's about
@@ -1108,8 +1151,11 @@ EXPORT_SYMBOL_GPL(usb_gadget_udc_reset);* necessary to have it powered on. * * Returns zero on success, else negative errno. +* +* Caller should acquire connect_lock before invoking this function. */ -static inline int usb_gadget_udc_start (struct usb_udc *udc) +static inline int usb_gadget_udc_start_locked (struct usb_udc *udc) + __must_hold(&udc->connect_lock) {int ret;
@@ -1126,7 +1172,7 @@ static inline int usb_gadget_udc_start(s }/** -* usb_gadget_udc_stop - tells usb device controller we don't need it anymore +* usb_gadget_udc_stop_locked - tells usb device controller we don't need it anymore * @udc: The UDC to be stopped * * This call is issued by the UDC Class driver after calling
@@ -1135,8 +1181,11 @@ static inline int usb_gadget_udc_start(s* The details are implementation specific, but it can go as * far as powering off UDC completely and disable its data * line pullups. +* +* Caller should acquire connect lock before invoking this function. */ -static inline void usb_gadget_udc_stop (struct usb_udc *udc) +static inline void usb_gadget_udc_stop_locked (struct usb_udc *udc) + __must_hold(&udc->connect_lock) {if (!udc->started) {dev_err (&udc->dev,"UDC had already stopped\n" );
@@ -1295,6 +1344,7 @@ int usb_add_gadget(struct usb_gadget *ga udc->gadget = gadget; gadget->udc = udc; +mutex_init (&udc->connect_lock); udc->started = false;
@@ -1496,11 +1546,15 @@ static int gadget_bind_driver(struct devif (ret) goto err_bind; - ret =usb_gadget_udc_start (udc); -if (ret) +mutex_lock (&udc->connect_lock); + ret =usb_gadget_udc_start_locked (udc); +if (ret) { +mutex_unlock (&udc->connect_lock); goto err_start; + }usb_gadget_enable_async_callbacks (udc); -usb_udc_connect_control (udc); +usb_udc_connect_control_locked (udc); +mutex_unlock (&udc->connect_lock);kobject_uevent (&udc->dev.kobj,KOBJ_CHANGE );return 0 ;
@@ -1531,12 +1585,14 @@ static void gadget_unbind_driver(structkobject_uevent (&udc->dev.kobj,KOBJ_CHANGE ); -usb_gadget_disconnect (gadget); +mutex_lock (&udc->connect_lock); +usb_gadget_disconnect_locked (gadget);usb_gadget_disable_async_callbacks (udc);if (gadget->irq)synchronize_irq (gadget->irq); udc->driver->unbind (gadget); -usb_gadget_udc_stop (udc); +usb_gadget_udc_stop_locked (udc); +mutex_unlock (&udc->connect_lock);mutex_lock (&udc_lock); driver->is_bound = false;
@@ -1622,11 +1678,15 @@ static ssize_t soft_connect_store(struct }if (sysfs_streq (buf,"connect" )) { -usb_gadget_udc_start (udc); -usb_gadget_connect (udc->gadget); +mutex_lock (&udc->connect_lock); +usb_gadget_udc_start_locked (udc); +usb_gadget_connect_locked (udc->gadget); +mutex_unlock (&udc->connect_lock); }else if (sysfs_streq (buf,"disconnect" )) { -usb_gadget_disconnect (udc->gadget); -usb_gadget_udc_stop (udc); +mutex_lock (&udc->connect_lock); +usb_gadget_disconnect_locked (udc->gadget); +usb_gadget_udc_stop_locked (udc); +mutex_unlock (&udc->connect_lock); }else {dev_err (dev,"unsupported command '%s'\n" , buf); ret = -EINVAL ;
Greg Kroah-Hartman
maintainerPATCH 31/611 usb: gadget: udc: core: Prevent redundant calls to pullup
In reply to Greg Kroah-HartmanFrom: Badhri Jagan Sridharan <[email protected]>
commit a3afbf5cc887fc3401f012fe629810998ed61859 upstream.
usb_gadget_connect calls gadget->ops->pullup without checking whether gadget->connected was previously set. Make this symmetric to usb_gadget_disconnect by returning early if gadget->connected is already set.
--- drivers/usb/gadget/udc/core.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/gadget/udc/core.c +3 -0
@@ -676,6 +676,9 @@ static int usb_gadget_connect_locked(str goto out; } +if (gadget->connected) + goto out; +if (gadget->deactivated || !gadget->udc->started) {/* * If gadget is deactivated we only save new state.
Greg Kroah-Hartman
maintainerPATCH 5/611 ASoC: amd: yc: Add DMI entries to support Victus by HP Laptop 16-e1xxx (8A22)
In reply to Greg Kroah-HartmanFrom: Ge-org Brohammer <[email protected]>
[ Upstream commit 205efd4619b860404ebb5882e5a119eb3b3b3716 ]
This model requires an additional detection quirk to enable the internal microphone.
Tried to use git send-email this time.
--- sound/soc/amd/yc/acp6x-mach.c | 7 +++++++ 1 file changed, 7 insertions(+)
sound/soc/amd/yc/acp6x-mach.c +7 -0
@@ -269,6 +269,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = { DMI_MATCH(DMI_BOARD_NAME, "8A43"), } }, + { + .driver_data = &acp6x_card, + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), + DMI_MATCH(DMI_BOARD_NAME, "8A22"), + } + }, {} };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 32/611 usb: dwc3: gadget: Stall and restart EP0 if host is unresponsive
In reply to Greg Kroah-HartmanFrom: Wesley Cheng <[email protected]>
commit 02435a739b81ae24aff5d6e930efef9458e2af3c upstream.
It was observed that there are hosts that may complete pending SETUP transactions before the stop active transfers and controller halt occurs, leading to lingering endxfer commands on DEPs on subsequent pullup/gadget start iterations.
dwc3_gadget_ep_disable name=ep8in flags=0x3009 direction=1 dwc3_gadget_ep_disable name=ep4in flags=1 direction=1 dwc3_gadget_ep_disable name=ep3out flags=1 direction=0
usb_gadget_disconnect deactivated=0 connected=0 ret=0
The sequence shows that the USB gadget disconnect (dwc3_gadget_pullup(0)) routine completed successfully, allowing for the USB gadget to proceed with a USB gadget connect. However, if this occurs the system runs into an issue where:
BUG: spinlock already unlocked on CPU spin_bug+0x0 dwc3_remove_requests+0x278 dwc3_ep0_out_start+0xb0 __dwc3_gadget_start+0x25c
This is due to the pending endxfers, leading to gadget start (w/o lock held) to execute the remove requests, which will unlock the dwc3 spinlock as part of giveback.
To mitigate this, resolve the pending endxfers on the pullup disable path by re-locating the SETUP phase check after stop active transfers, since that is where the DWC3_EP_DELAY_STOP is potentially set. This also allows for handling of a host that may be unresponsive by using the completion timeout to trigger the stall and restart for EP0.
--- drivers/usb/dwc3/gadget.c | 49 ++++++++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 17 deletions(-)
drivers/usb/dwc3/gadget.c +32 -17
@@ -2522,29 +2522,17 @@ static int __dwc3_gadget_start(struct dwstatic int dwc3_gadget_soft_disconnect (struct dwc3 *dwc) {unsigned long flags; +int ret;spin_lock_irqsave (&dwc->lock, flags); dwc->connected = false;/* -* Per databook, when we want to stop the gadget, if a control transfer -* is still in process, complete it and get the core into setup phase. +* Attempt to end pending SETUP status phase, and not wait for the +* function to do so. */ -if (dwc->ep0state !=EP0_SETUP_PHASE ) { -int ret; - -if (dwc->delayed_status) -dwc3_ep0_send_delayed_status (dwc); - -reinit_completion (&dwc->ep0_in_setup); - -spin_unlock_irqrestore (&dwc->lock, flags); - ret =wait_for_completion_timeout (&dwc->ep0_in_setup, -msecs_to_jiffies (DWC3_PULL_UP_TIMEOUT )); -spin_lock_irqsave (&dwc->lock, flags); -if (ret ==0 ) -dev_warn (dwc->dev,"timed out waiting for SETUP phase\n" ); - } +if (dwc->delayed_status) +dwc3_ep0_send_delayed_status (dwc);/* * In the Synopsys DesignWare Cores USB3 Databook Rev. 3.30a
@@ -2558,6 +2546,33 @@ static int dwc3_gadget_soft_disconnect(sspin_unlock_irqrestore (&dwc->lock, flags);/* +* Per databook, when we want to stop the gadget, if a control transfer +* is still in process, complete it and get the core into setup phase. +* In case the host is unresponsive to a SETUP transaction, forcefully +* stall the transfer, and move back to the SETUP phase, so that any +* pending endxfers can be executed. +*/ +if (dwc->ep0state !=EP0_SETUP_PHASE ) { +reinit_completion (&dwc->ep0_in_setup); + + ret =wait_for_completion_timeout (&dwc->ep0_in_setup, +msecs_to_jiffies (DWC3_PULL_UP_TIMEOUT )); +if (ret ==0 ) { +unsigned int dir; + +dev_warn (dwc->dev,"wait for SETUP phase timed out\n" ); +spin_lock_irqsave (&dwc->lock, flags); + dir = !!dwc->ep0_expect_in; +if (dwc->ep0state ==EP0_DATA_PHASE ) +dwc3_ep0_end_control_data (dwc, dwc->eps[dir]); +else +dwc3_ep0_end_control_data (dwc, dwc->eps[!dir]); +dwc3_ep0_stall_and_restart (dwc); +spin_unlock_irqrestore (&dwc->lock, flags); + } + } + +/* * Note: if the GEVNTCOUNT indicates events in the event buffer, the * driver needs to acknowledge them before the controller can halt. * Simply let the interrupt handler acknowledges and handle the
Greg Kroah-Hartman
maintainerPATCH 33/611 USB: dwc3: fix runtime pm imbalance on probe errors
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit 9a8ad10c9f2e0925ff26308ec6756b93fc2f4977 upstream.
Make sure not to suspend the device when probe fails to avoid disabling clocks and phys multiple times.
--- drivers/usb/dwc3/core.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
drivers/usb/dwc3/core.c +5 -9
@@ -1883,13 +1883,11 @@ static int dwc3_probe(struct platform_despin_lock_init (&dwc->lock);mutex_init (&dwc->mutex); +pm_runtime_get_noresume (dev);pm_runtime_set_active (dev);pm_runtime_use_autosuspend (dev);pm_runtime_set_autosuspend_delay (dev,DWC3_DEFAULT_AUTOSUSPEND_DELAY );pm_runtime_enable (dev); - ret =pm_runtime_get_sync (dev); -if (ret <0 ) - goto err1;pm_runtime_forbid (dev);
@@ -1954,12 +1952,10 @@ err3:dwc3_free_event_buffers (dwc); err2: -pm_runtime_allow (&pdev->dev); - -err1: -pm_runtime_put_sync (&pdev->dev); -pm_runtime_disable (&pdev->dev); - +pm_runtime_allow (dev); +pm_runtime_disable (dev); +pm_runtime_set_suspended (dev); +pm_runtime_put_noidle (dev); disable_clks:dwc3_clk_disable (dwc); assert_reset:
Greg Kroah-Hartman
maintainerPATCH 34/611 USB: dwc3: fix runtime pm imbalance on unbind
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit 44d257e9012ee8040e41d224d0e5bfb5ef5427ea upstream.
Make sure to balance the runtime PM usage count on driver unbind by adding back the pm_runtime_allow() call that had been erroneously removed.
--- drivers/usb/dwc3/core.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/dwc3/core.c +1 -0
@@ -1979,6 +1979,7 @@ static int dwc3_remove(struct platform_ddwc3_core_exit (dwc);dwc3_ulpi_exit (dwc); +pm_runtime_allow (&pdev->dev);pm_runtime_disable (&pdev->dev);pm_runtime_put_noidle (&pdev->dev);pm_runtime_set_suspended (&pdev->dev);
Greg Kroah-Hartman
maintainerPATCH 6/611 iio: adc: palmas_gpadc: fix NULL dereference on rmmod
In reply to Greg Kroah-HartmanFrom: Patrik Dahlström <[email protected]>
[ Upstream commit 49f76c499d38bf67803438eee88c8300d0f6ce09 ]
Calling dev_to_iio_dev() on a platform device pointer is undefined and will make adc NULL.
--- drivers/iio/adc/palmas_gpadc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/palmas_gpadc.c +1 -1
@@ -639,7 +639,7 @@ static int palmas_gpadc_probe(struct platform_device *pdev)static int palmas_gpadc_remove (struct platform_device *pdev) { -struct iio_dev *indio_dev =dev_to_iio_dev (&pdev->dev); +struct iio_dev *indio_dev =dev_get_drvdata (&pdev->dev);struct palmas_gpadc *adc =iio_priv (indio_dev);if (adc->wakeup1_enable || adc->wakeup2_enable)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 7/611 ASoC: Intel: bytcr_rt5640: Add quirk for the Acer Iconia One 7 B1-750
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
[ Upstream commit e38c5e80c3d293a883c6f1d553f2146ec0bda35e ]
The Acer Iconia One 7 B1-750 tablet mostly works fine with the defaults for an Bay Trail CR tablet. Except for the internal mic, instead of an analog mic on IN3 a digital mic on DMIC1 is uses.
Add a quirk with these settings for this tablet.
--- sound/soc/intel/boards/bytcr_rt5640.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
sound/soc/intel/boards/bytcr_rt5640.c +12 -0
@@ -533,6 +533,18 @@ static int byt_rt5640_aif1_hw_params(struct snd_pcm_substream *substream,/* Please keep this list alphabetically sorted */ static const struct dmi_system_id byt_rt5640_quirk_table[] = { + {/* Acer Iconia One 7 B1-750 */ + .matches = { +DMI_EXACT_MATCH (DMI_SYS_VENDOR ,"Insyde" ), +DMI_EXACT_MATCH (DMI_PRODUCT_NAME ,"VESPA2" ), + }, + .driver_data = (void *)(BYT_RT5640_DMIC1_MAP | +BYT_RT5640_JD_SRC_JD1_IN4P | +BYT_RT5640_OVCD_TH_1500UA | +BYT_RT5640_OVCD_SF_0P75 | +BYT_RT5640_SSP0_AIF1 | +BYT_RT5640_MCLK_EN ), + }, {/* Acer Iconia Tab 8 W1-810 */ .matches = {DMI_EXACT_MATCH (DMI_SYS_VENDOR ,"Acer" ),
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 8/611 ASoC: da7213.c: add missing pm_runtime_disable()
In reply to Greg Kroah-HartmanFrom: Duy Nguyen <[email protected]>
[ Upstream commit 44378cd113e5f15bb0a89f5ac5a0e687b52feb90 ]
da7213.c is missing pm_runtime_disable(), thus we will get below error when rmmod -> insmod.
$ rmmod snd-soc-da7213.ko $ insmod snd-soc-da7213.ko da7213 0-001a: Unbalanced pm_runtime_enable!"
[Kuninori adjusted to latest upstream]
--- sound/soc/codecs/da7213.c | 6 ++++++ 1 file changed, 6 insertions(+)
sound/soc/codecs/da7213.c +6 -0
@@ -1996,6 +1996,11 @@ static int da7213_i2c_probe(struct i2c_client *i2c)return ret; } +static void da7213_i2c_remove (struct i2c_client *i2c) +{ +pm_runtime_disable (&i2c->dev); +} +static int __maybe_unused da7213_runtime_suspend (struct device *dev) {struct da7213_priv *da7213 =dev_get_drvdata (dev);
@@ -2039,6 +2044,7 @@ static struct i2c_driver da7213_i2c_driver = { .pm = &da7213_pm, }, .probe_new = da7213_i2c_probe, + .remove = da7213_i2c_remove, .id_table = da7213_i2c_id, };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 9/611 net: wwan: t7xx: do not compile with -Werror
In reply to Greg Kroah-HartmanFrom: Jiri Slaby (SUSE) <[email protected]>
[ Upstream commit 362f0b6678ad1377c322a7dd237ea6785efc7342 ]
When playing with various compilers or their versions, some choke on the t7xx code. For example (with gcc 13):
In file included from ./arch/s390/include/generated/asm/rwonce.h:1,
from ../include/linux/compiler.h:247,
from ../include/linux/build_bug.h:5,
from ../include/linux/bits.h:22,
from ../drivers/net/wwan/t7xx/t7xx_state_monitor.c:17:
In function 'preempt_count',
inlined from 't7xx_fsm_append_event' at ../drivers/net/wwan/t7xx/t7xx_state_monitor.c:439:43: ../include/asm-generic/rwonce.h:44:26: error: array subscript 0 is outside array bounds of 'const volatile int[0]' [-Werror=array-bounds=]
There is no reason for any code in the kernel to be built with -Werror by default. Note that we have generic CONFIG_WERROR. So if anyone wants -Werror, they can enable that.
--- drivers/net/wwan/t7xx/Makefile | 2 -- 1 file changed, 2 deletions(-)
drivers/net/wwan/t7xx/Makefile +0 -2
@@ -1,7 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only -ccflags-y += -Werror - obj-${CONFIG_MTK_T7XX} := mtk_t7xx.o mtk_t7xx-y:= t7xx_pci.o \ t7xx_pcie_mac.o \
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 10/611 selftests mount: Fix mount_setattr_test builds failed
In reply to Greg Kroah-HartmanFrom: Anh Tuan Phan <[email protected]>
[ Upstream commit f1594bc676579133a3cd906d7d27733289edfb86 ]
When compiling selftests with target mount_setattr I encountered some errors with the below messages:mount_setattr_test.c: In function ‘mount_setattr_thread’:
mount_setattr_test.c:343:16: error: variable ‘attr’ has initializer but incomplete type
343 | struct mount_attr attr = {
| ^~~~~~~~~~These errors might be because of linux/mount.h is not included. This patch resolves that issue.
--- tools/testing/selftests/mount_setattr/mount_setattr_test.c | 1 + 1 file changed, 1 insertion(+)
tools/testing/selftests/mount_setattr/mount_setattr_test.c +1 -0
@@ -18,6 +18,7 @@#include <grp.h> #include <stdbool.h> #include <stdarg.h> +#include <linux/mount.h> #include "../kselftest_harness.h"
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 11/611 scsi: mpi3mr: Handle soft reset in progress fault code (0xF002)
In reply to Greg Kroah-HartmanFrom: Ranjan Kumar <[email protected]>
[ Upstream commit a3d27dfdcfc27ac3f46de5391bb6d24f04af7941 ]
The driver is exiting from the fault watchdog thread if it sees the 0xF002 (Soft reset in progress) fault code.
If the driver initiates the soft reset, then the driver restarts the watchdog at the end of the soft reset completion. However, if the soft reset is initiated by the firmware asynchronously, then the driver will never restart the watchdog and never re-initialize the controller after the asynchronous soft reset completion.
--- drivers/scsi/mpi3mr/mpi3mr_fw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/mpi3mr/mpi3mr_fw.c +1 -1
@@ -2526,7 +2526,7 @@ static void mpi3mr_watchdog_work(struct work_struct *work) mrioc->unrecoverable =1 ; goto schedule_work;case MPI3_SYSIF_FAULT_CODE_SOFT_RESET_IN_PROGRESS : -return ; + goto schedule_work;case MPI3_SYSIF_FAULT_CODE_CI_ACTIVATION_RESET : reset_reason =MPI3MR_RESET_FROM_CIACTIV_FAULT ;break ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 2/611 ASoC: Intel: soc-acpi: add table for Intel Rooks County NUC M15
In reply to Greg Kroah-HartmanFrom: Eugene Huang <[email protected]>
[ Upstream commit 9c691a42b8926c8966561265cdae3ddc7464d3a2 ]
Same topology as the HP Omen 16-k0005TX, except with the rt1316 amp on link2.
--- .../intel/common/soc-acpi-intel-adl-match.c | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+)
sound/soc/intel/common/soc-acpi-intel-adl-match.c +20 -0
@@ -354,6 +354,20 @@ static const struct snd_soc_acpi_link_adr adl_sdw_rt711_link0_rt1316_link3[] = { {} }; +static const struct snd_soc_acpi_link_adr adl_sdw_rt711_link0_rt1316_link2[] = { + { + .mask =BIT (0 ), + .num_adr =ARRAY_SIZE (rt711_sdca_0_adr), + .adr_d = rt711_sdca_0_adr, + }, + { + .mask =BIT (2 ), + .num_adr =ARRAY_SIZE (rt1316_2_single_adr), + .adr_d = rt1316_2_single_adr, + }, + {} +}; +static const struct snd_soc_acpi_adr_device mx8373_2_adr[] = { { .adr =0x000223019F837300ull ,
@@ -612,6 +626,12 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_sdw_machines[] = { .drv_name = "sof_sdw", .sof_tplg_filename = "sof-adl-rt711-l0-rt1316-l3.tplg", }, + { + .link_mask = 0x5, /* 2 active links required */ + .links = adl_sdw_rt711_link0_rt1316_link2, + .drv_name = "sof_sdw", + .sof_tplg_filename = "sof-adl-rt711-l0-rt1316-l2.tplg", + }, { .link_mask = 0x1, /* link0 required */ .links = adl_rvp,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 36/611 hwmon: (adt7475) Use device_property APIs when configuring polarity
In reply to Greg Kroah-HartmanFrom: Chris Packham <[email protected]>
commit 2a8e41ad337508fc5d598c0f9288890214f8e318 upstream.
On DT unaware platforms of_property_read_u32_array() returns -ENOSYS which wasn't handled by the code treating adi,pwm-active-state as optional. Update the code to use device_property_read_u32_array() which deals gracefully with DT unaware platforms.
--- drivers/hwmon/adt7475.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/hwmon/adt7475.c +3 -3
@@ -1604,9 +1604,9 @@ static int adt7475_set_pwm_polarity(struint ret, i;u8 val; - ret =of_property_read_u32_array (client->dev.of_node, -"adi,pwm-active-state" , states, -ARRAY_SIZE (states)); + ret =device_property_read_u32_array (&client->dev, +"adi,pwm-active-state" , states, +ARRAY_SIZE (states));if (ret)return ret;
Greg Kroah-Hartman
maintainerPATCH 45/611 blk-mq: release crypto keyslot before reporting I/O complete
In reply to Greg Kroah-HartmanFrom: Eric Biggers <[email protected]>
commit 9cd1e566676bbcb8a126acd921e4e194e6339603 upstream.
Once all I/O using a blk_crypto_key has completed, filesystems can call blk_crypto_evict_key(). However, the block layer currently doesn't call blk_crypto_put_keyslot() until the request is being freed, which happens after upper layers have been told (via bio_endio()) the I/O has completed. This causes a race condition where blk_crypto_evict_key() can see 'slot_refs != 0' without there being an actual bug.
This makes __blk_crypto_evict_key() hit the 'WARN_ON_ONCE(atomic_read(&slot->slot_refs) != 0)' and return without doing anything, eventually causing a use-after-free in blk_crypto_reprogram_all_keys(). (This is a very rare bug and has only been seen when per-file keys are being used with fscrypt.)
There are two options to fix this: either release the keyslot before bio_endio() is called on the request's last bio, or make __blk_crypto_evict_key() ignore slot_refs. Let's go with the first solution, since it preserves the ability to report bugs (via WARN_ON_ONCE) where a key is evicted while still in-use.
--- block/blk-crypto-internal.h | 25 +++++++++++++++++++++---- block/blk-crypto.c | 24 ++++++++++++------------ block/blk-merge.c | 2 ++ block/blk-mq.c | 15 ++++++++++++++- 4 files changed, 49 insertions(+), 17 deletions(-)
block/blk-crypto-internal.h +21 -4
@@ -65,6 +65,11 @@ static inline bool blk_crypto_rq_is_encrreturn rq->crypt_ctx; } +static inline bool blk_crypto_rq_has_keyslot (struct request *rq) +{ +return rq->crypt_keyslot; +} +blk_status_t blk_crypto_get_keyslot (struct blk_crypto_profile *profile,const struct blk_crypto_key *key,struct blk_crypto_keyslot **slot_ptr);
@@ -117,6 +122,11 @@ static inline bool blk_crypto_rq_is_encr return false; } +static inline bool blk_crypto_rq_has_keyslot (struct request *rq) +{ +return false; +} +#endif /* CONFIG_BLK_INLINE_ENCRYPTION */ void __bio_crypt_advance (struct bio *bio,unsigned int bytes);
@@ -151,14 +161,21 @@ static inline bool blk_crypto_bio_prep(sreturn true; } -blk_status_t __blk_crypto_init_request (struct request *rq); -static inline blk_status_t blk_crypto_init_request (struct request *rq) +blk_status_t __blk_crypto_rq_get_keyslot (struct request *rq); +static inline blk_status_t blk_crypto_rq_get_keyslot (struct request *rq) {if (blk_crypto_rq_is_encrypted (rq)) -return __blk_crypto_init_request (rq); +return __blk_crypto_rq_get_keyslot (rq);return BLK_STS_OK ; } +void __blk_crypto_rq_put_keyslot (struct request *rq); +static inline void blk_crypto_rq_put_keyslot (struct request *rq) +{ +if (blk_crypto_rq_has_keyslot (rq)) +__blk_crypto_rq_put_keyslot (rq); +} +void __blk_crypto_free_request (struct request *rq);static inline void blk_crypto_free_request (struct request *rq) {
@@ -197,7 +214,7 @@ static inline blk_status_t blk_crypto_in {if (blk_crypto_rq_is_encrypted (rq)) -return blk_crypto_init_request (rq); +return blk_crypto_rq_get_keyslot (rq);return BLK_STS_OK ; }
block/blk-crypto.c +12 -12
@@ -218,27 +218,27 @@ static bool bio_crypt_check_alignment(streturn true; } -blk_status_t __blk_crypto_init_request (struct request *rq) +blk_status_t __blk_crypto_rq_get_keyslot (struct request *rq) {return blk_crypto_get_keyslot (rq->q->crypto_profile, rq->crypt_ctx->bc_key, &rq->crypt_keyslot); } -/** -* __blk_crypto_free_request - Uninitialize the crypto fields of a request. -* -* @rq: The request whose crypto fields to uninitialize. -* -* Completely uninitializes the crypto fields of a request. If a keyslot has -* been programmed into some inline encryption hardware, that keyslot is -* released. The rq->crypt_ctx is also freed. -*/ -void __blk_crypto_free_request (struct request *rq) +void __blk_crypto_rq_put_keyslot (struct request *rq) {blk_crypto_put_keyslot (rq->crypt_keyslot); + rq->crypt_keyslot =NULL ; +} + +void __blk_crypto_free_request (struct request *rq) +{ +/* The keyslot, if one was needed, should have been released earlier. */ +if (WARN_ON_ONCE (rq->crypt_keyslot)) +__blk_crypto_rq_put_keyslot (rq); +mempool_free (rq->crypt_ctx, bio_crypt_ctx_pool); -blk_crypto_rq_set_defaults (rq); + rq->crypt_ctx =NULL ; }/**
block/blk-merge.c +2 -0
@@ -863,6 +863,8 @@ static struct request *attempt_merge(strif (!blk_discard_mergable (req))elv_merge_requests (q, req, next); +blk_crypto_rq_put_keyslot (next); +/* * 'next' is going away, so update stats accordingly */
block/blk-mq.c +14 -1
@@ -808,6 +808,12 @@ static void blk_complete_request(struct req->q->integrity.profile->complete_fn (req, total_bytes);#endif +/* +* Upper layers may call blk_crypto_evict_key() anytime after the last +* bio_endio(). Therefore, the keyslot must be released before that. +*/ +blk_crypto_rq_put_keyslot (req); +blk_account_io_completion (req, total_bytes); do {
@@ -873,6 +879,13 @@ bool blk_update_request(struct request * req->q->integrity.profile->complete_fn (req, nr_bytes);#endif +/* +* Upper layers may call blk_crypto_evict_key() anytime after the last +* bio_endio(). Therefore, the keyslot must be released before that. +*/ +if (blk_crypto_rq_has_keyslot (req) && nr_bytes >=blk_rq_bytes (req)) +__blk_crypto_rq_put_keyslot (req); +if (unlikely (error && !blk_rq_is_passthrough (req) && !(req->rq_flags &RQF_QUIET )) && !test_bit (GD_DEAD , &req->q->disk->state)) {
@@ -2955,7 +2968,7 @@ void blk_mq_submit_bio(struct bio *bio)blk_mq_bio_to_request (rq, bio, nr_segs); - ret =blk_crypto_init_request (rq); + ret =blk_crypto_rq_get_keyslot (rq);if (ret !=BLK_STS_OK ) { bio->bi_status = ret;bio_endio (bio);
Greg Kroah-Hartman
maintainerPATCH 46/611 blk-crypto: make blk_crypto_evict_key() return void
In reply to Greg Kroah-HartmanFrom: Eric Biggers <[email protected]>
commit 70493a63ba04f754f7a7dd53a4fcc82700181490 upstream.
blk_crypto_evict_key() is only called in contexts such as inode eviction where failure is not an option. So there is nothing the caller can do with errors except log them. (dm-table.c does "use" the error code, but only to pass on to upper layers, so it doesn't really count.)
Just make blk_crypto_evict_key() return void and log errors itself.
--- block/blk-crypto.c | 20 +++++++++----------- drivers/md/dm-table.c | 19 +++++-------------- include/linux/blk-crypto.h | 4 ++-- 3 files changed, 16 insertions(+), 27 deletions(-)
block/blk-crypto.c +9 -11
@@ -13,6 +13,7 @@#include <linux/blkdev.h> #include <linux/blk-crypto-profile.h> #include <linux/module.h> +#include <linux/ratelimit.h> #include <linux/slab.h> #include "blk-crypto-internal.h"
@@ -402,21 +403,18 @@ int blk_crypto_start_using_key(struct bl* Upper layers (filesystems) must call this function to ensure that a key is * evicted from any hardware that it might have been programmed into. The key * must not be in use by any in-flight IO when this function is called. -* -* Return: 0 on success or if the key wasn't in any keyslot; -errno on error. */ -int blk_crypto_evict_key (struct block_device *bdev, -const struct blk_crypto_key *key) +void blk_crypto_evict_key (struct block_device *bdev, +const struct blk_crypto_key *key) {struct request_queue *q =bdev_get_queue (bdev); +int err;if (blk_crypto_config_supported_natively (bdev, &key->crypto_cfg)) -return __blk_crypto_evict_key (q->crypto_profile, key); - -/* -* If the block_device didn't support the key, then blk-crypto-fallback -* may have been used, so try to evict the key from blk-crypto-fallback. -*/ -return blk_crypto_fallback_evict_key (key); + err =__blk_crypto_evict_key (q->crypto_profile, key); +else + err =blk_crypto_fallback_evict_key (key); +if (err) +pr_warn_ratelimited ("%pg: error %d evicting key\n" , bdev, err); }EXPORT_SYMBOL_GPL (blk_crypto_evict_key);
drivers/md/dm-table.c +5 -14
@@ -1203,21 +1203,12 @@ struct dm_crypto_profile {struct mapped_device *md; }; -struct dm_keyslot_evict_args { -const struct blk_crypto_key *key; -int err; -}; -static int dm_keyslot_evict_callback (struct dm_target *ti,struct dm_dev *dev,sector_t start,sector_t len,void *data) { -struct dm_keyslot_evict_args *args = data; -int err; +const struct blk_crypto_key *key = data; - err =blk_crypto_evict_key (dev->bdev, args->key); -if (!args->err) - args->err = err; -/* Always try to evict the key from all devices. */ +blk_crypto_evict_key (dev->bdev, key);return 0 ; }
@@ -1230,7 +1221,6 @@ static int dm_keyslot_evict(struct blk_c {struct mapped_device *md = container_of(profile, struct dm_crypto_profile, profile)->md; -struct dm_keyslot_evict_args args = { key };struct dm_table *t;int srcu_idx;
@@ -1243,11 +1233,12 @@ static int dm_keyslot_evict(struct blk_cif (!ti->type->iterate_devices)continue ; - ti->type->iterate_devices (ti, dm_keyslot_evict_callback, &args); + ti->type->iterate_devices (ti, dm_keyslot_evict_callback, + (void *)key); }dm_put_live_table (md, srcu_idx); -return args.err; +return 0 ; } static int
include/linux/blk-crypto.h +2 -2
@@ -94,8 +94,8 @@ int blk_crypto_init_key(struct blk_cryptint blk_crypto_start_using_key (struct block_device *bdev,const struct blk_crypto_key *key); -int blk_crypto_evict_key (struct block_device *bdev, -const struct blk_crypto_key *key); +void blk_crypto_evict_key (struct block_device *bdev, +const struct blk_crypto_key *key);bool blk_crypto_config_supported_natively (struct block_device *bdev,const struct blk_crypto_config *cfg);
Greg Kroah-Hartman
maintainerPATCH 47/611 blk-crypto: make blk_crypto_evict_key() more robust
In reply to Greg Kroah-HartmanFrom: Eric Biggers <[email protected]>
commit 5c7cb94452901a93e90c2230632e2c12a681bc92 upstream.
If blk_crypto_evict_key() sees that the key is still in-use (due to a bug) or that ->keyslot_evict failed, it currently just returns while leaving the key linked into the keyslot management structures.
However, blk_crypto_evict_key() is only called in contexts such as inode eviction where failure is not an option. So actually the caller proceeds with freeing the blk_crypto_key regardless of the return value of blk_crypto_evict_key().
These two assumptions don't match, and the result is that there can be a use-after-free in blk_crypto_reprogram_all_keys() after one of these errors occurs. (Note, these errors *shouldn't* happen; we're just talking about what happens if they do anyway.)
Fix this by making blk_crypto_evict_key() unlink the key from the keyslot management structures even on failure.
Also improve some comments.
--- block/blk-crypto-profile.c | 46 ++++++++++++++++++++------------------------- block/blk-crypto.c | 28 +++++++++++++++++++-------- 2 files changed, 41 insertions(+), 33 deletions(-)
block/blk-crypto-profile.c +21 -25
@@ -354,28 +354,16 @@ bool __blk_crypto_cfg_supported(struct breturn true; } -/** -* __blk_crypto_evict_key() - Evict a key from a device. -* @profile: the crypto profile of the device -* @key: the key to evict. It must not still be used in any I/O. -* -* If the device has keyslots, this finds the keyslot (if any) that contains the -* specified key and calls the driver's keyslot_evict function to evict it. -* -* Otherwise, this just calls the driver's keyslot_evict function if it is -* implemented, passing just the key (without any particular keyslot). This -* allows layered devices to evict the key from their underlying devices. -* -* Context: Process context. Takes and releases profile->lock. -* Return: 0 on success or if there's no keyslot with the specified key, -EBUSY -* if the keyslot is still in use, or another -errno value on other -* error. +/* +* This is an internal function that evicts a key from an inline encryption +* device that can be either a real device or the blk-crypto-fallback "device". +* It is used only by blk_crypto_evict_key(); see that function for details. */ int __blk_crypto_evict_key (struct blk_crypto_profile *profile,const struct blk_crypto_key *key) {struct blk_crypto_keyslot *slot; -int err =0 ; +int err;if (profile->num_slots ==0 ) {if (profile->ll_ops.keyslot_evict) {
@@ -389,22 +377,30 @@ int __blk_crypto_evict_key(struct blk_crblk_crypto_hw_enter (profile); slot =blk_crypto_find_keyslot (profile, key); -if (!slot) - goto out_unlock; +if (!slot) { +/* +* Not an error, since a key not in use by I/O is not guaranteed +* to be in a keyslot. There can be more keys than keyslots. +*/ + err =0 ; + goto out; + }if (WARN_ON_ONCE (atomic_read (&slot->slot_refs) !=0 )) { +/* BUG: key is still in use by I/O */ err = -EBUSY ; - goto out_unlock; + goto out_remove; } err = profile->ll_ops.keyslot_evict (profile, key,blk_crypto_keyslot_index (slot)); -if (err) - goto out_unlock; - +out_remove: +/* +* Callers free the key even on error, so unlink the key from the hash +* table and clear slot->key even on error. +*/ hlist_del (&slot->hash_node); slot->key =NULL ; - err =0 ; -out_unlock: +out:blk_crypto_hw_exit (profile);return err; }
block/blk-crypto.c +20 -8
@@ -394,15 +394,19 @@ int blk_crypto_start_using_key(struct bl }/** -* blk_crypto_evict_key() - Evict a key from any inline encryption hardware -* it may have been programmed into -* @bdev: The block_device who's associated inline encryption hardware this key -* might have been programmed into -* @key: The key to evict +* blk_crypto_evict_key() - Evict a blk_crypto_key from a block_device +* @bdev: a block_device on which I/O using the key may have been done +* @key: the key to evict * -* Upper layers (filesystems) must call this function to ensure that a key is -* evicted from any hardware that it might have been programmed into. The key -* must not be in use by any in-flight IO when this function is called. +* For a given block_device, this function removes the given blk_crypto_key from +* the keyslot management structures and evicts it from any underlying hardware +* keyslot(s) or blk-crypto-fallback keyslot it may have been programmed into. +* +* Upper layers must call this before freeing the blk_crypto_key. It must be +* called for every block_device the key may have been used on. The key must no +* longer be in use by any I/O when this function is called. +* +* Context: May sleep. */ void blk_crypto_evict_key (struct block_device *bdev,const struct blk_crypto_key *key)
@@ -414,6 +418,14 @@ void blk_crypto_evict_key(struct block_d err =__blk_crypto_evict_key (q->crypto_profile, key); else err =blk_crypto_fallback_evict_key (key); +/* +* An error can only occur here if the key failed to be evicted from a +* keyslot (due to a hardware or driver issue) or is allegedly still in +* use by I/O (due to a kernel bug). Even in these cases, the key is +* still unlinked from the keyslot management structures, and the caller +* is allowed and expected to free it right away. There's nothing +* callers can do to handle errors, so just log them and return void. +*/ if (err)pr_warn_ratelimited ("%pg: error %d evicting key\n" , bdev, err); }
Greg Kroah-Hartman
maintainerPATCH 48/611 staging: iio: resolver: ads1210: fix config mode
In reply to Greg Kroah-HartmanFrom: Nuno Sá <[email protected]>
commit 16313403d873ff17a587818b61f84c8cb4971cef upstream.
As stated in the device datasheet [1], bits a0 and a1 have to be set to 1 for the configuration mode.
[1]: https://www.analog.com/media/en/technical-documentation/data-sheets/ad2s1210.pdf
--- drivers/staging/iio/resolver/ad2s1210.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/iio/resolver/ad2s1210.c +1 -1
@@ -101,7 +101,7 @@ struct ad2s1210_state {static const int ad2s1210_mode_vals[4 ][2 ] = { [MOD_POS ] = {0 ,0 }, [MOD_VEL ] = {0 ,1 }, - [MOD_CONFIG ] = {1 ,0 }, + [MOD_CONFIG ] = {1 ,1 }, }; static inline void ad2s1210_set_mode(enum ad2s1210_mode mode,
Greg Kroah-Hartman
maintainerPATCH 49/611 tty: Prevent writing chars during tcsetattr TCSADRAIN/FLUSH
In reply to Greg Kroah-HartmanFrom: Ilpo Järvinen <[email protected]>
commit 094fb49a2d0d6827c86d2e0840873e6db0c491d2 upstream.
If userspace races tcsetattr() with a write, the drained condition might not be guaranteed by the kernel. There is a race window after checking Tx is empty before tty_set_termios() takes termios_rwsem for write. During that race window, more characters can be queued by a racing writer.
Any ongoing transmission might produce garbage during HW's ->set_termios() call. The intent of TCSADRAIN/FLUSH seems to be preventing such a character corruption. If those flags are set, take tty's write lock to stop any writer before performing the lower layer Tx empty check and wait for the pending characters to be sent (if any).
The initial wait for all-writers-done must be placed outside of tty's write lock to avoid deadlock which makes it impossible to use tty_wait_until_sent(). The write lock is retried if a racing write is detected.
--- drivers/tty/tty.h | 2 ++ drivers/tty/tty_io.c | 4 ++-- drivers/tty/tty_ioctl.c | 45 +++++++++++++++++++++++++++++++++------------ 3 files changed, 37 insertions(+), 14 deletions(-)
drivers/tty/tty.h +2 -0
@@ -62,6 +62,8 @@ int __tty_check_change(struct tty_structint tty_check_change (struct tty_struct *tty);void __stop_tty (struct tty_struct *tty);void __start_tty (struct tty_struct *tty); +void tty_write_unlock (struct tty_struct *tty); +int tty_write_lock (struct tty_struct *tty,int ndelay);void tty_vhangup_session (struct tty_struct *tty);void tty_open_proc_set_tty (struct file *filp,struct tty_struct *tty);int tty_signal_session_leader (struct tty_struct *tty,int exit_session);
drivers/tty/tty_io.c +2 -2
@@ -933,13 +933,13 @@ static ssize_t tty_read(struct kiocb *ioreturn i; } -static void tty_write_unlock (struct tty_struct *tty) +void tty_write_unlock (struct tty_struct *tty) {mutex_unlock (&tty->atomic_write_lock);wake_up_interruptible_poll (&tty->write_wait,EPOLLOUT ); } -static int tty_write_lock (struct tty_struct *tty,int ndelay) +int tty_write_lock (struct tty_struct *tty,int ndelay) {if (!mutex_trylock (&tty->atomic_write_lock)) {if (ndelay)
drivers/tty/tty_ioctl.c +33 -12
54 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 50/611 xhci: fix debugfs register accesses while suspended
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit 735baf1b23458f71a8b15cb924af22c9ff9cd125 upstream.
Wire up the debugfs regset device pointer so that the controller is resumed before accessing registers to avoid crashing or locking up if it happens to be runtime suspended.
--- drivers/usb/host/xhci-debugfs.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/host/xhci-debugfs.c +1 -0
@@ -133,6 +133,7 @@ static void xhci_debugfs_regset(struct x regset->regs = regs; regset->nregs = nregs; regset->base = hcd->regs + base; + regset->dev = hcd->self.controller;debugfs_create_regset32 ((const char *)rgs->name,0444 , parent, regset); }
Greg Kroah-Hartman
maintainerPATCH 51/611 serial: fix TIOCSRS485 locking
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit 9e4f2a8004213339e9d837d891a59cc80e082966 upstream.
The RS485 multipoint addressing support for some reason added a new ADDRB termios cflag which is (only!) updated from one of the RS485 ioctls.
Make sure to take the termios rw semaphore for the right ioctl (i.e. set, not get).
--- drivers/tty/serial/serial_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/tty/serial/serial_core.c +2 -2
@@ -1552,7 +1552,7 @@ uart_ioctl(struct tty_struct *tty, unsig goto out;/* rs485_config requires more locking than others */ -if (cmd ==TIOCGRS485 ) +if (cmd ==TIOCSRS485 )down_write (&tty->termios_rwsem);mutex_lock (&port->mutex);
@@ -1595,7 +1595,7 @@ uart_ioctl(struct tty_struct *tty, unsig } out_up:mutex_unlock (&port->mutex); -if (cmd ==TIOCGRS485 ) +if (cmd ==TIOCSRS485 )up_write (&tty->termios_rwsem); out:return ret;
Greg Kroah-Hartman
maintainerPATCH 52/611 serial: 8250: Fix serial8250_tx_empty() race with DMA Tx
In reply to Greg Kroah-HartmanFrom: Ilpo Järvinen <[email protected]>
commit 146a37e05d620cef4ad430e5d1c9c077fe6fa76f upstream.
There's a potential race before THRE/TEMT deasserts when DMA Tx is starting up (or the next batch of continuous Tx is being submitted). This can lead to misdetecting Tx empty condition.
It is entirely normal for THRE/TEMT to be set for some time after the DMA Tx had been setup in serial8250_tx_dma(). As Tx side is definitely not empty at that point, it seems incorrect for serial8250_tx_empty() claim Tx is empty.
Fix the race by also checking in serial8250_tx_empty() whether there's DMA Tx active.
Note: This fix only addresses in-kernel race mainly to make using TCSADRAIN/FLUSH robust. Userspace can still cause other races but they seem userspace concurrency control problems.
--- drivers/tty/serial/8250/8250.h | 12 ++++++++++++ drivers/tty/serial/8250/8250_port.c | 7 ++++--- 2 files changed, 16 insertions(+), 3 deletions(-)
drivers/tty/serial/8250/8250.h +12 -0
@@ -365,6 +365,13 @@ static inline void serial8250_do_prepareif (dma->prepare_rx_dma) dma->prepare_rx_dma(p); } + +static inline bool serial8250_tx_dma_running (struct uart_8250_port *p) +{ +struct uart_8250_dma *dma = p->dma; + +return dma && dma->tx_running; +}#else static inline int serial8250_tx_dma (struct uart_8250_port *p) {
@@ -380,6 +387,11 @@ static inline int serial8250_request_dma return -1; }static inline void serial8250_release_dma (struct uart_8250_port *p) { } + +static inline bool serial8250_tx_dma_running (struct uart_8250_port *p) +{ +return false; +}#endif static inline int ns16550a_goto_highspeed (struct uart_8250_port *up)
drivers/tty/serial/8250/8250_port.c +4 -3
@@ -2010,18 +2010,19 @@ static int serial8250_tx_threshold_handlstatic unsigned int serial8250_tx_empty (struct uart_port *port) {struct uart_8250_port *up =up_to_u8250p (port); +unsigned int result =0 ;unsigned long flags; -u16 lsr;serial8250_rpm_get (up);spin_lock_irqsave (&port->lock, flags); - lsr =serial_lsr_in (up); +if (!serial8250_tx_dma_running (up) &&uart_lsr_tx_empty (serial_lsr_in (up))) + result =TIOCSER_TEMT ;spin_unlock_irqrestore (&port->lock, flags);serial8250_rpm_put (up); -return uart_lsr_tx_empty (lsr) ?TIOCSER_TEMT :0 ; +return result; }unsigned int serial8250_do_get_mctrl (struct uart_port *port)
Greg Kroah-Hartman
maintainerPATCH 53/611 serial: max310x: fix IO data corruption in batched operations
In reply to Greg Kroah-HartmanFrom: Jan Kundrát <[email protected]>
commit 3f42b142ea1171967e40e10e4b0241c0d6d28d41 upstream.
After upgrading from 5.16 to 6.1, our board with a MAX14830 started producing lots of garbage data over UART. Bisection pointed out commit 285e76fc049c as the culprit. That patch tried to replace hand-written code which I added in 2b4bac48c1084 ("serial: max310x: Use batched reads when reasonably safe") with the generic regmap infrastructure for batched operations.
Unfortunately, the regmap_raw_read and regmap_raw_write which were used are actually functions which perform IO over *multiple* registers. That's not what is needed for accessing these Tx/Rx FIFOs; the appropriate functions are the _noinc_ versions, not the _raw_ ones.
Fix this regression by using regmap_noinc_read() and regmap_noinc_write() along with the necessary regmap_config setup; with this patch in place, our board communicates happily again. Since our board uses SPI for talking to this chip, the I2C part is completely untested.
--- drivers/tty/serial/max310x.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)
drivers/tty/serial/max310x.c +15 -2
@@ -525,6 +525,11 @@ static bool max310x_reg_precious(structreturn false; } +static bool max310x_reg_noinc (struct device *dev,unsigned int reg) +{ +return reg ==MAX310X_RHR_REG ; +} +static int max310x_set_baud (struct uart_port *port,int baud) {unsigned int mode =0 , div =0 , frac =0 , c =0 ,F =0 ;
@@ -651,14 +656,14 @@ static void max310x_batch_write(struct u {struct max310x_one *one =to_max310x_port (port); -regmap_raw_write (one->regmap,MAX310X_THR_REG , txbuf, len); +regmap_noinc_write (one->regmap,MAX310X_THR_REG , txbuf, len); }static void max310x_batch_read (struct uart_port *port,u8 *rxbuf,unsigned int len) {struct max310x_one *one =to_max310x_port (port); -regmap_raw_read (one->regmap,MAX310X_RHR_REG , rxbuf, len); +regmap_noinc_read (one->regmap,MAX310X_RHR_REG , rxbuf, len); }static void max310x_handle_rx (struct uart_port *port,unsigned int rxlen)
@@ -1472,6 +1477,10 @@ static struct regmap_config regcfg = { .writeable_reg = max310x_reg_writeable, .volatile_reg = max310x_reg_volatile, .precious_reg = max310x_reg_precious, + .writeable_noinc_reg = max310x_reg_noinc, + .readable_noinc_reg = max310x_reg_noinc, + .max_raw_read = MAX310X_FIFO_SIZE, + .max_raw_write = MAX310X_FIFO_SIZE, };#ifdef CONFIG_SPI_MASTER
@@ -1557,6 +1566,10 @@ static struct regmap_config regcfg_i2c = .volatile_reg = max310x_reg_volatile, .precious_reg = max310x_reg_precious, .max_register = MAX310X_I2C_REVID_EXTREG, + .writeable_noinc_reg = max310x_reg_noinc, + .readable_noinc_reg = max310x_reg_noinc, + .max_raw_read = MAX310X_FIFO_SIZE, + .max_raw_write = MAX310X_FIFO_SIZE, };static const struct max310x_if_cfg max310x_i2c_if_cfg = {
Greg Kroah-Hartman
maintainerPATCH 54/611 tick/nohz: Fix cpu_is_hotpluggable() by checking with nohz subsystem
In reply to Greg Kroah-HartmanFrom: Joel Fernandes (Google) <[email protected]>
commit 58d7668242647e661a20efe065519abd6454287e upstream.
For CONFIG_NO_HZ_FULL systems, the tick_do_timer_cpu cannot be offlined. However, cpu_is_hotpluggable() still returns true for those CPUs. This causes torture tests that do offlining to end up trying to offline this CPU causing test failures. Such failure happens on all architectures.
Fix the repeated error messages thrown by this (even if the hotplug errors are harmless) by asking the opinion of the nohz subsystem on whether the CPU can be hotplugged.
[ Apply Frederic Weisbecker feedback on refactoring tick_nohz_cpu_down(). ]
For drivers/base/ portion:
--- drivers/base/cpu.c | 3 ++- include/linux/tick.h | 2 ++ kernel/time/tick-sched.c | 11 ++++++++--- 3 files changed, 12 insertions(+), 4 deletions(-)
drivers/base/cpu.c +2 -1
@@ -487,7 +487,8 @@ static const struct attribute_group *cpubool cpu_is_hotpluggable (unsigned int cpu) {struct device *dev =get_cpu_device (cpu); - return dev && container_of(dev, struct cpu, dev)->hotpluggable; + return dev && container_of(dev, struct cpu, dev)->hotpluggable + &&tick_nohz_cpu_hotpluggable (cpu); }EXPORT_SYMBOL_GPL (cpu_is_hotpluggable);
include/linux/tick.h +2 -0
@@ -216,6 +216,7 @@ extern void tick_nohz_dep_set_signal(str enum tick_dep_bits bit);extern void tick_nohz_dep_clear_signal (struct signal_struct *signal,enum tick_dep_bits bit); +extern bool tick_nohz_cpu_hotpluggable (unsigned int cpu);/* * The below are tick_nohz_[set,clear]_dep() wrappers that optimize off-cases
@@ -280,6 +281,7 @@ static inline void tick_nohz_full_add_cpstatic inline void tick_nohz_dep_set_cpu (int cpu,enum tick_dep_bits bit) { }static inline void tick_nohz_dep_clear_cpu (int cpu,enum tick_dep_bits bit) { } +static inline bool tick_nohz_cpu_hotpluggable (unsigned int cpu) {return true; }static inline void tick_dep_set (enum tick_dep_bits bit) { }static inline void tick_dep_clear (enum tick_dep_bits bit) { }
kernel/time/tick-sched.c +8 -3
@@ -527,7 +527,7 @@ void __init tick_nohz_full_setup(cpumask tick_nohz_full_running = true; } -static int tick_nohz_cpu_down (unsigned int cpu) +bool tick_nohz_cpu_hotpluggable (unsigned int cpu) {/* * The tick_do_timer_cpu CPU handles housekeeping duty (unbound
@@ -535,8 +535,13 @@ static int tick_nohz_cpu_down(unsigned i* CPUs. It must remain online when nohz full is enabled. */ if (tick_nohz_full_running && tick_do_timer_cpu == cpu) -return -EBUSY ; -return 0 ; +return false; +return true; +} + +static int tick_nohz_cpu_down (unsigned int cpu) +{ +return tick_nohz_cpu_hotpluggable (cpu) ?0 : -EBUSY ; }void __init tick_nohz_init (void )
Greg Kroah-Hartman
maintainerPATCH 37/611 tpm: Add !tpm_amd_is_rng_defective() to the hwrng_unregister() call site
In reply to Greg Kroah-HartmanFrom: Jarkko Sakkinen <[email protected]>
commit bd8621ca1510e6e802df9855bdc35a04a3cfa932 upstream.
The following crash was reported:
[ 1950.279393] list_del corruption, ffff99560d485790->next is NULL [ 1950.279400] ------------[ cut here ]------------ [ 1950.279401] kernel BUG at lib/list_debug.c:49! [ 1950.279405] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI [ 1950.279407] CPU: 11 PID: 5886 Comm: modprobe Tainted: G O 6.2.8_1 #1 [ 1950.279409] Hardware name: Gigabyte Technology Co., Ltd. B550M AORUS PRO-P/B550M AORUS PRO-P, BIOS F15c 05/11/2022 [ 1950.279410] RIP: 0010:__list_del_entry_valid+0x59/0xc0 [ 1950.279415] Code: 48 8b 01 48 39 f8 75 5a 48 8b 72 08 48 39 c6 75 65 b8 01 00 00 00 c3 cc cc cc cc 48 89 fe 48 c7 c7 08 a8 13 9e e8 b7 0a bc ff <0f> 0b 48 89 fe 48 c7 c7 38 a8 13 9e e8 a6 0a bc ff 0f 0b 48 89 fe [ 1950.279416] RSP: 0018:ffffa96d05647e08 EFLAGS: 00010246 [ 1950.279418] RAX: 0000000000000033 RBX: ffff99560d485750 RCX: 0000000000000000 [ 1950.279419] RDX: 0000000000000000 RSI: ffffffff9e107c59 RDI: 00000000ffffffff [ 1950.279420] RBP: ffffffffc19c5168 R08: 0000000000000000 R09: ffffa96d05647cc8 [ 1950.279421] R10: 0000000000000003 R11: ffffffff9ea2a568 R12: 0000000000000000 [ 1950.279422] R13: ffff99560140a2e0 R14: ffff99560127d2e0 R15: 0000000000000000 [ 1950.279422] FS: 00007f67da795380(0000) GS:ffff995d1f0c0000(0000) knlGS:0000000000000000 [ 1950.279424] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1950.279424] CR2: 00007f67da7e65c0 CR3: 00000001feed2000 CR4: 0000000000750ee0 [ 1950.279426] PKRU: 55555554 [ 1950.279426] Call Trace: [ 1950.279428] <TASK> [ 1950.279430] hwrng_unregister+0x28/0xe0 [rng_core] [ 1950.279436] tpm_chip_unregister+0xd5/0xf0 [tpm]
Add the forgotten !tpm_amd_is_rng_defective() invariant to the hwrng_unregister() call site inside tpm_chip_unregister().
--- drivers/char/tpm/tpm-chip.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/char/tpm/tpm-chip.c +2 -1
@@ -678,7 +678,8 @@ EXPORT_SYMBOL_GPL(tpm_chip_register);void tpm_chip_unregister (struct tpm_chip *chip) {tpm_del_legacy_sysfs (chip); -if (IS_ENABLED (CONFIG_HW_RANDOM_TPM ) && !tpm_is_firmware_upgrade (chip)) +if (IS_ENABLED (CONFIG_HW_RANDOM_TPM ) && !tpm_is_firmware_upgrade (chip) && + !tpm_amd_is_rng_defective (chip))hwrng_unregister (&chip->hwrng);tpm_bios_log_teardown (chip);if (chip->flags &TPM_CHIP_FLAG_TPM2 && !tpm_is_firmware_upgrade (chip))
Greg Kroah-Hartman
maintainerPATCH 55/611 fs: fix sysctls.c built
In reply to Greg Kroah-HartmanFrom: Kefeng Wang <[email protected]>
commit e3184de9d46c2eebdb776face2e2662c6733331d upstream.
'obj-$(CONFIG_SYSCTL) += sysctls.o' must be moved after "obj-y :=", or it won't be built as it is overwrited.
Note that there is nothing that is going to break by linking sysctl.o later, we were just being way to cautious and patches have been updated to reflect these considerations and sent for stable as well with the whole "base" stuff needing to be linked prior to child sysctl tables that use that directory. All of the kernel sysctl APIs always share the same directory, and races against using it should end up re-using the same single created directory.
And so something we can do eventually is do away with all the base stuff. For now it's fine, it's not creating an issue. It is just a bit pedantic and careful.
--- fs/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/Makefile +1 -2
@@ -6,7 +6,6 @@ # Rewritten to use lists instead of if-statements. # -obj-$(CONFIG_SYSCTL) += sysctls.o obj-y := open.o read_write.o file_table.o super.o \ char_dev.o stat.o exec.o pipe.o namei.o fcntl.o \
@@ -49,7 +48,7 @@ obj-$(CONFIG_FS_MBCACHE) += mbcache.o obj-$(CONFIG_FS_POSIX_ACL) += posix_acl.o obj-$(CONFIG_NFS_COMMON) += nfs_common/ obj-$(CONFIG_COREDUMP) += coredump.o -obj-$(CONFIG_SYSCTL) += drop_caches.o +obj-$(CONFIG_SYSCTL) += drop_caches.o sysctls.o obj-$(CONFIG_FHANDLE) += fhandle.o obj-y += iomap/
Greg Kroah-Hartman
maintainerPATCH 56/611 MIPS: fw: Allow firmware to pass a empty env
In reply to Greg Kroah-HartmanFrom: Jiaxun Yang <[email protected]>
commit ee1809ed7bc456a72dc8410b475b73021a3a68d5 upstream.
fw_getenv will use env entry to determine style of env, however it is legal for firmware to just pass a empty list.
Check if first entry exist before running strchr to avoid null pointer dereference.
--- arch/mips/fw/lib/cmdline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/fw/lib/cmdline.c +1 -1
@@ -53,7 +53,7 @@ char *fw_getenv(char *envname) {char *result =NULL ; -if (_fw_envp !=NULL ) { +if (_fw_envp !=NULL &&fw_envp (0 ) !=NULL ) {/* * Return a pointer to the given environment variable. * YAMON uses "name", "value" pairs, while U-Boot uses
Greg Kroah-Hartman
maintainerPATCH 57/611 ipmi:ssif: Add send_retries increment
In reply to Greg Kroah-HartmanFrom: Corey Minyard <[email protected]>
commit 6ce7995a43febe693d4894033c6e29314970646a upstream.
A recent change removed an increment of send_retries, re-add it.
--- drivers/char/ipmi/ipmi_ssif.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/char/ipmi/ipmi_ssif.c +3 -1
@@ -557,8 +557,10 @@ static void retry_timeout(struct timer_lif (waiting)start_get (ssif_info); -if (resend) +if (resend) {start_resend (ssif_info); +ssif_inc_stat (ssif_info, send_retries); + } }static void watch_timeout (struct timer_list *t)
Greg Kroah-Hartman
maintainerPATCH 58/611 ipmi: fix SSIF not responding under certain cond.
In reply to Greg Kroah-HartmanFrom: Zhang Yuchen <[email protected]>
commit 6d2555cde2918409b0331560e66f84a0ad4849c6 upstream.
The ipmi communication is not restored after a specific version of BMC is upgraded on our server.
The ipmi driver does not respond after printing the following log:
ipmi_ssif: Invalid response getting flags: 1c 1
I found that after entering this branch, ssif_info->ssif_state always holds SSIF_GETTING_FLAGS and never return to IDLE.
As a result, the driver cannot be loaded, because the driver status is checked during the unload process and must be IDLE in shutdown_ssif():
while (ssif_info->ssif_state != SSIF_IDLE)
schedule_timeout(1);The process trigger this problem is:
1. One msg timeout and next msg start send, and call ssif_set_need_watch().
2. ssif_set_need_watch()->watch_timeout()->start_flag_fetch() change ssif_state to SSIF_GETTING_FLAGS.
3. In msg_done_handler() ssif_state == SSIF_GETTING_FLAGS, if an error message is received, the second branch does not modify the ssif_state.
4. All retry action need IS_SSIF_IDLE() == True. Include retry action in watch_timeout(), msg_done_handler(). Sending msg does not work either. SSIF_IDLE is also checked in start_next_msg().
5. The only thing that can be triggered in the SSIF driver is watch_timeout(), after destory_user(), this timer will stop too.
So, if enter this branch, the ssif_state will remain SSIF_GETTING_FLAGS and can't send msg, no timer started, can't unload.
We did a comparative test before and after adding this patch, and the result is effective.
Message-Id: <[email protected]>
--- drivers/char/ipmi/ipmi_ssif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/char/ipmi/ipmi_ssif.c +2 -2
@@ -786,9 +786,9 @@ static void msg_done_handler(struct ssif }else if (data[0 ] != (IPMI_NETFN_APP_REQUEST |1 ) <<2 || data[1 ] !=IPMI_GET_MSG_FLAGS_CMD ) {/* -* Don't abort here, maybe it was a queued -* response to a previous command. +* Recv error response, give up. */ + ssif_info->ssif_state =SSIF_IDLE ;ipmi_ssif_unlock_cond (ssif_info, flags); dev_warn(&ssif_info->client->dev, "Invalid response getting flags: %x %x\n",
Greg Kroah-Hartman
maintainerPATCH 59/611 iio: addac: stx104: Fix race condition when converting analog-to-digital
In reply to Greg Kroah-HartmanFrom: William Breathitt Gray <[email protected]>
commit 4f9b80aefb9e2f542a49d9ec087cf5919730e1dd upstream.
The ADC conversion procedure requires several device I/O operations performed in a particular sequence. If stx104_read_raw() is called concurrently, the ADC conversion procedure could be clobbered. Prevent such a race condition by utilizing a mutex.
--- drivers/iio/addac/stx104.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/iio/addac/stx104.c +4 -0
@@ -114,6 +114,8 @@ static int stx104_read_raw(struct iio_dereturn IIO_VAL_INT ; } +mutex_lock (&priv->lock); +/* select ADC channel */ iowrite8 (chan->channel | (chan->channel <<4 ), ®->achan);
@@ -124,6 +126,8 @@ static int stx104_read_raw(struct iio_dewhile (ioread8 (®->cir_asr) &BIT (7 )); *val =ioread16 (®->ssr_ad); + +mutex_unlock (&priv->lock);return IIO_VAL_INT ;case IIO_CHAN_INFO_OFFSET :/* get ADC bipolar/unipolar configuration */
Greg Kroah-Hartman
maintainerPATCH 60/611 iio: addac: stx104: Fix race condition for stx104_write_raw()
In reply to Greg Kroah-HartmanFrom: William Breathitt Gray <[email protected]>
commit 9740827468cea80c42db29e7171a50e99acf7328 upstream.
The priv->chan_out_states array and actual DAC value can become mismatched if stx104_write_raw() is called concurrently. Prevent such a race condition by utilizing a mutex.
--- drivers/iio/addac/stx104.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/iio/addac/stx104.c +8 -0
@@ -15,6 +15,7 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/moduleparam.h> +#include <linux/mutex.h> #include <linux/spinlock.h> #include <linux/types.h>
@@ -69,10 +70,12 @@ struct stx104_reg {/** * struct stx104_iio - IIO device private data structure +* @lock: synchronization lock to prevent I/O race conditions * @chan_out_states: channels' output states * @reg: I/O address offset for the device registers */ struct stx104_iio { +struct mutex lock;unsigned int chan_out_states[STX104_NUM_OUT_CHAN ];struct stx104_reg __iomem *reg; };
@@ -182,9 +185,12 @@ static int stx104_write_raw(struct iio_dif ((unsigned int )val >65535 )return -EINVAL ; +mutex_lock (&priv->lock); + priv->chan_out_states[chan->channel] = val;iowrite16 (val, &priv->reg->dac[chan->channel]); +mutex_unlock (&priv->lock);return 0 ; }return -EINVAL ;
@@ -355,6 +361,8 @@ static int stx104_probe(struct device *d indio_dev->name =dev_name (dev); +mutex_init (&priv->lock); +/* configure device for software trigger operation */ iowrite8 (0 , &priv->reg->acr);
Greg Kroah-Hartman
maintainerPATCH 61/611 kheaders: Use array declaration instead of char
In reply to Greg Kroah-HartmanFrom: Kees Cook <[email protected]>
commit b69edab47f1da8edd8e7bfdf8c70f51a2a5d89fb upstream.
Under CONFIG_FORTIFY_SOURCE, memcpy() will check the size of destination and source buffers. Defining kernel_headers_data as "char" would trip this check. Since these addresses are treated as byte arrays, define them as arrays (as done everywhere else).
This was seen with:
$ cat /sys/kernel/kheaders.tar.xz >> /dev/null
detected buffer overflow in memcpy
kernel BUG at lib/string_helpers.c:1027!
...
RIP: 0010:fortify_panic+0xf/0x20 [...] Call Trace: <TASK> ikheaders_read+0x45/0x50 [kheaders] kernfs_fop_read_iter+0x1a4/0x2f0 ...
--- kernel/kheaders.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
kernel/kheaders.c +5 -5
@@ -26,15 +26,15 @@ asm (" .popsection \n" ); -extern char kernel_headers_data; -extern char kernel_headers_data_end; +extern char kernel_headers_data[]; +extern char kernel_headers_data_end[];static ssize_t ikheaders_read (struct file *file,struct kobject *kobj,struct bin_attribute *bin_attr,char *buf,loff_t off,size_t len) { -memcpy (buf, &kernel_headers_data + off, len); +memcpy (buf, &kernel_headers_data[off], len);return len; }
@@ -48,8 +48,8 @@ static struct bin_attribute kheaders_attstatic int __init ikheaders_init (void ) { - kheaders_attr.size = (&kernel_headers_data_end - - &kernel_headers_data); + kheaders_attr.size = (kernel_headers_data_end - + kernel_headers_data);return sysfs_create_bin_file (kernel_kobj, &kheaders_attr); }
Greg Kroah-Hartman
maintainerPATCH 62/611 wifi: mt76: add missing locking to protect against concurrent rx/status calls
In reply to Greg Kroah-HartmanFrom: Felix Fietkau <[email protected]>
commit 5b8ccdfb943f6a03c676d2ea816dd38c149e920b upstream.
According to the documentation, ieee80211_rx_list must not run concurrently with ieee80211_tx_status (or its variants).
--- drivers/net/wireless/mediatek/mt76/dma.c | 2 ++ drivers/net/wireless/mediatek/mt76/mt7603/mac.c | 5 ++++- drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 5 ++++- drivers/net/wireless/mediatek/mt76/mt76x02_mac.c | 5 ++++- drivers/net/wireless/mediatek/mt76/tx.c | 4 ++++ 5 files changed, 18 insertions(+), 3 deletions(-)
drivers/net/wireless/mediatek/mt76/dma.c +2 -0
@@ -436,7 +436,9 @@ free: free_skb: status.skb = tx_info.skb; hw =mt76_tx_status_get_hw (dev, tx_info.skb); +spin_lock_bh (&dev->rx_lock);ieee80211_tx_status_ext (hw, &status); +spin_unlock_bh (&dev->rx_lock);return ret; }
drivers/net/wireless/mediatek/mt76/mt7603/mac.c +4 -1
@@ -1279,8 +1279,11 @@ void mt7603_mac_add_txs(struct mt7603_deif (wcidx >=MT7603_WTBL_STA || !sta) goto out; -if (mt7603_fill_txs (dev, msta, &info, txs_data)) +if (mt7603_fill_txs (dev, msta, &info, txs_data)) { +spin_lock_bh (&dev->mt76.rx_lock);ieee80211_tx_status_noskb (mt76_hw (dev), sta, &info); +spin_unlock_bh (&dev->mt76.rx_lock); + } out:rcu_read_unlock ();
drivers/net/wireless/mediatek/mt76/mt7615/mac.c +4 -1
@@ -1517,8 +1517,11 @@ static void mt7615_mac_add_txs(struct mtif (wcid->phy_idx && dev->mt76.phys[MT_BAND1 ]) mphy = dev->mt76.phys[MT_BAND1 ]; -if (mt7615_fill_txs (dev, msta, &info, txs_data)) +if (mt7615_fill_txs (dev, msta, &info, txs_data)) { +spin_lock_bh (&dev->mt76.rx_lock);ieee80211_tx_status_noskb (mphy->hw, sta, &info); +spin_unlock_bh (&dev->mt76.rx_lock); + } out:rcu_read_unlock ();
drivers/net/wireless/mediatek/mt76/mt76x02_mac.c +4 -1
@@ -631,8 +631,11 @@ void mt76x02_send_tx_status(struct mt76xmt76_tx_status_unlock (mdev, &list); -if (!status.skb) +if (!status.skb) { +spin_lock_bh (&dev->mt76.rx_lock);ieee80211_tx_status_ext (mt76_hw (dev), &status); +spin_unlock_bh (&dev->mt76.rx_lock); + }if (!len) goto out;
drivers/net/wireless/mediatek/mt76/tx.c +4 -0
@@ -77,7 +77,9 @@ mt76_tx_status_unlock(struct mt76_dev *d } hw =mt76_tx_status_get_hw (dev, skb); +spin_lock_bh (&dev->rx_lock);ieee80211_tx_status_ext (hw, &status); +spin_unlock_bh (&dev->rx_lock); }rcu_read_unlock (); }
@@ -263,7 +265,9 @@ void __mt76_tx_complete_skb(struct mt76_if (cb->pktid <MT_PACKET_ID_FIRST ) { hw =mt76_tx_status_get_hw (dev, skb); status.sta =wcid_to_sta (wcid); +spin_lock_bh (&dev->rx_lock);ieee80211_tx_status_ext (hw, &status); +spin_unlock_bh (&dev->rx_lock); goto out; }
Greg Kroah-Hartman
maintainerPATCH 63/611 pwm: meson: Fix axg ao mux parents
In reply to Greg Kroah-HartmanFrom: Heiner Kallweit <[email protected]>
commit eb411c0cf59ae6344b34bc6f0d298a22b300627e upstream.
This fix is basically the same as 9bce02ef0dfa ("pwm: meson: Fix the G12A AO clock parents order"). Vendor driver referenced there has xtal as first parent also for axg ao. In addition fix the name of the aoclk81 clock. Apparently name aoclk81 as used by the vendor driver was changed when mainlining the axg clock driver.
--- drivers/pwm/pwm-meson.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/pwm-meson.c +1 -1
@@ -418,7 +418,7 @@ static const struct meson_pwm_data pwm_a };static const char *const pwm_axg_ao_parent_names[] = { -"aoclk81" ,"xtal" ,"fclk_div4" ,"fclk_div5" +"xtal" ,"axg_ao_clk81" ,"fclk_div4" ,"fclk_div5" };static const struct meson_pwm_data pwm_axg_ao_data = {
Greg Kroah-Hartman
maintainerPATCH 64/611 pwm: meson: Fix g12a ao clk81 name
In reply to Greg Kroah-HartmanFrom: Heiner Kallweit <[email protected]>
commit 9e4fa80ab7ef9eb4f7b1ea9fc31e0eb040e85e25 upstream.
Fix the name of the aoclk81 clock. Apparently name aoclk81 as used by the vendor driver was changed when mainlining the g12a clock driver.
--- drivers/pwm/pwm-meson.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pwm/pwm-meson.c +2 -2
@@ -427,7 +427,7 @@ static const struct meson_pwm_data pwm_a };static const char *const pwm_g12a_ao_ab_parent_names[] = { -"xtal" ,"aoclk81" ,"fclk_div4" ,"fclk_div5" +"xtal" ,"g12a_ao_clk81" ,"fclk_div4" ,"fclk_div5" };static const struct meson_pwm_data pwm_g12a_ao_ab_data = {
@@ -436,7 +436,7 @@ static const struct meson_pwm_data pwm_g };static const char *const pwm_g12a_ao_cd_parent_names[] = { -"xtal" ,"aoclk81" , +"xtal" ,"g12a_ao_clk81" , };static const struct meson_pwm_data pwm_g12a_ao_cd_data = {
Greg Kroah-Hartman
maintainerPATCH 38/611 posix-cpu-timers: Implement the missing timer_wait_running callback
In reply to Greg Kroah-HartmanFrom: Thomas Gleixner <[email protected]>
commit f7abf14f0001a5a47539d9f60bbdca649e43536b upstream.
For some unknown reason the introduction of the timer_wait_running callback missed to fixup posix CPU timers, which went unnoticed for almost four years. Marco reported recently that the WARN_ON() in timer_wait_running() triggers with a posix CPU timer test case.
Posix CPU timers have two execution models for expiring timers depending on CONFIG_POSIX_CPU_TIMERS_TASK_WORK:
1) If not enabled, the expiry happens in hard interrupt context so spin waiting on the remote CPU is reasonably time bound.
Implement an empty stub function for that case.
2) If enabled, the expiry happens in task work before returning to user space or guest mode. The expired timers are marked as firing and moved from the timer queue to a local list head with sighand lock held. Once the timers are moved, sighand lock is dropped and the expiry happens in fully preemptible context. That means the expiring task can be scheduled out, migrated, interrupted etc. So spin waiting on it is more than suboptimal.
The timer wheel has a timer_wait_running() mechanism for RT, which uses a per CPU timer-base expiry lock which is held by the expiry code and the task waiting for the timer function to complete blocks on that lock.
This does not work in the same way for posix CPU timers as there is no timer base and expiry for process wide timers can run on any task belonging to that process, but the concept of waiting on an expiry lock can be used too in a slightly different way:
- Add a mutex to struct posix_cputimers_work. This struct is per task and used to schedule the expiry task work from the timer interrupt.
- Add a task_struct pointer to struct cpu_timer which is used to store a the task which runs the expiry. That's filled in when the task moves the expired timers to the local expiry list. That's not affecting the size of the k_itimer union as there are bigger union members already
- Let the task take the expiry mutex around the expiry function
- Let the waiter acquire a task reference with rcu_read_lock() held and block on the expiry mutex
This avoids spin-waiting on a task which might not even be on a CPU and works nicely for RT too.
--- include/linux/posix-timers.h | 17 +++++--- kernel/time/posix-cpu-timers.c | 81 +++++++++++++++++++++++++++++++++-------- kernel/time/posix-timers.c | 4 ++ 3 files changed, 82 insertions(+), 20 deletions(-)
include/linux/posix-timers.h +11 -6
@@ -4,6 +4,7 @@#include <linux/spinlock.h> #include <linux/list.h> +#include <linux/mutex.h> #include <linux/alarmtimer.h> #include <linux/timerqueue.h>
@@ -62,16 +63,18 @@ static inline int clockid_to_fd(const cl* cpu_timer - Posix CPU timer representation for k_itimer * @node: timerqueue node to queue in the task/sig * @head: timerqueue head on which this timer is queued -* @task: Pointer to target task +* @pid: Pointer to target task PID * @elist: List head for the expiry list * @firing: Timer is currently firing +* @handling: Pointer to the task which handles expiry */ struct cpu_timer { -struct timerqueue_node node; -struct timerqueue_head *head; -struct pid *pid; -struct list_head elist; -int firing; +struct timerqueue_node node; +struct timerqueue_head *head; +struct pid *pid; +struct list_head elist; +int firing; +struct task_struct __rcu *handling; }; static inline bool cpu_timer_enqueue(struct timerqueue_head *head,
@@ -135,10 +138,12 @@ struct posix_cputimers {/** * posix_cputimers_work - Container for task work based posix CPU timer expiry * @work: The task work to be scheduled +* @mutex: Mutex held around expiry in context of this task work * @scheduled: @work has been scheduled already, no further processing */ struct posix_cputimers_work {struct callback_head work; +struct mutex mutex;unsigned int scheduled; };
kernel/time/posix-cpu-timers.c +67 -14
127 lines not on this page · raw message
kernel/time/posix-timers.c +4 -0
@@ -846,6 +846,10 @@ static struct k_itimer *timer_wait_runnircu_read_lock ();unlock_timer (timer, *flags); +/* +* kc->timer_wait_running() might drop RCU lock. So @timer +* cannot be touched anymore after the function returns! +*/ if (!WARN_ON_ONCE (!kc->timer_wait_running)) kc->timer_wait_running (timer);
Greg Kroah-Hartman
maintainerPATCH 65/611 soundwire: qcom: correct setting ignore bit on v1.5.1
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
commit bd934f77eeac377e81ddac8673803e7334b82d3d upstream.
According to the comment and to downstream sources, the SWRM_CONTINUE_EXEC_ON_CMD_IGNORE in SWRM_CMD_FIFO_CFG_ADDR register should be set for v1.5.1 and newer, so fix the >= operator.
--- drivers/soundwire/qcom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soundwire/qcom.c +1 -1
@@ -696,7 +696,7 @@ static int qcom_swrm_init(struct qcom_sw ctrl->reg_write (ctrl,SWRM_MCP_BUS_CTRL ,SWRM_MCP_BUS_CLK_START );/* Configure number of retries of a read/write cmd */ -if (ctrl->version >0x01050001 ) { +if (ctrl->version >=0x01050001 ) {/* Only for versions >= 1.5.1 */ ctrl->reg_write(ctrl, SWRM_CMD_FIFO_CFG_ADDR, SWRM_RD_WR_CMD_RETRIES |
Greg Kroah-Hartman
maintainerPATCH 66/611 pinctrl: qcom: lpass-lpi: set output value before enabling output
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
commit 163bfb0cb1f6fbf961cf912cbde57399ea1ae0e8 upstream.
As per Hardware Programming Guide, when configuring pin as output, set the pin value before setting output-enable (OE). Similar approach is in main SoC TLMM pin controller.
--- drivers/pinctrl/qcom/pinctrl-lpass-lpi.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/pinctrl/qcom/pinctrl-lpass-lpi.c +9 -5
@@ -216,6 +216,15 @@ static int lpi_config_set(struct pinctrl } } +/* +* As per Hardware Programming Guide, when configuring pin as output, +* set the pin value before setting output-enable (OE). +*/ +if (output_enabled) { + val =u32_encode_bits (value ?1 :0 ,LPI_GPIO_VALUE_OUT_MASK ); +lpi_gpio_write (pctrl, group,LPI_GPIO_VALUE_REG , val); + } + val =lpi_gpio_read (pctrl, group,LPI_GPIO_CFG_REG );u32p_replace_bits (&val, pullup,LPI_GPIO_PULL_MASK );
@@ -225,11 +234,6 @@ static int lpi_config_set(struct pinctrllpi_gpio_write (pctrl, group,LPI_GPIO_CFG_REG , val); -if (output_enabled) { - val =u32_encode_bits (value ?1 :0 ,LPI_GPIO_VALUE_OUT_MASK ); -lpi_gpio_write (pctrl, group,LPI_GPIO_VALUE_REG , val); - } -return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 67/611 ring-buffer: Ensure proper resetting of atomic variables in ring_buffer_reset_online_cpus
In reply to Greg Kroah-HartmanFrom: Tze-nan Wu <[email protected]>
commit 7c339fb4d8577792378136c15fde773cfb863cb8 upstream.
In ring_buffer_reset_online_cpus, the buffer_size_kb write operation may permanently fail if the cpu_online_mask changes between two for_each_online_buffer_cpu loops. The number of increases and decreases on both cpu_buffer->resize_disabled and cpu_buffer->record_disabled may be inconsistent, causing some CPUs to have non-zero values for these atomic variables after the function returns.
This issue can be reproduced by "echo 0 > trace" while hotplugging cpu. After reproducing success, we can find out buffer_size_kb will not be functional anymore.
To prevent leaving 'resize_disabled' and 'record_disabled' non-zero after ring_buffer_reset_online_cpus returns, we ensure that each atomic variable has been set up before atomic_sub() to it.
--- kernel/trace/ring_buffer.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
kernel/trace/ring_buffer.c +13 -3
@@ -5333,6 +5333,9 @@ void ring_buffer_reset_cpu(struct trace_ }EXPORT_SYMBOL_GPL (ring_buffer_reset_cpu); +/* Flag to ensure proper resetting of atomic variables */ +#define RESET_BIT (1 << 30) +/** * ring_buffer_reset_online_cpus - reset a ring buffer per CPU buffer * @buffer: The ring buffer to reset a per cpu buffer of
@@ -5349,20 +5352,27 @@ void ring_buffer_reset_online_cpus(strucfor_each_online_buffer_cpu (buffer, cpu) { cpu_buffer = buffer->buffers[cpu]; -atomic_inc (&cpu_buffer->resize_disabled); +atomic_add (RESET_BIT , &cpu_buffer->resize_disabled);atomic_inc (&cpu_buffer->record_disabled); }/* Make sure all commits have finished */ synchronize_rcu (); -for_each_online_buffer_cpu (buffer, cpu) { +for_each_buffer_cpu (buffer, cpu) { cpu_buffer = buffer->buffers[cpu]; +/* +* If a CPU came online during the synchronize_rcu(), then +* ignore it. +*/ +if (!(atomic_read (&cpu_buffer->resize_disabled) &RESET_BIT )) +continue ; +reset_disabled_cpu_buffer (cpu_buffer);atomic_dec (&cpu_buffer->record_disabled); -atomic_dec (&cpu_buffer->resize_disabled); +atomic_sub (RESET_BIT , &cpu_buffer->resize_disabled); }mutex_unlock (&buffer->mutex);
Greg Kroah-Hartman
maintainerPATCH 68/611 ring-buffer: Sync IRQ works before buffer destruction
In reply to Greg Kroah-HartmanFrom: Johannes Berg <[email protected]>
commit 675751bb20634f981498c7d66161584080cc061e upstream.
If something was written to the buffer just before destruction, it may be possible (maybe not in a real system, but it did happen in ARCH=um with time-travel) to destroy the ringbuffer before the IRQ work ran, leading this KASAN report (or a crash without KASAN):
BUG: KASAN: slab-use-after-free in irq_work_run_list+0x11a/0x13a
Read of size 8 at addr 000000006d640a48 by task swapper/0
CPU: 0 PID: 0 Comm: swapper Tainted: G W O 6.3.0-rc1 #7
Stack:
60c4f20f 0c203d48 41b58ab3 60f224fc
600477fa 60f35687 60c4f20f 601273dd
00000008 6101eb00 6101eab0 615be548
Call Trace:
[<60047a58>] show_stack+0x25e/0x282
[<60c609e0>] dump_stack_lvl+0x96/0xfd
[<60c50d4c>] print_report+0x1a7/0x5a8
[<603078d3>] kasan_report+0xc1/0xe9
[<60308950>] __asan_report_load8_noabort+0x1b/0x1d
[<60232844>] irq_work_run_list+0x11a/0x13a
[<602328b4>] irq_work_tick+0x24/0x34
[<6017f9dc>] update_process_times+0x162/0x196
[<6019f335>] tick_sched_handle+0x1a4/0x1c3
[<6019fd9e>] tick_sched_timer+0x79/0x10c
[<601812b9>] __hrtimer_run_queues.constprop.0+0x425/0x695
[<60182913>] hrtimer_interrupt+0x16c/0x2c4
[<600486a3>] um_timer+0x164/0x183
[...]
Allocated by task 411:
save_stack_trace+0x99/0xb5
stack_trace_save+0x81/0x9b
kasan_save_stack+0x2d/0x54
kasan_set_track+0x34/0x3e
kasan_save_alloc_info+0x25/0x28
____kasan_kmalloc+0x8b/0x97
__kasan_kmalloc+0x10/0x12
__kmalloc+0xb2/0xe8
load_elf_phdrs+0xee/0x182
[...]
The buggy address belongs to the object at 000000006d640800
which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 584 bytes inside of
freed 1024-byte region [000000006d640800, 000000006d640c00)Add the appropriate irq_work_sync() so the work finishes before the buffers are destroyed.
Prior to the commit in the Fixes tag below, there was only a single global IRQ work, so this issue didn't exist.
--- kernel/trace/ring_buffer.c | 4 ++++ 1 file changed, 4 insertions(+)
kernel/trace/ring_buffer.c +4 -0
@@ -1778,6 +1778,8 @@ static void rb_free_cpu_buffer(struct ristruct list_head *head = cpu_buffer->pages;struct buffer_page *bpage, *tmp; +irq_work_sync (&cpu_buffer->irq_work.work); +free_buffer_page (cpu_buffer->reader_page);if (head) {
@@ -1884,6 +1886,8 @@ ring_buffer_free(struct trace_buffer *bucpuhp_state_remove_instance (CPUHP_TRACE_RB_PREPARE , &buffer->node); +irq_work_sync (&buffer->irq_work.work); +for_each_buffer_cpu (buffer, cpu)rb_free_cpu_buffer (buffer->buffers[cpu]);
Greg Kroah-Hartman
maintainerPATCH 39/611 media: ov8856: Do not check for for module version
In reply to Greg Kroah-HartmanFrom: Ricardo Ribalda <[email protected]>
commit 5a4e1b5aed2a36a10d6a3b30fafb6b3bf41c3186 upstream.
It the device is probed in non-zero ACPI D state, the module identification is delayed until the first streamon.
The module identification has two parts: deviceID and version. To rea the version we have to enable OTP read. This cannot be done during streamon, becase it modifies REG_MODE_SELECT.
Since the driver has the same behaviour for all the module versions, do not read the module version from the sensor's OTP.
--- drivers/media/i2c/ov8856.c | 40 ---------------------------------------- 1 file changed, 40 deletions(-)
drivers/media/i2c/ov8856.c +0 -40
@@ -1709,46 +1709,6 @@ static int ov8856_identify_module(structreturn -ENXIO ; } - ret =ov8856_write_reg (ov8856,OV8856_REG_MODE_SELECT , -OV8856_REG_VALUE_08BIT ,OV8856_MODE_STREAMING ); -if (ret) -return ret; - - ret =ov8856_write_reg (ov8856,OV8856_OTP_MODE_CTRL , -OV8856_REG_VALUE_08BIT ,OV8856_OTP_MODE_AUTO ); -if (ret) { -dev_err (&client->dev,"failed to set otp mode" ); -return ret; - } - - ret =ov8856_write_reg (ov8856,OV8856_OTP_LOAD_CTRL , -OV8856_REG_VALUE_08BIT , -OV8856_OTP_LOAD_CTRL_ENABLE ); -if (ret) { -dev_err (&client->dev,"failed to enable load control" ); -return ret; - } - - ret =ov8856_read_reg (ov8856,OV8856_MODULE_REVISION , -OV8856_REG_VALUE_08BIT , &val); -if (ret) { -dev_err (&client->dev,"failed to read module revision" ); -return ret; - } - -dev_info (&client->dev,"OV8856 revision %x (%s) at address 0x%02x\n" , - val, - val ==OV8856_2A_MODULE ?"2A" : - val ==OV8856_1B_MODULE ?"1B" :"unknown revision" , - client->addr); - - ret =ov8856_write_reg (ov8856,OV8856_REG_MODE_SELECT , -OV8856_REG_VALUE_08BIT ,OV8856_MODE_STANDBY ); -if (ret) { -dev_err (&client->dev,"failed to exit streaming mode" ); -return ret; - } - ov8856->identified = true;return 0 ;
Greg Kroah-Hartman
maintainerPATCH 40/611 blk-stat: fix QUEUE_FLAG_STATS clear
In reply to Greg Kroah-HartmanFrom: Chengming Zhou <[email protected]>
commit 20de765f6d9da0c47b756429c60b41063b990a10 upstream.
We need to set QUEUE_FLAG_STATS for two cases:
1. blk_stat_enable_accounting()
2. blk_stat_add_callback()
So we should clear it only when ((q->stats->accounting == 0) && list_empty(&q->stats->callbacks)).
blk_stat_disable_accounting() only check if q->stats->accounting is 0 before clear the flag, this patch fix it.
Also add list_empty(&q->stats->callbacks)) check when enable, or the flag is already set.
The bug can be reproduced on kernel without BLK_DEV_THROTTLING (since it unconditionally enable accounting, see the next patch).
# cat /sys/block/sr0/queue/scheduler none mq-deadline [bfq]
# cat /sys/kernel/debug/block/sr0/state SAME_COMP|IO_STAT|INIT_DONE|STATS|REGISTERED|NOWAIT|30
# echo none > /sys/block/sr0/queue/scheduler
# cat /sys/kernel/debug/block/sr0/state SAME_COMP|IO_STAT|INIT_DONE|REGISTERED|NOWAIT
# cat /sys/block/sr0/queue/wbt_lat_usec 75000
We can see that after changing elevator from "bfq" to "none", "STATS" flag is lost even though WBT callback still need it.
--- block/blk-stat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
block/blk-stat.c +2 -2
@@ -189,7 +189,7 @@ void blk_stat_disable_accounting(structunsigned long flags;spin_lock_irqsave (&q->stats->lock, flags); -if (!--q->stats->accounting) +if (!--q->stats->accounting &&list_empty (&q->stats->callbacks))blk_queue_flag_clear (QUEUE_FLAG_STATS , q);spin_unlock_irqrestore (&q->stats->lock, flags); }
@@ -200,7 +200,7 @@ void blk_stat_enable_accounting(struct runsigned long flags;spin_lock_irqsave (&q->stats->lock, flags); -if (!q->stats->accounting++) +if (!q->stats->accounting++ &&list_empty (&q->stats->callbacks))blk_queue_flag_set (QUEUE_FLAG_STATS , q);spin_unlock_irqrestore (&q->stats->lock, flags); }
Greg Kroah-Hartman
maintainerPATCH 41/611 blk-crypto: dont use struct request_queue for public interfaces
In reply to Greg Kroah-HartmanFrom: Christoph Hellwig <[email protected]>
commit fce3caea0f241f5d34855c82c399d5e0e2d91f07 upstream.
Switch all public blk-crypto interfaces to use struct block_device arguments to specify the device they operate on instead of th request_queue, which is a block layer implementation detail.
--- Documentation/block/inline-encryption.rst | 12 ++++++------ block/blk-crypto.c | 24 ++++++++++++++---------- drivers/md/dm-table.c | 2 +- fs/crypto/inline_crypt.c | 8 +++----- include/linux/blk-crypto.h | 11 ++++------- 5 files changed, 28 insertions(+), 29 deletions(-)
Documentation/block/inline-encryption.rst +6 -6
@@ -142,7 +142,7 @@ Therefore, we also introduce *blk-crypto of inline encryption using the kernel crypto API. blk-crypto-fallback is built into the block layer, so it works on any block device without any special setup. Essentially, when a bio with an encryption context is submitted to a -request_queue that doesn't support that encryption context, the block layer will +block_device that doesn't support that encryption context, the block layer will handle en/decryption of the bio using blk-crypto-fallback. For encryption, the data cannot be encrypted in-place, as callers usually rely
@@ -187,7 +187,7 @@ API presented to users of the block laye ``blk_crypto_config_supported()`` allows users to check ahead of time whether inline encryption with particular crypto settings will work on a particular -request_queue -- either via hardware or via blk-crypto-fallback. This function +block_device -- either via hardware or via blk-crypto-fallback. This function takes in a ``struct blk_crypto_config`` which is like blk_crypto_key, but omits the actual bytes of the key and instead just contains the algorithm, data unit size, etc. This function can be useful if blk-crypto-fallback is disabled.
@@ -195,7 +195,7 @@ size, etc. This function can be useful ``blk_crypto_init_key()`` allows users to initialize a blk_crypto_key. Users must call ``blk_crypto_start_using_key()`` before actually starting to use -a blk_crypto_key on a request_queue (even if ``blk_crypto_config_supported()`` +a blk_crypto_key on a block_device (even if ``blk_crypto_config_supported()`` was called earlier). This is needed to initialize blk-crypto-fallback if it will be needed. This must not be called from the data path, as this may have to allocate resources, which may deadlock in that case.
@@ -207,7 +207,7 @@ for en/decryption. Users don't need to later, as that happens automatically when the bio is freed or reset. Finally, when done using inline encryption with a blk_crypto_key on a -request_queue, users must call ``blk_crypto_evict_key()``. This ensures that +block_device, users must call ``blk_crypto_evict_key()``. This ensures that the key is evicted from all keyslots it may be programmed into and unlinked from any kernel data structures it may be linked into.
@@ -221,9 +221,9 @@ as follows: 5. ``blk_crypto_evict_key()`` (after all I/O has completed) 6. Zeroize the blk_crypto_key (this has no dedicated function) -If a blk_crypto_key is being used on multiple request_queues, then +If a blk_crypto_key is being used on multiple block_devices, then ``blk_crypto_config_supported()`` (if used), ``blk_crypto_start_using_key()``, -and ``blk_crypto_evict_key()`` must be called on each request_queue. +and ``blk_crypto_evict_key()`` must be called on each block_device. API presented to device drivers ===============================
block/blk-crypto.c +14 -10
@@ -354,20 +354,21 @@ int blk_crypto_init_key(struct blk_crypt/* * Check if bios with @cfg can be en/decrypted by blk-crypto (i.e. either the -* request queue it's submitted to supports inline crypto, or the +* block_device it's submitted to supports inline crypto, or the * blk-crypto-fallback is enabled and supports the cfg). */ -bool blk_crypto_config_supported (struct request_queue *q, +bool blk_crypto_config_supported (struct block_device *bdev,const struct blk_crypto_config *cfg) {return IS_ENABLED (CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK ) || -__blk_crypto_cfg_supported (q->crypto_profile, cfg); +__blk_crypto_cfg_supported (bdev_get_queue (bdev)->crypto_profile, + cfg); }/** * blk_crypto_start_using_key() - Start using a blk_crypto_key on a device +* @bdev: block device to operate on * @key: A key to use on the device -* @q: the request queue for the device * * Upper layers must call this function to ensure that either the hardware * supports the key's crypto settings, or the crypto API fallback has transforms
@@ -379,10 +380,11 @@ bool blk_crypto_config_supported(struct* blk-crypto-fallback is either disabled or the needed algorithm * is disabled in the crypto API; or another -errno code. */ -int blk_crypto_start_using_key (const struct blk_crypto_key *key, -struct request_queue *q) +int blk_crypto_start_using_key (struct block_device *bdev, +const struct blk_crypto_key *key) { -if (__blk_crypto_cfg_supported (q->crypto_profile, &key->crypto_cfg)) +if (__blk_crypto_cfg_supported (bdev_get_queue (bdev)->crypto_profile, + &key->crypto_cfg))return 0 ;return blk_crypto_fallback_start_using_mode (key->crypto_cfg.crypto_mode); }
@@ -390,7 +392,7 @@ int blk_crypto_start_using_key(const str/** * blk_crypto_evict_key() - Evict a key from any inline encryption hardware * it may have been programmed into -* @q: The request queue who's associated inline encryption hardware this key +* @bdev: The block_device who's associated inline encryption hardware this key * might have been programmed into * @key: The key to evict *
@@ -400,14 +402,16 @@ int blk_crypto_start_using_key(const str* * Return: 0 on success or if the key wasn't in any keyslot; -errno on error. */ -int blk_crypto_evict_key (struct request_queue *q, +int blk_crypto_evict_key (struct block_device *bdev,const struct blk_crypto_key *key) { +struct request_queue *q =bdev_get_queue (bdev); +if (__blk_crypto_cfg_supported (q->crypto_profile, &key->crypto_cfg))return __blk_crypto_evict_key (q->crypto_profile, key);/* -* If the request_queue didn't support the key, then blk-crypto-fallback +* If the block_device didn't support the key, then blk-crypto-fallback * may have been used, so try to evict the key from blk-crypto-fallback. */ return blk_crypto_fallback_evict_key (key);
drivers/md/dm-table.c +1 -1
@@ -1214,7 +1214,7 @@ static int dm_keyslot_evict_callback(strstruct dm_keyslot_evict_args *args = data;int err; - err =blk_crypto_evict_key (bdev_get_queue (dev->bdev), args->key); + err =blk_crypto_evict_key (dev->bdev, args->key);if (!args->err) args->err = err;/* Always try to evict the key from all devices. */
fs/crypto/inline_crypt.c +3 -5
@@ -139,8 +139,7 @@ int fscrypt_select_encryption_impl(strucreturn PTR_ERR (devs);for (i =0 ; i < num_devs; i++) { -if (!blk_crypto_config_supported (bdev_get_queue (devs[i]), - &crypto_cfg)) +if (!blk_crypto_config_supported (devs[i], &crypto_cfg)) goto out_free_devs; }
@@ -184,8 +183,7 @@ int fscrypt_prepare_inline_crypt_key(str goto fail; }for (i =0 ; i < num_devs; i++) { - err =blk_crypto_start_using_key (blk_key, -bdev_get_queue (devs[i])); + err =blk_crypto_start_using_key (devs[i], blk_key);if (err)break ; }
@@ -224,7 +222,7 @@ void fscrypt_destroy_inline_crypt_key(st devs =fscrypt_get_devices (sb, &num_devs);if (!IS_ERR (devs)) {for (i =0 ; i < num_devs; i++) -blk_crypto_evict_key (bdev_get_queue (devs[i]), blk_key); +blk_crypto_evict_key (devs[i], blk_key);kfree (devs); }kfree_sensitive (blk_key);
include/linux/blk-crypto.h +4 -7
@@ -71,9 +71,6 @@ struct bio_crypt_ctx {#include <linux/blk_types.h> #include <linux/blkdev.h> -struct request ; -struct request_queue ; -#ifdef CONFIG_BLK_INLINE_ENCRYPTION static inline bool bio_has_crypt_ctx (struct bio *bio)
@@ -94,13 +91,13 @@ int blk_crypto_init_key(struct blk_cryptunsigned int dun_bytes, unsigned int data_unit_size); -int blk_crypto_start_using_key (const struct blk_crypto_key *key, -struct request_queue *q); +int blk_crypto_start_using_key (struct block_device *bdev, +const struct blk_crypto_key *key); -int blk_crypto_evict_key (struct request_queue *q, +int blk_crypto_evict_key (struct block_device *bdev,const struct blk_crypto_key *key); -bool blk_crypto_config_supported (struct request_queue *q, +bool blk_crypto_config_supported (struct block_device *bdev,const struct blk_crypto_config *cfg);#else /* CONFIG_BLK_INLINE_ENCRYPTION */
Greg Kroah-Hartman
maintainerPATCH 42/611 blk-crypto: add a blk_crypto_config_supported_natively helper
In reply to Greg Kroah-HartmanFrom: Christoph Hellwig <[email protected]>
commit 6715c98b6cf003f26b1b2f655393134e9d999a05 upstream.
Add a blk_crypto_config_supported_natively helper that wraps __blk_crypto_cfg_supported to retrieve the crypto_profile from the request queue. With this fscrypt can stop including blk-crypto-profile.h and rely on the public consumer interface in blk-crypto.h.
--- block/blk-crypto.c | 21 ++++++++++++--------- fs/crypto/inline_crypt.c | 6 ++---- include/linux/blk-crypto.h | 2 ++ 3 files changed, 16 insertions(+), 13 deletions(-)
block/blk-crypto.c +12 -9
@@ -267,7 +267,6 @@ bool __blk_crypto_bio_prep(struct bio ** {struct bio *bio = *bio_ptr;const struct blk_crypto_key *bc_key = bio->bi_crypt_context->bc_key; -struct blk_crypto_profile *profile;/* Error if bio has no data. */ if (WARN_ON_ONCE (!bio_has_data (bio))) {
@@ -284,10 +283,9 @@ bool __blk_crypto_bio_prep(struct bio *** Success if device supports the encryption context, or if we succeeded * in falling back to the crypto API. */ - profile =bdev_get_queue (bio->bi_bdev)->crypto_profile; -if (__blk_crypto_cfg_supported (profile, &bc_key->crypto_cfg)) +if (blk_crypto_config_supported_natively (bio->bi_bdev, + &bc_key->crypto_cfg))return true; -if (blk_crypto_fallback_bio_prep (bio_ptr))return true; fail:
@@ -352,6 +350,13 @@ int blk_crypto_init_key(struct blk_cryptreturn 0 ; } +bool blk_crypto_config_supported_natively (struct block_device *bdev, +const struct blk_crypto_config *cfg) +{ +return __blk_crypto_cfg_supported (bdev_get_queue (bdev)->crypto_profile, + cfg); +} +/* * Check if bios with @cfg can be en/decrypted by blk-crypto (i.e. either the * block_device it's submitted to supports inline crypto, or the
@@ -361,8 +366,7 @@ bool blk_crypto_config_supported(struct const struct blk_crypto_config *cfg) {return IS_ENABLED (CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK ) || -__blk_crypto_cfg_supported (bdev_get_queue (bdev)->crypto_profile, - cfg); +blk_crypto_config_supported_natively (bdev, cfg); }/**
@@ -383,8 +387,7 @@ bool blk_crypto_config_supported(structint blk_crypto_start_using_key (struct block_device *bdev,const struct blk_crypto_key *key) { -if (__blk_crypto_cfg_supported (bdev_get_queue (bdev)->crypto_profile, - &key->crypto_cfg)) +if (blk_crypto_config_supported_natively (bdev, &key->crypto_cfg))return 0 ;return blk_crypto_fallback_start_using_mode (key->crypto_cfg.crypto_mode); }
@@ -407,7 +410,7 @@ int blk_crypto_evict_key(struct block_de {struct request_queue *q =bdev_get_queue (bdev); -if (__blk_crypto_cfg_supported (q->crypto_profile, &key->crypto_cfg)) +if (blk_crypto_config_supported_natively (bdev, &key->crypto_cfg))return __blk_crypto_evict_key (q->crypto_profile, key);/*
fs/crypto/inline_crypt.c +2 -4
@@ -12,7 +12,7 @@* provides the key and IV to use. */ -#include <linux/blk-crypto-profile.h> +#include <linux/blk-crypto.h> #include <linux/blkdev.h> #include <linux/buffer_head.h> #include <linux/sched/mm.h>
@@ -77,10 +77,8 @@ static void fscrypt_log_blk_crypto_impl(unsigned int i;for (i =0 ; i < num_devs; i++) { -struct request_queue *q =bdev_get_queue (devs[i]); -if (!IS_ENABLED (CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK ) || -__blk_crypto_cfg_supported (q->crypto_profile, cfg)) { +blk_crypto_config_supported_natively (devs[i], cfg)) {if (!xchg (&mode->logged_blk_crypto_native,1 ))pr_info ("fscrypt: %s using blk-crypto (native)\n" , mode->friendly_name);
include/linux/blk-crypto.h +2 -0
@@ -97,6 +97,8 @@ int blk_crypto_start_using_key(struct blint blk_crypto_evict_key (struct block_device *bdev,const struct blk_crypto_key *key); +bool blk_crypto_config_supported_natively (struct block_device *bdev, +const struct blk_crypto_config *cfg);bool blk_crypto_config_supported (struct block_device *bdev,const struct blk_crypto_config *cfg);
Greg Kroah-Hartman
maintainerPATCH 43/611 blk-crypto: move internal only declarations to blk-crypto-internal.h
In reply to Greg Kroah-HartmanFrom: Christoph Hellwig <[email protected]>
commit 3569788c08235c6f3e9e6ca724b2df44787ff487 upstream.
blk_crypto_get_keyslot, blk_crypto_put_keyslot, __blk_crypto_evict_key
and __blk_crypto_cfg_supported are only used internally by the blk-crypto code, so move the out of blk-crypto-profile.h, which is included by drivers that supply blk-crypto functionality.
--- block/blk-crypto-internal.h | 12 ++++++++++++ include/linux/blk-crypto-profile.h | 12 ------------ 2 files changed, 12 insertions(+), 12 deletions(-)
block/blk-crypto-internal.h +12 -0
@@ -65,6 +65,18 @@ static inline bool blk_crypto_rq_is_encr return rq->crypt_ctx; } +blk_status_t blk_crypto_get_keyslot (struct blk_crypto_profile *profile, +const struct blk_crypto_key *key, +struct blk_crypto_keyslot **slot_ptr); + +void blk_crypto_put_keyslot (struct blk_crypto_keyslot *slot); + +int __blk_crypto_evict_key (struct blk_crypto_profile *profile, +const struct blk_crypto_key *key); + +bool __blk_crypto_cfg_supported (struct blk_crypto_profile *profile, +const struct blk_crypto_config *cfg); +#else /* CONFIG_BLK_INLINE_ENCRYPTION */ static inline int blk_crypto_sysfs_register (struct request_queue *q)
include/linux/blk-crypto-profile.h +0 -12
@@ -138,18 +138,6 @@ int devm_blk_crypto_profile_init(structunsigned int blk_crypto_keyslot_index (struct blk_crypto_keyslot *slot); -blk_status_t blk_crypto_get_keyslot (struct blk_crypto_profile *profile, -const struct blk_crypto_key *key, -struct blk_crypto_keyslot **slot_ptr); - -void blk_crypto_put_keyslot (struct blk_crypto_keyslot *slot); - -bool __blk_crypto_cfg_supported (struct blk_crypto_profile *profile, -const struct blk_crypto_config *cfg); - -int __blk_crypto_evict_key (struct blk_crypto_profile *profile, -const struct blk_crypto_key *key); -void blk_crypto_reprogram_all_keys (struct blk_crypto_profile *profile);void blk_crypto_profile_destroy (struct blk_crypto_profile *profile);
Greg Kroah-Hartman
maintainerPATCH 44/611 blk-crypto: Add a missing include directive
In reply to Greg Kroah-HartmanFrom: Bart Van Assche <[email protected]>
commit 85168d416e5d3184b77dbec8fee75c9439894afa upstream.
Allow the compiler to verify consistency of function declarations and function definitions. This patch fixes the following sparse errors:
block/blk-crypto-profile.c:241:14: error: no previous prototype for ‘blk_crypto_get_keyslot’ [-Werror=missing-prototypes]
241 | blk_status_t blk_crypto_get_keyslot(struct blk_crypto_profile *profile,
| ^~~~~~~~~~~~~~~~~~~~~~
block/blk-crypto-profile.c:318:6: error: no previous prototype for ‘blk_crypto_put_keyslot’ [-Werror=missing-prototypes]
318 | void blk_crypto_put_keyslot(struct blk_crypto_keyslot *slot)
| ^~~~~~~~~~~~~~~~~~~~~~
block/blk-crypto-profile.c:344:6: error: no previous prototype for ‘__blk_crypto_cfg_supported’ [-Werror=missing-prototypes]
344 | bool __blk_crypto_cfg_supported(struct blk_crypto_profile *profile,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
block/blk-crypto-profile.c:373:5: error: no previous prototype for ‘__blk_crypto_evict_key’ [-Werror=missing-prototypes]
373 | int __blk_crypto_evict_key(struct blk_crypto_profile *profile,
| ^~~~~~~~~~~~~~~~~~~~~~--- block/blk-crypto-profile.c | 1 + 1 file changed, 1 insertion(+)
block/blk-crypto-profile.c +1 -0
@@ -32,6 +32,7 @@#include <linux/wait.h> #include <linux/blkdev.h> #include <linux/blk-integrity.h> +#include "blk-crypto-internal.h" struct blk_crypto_keyslot {atomic_t slot_refs;
Greg Kroah-Hartman
maintainerPATCH 35/611 hwmon: (k10temp) Check range scale when CUR_TEMP register is read-write
In reply to Greg Kroah-HartmanFrom: Babu Moger <[email protected]>
commit 0c072385348e3ac5229145644055d3e2afb5b3db upstream.
Spec says, when CUR_TEMP_TJ_SEL == 3 and CUR_TEMP_RANGE_SEL == 0, it should use RangeUnadjusted is 0, which is (CurTmp*0.125 -49) C. The CUR_TEMP register is read-write when CUR_TEMP_TJ_SEL == 3 (bit 17-16).
Add the check to detect it.
Sensors command's output before the patch.
$sensors
k10temp-pci-00c3
Adapter: PCI adapter
Tctl: +76.6°C <- Wrong value Tccd1: +26.5°C Tccd2: +27.5°C Tccd3: +27.2°C Tccd4: +27.5°C Tccd5: +26.0°C Tccd6: +26.2°C Tccd7: +25.0°C Tccd8: +26.5°C
Sensors command's output after the patch.
$sensors
k10temp-pci-00c3
Adapter: PCI adapter
Tctl: +28.8°C <- corrected value Tccd1: +27.5°C Tccd2: +28.5°C Tccd3: +28.5°C Tccd4: +28.5°C Tccd5: +27.0°C Tccd6: +27.5°C Tccd7: +27.0°C Tccd8: +27.5°C
--- drivers/hwmon/k10temp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/hwmon/k10temp.c +3 -1
@@ -75,6 +75,7 @@ static DEFINE_MUTEX(nb_smu_ind_mutex);#define ZEN_CUR_TEMP_SHIFT 21#define ZEN_CUR_TEMP_RANGE_SEL_MASK BIT(19) +#define ZEN_CUR_TEMP_TJ_SEL_MASK GENMASK(17, 16)struct k10temp_data {struct pci_dev *pdev;
@@ -155,7 +156,8 @@ static long get_raw_temp(struct k10temp_ data->read_tempreg (data->pdev, ®val); temp = (regval >>ZEN_CUR_TEMP_SHIFT ) *125 ; -if (regval & data->temp_adjust_mask) +if ((regval & data->temp_adjust_mask) || + (regval &ZEN_CUR_TEMP_TJ_SEL_MASK ) ==ZEN_CUR_TEMP_TJ_SEL_MASK ) temp -=49000 ;return temp; }
Greg Kroah-Hartman
maintainerPATCH 70/611 crypto: safexcel - Cleanup ring IRQ workqueues on load failure
In reply to Greg Kroah-HartmanFrom: Jonathan McDowell <[email protected]>
commit ca25c00ccbc5f942c63897ed23584cfc66e8ec81 upstream.
A failure loading the safexcel driver results in the following warning on boot, because the IRQ affinity has not been correctly cleaned up. Ensure we clean up the affinity and workqueues on a failure to load the driver.
crypto-safexcel: probe of f2800000.crypto failed with error -2
------------[ cut here ]------------ WARNING: CPU: 1 PID: 232 at kernel/irq/manage.c:1913 free_irq+0x300/0x340 Modules linked in: hwmon mdio_i2c crypto_safexcel(+) md5 sha256_generic libsha256 authenc libdes omap_rng rng_core nft_masq nft_nat nft_chain_nat nf_nat nft_ct nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nf_tables libcrc32c nfnetlink fuse autofs4 CPU: 1 PID: 232 Comm: systemd-udevd Tainted: G W 6.1.6-00002-g9d4898824677 #3 Hardware name: MikroTik RB5009 (DT) pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : free_irq+0x300/0x340 lr : free_irq+0x2e0/0x340
sp : ffff800008fa3890
x29: ffff800008fa3890 x28: 0000000000000000 x27: 0000000000000000
x26: ffff8000008e6dc0 x25: ffff000009034cac x24: ffff000009034d50
x23: 0000000000000000 x22: 000000000000004a x21: ffff0000093e0d80
x20: ffff000009034c00 x19: ffff00000615fc00 x18: 0000000000000000
x17: 0000000000000000 x16: 0000000000000000 x15: 000075f5c1584c5e
x14: 0000000000000017 x13: 0000000000000000 x12: 0000000000000040
x11: ffff000000579b60 x10: ffff000000579b62 x9 : ffff800008bbe370 x8 : ffff000000579dd0 x7 : 0000000000000000 x6 : ffff000000579e18 x5 : ffff000000579da8 x4 : ffff800008ca0000 x3 : ffff800008ca0188 x2 : 0000000013033204 x1 : ffff000009034c00 x0 : ffff8000087eadf0
Call trace: free_irq+0x300/0x340 devm_irq_release+0x14/0x20 devres_release_all+0xa0/0x100 device_unbind_cleanup+0x14/0x60 really_probe+0x198/0x2d4 __driver_probe_device+0x74/0xdc driver_probe_device+0x3c/0x110 __driver_attach+0x8c/0x190 bus_for_each_dev+0x6c/0xc0 driver_attach+0x20/0x30 bus_add_driver+0x148/0x1fc driver_register+0x74/0x120 __platform_driver_register+0x24/0x30 safexcel_init+0x48/0x1000 [crypto_safexcel] do_one_initcall+0x4c/0x1b0 do_init_module+0x44/0x1cc load_module+0x1724/0x1be4 __do_sys_finit_module+0xbc/0x110 __arm64_sys_finit_module+0x1c/0x24 invoke_syscall+0x44/0x110 el0_svc_common.constprop.0+0xc0/0xe0 do_el0_svc+0x20/0x80 el0_svc+0x14/0x4c el0t_64_sync_handler+0xb0/0xb4 el0t_64_sync+0x148/0x14c ---[ end trace 0000000000000000 ]---
--- drivers/crypto/inside-secure/safexcel.c | 37 +++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 10 deletions(-)
drivers/crypto/inside-secure/safexcel.c +27 -10
@@ -1631,19 +1631,23 @@ static int safexcel_probe_generic(void * &priv->ring[i].rdr);if (ret) {dev_err (dev,"Failed to initialize rings\n" ); -return ret; + goto err_cleanup_rings; } priv->ring[i].rdr_req =devm_kcalloc (dev,EIP197_DEFAULT_RING_SIZE ,sizeof (*priv->ring[i].rdr_req),GFP_KERNEL ); -if (!priv->ring[i].rdr_req) -return -ENOMEM ; +if (!priv->ring[i].rdr_req) { + ret = -ENOMEM ; + goto err_cleanup_rings; + } ring_irq =devm_kzalloc (dev,sizeof (*ring_irq),GFP_KERNEL ); -if (!ring_irq) -return -ENOMEM ; +if (!ring_irq) { + ret = -ENOMEM ; + goto err_cleanup_rings; + } ring_irq->priv = priv; ring_irq->ring = i;
@@ -1657,7 +1661,8 @@ static int safexcel_probe_generic(void * ring_irq);if (irq <0 ) {dev_err (dev,"Failed to get IRQ ID for ring %d\n" , i); -return irq; + ret = irq; + goto err_cleanup_rings; } priv->ring[i].irq = irq;
@@ -1669,8 +1674,10 @@ static int safexcel_probe_generic(void *snprintf (wq_name,9 ,"wq_ring%d" , i); priv->ring[i].workqueue =create_singlethread_workqueue (wq_name); -if (!priv->ring[i].workqueue) -return -ENOMEM ; +if (!priv->ring[i].workqueue) { + ret = -ENOMEM ; + goto err_cleanup_rings; + } priv->ring[i].requests =0 ; priv->ring[i].busy = false;
@@ -1687,16 +1694,26 @@ static int safexcel_probe_generic(void * ret =safexcel_hw_init (priv);if (ret) {dev_err (dev,"HW init failed (%d)\n" , ret); -return ret; + goto err_cleanup_rings; } ret =safexcel_register_algorithms (priv);if (ret) {dev_err (dev,"Failed to register algorithms (%d)\n" , ret); -return ret; + goto err_cleanup_rings; }return 0 ; + +err_cleanup_rings: +for (i =0 ; i < priv->config.rings; i++) { +if (priv->ring[i].irq) +irq_set_affinity_hint (priv->ring[i].irq,NULL ); +if (priv->ring[i].workqueue) +destroy_workqueue (priv->ring[i].workqueue); + } + +return ret; }static void safexcel_hw_reset_rings (struct safexcel_crypto_priv *priv)
Greg Kroah-Hartman
maintainerPATCH 79/611 KVM: arm64: Use config_lock to protect vgic state
In reply to Greg Kroah-HartmanFrom: Oliver Upton <[email protected]>
commit f00327731131d1b5aa6a1aa9f50bcf8d620ace4c upstream.
Almost all of the vgic state is VM-scoped but accessed from the context of a vCPU. These accesses were serialized on the kvm->lock which cannot be nested within a vcpu->mutex critical section.
Move over the vgic state to using the config_lock. Tweak the lock ordering where necessary to ensure that the config_lock is acquired after the vcpu->mutex. Acquire the config_lock in kvm_vgic_create() to avoid a race between the converted flows and GIC creation. Where necessary, continue to acquire kvm->lock to avoid a race with vCPU creation (i.e. flows that use lock_all_vcpus()).
Finally, promote the locking expectations in comments to lockdep assertions and update the locking documentation for the config_lock as well as vcpu->mutex.
--- arch/arm64/kvm/vgic/vgic-debug.c | 8 ++--- arch/arm64/kvm/vgic/vgic-init.c | 36 ++++++++++++++++---------- arch/arm64/kvm/vgic/vgic-its.c | 18 ++++++++----- arch/arm64/kvm/vgic/vgic-kvm-device.c | 47 ++++++++++++++++++++-------------- arch/arm64/kvm/vgic/vgic-mmio-v3.c | 4 +- arch/arm64/kvm/vgic/vgic-mmio.c | 12 ++++---- arch/arm64/kvm/vgic/vgic-v4.c | 11 ++++--- arch/arm64/kvm/vgic/vgic.c | 12 +++++--- 8 files changed, 88 insertions(+), 60 deletions(-)
arch/arm64/kvm/vgic/vgic-debug.c +4 -4
@@ -85,7 +85,7 @@ static void *vgic_debug_start(struct seqstruct kvm *kvm = s->private;struct vgic_state_iter *iter; -mutex_lock (&kvm->lock); +mutex_lock (&kvm->arch.config_lock); iter = kvm->arch.vgic.iter;if (iter) { iter =ERR_PTR (-EBUSY );
@@ -104,7 +104,7 @@ static void *vgic_debug_start(struct seqif (end_of_vgic (iter)) iter =NULL ; out: -mutex_unlock (&kvm->lock); +mutex_unlock (&kvm->arch.config_lock);return iter; }
@@ -132,12 +132,12 @@ static void vgic_debug_stop(struct seq_fif (IS_ERR (v))return ; -mutex_lock (&kvm->lock); +mutex_lock (&kvm->arch.config_lock); iter = kvm->arch.vgic.iter;kfree (iter->lpi_array);kfree (iter); kvm->arch.vgic.iter =NULL ; -mutex_unlock (&kvm->lock); +mutex_unlock (&kvm->arch.config_lock); }static void print_dist_state (struct seq_file *s,struct vgic_dist *dist)
arch/arm64/kvm/vgic/vgic-init.c +23 -13
@@ -74,9 +74,6 @@ int kvm_vgic_create(struct kvm *kvm, u32unsigned long i;int ret; -if (irqchip_in_kernel (kvm)) -return -EEXIST ; -/* * This function is also called by the KVM_CREATE_IRQCHIP handler, * which had no chance yet to check the availability of the GICv2
@@ -87,10 +84,20 @@ int kvm_vgic_create(struct kvm *kvm, u32 !kvm_vgic_global_state.can_emulate_gicv2)return -ENODEV ; +/* Must be held to avoid race with vCPU creation */ +lockdep_assert_held (&kvm->lock); + ret = -EBUSY ;if (!lock_all_vcpus (kvm))return ret; +mutex_lock (&kvm->arch.config_lock); + +if (irqchip_in_kernel (kvm)) { + ret = -EEXIST ; + goto out_unlock; + } +kvm_for_each_vcpu (i, vcpu, kvm) {if (vcpu_has_run_once (vcpu)) goto out_unlock;
@@ -118,6 +125,7 @@ int kvm_vgic_create(struct kvm *kvm, u32INIT_LIST_HEAD (&kvm->arch.vgic.rd_regions); out_unlock: +mutex_unlock (&kvm->arch.config_lock);unlock_all_vcpus (kvm);return ret; }
@@ -227,9 +235,9 @@ int kvm_vgic_vcpu_init(struct kvm_vcpu ** KVM io device for the redistributor that belongs to this VCPU. */ if (dist->vgic_model ==KVM_DEV_TYPE_ARM_VGIC_V3 ) { -mutex_lock (&vcpu->kvm->lock); +mutex_lock (&vcpu->kvm->arch.config_lock); ret =vgic_register_redist_iodev (vcpu); -mutex_unlock (&vcpu->kvm->lock); +mutex_unlock (&vcpu->kvm->arch.config_lock); }return ret; }
@@ -250,7 +258,6 @@ static void kvm_vgic_vcpu_enable(struct* The function is generally called when nr_spis has been explicitly set * by the guest through the KVM DEVICE API. If not nr_spis is set to 256. * vgic_initialized() returns true when this function has succeeded. -* Must be called with kvm->lock held! */ int vgic_init (struct kvm *kvm) {
@@ -259,6 +266,8 @@ int vgic_init(struct kvm *kvm)int ret =0 , i;unsigned long idx; +lockdep_assert_held (&kvm->arch.config_lock); +if (vgic_initialized (kvm))return 0 ;
@@ -373,12 +382,13 @@ void kvm_vgic_vcpu_destroy(struct kvm_vc vgic_cpu->rd_iodev.base_addr =VGIC_ADDR_UNDEF ; } -/* To be called with kvm->lock held */ static void __kvm_vgic_destroy (struct kvm *kvm) {struct kvm_vcpu *vcpu;unsigned long i; +lockdep_assert_held (&kvm->arch.config_lock); +vgic_debug_destroy (kvm);kvm_for_each_vcpu (i, vcpu, kvm)
@@ -389,9 +399,9 @@ static void __kvm_vgic_destroy(struct kvvoid kvm_vgic_destroy (struct kvm *kvm) { -mutex_lock (&kvm->lock); +mutex_lock (&kvm->arch.config_lock);__kvm_vgic_destroy (kvm); -mutex_unlock (&kvm->lock); +mutex_unlock (&kvm->arch.config_lock); }/**
@@ -414,9 +424,9 @@ int vgic_lazy_init(struct kvm *kvm)if (kvm->arch.vgic.vgic_model !=KVM_DEV_TYPE_ARM_VGIC_V2 )return -EBUSY ; -mutex_lock (&kvm->lock); +mutex_lock (&kvm->arch.config_lock); ret =vgic_init (kvm); -mutex_unlock (&kvm->lock); +mutex_unlock (&kvm->arch.config_lock); }return ret;
@@ -441,7 +451,7 @@ int kvm_vgic_map_resources(struct kvm *kif (likely (vgic_ready (kvm)))return 0 ; -mutex_lock (&kvm->lock); +mutex_lock (&kvm->arch.config_lock);if (vgic_ready (kvm)) goto out;
@@ -459,7 +469,7 @@ int kvm_vgic_map_resources(struct kvm *k dist->ready = true; out: -mutex_unlock (&kvm->lock); +mutex_unlock (&kvm->arch.config_lock);return ret; }
arch/arm64/kvm/vgic/vgic-its.c +12 -6
@@ -2045,6 +2045,13 @@ static int vgic_its_attr_regs_access(strmutex_lock (&dev->kvm->lock); +if (!lock_all_vcpus (dev->kvm)) { +mutex_unlock (&dev->kvm->lock); +return -EBUSY ; + } + +mutex_lock (&dev->kvm->arch.config_lock); +if (IS_VGIC_ADDR_UNDEF (its->vgic_its_base)) { ret = -ENXIO ; goto out;
@@ -2058,11 +2065,6 @@ static int vgic_its_attr_regs_access(str goto out; } -if (!lock_all_vcpus (dev->kvm)) { - ret = -EBUSY ; - goto out; - } - addr = its->vgic_its_base + offset; len = region->access_flags & VGIC_ACCESS_64bit ?8 :4 ;
@@ -2076,8 +2078,9 @@ static int vgic_its_attr_regs_access(str }else { *reg = region->its_read (dev->kvm, its, addr, len); } -unlock_all_vcpus (dev->kvm); out: +mutex_unlock (&dev->kvm->arch.config_lock); +unlock_all_vcpus (dev->kvm);mutex_unlock (&dev->kvm->lock);return ret; }
@@ -2757,6 +2760,8 @@ static int vgic_its_ctrl(struct kvm *kvmreturn -EBUSY ; } +mutex_lock (&kvm->arch.config_lock); +switch (attr) {case KVM_DEV_ARM_ITS_CTRL_RESET :vgic_its_reset (kvm, its);
@@ -2769,6 +2774,7 @@ static int vgic_its_ctrl(struct kvm *kvmbreak ; } +mutex_unlock (&kvm->arch.config_lock);unlock_all_vcpus (kvm);mutex_unlock (&its->its_lock);mutex_unlock (&kvm->lock);
arch/arm64/kvm/vgic/vgic-kvm-device.c +28 -19
129 lines not on this page · raw message
arch/arm64/kvm/vgic/vgic-mmio-v3.c +2 -2
@@ -111,7 +111,7 @@ static void vgic_mmio_write_v3_misc(strucase GICD_CTLR : {bool was_enabled, is_hwsgi; -mutex_lock (&vcpu->kvm->lock); +mutex_lock (&vcpu->kvm->arch.config_lock); was_enabled = dist->enabled; is_hwsgi = dist->nassgireq;
@@ -139,7 +139,7 @@ static void vgic_mmio_write_v3_misc(struelse if (!was_enabled && dist->enabled)vgic_kick_vcpus (vcpu->kvm); -mutex_unlock (&vcpu->kvm->lock); +mutex_unlock (&vcpu->kvm->arch.config_lock);break ; }case GICD_TYPER :
arch/arm64/kvm/vgic/vgic-mmio.c +6 -6
@@ -527,13 +527,13 @@ unsigned long vgic_mmio_read_active(struu32 intid =VGIC_ADDR_TO_INTID (addr,1 );u32 val; -mutex_lock (&vcpu->kvm->lock); +mutex_lock (&vcpu->kvm->arch.config_lock);vgic_access_active_prepare (vcpu, intid); val =__vgic_mmio_read_active (vcpu, addr, len);vgic_access_active_finish (vcpu, intid); -mutex_unlock (&vcpu->kvm->lock); +mutex_unlock (&vcpu->kvm->arch.config_lock);return val; }
@@ -622,13 +622,13 @@ void vgic_mmio_write_cactive(struct kvm_ {u32 intid =VGIC_ADDR_TO_INTID (addr,1 ); -mutex_lock (&vcpu->kvm->lock); +mutex_lock (&vcpu->kvm->arch.config_lock);vgic_access_active_prepare (vcpu, intid);__vgic_mmio_write_cactive (vcpu, addr, len, val);vgic_access_active_finish (vcpu, intid); -mutex_unlock (&vcpu->kvm->lock); +mutex_unlock (&vcpu->kvm->arch.config_lock); } int vgic_mmio_uaccess_write_cactive(struct kvm_vcpu *vcpu,
@@ -659,13 +659,13 @@ void vgic_mmio_write_sactive(struct kvm_ {u32 intid =VGIC_ADDR_TO_INTID (addr,1 ); -mutex_lock (&vcpu->kvm->lock); +mutex_lock (&vcpu->kvm->arch.config_lock);vgic_access_active_prepare (vcpu, intid);__vgic_mmio_write_sactive (vcpu, addr, len, val);vgic_access_active_finish (vcpu, intid); -mutex_unlock (&vcpu->kvm->lock); +mutex_unlock (&vcpu->kvm->arch.config_lock); } int vgic_mmio_uaccess_write_sactive(struct kvm_vcpu *vcpu,
arch/arm64/kvm/vgic/vgic-v4.c +6 -5
@@ -232,9 +232,8 @@ int vgic_v4_request_vpe_irq(struct kvm_v* @kvm: Pointer to the VM being initialized * * We may be called each time a vITS is created, or when the -* vgic is initialized. This relies on kvm->lock to be -* held. In both cases, the number of vcpus should now be -* fixed. +* vgic is initialized. In both cases, the number of vcpus +* should now be fixed. */ int vgic_v4_init (struct kvm *kvm) {
@@ -243,6 +242,8 @@ int vgic_v4_init(struct kvm *kvm)int nr_vcpus, ret;unsigned long i; +lockdep_assert_held (&kvm->arch.config_lock); +if (!kvm_vgic_global_state.has_gicv4)return 0 ;/* Nothing to see here... move along. */
@@ -309,14 +310,14 @@ int vgic_v4_init(struct kvm *kvm)/** * vgic_v4_teardown - Free the GICv4 data structures * @kvm: Pointer to the VM being destroyed -* -* Relies on kvm->lock to be held. */ void vgic_v4_teardown (struct kvm *kvm) {struct its_vm *its_vm = &kvm->arch.vgic.its_vm;int i; +lockdep_assert_held (&kvm->arch.config_lock); +if (!its_vm->vpes)return ;
arch/arm64/kvm/vgic/vgic.c +7 -5
@@ -24,11 +24,13 @@ struct vgic_global kvm_vgic_global_state/* * Locking order is always: * kvm->lock (mutex) -* its->cmd_lock (mutex) -* its->its_lock (mutex) -* vgic_cpu->ap_list_lock must be taken with IRQs disabled -* kvm->lpi_list_lock must be taken with IRQs disabled -* vgic_irq->irq_lock must be taken with IRQs disabled +* vcpu->mutex (mutex) +* kvm->arch.config_lock (mutex) +* its->cmd_lock (mutex) +* its->its_lock (mutex) +* vgic_cpu->ap_list_lock must be taken with IRQs disabled +* kvm->lpi_list_lock must be taken with IRQs disabled +* vgic_irq->irq_lock must be taken with IRQs disabled * * As the ap_list_lock might be taken from the timer interrupt handler, * we have to disable IRQs before taking this lock and everything lower
Greg Kroah-Hartman
maintainerPATCH 80/611 KVM: arm64: vgic: Dont acquire its_lock before config_lock
In reply to Greg Kroah-HartmanFrom: Oliver Upton <[email protected]>
commit 49e5d16b6fc003407a33a9961b4bcbb970bd1c76 upstream.
commit f00327731131 ("KVM: arm64: Use config_lock to protect vgic state") was meant to rectify a longstanding lock ordering issue in KVM where the kvm->lock is taken while holding vcpu->mutex. As it so happens, the aforementioned commit introduced yet another locking issue by acquiring the its_lock before acquiring the config lock.
This is obviously wrong, especially considering that the lock ordering is well documented in vgic.c. Reshuffle the locks once more to take the config_lock before the its_lock. While at it, sprinkle in the lockdep hinting that has become popular as of late to keep lockdep apprised of our ordering.
--- arch/arm64/kvm/vgic/vgic-its.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
arch/arm64/kvm/vgic/vgic-its.c +12 -3
@@ -1958,6 +1958,16 @@ static int vgic_its_create(struct kvm_demutex_init (&its->its_lock);mutex_init (&its->cmd_lock); +/* Yep, even more trickery for lock ordering... */ +#ifdef CONFIG_LOCKDEP +mutex_lock (&dev->kvm->arch.config_lock); +mutex_lock (&its->cmd_lock); +mutex_lock (&its->its_lock); +mutex_unlock (&its->its_lock); +mutex_unlock (&its->cmd_lock); +mutex_unlock (&dev->kvm->arch.config_lock); +#endif + its->vgic_its_base =VGIC_ADDR_UNDEF ;INIT_LIST_HEAD (&its->device_list);
@@ -2752,15 +2762,14 @@ static int vgic_its_ctrl(struct kvm *kvmreturn 0 ;mutex_lock (&kvm->lock); -mutex_lock (&its->its_lock);if (!lock_all_vcpus (kvm)) { -mutex_unlock (&its->its_lock);mutex_unlock (&kvm->lock);return -EBUSY ; }mutex_lock (&kvm->arch.config_lock); +mutex_lock (&its->its_lock);switch (attr) {case KVM_DEV_ARM_ITS_CTRL_RESET :
@@ -2774,9 +2783,9 @@ static int vgic_its_ctrl(struct kvm *kvmbreak ; } +mutex_unlock (&its->its_lock);mutex_unlock (&kvm->arch.config_lock);unlock_all_vcpus (kvm); -mutex_unlock (&its->its_lock);mutex_unlock (&kvm->lock);return ret; }
Greg Kroah-Hartman
maintainerPATCH 81/611 relayfs: fix out-of-bounds access in relay_file_read
In reply to Greg Kroah-HartmanFrom: Zhang Zhengming <[email protected]>
commit 43ec16f1450f4936025a9bdf1a273affdb9732c1 upstream.
There is a crash in relay_file_read, as the var from point to the end of last subbuf.
The oops looks something like:
pc : __arch_copy_to_user+0x180/0x310 lr : relay_file_read+0x20c/0x2c8 Call trace: __arch_copy_to_user+0x180/0x310 full_proxy_read+0x68/0x98 vfs_read+0xb0/0x1d0 ksys_read+0x6c/0xf0 __arm64_sys_read+0x20/0x28 el0_svc_common.constprop.3+0x84/0x108 do_el0_svc+0x74/0x90 el0_svc+0x1c/0x28 el0_sync_handler+0x88/0xb0 el0_sync+0x148/0x180
We get the condition by analyzing the vmcore:
1). The last produced byte and last consumed byte
both at the end of the last subbuf
2). A softirq calls function(e.g __blk_add_trace)
to write relay buffer occurs when an program is calling
relay_file_read_avail().
relay_file_read
relay_file_read_avail
relay_file_read_consume(buf, 0, 0);
//interrupted by softirq who will write subbuf
....
return 1;
//read_start point to the end of the last subbuf
read_start = relay_file_read_start_pos
//avail is equal to subsize
avail = relay_file_read_subbuf_avail
//from points to an invalid memory address
from = buf->start + read_start
//system is crashed
copy_to_user(buffer, from, avail)--- kernel/relay.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/relay.c +2 -1
@@ -989,7 +989,8 @@ static size_t relay_file_read_start_pos(size_t subbuf_size = buf->chan->subbuf_size;size_t n_subbufs = buf->chan->n_subbufs;size_t consumed = buf->subbufs_consumed % n_subbufs; -size_t read_pos = consumed * subbuf_size + buf->bytes_consumed; +size_t read_pos = (consumed * subbuf_size + buf->bytes_consumed) + % (n_subbufs * subbuf_size); read_subbuf = read_pos / subbuf_size; padding = buf->padding[read_subbuf];
Greg Kroah-Hartman
maintainerPATCH 82/611 drm/amd/display: Remove stutter only configurations
In reply to Greg Kroah-HartmanFrom: Nasir Osman <[email protected]>
[ Upstream commit 71c4ca2d3b079d0ba4d9b3033641fea906cebfb6 ]
[why]
Newer ASICs such as DCN314 needs to allow for both self refresh and mem clk switching rather than just self refresh only. Otherwise, we can see some p-state hangs on ASICs that do support mem clk switching.
[how]
Added an allow_self_refresh_only flag for dcn30_internal_validate_bw and created a validate_bw method for DCN314 with the allow_self_refresh_only flag set to false (to support mem clk switching).
Stable-dep-of: 1e994cc0956b ("drm/amd/display: limit timing for single dimm memory")
--- .../drm/amd/display/dc/dcn30/dcn30_resource.c | 16 +++--- .../drm/amd/display/dc/dcn30/dcn30_resource.h | 3 +- .../drm/amd/display/dc/dcn31/dcn31_resource.c | 2 +- .../amd/display/dc/dcn314/dcn314_resource.c | 57 ++++++++++++++++++- .../amd/display/dc/dcn314/dcn314_resource.h | 4 ++ .../drm/amd/display/dc/dml/dcn30/dcn30_fpu.c | 2 +- 6 files changed, 73 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c +9 -7
@@ -1641,7 +1641,8 @@ noinline bool dcn30_internal_validate_bw( display_e2e_pipe_params_st *pipes, int *pipe_cnt_out, int *vlevel_out, - bool fast_validate) + bool fast_validate, + bool allow_self_refresh_only) {bool out = false;bool repopulate_pipes = false;
@@ -1668,7 +1669,7 @@ noinline bool dcn30_internal_validate_bw(dml_log_pipe_params (&context->bw_ctx.dml, pipes, pipe_cnt); -if (!fast_validate) { +if (!fast_validate || !allow_self_refresh_only) {/* * DML favors voltage over p-state, but we're more interested in * supporting p-state over voltage. We can't support p-state in
@@ -1681,11 +1682,12 @@ noinline bool dcn30_internal_validate_bw(if (vlevel < context->bw_ctx.dml.soc.num_states) vlevel =dcn20_validate_apply_pipe_split_flags (dc, context, vlevel, split, merge); } -if (fast_validate || vlevel == context->bw_ctx.dml.soc.num_states || - vba->DRAMClockChangeSupport[vlevel][vba->maxMpcComb] == dm_dram_clock_change_unsupported) { +if (allow_self_refresh_only && + (fast_validate || vlevel == context->bw_ctx.dml.soc.num_states || + vba->DRAMClockChangeSupport[vlevel][vba->maxMpcComb] == dm_dram_clock_change_unsupported)) {/* -* If mode is unsupported or there's still no p-state support then -* fall back to favoring voltage. +* If mode is unsupported or there's still no p-state support +* then fall back to favoring voltage. * * We don't actually support prefetch mode 2, so require that we * at least support prefetch mode 1.
@@ -2056,7 +2058,7 @@ bool dcn30_validate_bandwidth(struct dc *dc,BW_VAL_TRACE_COUNT ();DC_FP_START (); - out =dcn30_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel, fast_validate); + out =dcn30_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel, fast_validate, true);DC_FP_END ();if (pipe_cnt ==0 )
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.h +2 -1
@@ -64,7 +64,8 @@ bool dcn30_internal_validate_bw( display_e2e_pipe_params_st *pipes, int *pipe_cnt_out, int *vlevel_out, - bool fast_validate); + bool fast_validate, + bool allow_self_refresh_only); void dcn30_calculate_wm_and_dlg( struct dc *dc, struct dc_state *context, display_e2e_pipe_params_st *pipes,
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c +1 -1
@@ -1770,7 +1770,7 @@ bool dcn31_validate_bandwidth(struct dc *dc,BW_VAL_TRACE_COUNT ();DC_FP_START (); - out =dcn30_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel, fast_validate); + out =dcn30_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel, fast_validate, true);DC_FP_END ();// Disable fast_validate to set min dcfclk in alculate_wm_and_dlg
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c +56 -1
69 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.h +4 -0
@@ -39,6 +39,10 @@ struct dcn314_resource_pool {struct resource_pool base; }; +bool dcn314_validate_bandwidth (struct dc *dc, +struct dc_state *context, +bool fast_validate); +struct resource_pool *dcn314_create_resource_pool (const struct dc_init_data *init_data,struct dc *dc);
drivers/gpu/drm/amd/display/dc/dml/dcn30/dcn30_fpu.c +1 -1
@@ -636,7 +636,7 @@ int dcn30_find_dummy_latency_index_for_fw_based_mclk_switch(struct dc *dc,while (dummy_latency_index < max_latency_table_entries) { context->bw_ctx.dml.soc.dram_clock_change_latency_us = dc->clk_mgr->bw_params->dummy_pstate_table[dummy_latency_index].dummy_pstate_latency_us; -dcn30_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel, false); +dcn30_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel, false, true);if (context->bw_ctx.dml.soc.allow_dram_self_refresh_or_dram_clock_change_in_vblank == dm_allow_self_refresh_and_mclk_switch)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 83/611 drm/amd/display: limit timing for single dimm memory
In reply to Greg Kroah-HartmanFrom: Daniel Miess <[email protected]>
[ Upstream commit 1e994cc0956b8dabd1b1fef315bbd722733b8aa8 ]
[Why]
1. It could hit bandwidth limitdation under single dimm memory when connecting 8K external monitor.
2. IsSupportedVidPn got validation failed with 2K240Hz eDP + 8K24Hz external monitor.
3. It's better to filter out such combination in EnumVidPnCofuncModality
4. For short term, filter out in dc bandwidth validation.
[How]
Force 2K@240Hz+8K@24Hz timing validation false in dc.
--- .../amd/display/dc/dcn314/dcn314_resource.c | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c +20 -0
@@ -1689,6 +1689,23 @@ static void dcn314_get_panel_config_defaults(struct dc_panel_config *panel_confi *panel_config = panel_config_defaults; } +static bool filter_modes_for_single_channel_workaround (struct dc *dc, +struct dc_state *context) +{ +// Filter 2K@240Hz+8K@24fps above combination timing if memory only has single dimm LPDDR +if (dc->clk_mgr->bw_params->vram_type ==34 && dc->clk_mgr->bw_params->num_channels <2 ) { +int total_phy_pix_clk =0 ; + +for (int i =0 ; i < context->stream_count; i++) +if (context->res_ctx.pipe_ctx[i].stream) + total_phy_pix_clk += context->res_ctx.pipe_ctx[i].stream->phy_pix_clk; + +if (total_phy_pix_clk >= (1148928 +826260 ))//2K@240Hz+8K@24fps +return true; + } +return false; +} +bool dcn314_validate_bandwidth (struct dc *dc,struct dc_state *context,bool fast_validate)
@@ -1704,6 +1721,9 @@ bool dcn314_validate_bandwidth(struct dc *dc,BW_VAL_TRACE_COUNT (); +if (filter_modes_for_single_channel_workaround (dc, context)) + goto validate_fail; +DC_FP_START ();// do not support self refresh only out =dcn30_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel, fast_validate, false);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 84/611 drm/amd/display: fix PSR-SU/DSC interoperability support
In reply to Greg Kroah-HartmanFrom: Hamza Mahfooz <[email protected]>
[ Upstream commit 13b90cf900ab69dd5cab3cc5035bc7614037e64e ]
Currently, there are issues with enabling PSR-SU + DSC. This stems from the fact that DSC imposes a slice height on transmitted video data and we are not conforming to that slice height in PSR-SU regions. So, pass slice_height into su_y_granularity to feed the DSC slice height into PSR-SU code.
Stable-dep-of: 0b5dfe12755f ("drm/amd/display: fix a divided-by-zero error")
--- .../drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c | 3 ++ .../amd/display/modules/power/power_helpers.c | 31 +++++++++++++++++++ .../amd/display/modules/power/power_helpers.h | 3 ++ 3 files changed, 37 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c +3 -0
@@ -122,6 +122,9 @@ bool amdgpu_dm_link_setup_psr(struct dc_stream_state *stream) psr_config.allow_multi_disp_optimizations = (amdgpu_dc_feature_mask &DC_PSR_ALLOW_MULTI_DISP_OPT ); +if (!psr_su_set_y_granularity (dc, link, stream, &psr_config)) +return false; + ret =dc_link_setup_psr (link, stream, &psr_config, &psr_context); }
drivers/gpu/drm/amd/display/modules/power/power_helpers.c +31 -0
@@ -907,3 +907,34 @@ bool mod_power_only_edp(const struct dc_state *context, const struct dc_stream_s {return context && context->stream_count ==1 &&dc_is_embedded_signal (stream->signal); } + +bool psr_su_set_y_granularity (struct dc *dc,struct dc_link *link, +struct dc_stream_state *stream, +struct psr_config *config) +{ +uint16_t pic_height; +uint8_t slice_height; + +if ((link->connector_signal &SIGNAL_TYPE_EDP ) && + (!dc->caps.edp_dsc_support || + link->panel_config.dsc.disable_dsc_edp || + !link->dpcd_caps.dsc_caps.dsc_basic_caps.fields.dsc_support.DSC_SUPPORT || + !stream->timing.dsc_cfg.num_slices_v)) +return true; + + pic_height = stream->timing.v_addressable + + stream->timing.v_border_top + stream->timing.v_border_bottom; + slice_height = pic_height / stream->timing.dsc_cfg.num_slices_v; + +if (slice_height) { +if (config->su_y_granularity && + (slice_height % config->su_y_granularity)) { +ASSERT (0 ); +return false; + } + + config->su_y_granularity = slice_height; + } + +return true; +}
drivers/gpu/drm/amd/display/modules/power/power_helpers.h +3 -0
@@ -59,4 +59,7 @@ void mod_power_calc_psr_configs(struct psr_config *psr_config, const struct dc_stream_state *stream);bool mod_power_only_edp (const struct dc_state *context,const struct dc_stream_state *stream); +bool psr_su_set_y_granularity (struct dc *dc,struct dc_link *link, +struct dc_stream_state *stream, +struct psr_config *config);#endif /* MODULES_POWER_POWER_HELPERS_H_ */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 85/611 drm/amd/display: fix a divided-by-zero error
In reply to Greg Kroah-HartmanFrom: Alex Hung <[email protected]>
[ Upstream commit 0b5dfe12755f87ec014bb4cc1930485026167430 ]
[Why & How]
timing.dsc_cfg.num_slices_v can be zero and it is necessary to check before using it.
This fixes the error "divide error: 0000 [#1] PREEMPT SMP NOPTI".
--- drivers/gpu/drm/amd/display/modules/power/power_helpers.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/display/modules/power/power_helpers.c +4 -0
@@ -924,6 +924,10 @@ bool psr_su_set_y_granularity(struct dc *dc, struct dc_link *link, pic_height = stream->timing.v_addressable + stream->timing.v_border_top + stream->timing.v_border_bottom; + +if (stream->timing.dsc_cfg.num_slices_v ==0 ) +return false; + slice_height = pic_height / stream->timing.dsc_cfg.num_slices_v;if (slice_height) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 86/611 KVM: RISC-V: Retry fault if vma_lookup() results become invalid
In reply to Greg Kroah-HartmanFrom: David Matlack <[email protected]>
commit 2ed90cb0938a45b12eb947af062d12c7af0067b3 upstream.
Read mmu_invalidate_seq before dropping the mmap_lock so that KVM can detect if the results of vma_lookup() (e.g. vma_shift) become stale before it acquires kvm->mmu_lock. This fixes a theoretical bug where a VMA could be changed by userspace after vma_lookup() and before KVM reads the mmu_invalidate_seq, causing KVM to install page table entries based on a (possibly) no-longer-valid vma_shift.
Re-order the MMU cache top-up to earlier in user_mem_abort() so that it is not done after KVM has read mmu_invalidate_seq (i.e. so as to avoid inducing spurious fault retries).
It's unlikely that any sane userspace currently modifies VMAs in such a way as to trigger this race. And even with directed testing I was unable to reproduce it. But a sufficiently motivated host userspace might be able to exploit this race.
Note KVM/ARM had the same bug and was fixed in a separate, near identical patch (see Link).
--- arch/riscv/kvm/mmu.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-)
arch/riscv/kvm/mmu.c +16 -9
@@ -630,6 +630,13 @@ int kvm_riscv_gstage_map(struct kvm_vcpu !(memslot->flags & KVM_MEM_READONLY)) ? true : false;unsigned long vma_pagesize, mmu_seq; +/* We need minimum second+third level pages */ + ret =kvm_mmu_topup_memory_cache (pcache, gstage_pgd_levels); +if (ret) { +kvm_err ("Failed to topup G-stage cache\n" ); +return ret; + } +mmap_read_lock (current->mm); vma =find_vma_intersection (current->mm, hva, hva +1 );
@@ -650,6 +657,15 @@ int kvm_riscv_gstage_map(struct kvm_vcpuif (vma_pagesize ==PMD_SIZE || vma_pagesize ==PGDIR_SIZE ) gfn = (gpa &huge_page_mask (hstate_vma (vma))) >>PAGE_SHIFT ; +/* +* Read mmu_invalidate_seq so that KVM can detect if the results of +* vma_lookup() or gfn_to_pfn_prot() become stale priort to acquiring +* kvm->mmu_lock. +* +* Rely on mmap_read_unlock() for an implicit smp_rmb(), which pairs +* with the smp_wmb() in kvm_mmu_invalidate_end(). +*/ + mmu_seq = kvm->mmu_invalidate_seq;mmap_read_unlock (current->mm); if (vma_pagesize != PGDIR_SIZE &&
@@ -659,15 +675,6 @@ int kvm_riscv_gstage_map(struct kvm_vcpureturn -EFAULT ; } -/* We need minimum second+third level pages */ - ret =kvm_mmu_topup_memory_cache (pcache, gstage_pgd_levels); -if (ret) { -kvm_err ("Failed to topup G-stage cache\n" ); -return ret; - } - - mmu_seq = kvm->mmu_invalidate_seq; - hfn =gfn_to_pfn_prot (kvm, gfn, is_write, &writable);if (hfn ==KVM_PFN_ERR_HWPOISON ) { send_sig_mceerr(BUS_MCEERR_AR, (void __user *)hva,
Greg Kroah-Hartman
maintainerPATCH 87/611 ksmbd: fix racy issue under cocurrent smb2 tree disconnect
In reply to Greg Kroah-HartmanFrom: Namjae Jeon <[email protected]>
commit 30210947a343b6b3ca13adc9bfc88e1543e16dd5 upstream.
There is UAF issue under cocurrent smb2 tree disconnect. This patch introduce TREE_CONN_EXPIRE flags for tcon to avoid cocurrent access.
--- fs/ksmbd/mgmt/tree_connect.c | 10 +++++++++- fs/ksmbd/mgmt/tree_connect.h | 3 +++ fs/ksmbd/smb2pdu.c | 3 ++- 3 files changed, 14 insertions(+), 2 deletions(-)
fs/ksmbd/mgmt/tree_connect.c +9 -1
@@ -109,7 +109,15 @@ int ksmbd_tree_conn_disconnect(struct ksstruct ksmbd_tree_connect *ksmbd_tree_conn_lookup (struct ksmbd_session *sess,unsigned int id) { -return xa_load (&sess->tree_conns, id); +struct ksmbd_tree_connect *tcon; + + tcon =xa_load (&sess->tree_conns, id); +if (tcon) { +if (test_bit (TREE_CONN_EXPIRE , &tcon->status)) + tcon =NULL ; + } + +return tcon; } struct ksmbd_share_config *ksmbd_tree_conn_share(struct ksmbd_session *sess,
fs/ksmbd/mgmt/tree_connect.h +3 -0
@@ -14,6 +14,8 @@ struct ksmbd_share_config;struct ksmbd_user ;struct ksmbd_conn ; +#define TREE_CONN_EXPIRE 1 +struct ksmbd_tree_connect {int id;
@@ -25,6 +27,7 @@ struct ksmbd_tree_connect {int maximal_access;bool posix_extensions; +unsigned long status; };struct ksmbd_tree_conn_status {
fs/ksmbd/smb2pdu.c +2 -1
@@ -2053,11 +2053,12 @@ int smb2_tree_disconnect(struct ksmbd_woksmbd_debug (SMB ,"request\n" ); -if (!tcon) { +if (!tcon ||test_and_set_bit (TREE_CONN_EXPIRE , &tcon->status)) {struct smb2_tree_disconnect_req *req =smb2_get_msg (work->request_buf);ksmbd_debug (SMB ,"Invalid tid %d\n" , req->hdr.Id.SyncId.TreeId); + rsp->hdr.Status =STATUS_NETWORK_NAME_DELETED ;smb2_set_err_rsp (work);return 0 ;
Greg Kroah-Hartman
maintainerPATCH 88/611 ksmbd: call rcu_barrier() in ksmbd_server_exit()
In reply to Greg Kroah-HartmanFrom: Namjae Jeon <[email protected]>
commit eb307d09fe15844fdaebeb8cc8c9b9e925430aa5 upstream.
racy issue is triggered the bug by racing between closing a connection and rmmod. In ksmbd, rcu_barrier() is not called at module unload time, so nothing prevents ksmbd from getting unloaded while it still has RCU callbacks pending. It leads to trigger unintended execution of kernel code locally and use to defeat protections such as Kernel Lockdown
--- fs/ksmbd/server.c | 1 + 1 file changed, 1 insertion(+)
fs/ksmbd/server.c +1 -0
@@ -614,6 +614,7 @@ err_unregister: static void __exit ksmbd_server_exit(void) {ksmbd_server_shutdown (); +rcu_barrier ();ksmbd_release_inode_hash (); }
Greg Kroah-Hartman
maintainerPATCH 71/611 crypto: arm64/aes-neonbs - fix crash with CFI enabled
In reply to Greg Kroah-HartmanFrom: Eric Biggers <[email protected]>
commit 47446d7cd42358ca7d7a544f2f7823db03f616ff upstream.
aesbs_ecb_encrypt(), aesbs_ecb_decrypt(), aesbs_xts_encrypt(), and aesbs_xts_decrypt() are called via indirect function calls. Therefore they need to use SYM_TYPED_FUNC_START instead of SYM_FUNC_START to cause their type hashes to be emitted when the kernel is built with CONFIG_CFI_CLANG=y. Otherwise, the code crashes with a CFI failure if the compiler doesn't happen to optimize out the indirect calls.
--- arch/arm64/crypto/aes-neonbs-core.S | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
arch/arm64/crypto/aes-neonbs-core.S +5 -4
@@ -15,6 +15,7 @@ */ #include <linux/linkage.h> +#include <linux/cfi_types.h> #include <asm/assembler.h> .text
@@ -620,12 +621,12 @@ SYM_FUNC_END(aesbs_decrypt8) .endm .align 4 -SYM_FUNC_START(aesbs_ecb_encrypt) +SYM_TYPED_FUNC_START(aesbs_ecb_encrypt) __ecb_crypt aesbs_encrypt8, v0, v1, v4, v6, v3, v7, v2, v5 SYM_FUNC_END(aesbs_ecb_encrypt) .align 4 -SYM_FUNC_START(aesbs_ecb_decrypt) +SYM_TYPED_FUNC_START(aesbs_ecb_decrypt) __ecb_crypt aesbs_decrypt8, v0, v1, v6, v4, v2, v7, v3, v5 SYM_FUNC_END(aesbs_ecb_decrypt)
@@ -799,11 +800,11 @@ SYM_FUNC_END(__xts_crypt8) ret .endm -SYM_FUNC_START(aesbs_xts_encrypt) +SYM_TYPED_FUNC_START(aesbs_xts_encrypt) __xts_crypt aesbs_encrypt8, v0, v1, v4, v6, v3, v7, v2, v5 SYM_FUNC_END(aesbs_xts_encrypt) -SYM_FUNC_START(aesbs_xts_decrypt) +SYM_TYPED_FUNC_START(aesbs_xts_decrypt) __xts_crypt aesbs_decrypt8, v0, v1, v6, v4, v2, v7, v3, v5 SYM_FUNC_END(aesbs_xts_decrypt)
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 89/611 ksmbd: fix NULL pointer dereference in smb2_get_info_filesystem()
In reply to Greg Kroah-HartmanFrom: Namjae Jeon <[email protected]>
commit 3ac00a2ab69b34189942afa9e862d5170cdcb018 upstream.
If share is , share->path is NULL and it cause NULL pointer dereference issue.
--- fs/ksmbd/smb2pdu.c | 3 +++ 1 file changed, 3 insertions(+)
fs/ksmbd/smb2pdu.c +3 -0
@@ -4913,6 +4913,9 @@ static int smb2_get_info_filesystem(struint rc =0 , len;int fs_infoclass_size =0 ; +if (!share->path) +return -EIO ; + rc =kern_path (share->path,LOOKUP_NO_SYMLINKS , &path);if (rc) {pr_err ("cannot create vfs path\n" );
Greg Kroah-Hartman
maintainerPATCH 90/611 ksmbd: fix memleak in session setup
In reply to Greg Kroah-HartmanFrom: Namjae Jeon <[email protected]>
commit 6d7cb549c2ca20e1f07593f15e936fd54b763028 upstream.
If client send session setup request with unknown NTLMSSP message type, session that does not included channel can be created. It will cause session memleak. because ksmbd_sessions_deregister() does not destroy session if channel is not included. This patch return error response if client send the request unknown NTLMSSP message type.
--- fs/ksmbd/smb2pdu.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/ksmbd/smb2pdu.c +4 -0
@@ -1799,6 +1799,10 @@ int smb2_sess_setup(struct ksmbd_work *w }kfree (sess->Preauth_HashValue); sess->Preauth_HashValue =NULL ; + }else { +pr_info_ratelimited ("Unknown NTLMSSP message type : 0x%x\n" , +le32_to_cpu (negblob->MessageType)); + rc = -EINVAL ; } }else {/* TODO: need one more negotiation */
Greg Kroah-Hartman
maintainerPATCH 91/611 ksmbd: not allow guest user on multichannel
In reply to Greg Kroah-HartmanFrom: Namjae Jeon <[email protected]>
commit 3353ab2df5f68dab7da8d5ebb427a2d265a1f2b2 upstream.
This patch return STATUS_NOT_SUPPORTED if binding session is guest.
--- fs/ksmbd/smb2pdu.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
fs/ksmbd/smb2pdu.c +9 -2
@@ -1456,7 +1456,7 @@ static int ntlm_authenticate(struct ksmb* Reuse session if anonymous try to connect * on reauthetication. */ -if (ksmbd_anonymous_user (user)) { +if (conn->binding == false &&ksmbd_anonymous_user (user)) {ksmbd_free_user (user);return 0 ; }
@@ -1470,7 +1470,7 @@ static int ntlm_authenticate(struct ksmb sess->user = user; } -if (user_guest (sess->user)) { +if (conn->binding == false &&user_guest (sess->user)) { rsp->SessionFlags =SMB2_SESSION_FLAG_IS_GUEST_LE ; }else {struct authenticate_message *authblob;
@@ -1713,6 +1713,11 @@ int smb2_sess_setup(struct ksmbd_work *w goto out_err; } +if (user_guest (sess->user)) { + rc = -EOPNOTSUPP ; + goto out_err; + } + conn->binding = true; } else if ((conn->dialect < SMB30_PROT_ID || server_conf.flags & KSMBD_GLOBAL_FLAG_SMB3_MULTICHANNEL) &&
@@ -1825,6 +1830,8 @@ out_err: rsp->hdr.Status =STATUS_NETWORK_SESSION_EXPIRED ; else if (rc == -ENOMEM) rsp->hdr.Status = STATUS_INSUFFICIENT_RESOURCES; + else if (rc == -EOPNOTSUPP) + rsp->hdr.Status = STATUS_NOT_SUPPORTED; else if (rc) rsp->hdr.Status = STATUS_LOGON_FAILURE;
Greg Kroah-Hartman
maintainerPATCH 92/611 ksmbd: fix deadlock in ksmbd_find_crypto_ctx()
In reply to Greg Kroah-HartmanFrom: Namjae Jeon <[email protected]>
commit 7b4323373d844954bb76e0e9f39c4e5fc785fa7b upstream.
Deadlock is triggered by sending multiple concurrent session setup requests. It should be reused after releasing when getting ctx for crypto. Multiple consecutive ctx uses cause deadlock while waiting for releasing due to the limited number of ctx.
--- fs/ksmbd/auth.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
fs/ksmbd/auth.c +11 -8
@@ -221,22 +221,22 @@ int ksmbd_auth_ntlmv2(struct ksmbd_conn {char ntlmv2_hash[CIFS_ENCPWD_SIZE ];char ntlmv2_rsp[CIFS_HMAC_MD5_HASH_SIZE ]; -struct ksmbd_crypto_ctx *ctx; +struct ksmbd_crypto_ctx *ctx =NULL ;char *construct =NULL ;int rc, len; - ctx =ksmbd_crypto_ctx_find_hmacmd5 (); -if (!ctx) { -ksmbd_debug (AUTH ,"could not crypto alloc hmacmd5\n" ); -return -ENOMEM ; - } - rc =calc_ntlmv2_hash (conn, sess, ntlmv2_hash, domain_name);if (rc) {ksmbd_debug (AUTH ,"could not get v2 hash rc %d\n" , rc); goto out; } + ctx =ksmbd_crypto_ctx_find_hmacmd5 (); +if (!ctx) { +ksmbd_debug (AUTH ,"could not crypto alloc hmacmd5\n" ); +return -ENOMEM ; + } + rc =crypto_shash_setkey (CRYPTO_HMACMD5_TFM (ctx), ntlmv2_hash,CIFS_HMAC_MD5_HASH_SIZE );
@@ -272,6 +272,8 @@ int ksmbd_auth_ntlmv2(struct ksmbd_connksmbd_debug (AUTH ,"Could not generate md5 hash\n" ); goto out; } +ksmbd_release_crypto_ctx (ctx); + ctx =NULL ; rc =ksmbd_gen_sess_key (sess, ntlmv2_hash, ntlmv2_rsp);if (rc) {
@@ -282,7 +284,8 @@ int ksmbd_auth_ntlmv2(struct ksmbd_connif (memcmp (ntlmv2->ntlmv2_hash, ntlmv2_rsp,CIFS_HMAC_MD5_HASH_SIZE ) !=0 ) rc = -EINVAL ; out: -ksmbd_release_crypto_ctx (ctx); +if (ctx) +ksmbd_release_crypto_ctx (ctx);kfree (construct);return rc; }
Greg Kroah-Hartman
maintainerPATCH 93/611 ACPI: video: Remove acpi_backlight=video quirk for Lenovo ThinkPad W530
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
commit 3db66620ea90b0fd4134b31eabfec16d7b07d7e3 upstream.
Remove the acpi_backlight=video quirk for Lenovo ThinkPad W530.
This was intended to help users of the (unsupported) Nvidia binary driver, but this has been reported to cause backlight control issues for users who have the gfx configured in hybrid (dual-GPU) mode, so drop this.
The Nvidia binary driver should call acpi_video_register_backlight() when necessary and this has been reported to Nvidia.
Until this is fixed Nvidia binary driver users can work around this by passing "acpi_backlight=video" on the kernel commandline (with the latest 6.1.y or newer stable series, kernels < 6.1.y don't need this).
--- drivers/acpi/video_detect.c | 14 -------------- 1 file changed, 14 deletions(-)
drivers/acpi/video_detect.c +0 -14
@@ -298,20 +298,6 @@ static const struct dmi_system_id video_ },/* -* Older models with nvidia GPU which need acpi_video backlight -* control and where the old nvidia binary driver series does not -* call acpi_video_register_backlight(). -*/ - { - .callback = video_detect_force_video, - /* ThinkPad W530 */ - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad W530"), - }, - }, - - /** These models have a working acpi_video backlight control, and using * native backlight causes a regression where backlight does not work * when userspace is not handling brightness key events. Disable
Greg Kroah-Hartman
maintainerPATCH 94/611 i2c: omap: Fix standard mode false ACK readings
In reply to Greg Kroah-HartmanFrom: Reid Tonking <[email protected]>
commit c770657bd2611b077ec1e7b1fe6aa92f249399bd upstream.
Using standard mode, rare false ACK responses were appearing with i2cdetect tool. This was happening due to NACK interrupt triggering ISR thread before register access interrupt was ready. Removing the NACK interrupt's ability to trigger ISR thread lets register access ready interrupt do this instead.
--- drivers/i2c/busses/i2c-omap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-omap.c +1 -1
@@ -1058,7 +1058,7 @@ omap_i2c_isr(int irq, void *dev_id)u16 stat; stat =omap_i2c_read_reg (omap,OMAP_I2C_STAT_REG ); - mask =omap_i2c_read_reg (omap,OMAP_I2C_IE_REG ); + mask =omap_i2c_read_reg (omap,OMAP_I2C_IE_REG ) & ~OMAP_I2C_STAT_NACK ;if (stat & mask) ret =IRQ_WAKE_THREAD ;
Greg Kroah-Hartman
maintainerPATCH 95/611 riscv: mm: remove redundant parameter of create_fdt_early_page_table
In reply to Greg Kroah-HartmanFrom: Song Shuai <[email protected]>
commit e4ef93edd4e0b022529303db1915766ff9de450e upstream.
create_fdt_early_page_table() explicitly uses early_pg_dir for 32-bit fdt mapping and the pgdir parameter is redundant here. So remove it and its caller.
--- arch/riscv/mm/init.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
arch/riscv/mm/init.c +2 -4
@@ -842,8 +842,7 @@ static void __init create_kernel_page_ta* this means 2 PMD entries whereas for 32-bit kernel, this is only 1 PGDIR * entry. */ -static void __init create_fdt_early_page_table (pgd_t *pgdir, -uintptr_t fix_fdt_va, +static void __init create_fdt_early_page_table (uintptr_t fix_fdt_va,uintptr_t dtb_pa) {uintptr_t pa = dtb_pa & ~(PMD_SIZE -1 );
@@ -1033,8 +1032,7 @@ asmlinkage void __init setup_vm(uintptr_create_kernel_page_table (early_pg_dir, true);/* Setup early mapping for FDT early scan */ -create_fdt_early_page_table (early_pg_dir, -__fix_to_virt (FIX_FDT ), dtb_pa); +create_fdt_early_page_table (__fix_to_virt (FIX_FDT ), dtb_pa);/* * Bootime fixmap only can handle PMD_SIZE mapping. Thus, boot-ioremap
Greg Kroah-Hartman
maintainerPATCH 96/611 tracing: Fix permissions for the buffer_percent file
In reply to Greg Kroah-HartmanFrom: Ondrej Mosnacek <[email protected]>
commit 4f94559f40ad06d627c0fdfc3319cec778a2845b upstream.
This file defines both read and write operations, yet it is being created as read-only. This means that it can't be written to without the CAP_DAC_OVERRIDE capability. Fix the permissions to allow root to write to it without the need to override DAC perms.
--- kernel/trace/trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/trace.c +1 -1
@@ -9619,7 +9619,7 @@ init_tracer_tracefs(struct trace_array * tr->buffer_percent =50 ; -trace_create_file ("buffer_percent" ,TRACE_MODE_READ , d_tracer, +trace_create_file ("buffer_percent" ,TRACE_MODE_WRITE , d_tracer, tr, &buffer_percent_fops);create_trace_options_dir (tr);
Greg Kroah-Hartman
maintainerPATCH 97/611 swsmu/amdgpu_smu: Fix the wrong if-condition
In reply to Greg Kroah-HartmanFrom: Yu Songping <[email protected]>
commit 484d7dcc709da46a5976c9530eeff931e9ecba82 upstream.
The logical operator '&&' will make smu->ppt_funcs->set_gfx_power_up_by_imu segment fault when smu->ppt_funcs is NULL.
--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +1 -1
@@ -161,7 +161,7 @@ int smu_get_dpm_freq_range(struct smu_coint smu_set_gfx_power_up_by_imu (struct smu_context *smu) { -if (!smu->ppt_funcs && !smu->ppt_funcs->set_gfx_power_up_by_imu) +if (!smu->ppt_funcs || !smu->ppt_funcs->set_gfx_power_up_by_imu)return -EOPNOTSUPP ;return smu->ppt_funcs->set_gfx_power_up_by_imu (smu);
Greg Kroah-Hartman
maintainerPATCH 98/611 drm/amd/pm: re-enable the gfx imu when smu resume
In reply to Greg Kroah-HartmanFrom: Tim Huang <[email protected]>
commit f7f28f268b861c29dd18086bb636abedf0ff59ff upstream.
If the gfx imu is poweroff when suspend, then it need to be re-enabled when resume.
--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 40 +++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +28 -12
@@ -161,10 +161,15 @@ int smu_get_dpm_freq_range(struct smu_coint smu_set_gfx_power_up_by_imu (struct smu_context *smu) { -if (!smu->ppt_funcs || !smu->ppt_funcs->set_gfx_power_up_by_imu) -return -EOPNOTSUPP ; +int ret =0 ; +struct amdgpu_device *adev = smu->adev; -return smu->ppt_funcs->set_gfx_power_up_by_imu (smu); +if (smu->ppt_funcs->set_gfx_power_up_by_imu) { + ret = smu->ppt_funcs->set_gfx_power_up_by_imu (smu); +if (ret) +dev_err (adev->dev,"Failed to enable gfx imu!\n" ); + } +return ret; }static u32 smu_get_mclk (void *handle,bool low)
@@ -195,6 +200,19 @@ static u32 smu_get_sclk(void *handle, boreturn clk_freq *100 ; } +static int smu_set_gfx_imu_enable (struct smu_context *smu) +{ +struct amdgpu_device *adev = smu->adev; + +if (adev->firmware.load_type !=AMDGPU_FW_LOAD_PSP ) +return 0 ; + +if (amdgpu_in_reset (smu->adev) || adev->in_s0ix) +return 0 ; + +return smu_set_gfx_power_up_by_imu (smu); +} +static int smu_dpm_set_vcn_enable (struct smu_context *smu,bool enable) {
@@ -1386,15 +1404,9 @@ static int smu_hw_init(void *handle) }if (smu->is_apu) { -if ((smu->ppt_funcs->set_gfx_power_up_by_imu) && -likely (adev->firmware.load_type ==AMDGPU_FW_LOAD_PSP )) { - ret = smu->ppt_funcs->set_gfx_power_up_by_imu (smu); -if (ret) { -dev_err (adev->dev,"Failed to Enable gfx imu!\n" ); -return ret; - } - } - + ret =smu_set_gfx_imu_enable (smu); +if (ret) +return ret;smu_dpm_set_vcn_enable (smu, true);smu_dpm_set_jpeg_enable (smu, true);smu_set_gfx_cgpg (smu, true);
@@ -1670,6 +1682,10 @@ static int smu_resume(void *handle)return ret; } + ret =smu_set_gfx_imu_enable (smu); +if (ret) +return ret; +smu_set_gfx_cgpg (smu, true); smu->disable_uclk_switch =0 ;
Greg Kroah-Hartman
maintainerPATCH 72/611 crypto: ccp - Dont initialize CCP for PSP 0x1649
In reply to Greg Kroah-HartmanFrom: Mario Limonciello <[email protected]>
commit c79a3169b9f3633c215b55857eba5921e5b49217 upstream.
A number of platforms are emitting the error:
```ccp: unable to access the device: you might be running a broken BIOS.```
This is expected behavior as CCP is no longer accessible from the PSP's PCIe BAR so stop trying to probe CCP for 0x1649.
--- drivers/crypto/ccp/sp-pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/ccp/sp-pci.c +1 -1
@@ -451,9 +451,9 @@ static const struct pci_device_id sp_pci { PCI_VDEVICE(AMD, 0x1468), (kernel_ulong_t)&dev_vdata[2] }, { PCI_VDEVICE(AMD, 0x1486), (kernel_ulong_t)&dev_vdata[3] }, { PCI_VDEVICE(AMD, 0x15DF), (kernel_ulong_t)&dev_vdata[4] }, - { PCI_VDEVICE(AMD, 0x1649), (kernel_ulong_t)&dev_vdata[4] }, { PCI_VDEVICE(AMD, 0x14CA), (kernel_ulong_t)&dev_vdata[5] }, { PCI_VDEVICE(AMD, 0x15C7), (kernel_ulong_t)&dev_vdata[6] }, + { PCI_VDEVICE(AMD, 0x1649), (kernel_ulong_t)&dev_vdata[6] },/* Last entry must be zero */ { 0, } };
Greg Kroah-Hartman
maintainerPATCH 99/611 iommu/amd: Fix "Guest Virtual APIC Table Root Pointer" configuration in IRTE
In reply to Greg Kroah-HartmanFrom: Kishon Vijay Abraham I <[email protected]>
commit ccc62b827775915a9b82db42a29813d04f92df7a upstream.
commit b9c6ff94e43a ("iommu/amd: Re-factor guest virtual APIC (de-)activation code") while refactoring guest virtual APIC activation/de-activation code, stored information for activate/de-activate in "struct amd_ir_data". It used 32-bit integer data type for storing the "Guest Virtual APIC Table Root Pointer" (ga_root_ptr), though the "ga_root_ptr" is actually a 40-bit field in IRTE (Interrupt Remapping Table Entry).
This causes interrupts from PCIe devices to not reach the guest in the case of PCIe passthrough with SME (Secure Memory Encryption) enabled as _SME_ bit in the "ga_root_ptr" is lost before writing it to the IRTE.
Fix it by using 64-bit data type for storing the "ga_root_ptr". While at that also change the data type of "ga_tag" to u32 in order to match the IOMMU spec.
--- drivers/iommu/amd/amd_iommu_types.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iommu/amd/amd_iommu_types.h +2 -2
@@ -1002,8 +1002,8 @@ struct amd_ir_data {*/ struct irq_cfg *cfg;int ga_vector; -int ga_root_ptr; -int ga_tag; +u64 ga_root_ptr; +u32 ga_tag; };struct amd_irte_ops {
Greg Kroah-Hartman
maintainerPATCH 100/611 RISC-V: Align SBI probe implementation with spec
In reply to Greg Kroah-HartmanFrom: Andrew Jones <[email protected]>
commit 41cad8284d5e6bf1d49d3c10a6b52ee1ae866a20 upstream.
sbi_probe_extension() is specified with "Returns 0 if the given SBI extension ID (EID) is not available, or 1 if it is available unless defined as any other non-zero value by the implementation." Additionally, sbiret.value is a long. Fix the implementation to ensure any nonzero long value is considered a success, rather than only positive int values.
--- arch/riscv/include/asm/sbi.h | 2 +- arch/riscv/kernel/cpu_ops.c | 2 +- arch/riscv/kernel/sbi.c | 17 ++++++++--------- arch/riscv/kvm/main.c | 2 +- drivers/cpuidle/cpuidle-riscv-sbi.c | 2 +- drivers/perf/riscv_pmu_sbi.c | 2 +- 6 files changed, 13 insertions(+), 14 deletions(-)
arch/riscv/include/asm/sbi.h +1 -1
@@ -293,7 +293,7 @@ int sbi_remote_hfence_vvma_asid(const stunsigned long start, unsigned long size, unsigned long asid); -int sbi_probe_extension (int ext); +long sbi_probe_extension (int ext);/* Check if current SBI specification version is 0.1 or not */ static inline int sbi_spec_is_0_1 (void )
arch/riscv/kernel/cpu_ops.c +1 -1
@@ -27,7 +27,7 @@ const struct cpu_operations cpu_ops_spinvoid __init cpu_set_ops (int cpuid) {#if IS_ENABLED (CONFIG_RISCV_SBI ) -if (sbi_probe_extension (SBI_EXT_HSM ) >0 ) { +if (sbi_probe_extension (SBI_EXT_HSM )) {if (!cpuid)pr_info ("SBI HSM extension detected\n" ); cpu_ops[cpuid] = &cpu_ops_sbi;
arch/riscv/kernel/sbi.c +8 -9
@@ -581,19 +581,18 @@ static void sbi_srst_power_off(void)* sbi_probe_extension() - Check if an SBI extension ID is supported or not. * @extid: The extension ID to be probed. * -* Return: Extension specific nonzero value f yes, -ENOTSUPP otherwise. +* Return: 1 or an extension specific nonzero value if yes, 0 otherwise. */ -int sbi_probe_extension (int extid) +long sbi_probe_extension (int extid) {struct sbiret ret; ret =sbi_ecall (SBI_EXT_BASE ,SBI_EXT_BASE_PROBE_EXT , extid,0 ,0 ,0 ,0 ,0 );if (!ret.error) -if (ret.value) -return ret.value; +return ret.value; -return -ENOTSUPP ; +return 0 ; }EXPORT_SYMBOL (sbi_probe_extension);
@@ -662,26 +661,26 @@ void __init sbi_init(void)if (!sbi_spec_is_0_1 ()) {pr_info ("SBI implementation ID=0x%lx Version=0x%lx\n" ,sbi_get_firmware_id (),sbi_get_firmware_version ()); -if (sbi_probe_extension (SBI_EXT_TIME ) >0 ) { +if (sbi_probe_extension (SBI_EXT_TIME )) { __sbi_set_timer = __sbi_set_timer_v02;pr_info ("SBI TIME extension detected\n" ); }else { __sbi_set_timer = __sbi_set_timer_v01; } -if (sbi_probe_extension (SBI_EXT_IPI ) >0 ) { +if (sbi_probe_extension (SBI_EXT_IPI )) { __sbi_send_ipi = __sbi_send_ipi_v02;pr_info ("SBI IPI extension detected\n" ); }else { __sbi_send_ipi = __sbi_send_ipi_v01; } -if (sbi_probe_extension (SBI_EXT_RFENCE ) >0 ) { +if (sbi_probe_extension (SBI_EXT_RFENCE )) { __sbi_rfence = __sbi_rfence_v02;pr_info ("SBI RFENCE extension detected\n" ); }else { __sbi_rfence = __sbi_rfence_v01; }if ((sbi_spec_version >=sbi_mk_version (0 ,3 )) && - (sbi_probe_extension (SBI_EXT_SRST ) >0 )) { +sbi_probe_extension (SBI_EXT_SRST )) {pr_info ("SBI SRST extension detected\n" ); pm_power_off = sbi_srst_power_off; sbi_srst_reboot_nb.notifier_call = sbi_srst_reboot;
arch/riscv/kvm/main.c +1 -1
@@ -84,7 +84,7 @@ int kvm_arch_init(void *opaque)return -ENODEV ; } -if (sbi_probe_extension (SBI_EXT_RFENCE ) <=0 ) { +if (!sbi_probe_extension (SBI_EXT_RFENCE )) {kvm_info ("require SBI RFENCE extension\n" );return -ENODEV ; }
drivers/cpuidle/cpuidle-riscv-sbi.c +1 -1
@@ -612,7 +612,7 @@ static int __init sbi_cpuidle_init(void)* 2) SBI HSM extension is available */ if ((sbi_spec_version <sbi_mk_version (0 ,3 )) || -sbi_probe_extension (SBI_EXT_HSM ) <=0 ) { + !sbi_probe_extension (SBI_EXT_HSM )) {pr_info ("HSM suspend not available\n" );return 0 ; }
drivers/perf/riscv_pmu_sbi.c +1 -1
@@ -869,7 +869,7 @@ static int __init pmu_sbi_devinit(void)struct platform_device *pdev;if (sbi_spec_version <sbi_mk_version (0 ,3 ) || -sbi_probe_extension (SBI_EXT_PMU ) <=0 ) { + !sbi_probe_extension (SBI_EXT_PMU )) {return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 101/611 Revert "ubifs: dirty_cow_znode: Fix memleak in error handling path"
In reply to Greg Kroah-HartmanFrom: Zhihao Cheng <[email protected]>
commit 7d01cb27f6aebc54efbe28d8961a973b8f795b13 upstream.
This reverts commit 122deabfe1428 (ubifs: dirty_cow_znode: Fix memleak in error handling path).
After commit 122deabfe1428 applied, if insert_old_idx() failed, old index neither exists in TNC nor in old-index tree. Which means that old index node could be overwritten in layout_leb_in_gaps(), then ubifs image will be corrupted in power-cut.
--- fs/ubifs/tnc.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
fs/ubifs/tnc.c +1 -8
@@ -267,18 +267,11 @@ static struct ubifs_znode *dirty_cow_znoif (zbr->len) { err =insert_old_idx (c, zbr->lnum, zbr->offs);if (unlikely (err)) -/* -* Obsolete znodes will be freed by tnc_destroy_cnext() -* or free_obsolete_znodes(), copied up znodes should -* be added back to tnc and freed by -* ubifs_destroy_tnc_subtree(). -*/ - goto out; +return ERR_PTR (err); err =add_idx_dirt (c, zbr->lnum, zbr->len); }else err =0 ; -out: zbr->znode = zn; zbr->lnum =0 ; zbr->offs =0 ;
Greg Kroah-Hartman
maintainerPATCH 102/611 ubifs: Fix memleak when insert_old_idx() failed
In reply to Greg Kroah-HartmanFrom: Zhihao Cheng <[email protected]>
commit b5fda08ef213352ac2df7447611eb4d383cce929 upstream.
Following process will cause a memleak for copied up znode:
dirty_cow_znode
zn = copy_znode(c, znode);
err = insert_old_idx(c, zbr->lnum, zbr->offs);
if (unlikely(err))
return ERR_PTR(err); // No one refers to zn.
Fetch a reproducer in [Link].
Function copy_znode() is split into 2 parts: resource allocation and znode replacement, insert_old_idx() is split in similar way, so resource cleanup could be done in error handling path without corrupting metadata(mem & disk).
It's okay that old index inserting is put behind of add_idx_dirt(), old index is used in layout_leb_in_gaps(), so the two processes do not depend on each other.
--- fs/ubifs/tnc.c | 137 ++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 87 insertions(+), 50 deletions(-)
fs/ubifs/tnc.c +87 -50
@@ -44,6 +44,33 @@ enum { NOT_ON_MEDIA = 3, }; +static void do_insert_old_idx (struct ubifs_info *c, +struct ubifs_old_idx *old_idx) +{ +struct ubifs_old_idx *o; +struct rb_node **p, *parent =NULL ; + + p = &c->old_idx.rb_node; +while (*p) { + parent = *p; + o = rb_entry(parent, struct ubifs_old_idx, rb); +if (old_idx->lnum < o->lnum) + p = &(*p)->rb_left; +else if (old_idx->lnum > o->lnum) + p = &(*p)->rb_right; +else if (old_idx->offs < o->offs) + p = &(*p)->rb_left; +else if (old_idx->offs > o->offs) + p = &(*p)->rb_right; +else { +ubifs_err (c,"old idx added twice!" ); +kfree (old_idx); + } + } +rb_link_node (&old_idx->rb, parent, p); +rb_insert_color (&old_idx->rb, &c->old_idx); +} +/** * insert_old_idx - record an index node obsoleted since the last commit start. * @c: UBIFS file-system description object
@@ -69,35 +96,15 @@ enum {*/ static int insert_old_idx (struct ubifs_info *c,int lnum,int offs) { -struct ubifs_old_idx *old_idx, *o; -struct rb_node **p, *parent =NULL ; +struct ubifs_old_idx *old_idx; old_idx =kmalloc (sizeof (struct ubifs_old_idx ),GFP_NOFS );if (unlikely (!old_idx))return -ENOMEM ; old_idx->lnum = lnum; old_idx->offs = offs; +do_insert_old_idx (c, old_idx); - p = &c->old_idx.rb_node; -while (*p) { - parent = *p; - o = rb_entry(parent, struct ubifs_old_idx, rb); -if (lnum < o->lnum) - p = &(*p)->rb_left; -else if (lnum > o->lnum) - p = &(*p)->rb_right; -else if (offs < o->offs) - p = &(*p)->rb_left; -else if (offs > o->offs) - p = &(*p)->rb_right; -else { -ubifs_err (c,"old idx added twice!" ); -kfree (old_idx); -return 0 ; - } - } -rb_link_node (&old_idx->rb, parent, p); -rb_insert_color (&old_idx->rb, &c->old_idx);return 0 ; }
@@ -199,23 +206,6 @@ static struct ubifs_znode *copy_znode(st__set_bit (DIRTY_ZNODE , &zn->flags);__clear_bit (COW_ZNODE , &zn->flags); -ubifs_assert (c, !ubifs_zn_obsolete (znode)); -__set_bit (OBSOLETE_ZNODE , &znode->flags); - -if (znode->level !=0 ) { -int i; -const int n = zn->child_cnt; - -/* The children now have new parent */ -for (i =0 ; i < n; i++) { -struct ubifs_zbranch *zbr = &zn->zbranch[i]; - -if (zbr->znode) - zbr->znode->parent = zn; - } - } - -atomic_long_inc (&c->dirty_zn_cnt);return zn; }
@@ -234,6 +224,42 @@ static int add_idx_dirt(struct ubifs_inf }/** +* replace_znode - replace old znode with new znode. +* @c: UBIFS file-system description object +* @new_zn: new znode +* @old_zn: old znode +* @zbr: the branch of parent znode +* +* Replace old znode with new znode in TNC. +*/ +static void replace_znode (struct ubifs_info *c,struct ubifs_znode *new_zn, +struct ubifs_znode *old_zn,struct ubifs_zbranch *zbr) +{ +ubifs_assert (c, !ubifs_zn_obsolete (old_zn)); +__set_bit (OBSOLETE_ZNODE , &old_zn->flags); + +if (old_zn->level !=0 ) { +int i; +const int n = new_zn->child_cnt; + +/* The children now have new parent */ +for (i =0 ; i < n; i++) { +struct ubifs_zbranch *child = &new_zn->zbranch[i]; + +if (child->znode) + child->znode->parent = new_zn; + } + } + + zbr->znode = new_zn; + zbr->lnum =0 ; + zbr->offs =0 ; + zbr->len =0 ; + +atomic_long_inc (&c->dirty_zn_cnt); +} + +/** * dirty_cow_znode - ensure a znode is not being committed. * @c: UBIFS file-system description object * @zbr: branch of znode to check
@@ -265,21 +291,32 @@ static struct ubifs_znode *dirty_cow_znoreturn zn;if (zbr->len) { - err =insert_old_idx (c, zbr->lnum, zbr->offs); -if (unlikely (err)) -return ERR_PTR (err); +struct ubifs_old_idx *old_idx; + + old_idx =kmalloc (sizeof (struct ubifs_old_idx ),GFP_NOFS ); +if (unlikely (!old_idx)) { + err = -ENOMEM ; + goto out; + } + old_idx->lnum = zbr->lnum; + old_idx->offs = zbr->offs; + err =add_idx_dirt (c, zbr->lnum, zbr->len); - }else - err =0 ; +if (err) { +kfree (old_idx); + goto out; + } - zbr->znode = zn; - zbr->lnum =0 ; - zbr->offs =0 ; - zbr->len =0 ; +do_insert_old_idx (c, old_idx); + } + +replace_znode (c, zn, znode, zbr); -if (unlikely (err)) -return ERR_PTR (err);return zn; + +out: +kfree (zn); +return ERR_PTR (err); }/**
Greg Kroah-Hartman
maintainerPATCH 73/611 rcu: Avoid stack overflow due to __rcu_irq_enter_check_tick() being kprobe-ed
In reply to Greg Kroah-HartmanFrom: Zheng Yejian <[email protected]>
commit 7a29fb4a4771124bc61de397dbfc1554dbbcc19c upstream.
Registering a kprobe on __rcu_irq_enter_check_tick() can cause kernel stack overflow as shown below. This issue can be reproduced by enabling CONFIG_NO_HZ_FULL and booting the kernel with argument "nohz_full=", and then giving the following commands at the shell prompt:
# cd /sys/kernel/tracing/ # echo 'p:mp1 __rcu_irq_enter_check_tick' >> kprobe_events # echo 1 > events/kprobes/enable
This commit therefore adds __rcu_irq_enter_check_tick() to the kprobes blacklist using NOKPROBE_SYMBOL().
Insufficient stack space to handle exception!
ESR: 0x00000000f2000004 -- BRK (AArch64) FAR: 0x0000ffffccf3e510 Task stack: [0xffff80000ad30000..0xffff80000ad38000] IRQ stack: [0xffff800008050000..0xffff800008058000] Overflow stack: [0xffff089c36f9f310..0xffff089c36fa0310] CPU: 5 PID: 190 Comm: bash Not tainted 6.2.0-rc2-00320-g1f5abbd77e2c #19 Hardware name: linux,dummy-virt (DT) pstate: 400003c5 (nZcv DAIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : __rcu_irq_enter_check_tick+0x0/0x1b8 lr : ct_nmi_enter+0x11c/0x138
sp : ffff80000ad30080
x29: ffff80000ad30080 x28: ffff089c82e20000 x27: 0000000000000000
x26: 0000000000000000 x25: ffff089c02a8d100 x24: 0000000000000000
x23: 00000000400003c5 x22: 0000ffffccf3e510 x21: ffff089c36fae148
x20: ffff80000ad30120 x19: ffffa8da8fcce148 x18: 0000000000000000
x17: 0000000000000000 x16: 0000000000000000 x15: ffffa8da8e44ea6c
x14: ffffa8da8e44e968 x13: ffffa8da8e03136c x12: 1fffe113804d6809
x11: ffff6113804d6809 x10: 0000000000000a60 x9 : dfff800000000000 x8 : ffff089c026b404f x7 : 00009eec7fb297f7 x6 : 0000000000000001 x5 : ffff80000ad30120 x4 : dfff800000000000 x3 : ffffa8da8e3016f4 x2 : 0000000000000003 x1 : 0000000000000000 x0 : 0000000000000000
Kernel panic - not syncing: kernel stack overflow CPU: 5 PID: 190 Comm: bash Not tainted 6.2.0-rc2-00320-g1f5abbd77e2c #19 Hardware name: linux,dummy-virt (DT) Call trace: dump_backtrace+0xf8/0x108 show_stack+0x20/0x30 dump_stack_lvl+0x68/0x84 dump_stack+0x1c/0x38 panic+0x214/0x404 add_taint+0x0/0xf8 panic_bad_stack+0x144/0x160 handle_bad_stack+0x38/0x58 __bad_stack+0x78/0x7c __rcu_irq_enter_check_tick+0x0/0x1b8 arm64_enter_el1_dbg.isra.0+0x14/0x20 el1_dbg+0x2c/0x90 el1h_64_sync_handler+0xcc/0xe8 el1h_64_sync+0x64/0x68 __rcu_irq_enter_check_tick+0x0/0x1b8 arm64_enter_el1_dbg.isra.0+0x14/0x20 el1_dbg+0x2c/0x90 el1h_64_sync_handler+0xcc/0xe8 el1h_64_sync+0x64/0x68 __rcu_irq_enter_check_tick+0x0/0x1b8 arm64_enter_el1_dbg.isra.0+0x14/0x20 el1_dbg+0x2c/0x90 el1h_64_sync_handler+0xcc/0xe8 el1h_64_sync+0x64/0x68 __rcu_irq_enter_check_tick+0x0/0x1b8 [...] el1_dbg+0x2c/0x90 el1h_64_sync_handler+0xcc/0xe8 el1h_64_sync+0x64/0x68 __rcu_irq_enter_check_tick+0x0/0x1b8 arm64_enter_el1_dbg.isra.0+0x14/0x20 el1_dbg+0x2c/0x90 el1h_64_sync_handler+0xcc/0xe8 el1h_64_sync+0x64/0x68 __rcu_irq_enter_check_tick+0x0/0x1b8 arm64_enter_el1_dbg.isra.0+0x14/0x20 el1_dbg+0x2c/0x90 el1h_64_sync_handler+0xcc/0xe8 el1h_64_sync+0x64/0x68 __rcu_irq_enter_check_tick+0x0/0x1b8 el1_interrupt+0x28/0x60 el1h_64_irq_handler+0x18/0x28 el1h_64_irq+0x64/0x68 __ftrace_set_clr_event_nolock+0x98/0x198 __ftrace_set_clr_event+0x58/0x80 system_enable_write+0x144/0x178 vfs_write+0x174/0x738 ksys_write+0xd0/0x188 __arm64_sys_write+0x4c/0x60 invoke_syscall+0x64/0x180 el0_svc_common.constprop.0+0x84/0x160 do_el0_svc+0x48/0xe8 el0_svc+0x34/0xd0 el0t_64_sync_handler+0xb8/0xc0 el0t_64_sync+0x190/0x194
SMP: stopping secondary CPUs
Kernel Offset: 0x28da86000000 from 0xffff800008000000PHYS_OFFSET: 0xfffff76600000000
CPU features: 0x00000,01a00100,0000421b Memory Limit: none
--- kernel/rcu/tree.c | 1 + 1 file changed, 1 insertion(+)
kernel/rcu/tree.c +1 -0
@@ -665,6 +665,7 @@ void __rcu_irq_enter_check_tick(void) }raw_spin_unlock_rcu_node (rdp->mynode); } +NOKPROBE_SYMBOL (__rcu_irq_enter_check_tick);#endif /* CONFIG_NO_HZ_FULL */ /*
Greg Kroah-Hartman
maintainerPATCH 74/611 reiserfs: Add security prefix to xattr name in reiserfs_security_write()
In reply to Greg Kroah-HartmanFrom: Roberto Sassu <[email protected]>
commit d82dcd9e21b77d338dc4875f3d4111f0db314a7c upstream.
Reiserfs sets a security xattr at inode creation time in two stages: first, it calls reiserfs_security_init() to obtain the xattr from active LSMs; then, it calls reiserfs_security_write() to actually write that xattr.
Unfortunately, it seems there is a wrong expectation that LSMs provide the full xattr name in the form 'security.<suffix>'. However, LSMs always provided just the suffix, causing reiserfs to not write the xattr at all (if the suffix is shorter than the prefix), or to write an xattr with the wrong name.
Add a temporary buffer in reiserfs_security_write(), and write to it the full xattr name, before passing it to reiserfs_xattr_set_handle().
Also replace the name length check with a check that the full xattr name is not larger than XATTR_NAME_MAX.
--- fs/reiserfs/xattr_security.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
fs/reiserfs/xattr_security.c +6 -2
@@ -82,11 +82,15 @@ int reiserfs_security_write(struct reisestruct inode *inode, struct reiserfs_security_handle *sec) { + char xattr_name[XATTR_NAME_MAX + 1] = XATTR_SECURITY_PREFIX;int error; -if (strlen (sec->name) <sizeof (XATTR_SECURITY_PREFIX )) + +if (XATTR_SECURITY_PREFIX_LEN +strlen (sec->name) >XATTR_NAME_MAX )return -EINVAL ; - error =reiserfs_xattr_set_handle (th, inode, sec->name, sec->value, +strlcat (xattr_name, sec->name,sizeof (xattr_name)); + + error =reiserfs_xattr_set_handle (th, inode, xattr_name, sec->value, sec->length,XATTR_CREATE );if (error == -ENODATA || error == -EOPNOTSUPP ) error =0 ;
Greg Kroah-Hartman
maintainerPATCH 75/611 KVM: nVMX: Emulate NOPs in L2, and PAUSE if its not intercepted
In reply to Greg Kroah-HartmanFrom: Sean Christopherson <[email protected]>
commit 4984563823f0034d3533854c1b50e729f5191089 upstream.
Extend VMX's nested intercept logic for emulated instructions to handle "pause" interception, in quotes because KVM's emulator doesn't filter out NOPs when checking for nested intercepts. Failure to allow emulation of NOPs results in KVM injecting a #UD into L2 on any NOP that collides with the emulator's definition of PAUSE, i.e. on all single-byte NOPs.
For PAUSE itself, honor L1's PAUSE-exiting control, but ignore PLE to avoid unnecessarily injecting a #UD into L2. Per the SDM, the first execution of PAUSE after VM-Entry is treated as the beginning of a new loop, i.e. will never trigger a PLE VM-Exit, and so L1 can't expect any given execution of PAUSE to deterministically exit.
... the processor considers this execution to be the first execution of PAUSE in a loop. (It also does so for the first execution of PAUSE at CPL 0 after VM entry.)
All that said, the PLE side of things is currently a moot point, as KVM doesn't expose PLE to L1.
Note, vmx_check_intercept() is still wildly broken when L1 wants to intercept an instruction, as KVM injects a #UD instead of synthesizing a nested VM-Exit. That issue extends far beyond NOP/PAUSE and needs far more effort to fix, i.e. is a problem for the future.
--- arch/x86/kvm/vmx/vmx.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
arch/x86/kvm/vmx/vmx.c +15 -0
@@ -7830,6 +7830,21 @@ static int vmx_check_intercept(struct kv/* FIXME: produce nested vmexit and return X86EMUL_INTERCEPTED. */ break ; +case x86_intercept_pause: +/* +* PAUSE is a single-byte NOP with a REPE prefix, i.e. collides +* with vanilla NOPs in the emulator. Apply the interception +* check only to actual PAUSE instructions. Don't check +* PAUSE-loop-exiting, software can't expect a given PAUSE to +* exit, i.e. KVM is within its rights to allow L2 to execute +* the PAUSE. +*/ +if ((info->rep_prefix !=REPE_PREFIX ) || + !nested_cpu_has2 (vmcs12,CPU_BASED_PAUSE_EXITING )) +return X86EMUL_CONTINUE ; + +break ; +/* TODO: check more intercepts... */ default :break ;
Greg Kroah-Hartman
maintainerPATCH 76/611 KVM: arm64: Avoid vcpu->mutex v. kvm->lock inversion in CPU_ON
In reply to Greg Kroah-HartmanFrom: Oliver Upton <[email protected]>
commit 0acc7239c20a8401b8968c2adace8f7c9b0295ae upstream.
KVM/arm64 had the lock ordering backwards on vcpu->mutex and kvm->lock from the very beginning. One such example is the way vCPU resets are
handled: the kvm->lock is acquired while handling a guest CPU_ON PSCI call.
Add a dedicated lock to serialize writes to kvm_vcpu_arch::{mp_state, reset_state}. Promote all accessors of mp_state to {READ,WRITE}_ONCE() as readers do not acquire the mp_state_lock. While at it, plug yet another race by taking the mp_state_lock in the KVM_SET_MP_STATE ioctl handler.
As changes to MP state are now guarded with a dedicated lock, drop the kvm->lock acquisition from the PSCI CPU_ON path. Similarly, move the reader of reset_state outside of the kvm->lock and instead protect it with the mp_state_lock. Note that writes to reset_state::reset have been demoted to regular stores as both readers and writers acquire the mp_state_lock.
While the kvm->lock inversion still exists in kvm_reset_vcpu(), at least now PSCI CPU_ON no longer depends on it for serializing vCPU reset.
--- arch/arm64/include/asm/kvm_host.h | 1 + arch/arm64/kvm/arm.c | 31 ++++++++++++++++++++++--------- arch/arm64/kvm/psci.c | 28 ++++++++++++++++------------ arch/arm64/kvm/reset.c | 9 +++++---- 4 files changed, 44 insertions(+), 25 deletions(-)
arch/arm64/include/asm/kvm_host.h +1 -0
@@ -398,6 +398,7 @@ struct kvm_vcpu_arch {/* vcpu power state */ struct kvm_mp_state mp_state; +spinlock_t mp_state_lock;/* Cache some mmu pages needed inside spinlock regions */ struct kvm_mmu_memory_cache mmu_page_cache;
arch/arm64/kvm/arm.c +22 -9
@@ -324,6 +324,8 @@ int kvm_arch_vcpu_create(struct kvm_vcpu {int err; +spin_lock_init (&vcpu->arch.mp_state_lock); +/* Force users to call KVM_ARM_VCPU_INIT */ vcpu->arch.target =-1 ;bitmap_zero (vcpu->arch.features,KVM_VCPU_MAX_FEATURES );
@@ -441,34 +443,41 @@ void kvm_arch_vcpu_put(struct kvm_vcpu * vcpu->cpu =-1 ; } -void kvm_arm_vcpu_power_off (struct kvm_vcpu *vcpu) +static void __kvm_arm_vcpu_power_off (struct kvm_vcpu *vcpu) { - vcpu->arch.mp_state.mp_state =KVM_MP_STATE_STOPPED ; +WRITE_ONCE (vcpu->arch.mp_state.mp_state,KVM_MP_STATE_STOPPED );kvm_make_request (KVM_REQ_SLEEP , vcpu);kvm_vcpu_kick (vcpu); } +void kvm_arm_vcpu_power_off (struct kvm_vcpu *vcpu) +{ +spin_lock (&vcpu->arch.mp_state_lock); +__kvm_arm_vcpu_power_off (vcpu); +spin_unlock (&vcpu->arch.mp_state_lock); +} +bool kvm_arm_vcpu_stopped (struct kvm_vcpu *vcpu) { -return vcpu->arch.mp_state.mp_state ==KVM_MP_STATE_STOPPED ; +return READ_ONCE (vcpu->arch.mp_state.mp_state) ==KVM_MP_STATE_STOPPED ; }static void kvm_arm_vcpu_suspend (struct kvm_vcpu *vcpu) { - vcpu->arch.mp_state.mp_state =KVM_MP_STATE_SUSPENDED ; +WRITE_ONCE (vcpu->arch.mp_state.mp_state,KVM_MP_STATE_SUSPENDED );kvm_make_request (KVM_REQ_SUSPEND , vcpu);kvm_vcpu_kick (vcpu); }static bool kvm_arm_vcpu_suspended (struct kvm_vcpu *vcpu) { -return vcpu->arch.mp_state.mp_state ==KVM_MP_STATE_SUSPENDED ; +return READ_ONCE (vcpu->arch.mp_state.mp_state) ==KVM_MP_STATE_SUSPENDED ; }int kvm_arch_vcpu_ioctl_get_mpstate (struct kvm_vcpu *vcpu,struct kvm_mp_state *mp_state) { - *mp_state = vcpu->arch.mp_state; + *mp_state =READ_ONCE (vcpu->arch.mp_state);return 0 ; }
@@ -478,12 +487,14 @@ int kvm_arch_vcpu_ioctl_set_mpstate(stru {int ret =0 ; +spin_lock (&vcpu->arch.mp_state_lock); +switch (mp_state->mp_state) {case KVM_MP_STATE_RUNNABLE : - vcpu->arch.mp_state = *mp_state; +WRITE_ONCE (vcpu->arch.mp_state, *mp_state);break ;case KVM_MP_STATE_STOPPED : -kvm_arm_vcpu_power_off (vcpu); +__kvm_arm_vcpu_power_off (vcpu);break ;case KVM_MP_STATE_SUSPENDED :kvm_arm_vcpu_suspend (vcpu);
@@ -492,6 +503,8 @@ int kvm_arch_vcpu_ioctl_set_mpstate(stru ret = -EINVAL ; } +spin_unlock (&vcpu->arch.mp_state_lock); +return ret; }
@@ -1202,7 +1215,7 @@ static int kvm_arch_vcpu_ioctl_vcpu_initif (test_bit (KVM_ARM_VCPU_POWER_OFF , vcpu->arch.features))kvm_arm_vcpu_power_off (vcpu);else - vcpu->arch.mp_state.mp_state =KVM_MP_STATE_RUNNABLE ; +WRITE_ONCE (vcpu->arch.mp_state.mp_state,KVM_MP_STATE_RUNNABLE );return 0 ; }
arch/arm64/kvm/psci.c +16 -12
@@ -62,6 +62,7 @@ static unsigned long kvm_psci_vcpu_on(ststruct vcpu_reset_state *reset_state;struct kvm *kvm = source_vcpu->kvm;struct kvm_vcpu *vcpu =NULL ; +int ret =PSCI_RET_SUCCESS ;unsigned long cpu_id; cpu_id =smccc_get_arg1 (source_vcpu);
@@ -76,11 +77,15 @@ static unsigned long kvm_psci_vcpu_on(st*/ if (!vcpu)return PSCI_RET_INVALID_PARAMS ; + +spin_lock (&vcpu->arch.mp_state_lock);if (!kvm_arm_vcpu_stopped (vcpu)) {if (kvm_psci_version (source_vcpu) !=KVM_ARM_PSCI_0_1 ) -return PSCI_RET_ALREADY_ON ; + ret =PSCI_RET_ALREADY_ON ;else -return PSCI_RET_INVALID_PARAMS ; + ret =PSCI_RET_INVALID_PARAMS ; + + goto out_unlock; } reset_state = &vcpu->arch.reset_state;
@@ -96,7 +101,7 @@ static unsigned long kvm_psci_vcpu_on(st*/ reset_state->r0 =smccc_get_arg3 (source_vcpu); -WRITE_ONCE (reset_state->reset, true); + reset_state->reset = true;kvm_make_request (KVM_REQ_VCPU_RESET , vcpu);/*
@@ -108,7 +113,9 @@ static unsigned long kvm_psci_vcpu_on(st vcpu->arch.mp_state.mp_state =KVM_MP_STATE_RUNNABLE ;kvm_vcpu_wake_up (vcpu); -return PSCI_RET_SUCCESS ; +out_unlock: +spin_unlock (&vcpu->arch.mp_state_lock); +return ret; }static unsigned long kvm_psci_vcpu_affinity_info (struct kvm_vcpu *vcpu)
@@ -168,8 +175,11 @@ static void kvm_prepare_system_event(str* after this call is handled and before the VCPUs have been * re-initialized. */ -kvm_for_each_vcpu (i, tmp, vcpu->kvm) - tmp->arch.mp_state.mp_state =KVM_MP_STATE_STOPPED ; +kvm_for_each_vcpu (i, tmp, vcpu->kvm) { +spin_lock (&tmp->arch.mp_state_lock); +WRITE_ONCE (tmp->arch.mp_state.mp_state,KVM_MP_STATE_STOPPED ); +spin_unlock (&tmp->arch.mp_state_lock); + }kvm_make_all_cpus_request (vcpu->kvm,KVM_REQ_SLEEP );memset (&vcpu->run->system_event,0 ,sizeof (vcpu->run->system_event));
@@ -229,7 +239,6 @@ static unsigned long kvm_psci_check_allostatic int kvm_psci_0_2_call (struct kvm_vcpu *vcpu) { -struct kvm *kvm = vcpu->kvm;u32 psci_fn =smccc_get_function (vcpu);unsigned long val;int ret =1 ;
@@ -254,9 +263,7 @@ static int kvm_psci_0_2_call(struct kvm_kvm_psci_narrow_to_32bit (vcpu); fallthrough;case PSCI_0_2_FN64_CPU_ON : -mutex_lock (&kvm->lock); val =kvm_psci_vcpu_on (vcpu); -mutex_unlock (&kvm->lock);break ;case PSCI_0_2_FN_AFFINITY_INFO :kvm_psci_narrow_to_32bit (vcpu);
@@ -395,7 +402,6 @@ static int kvm_psci_1_x_call(struct kvm_static int kvm_psci_0_1_call (struct kvm_vcpu *vcpu) { -struct kvm *kvm = vcpu->kvm;u32 psci_fn =smccc_get_function (vcpu);unsigned long val;
@@ -405,9 +411,7 @@ static int kvm_psci_0_1_call(struct kvm_ val =PSCI_RET_SUCCESS ;break ;case KVM_PSCI_FN_CPU_ON : -mutex_lock (&kvm->lock); val =kvm_psci_vcpu_on (vcpu); -mutex_unlock (&kvm->lock);break ;default : val =PSCI_RET_NOT_SUPPORTED ;
arch/arm64/kvm/reset.c +5 -4
@@ -255,15 +255,16 @@ int kvm_reset_vcpu(struct kvm_vcpu *vcpumutex_lock (&vcpu->kvm->lock); ret =kvm_set_vm_width (vcpu); -if (!ret) { - reset_state = vcpu->arch.reset_state; -WRITE_ONCE (vcpu->arch.reset_state.reset, false); - }mutex_unlock (&vcpu->kvm->lock);if (ret)return ret; +spin_lock (&vcpu->arch.mp_state_lock); + reset_state = vcpu->arch.reset_state; + vcpu->arch.reset_state.reset = false; +spin_unlock (&vcpu->arch.mp_state_lock); +/* Reset PMU outside of the non-preemptible section */ kvm_pmu_vcpu_reset (vcpu);
Greg Kroah-Hartman
maintainerPATCH 77/611 KVM: arm64: Avoid lock inversion when setting the VM register width
In reply to Greg Kroah-HartmanFrom: Oliver Upton <[email protected]>
commit c43120afb5c66a3465c7468f5cf9806a26484cde upstream.
kvm->lock must be taken outside of the vcpu->mutex. Of course, the locking documentation for KVM makes this abundantly clear. Nonetheless, the locking order in KVM/arm64 has been wrong for quite a while; we acquire the kvm->lock while holding the vcpu->mutex all over the shop.
All was seemingly fine until commit 42a90008f890 ("KVM: Ensure lockdep knows about kvm->lock vs. vcpu->mutex ordering rule") caught us with our pants down, leading to lockdep barfing:
======================================================
WARNING: possible circular locking dependency detected 6.2.0-rc7+ #19 Not tainted
------------------------------------------------------
qemu-system-aar/859 is trying to acquire lock:
ffff5aa69269eba0 (&host_kvm->lock){+.+.}-{3:3}, at: kvm_reset_vcpu+0x34/0x274
but task is already holding lock:
ffff5aa68768c0b8 (&vcpu->mutex){+.+.}-{3:3}, at: kvm_vcpu_ioctl+0x8c/0xba0
which lock already depends on the new lock.
Add a dedicated lock to serialize writes to VM-scoped configuration from the context of a vCPU. Protect the register width flags with the new lock, thus avoiding the need to grab the kvm->lock while holding vcpu->mutex in kvm_reset_vcpu().
--- arch/arm64/include/asm/kvm_host.h | 3 +++ arch/arm64/kvm/arm.c | 18 ++++++++++++++++++ arch/arm64/kvm/reset.c | 6 +++--- 3 files changed, 24 insertions(+), 3 deletions(-)
arch/arm64/include/asm/kvm_host.h +3 -0
@@ -127,6 +127,9 @@ struct kvm_arch {/* Mandated version of PSCI */ u32 psci_version; +/* Protects VM-scoped configuration data */ +struct mutex config_lock; +/* * If we encounter a data abort without valid instruction syndrome * information, report this to user space. User space can (and
arch/arm64/kvm/arm.c +18 -0
@@ -146,6 +146,16 @@ int kvm_arch_init_vm(struct kvm *kvm, unif (ret)return ret; +mutex_init (&kvm->arch.config_lock); + +#ifdef CONFIG_LOCKDEP +/* Clue in lockdep that the config_lock must be taken inside kvm->lock */ +mutex_lock (&kvm->lock); +mutex_lock (&kvm->arch.config_lock); +mutex_unlock (&kvm->arch.config_lock); +mutex_unlock (&kvm->lock); +#endif + ret =kvm_share_hyp (kvm, kvm +1 );if (ret) goto out_free_stage2_pgd;
@@ -326,6 +336,14 @@ int kvm_arch_vcpu_create(struct kvm_vcpuspin_lock_init (&vcpu->arch.mp_state_lock); +#ifdef CONFIG_LOCKDEP +/* Inform lockdep that the config_lock is acquired after vcpu->mutex */ +mutex_lock (&vcpu->mutex); +mutex_lock (&vcpu->kvm->arch.config_lock); +mutex_unlock (&vcpu->kvm->arch.config_lock); +mutex_unlock (&vcpu->mutex); +#endif +/* Force users to call KVM_ARM_VCPU_INIT */ vcpu->arch.target =-1 ;bitmap_zero (vcpu->arch.features,KVM_VCPU_MAX_FEATURES );
arch/arm64/kvm/reset.c +3 -3
@@ -200,7 +200,7 @@ static int kvm_set_vm_width(struct kvm_v is32bit =vcpu_has_feature (vcpu,KVM_ARM_VCPU_EL1_32BIT ); -lockdep_assert_held (&kvm->lock); +lockdep_assert_held (&kvm->arch.config_lock);if (test_bit (KVM_ARCH_FLAG_REG_WIDTH_CONFIGURED , &kvm->arch.flags)) {/*
@@ -253,9 +253,9 @@ int kvm_reset_vcpu(struct kvm_vcpu *vcpubool loaded;u32 pstate; -mutex_lock (&vcpu->kvm->lock); +mutex_lock (&vcpu->kvm->arch.config_lock); ret =kvm_set_vm_width (vcpu); -mutex_unlock (&vcpu->kvm->lock); +mutex_unlock (&vcpu->kvm->arch.config_lock);if (ret)return ret;
Greg Kroah-Hartman
maintainerPATCH 78/611 KVM: arm64: Use config_lock to protect data ordered against KVM_RUN
In reply to Greg Kroah-HartmanFrom: Oliver Upton <[email protected]>
commit 4bba7f7def6f278266dadf845da472cfbfed784e upstream.
There are various bits of VM-scoped data that can only be configured before the first call to KVM_RUN, such as the hypercall bitmaps and the PMU. As these fields are protected by the kvm->lock and accessed while holding vcpu->mutex, this is yet another example of lock inversion.
Change out the kvm->lock for kvm->arch.config_lock in all of these instances. Opportunistically simplify the locking mechanics of the PMU configuration by holding the config_lock for the entirety of kvm_arm_pmu_v3_set_attr().
Note that this also addresses a couple of bugs. There is an unguarded read of the PMU version in KVM_ARM_VCPU_PMU_V3_FILTER which could race with KVM_ARM_VCPU_PMU_V3_SET_PMU. Additionally, until now writes to the per-vCPU vPMU irq were not serialized VM-wide, meaning concurrent calls to KVM_ARM_VCPU_PMU_V3_IRQ could lead to a false positive in pmu_irq_is_valid().
--- arch/arm64/kvm/arm.c | 4 ++-- arch/arm64/kvm/guest.c | 2 ++ arch/arm64/kvm/hypercalls.c | 4 ++-- arch/arm64/kvm/pmu-emul.c | 23 ++++++----------------- 4 files changed, 12 insertions(+), 21 deletions(-)
arch/arm64/kvm/arm.c +2 -2
@@ -616,9 +616,9 @@ int kvm_arch_vcpu_run_pid_change(structif (kvm_vm_is_protected (kvm))kvm_call_hyp_nvhe (__pkvm_vcpu_init_traps, vcpu); -mutex_lock (&kvm->lock); +mutex_lock (&kvm->arch.config_lock);set_bit (KVM_ARCH_FLAG_HAS_RAN_ONCE , &kvm->arch.flags); -mutex_unlock (&kvm->lock); +mutex_unlock (&kvm->arch.config_lock);return ret; }
arch/arm64/kvm/guest.c +2 -0
@@ -951,7 +951,9 @@ int kvm_arm_vcpu_arch_set_attr(struct kvswitch (attr->group) {case KVM_ARM_VCPU_PMU_V3_CTRL : +mutex_lock (&vcpu->kvm->arch.config_lock); ret =kvm_arm_pmu_v3_set_attr (vcpu, attr); +mutex_unlock (&vcpu->kvm->arch.config_lock);break ;case KVM_ARM_VCPU_TIMER_CTRL : ret =kvm_arm_timer_set_attr (vcpu, attr);
arch/arm64/kvm/hypercalls.c +2 -2
@@ -377,7 +377,7 @@ static int kvm_arm_set_fw_reg_bmap(strucif (val & ~fw_reg_features)return -EINVAL ; -mutex_lock (&kvm->lock); +mutex_lock (&kvm->arch.config_lock);if (test_bit (KVM_ARCH_FLAG_HAS_RAN_ONCE , &kvm->arch.flags) && val != *fw_reg_bmap) {
@@ -387,7 +387,7 @@ static int kvm_arm_set_fw_reg_bmap(strucWRITE_ONCE (*fw_reg_bmap, val); out: -mutex_unlock (&kvm->lock); +mutex_unlock (&kvm->arch.config_lock);return ret; }
arch/arm64/kvm/pmu-emul.c +6 -17
@@ -850,7 +850,7 @@ static int kvm_arm_pmu_v3_set_pmu(structstruct arm_pmu *arm_pmu;int ret = -ENXIO ; -mutex_lock (&kvm->lock); +lockdep_assert_held (&kvm->arch.config_lock);mutex_lock (&arm_pmus_lock);list_for_each_entry (entry, &arm_pmus, entry) {
@@ -870,7 +870,6 @@ static int kvm_arm_pmu_v3_set_pmu(struct }mutex_unlock (&arm_pmus_lock); -mutex_unlock (&kvm->lock);return ret; }
@@ -878,22 +877,20 @@ int kvm_arm_pmu_v3_set_attr(struct kvm_v {struct kvm *kvm = vcpu->kvm; +lockdep_assert_held (&kvm->arch.config_lock); +if (!kvm_vcpu_has_pmu (vcpu))return -ENODEV ;if (vcpu->arch.pmu.created)return -EBUSY ; -mutex_lock (&kvm->lock);if (!kvm->arch.arm_pmu) {/* No PMU set, get the default one */ kvm->arch.arm_pmu =kvm_pmu_probe_armpmu (); -if (!kvm->arch.arm_pmu) { -mutex_unlock (&kvm->lock); +if (!kvm->arch.arm_pmu)return -ENODEV ; - } } -mutex_unlock (&kvm->lock);switch (attr->attr) {case KVM_ARM_VCPU_PMU_V3_IRQ : {
@@ -937,19 +934,13 @@ int kvm_arm_pmu_v3_set_attr(struct kvm_v filter.action != KVM_PMU_EVENT_DENY))return -EINVAL ; -mutex_lock (&kvm->lock); - -if (test_bit (KVM_ARCH_FLAG_HAS_RAN_ONCE , &kvm->arch.flags)) { -mutex_unlock (&kvm->lock); +if (test_bit (KVM_ARCH_FLAG_HAS_RAN_ONCE , &kvm->arch.flags))return -EBUSY ; - }if (!kvm->arch.pmu_filter) { kvm->arch.pmu_filter =bitmap_alloc (nr_events,GFP_KERNEL_ACCOUNT ); -if (!kvm->arch.pmu_filter) { -mutex_unlock (&kvm->lock); +if (!kvm->arch.pmu_filter)return -ENOMEM ; - }/* * The default depends on the first applied filter.
@@ -968,8 +959,6 @@ int kvm_arm_pmu_v3_set_attr(struct kvm_velse bitmap_clear (kvm->arch.pmu_filter, filter.base_event, filter.nevents); -mutex_unlock (&kvm->lock); -return 0 ; }case KVM_ARM_VCPU_PMU_V3_SET_PMU : {
Greg Kroah-Hartman
maintainerPATCH 69/611 crypto: api - Demote BUG_ON() in crypto_unregister_alg() to a WARN_ON()
In reply to Greg Kroah-HartmanFrom: Toke Høiland-Jørgensen <[email protected]>
commit a543ada7db729514ddd3ba4efa45f4c7b802ad85 upstream.
The crypto_unregister_alg() function expects callers to ensure that any algorithm that is unregistered has a refcnt of exactly 1, and issues a BUG_ON() if this is not the case. However, there are in fact drivers that will call crypto_unregister_alg() without ensuring that the refcnt has been lowered first, most notably on system shutdown. This causes the BUG_ON() to trigger, which prevents a clean shutdown and hangs the system.
To avoid such hangs on shutdown, demote the BUG_ON() in crypto_unregister_alg() to a WARN_ON() with early return. Cc stable because this problem was observed on a 6.2 kernel, cf the link below.
--- crypto/algapi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
crypto/algapi.c +3 -1
@@ -472,7 +472,9 @@ void crypto_unregister_alg(struct cryptoif (WARN (ret,"Algorithm %s is not registered" , alg->cra_driver_name))return ; -BUG_ON (refcount_read (&alg->cra_refcnt) !=1 ); +if (WARN_ON (refcount_read (&alg->cra_refcnt) !=1 )) +return ; +if (alg->cra_destroy) alg->cra_destroy (alg);
Greg Kroah-Hartman
maintainerPATCH 104/611 ubifs: Free memory for tmpfile name
In reply to Greg Kroah-HartmanFrom: Mårten Lindahl <[email protected]>
commit 1fb815b38bb31d6af9bd0540b8652a0d6fe6cfd3 upstream.
When opening a ubifs tmpfile on an encrypted directory, function fscrypt_setup_filename allocates memory for the name that is to be stored in the directory entry, but after the name has been copied to the directory entry inode, the memory is not freed.
When running kmemleak on it we see that it is registered as a leak. The report below is triggered by a simple program 'tmpfile' just opening a tmpfile:
unreferenced object 0xffff88810178f380 (size 32):
comm "tmpfile", pid 509, jiffies 4294934744 (age 1524.742s)
backtrace:
__kmem_cache_alloc_node
__kmalloc
fscrypt_setup_filename
ubifs_tmpfile
vfs_tmpfile
path_openatFree this memory after it has been copied to the inode.
--- fs/ubifs/dir.c | 1 + 1 file changed, 1 insertion(+)
fs/ubifs/dir.c +1 -0
@@ -492,6 +492,7 @@ static int ubifs_tmpfile(struct user_namunlock_2_inodes (dir, inode);ubifs_release_budget (c, &req); +fscrypt_free_filename (&nm);return finish_open_simple (file,0 );
Greg Kroah-Hartman
maintainerPATCH 113/611 kunit: improve KTAP compliance of KUnit test output
In reply to Greg Kroah-HartmanFrom: Rae Moar <[email protected]>
[ Upstream commit 6c738b52316c58ae8a87abf0907f87a7b5e7a109 ]
Change KUnit test output to better comply with KTAP v1 specifications found here: https://kernel.org/doc/html/latest/dev-tools/ktap.html.
1) Use "KTAP version 1" instead of "TAP version 14" as test output header
2) Remove '-' between test number and test name on test result lines
2) Add KTAP version lines to each subtest header as well
Note that the new KUnit output still includes the “# Subtest” line now located after the KTAP version line. This does not completely match the KTAP v1 spec but since it is classified as a diagnostic line, it is not expected to be disruptive or break any existing parsers. This “# Subtest” line comes from the TAP 14 spec
(https://testanything.org/tap-version-14-specification.html) and it is used to define the test name before the results.
Original output:
TAP version 14
1..1
# Subtest: kunit-test-suite
1..3
ok 1 - kunit_test_1
ok 2 - kunit_test_2
ok 3 - kunit_test_3
# kunit-test-suite: pass:3 fail:0 skip:0 total:3
# Totals: pass:3 fail:0 skip:0 total:3
ok 1 - kunit-test-suite
New output:
KTAP version 1
1..1
KTAP version 1
# Subtest: kunit-test-suite
1..3
ok 1 kunit_test_1
ok 2 kunit_test_2
ok 3 kunit_test_3
# kunit-test-suite: pass:3 fail:0 skip:0 total:3
# Totals: pass:3 fail:0 skip:0 total:3
ok 1 kunit-test-suite
Stable-dep-of: f9a301c3317d ("kunit: fix bug in the order of lines in debugfs logs")
--- lib/kunit/debugfs.c | 2 +- lib/kunit/executor.c | 6 +++--- lib/kunit/test.c | 9 ++++++--- 3 files changed, 10 insertions(+), 7 deletions(-)
lib/kunit/debugfs.c +1 -1
@@ -63,7 +63,7 @@ static int debugfs_print_results(struct seq_file *seq, void *v)kunit_suite_for_each_test_case (suite, test_case)debugfs_print_result (seq, suite, test_case); -seq_printf (seq,"%s %d - %s\n" , +seq_printf (seq,"%s %d %s\n" ,kunit_status_to_ok_not_ok (success),1 , suite->name);return 0 ; }
lib/kunit/executor.c +3 -3
@@ -166,7 +166,7 @@ static void kunit_exec_run_tests(struct suite_set *suite_set) {size_t num_suites = suite_set->end - suite_set->start; -pr_info ("TAP version 14\n" ); +pr_info ("KTAP version 1\n" );pr_info ("1..%zu\n" , num_suites);__kunit_test_suites_init (suite_set->start, num_suites);
@@ -177,8 +177,8 @@ static void kunit_exec_list_tests(struct suite_set *suite_set)struct kunit_suite *const *suites;struct kunit_case *test_case; -/* Hack: print a tap header so kunit.py can find the start of KUnit output. */ -pr_info ("TAP version 14\n" ); +/* Hack: print a ktap header so kunit.py can find the start of KUnit output. */ +pr_info ("KTAP version 1\n" );for (suites = suite_set->start; suites < suite_set->end; suites++)kunit_suite_for_each_test_case ((*suites), test_case) {
lib/kunit/test.c +6 -3
@@ -149,6 +149,7 @@ EXPORT_SYMBOL_GPL(kunit_suite_num_test_cases);static void kunit_print_suite_start (struct kunit_suite *suite) { +kunit_log (KERN_INFO , suite,KUNIT_SUBTEST_INDENT "KTAP version 1\n" );kunit_log (KERN_INFO , suite,KUNIT_SUBTEST_INDENT "# Subtest: %s" , suite->name); kunit_log(KERN_INFO, suite, KUNIT_SUBTEST_INDENT "1..%zd",
@@ -175,13 +176,13 @@ static void kunit_print_ok_not_ok(void *test_or_suite,* representation. */ if (suite) -pr_info ("%s %zd - %s%s%s\n" , +pr_info ("%s %zd %s%s%s\n" ,kunit_status_to_ok_not_ok (status), test_number, description, directive_header, (status ==KUNIT_SKIPPED ) ? directive :"" );else kunit_log (KERN_INFO , test, -KUNIT_SUBTEST_INDENT "%s %zd - %s%s%s" , +KUNIT_SUBTEST_INDENT "%s %zd %s%s%s" ,kunit_status_to_ok_not_ok (status), test_number, description, directive_header, (status ==KUNIT_SKIPPED ) ? directive :"" );
@@ -542,6 +543,8 @@ int kunit_run_tests(struct kunit_suite *suite)/* Get initial param. */ param_desc[0 ] ='\0' ; test.param_value = test_case->generate_params (NULL , param_desc); + kunit_log(KERN_INFO, &test, KUNIT_SUBTEST_INDENT KUNIT_SUBTEST_INDENT +"KTAP version 1\n" ); kunit_log(KERN_INFO, &test, KUNIT_SUBTEST_INDENT KUNIT_SUBTEST_INDENT"# Subtest: %s" , test_case->name);
@@ -555,7 +558,7 @@ int kunit_run_tests(struct kunit_suite *suite)kunit_log (KERN_INFO , &test, KUNIT_SUBTEST_INDENT KUNIT_SUBTEST_INDENT -"%s %d - %s" , +"%s %d %s" ,kunit_status_to_ok_not_ok (test.status), test.param_index +1 , param_desc);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 114/611 kunit: fix bug in the order of lines in debugfs logs
In reply to Greg Kroah-HartmanFrom: Rae Moar <[email protected]>
[ Upstream commit f9a301c3317daa921375da0aec82462ddf019928 ]
Fix bug in debugfs logs that causes an incorrect order of lines in the debugfs log.
Currently, the test counts lines that show the number of tests passed, failed, and skipped, as well as any suite diagnostic lines, appear prior to the individual results, which is a bug.
Ensure the order of printing for the debugfs log is correct. Additionally, add a KTAP header to so the debugfs logs can be valid KTAP.
This is an example of a log prior to these fixes:
KTAP version 1
# Subtest: kunit_status
1..2
# kunit_status: pass:2 fail:0 skip:0 total:2
# Totals: pass:2 fail:0 skip:0 total:2
ok 1 kunit_status_set_failure_test
ok 2 kunit_status_mark_skipped_test
ok 1 kunit_status
Note the two lines with stats are out of order. This is the same debugfs log after the fixes (in combination with the third patch to remove the extra line):
KTAP version 1
1..1
KTAP version 1
# Subtest: kunit_status
1..2
ok 1 kunit_status_set_failure_test
ok 2 kunit_status_mark_skipped_test
# kunit_status: pass:2 fail:0 skip:0 total:2
# Totals: pass:2 fail:0 skip:0 total:2
ok 1 kunit_status
--- lib/kunit/debugfs.c | 14 ++++++++++++-- lib/kunit/test.c | 21 ++++++++++++++------- 2 files changed, 26 insertions(+), 9 deletions(-)
lib/kunit/debugfs.c +12 -2
@@ -55,14 +55,24 @@ static int debugfs_print_results(struct seq_file *seq, void *v)enum kunit_status success =kunit_suite_has_succeeded (suite);struct kunit_case *test_case; -if (!suite || !suite->log) +if (!suite)return 0 ; -seq_printf (seq,"%s" , suite->log); +/* Print KTAP header so the debugfs log can be parsed as valid KTAP. */ +seq_puts (seq,"KTAP version 1\n" ); +seq_puts (seq,"1..1\n" ); + +/* Print suite header because it is not stored in the test logs. */ +seq_puts (seq,KUNIT_SUBTEST_INDENT "KTAP version 1\n" ); +seq_printf (seq,KUNIT_SUBTEST_INDENT "# Subtest: %s\n" , suite->name); +seq_printf (seq,KUNIT_SUBTEST_INDENT "1..%zd\n" ,kunit_suite_num_test_cases (suite));kunit_suite_for_each_test_case (suite, test_case)debugfs_print_result (seq, suite, test_case); +if (suite->log) +seq_printf (seq,"%s" , suite->log); +seq_printf (seq,"%s %d %s\n" ,kunit_status_to_ok_not_ok (success),1 , suite->name);return 0 ;
lib/kunit/test.c +14 -7
@@ -149,10 +149,18 @@ EXPORT_SYMBOL_GPL(kunit_suite_num_test_cases);static void kunit_print_suite_start (struct kunit_suite *suite) { -kunit_log (KERN_INFO , suite,KUNIT_SUBTEST_INDENT "KTAP version 1\n" ); -kunit_log (KERN_INFO , suite,KUNIT_SUBTEST_INDENT "# Subtest: %s" , +/* +* We do not log the test suite header as doing so would +* mean debugfs display would consist of the test suite +* header prior to individual test results. +* Hence directly printk the suite status, and we will +* separately seq_printf() the suite header for the debugfs +* representation. +*/ +pr_info (KUNIT_SUBTEST_INDENT "KTAP version 1\n" ); +pr_info (KUNIT_SUBTEST_INDENT "# Subtest: %s\n" , suite->name); -kunit_log (KERN_INFO , suite,KUNIT_SUBTEST_INDENT "1..%zd" , +pr_info (KUNIT_SUBTEST_INDENT "1..%zd\n" ,kunit_suite_num_test_cases (suite)); }
@@ -169,10 +177,9 @@ static void kunit_print_ok_not_ok(void *test_or_suite,/* * We do not log the test suite results as doing so would -* mean debugfs display would consist of the test suite -* description and status prior to individual test results. -* Hence directly printk the suite status, and we will -* separately seq_printf() the suite status for the debugfs +* mean debugfs display would consist of an incorrect test +* number. Hence directly printk the suite result, and we will +* separately seq_printf() the suite results for the debugfs * representation. */ if (suite)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 115/611 rcu: Fix missing TICK_DEP_MASK_RCU_EXP dependency check
In reply to Greg Kroah-HartmanFrom: Zqiang <[email protected]>
[ Upstream commit db7b464df9d820186e98a65aa6a10f0d51fbf8ce ]
This commit adds checks for the TICK_DEP_MASK_RCU_EXP bit, thus enabling RCU expedited grace periods to actually force-enable scheduling-clock interrupts on holdout CPUs.
--- include/trace/events/timer.h | 3 ++- kernel/time/tick-sched.c | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-)
include/trace/events/timer.h +2 -1
@@ -371,7 +371,8 @@ TRACE_EVENT(itimer_expire, tick_dep_name(PERF_EVENTS) \ tick_dep_name(SCHED) \ tick_dep_name(CLOCK_UNSTABLE) \ - tick_dep_name_end(RCU) + tick_dep_name(RCU) \ + tick_dep_name_end(RCU_EXP) #undef tick_dep_name#undef tick_dep_mask_name
kernel/time/tick-sched.c +5 -0
@@ -281,6 +281,11 @@ static bool check_tick_dependency(atomic_t *dep)return true; } +if (val &TICK_DEP_MASK_RCU_EXP ) { +trace_tick_stop (0 ,TICK_DEP_MASK_RCU_EXP ); +return true; + } +return false; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 116/611 selftests/resctrl: Return NULL if malloc_and_init_memory() did not alloc mem
In reply to Greg Kroah-HartmanFrom: Ilpo Järvinen <[email protected]>
[ Upstream commit 22a8be280383812235131dda18a8212a59fadd2d ]
malloc_and_init_memory() in fill_buf isn't checking if memalign() successfully allocated memory or not before accessing the memory.
Check the return value of memalign() and return NULL if allocating aligned memory fails.
--- tools/testing/selftests/resctrl/fill_buf.c | 2 ++ 1 file changed, 2 insertions(+)
tools/testing/selftests/resctrl/fill_buf.c +2 -0
@@ -68,6 +68,8 @@ static void *malloc_and_init_memory(size_t s)size_t s64;void *p =memalign (PAGE_SIZE , s); +if (!p) +return NULL ; p64 = (uint64_t *)p; s64 = s /sizeof (uint64_t );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 117/611 selftests/resctrl: Move ->setup() call outside of test specific branches
In reply to Greg Kroah-HartmanFrom: Ilpo Järvinen <[email protected]>
[ Upstream commit c90b3b588e369c20087699316259fa5ebbb16f2d ]
resctrl_val() function is called only by MBM, MBA, and CMT tests which means the else branch is never used.
Both test branches call param->setup().
Remove the unused else branch and place the ->setup() call outside of the test specific branches reducing code duplication.
Stable-dep-of: fa10366cc6f4 ("selftests/resctrl: Allow ->setup() to return errors")
--- tools/testing/selftests/resctrl/resctrl_val.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-)
tools/testing/selftests/resctrl/resctrl_val.c +6 -13
@@ -734,29 +734,22 @@ int resctrl_val(char **benchmark_cmd, struct resctrl_val_param *param)/* Test runs until the callback setup() tells the test to stop. */ while (1 ) { + ret = param->setup (1 , param); +if (ret) { + ret =0 ; +break ; + } +if (!strncmp (resctrl_val,MBM_STR ,sizeof (MBM_STR )) || !strncmp (resctrl_val,MBA_STR ,sizeof (MBA_STR ))) { - ret = param->setup (1 , param); -if (ret) { - ret =0 ; -break ; - } - ret =measure_vals (param, &bw_resc_start);if (ret)break ; }else if (!strncmp (resctrl_val,CMT_STR ,sizeof (CMT_STR ))) { - ret = param->setup (1 , param); -if (ret) { - ret =0 ; -break ; - }sleep (1 ); ret =measure_cache_vals (param, bm_pid);if (ret)break ; - }else { -break ; } }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 118/611 selftests/resctrl: Allow ->setup() to return errors
In reply to Greg Kroah-HartmanFrom: Ilpo Järvinen <[email protected]>
[ Upstream commit fa10366cc6f4cc862871f8938426d85c2481f084 ]
resctrl_val() assumes ->setup() always returns either 0 to continue tests or < 0 in case of the normal termination of tests after x runs. The latter overlaps with normal error returns.
Define END_OF_TESTS (=1) to differentiate the normal termination of tests and return errors as negative values. Alter callers of ->setup() to handle errors properly.
--- tools/testing/selftests/resctrl/cache.c | 4 +++- tools/testing/selftests/resctrl/cat_test.c | 2 +- tools/testing/selftests/resctrl/cmt_test.c | 2 +- tools/testing/selftests/resctrl/mba_test.c | 2 +- tools/testing/selftests/resctrl/mbm_test.c | 2 +- tools/testing/selftests/resctrl/resctrl.h | 2 ++ tools/testing/selftests/resctrl/resctrl_val.c | 4 +++- 7 files changed, 12 insertions(+), 6 deletions(-)
tools/testing/selftests/resctrl/cache.c +3 -1
@@ -244,10 +244,12 @@ int cat_val(struct resctrl_val_param *param)while (1 ) {if (!strncmp (resctrl_val,CAT_STR ,sizeof (CAT_STR ))) { ret = param->setup (1 , param); -if (ret) { +if (ret ==END_OF_TESTS ) { ret =0 ;break ; } +if (ret <0 ) +break ; ret =reset_enable_llc_perf (bm_pid, param->cpu_no);if (ret)break ;
tools/testing/selftests/resctrl/cat_test.c +1 -1
@@ -40,7 +40,7 @@ static int cat_setup(int num, ...)/* Run NUM_OF_RUNS times */ if (p->num_of_runs >=NUM_OF_RUNS ) -return -1 ; +return END_OF_TESTS ;if (p->num_of_runs ==0 ) {sprintf (schemata,"%lx" , p->mask);
tools/testing/selftests/resctrl/cmt_test.c +1 -1
@@ -32,7 +32,7 @@ static int cmt_setup(int num, ...)/* Run NUM_OF_RUNS times */ if (p->num_of_runs >=NUM_OF_RUNS ) -return -1 ; +return END_OF_TESTS ; p->num_of_runs++;
tools/testing/selftests/resctrl/mba_test.c +1 -1
@@ -41,7 +41,7 @@ static int mba_setup(int num, ...)return 0 ;if (allocation <ALLOCATION_MIN || allocation >ALLOCATION_MAX ) -return -1 ; +return END_OF_TESTS ;sprintf (allocation_str,"%d" , allocation);
tools/testing/selftests/resctrl/mbm_test.c +1 -1
@@ -95,7 +95,7 @@ static int mbm_setup(int num, ...)/* Run NUM_OF_RUNS times */ if (num_of_runs++ >=NUM_OF_RUNS ) -return -1 ; +return END_OF_TESTS ;va_start (param, num); p = va_arg(param, struct resctrl_val_param *);
tools/testing/selftests/resctrl/resctrl.h +2 -0
@@ -37,6 +37,8 @@#define ARCH_INTEL 1#define ARCH_AMD 2 +#define END_OF_TESTS 1 +#define PARENT_EXIT (err_msg) \ do { \ perror(err_msg); \
tools/testing/selftests/resctrl/resctrl_val.c +3 -1
@@ -735,10 +735,12 @@ int resctrl_val(char **benchmark_cmd, struct resctrl_val_param *param)/* Test runs until the callback setup() tells the test to stop. */ while (1 ) { ret = param->setup (1 , param); -if (ret) { +if (ret ==END_OF_TESTS ) { ret =0 ;break ; } +if (ret <0 ) +break ;if (!strncmp (resctrl_val,MBM_STR ,sizeof (MBM_STR )) || !strncmp (resctrl_val,MBA_STR ,sizeof (MBA_STR ))) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 119/611 selftests/resctrl: Check for return value after write_schemata()
In reply to Greg Kroah-HartmanFrom: Ilpo Järvinen <[email protected]>
[ Upstream commit 0d45c83b95da414e98ad333e723141a94f6e2c64 ]
MBA test case writes schemata but it does not check if the write is successful or not.
Add the error check and return error properly.
--- tools/testing/selftests/resctrl/mba_test.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
tools/testing/selftests/resctrl/mba_test.c +6 -1
@@ -28,6 +28,7 @@ static int mba_setup(int num, ...)struct resctrl_val_param *p;char allocation_str[64 ];va_list param; +int ret;va_start (param, num); p = va_arg(param, struct resctrl_val_param *);
@@ -45,7 +46,11 @@ static int mba_setup(int num, ...)sprintf (allocation_str,"%d" , allocation); -write_schemata (p->ctrlgrp, allocation_str, p->cpu_no, p->resctrl_val); + ret =write_schemata (p->ctrlgrp, allocation_str, p->cpu_no, + p->resctrl_val); +if (ret <0 ) +return ret; + allocation -=ALLOCATION_STEP ;return 0 ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 120/611 selinux: fix Makefile dependencies of flask.h
In reply to Greg Kroah-HartmanFrom: Ondrej Mosnacek <[email protected]>
[ Upstream commit bcab1adeaad4b39a1e04cb98979a367d08253f03 ]
Make the flask.h target depend on the genheaders binary instead of classmap.h to ensure that it is rebuilt if any of the dependencies of genheaders are changed.
Notably this fixes flask.h not being rebuilt wheninitial_sid_to_string.h is modified.
--- security/selinux/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
security/selinux/Makefile +2 -2
@@ -23,8 +23,8 @@ ccflags-y := -I$(srctree)/security/selinux -I$(srctree)/security/selinux/include $(addprefix $(obj)/,$(selinux-y)): $(obj)/flask.h quiet_cmd_flask = GEN $(obj)/flask.h $(obj)/av_permissions.h - cmd_flask = scripts/selinux/genheaders/genheaders $(obj)/flask.h $(obj)/av_permissions.h + cmd_flask = $< $(obj)/flask.h $(obj)/av_permissions.h targets += flask.h av_permissions.h -$(obj)/flask.h: $(src)/include/classmap.h FORCE +$(obj)/flask.h: scripts/selinux/genheaders/genheaders FORCE $(call if_changed,flask)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 121/611 selinux: ensure av_permissions.h is built when needed
In reply to Greg Kroah-HartmanFrom: Paul Moore <[email protected]>
[ Upstream commit 4ce1f694eb5d8ca607fed8542d32a33b4f1217a5 ]
The Makefile rule responsible for building flask.h and av_permissions.h only lists flask.h as a target which means that av_permissions.h is only generated when flask.h needs to be generated. This patch fixes this by adding av_permissions.h as a target to the rule.
--- security/selinux/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
security/selinux/Makefile +1 -1
@@ -26,5 +26,5 @@ quiet_cmd_flask = GEN $(obj)/flask.h $(obj)/av_permissions.h cmd_flask = $< $(obj)/flask.h $(obj)/av_permissions.h targets += flask.h av_permissions.h -$(obj)/flask.h: scripts/selinux/genheaders/genheaders FORCE +$(obj)/flask.h $(obj)/av_permissions.h &: scripts/selinux/genheaders/genheaders FORCE $(call if_changed,flask)
Signature · 1 line
2.39.2