6.6.76-rc1 review
Subsystems (6)
Greg Kroah-Hartman
maintainercover 6.6.76-rc1 review
This is the start of the stable review cycle for the 6.6.76 release. There are 393 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 Fri, 07 Feb 2025 13:43:04 +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.6.76-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.6.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 6.6.76-rc1
Tiezhu Yang <[email protected]>
LoongArch: Change 8 to 14 for LOONGARCH_MAX_{BRP,WRP}Nathan Chancellor <[email protected]>
s390: Add '-std=gnu11' to decompressor and purgatory CFLAGS
Qu Wenruo <[email protected]>
btrfs: output the reason for open_ctree() failure
Dan Carpenter <[email protected]>
media: imx-jpeg: Fix potential error pointer dereference in detach_pm()
Laurentiu Palcu <[email protected]>
staging: media: max96712: fix kernel oops when removing module
Thinh Nguyen <[email protected]>
usb: gadget: f_tcm: Don't free command immediately
Calvin Owens <[email protected]>
pps: Fix a use-after-free
Laurent Pinchart <[email protected]>
media: uvcvideo: Fix double free in error path
Arnaud Pouliquen <[email protected]>
remoteproc: core: Fix ida_free call while not allocated
Paolo Abeni <[email protected]>
mptcp: handle fastopen disconnect correctly
Paolo Abeni <[email protected]>
mptcp: consolidate suboption status
Kyle Tso <[email protected]>
usb: typec: tcpci: Prevent Sink disconnection before vPpsShutdown in SPR PPS
Jos Wang <[email protected]>
usb: typec: tcpm: set SRC_SEND_CAPABILITIES timeout to PD_T_SENDER_RESPONSE
Kyle Tso <[email protected]>
usb: dwc3: core: Defer the probe until USB power supply ready
Joe Hattori <[email protected]>
usb: dwc3-am62: Fix an OF node leak in phy_syscon_pll_refclk()
Thinh Nguyen <[email protected]>
usb: gadget: f_tcm: Fix Get/SetInterface return value
Sean Rhodes <[email protected]>
drivers/card_reader/rtsx_usb: Restore interrupt based detection
Michal Pecio <[email protected]>
usb: xhci: Fix NULL pointer dereference on certain command aborts
Nikita Zhandarovich <[email protected]>
net: usb: rtl8150: enable basic endpoint checking
Lianqin Hu <[email protected]>
ALSA: usb-audio: Add delay quirk for iBasso DC07 Pro
Ricardo B. Marliere <[email protected]>
ktest.pl: Check kernelrelease return in get_version
Mathieu Desnoyers <[email protected]>
selftests/rseq: Fix handling of glibc without rseq support
Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: reject mismatching sum of field_len with set key length
Parth Pancholi <[email protected]>
kbuild: switch from lz4c to lz4 for compression
Chuck Lever <[email protected]>
Revert "SUNRPC: Reduce thread wake-up rate when receiving large RPC messages"
Chuck Lever <[email protected]>
NFSD: Reset cb_seq_status after NFS4ERR_DELAY
Daniel Lee <[email protected]>
f2fs: Introduce linear search for dentries
Lin Yujun <[email protected]>
hexagon: Fix unbalanced spinlock in die()
Willem de Bruijn <[email protected]>
hexagon: fix using plain integer as NULL pointer warning in cmpxchg
Masahiro Yamada <[email protected]>
kconfig: fix memory leak in sym_warn_unmet_dep()
Sergey Senozhatsky <[email protected]>
kconfig: WERROR unmet symbol dependency
Masahiro Yamada <[email protected]>
kconfig: deduplicate code in conf_read_simple()
Masahiro Yamada <[email protected]>
kconfig: remove unused code for S_DEF_AUTO in conf_read_simple()
Masahiro Yamada <[email protected]>
kconfig: require a space after '#' for valid input
Masahiro Yamada <[email protected]>
kconfig: fix file name in warnings when loading KCONFIG_DEFCONFIG_LIST
Pali Rohár <[email protected]>
cifs: Fix getting and setting SACLs over SMB1
Pali Rohár <[email protected]>
cifs: Validate EAs for WSL reparse points
Jens Axboe <[email protected]>
io_uring/uring_cmd: use cached cmd_op in io_uring_cmd_sock()
Detlev Casanova <[email protected]>
ASoC: rockchip: i2s_tdm: Re-add the set_sysclk callback
Palmer Dabbelt <[email protected]>
RISC-V: Mark riscv_v_init() as __init
Hongbo Li <[email protected]>
hostfs: fix the host directory parse when mounting.
Nathan Chancellor <[email protected]>
hostfs: Add const qualifier to host_root in hostfs_fill_super()
Al Viro <[email protected]>
hostfs: fix string handling in __dentry_name()
Hongbo Li <[email protected]>
hostfs: convert hostfs to use the new mount API
Masahiro Yamada <[email protected]>
genksyms: fix memory leak when the same symbol is read from *.symref file
Masahiro Yamada <[email protected]>
genksyms: fix memory leak when the same symbol is added from source
Eric Dumazet <[email protected]>
net: hsr: fix fill_frame_info() regression vs VLAN packets
Kory Maincent <[email protected]>
net: sh_eth: Fix missing rtnl lock in suspend/resume path
Toke Høiland-Jørgensen <[email protected]>
net: xdp: Disallow attaching device-bound programs in generic mode
Jon Maloy <[email protected]>
tcp: correct handling of extreme memory squeeze
Rafał Miłecki <[email protected]>
bgmac: reduce max frame size to support just MTU 1500
Michal Luczaj <[email protected]>
vsock: Allow retrying on connect() failure
Michal Luczaj <[email protected]>
vsock: Keep the binding until socket destruction
Neeraj Sanjay Kale <[email protected]>
Bluetooth: btnxpuart: Fix glitches seen in dual A2DP streaming
Rafael J. Wysocki <[email protected]>
PM: sleep: core: Synchronize runtime PM status of parents and children
Rafael J. Wysocki <[email protected]>
PM: sleep: Use bool for all 1-bit fields in struct dev_pm_info
Rafael J. Wysocki <[email protected]>
PM: sleep: Restore asynchronous device resume optimization
Howard Chu <[email protected]>
perf trace: Fix runtime error of index out of bounds
Kunihiko Hayashi <[email protected]>
net: stmmac: Limit FIFO size by hardware capability
Kunihiko Hayashi <[email protected]>
net: stmmac: Limit the number of MTL queues to hardware capability
Thomas Weißschuh <[email protected]>
ptp: Properly handle compat ioctls
Chenyuan Yang <[email protected]>
net: davicom: fix UAF in dm9000_drv_remove
Shigeru Yoshida <[email protected]>
vxlan: Fix uninit-value in vxlan_vnifilter_dump()
Jakub Kicinski <[email protected]>
net: netdevsim: try to close UDP port harness races
Eric Dumazet <[email protected]>
net: rose: fix timer races against user threads
Michal Swiatkowski <[email protected]>
iavf: allow changing VLAN state without calling PF
Wentao Liang <[email protected]>
PM: hibernate: Add error handling for syscore_suspend()
Eric Dumazet <[email protected]>
ipmr: do not call mr_mfc_uses_dev() for unres entries
Dheeraj Reddy Jonnalagadda <[email protected]>
net: fec: implement TSO descriptor cleanup
Ahmad Fatoum <[email protected]>
gpio: mxc: remove dead code after switch to DT-only
Jian Shen <[email protected]>
net: hns3: fix oops when unload drivers paralleling
Alexander Stein <[email protected]>
regulator: core: Add missing newline character
pangliyuan <[email protected]>
ubifs: skip dumping tnc tree when zroot is null
Ming Wang <[email protected]>
rtc: loongson: clear TOY_MATCH0_REG in loongson_rtc_isr()
Oleksij Rempel <[email protected]>
rtc: pcf85063: fix potential OOB write in PCF85063 NVMEM read
Alexandre Cassen <[email protected]>
xfrm: delete intermediate secpath entry in packet offload mode
Joe Hattori <[email protected]>
dmaengine: ti: edma: fix OF node reference leaks in edma_driver
Jianbo Liu <[email protected]>
xfrm: replay: Fix the update of replay_esn->oseq_hi for GSO
Luo Yifan <[email protected]>
tools/bootconfig: Fix the wrong format specifier
Huacai Chen <[email protected]>
LoongArch: Fix warnings during S3 suspend
Olga Kornievskaia <[email protected]>
NFSv4.2: mark OFFLOAD_CANCEL MOVEABLE
Olga Kornievskaia <[email protected]>
NFSv4.2: fix COPY_NOTIFY xdr buf size calculation
John Ogness <[email protected]>
serial: 8250: Adjust the timeout for FIFO mode
Zijun Hu <[email protected]>
driver core: class: Fix wild pointer dereferences in API class_dev_iter_next()
Sebastian Andrzej Siewior <[email protected]>
module: Extend the preempt disabled section in dereference_symbol_descriptor().
Ryusuke Konishi <[email protected]>
nilfs2: protect access to buffers with no active references
Matthew Wilcox (Oracle) <[email protected]>
nilfs2: convert nilfs_lookup_dirty_data_buffers to use folio_create_empty_buffers
Matthew Wilcox (Oracle) <[email protected]>
buffer: make folio_create_empty_buffers() return a buffer_head
Su Yue <[email protected]>
ocfs2: mark dquot as inactive if failed to start trans while releasing dquot
Guixin Liu <[email protected]>
scsi: ufs: bsg: Delete bsg_dev when setting up bsg fails
Paul Menzel <[email protected]>
scsi: mpt3sas: Set ioc->manu_pg11.EEDPTagMode directly to 1
Manivannan Sadhasivam <[email protected]>
PCI: endpoint: pci-epf-test: Fix check for DMA MEMCPY test
Mohamed Khalfella <[email protected]>
PCI: endpoint: pci-epf-test: Set dma_chan_rx pointer to NULL on error
Richard Zhu <[email protected]>
PCI: imx6: Skip controller_id generation logic for i.MX7D
Frank Li <[email protected]>
PCI: imx6: Simplify clock handling by using clk_bulk*() function
King Dix <[email protected]>
PCI: rcar-ep: Fix incorrect variable used when calling devm_request_mem_region()
Desnes Nunes <[email protected]>
media: dvb-usb-v2: af9035: fix ISO C90 compilation error on af9035_i2c_master_xfer
Joe Hattori <[email protected]>
staging: media: imx: fix OF node leak in imx_media_add_of_subdevs()
Joe Hattori <[email protected]>
watchdog: rti_wdt: Fix an OF node leak in rti_wdt_probe()
Laurentiu Palcu <[email protected]>
media: nxp: imx8-isi: fix v4l2-compliance test errors
Joe Hattori <[email protected]>
mtd: hyperbus: hbmc-am654: fix an OF node reference leak
Uwe Kleine-König <[email protected]>
mtd: hyperbus: hbmc-am654: Convert to platform remove callback returning void
david regan <[email protected]>
mtd: rawnand: brcmnand: fix status read of brcmnand_waitfunc
Ricardo Ribalda <[email protected]>
media: uvcvideo: Propagate buf->error to userspace
Jiasheng Jiang <[email protected]>
media: camif-core: Add check for clk_enable()
Jiasheng Jiang <[email protected]>
media: mipi-csis: Add check for clk_enable()
Dave Stevenson <[email protected]>
media: i2c: ov9282: Correct the exposure offset
Luca Weiss <[email protected]>
media: i2c: imx412: Add missing newline to prints
Dave Stevenson <[email protected]>
media: i2c: imx290: Register 0x3011 varies between imx327 and imx290
Jiasheng Jiang <[email protected]>
media: marvell: Add check for clk_enable()
Zijun Hu <[email protected]>
PCI: endpoint: Destroy the EPC device in devm_pci_epc_destroy()
Chen Ni <[email protected]>
media: lmedm04: Handle errors for lme2510_int_read
Oliver Neukum <[email protected]>
media: rc: iguanair: handle timeouts
Mark Brown <[email protected]>
spi: omap2-mcspi: Correctly handle devm_clk_get_optional() errors
Qasim Ijaz <[email protected]>
iommufd/iova_bitmap: Fix shift-out-of-bounds in iova_bitmap_offset_to_index()
Zhu Yanjun <[email protected]>
RDMA/rxe: Fix the warning "__rxe_cleanup+0x12c/0x170 [rdma_rxe]"
Randy Dunlap <[email protected]>
efi: sysfb_efi: fix W=1 warnings when EFI is not set
Zijun Hu <[email protected]>
of: reserved-memory: Do not make kmemleak ignore freed address
Michael Guralnik <[email protected]>
RDMA/mlx5: Fix indirect mkey ODP page count
Pei Xiao <[email protected]>
i3c: dw: Fix use-after-free in dw_i3c_master driver due to race condition
Billy Tsai <[email protected]>
i3c: dw: Add hot-join support.
Akhil R <[email protected]>
arm64: tegra: Fix DMA ID for SPI2
Joe Hattori <[email protected]>
fbdev: omapfb: Fix an OF node leak in dss_of_port_get_parent_device()
Rafał Miłecki <[email protected]>
ARM: dts: mediatek: mt7623: fix IR nodename
Vladimir Zapolskiy <[email protected]>
arm64: dts: qcom: sm8250: Fix interrupt types of camss interrupts
Vladimir Zapolskiy <[email protected]>
arm64: dts: qcom: sdm845: Fix interrupt types of camss interrupts
Val Packett <[email protected]>
arm64: dts: mediatek: add per-SoC compatibles for keypad nodes
Jason-JH.Lin <[email protected]>
dts: arm64: mediatek: mt8195: Remove MT8183 compatible for OVL
Konrad Dybcio <[email protected]>
arm64: dts: qcom: sc8280xp: Fix up remoteproc register space sizes
Neil Armstrong <[email protected]>
arm64: dts: qcom: sm8150-microsoft-surface-duo: fix typos in da7280 properties
Neil Armstrong <[email protected]>
arm64: dts: qcom: sc7180: fix psci power domain node names
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sc7180: change labels to lower-case
David Wronek <[email protected]>
arm64: dts: qcom: Add SM7125 device tree
Neil Armstrong <[email protected]>
arm64: dts: qcom: sc7180-trogdor-pompom: rename 5v-choke thermal zone
Konrad Dybcio <[email protected]>
arm64: dts: qcom: sc7180-*: Remove thermal zone polling delays
Neil Armstrong <[email protected]>
arm64: dts: qcom: sc7180-trogdor-quackingstick: add missing avee-supply
Neil Armstrong <[email protected]>
arm64: dts: qcom: sdm845-db845c-navigation-mezzanine: remove disabled ov7251 camera
Bryan O'Donoghue <[email protected]>
arm64: dts: qcom: sdm845-db845c-navigation-mezzanine: Convert mezzanine riser to dtso
Aaro Koskinen <[email protected]>
ARM: omap1: Fix up the Retu IRQ on Nokia 770
Kalesh AP <[email protected]>
RDMA/bnxt_re: Fix to drop reference to the mmap entry in case of error
Vasily Khoruzhick <[email protected]>
arm64: dts: allwinner: a64: explicitly assign clock parent for TCON0
Bryan Brattlof <[email protected]>
arm64: dts: ti: k3-am62a: Remove duplicate GICR reg
Bryan Brattlof <[email protected]>
arm64: dts: ti: k3-am62: Remove duplicate GICR reg
Cristian Birsan <[email protected]>
ARM: dts: microchip: sama5d27_wlsom1_ek: Add no-1-8-v property to sdmmc0 node
Mihai Sain <[email protected]>
ARM: dts: microchip: sama5d27_wlsom1_ek: Remove mmc-ddr-3_3v property from sdmmc0 node
Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: sm8450: correct sleep clock frequency
Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: sm8350: correct sleep clock frequency
Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: sm8250: correct sleep clock frequency
Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: sm6375: correct sleep clock frequency
Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: sm6125: correct sleep clock frequency
Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: sm4450: correct sleep clock frequency
Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: sdx75: correct sleep clock frequency
Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: sc7280: correct sleep clock frequency
Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: qrb4210-rb2: correct sleep clock frequency
Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: q[dr]u1000: correct sleep clock frequency
Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: qcs404: correct sleep clock frequency
Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: msm8994: correct sleep clock frequency
Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: msm8939: correct sleep clock frequency
Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: msm8916: correct sleep clock frequency
Luca Weiss <[email protected]>
arm64: dts: qcom: sm7225-fairphone-fp4: Drop extra qcom,msm-id value
Konrad Dybcio <[email protected]>
arm64: dts: qcom: msm8994: Describe USB interrupts
Konrad Dybcio <[email protected]>
arm64: dts: qcom: msm8996: Fix up USB3 interrupts
Taniya Das <[email protected]>
arm64: dts: qcom: sa8775p: Update sleep_clk frequency
Bartosz Golaszewski <[email protected]>
arm64: dts: qcom: move common parts for sa8775p-ride variants into a .dtsi
Shazad Hussain <[email protected]>
arm64: dts: qcom: sa8775p-ride: enable pmm8654au_0_pon_resin
Andrew Halaney <[email protected]>
arm64: dts: qcom: sa8775p-ride: Describe sgmii_phy1 irq
Andrew Halaney <[email protected]>
arm64: dts: qcom: sa8775p-ride: Describe sgmii_phy0 irq
Marek Vasut <[email protected]>
arm64: dts: qcom: msm8996-xiaomi-gemini: Fix LP5562 LED1 reg property
Chen-Yu Tsai <[email protected]>
arm64: dts: mediatek: mt8183-kukui-jacuzzi: Drop pp3300_panel voltage settings
Joe Hattori <[email protected]>
memory: tegra20-emc: fix an OF node reference bug in tegra_emc_find_node_by_ram_code()
Marek Vasut <[email protected]>
ARM: dts: stm32: Swap USART3 and UART8 alias on STM32MP15xx DHCOM SoM
Marek Vasut <[email protected]>
ARM: dts: stm32: Deduplicate serial aliases and chosen node for STM32MP15xx DHCOM SoM
Nícolas F. R. A. Prado <[email protected]>
arm64: dts: mediatek: mt8195: Remove suspend-breaking reset from pcie1
Ma Ke <[email protected]>
RDMA/srp: Fix error handling in srp_add_port
Hsin-Te Yuan <[email protected]>
arm64: dts: mediatek: mt8183: willow: Support second source touchscreen
Hsin-Te Yuan <[email protected]>
arm64: dts: mediatek: mt8183: kenzo: Support second source touchscreen
zhenwei pi <[email protected]>
RDMA/rxe: Fix mismatched max_msg_sz
Li Zhijian <[email protected]>
RDMA/rxe: Improve newline in printing messages
Mamta Shukla <[email protected]>
arm: dts: socfpga: use reset-name "stmmaceth-ocp" instead of "ahb"
Ricky CX Wu <[email protected]>
ARM: dts: aspeed: yosemite4: correct the compatible string for max31790
Ricky CX Wu <[email protected]>
ARM: dts: aspeed: yosemite4: Add required properties for IOE on fan boards
Ricky CX Wu <[email protected]>
ARM: dts: aspeed: yosemite4: correct the compatible string of adm1272
Chen-Yu Tsai <[email protected]>
arm64: dts: mediatek: mt8173-evb: Fix MT6397 PMIC sub-node names
Chen-Yu Tsai <[email protected]>
arm64: dts: mediatek: mt8173-elm: Fix MT6397 PMIC sub-node names
Chen-Yu Tsai <[email protected]>
arm64: dts: mediatek: mt8195-demo: Drop regulator-compatible property
Chen-Yu Tsai <[email protected]>
arm64: dts: mediatek: mt8195-cherry: Drop regulator-compatible property
Chen-Yu Tsai <[email protected]>
arm64: dts: mediatek: mt8192-asurada: Drop regulator-compatible property
Chen-Yu Tsai <[email protected]>
arm64: dts: mediatek: mt8173-elm: Drop regulator-compatible property
Chen-Yu Tsai <[email protected]>
arm64: dts: mediatek: mt8173-evb: Drop regulator-compatible property
Dan Carpenter <[email protected]>
rdma/cxgb4: Prevent potential integer overflow on 32bit
Leon Romanovsky <[email protected]>
RDMA/mlx4: Avoid false error about access to uninitialized gids array
Arnaud Pouliquen <[email protected]>
ARM: dts: stm32: Fix IPCC EXTI declaration on stm32mp151
Val Packett <[email protected]>
arm64: dts: mediatek: mt8516: reserve 192 KiB for TF-A
Val Packett <[email protected]>
arm64: dts: mediatek: mt8516: add i2c clock-div property
Val Packett <[email protected]>
arm64: dts: mediatek: mt8516: fix wdt irq type
Val Packett <[email protected]>
arm64: dts: mediatek: mt8516: fix GICv2 range
Hsin-Yi Wang <[email protected]>
arm64: dts: mt8183: set DMIC one-wire mode on Damu
Nícolas F. R. A. Prado <[email protected]>
arm64: dts: mediatek: mt8186: Move wakeup to MTU3 to get working suspend
Nicolas Ferre <[email protected]>
ARM: at91: pm: change BU Power Switch to automatic mode
Javier Carrasco <[email protected]>
soc: atmel: fix device_node release in atmel_soc_device_init()
Pali Rohár <[email protected]>
cifs: Use cifs_autodisable_serverino() for disabling CIFS_MOUNT_SERVER_INUM in readdir.c
Paulo Alcantara <[email protected]>
smb: client: fix oops due to unset link speed
Chen Ridong <[email protected]>
padata: avoid UAF for reorder_work
Chen Ridong <[email protected]>
padata: add pd get/put refcnt helper
Chen Ridong <[email protected]>
padata: fix UAF in padata_reorder
Chun-Tse Shao <[email protected]>
perf lock: Fix parse_lock_type which only retrieve one lock flag
Kailang Yang <[email protected]>
ALSA: hda/realtek - Fixed headphone distorted sound on Acer Aspire A115-31 laptop
Daniel Xu <[email protected]>
bpf: tcp: Mark bpf_load_hdr_opt() arg2 as read-write
Puranjay Mohan <[email protected]>
bpf: Send signals asynchronously if !preemptible
Maciej S. Szmigiero <[email protected]>
pinctrl: amd: Take suspend type into consideration which pins are non-wake
Mingwei Zheng <[email protected]>
pinctrl: stm32: Add check for clk_enable()
Jiachen Zhang <[email protected]>
perf report: Fix misleading help message about --demangle
Cezary Rojewski <[email protected]>
ASoC: Intel: avs: Fix theoretical infinite loop
Cezary Rojewski <[email protected]>
ASoC: Intel: avs: Do not readq() u32 registers
Cezary Rojewski <[email protected]>
ASoC: Intel: avs: Abstract IPC handling
Cezary Rojewski <[email protected]>
ASoC: Intel: avs: Prefix SKL/APL-specific members
Arnaldo Carvalho de Melo <[email protected]>
perf namespaces: Fixup the nsinfo__in_pidns() return type, its bool
Arnaldo Carvalho de Melo <[email protected]>
perf namespaces: Introduce nsinfo__set_in_pidns()
Christophe Leroy <[email protected]>
perf machine: Don't ignore _etext when not a text symbol
Arnaldo Carvalho de Melo <[email protected]>
perf top: Don't complain about lack of vmlinux when not resolving some kernel samples
Thomas Weißschuh <[email protected]>
padata: fix sysfs store callback check
Takashi Iwai <[email protected]>
ALSA: seq: Make dependency on UMP clearer
Masahiro Yamada <[email protected]>
ALSA: seq: remove redundant 'tristate' for SND_SEQ_UMP_CLIENT
Joe Hattori <[email protected]>
crypto: ixp4xx - fix OF node reference leaks in init_ixp_crypto()
Wenkai Lin <[email protected]>
crypto: hisilicon/sec2 - fix for aead invalid authsize
Wenkai Lin <[email protected]>
crypto: hisilicon/sec2 - fix for aead icv error
Chenghai Huang <[email protected]>
crypto: hisilicon/sec2 - optimize the error return process
Martin KaFai Lau <[email protected]>
bpf: bpf_local_storage: Always use bpf_mem_alloc in PREEMPT_RT
Ba Jing <[email protected]>
ktest.pl: Remove unused declarations in run_bisect_test function
Levi Yun <[email protected]>
perf expr: Initialize is_test value in expr__ctx_new()
Claudiu Beznea <[email protected]>
ASoC: renesas: rz-ssi: Use only the proper amount of dividers
Zhongqiu Han <[email protected]>
perf bpf: Fix two memory leakages when calling perf_env__insert_bpf_prog_info()
Zhongqiu Han <[email protected]>
perf header: Fix one memory leakage in process_bpf_prog_info()
Zhongqiu Han <[email protected]>
perf header: Fix one memory leakage in process_bpf_btf()
Gaurav Jain <[email protected]>
crypto: caam - use JobR's space to access page 0 regs
Herbert Xu <[email protected]>
crypto: api - Fix boot-up self-test race
Saket Kumar Bhaskar <[email protected]>
selftests/bpf: Fix fill_link_info selftest on powerpc
George Lander <[email protected]>
ASoC: sun4i-spdif: Add clock multiplier settings
Quentin Monnet <[email protected]>
libbpf: Fix segfault due to libelf functions not setting errno
Marco Leogrande <[email protected]>
tools/testing/selftests/bpf/test_tc_tunnel.sh: Fix wait for server bind
Andrii Nakryiko <[email protected]>
libbpf: don't adjust USDT semaphore address if .stapsdt.base addr is missing
Nikita Zhandarovich <[email protected]>
net/rose: prevent integer overflows in rose_setsockopt()
Mahdi Arghavani <[email protected]>
tcp_cubic: fix incorrect HyStart round start detection
Roger Quadros <[email protected]>
net: ethernet: ti: am65-cpsw: fix freeing IRQ in am65_cpsw_nuss_remove_tx_chns()
Florian Westphal <[email protected]>
netfilter: nft_flow_offload: update tcp state flags under lock
Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: fix set size with rbtree backend
Florian Westphal <[email protected]>
netfilter: nft_set_rbtree: prefer sync gc to async worker
Florian Westphal <[email protected]>
netfilter: nft_set_rbtree: rename gc deactivate+erase function
Florian Westphal <[email protected]>
netfilter: nf_tables: de-constify set commit ops function argument
Jamal Hadi Salim <[email protected]>
net: sched: Disallow replacing of child qdisc from one parent to another
Antoine Tenart <[email protected]>
net: avoid race between device unregistration and ethnl ops
Shinas Rasheed <[email protected]>
octeon_ep: remove firmware stats fetch in ndo_get_stats64
Maher Sanalla <[email protected]>
net/mlxfw: Drop hard coded max FW flash image size
Liu Jian <[email protected]>
net: let net.core.dev_weight always be non-zero
Mickaël Salaün <[email protected]>
selftests/landlock: Fix error message
Mingwei Zheng <[email protected]>
pwm: stm32: Add check for clk_enable()
Bo Gan <[email protected]>
clk: analogbits: Fix incorrect calculation of vco rate delta
Eric Dumazet <[email protected]>
inet: ipmr: fix data-races
Dmitry Antipov <[email protected]>
wifi: cfg80211: adjust allocation of colocated AP data
Ilan Peer <[email protected]>
wifi: cfg80211: Handle specific BSSID in 6GHz scanning
Dmitry V. Levin <[email protected]>
selftests: harness: fix printing of mismatch values in __EXPECT()
Geert Uytterhoeven <[email protected]>
selftests: timers: clocksource-switch: Adapt progress to kselftest framework
Gautham R. Shenoy <[email protected]>
cpufreq: ACPI: Fix max-frequency computation
Peter Chiu <[email protected]>
wifi: mt76: mt7996: fix ldpc setting
Benjamin Lin <[email protected]>
wifi: mt76: mt7996: fix incorrect indexing of MIB FW event
Howard Hsu <[email protected]>
wifi: mt76: mt7996: fix HE Phy capability
Howard Hsu <[email protected]>
wifi: mt76: mt7996: fix the capability of reception of EHT MU PPDU
Peter Chiu <[email protected]>
wifi: mt76: mt7996: add max mpdu len capability
Peter Chiu <[email protected]>
wifi: mt76: mt7996: fix register mapping
Peter Chiu <[email protected]>
wifi: mt76: mt7915: fix register mapping
Felix Fietkau <[email protected]>
wifi: mt76: mt7915: fix omac index assignment after hardware reset
Felix Fietkau <[email protected]>
wifi: mt76: mt7915: improve hardware restart reliability
Felix Fietkau <[email protected]>
wifi: mt76: connac: move mt7615_mcu_del_wtbl_all to connac
Felix Fietkau <[email protected]>
wifi: mt76: mt7915: firmware restart on devices with a second pcie link
Felix Fietkau <[email protected]>
wifi: mt76: mt7996: fix rx filter setting for bfee functionality
xueqin Luo <[email protected]>
wifi: mt76: mt7915: fix overflows seen when writing limit attributes
Michael Lo <[email protected]>
wifi: mt76: mt7921: fix using incorrect group cipher after disconnection.
WangYuli <[email protected]>
wifi: mt76: mt76u_vendor_request: Do not print error messages when -EPROTO
Mickaël Salaün <[email protected]>
landlock: Handle weird files
Guangguan Wang <[email protected]>
net/smc: fix data error when recvmsg with MSG_PEEK flag
Sergio Paracuellos <[email protected]>
clk: ralink: mtmips: remove duplicated 'xtal' clock for Ralink SoC RT3883
Johannes Berg <[email protected]>
wifi: mac80211: don't flush non-uploaded STAs
Ilan Peer <[email protected]>
wifi: mac80211: Fix common size calculation for ML element
Andy Strohman <[email protected]>
wifi: mac80211: fix tid removal during mesh forwarding
Johannes Berg <[email protected]>
wifi: mac80211: prohibit deactivating all links
Nicolas Cavallari <[email protected]>
wifi: mt76: mt7915: Fix mesh scan on MT7916 DBDC
Andreas Kemnade <[email protected]>
wifi: wlcore: fix unbalanced pm_runtime calls
Zichen Xie <[email protected]>
samples/landlock: Fix possible NULL dereference in parse_path()
Rob Herring (Arm) <[email protected]>
mfd: syscon: Fix race in device_node_get_regmap()
Krzysztof Kozlowski <[email protected]>
mfd: syscon: Use scoped variables with memory allocators to simplify error paths
Peter Griffin <[email protected]>
mfd: syscon: Add of_syscon_register_regmap() API
Peter Griffin <[email protected]>
mfd: syscon: Remove extern from function prototypes
Joe Hattori <[email protected]>
leds: cht-wcove: Use devm_led_classdev_register() to avoid memory leak
Terry Tritton <[email protected]>
HID: fix generic desktop D-Pad controls
Karol Przybylski <[email protected]>
HID: hid-thrustmaster: Fix warning in thrustmaster_probe by adding endpoint check
Amit Pundir <[email protected]>
clk: qcom: gcc-sdm845: Do not use shared clk_ops for QUPs
Sathishkumar Muruganandam <[email protected]>
wifi: ath12k: fix tx power, max reg power update to firmware
Quan Nguyen <[email protected]>
ipmi: ssif_bmc: Fix new request loss when bmc ready for a response
Joe Hattori <[email protected]>
OPP: OF: Fix an OF node leak in _opp_add_static_v2()
Eric Dumazet <[email protected]>
ax25: rcu protect dev->ax25_ptr
Joe Hattori <[email protected]>
regulator: of: Implement the unwind path of of_regulator_match()
Vasily Khoruzhick <[email protected]>
clk: sunxi-ng: a64: stop force-selecting PLL-MIPI as TCON0 parent
Vasily Khoruzhick <[email protected]>
clk: sunxi-ng: a64: drop redundant CLK_PLL_VIDEO0_2X and CLK_PLL_MIPI
Vasily Khoruzhick <[email protected]>
dt-bindings: clock: sunxi: Export PLL_VIDEO_2X and PLL_MIPI
Octavian Purdila <[email protected]>
team: prevent adding a device which is already a team device lower
Marek Vasut <[email protected]>
clk: imx8mp: Fix clkout1/2 support
Manivannan Sadhasivam <[email protected]>
cpufreq: qcom: Implement clk_ops::determine_rate() for qcom_cpufreq* clocks
Manivannan Sadhasivam <[email protected]>
cpufreq: qcom: Fix qcom_cpufreq_hw_recalc_rate() to query LUT if LMh IRQ is not available
Luca Ceresoli <[email protected]>
gpio: pca953x: log an error when failing to get the reset GPIO
Andy Shevchenko <[email protected]>
gpio: pca953x: Fully convert to device managed resources
Andy Shevchenko <[email protected]>
gpio: pca953x: Drop unused fields in struct pca953x_platform_data
Sultan Alsawaf (unemployed) <[email protected]>
cpufreq: schedutil: Fix superfluous updates caused by need_freq_update
Mingwei Zheng <[email protected]>
pwm: stm32-lp: Add check for clk_enable()
Eric Dumazet <[email protected]>
inetpeer: do not get a refcount in inet_getpeer()
Eric Dumazet <[email protected]>
inetpeer: update inetpeer timestamp in inet_getpeer()
Eric Dumazet <[email protected]>
inetpeer: remove create argument of inet_getpeer()
Eric Dumazet <[email protected]>
inetpeer: remove create argument of inet_getpeer_v[46]()
Joe Hattori <[email protected]>
leds: netxbig: Fix an OF node reference leak in netxbig_leds_get_of_pdata()
Matti Vaittinen <[email protected]>
dt-bindings: mfd: bd71815: Fix rsense and typos
He Rongguang <[email protected]>
cpupower: fix TSC MHz calculation
Joe Hattori <[email protected]>
ACPI: fan: cleanup resources in the error path of .probe()
Marcel Hamer <[email protected]>
wifi: brcmfmac: add missing header include for brcmf_dbg
Chen-Yu Tsai <[email protected]>
regulator: dt-bindings: mt6315: Drop regulator-compatible property
Jiri Kosina <[email protected]>
HID: multitouch: fix support for Goodix PID 0x01e9
Thadeu Lima de Souza Cascardo <[email protected]>
wifi: rtlwifi: pci: wait for firmware loading before releasing memory
Thadeu Lima de Souza Cascardo <[email protected]>
wifi: rtlwifi: fix memory leaks and invalid access at probe error path
Thadeu Lima de Souza Cascardo <[email protected]>
wifi: rtlwifi: destroy workqueue at rtl_deinit_core
Thadeu Lima de Souza Cascardo <[email protected]>
wifi: rtlwifi: remove unused check_buddy_priv
Geert Uytterhoeven <[email protected]>
dt-bindings: leds: class-multicolor: Fix path to color definitions
Joe Hattori <[email protected]>
clk: fix an OF node reference leak in of_clk_get_parent_name()
Luca Ceresoli <[email protected]>
of: remove internal arguments from of_property_for_each_u32()
Alvin Šipraga <[email protected]>
clk: si5351: allow PLLs to be adjusted without reset
Hugo Villeneuve <[email protected]>
serial: sc16is7xx: use device_property APIs when configuring irda mode
Neil Armstrong <[email protected]>
dt-bindings: mmc: controller: clarify the address-cells description
David Howells <[email protected]>
rxrpc: Fix handling of received connection abort
Mingwei Zheng <[email protected]>
spi: zynq-qspi: Add check for clk_enable()
Octavian Purdila <[email protected]>
net_sched: sch_sfq: don't allow 1 packet limit
Eric Dumazet <[email protected]>
net_sched: sch_sfq: handle bigger packets
Eric Dumazet <[email protected]>
net_sched: sch_sfq: annotate data-races around q->perturb_period
Barnabás Czémán <[email protected]>
wifi: wcn36xx: fix channel survey memory allocation size
Thadeu Lima de Souza Cascardo <[email protected]>
wifi: rtlwifi: usb: fix workqueue leak when probe fails
Thadeu Lima de Souza Cascardo <[email protected]>
wifi: rtlwifi: fix init_sw_vars leak when probe fails
Thadeu Lima de Souza Cascardo <[email protected]>
wifi: rtlwifi: wait for firmware loading before releasing memory
Thadeu Lima de Souza Cascardo <[email protected]>
wifi: rtlwifi: rtl8192se: rise completion of firmware loading as last step
Thadeu Lima de Souza Cascardo <[email protected]>
wifi: rtlwifi: do not complete firmware loading needlessly
Balaji Pothunoori <[email protected]>
wifi: ath11k: Fix unexpected return buffer manager error for WCN6750/WCN6855
Charles Han <[email protected]>
ipmi: ipmb: Add check devm_kasprintf() returned value
Thomas Gleixner <[email protected]>
genirq: Make handle_enforce_irqctx() unconditionally available
Jiang Liu <[email protected]>
drm/amdgpu: tear down ttm range manager for doorbell in amdgpu_ttm_fini()
Hermes Wu <[email protected]>
drm/bridge: it6505: Change definition of AUX_FIFO_MAX_SIZE
Sui Jingfeng <[email protected]>
drm/msm: Check return value of of_dma_configure()
Dmitry Baryshkov <[email protected]>
drm/msm/dpu: link DSPP_2/_3 blocks on SM8550
Dmitry Baryshkov <[email protected]>
drm/msm/dpu: link DSPP_2/_3 blocks on SM8350
Dmitry Baryshkov <[email protected]>
drm/msm/dpu: link DSPP_2/_3 blocks on SM8250
Dmitry Baryshkov <[email protected]>
drm/msm/dpu: link DSPP_2/_3 blocks on SC8180X
Dmitry Baryshkov <[email protected]>
drm/msm/dpu: link DSPP_2/_3 blocks on SM8150
Neil Armstrong <[email protected]>
OPP: fix dev_pm_opp_find_bw_*() when bandwidth table not initialized
Neil Armstrong <[email protected]>
OPP: add index check to assert to avoid buffer overflow in _read_freq()
Bokun Zhang <[email protected]>
drm/amdgpu/vcn: reset fw_shared under SRIOV
Min-Hua Chen <[email protected]>
drm/rockchip: vop2: include rockchip_drm_drv.h
Andy Yan <[email protected]>
drm/rockchip: move output interface related definition to rockchip_drm_drv.h
Andy Yan <[email protected]>
drm/rockchip: vop2: Check linear format for Cluster windows on rk3566/8
Andy Yan <[email protected]>
drm/rockchip: vop2: Fix the windows switch between different layers
Andy Yan <[email protected]>
drm/rockchip: vop2: set bg dly and prescan dly at vop2_post_config
Andy Yan <[email protected]>
drm/rockchip: vop2: Set YUV/RGB overlay mode
Andy Yan <[email protected]>
drm/rockchip: vop2: Fix the mixer alpha setup for layer 0
Andy Yan <[email protected]>
drm/rockchip: vop2: Fix cluster windows alpha ctrl regsiters offset
Ivan Stepchenko <[email protected]>
drm/amdgpu: Fix potential NULL pointer dereference in atomctrl_get_smc_sclk_range_table
Christophe JAILLET <[email protected]>
drm/amd/pm: Fix an error handling path in vega10_enable_se_edc_force_stall_config()
Alan Stern <[email protected]>
HID: core: Fix assumption that Resolution Multipliers must be in Logical Collections
Sui Jingfeng <[email protected]>
drm/etnaviv: Fix page property being used for non writecombine buffers
Dmitry Baryshkov <[email protected]>
drm/msm/dp: set safe_to_exit_level before printing it
K Prateek Nayak <[email protected]>
x86/topology: Use x86_sched_itmt_flags for PKG domain unconditionally
Perry Yuan <[email protected]>
x86/cpu: Enable SD_ASYM_PACKING for PKG domain on AMD
Peter Zijlstra <[email protected]>
sched/topology: Rename 'DIE' domain to 'PKG'
Peter Zijlstra <[email protected]>
sched/fair: Fix value reported by hot tasks pulled in /proc/schedstat
Yabin Cui <[email protected]>
perf/core: Save raw sample data conditionally based on sample type
David Howells <[email protected]>
afs: Fix the fallback handling for the YFS.RemoveFile2 RPC call
Jens Axboe <[email protected]>
nvme: fix bogus kzalloc() return check in nvme_init_effects_log()
Christophe Leroy <[email protected]>
select: Fix unbalanced user_access_end()
Randy Dunlap <[email protected]>
partitions: ldm: remove the initial kernel-doc notation
Keisuke Nishimura <[email protected]>
nvme: Add error path for xa_store in nvme_init_effects
Michael Ellerman <[email protected]>
selftests/powerpc: Fix argument order to timer_sub()
Keisuke Nishimura <[email protected]>
nvme: Add error check for xa_store in nvme_get_effects_log
Eugen Hristev <[email protected]>
pstore/blk: trivial typo fixes
Yu Kuai <[email protected]>
nbd: don't allow reconnect after disconnect
Yang Erkun <[email protected]>
block: retry call probe after request_module in blk_request_module
Jinliang Zheng <[email protected]>
fs: fix proc_handler for sysctl_nr_open
David Howells <[email protected]>
afs: Fix cleanup of immediately failed async calls
David Howells <[email protected]>
afs: Fix directory format encoding struct
David Howells <[email protected]>
afs: Fix EEXIST error returned from afs_rmdir() to be ENOTEMPTY
Alexander Aring <[email protected]>
dlm: fix srcu_read_lock() return type to int
Sourabh Jain <[email protected]>
powerpc/book3s64/hugetlb: Fix disabling hugetlb when fadump is active
-------------
Diffstat:
.../bindings/leds/leds-class-multicolor.yaml | 2 +- .../devicetree/bindings/mfd/rohm,bd71815-pmic.yaml | 20 +- .../devicetree/bindings/mmc/mmc-controller.yaml | 2 +- .../bindings/regulator/mt6315-regulator.yaml | 6 - Makefile | 6 +- .../dts/aspeed/aspeed-bmc-facebook-yosemite4.dts | 24 +- .../boot/dts/intel/socfpga/socfpga_arria10.dtsi | 6 +- arch/arm/boot/dts/mediatek/mt7623.dtsi | 2 +- .../boot/dts/microchip/at91-sama5d27_wlsom1_ek.dts | 2 +- arch/arm/boot/dts/st/stm32mp151.dtsi | 2 +- arch/arm/boot/dts/st/stm32mp15xx-dhcom-drc02.dtsi | 12 - arch/arm/boot/dts/st/stm32mp15xx-dhcom-pdk2.dtsi | 10 - .../arm/boot/dts/st/stm32mp15xx-dhcom-picoitx.dtsi | 10 - arch/arm/boot/dts/st/stm32mp15xx-dhcom-som.dtsi | 7 + arch/arm/mach-at91/pm.c | 31 +- arch/arm/mach-omap1/board-nokia770.c | 2 +- .../boot/dts/allwinner/sun50i-a64-pinebook.dts | 2 + .../boot/dts/allwinner/sun50i-a64-teres-i.dts | 2 + arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 2 + arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi | 29 +- arch/arm64/boot/dts/mediatek/mt8173-evb.dts | 25 +- .../dts/mediatek/mt8183-kukui-jacuzzi-damu.dts | 4 + .../dts/mediatek/mt8183-kukui-jacuzzi-kenzo.dts | 15 + .../dts/mediatek/mt8183-kukui-jacuzzi-willow.dtsi | 15 + .../boot/dts/mediatek/mt8183-kukui-jacuzzi.dtsi | 2 - arch/arm64/boot/dts/mediatek/mt8183.dtsi | 3 +- arch/arm64/boot/dts/mediatek/mt8186.dtsi | 8 +- arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi | 3 - arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi | 2 - arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 9 - arch/arm64/boot/dts/mediatek/mt8195.dtsi | 5 +- arch/arm64/boot/dts/mediatek/mt8365.dtsi | 3 +- arch/arm64/boot/dts/mediatek/mt8516.dtsi | 11 +- arch/arm64/boot/dts/mediatek/pumpkin-common.dtsi | 2 - arch/arm64/boot/dts/nvidia/tegra234.dtsi | 2 +- arch/arm64/boot/dts/qcom/Makefile | 3 + arch/arm64/boot/dts/qcom/msm8916.dtsi | 2 +- arch/arm64/boot/dts/qcom/msm8939.dtsi | 2 +- arch/arm64/boot/dts/qcom/msm8994.dtsi | 11 +- arch/arm64/boot/dts/qcom/msm8996-xiaomi-gemini.dts | 2 +- arch/arm64/boot/dts/qcom/msm8996.dtsi | 9 +- arch/arm64/boot/dts/qcom/pm6150.dtsi | 2 +- arch/arm64/boot/dts/qcom/pm6150l.dtsi | 3 - arch/arm64/boot/dts/qcom/qcs404.dtsi | 2 +- arch/arm64/boot/dts/qcom/qdu1000-idp.dts | 2 +- arch/arm64/boot/dts/qcom/qrb4210-rb2.dts | 2 +- arch/arm64/boot/dts/qcom/qru1000-idp.dts | 2 +- arch/arm64/boot/dts/qcom/sa8775p-ride.dts | 829 +-------------------- arch/arm64/boot/dts/qcom/sa8775p-ride.dtsi | 814 ++++++++++++++++++++ arch/arm64/boot/dts/qcom/sc7180-firmware-tfa.dtsi | 84 +-- .../arm64/boot/dts/qcom/sc7180-trogdor-coachz.dtsi | 9 +- .../boot/dts/qcom/sc7180-trogdor-homestar.dtsi | 9 +- .../arm64/boot/dts/qcom/sc7180-trogdor-pompom.dtsi | 7 +- .../dts/qcom/sc7180-trogdor-quackingstick.dtsi | 1 + .../boot/dts/qcom/sc7180-trogdor-wormdingler.dtsi | 9 +- arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi | 3 - arch/arm64/boot/dts/qcom/sc7180.dtsi | 387 +++++----- arch/arm64/boot/dts/qcom/sc7280.dtsi | 2 +- arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 6 +- ...dts => sdm845-db845c-navigation-mezzanine.dtso} | 46 +- arch/arm64/boot/dts/qcom/sdm845.dtsi | 20 +- arch/arm64/boot/dts/qcom/sdx75.dtsi | 2 +- arch/arm64/boot/dts/qcom/sm4450.dtsi | 2 +- arch/arm64/boot/dts/qcom/sm6125.dtsi | 2 +- arch/arm64/boot/dts/qcom/sm6375.dtsi | 2 +- arch/arm64/boot/dts/qcom/sm7125.dtsi | 16 + arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts | 2 +- .../boot/dts/qcom/sm8150-microsoft-surface-duo.dts | 4 +- arch/arm64/boot/dts/qcom/sm8250.dtsi | 30 +- arch/arm64/boot/dts/qcom/sm8350.dtsi | 2 +- arch/arm64/boot/dts/qcom/sm8450.dtsi | 2 +- arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 1 - arch/arm64/boot/dts/ti/k3-am62a-main.dtsi | 1 - arch/hexagon/include/asm/cmpxchg.h | 2 +- arch/hexagon/kernel/traps.c | 4 +- arch/loongarch/include/asm/hw_breakpoint.h | 4 +- arch/loongarch/include/asm/loongarch.h | 60 ++ arch/loongarch/kernel/hw_breakpoint.c | 16 +- arch/loongarch/power/platform.c | 2 +- arch/powerpc/include/asm/hugetlb.h | 9 + arch/powerpc/kernel/smp.c | 4 +- arch/powerpc/sysdev/xive/native.c | 4 +- arch/powerpc/sysdev/xive/spapr.c | 3 +- arch/riscv/kernel/vector.c | 2 +- arch/s390/Makefile | 2 +- arch/s390/kernel/perf_cpum_cf.c | 2 +- arch/s390/kernel/perf_pai_crypto.c | 2 +- arch/s390/kernel/perf_pai_ext.c | 2 +- arch/s390/kernel/topology.c | 2 +- arch/s390/purgatory/Makefile | 2 +- arch/x86/events/amd/ibs.c | 2 +- arch/x86/kernel/smpboot.c | 12 +- block/genhd.c | 22 +- block/partitions/ldm.h | 2 +- crypto/algapi.c | 4 +- drivers/acpi/acpica/achware.h | 2 - drivers/acpi/fan_core.c | 10 +- drivers/base/class.c | 9 +- drivers/base/power/main.c | 146 ++-- drivers/block/nbd.c | 1 + drivers/bluetooth/btnxpuart.c | 3 +- drivers/bus/ti-sysc.c | 4 +- drivers/char/ipmi/ipmb_dev_int.c | 3 + drivers/char/ipmi/ssif_bmc.c | 5 +- drivers/clk/analogbits/wrpll-cln28hpc.c | 2 +- drivers/clk/clk-conf.c | 4 +- drivers/clk/clk-si5351.c | 76 +- drivers/clk/clk.c | 14 +- drivers/clk/imx/clk-imx8mp.c | 5 +- drivers/clk/qcom/common.c | 4 +- drivers/clk/qcom/gcc-sdm845.c | 32 +- drivers/clk/ralink/clk-mtmips.c | 1 - drivers/clk/sunxi-ng/ccu-sun50i-a64.c | 13 +- drivers/clk/sunxi-ng/ccu-sun50i-a64.h | 2 - drivers/clk/sunxi/clk-simple-gates.c | 4 +- drivers/clk/sunxi/clk-sun8i-bus-gates.c | 4 +- drivers/clocksource/samsung_pwm_timer.c | 4 +- drivers/cpufreq/acpi-cpufreq.c | 36 +- drivers/cpufreq/qcom-cpufreq-hw.c | 34 +- drivers/crypto/caam/blob_gen.c | 3 +- drivers/crypto/hisilicon/sec2/sec.h | 3 +- drivers/crypto/hisilicon/sec2/sec_crypto.c | 164 ++-- drivers/crypto/hisilicon/sec2/sec_crypto.h | 11 - drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c | 3 + drivers/dma/ti/edma.c | 3 +- drivers/firmware/efi/sysfb_efi.c | 2 +- drivers/gpio/gpio-brcmstb.c | 5 +- drivers/gpio/gpio-mxc.c | 3 +- drivers/gpio/gpio-pca953x.c | 108 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 1 + drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 2 + .../gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c | 2 + .../drm/amd/pm/powerplay/hwmgr/vega10_powertune.c | 5 +- drivers/gpu/drm/bridge/ite-it6505.c | 2 +- drivers/gpu/drm/etnaviv/etnaviv_gem.c | 16 +- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 8 +- .../gpu/drm/msm/disp/dpu1/catalog/dpu_5_0_sm8150.h | 2 + .../drm/msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h | 2 + .../gpu/drm/msm/disp/dpu1/catalog/dpu_6_0_sm8250.h | 2 + .../gpu/drm/msm/disp/dpu1/catalog/dpu_7_0_sm8350.h | 2 + .../gpu/drm/msm/disp/dpu1/catalog/dpu_9_0_sm8550.h | 2 + drivers/gpu/drm/msm/dp/dp_audio.c | 2 +- drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 1 - drivers/gpu/drm/rockchip/cdn-dp-core.c | 1 - drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 1 - drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 1 - drivers/gpu/drm/rockchip/inno_hdmi.c | 1 - drivers/gpu/drm/rockchip/rk3066_hdmi.c | 1 - drivers/gpu/drm/rockchip/rockchip_drm_drv.h | 18 + drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 12 - drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 121 ++- drivers/gpu/drm/rockchip/rockchip_drm_vop2.h | 18 +- drivers/gpu/drm/rockchip/rockchip_lvds.c | 1 - drivers/gpu/drm/rockchip/rockchip_rgb.c | 1 - drivers/hid/hid-core.c | 2 + drivers/hid/hid-input.c | 37 +- drivers/hid/hid-multitouch.c | 2 +- drivers/hid/hid-thrustmaster.c | 8 + drivers/i3c/master/dw-i3c-master.c | 66 +- drivers/i3c/master/dw-i3c-master.h | 2 + drivers/iio/adc/ti_am335x_adc.c | 4 +- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 7 +- drivers/infiniband/hw/cxgb4/device.c | 6 +- drivers/infiniband/hw/mlx4/main.c | 8 +- drivers/infiniband/hw/mlx5/odp.c | 32 +- drivers/infiniband/sw/rxe/rxe.c | 6 +- drivers/infiniband/sw/rxe/rxe.h | 6 +- drivers/infiniband/sw/rxe/rxe_comp.c | 4 +- drivers/infiniband/sw/rxe/rxe_cq.c | 4 +- drivers/infiniband/sw/rxe/rxe_mr.c | 16 +- drivers/infiniband/sw/rxe/rxe_mw.c | 2 +- drivers/infiniband/sw/rxe/rxe_param.h | 2 +- drivers/infiniband/sw/rxe/rxe_pool.c | 11 +- drivers/infiniband/sw/rxe/rxe_qp.c | 8 +- drivers/infiniband/sw/rxe/rxe_resp.c | 12 +- drivers/infiniband/sw/rxe/rxe_task.c | 4 +- drivers/infiniband/sw/rxe/rxe_verbs.c | 221 +++--- drivers/infiniband/ulp/srp/ib_srp.c | 1 - drivers/irqchip/irq-atmel-aic-common.c | 4 +- drivers/irqchip/irq-pic32-evic.c | 4 +- drivers/leds/leds-cht-wcove.c | 6 +- drivers/leds/leds-netxbig.c | 1 + drivers/media/i2c/imx290.c | 3 +- drivers/media/i2c/imx412.c | 42 +- drivers/media/i2c/ov9282.c | 2 +- drivers/media/platform/marvell/mcam-core.c | 7 +- drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c | 7 +- .../media/platform/nxp/imx8-isi/imx8-isi-video.c | 3 + .../media/platform/samsung/exynos4-is/mipi-csis.c | 10 +- .../media/platform/samsung/s3c-camif/camif-core.c | 13 +- drivers/media/rc/iguanair.c | 4 +- drivers/media/usb/dvb-usb-v2/af9035.c | 18 +- drivers/media/usb/dvb-usb-v2/lmedm04.c | 12 +- drivers/media/usb/uvc/uvc_queue.c | 3 +- drivers/media/usb/uvc/uvc_status.c | 1 + drivers/memory/tegra/tegra20-emc.c | 8 +- drivers/mfd/syscon.c | 81 +- drivers/mfd/ti_am335x_tscadc.c | 4 +- drivers/misc/cardreader/rtsx_usb.c | 15 + drivers/mtd/hyperbus/hbmc-am654.c | 25 +- drivers/mtd/nand/raw/brcmnand/brcmnand.c | 5 + drivers/net/ethernet/broadcom/bgmac.h | 3 +- drivers/net/ethernet/davicom/dm9000.c | 3 +- drivers/net/ethernet/freescale/fec_main.c | 31 +- drivers/net/ethernet/hisilicon/hns3/hnae3.c | 15 + drivers/net/ethernet/hisilicon/hns3/hnae3.h | 2 + drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 2 + .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 + .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 2 + drivers/net/ethernet/intel/iavf/iavf_main.c | 19 +- .../net/ethernet/marvell/octeon_ep/octep_main.c | 10 - drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c | 2 - drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c | 8 +- drivers/net/ethernet/renesas/sh_eth.c | 4 + drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 30 + drivers/net/ethernet/ti/am65-cpsw-nuss.c | 2 +- drivers/net/netdevsim/netdevsim.h | 1 + drivers/net/netdevsim/udp_tunnels.c | 23 +- drivers/net/team/team.c | 7 + drivers/net/usb/rtl8150.c | 22 + drivers/net/vxlan/vxlan_vnifilter.c | 5 + drivers/net/wireless/ath/ath11k/dp_rx.c | 1 + drivers/net/wireless/ath/ath11k/hal_rx.c | 3 +- drivers/net/wireless/ath/ath12k/mac.c | 6 +- drivers/net/wireless/ath/wcn36xx/main.c | 5 +- .../wireless/broadcom/brcm80211/brcmfmac/fwil.h | 2 + drivers/net/wireless/mediatek/mt76/mt7615/init.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 10 - drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h | 1 - .../net/wireless/mediatek/mt76/mt76_connac_mcu.c | 11 + .../net/wireless/mediatek/mt76/mt76_connac_mcu.h | 1 + drivers/net/wireless/mediatek/mt76/mt7915/init.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 34 +- drivers/net/wireless/mediatek/mt76/mt7915/main.c | 15 +- drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 2 + drivers/net/wireless/mediatek/mt76/mt7915/mmio.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h | 1 + drivers/net/wireless/mediatek/mt76/mt7915/pci.c | 1 + drivers/net/wireless/mediatek/mt76/mt7921/main.c | 8 +- drivers/net/wireless/mediatek/mt76/mt7996/init.c | 15 +- drivers/net/wireless/mediatek/mt76/mt7996/main.c | 3 +- drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 47 +- drivers/net/wireless/mediatek/mt76/mt7996/mmio.c | 2 +- drivers/net/wireless/mediatek/mt76/usb.c | 4 +- drivers/net/wireless/realtek/rtlwifi/base.c | 13 +- drivers/net/wireless/realtek/rtlwifi/base.h | 1 - drivers/net/wireless/realtek/rtlwifi/pci.c | 61 +- .../net/wireless/realtek/rtlwifi/rtl8192se/sw.c | 7 +- drivers/net/wireless/realtek/rtlwifi/usb.c | 12 +- drivers/net/wireless/realtek/rtlwifi/wifi.h | 12 - drivers/net/wireless/ti/wlcore/main.c | 10 +- drivers/nvme/host/core.c | 34 +- drivers/of/of_reserved_mem.c | 3 +- drivers/opp/core.c | 57 +- drivers/opp/of.c | 4 +- drivers/pci/controller/dwc/pci-imx6.c | 139 ++-- drivers/pci/controller/pcie-rcar-ep.c | 2 +- drivers/pci/endpoint/functions/pci-epf-test.c | 6 +- drivers/pci/endpoint/pci-epc-core.c | 2 +- drivers/pinctrl/nxp/pinctrl-s32cc.c | 4 +- drivers/pinctrl/pinctrl-amd.c | 27 +- drivers/pinctrl/pinctrl-amd.h | 7 +- drivers/pinctrl/pinctrl-k210.c | 4 +- drivers/pinctrl/stm32/pinctrl-stm32.c | 76 +- drivers/pps/clients/pps-gpio.c | 4 +- drivers/pps/clients/pps-ktimer.c | 4 +- drivers/pps/clients/pps-ldisc.c | 6 +- drivers/pps/clients/pps_parport.c | 4 +- drivers/pps/kapi.c | 10 +- drivers/pps/kc.c | 10 +- drivers/pps/pps.c | 127 ++-- drivers/ptp/ptp_chardev.c | 4 + drivers/ptp/ptp_ocp.c | 2 +- drivers/pwm/pwm-samsung.c | 4 +- drivers/pwm/pwm-stm32-lp.c | 8 +- drivers/pwm/pwm-stm32.c | 7 +- drivers/regulator/core.c | 2 +- drivers/regulator/of_regulator.c | 14 +- drivers/remoteproc/remoteproc_core.c | 14 +- drivers/rtc/rtc-loongson.c | 13 +- drivers/rtc/rtc-pcf85063.c | 11 +- drivers/scsi/mpt3sas/mpt3sas_base.c | 3 +- drivers/soc/atmel/soc.c | 2 +- drivers/spi/spi-omap2-mcspi.c | 11 +- drivers/spi/spi-zynq-qspi.c | 13 +- drivers/staging/media/imx/imx-media-of.c | 8 +- drivers/staging/media/max96712/max96712.c | 4 +- drivers/tty/serial/8250/8250_port.c | 32 +- drivers/tty/serial/sc16is7xx.c | 34 +- drivers/tty/sysrq.c | 4 +- drivers/ufs/core/ufs_bsg.c | 1 + drivers/usb/dwc3/core.c | 30 +- drivers/usb/dwc3/dwc3-am62.c | 1 + drivers/usb/gadget/function/f_tcm.c | 14 +- drivers/usb/host/xhci-ring.c | 3 +- drivers/usb/misc/usb251xb.c | 4 +- drivers/usb/typec/tcpm/tcpci.c | 13 +- drivers/usb/typec/tcpm/tcpm.c | 10 +- drivers/vfio/iova_bitmap.c | 2 +- drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 1 + drivers/watchdog/rti_wdt.c | 1 + fs/afs/dir.c | 7 +- fs/afs/internal.h | 9 + fs/afs/rxrpc.c | 12 +- fs/afs/xdr_fs.h | 2 +- fs/afs/yfsclient.c | 5 +- fs/btrfs/super.c | 2 +- fs/buffer.c | 24 +- fs/dlm/lowcomms.c | 3 +- fs/f2fs/dir.c | 53 +- fs/f2fs/f2fs.h | 6 +- fs/f2fs/inline.c | 5 +- fs/file_table.c | 2 +- fs/hostfs/hostfs_kern.c | 157 ++-- fs/nfs/nfs42proc.c | 2 +- fs/nfs/nfs42xdr.c | 2 + fs/nfsd/nfs4callback.c | 1 + fs/nilfs2/segment.c | 11 +- fs/ocfs2/quota_global.c | 5 + fs/pstore/blk.c | 4 +- fs/select.c | 4 +- fs/smb/client/cifsacl.c | 25 +- fs/smb/client/cifsproto.h | 2 +- fs/smb/client/cifssmb.c | 4 +- fs/smb/client/readdir.c | 2 +- fs/smb/client/reparse.c | 22 +- fs/smb/client/smb2ops.c | 3 +- fs/ubifs/debug.c | 22 +- include/acpi/acpixf.h | 1 + include/dt-bindings/clock/sun50i-a64-ccu.h | 2 + include/linux/buffer_head.h | 4 +- include/linux/hid.h | 1 + include/linux/ieee80211.h | 11 +- include/linux/kallsyms.h | 2 +- include/linux/mfd/syscon.h | 33 +- include/linux/mroute_base.h | 6 +- include/linux/netdevice.h | 2 +- include/linux/of.h | 15 +- include/linux/perf_event.h | 6 + include/linux/platform_data/pca953x.h | 13 - include/linux/platform_data/si5351.h | 2 + include/linux/pm.h | 32 +- include/linux/pps_kernel.h | 3 +- include/linux/sched.h | 1 + include/linux/usb/tcpm.h | 3 +- include/net/ax25.h | 10 +- include/net/inetpeer.h | 12 +- include/net/netfilter/nf_tables.h | 8 +- include/net/xfrm.h | 16 +- include/trace/events/afs.h | 2 + include/trace/events/rxrpc.h | 25 + io_uring/uring_cmd.c | 2 +- kernel/bpf/bpf_local_storage.c | 8 +- kernel/events/core.c | 35 +- kernel/irq/internals.h | 9 +- kernel/padata.c | 45 +- kernel/power/hibernate.c | 7 +- kernel/sched/cpufreq_schedutil.c | 4 +- kernel/sched/fair.c | 19 +- kernel/sched/topology.c | 8 +- kernel/trace/bpf_trace.c | 13 +- net/ax25/af_ax25.c | 12 +- net/ax25/ax25_dev.c | 4 +- net/ax25/ax25_ip.c | 3 +- net/ax25/ax25_out.c | 22 +- net/ax25/ax25_route.c | 2 + net/core/dev.c | 4 + net/core/filter.c | 2 +- net/core/sysctl_net_core.c | 5 +- net/ethtool/netlink.c | 2 +- net/hsr/hsr_forward.c | 7 +- net/ipv4/icmp.c | 9 +- net/ipv4/inetpeer.c | 31 +- net/ipv4/ip_fragment.c | 15 +- net/ipv4/ipmr.c | 28 +- net/ipv4/ipmr_base.c | 9 +- net/ipv4/route.c | 17 +- net/ipv4/tcp_cubic.c | 8 +- net/ipv4/tcp_output.c | 9 +- net/ipv6/icmp.c | 6 +- net/ipv6/ip6_output.c | 6 +- net/ipv6/ip6mr.c | 28 +- net/ipv6/ndisc.c | 8 +- net/mac80211/debugfs_netdev.c | 2 +- net/mac80211/driver-ops.h | 3 + net/mac80211/rx.c | 1 + net/mptcp/options.c | 13 +- net/mptcp/protocol.c | 4 +- net/mptcp/protocol.h | 30 +- net/netfilter/nf_tables_api.c | 57 +- net/netfilter/nft_flow_offload.c | 16 +- net/netfilter/nft_set_pipapo.c | 7 +- net/netfilter/nft_set_rbtree.c | 178 +++-- net/rose/af_rose.c | 16 +- net/rose/rose_timer.c | 15 + net/rxrpc/conn_event.c | 12 +- net/sched/sch_api.c | 4 + net/sched/sch_sfq.c | 58 +- net/smc/af_smc.c | 2 +- net/smc/smc_rx.c | 37 +- net/smc/smc_rx.h | 8 +- net/sunrpc/svcsock.c | 12 +- net/vmw_vsock/af_vsock.c | 13 +- net/wireless/scan.c | 35 + net/xfrm/xfrm_replay.c | 10 +- samples/landlock/sandboxer.c | 7 + scripts/Makefile.lib | 4 +- scripts/genksyms/genksyms.c | 11 +- scripts/genksyms/genksyms.h | 2 +- scripts/genksyms/parse.y | 18 +- scripts/kconfig/conf.c | 6 + scripts/kconfig/confdata.c | 113 ++- scripts/kconfig/lkc_proto.h | 2 + scripts/kconfig/symbol.c | 10 + security/landlock/fs.c | 11 +- sound/core/seq/Kconfig | 5 +- sound/pci/hda/patch_realtek.c | 1 + sound/soc/codecs/arizona.c | 12 +- sound/soc/intel/avs/apl.c | 53 +- sound/soc/intel/avs/avs.h | 40 +- sound/soc/intel/avs/core.c | 51 +- sound/soc/intel/avs/ipc.c | 36 +- sound/soc/intel/avs/loader.c | 2 +- sound/soc/intel/avs/messages.h | 10 +- sound/soc/intel/avs/registers.h | 6 +- sound/soc/intel/avs/skl.c | 30 +- sound/soc/rockchip/rockchip_i2s_tdm.c | 31 +- sound/soc/sh/rz-ssi.c | 3 +- sound/soc/sunxi/sun4i-spdif.c | 7 + sound/usb/quirks.c | 2 + tools/bootconfig/main.c | 4 +- tools/lib/bpf/linker.c | 22 +- tools/lib/bpf/usdt.c | 2 +- tools/perf/builtin-lock.c | 66 +- tools/perf/builtin-report.c | 2 +- tools/perf/builtin-top.c | 2 +- tools/perf/builtin-trace.c | 6 +- tools/perf/util/bpf-event.c | 10 +- tools/perf/util/env.c | 13 +- tools/perf/util/env.h | 4 +- tools/perf/util/expr.c | 5 +- tools/perf/util/header.c | 8 +- tools/perf/util/machine.c | 2 +- tools/perf/util/namespaces.c | 7 +- tools/perf/util/namespaces.h | 3 +- .../cpupower/utils/idle_monitor/mperf_monitor.c | 15 +- tools/testing/ktest/ktest.pl | 7 +- .../selftests/bpf/prog_tests/fill_link_info.c | 4 + .../selftests/bpf/progs/test_fill_link_info.c | 13 +- tools/testing/selftests/bpf/test_tc_tunnel.sh | 1 + .../drivers/net/netdevsim/udp_tunnel_nic.sh | 16 +- tools/testing/selftests/kselftest_harness.h | 24 +- tools/testing/selftests/landlock/fs_test.c | 3 +- .../selftests/powerpc/benchmarks/gettimeofday.c | 2 +- tools/testing/selftests/rseq/rseq.c | 32 +- tools/testing/selftests/rseq/rseq.h | 9 +- .../testing/selftests/timers/clocksource-switch.c | 6 +- 457 files changed, 4603 insertions(+), 3454 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/393 powerpc/book3s64/hugetlb: Fix disabling hugetlb when fadump is active
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sourabh Jain <[email protected]>
[ Upstream commit d629d7a8efc33d05d62f4805c0ffb44727e3d99f ]
Commit 8597538712eb ("powerpc/fadump: Do not use hugepages when fadump is active") disabled hugetlb support when fadump is active by returning early from hugetlbpage_init():arch/powerpc/mm/hugetlbpage.c and not populating hpage_shift/HPAGE_SHIFT.
Later, commit 2354ad252b66 ("powerpc/mm: Update default hugetlb size early") moved the allocation of hpage_shift/HPAGE_SHIFT to early boot, which inadvertently re-enabled hugetlb support when fadump is active.
Fix this by implementing hugepages_supported() on powerpc. This ensures that disabling hugetlb for the fadump kernel is independent of hpage_shift/HPAGE_SHIFT.
--- arch/powerpc/include/asm/hugetlb.h | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/powerpc/include/asm/hugetlb.h +9 -0
@@ -15,6 +15,15 @@extern bool hugetlb_disabled; +static inline bool hugepages_supported (void ) +{ +if (hugetlb_disabled) +return false; + +return HPAGE_SHIFT !=0 ; +} +#define hugepages_supported hugepages_supported +void __init hugetlbpage_init_defaultsize (void ); int slice_is_hugepage_only_range(struct mm_struct *mm, unsigned long addr,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 2/393 dlm: fix srcu_read_lock() return type to int
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Aring <[email protected]>
[ Upstream commit 57cdd1a1cf1464199678f9338049b63fb5d5b41c ]
The return type of srcu_read_lock() is int and not bool. Whereas we using the ret variable only to evaluate a bool type of dlm_lowcomms_con_has_addr() to check if an address is already being set.
--- fs/dlm/lowcomms.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/dlm/lowcomms.c +2 -1
@@ -460,7 +460,8 @@ static bool dlm_lowcomms_con_has_addr(const struct connection *con,int dlm_lowcomms_addr (int nodeid,struct sockaddr_storage *addr,int len) {struct connection *con; -bool ret, idx; +bool ret; +int idx; idx =srcu_read_lock (&connections_srcu); con =nodeid2con (nodeid,GFP_NOFS );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 3/393 afs: Fix EEXIST error returned from afs_rmdir() to be ENOTEMPTY
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <[email protected]>
[ Upstream commit b49194da2aff2c879dec9c59ef8dec0f2b0809ef ]
AFS servers pass back a code indicating EEXIST when they're asked to remove a directory that is not empty rather than ENOTEMPTY because not all the systems that an AFS server can run on have the latter error available and AFS preexisted the addition of that error in general.
Fix afs_rmdir() to translate EEXIST to ENOTEMPTY.
--- fs/afs/dir.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
fs/afs/dir.c +6 -1
@@ -1458,7 +1458,12 @@ static int afs_rmdir(struct inode *dir, struct dentry *dentry) op->file[1 ].vnode = vnode; } -return afs_do_sync_operation (op); + ret =afs_do_sync_operation (op); + +/* Not all systems that can host afs servers have ENOTEMPTY. */ +if (ret == -EEXIST ) + ret = -ENOTEMPTY ; +return ret; error:return afs_put_operation (op);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 4/393 afs: Fix directory format encoding struct
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <[email protected]>
[ Upstream commit 07a10767853adcbdbf436dc91393b729b52c4e81 ]
The AFS directory format structure, union afs_xdr_dir_block::meta, has too many alloc counter slots declared and so pushes the hash table along and over the data. This doesn't cause a problem at the moment because I'm currently ignoring the hash table and only using the correct number of alloc_ctrs in the code anyway. In future, however, I should start using the hash table to try and speed up afs_lookup().
Fix this by using the correct constant to declare the counter array.
--- fs/afs/xdr_fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/afs/xdr_fs.h +1 -1
@@ -88,7 +88,7 @@ union afs_xdr_dir_block {struct {struct afs_xdr_dir_hdr hdr; -u8 alloc_ctrs[AFS_DIR_MAX_BLOCKS ]; +u8 alloc_ctrs[AFS_DIR_BLOCKS_WITH_CTR ];__be16 hashtable[AFS_DIR_HASHTBL_SIZE ]; } meta;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 5/393 afs: Fix cleanup of immediately failed async calls
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <[email protected]>
[ Upstream commit 9750be93b2be12b6d92323b97d7c055099d279e6 ]
If we manage to begin an async call, but fail to transmit any data on it due to a signal, we then abort it which causes a race between the notification of call completion from rxrpc and our attempt to cancel the notification. The notification will be necessary, however, for async FetchData to terminate the netfs subrequest.
However, since we get a notification from rxrpc upon completion of a call (aborted or otherwise), we can just leave it to that.
This leads to calls not getting cleaned up, but appearing in /proc/net/rxrpc/calls as being aborted with code 6.
Fix this by making the "error_do_abort:" case of afs_make_call() abort the call and then abandon it to the notification handler.
--- fs/afs/internal.h | 9 +++++++++ fs/afs/rxrpc.c | 12 +++++++++--- include/trace/events/afs.h | 2 ++ 3 files changed, 20 insertions(+), 3 deletions(-)
fs/afs/internal.h +9 -0
@@ -1286,6 +1286,15 @@ extern void afs_send_simple_reply(struct afs_call *, const void *, size_t);extern int afs_extract_data (struct afs_call *,bool );extern int afs_protocol_error (struct afs_call *,enum afs_eproto_cause ); +static inline void afs_see_call (struct afs_call *call,enum afs_call_trace why) +{ +int r =refcount_read (&call->ref); + +trace_afs_call (call->debug_id, why, r, +atomic_read (&call->net->nr_outstanding_calls), +__builtin_return_address (0 )); +} +static inline void afs_make_op_call (struct afs_operation *op,struct afs_call *call,gfp_t gfp) {
fs/afs/rxrpc.c +9 -3
@@ -396,11 +396,16 @@ void afs_make_call(struct afs_addr_cursor *ac, struct afs_call *call, gfp_t gfp)return ; error_do_abort: -if (ret != -ECONNABORTED ) { +if (ret != -ECONNABORTED )rxrpc_kernel_abort_call (call->net->socket, rxcall,RX_USER_ABORT , ret, afs_abort_send_data_error); - }else { +if (call->async) { +afs_see_call (call, afs_call_trace_async_abort); +return ; + } + +if (ret == -ECONNABORTED ) { len =0 ;iov_iter_kvec (&msg.msg_iter,ITER_DEST ,NULL ,0 ,0 ); rxrpc_kernel_recv_data(call->net->socket, rxcall,
@@ -412,6 +417,8 @@ void afs_make_call(struct afs_addr_cursor *ac, struct afs_call *call, gfp_t gfp) call->error = ret;trace_afs_call_done (call); error_kill_call: +if (call->async) +afs_see_call (call, afs_call_trace_async_kill);if (call->type->done) call->type->done (call);
@@ -566,7 +573,6 @@ static void afs_deliver_to_call(struct afs_call *call) abort_code =0 ; call_complete:afs_set_call_complete (call, ret, remote_abort); - state =AFS_CALL_COMPLETE ; goto done; }
include/trace/events/afs.h +2 -0
@@ -118,6 +118,8 @@ enum yfs_cm_operation {*/ #define afs_call_traces \ EM(afs_call_trace_alloc, "ALLOC") \ + EM(afs_call_trace_async_abort, "ASYAB") \ + EM(afs_call_trace_async_kill, "ASYKL") \ EM(afs_call_trace_free, "FREE ") \ EM(afs_call_trace_get, "GET ") \ EM(afs_call_trace_put, "PUT ") \
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 6/393 fs: fix proc_handler for sysctl_nr_open
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jinliang Zheng <[email protected]>
[ Upstream commit d727935cad9f6f52c8d184968f9720fdc966c669 ]
Use proc_douintvec_minmax() instead of proc_dointvec_minmax() to handle sysctl_nr_open, because its data type is unsigned int, not int.
--- fs/file_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/file_table.c +1 -1
@@ -133,7 +133,7 @@ static struct ctl_table fs_stat_sysctls[] = { .data = &sysctl_nr_open, .maxlen = sizeof(unsigned int), .mode = 0644, - .proc_handler = proc_dointvec_minmax, + .proc_handler = proc_douintvec_minmax, .extra1 = &sysctl_nr_open_min, .extra2 = &sysctl_nr_open_max, },
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 7/393 block: retry call probe after request_module in blk_request_module
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yang Erkun <[email protected]>
[ Upstream commit 457ef47c08d2979f3e59ce66267485c3faed70c8 ]
Set kernel config:
CONFIG_BLK_DEV_LOOP=m
CONFIG_BLK_DEV_LOOP_MIN_COUNT=0
Do latter:
mknod loop0 b 7 0
exec 4<> loop0
Before commit e418de3abcda ("block: switch gendisk lookup to a simple xarray"), lookup_gendisk will first use base_probe to load module loop, and then the retry will call loop_probe to prepare the loop disk. Finally open for this disk will success. However, after this commit, we lose the retry logic, and open will fail with ENXIO. Block device autoloading is deprecated and will be removed soon, but maybe we should keep open success until we really remove it. So, give a retry to fix it.
--- block/genhd.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-)
block/genhd.c +17 -5
@@ -763,7 +763,7 @@ static ssize_t disk_badblocks_store(struct device *dev, }#ifdef CONFIG_BLOCK_LEGACY_AUTOLOAD -void blk_request_module (dev_t devt) +static bool blk_probe_dev (dev_t devt) {unsigned int major =MAJOR (devt);struct blk_major_name **n;
@@ -773,14 +773,26 @@ void blk_request_module(dev_t devt)if ((*n)->major == major && (*n)->probe) { (*n)->probe (devt);mutex_unlock (&major_names_lock); -return ; +return true; } }mutex_unlock (&major_names_lock); +return false; +} + +void blk_request_module (dev_t devt) +{ +int error; + +if (blk_probe_dev (devt)) +return ; -if (request_module ("block-major-%d-%d" ,MAJOR (devt),MINOR (devt)) >0 ) -/* Make old-style 2.4 aliases work */ -request_module ("block-major-%d" ,MAJOR (devt)); + error =request_module ("block-major-%d-%d" ,MAJOR (devt),MINOR (devt)); +/* Make old-style 2.4 aliases work */ +if (error >0 ) + error =request_module ("block-major-%d" ,MAJOR (devt)); +if (!error) +blk_probe_dev (devt); }#endif /* CONFIG_BLOCK_LEGACY_AUTOLOAD */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 8/393 nbd: dont allow reconnect after disconnect
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yu Kuai <[email protected]>
[ Upstream commit 844b8cdc681612ff24df62cdefddeab5772fadf1 ]
Following process can cause nbd_config UAF:
1) grab nbd_config temporarily;
2) nbd_genl_disconnect() flush all recv_work() and release the initial reference:
nbd_genl_disconnect
nbd_disconnect_and_put
nbd_disconnect
flush_workqueue(nbd->recv_workq)
if (test_and_clear_bit(NBD_RT_HAS_CONFIG_REF, ...))
nbd_config_put
-> due to step 1), reference is still not zero3) nbd_genl_reconfigure() queue recv_work() again;
nbd_genl_reconfigure
config = nbd_get_config_unlocked(nbd)
if (!config)
-> succeed
if (!test_bit(NBD_RT_BOUND, ...))
-> succeed
nbd_reconnect_socket
queue_work(nbd->recv_workq, &args->work)
4) step 1) release the reference;
5) Finially, recv_work() will trigger UAF:
recv_work
nbd_config_put(nbd)
-> nbd_config is freed
atomic_dec(&config->recv_threads)
-> UAF
Fix the problem by clearing NBD_RT_BOUND in nbd_genl_disconnect(), so that nbd_genl_reconfigure() will fail.
--- drivers/block/nbd.c | 1 + 1 file changed, 1 insertion(+)
drivers/block/nbd.c +1 -0
@@ -2164,6 +2164,7 @@ static void nbd_disconnect_and_put(struct nbd_device *nbd)flush_workqueue (nbd->recv_workq);nbd_clear_que (nbd); nbd->task_setup =NULL ; +clear_bit (NBD_RT_BOUND , &nbd->config->runtime_flags);mutex_unlock (&nbd->config_lock); if (test_and_clear_bit(NBD_RT_HAS_CONFIG_REF,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 9/393 pstore/blk: trivial typo fixes
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eugen Hristev <[email protected]>
[ Upstream commit 542243af7182efaeaf6d0f4643f7de437541a9af ]
Fix trivial typos in comments.
--- fs/pstore/blk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/pstore/blk.c +2 -2
@@ -89,7 +89,7 @@ static struct pstore_device_info *pstore_device_info; _##name_ = check_size(name, alignsize); \ else \ _##name_ = 0; \ - /* Synchronize module parameters with resuls. */ \ + /* Synchronize module parameters with results. */ \ name = _##name_ / 1024; \ dev->zone.name = _##name_; \ }
@@ -121,7 +121,7 @@ static int __register_pstore_device(struct pstore_device_info *dev)if (pstore_device_info)return -EBUSY ; -/* zero means not limit on which backends to attempt to store. */ +/* zero means no limit on which backends attempt to store. */ if (!dev->flags) dev->flags =UINT_MAX ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 10/393 nvme: Add error check for xa_store in nvme_get_effects_log
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Keisuke Nishimura <[email protected]>
[ Upstream commit ac32057acc7f3d7a238dafaa9b2aa2bc9750080e ]
The xa_store() may fail due to memory allocation failure because there is no guarantee that the index csi is already used. This fix adds an error check of the return value of xa_store() in nvme_get_effects_log().
--- drivers/nvme/host/core.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/nvme/host/core.c +6 -2
@@ -2853,7 +2853,7 @@ int nvme_get_log(struct nvme_ctrl *ctrl, u32 nsid, u8 log_page, u8 lsp, u8 csi,static int nvme_get_effects_log (struct nvme_ctrl *ctrl,u8 csi,struct nvme_effects_log **log) { -struct nvme_effects_log *cel =xa_load (&ctrl->cels, csi); +struct nvme_effects_log *old, *cel =xa_load (&ctrl->cels, csi);int ret;if (cel)
@@ -2870,7 +2870,11 @@ static int nvme_get_effects_log(struct nvme_ctrl *ctrl, u8 csi,return ret; } -xa_store (&ctrl->cels, csi, cel,GFP_KERNEL ); + old =xa_store (&ctrl->cels, csi, cel,GFP_KERNEL ); +if (xa_is_err (old)) { +kfree (cel); +return xa_err (old); + } out: *log = cel;return 0 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 11/393 selftests/powerpc: Fix argument order to timer_sub()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Ellerman <[email protected]>
[ Upstream commit 2bf66e66d2e6feece6175ec09ec590a0a8563bdd ]
Commit c814bf958926 ("powerpc/selftests: Use timersub() for gettimeofday()"), got the order of arguments to timersub() wrong, leading to a negative time delta being reported, eg:
test: gettimeofday
tags: git_version:v6.12-rc5-409-gdddf291c3030
time = -3.297781
success: gettimeofday
The correct order is minuend, subtrahend, which in this case is end, start. Which gives:
test: gettimeofday
tags: git_version:v6.12-rc5-409-gdddf291c3030-dirty time = 3.300650
success: gettimeofday
--- tools/testing/selftests/powerpc/benchmarks/gettimeofday.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/powerpc/benchmarks/gettimeofday.c +1 -1
@@ -20,7 +20,7 @@ static int test_gettimeofday(void)gettimeofday (&tv_end,NULL ); } -timersub (&tv_start, &tv_end, &tv_diff); +timersub (&tv_end, &tv_start, &tv_diff);printf ("time = %.6f\n" , tv_diff.tv_sec + (tv_diff.tv_usec) *1e-6 );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 12/393 nvme: Add error path for xa_store in nvme_init_effects
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Keisuke Nishimura <[email protected]>
[ Upstream commit d4a95adeabc6b5a39405e49c6d5ed14dd83682c4 ]
The xa_store() may fail due to memory allocation failure because there is no guarantee that the index NVME_CSI_NVM is already used. This fix introduces a new function to handle the error path.
--- drivers/nvme/host/core.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-)
drivers/nvme/host/core.c +22 -4
@@ -2945,6 +2945,25 @@ static int nvme_init_non_mdts_limits(struct nvme_ctrl *ctrl)return ret; } +static int nvme_init_effects_log (struct nvme_ctrl *ctrl, +u8 csi,struct nvme_effects_log **log) +{ +struct nvme_effects_log *effects, *old; + + effects =kzalloc (sizeof (*effects),GFP_KERNEL ); +if (effects) +return -ENOMEM ; + + old =xa_store (&ctrl->cels, csi, effects,GFP_KERNEL ); +if (xa_is_err (old)) { +kfree (effects); +return xa_err (old); + } + + *log = effects; +return 0 ; +} +static void nvme_init_known_nvm_effects (struct nvme_ctrl *ctrl) {struct nvme_effects_log *log = ctrl->effects;
@@ -2991,10 +3010,9 @@ static int nvme_init_effects(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id) }if (!ctrl->effects) { - ctrl->effects =kzalloc (sizeof (*ctrl->effects),GFP_KERNEL ); -if (!ctrl->effects) -return -ENOMEM ; -xa_store (&ctrl->cels,NVME_CSI_NVM , ctrl->effects,GFP_KERNEL ); + ret =nvme_init_effects_log (ctrl,NVME_CSI_NVM , &ctrl->effects); +if (ret <0 ) +return ret; }nvme_init_known_nvm_effects (ctrl);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 13/393 partitions: ldm: remove the initial kernel-doc notation
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Randy Dunlap <[email protected]>
[ Upstream commit e494e451611a3de6ae95f99e8339210c157d70fb ]
Remove the file's first comment describing what the file is. This comment is not in kernel-doc format so it causes a kernel-doc warning.
ldm.h:13: warning: expecting prototype for ldm(). Prototype was for _FS_PT_LDM_H_() instead
--- block/partitions/ldm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
block/partitions/ldm.h +1 -1
@@ -1,5 +1,5 @@// SPDX-License-Identifier: GPL-2.0-or-later -/** +/* * ldm - Part of the Linux-NTFS project. * * Copyright (C) 2001,2002 Richard Russon <[email protected]>
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 14/393 select: Fix unbalanced user_access_end()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christophe Leroy <[email protected]>
[ Upstream commit 344af27715ddbf357cf76978d674428b88f8e92d ]
While working on implementing user access validation on powerpc I got the following warnings on a pmac32_defconfig build:
CC fs/select.o fs/select.o: warning: objtool: sys_pselect6+0x1bc: redundant UACCESS disable fs/select.o: warning: objtool: sys_pselect6_time32+0x1bc: redundant UACCESS disable
On powerpc/32s, user_read_access_begin/end() are no-ops, but the failure path has a user_access_end() instead of user_read_access_end() which means an access end without any prior access begin.
Replace that user_access_end() by user_read_access_end().
--- fs/select.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/select.c +2 -2
@@ -788,7 +788,7 @@ static inline int get_sigset_argpack(struct sigset_argpack *to, }return 0 ; Efault: -user_access_end (); +user_read_access_end ();return -EFAULT ; }
@@ -1361,7 +1361,7 @@ static inline int get_compat_sigset_argpack(struct compat_sigset_argpack *to, }return 0 ; Efault: -user_access_end (); +user_read_access_end ();return -EFAULT ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 15/393 nvme: fix bogus kzalloc() return check in nvme_init_effects_log()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <[email protected]>
[ Upstream commit 170e086ad3997f816d1f551f178a03a626a130b7 ]
nvme_init_effects_log() returns failure when kzalloc() is successful, which is obviously wrong and causes failures to boot. Correct the check.
--- drivers/nvme/host/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/core.c +1 -1
@@ -2951,7 +2951,7 @@ static int nvme_init_effects_log(struct nvme_ctrl *ctrl,struct nvme_effects_log *effects, *old; effects =kzalloc (sizeof (*effects),GFP_KERNEL ); -if (effects) +if (!effects)return -ENOMEM ; old =xa_store (&ctrl->cels, csi, effects,GFP_KERNEL );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 16/393 afs: Fix the fallback handling for the YFS.RemoveFile2 RPC call
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <[email protected]>
[ Upstream commit e30458d690f35abb01de8b3cbc09285deb725d00 ]
Fix a pair of bugs in the fallback handling for the YFS.RemoveFile2 RPC call:
(1) Fix the abort code check to also look for RXGEN_OPCODE. The lack of this masks the second bug.
(2) call->server is now not used for ordinary filesystem RPC calls that
have an operation descriptor. Fix to use call->op->server instead.
--- fs/afs/yfsclient.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
fs/afs/yfsclient.c +3 -2
@@ -655,8 +655,9 @@ static int yfs_deliver_fs_remove_file2(struct afs_call *call)static void yfs_done_fs_remove_file2 (struct afs_call *call) {if (call->error == -ECONNABORTED && - call->abort_code ==RX_INVALID_OPERATION ) { -set_bit (AFS_SERVER_FL_NO_RM2 , &call->server->flags); + (call->abort_code ==RX_INVALID_OPERATION || + call->abort_code ==RXGEN_OPCODE )) { +set_bit (AFS_SERVER_FL_NO_RM2 , &call->op->server->flags); call->op->flags |=AFS_OPERATION_DOWNGRADE ; } }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 17/393 perf/core: Save raw sample data conditionally based on sample type
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yabin Cui <[email protected]>
[ Upstream commit b9c44b91476b67327a521568a854babecc4070ab ]
Currently, space for raw sample data is always allocated within sample records for both BPF output and tracepoint events. This leads to unused space in sample records when raw sample data is not requested.
This patch enforces checking sample type of an event in perf_sample_save_raw_data(). So raw sample data will only be saved if explicitly requested, reducing overhead when it is not needed.
--- arch/s390/kernel/perf_cpum_cf.c | 2 +- arch/s390/kernel/perf_pai_crypto.c | 2 +- arch/s390/kernel/perf_pai_ext.c | 2 +- arch/x86/events/amd/ibs.c | 2 +- include/linux/perf_event.h | 6 +++++ kernel/events/core.c | 35 +++++++++++++++--------------- kernel/trace/bpf_trace.c | 11 +++++----- 7 files changed, 34 insertions(+), 26 deletions(-)
arch/s390/kernel/perf_cpum_cf.c +1 -1
@@ -977,7 +977,7 @@ static int cfdiag_push_sample(struct perf_event *event,if (event->attr.sample_type &PERF_SAMPLE_RAW ) { raw.frag.size = cpuhw->usedss; raw.frag.data = cpuhw->stop; -perf_sample_save_raw_data (&data, &raw); +perf_sample_save_raw_data (&data, event, &raw); } overflow =perf_event_overflow (event, &data, ®s);
arch/s390/kernel/perf_pai_crypto.c +1 -1
@@ -365,7 +365,7 @@ static int paicrypt_push_sample(void)if (event->attr.sample_type &PERF_SAMPLE_RAW ) { raw.frag.size = rawsize; raw.frag.data = cpump->save; -perf_sample_save_raw_data (&data, &raw); +perf_sample_save_raw_data (&data, event, &raw); } overflow =perf_event_overflow (event, &data, ®s);
arch/s390/kernel/perf_pai_ext.c +1 -1
@@ -454,7 +454,7 @@ static int paiext_push_sample(void)if (event->attr.sample_type &PERF_SAMPLE_RAW ) { raw.frag.size = rawsize; raw.frag.data = cpump->save; -perf_sample_save_raw_data (&data, &raw); +perf_sample_save_raw_data (&data, event, &raw); } overflow =perf_event_overflow (event, &data, ®s);
arch/x86/events/amd/ibs.c +1 -1
@@ -1115,7 +1115,7 @@ static int perf_ibs_handle_irq(struct perf_ibs *perf_ibs, struct pt_regs *iregs) .data = ibs_data.data, }, }; -perf_sample_save_raw_data (&data, &raw); +perf_sample_save_raw_data (&data, event, &raw); }if (perf_ibs == &perf_ibs_op)
include/linux/perf_event.h +6 -0
@@ -1231,12 +1231,18 @@ static inline void perf_sample_save_callchain(struct perf_sample_data *data, }static inline void perf_sample_save_raw_data (struct perf_sample_data *data, +struct perf_event *event,struct perf_raw_record *raw) {struct perf_raw_frag *frag = &raw->frag;u32 sum =0 ;int size; +if (!(event->attr.sample_type &PERF_SAMPLE_RAW )) +return ; +if (WARN_ON_ONCE (data->sample_flags &PERF_SAMPLE_RAW )) +return ; + do { sum += frag->size; if (perf_raw_frag_last(frag))
kernel/events/core.c +18 -17
@@ -10157,9 +10157,9 @@ static struct pmu perf_tracepoint = { };static int perf_tp_filter_match (struct perf_event *event, -struct perf_sample_data *data) +struct perf_raw_record *raw) { -void *record = data->raw->frag.data; +void *record = raw->frag.data;/* only top level events have filters set */ if (event->parent)
@@ -10171,7 +10171,7 @@ static int perf_tp_filter_match(struct perf_event *event, }static int perf_tp_event_match (struct perf_event *event, -struct perf_sample_data *data, +struct perf_raw_record *raw,struct pt_regs *regs) {if (event->hw.state &PERF_HES_STOPPED )
@@ -10182,7 +10182,7 @@ static int perf_tp_event_match(struct perf_event *event,if (event->attr.exclude_kernel && !user_mode (regs))return 0 ; -if (!perf_tp_filter_match (event, data)) +if (!perf_tp_filter_match (event, raw))return 0 ;return 1 ;
@@ -10208,6 +10208,7 @@ EXPORT_SYMBOL_GPL(perf_trace_run_bpf_submit);static void __perf_tp_event_target_task (u64 count,void *record,struct pt_regs *regs,struct perf_sample_data *data, +struct perf_raw_record *raw,struct perf_event *event) {struct trace_entry *entry = record;
@@ -10217,13 +10218,17 @@ static void __perf_tp_event_target_task(u64 count, void *record,/* Cannot deliver synchronous signal to other task. */ if (event->attr.sigtrap)return ; -if (perf_tp_event_match (event, data, regs)) +if (perf_tp_event_match (event, raw, regs)) { +perf_sample_data_init (data,0 ,0 ); +perf_sample_save_raw_data (data, event, raw);perf_swevent_event (event, count, data, regs); + } }static void perf_tp_event_target_task (u64 count,void *record,struct pt_regs *regs,struct perf_sample_data *data, +struct perf_raw_record *raw,struct perf_event_context *ctx) {unsigned int cpu =smp_processor_id ();
@@ -10231,15 +10236,15 @@ static void perf_tp_event_target_task(u64 count, void *record,struct perf_event *event, *sibling; perf_event_groups_for_cpu_pmu(event, &ctx->pinned_groups, cpu, pmu) { -__perf_tp_event_target_task (count, record, regs, data, event); +__perf_tp_event_target_task (count, record, regs, data, raw, event);for_each_sibling_event (sibling, event) -__perf_tp_event_target_task (count, record, regs, data, sibling); +__perf_tp_event_target_task (count, record, regs, data, raw, sibling); } perf_event_groups_for_cpu_pmu(event, &ctx->flexible_groups, cpu, pmu) { -__perf_tp_event_target_task (count, record, regs, data, event); +__perf_tp_event_target_task (count, record, regs, data, raw, event);for_each_sibling_event (sibling, event) -__perf_tp_event_target_task (count, record, regs, data, sibling); +__perf_tp_event_target_task (count, record, regs, data, raw, sibling); } }
@@ -10257,15 +10262,10 @@ void perf_tp_event(u16 event_type, u64 count, void *record, int entry_size, }, }; -perf_sample_data_init (&data,0 ,0 ); -perf_sample_save_raw_data (&data, &raw); -perf_trace_buf_update (record, event_type);hlist_for_each_entry_rcu (event, head, hlist_entry) { -if (perf_tp_event_match (event, &data, regs)) { -perf_swevent_event (event, count, &data, regs); - +if (perf_tp_event_match (event, &raw, regs)) {/* * Here use the same on-stack perf_sample_data, * some members in data are event-specific and
@@ -10275,7 +10275,8 @@ void perf_tp_event(u16 event_type, u64 count, void *record, int entry_size,* because data->sample_flags is set. */ perf_sample_data_init (&data,0 ,0 ); -perf_sample_save_raw_data (&data, &raw); +perf_sample_save_raw_data (&data, event, &raw); +perf_swevent_event (event, count, &data, regs); } }
@@ -10292,7 +10293,7 @@ void perf_tp_event(u16 event_type, u64 count, void *record, int entry_size, goto unlock;raw_spin_lock (&ctx->lock); -perf_tp_event_target_task (count, record, regs, &data, ctx); +perf_tp_event_target_task (count, record, regs, &data, &raw, ctx);raw_spin_unlock (&ctx->lock); unlock:rcu_read_unlock ();
kernel/trace/bpf_trace.c +6 -5
@@ -616,7 +616,8 @@ static const struct bpf_func_proto bpf_perf_event_read_value_proto = { static __always_inline u64__bpf_perf_event_output (struct pt_regs *regs,struct bpf_map *map, -u64 flags,struct perf_sample_data *sd) +u64 flags,struct perf_raw_record *raw, +struct perf_sample_data *sd) { struct bpf_array *array = container_of(map, struct bpf_array, map);unsigned int cpu =smp_processor_id ();
@@ -641,6 +642,8 @@ __bpf_perf_event_output(struct pt_regs *regs, struct bpf_map *map,if (unlikely (event->oncpu != cpu))return -EOPNOTSUPP ; +perf_sample_save_raw_data (sd, event, raw); +return perf_event_output (event, sd, regs); }
@@ -684,9 +687,8 @@ BPF_CALL_5(bpf_perf_event_output, struct pt_regs *, regs, struct bpf_map *, map, }perf_sample_data_init (sd,0 ,0 ); -perf_sample_save_raw_data (sd, &raw); - err =__bpf_perf_event_output (regs, map, flags, sd); + err =__bpf_perf_event_output (regs, map, flags, &raw, sd); out:this_cpu_dec (bpf_trace_nest_level);preempt_enable ();
@@ -745,9 +747,8 @@ u64 bpf_event_output(struct bpf_map *map, u64 flags, void *meta, u64 meta_size,perf_fetch_caller_regs (regs);perf_sample_data_init (sd,0 ,0 ); -perf_sample_save_raw_data (sd, &raw); - ret =__bpf_perf_event_output (regs, map, flags, sd); + ret =__bpf_perf_event_output (regs, map, flags, &raw, sd); out:this_cpu_dec (bpf_event_output_nest_level);preempt_enable ();
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 18/393 sched/fair: Fix value reported by hot tasks pulled in /proc/schedstat
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <[email protected]>
[ Upstream commit a430d99e349026d53e2557b7b22bd2ebd61fe12a ]
In /proc/schedstat, lb_hot_gained reports the number hot tasks pulled during load balance. This value is incremented in can_migrate_task() if the task is migratable and hot. After incrementing the value, load balancer can still decide not to migrate this task leading to wrong accounting. Fix this by incrementing stats when hot tasks are detached. This issue only exists in detach_tasks() where we can decide to not migrate hot task even if it is migratable. However, in detach_one_task(), we migrate it unconditionally.
[Swapnil: Handled the case where nr_failed_migrations_hot was not accounted properly and wrote commit log]
--- include/linux/sched.h | 1 + kernel/sched/fair.c | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-)
include/linux/sched.h +1 -0
@@ -896,6 +896,7 @@ struct task_struct { unsigned sched_reset_on_fork:1; unsigned sched_contributes_to_load:1; unsigned sched_migrated:1; + unsigned sched_task_hot:1;/* Force alignment to the next boundary: */ unsigned :0;
kernel/sched/fair.c +13 -4
@@ -8921,6 +8921,8 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env)int tsk_cache_hot;lockdep_assert_rq_held (env->src_rq); +if (p->sched_task_hot) + p->sched_task_hot =0 ;/* * We do not migrate tasks that are:
@@ -8993,10 +8995,8 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env)if (tsk_cache_hot <=0 || env->sd->nr_balance_failed > env->sd->cache_nice_tries) { -if (tsk_cache_hot ==1 ) { -schedstat_inc (env->sd->lb_hot_gained[env->idle]); -schedstat_inc (p->stats.nr_forced_migrations); - } +if (tsk_cache_hot ==1 ) + p->sched_task_hot =1 ;return 1 ; }
@@ -9011,6 +9011,12 @@ static void detach_task(struct task_struct *p, struct lb_env *env) {lockdep_assert_rq_held (env->src_rq); +if (p->sched_task_hot) { + p->sched_task_hot =0 ; +schedstat_inc (env->sd->lb_hot_gained[env->idle]); +schedstat_inc (p->stats.nr_forced_migrations); + } +deactivate_task (env->src_rq, p,DEQUEUE_NOCLOCK );set_task_cpu (p, env->dst_cpu); }
@@ -9171,6 +9177,9 @@ static int detach_tasks(struct lb_env *env)continue ; next: +if (p->sched_task_hot) +schedstat_inc (p->stats.nr_failed_migrations_hot); +list_move (&p->se.group_node, tasks); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 19/393 sched/topology: Rename DIE domain to PKG
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <[email protected]>
[ Upstream commit f577cd57bfaa889cf0718e30e92c08c7f78c9d85 ]
While reworking the x86 topology code Thomas tripped over creating a 'DIE' domain for the package mask. :-)
Since these names are CONFIG_SCHED_DEBUG=y only, rename them to make the name less ambiguous.
[ Shrikanth Hegde: rename on s390 as well. ]
[ Valentin Schneider: also rename it in the comments. ] [ mingo: port to recent kernels & find all remaining occurances. ]
Stable-dep-of: e1bc02646527 ("x86/topology: Use x86_sched_itmt_flags for PKG domain unconditionally")
--- arch/powerpc/kernel/smp.c | 4 ++-- arch/s390/kernel/topology.c | 2 +- arch/x86/kernel/smpboot.c | 4 ++-- kernel/sched/fair.c | 2 +- kernel/sched/topology.c | 8 ++++---- 5 files changed, 10 insertions(+), 10 deletions(-)
arch/powerpc/kernel/smp.c +2 -2
@@ -1051,7 +1051,7 @@ static struct sched_domain_topology_level powerpc_topology[] = {#endif { shared_cache_mask, powerpc_shared_cache_flags, SD_INIT_NAME(CACHE) }, { cpu_mc_mask, SD_INIT_NAME(MC) }, - { cpu_cpu_mask, SD_INIT_NAME(DIE) }, + { cpu_cpu_mask, SD_INIT_NAME(PKG) }, { NULL, }, };
@@ -1595,7 +1595,7 @@ static void add_cpu_to_masks(int cpu)/* Skip all CPUs already part of current CPU core mask */ cpumask_andnot (mask, cpu_online_mask,cpu_core_mask (cpu)); -/* If chip_id is -1; limit the cpu_core_mask to within DIE*/ +/* If chip_id is -1; limit the cpu_core_mask to within PKG */ if (chip_id ==-1 )cpumask_and (mask, mask,cpu_cpu_mask (cpu));
arch/s390/kernel/topology.c +1 -1
@@ -522,7 +522,7 @@ static struct sched_domain_topology_level s390_topology[] = { { cpu_coregroup_mask, cpu_core_flags, SD_INIT_NAME(MC) }, { cpu_book_mask, SD_INIT_NAME(BOOK) }, { cpu_drawer_mask, SD_INIT_NAME(DRAWER) }, - { cpu_cpu_mask, SD_INIT_NAME(DIE) }, + { cpu_cpu_mask, SD_INIT_NAME(PKG) }, { NULL, }, };
arch/x86/kernel/smpboot.c +2 -2
@@ -641,13 +641,13 @@ static void __init build_sched_topology(void) };#endif /* -* When there is NUMA topology inside the package skip the DIE domain +* When there is NUMA topology inside the package skip the PKG domain * since the NUMA domains will auto-magically create the right spanning * domains based on the SLIT. */ if (!x86_has_numa_in_package) { x86_topology[i++] = (struct sched_domain_topology_level ){ - cpu_cpu_mask, x86_die_flags,SD_INIT_NAME (DIE ) + cpu_cpu_mask, x86_die_flags,SD_INIT_NAME (PKG ) }; }
kernel/sched/fair.c +1 -1
@@ -9782,7 +9782,7 @@ static bool sched_use_asym_prio(struct sched_domain *sd, int cpu)* can only do it if @group is an SMT group and has exactly on busy CPU. Larger * imbalances in the number of CPUS are dealt with in find_busiest_group(). * -* If we are balancing load within an SMT core, or at DIE domain level, always +* If we are balancing load within an SMT core, or at PKG domain level, always * proceed. * * Return: true if @env::dst_cpu can do with asym_packing load balance. False
kernel/sched/topology.c +4 -4
@@ -1117,7 +1117,7 @@ build_overlap_sched_groups(struct sched_domain *sd, int cpu)* * - Simultaneous multithreading (SMT) * - Multi-Core Cache (MC) -* - Package (DIE) +* - Package (PKG) * * Where the last one more or less denotes everything up to a NUMA node. *
@@ -1139,13 +1139,13 @@ build_overlap_sched_groups(struct sched_domain *sd, int cpu)* * CPU 0 1 2 3 4 5 6 7 * -* DIE [ ] +* PKG [ ] * MC [ ] [ ] * SMT [ ] [ ] [ ] [ ] * * - or - * -* DIE 0-7 0-7 0-7 0-7 0-7 0-7 0-7 0-7 +* PKG 0-7 0-7 0-7 0-7 0-7 0-7 0-7 0-7 * MC 0-3 0-3 0-3 0-3 4-7 4-7 4-7 4-7 * SMT 0-1 0-1 2-3 2-3 4-5 4-5 6-7 6-7 *
@@ -1679,7 +1679,7 @@ static struct sched_domain_topology_level default_topology[] = { #ifdef CONFIG_SCHED_MC { cpu_coregroup_mask, cpu_core_flags, SD_INIT_NAME(MC) }, #endif - { cpu_cpu_mask, SD_INIT_NAME(DIE) }, + { cpu_cpu_mask, SD_INIT_NAME(PKG) }, { NULL, }, };
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 20/393 x86/cpu: Enable SD_ASYM_PACKING for PKG domain on AMD
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Perry Yuan <[email protected]>
[ Upstream commit b0979e53645825a38f814ca5d3d09aed2745911d ]
Enable the SD_ASYM_PACKING domain flag for the PKG domain on AMD heterogeneous processors. This flag is beneficial for processors with one or more CCDs and relies on x86_sched_itmt_flags().
Stable-dep-of: e1bc02646527 ("x86/topology: Use x86_sched_itmt_flags for PKG domain unconditionally")
--- arch/x86/kernel/smpboot.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
arch/x86/kernel/smpboot.c +3 -2
@@ -606,8 +606,9 @@ static int x86_cluster_flags(void)static int x86_die_flags (void ) { -if (cpu_feature_enabled (X86_FEATURE_HYBRID_CPU )) -return x86_sched_itmt_flags (); +if (cpu_feature_enabled (X86_FEATURE_HYBRID_CPU ) || +cpu_feature_enabled (X86_FEATURE_AMD_HETEROGENEOUS_CORES )) +return x86_sched_itmt_flags ();return 0 ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 21/393 x86/topology: Use x86_sched_itmt_flags for PKG domain unconditionally
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: K Prateek Nayak <[email protected]>
[ Upstream commit e1bc02646527fc1ed74f00eb599b2b74d49671c7 ]
x86_sched_itmt_flags() returns SD_ASYM_PACKING if ITMT support is enabled by the system. Without ITMT support being enabled, it returns 0 similar to current x86_die_flags() on non-Hybrid systems (!X86_HYBRID_CPU and !X86_FEATURE_AMD_HETEROGENEOUS_CORES)
On Intel systems that enable ITMT support, either the MC domain coincides with the PKG domain, or in case of multiple MC groups within a PKG domain, either Sub-NUMA Cluster (SNC) is enabled or the processor features Hybrid core layout (X86_HYBRID_CPU) which leads to three distinct possibilities:
o If PKG and MC domains coincide, PKG domain is degenerated by sd_parent_degenerate() when building sched domain topology.
o If SNC is enabled, PKG domain is never added since "x86_has_numa_in_package" is set and the topology will instead contain NODE and NUMA domains.
o On X86_HYBRID_CPU which contains multiple MC groups within the PKG, the PKG domain requires x86_sched_itmt_flags().
Thus, on Intel systems that contains multiple MC groups within the PKG and enables ITMT support, the PKG domain requires x86_sched_itmt_flags(). In all other cases PKG domain is either never added or is degenerated. Thus, returning x86_sched_itmt_flags() unconditionally at PKG domain on Intel systems should not lead to any functional changes.
On AMD systems with multiple LLCs (MC groups) within a PKG domain, enabling ITMT support requires setting SD_ASYM_PACKING to the PKG domain since the core rankings are assigned PKG-wide.
Core rankings on AMD processors is currently set by the amd-pstate driver when Preferred Core feature is supported. A subset of systems that support Preferred Core feature can be detected using X86_FEATURE_AMD_HETEROGENEOUS_CORES however, this does not cover all the systems that support Preferred Core ranking.
Detecting Preferred Core support on AMD systems requires inspecting CPPC Highest Perf on all present CPUs and checking if it differs on at least one CPU. Previous suggestion to use a synthetic feature to detect Preferred Core support [1] was found to be non-trivial to implement since BSP alone cannot detect if Preferred Core is supported and by the time AP comes up, alternatives are patched and setting a X86_FEATURE_* then is not possible.
Since x86 processors enabling ITMT support that consists multiple non-NUMA MC groups within a PKG requires SD_ASYM_PACKING flag set at the PKG domain, return x86_sched_itmt_flags unconditionally for the PKG domain.
Since x86_die_flags() would have just returned x86_sched_itmt_flags() after the change, remove the unnecessary wrapper and pass x86_sched_itmt_flags() directly as the flags function.
--- arch/x86/kernel/smpboot.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
arch/x86/kernel/smpboot.c +1 -10
@@ -604,15 +604,6 @@ static int x86_cluster_flags(void) }#endif -static int x86_die_flags (void ) -{ -if (cpu_feature_enabled (X86_FEATURE_HYBRID_CPU ) || -cpu_feature_enabled (X86_FEATURE_AMD_HETEROGENEOUS_CORES )) -return x86_sched_itmt_flags (); - -return 0 ; -} -/* * Set if a package/die has multiple NUMA nodes inside. * AMD Magny-Cours, Intel Cluster-on-Die, and Intel
@@ -648,7 +639,7 @@ static void __init build_sched_topology(void)*/ if (!x86_has_numa_in_package) { x86_topology[i++] = (struct sched_domain_topology_level ){ - cpu_cpu_mask, x86_die_flags,SD_INIT_NAME (PKG ) + cpu_cpu_mask, x86_sched_itmt_flags,SD_INIT_NAME (PKG ) }; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 22/393 drm/msm/dp: set safe_to_exit_level before printing it
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit 7dee35d79bb046bfd425aa9e58a82414f67c1cec ]
Rather than printing random garbage from stack and pretending that it is the default safe_to_exit_level, set the variable beforehand.
Patchwork: https://patchwork.freedesktop.org/patch/626804/
--- drivers/gpu/drm/msm/dp/dp_audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/msm/dp/dp_audio.c +1 -1
@@ -410,10 +410,10 @@ static void dp_audio_safe_to_exit_level(struct dp_audio_private *audio) safe_to_exit_level =5 ;break ;default : + safe_to_exit_level =14 ;drm_dbg_dp (audio->drm_dev,"setting the default safe_to_exit_level = %u\n" , safe_to_exit_level); - safe_to_exit_level =14 ;break ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 23/393 drm/etnaviv: Fix page property being used for non writecombine buffers
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sui Jingfeng <[email protected]>
[ Upstream commit 834f304192834d6f0941954f3277ae0ba11a9a86 ]
In the etnaviv_gem_vmap_impl() function, the driver vmap whatever buffers with write combine(WC) page property, this is incorrect. Cached buffers should be mapped with the cached page property and uncached buffers should be mapped with the uncached page property.
--- drivers/gpu/drm/etnaviv/etnaviv_gem.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
drivers/gpu/drm/etnaviv/etnaviv_gem.c +14 -2
@@ -343,6 +343,7 @@ void *etnaviv_gem_vmap(struct drm_gem_object *obj)static void *etnaviv_gem_vmap_impl (struct etnaviv_gem_object *obj) {struct page **pages; +pgprot_t prot;lockdep_assert_held (&obj->lock);
@@ -350,8 +351,19 @@ static void *etnaviv_gem_vmap_impl(struct etnaviv_gem_object *obj)if (IS_ERR (pages))return NULL ; -return vmap (pages, obj->base.size >>PAGE_SHIFT , -VM_MAP ,pgprot_writecombine (PAGE_KERNEL )); +switch (obj->flags &ETNA_BO_CACHE_MASK ) { +case ETNA_BO_CACHED : + prot =PAGE_KERNEL ; +break ; +case ETNA_BO_UNCACHED : + prot =pgprot_noncached (PAGE_KERNEL ); +break ; +case ETNA_BO_WC : +default : + prot =pgprot_writecombine (PAGE_KERNEL ); + } + +return vmap (pages, obj->base.size >>PAGE_SHIFT ,VM_MAP , prot); }static inline enum dma_data_direction etnaviv_op_to_dma_dir (u32 op)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 24/393 HID: core: Fix assumption that Resolution Multipliers must be in Logical Collections
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <[email protected]>
commit 64f2657b579343cf923aa933f08074e6258eb07b upstream.
A report in 2019 by the syzbot fuzzer was found to be connected to two errors in the HID core associated with Resolution Multipliers. One of the errors was fixed by commit ea427a222d8b ("HID: core: Fix deadloop in hid_apply_multiplier."), but the other has not been fixed.
This error arises because hid_apply_multipler() assumes that every Resolution Multiplier control is contained in a Logical Collection, i.e., there's no way the routine can ever set multiplier_collection to NULL. This is in spite of the fact that the function starts with a big comment saying:
* "The Resolution Multiplier control must be contained in the same
* Logical Collection as the control(s) to which it is to be applied.
...
* If no Logical Collection is
* defined, the Resolution Multiplier is associated with all
* controls in the report."
* HID Usage Table, v1.12, Section 4.3.1, p30
*
* Thus, search from the current collection upwards until we find a
* logical collection...
The comment and the code overlook the possibility that none of the collections found may be a Logical Collection.
The fix is to set the multiplier_collection pointer to NULL if the collection found isn't a Logical Collection.
--- drivers/hid/hid-core.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/hid/hid-core.c +2 -0
@@ -1125,6 +1125,8 @@ static void hid_apply_multiplier(structwhile (multiplier_collection->parent_idx !=-1 && multiplier_collection->type !=HID_COLLECTION_LOGICAL ) multiplier_collection = &hid->collection[multiplier_collection->parent_idx]; +if (multiplier_collection->type !=HID_COLLECTION_LOGICAL ) + multiplier_collection =NULL ; effective_multiplier =hid_calculate_multiplier (hid, multiplier);
Greg Kroah-Hartman
maintainerPATCH 25/393 drm/amd/pm: Fix an error handling path in vega10_enable_se_edc_force_stall_config()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christophe JAILLET <[email protected]>
[ Upstream commit a3300782d5375e280ba7040f323d01960bfe3396 ]
In case of error after a amdgpu_gfx_rlc_enter_safe_mode() call, it is not balanced by a corresponding amdgpu_gfx_rlc_exit_safe_mode() call.
Add the missing call.
--- drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_powertune.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_powertune.c +3 -2
@@ -1120,13 +1120,14 @@ static int vega10_enable_se_edc_force_stall_config(struct pp_hwmgr *hwmgr) result =vega10_program_didt_config_registers (hwmgr, SEEDCForceStallPatternConfig_Vega10,VEGA10_CONFIGREG_DIDT ); result |=vega10_program_didt_config_registers (hwmgr, SEEDCCtrlForceStallConfig_Vega10,VEGA10_CONFIGREG_DIDT );if (0 != result) -return result; + goto exit_safe_mode;vega10_didt_set_mask (hwmgr, false); +exit_safe_mode:amdgpu_gfx_rlc_exit_safe_mode (adev,0 ); -return 0 ; +return result; }static int vega10_disable_se_edc_force_stall_config (struct pp_hwmgr *hwmgr)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 26/393 drm/amdgpu: Fix potential NULL pointer dereference in atomctrl_get_smc_sclk_range_table
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ivan Stepchenko <[email protected]>
[ Upstream commit 357445e28ff004d7f10967aa93ddb4bffa5c3688 ]
The function atomctrl_get_smc_sclk_range_table() does not check the return value of smu_atom_get_data_table(). If smu_atom_get_data_table() fails to retrieve SMU_Info table, it returns NULL which is later dereferenced.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
In practice this should never happen as this code only gets called on polaris chips and the vbios data table will always be present on those chips.
--- drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c +2 -0
@@ -1420,6 +1420,8 @@ int atomctrl_get_smc_sclk_range_table(struct pp_hwmgr *hwmgr, struct pp_atom_ctrGetIndexIntoMasterTable (DATA , SMU_Info), &size, &frev, &crev); +if (!psmu_info) +return -EINVAL ;for (i =0 ; i < psmu_info->ucSclkEntryNum; i++) { table->entry[i].ucVco_setting = psmu_info->asSclkFcwRangeEntry[i].ucVco_setting;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 27/393 drm/rockchip: vop2: Fix cluster windows alpha ctrl regsiters offset
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Yan <[email protected]>
[ Upstream commit 17b4b10a0df1a1421d5fbdc03bad0bd3799bc966 ]
The phy_id of cluster windws are not increase one for each window.
--- drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +17 -1
@@ -1741,7 +1741,6 @@ static int vop2_find_start_mixer_id_for_vp(struct vop2 *vop2, u8 port_id)static void vop2_setup_cluster_alpha (struct vop2 *vop2,struct vop2_win *main_win) { -u32 offset = (main_win->data->phys_id *0x10 );struct vop2_alpha_config alpha_config;struct vop2_alpha alpha;struct drm_plane_state *bottom_win_pstate;
@@ -1749,6 +1748,7 @@ static void vop2_setup_cluster_alpha(struct vop2 *vop2, struct vop2_win *main_wiu16 src_glb_alpha_val, dst_glb_alpha_val;bool premulti_en = false;bool swap = false; +u32 offset =0 ;/* At one win mode, win0 is dst/bottom win, and win1 is a all zero src/top win */ bottom_win_pstate = main_win->base.state;
@@ -1767,6 +1767,22 @@ static void vop2_setup_cluster_alpha(struct vop2 *vop2, struct vop2_win *main_wivop2_parse_alpha (&alpha_config, &alpha); alpha.src_color_ctrl.bits.src_dst_swap = swap; + +switch (main_win->data->phys_id) { +case ROCKCHIP_VOP2_CLUSTER0 : + offset =0x0 ; +break ; +case ROCKCHIP_VOP2_CLUSTER1 : + offset =0x10 ; +break ; +case ROCKCHIP_VOP2_CLUSTER2 : + offset =0x20 ; +break ; +case ROCKCHIP_VOP2_CLUSTER3 : + offset =0x30 ; +break ; + } +vop2_writel (vop2,RK3568_CLUSTER0_MIX_SRC_COLOR_CTRL + offset, alpha.src_color_ctrl.val); vop2_writel(vop2, RK3568_CLUSTER0_MIX_DST_COLOR_CTRL + offset,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 28/393 drm/rockchip: vop2: Fix the mixer alpha setup for layer 0
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Yan <[email protected]>
[ Upstream commit 6b4dfdcde3573a12b72d2869dabd4ca37ad7e9c7 ]
The alpha setup should start from the second layer, the current calculation starts incorrectly from the first layer, a negative offset will be obtained in the following formula:
offset = (mixer_id + zpos - 1) * 0x10
--- drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +6 -0
@@ -1830,6 +1830,12 @@ static void vop2_setup_alpha(struct vop2_video_port *vp)struct vop2_win *win =to_vop2_win (plane);int zpos = plane->state->normalized_zpos; +/* +* Need to configure alpha from second layer. +*/ +if (zpos ==0 ) +continue ; +if (plane->state->pixel_blend_mode ==DRM_MODE_BLEND_PREMULTI ) premulti_en =1 ;else
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 29/393 drm/rockchip: vop2: Set YUV/RGB overlay mode
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Yan <[email protected]>
[ Upstream commit dd49ee4614cfb0b1f627c4353b60cecfe998a374 ]
Set overlay mode register according to the
output mode is yuv or rgb.
Stable-dep-of: 0ca953ac226e ("drm/rockchip: vop2: Fix the windows switch between different layers")
--- drivers/gpu/drm/rockchip/rockchip_drm_drv.h | 1 + drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 17 ++++++++++++++--- drivers/gpu/drm/rockchip/rockchip_drm_vop2.h | 1 + 3 files changed, 16 insertions(+), 3 deletions(-)
drivers/gpu/drm/rockchip/rockchip_drm_drv.h +1 -0
@@ -31,6 +31,7 @@ struct rockchip_crtc_state {int output_bpc;int output_flags;bool enable_afbc; +bool yuv_overlay;u32 bus_format;u32 bus_flags;int color_space;
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +14 -3
@@ -1560,6 +1560,8 @@ static void vop2_crtc_atomic_enable(struct drm_crtc *crtc, vop2->enable_count++; + vcstate->yuv_overlay =is_yuv_output (vcstate->bus_format); +vop2_crtc_enable_irq (vp,VP_INT_POST_BUF_EMPTY ); polflags =0 ;
@@ -1587,7 +1589,7 @@ static void vop2_crtc_atomic_enable(struct drm_crtc *crtc,if (vop2_output_uv_swap (vcstate->bus_format, vcstate->output_mode)) dsp_ctrl |=RK3568_VP_DSP_CTRL__DSP_RB_SWAP ; -if (is_yuv_output (vcstate->bus_format)) +if (vcstate->yuv_overlay) dsp_ctrl |=RK3568_VP_DSP_CTRL__POST_DSP_OUT_R2Y ;vop2_dither_setup (crtc, &dsp_ctrl);
@@ -1918,10 +1920,12 @@ static void vop2_setup_layer_mixer(struct vop2_video_port *vp)u16 hdisplay;u32 bg_dly;u32 pre_scan_dly; +u32 ovl_ctrl;int i;struct vop2_video_port *vp0 = &vop2->vps[0 ];struct vop2_video_port *vp1 = &vop2->vps[1 ];struct vop2_video_port *vp2 = &vop2->vps[2 ]; +struct rockchip_crtc_state *vcstate =to_rockchip_crtc_state (vp->crtc.state); adjusted_mode = &vp->crtc.state->adjusted_mode; hsync_len = adjusted_mode->crtc_hsync_end - adjusted_mode->crtc_hsync_start;
@@ -1934,7 +1938,15 @@ static void vop2_setup_layer_mixer(struct vop2_video_port *vp) pre_scan_dly = ((bg_dly + (hdisplay >>1 ) -1 ) <<16 ) | hsync_len;vop2_vp_write (vp,RK3568_VP_PRE_SCAN_HTIMING , pre_scan_dly); -vop2_writel (vop2,RK3568_OVL_CTRL ,0 ); + ovl_ctrl =vop2_readl (vop2,RK3568_OVL_CTRL ); + ovl_ctrl |=RK3568_OVL_CTRL__LAYERSEL_REGDONE_IMD ; +if (vcstate->yuv_overlay) + ovl_ctrl |=RK3568_OVL_CTRL__YUV_MODE (vp->id); +else + ovl_ctrl &= ~RK3568_OVL_CTRL__YUV_MODE (vp->id); + +vop2_writel (vop2,RK3568_OVL_CTRL , ovl_ctrl); + port_sel =vop2_readl (vop2,RK3568_OVL_PORT_SEL ); port_sel &=RK3568_OVL_PORT_SEL__SEL_PORT ;
@@ -2008,7 +2020,6 @@ static void vop2_setup_layer_mixer(struct vop2_video_port *vp)vop2_writel (vop2,RK3568_OVL_LAYER_SEL , layer_sel);vop2_writel (vop2,RK3568_OVL_PORT_SEL , port_sel); -vop2_writel (vop2,RK3568_OVL_CTRL ,RK3568_OVL_CTRL__LAYERSEL_REGDONE_IMD ); }static void vop2_setup_dly_for_windows (struct vop2 *vop2)
drivers/gpu/drm/rockchip/rockchip_drm_vop2.h +1 -0
@@ -418,6 +418,7 @@ enum dst_factor_mode {#define VOP2_COLOR_KEY_MASK BIT(31)#define RK3568_OVL_CTRL__LAYERSEL_REGDONE_IMD BIT(28) +#define RK3568_OVL_CTRL__YUV_MODE (vp) BIT(vp)#define RK3568_VP_BG_MIX_CTRL__BG_DLY GENMASK(31, 24)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 30/393 drm/rockchip: vop2: set bg dly and prescan dly at vop2_post_config
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Yan <[email protected]>
[ Upstream commit 075a5b3969becb1ebc2f1d4fa1a1fe9163679273 ]
We need to setup background delay cycle and prescan delay cycle when a mode is enable to avoid trigger POST_BUF_EMPTY irq on rk3588.
Note: RK356x has no such requirement.
Stable-dep-of: 0ca953ac226e ("drm/rockchip: vop2: Fix the windows switch between different layers")
--- drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 26 ++++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-)
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +10 -16
@@ -1397,8 +1397,18 @@ static void vop2_post_config(struct drm_crtc *crtc)u32 top_margin =100 , bottom_margin =100 ;u16 hsize = hdisplay * (left_margin + right_margin) /200 ;u16 vsize = vdisplay * (top_margin + bottom_margin) /200 ; +u16 hsync_len = mode->crtc_hsync_end - mode->crtc_hsync_start;u16 hact_end, vact_end;u32 val; +u32 bg_dly; +u32 pre_scan_dly; + + bg_dly = vp->data->pre_scan_max_dly[3 ]; +vop2_writel (vp->vop2,RK3568_VP_BG_MIX_CTRL (vp->id), +FIELD_PREP (RK3568_VP_BG_MIX_CTRL__BG_DLY , bg_dly)); + + pre_scan_dly = ((bg_dly + (hdisplay >>1 ) -1 ) <<16 ) | hsync_len; +vop2_vp_write (vp,RK3568_VP_PRE_SCAN_HTIMING , pre_scan_dly); vsize =rounddown (vsize,2 ); hsize =rounddown (hsize,2 );
@@ -1915,11 +1925,6 @@ static void vop2_setup_layer_mixer(struct vop2_video_port *vp)u32 layer_sel =0 ;u32 port_sel;unsigned int nlayer, ofs; -struct drm_display_mode *adjusted_mode; -u16 hsync_len; -u16 hdisplay; -u32 bg_dly; -u32 pre_scan_dly;u32 ovl_ctrl;int i;struct vop2_video_port *vp0 = &vop2->vps[0 ];
@@ -1927,17 +1932,6 @@ static void vop2_setup_layer_mixer(struct vop2_video_port *vp)struct vop2_video_port *vp2 = &vop2->vps[2 ];struct rockchip_crtc_state *vcstate =to_rockchip_crtc_state (vp->crtc.state); - adjusted_mode = &vp->crtc.state->adjusted_mode; - hsync_len = adjusted_mode->crtc_hsync_end - adjusted_mode->crtc_hsync_start; - hdisplay = adjusted_mode->crtc_hdisplay; - - bg_dly = vp->data->pre_scan_max_dly[3 ]; -vop2_writel (vop2,RK3568_VP_BG_MIX_CTRL (vp->id), -FIELD_PREP (RK3568_VP_BG_MIX_CTRL__BG_DLY , bg_dly)); - - pre_scan_dly = ((bg_dly + (hdisplay >>1 ) -1 ) <<16 ) | hsync_len; -vop2_vp_write (vp,RK3568_VP_PRE_SCAN_HTIMING , pre_scan_dly); - ovl_ctrl =vop2_readl (vop2,RK3568_OVL_CTRL ); ovl_ctrl |=RK3568_OVL_CTRL__LAYERSEL_REGDONE_IMD ;if (vcstate->yuv_overlay)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 31/393 drm/rockchip: vop2: Fix the windows switch between different layers
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Yan <[email protected]>
[ Upstream commit 0ca953ac226eaffbe1a795f5e517095a8d494921 ]
Every layer of vop2 should bind a window, and we also need to make sure that this window is not used by other layer.
0x5 is a reserved layer sel value on rk3568, but it will select Cluster3 on rk3588, configure unused layers to 0x5 will lead alpha blending error on rk3588.
When we bind a window from layerM to layerN, we move the old window on layerN to layerM.
--- drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 47 ++++++++++++++------ 1 file changed, 34 insertions(+), 13 deletions(-)
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +34 -13
@@ -1924,7 +1924,10 @@ static void vop2_setup_layer_mixer(struct vop2_video_port *vp)struct drm_plane *plane;u32 layer_sel =0 ;u32 port_sel; -unsigned int nlayer, ofs; +u8 layer_id; +u8 old_layer_id; +u8 layer_sel_id; +unsigned int ofs;u32 ovl_ctrl;int i;struct vop2_video_port *vp0 = &vop2->vps[0 ];
@@ -1968,9 +1971,30 @@ static void vop2_setup_layer_mixer(struct vop2_video_port *vp)for (i =0 ; i < vp->id; i++) ofs += vop2->vps[i].nlayers; - nlayer =0 ;drm_atomic_crtc_for_each_plane (plane, &vp->crtc) {struct vop2_win *win =to_vop2_win (plane); +struct vop2_win *old_win; + + layer_id = (u8)(plane->state->normalized_zpos + ofs); + +/* +* Find the layer this win bind in old state. +*/ +for (old_layer_id =0 ; old_layer_id < vop2->data->win_size; old_layer_id++) { + layer_sel_id = (layer_sel >> (4 * old_layer_id)) &0xf ; +if (layer_sel_id == win->data->layer_sel_id) +break ; + } + +/* +* Find the win bind to this layer in old state +*/ +for (i =0 ; i < vop2->data->win_size; i++) { + old_win = &vop2->win[i]; + layer_sel_id = (layer_sel >> (4 * layer_id)) &0xf ; +if (layer_sel_id == old_win->data->layer_sel_id) +break ; + }switch (win->data->phys_id) {case ROCKCHIP_VOP2_CLUSTER0 :
@@ -1999,17 +2023,14 @@ static void vop2_setup_layer_mixer(struct vop2_video_port *vp)break ; } - layer_sel &= ~RK3568_OVL_LAYER_SEL__LAYER (plane->state->normalized_zpos + ofs, -0x7 ); - layer_sel |=RK3568_OVL_LAYER_SEL__LAYER (plane->state->normalized_zpos + ofs, - win->data->layer_sel_id); - nlayer++; - } - -/* configure unused layers to 0x5 (reserved) */ -for (; nlayer < vp->nlayers; nlayer++) { - layer_sel &= ~RK3568_OVL_LAYER_SEL__LAYER (nlayer + ofs,0x7 ); - layer_sel |=RK3568_OVL_LAYER_SEL__LAYER (nlayer + ofs,5 ); + layer_sel &= ~RK3568_OVL_LAYER_SEL__LAYER (layer_id,0x7 ); + layer_sel |=RK3568_OVL_LAYER_SEL__LAYER (layer_id, win->data->layer_sel_id); +/* +* When we bind a window from layerM to layerN, we also need to move the old +* window on layerN to layerM to avoid one window selected by two or more layers. +*/ + layer_sel &= ~RK3568_OVL_LAYER_SEL__LAYER (old_layer_id,0x7 ); + layer_sel |=RK3568_OVL_LAYER_SEL__LAYER (old_layer_id, old_win->data->layer_sel_id); }vop2_writel (vop2,RK3568_OVL_LAYER_SEL , layer_sel);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 32/393 drm/rockchip: vop2: Check linear format for Cluster windows on rk3566/8
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Yan <[email protected]>
[ Upstream commit df063c0b8ffbdca486ab2f802e716973985d8f86 ]
The Cluster windows on rk3566/8 only support afbc mode.
--- drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +10 -0
@@ -465,6 +465,16 @@ static bool rockchip_vop2_mod_supported(struct drm_plane *plane, u32 format,if (modifier ==DRM_FORMAT_MOD_INVALID )return false; +if (vop2->data->soc_id ==3568 || vop2->data->soc_id ==3566 ) { +if (vop2_cluster_window (win)) { +if (modifier ==DRM_FORMAT_MOD_LINEAR ) { +drm_dbg_kms (vop2->drm, +"Cluster window only supports format with afbc\n" ); +return false; + } + } + } +if (modifier ==DRM_FORMAT_MOD_LINEAR )return true;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 33/393 drm/rockchip: move output interface related definition to rockchip_drm_drv.h
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Yan <[email protected]>
[ Upstream commit 8c8546546f256f834e9c7cab48e5946df340d1a8 ]
The output interface related definition can shared between vop and vop2, move them to rockchip_drm_drv.h can avoid duplicated definition.
Stable-dep-of: 77b1ccb2a27c ("drm/rockchip: vop2: include rockchip_drm_drv.h")
--- drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 1 - drivers/gpu/drm/rockchip/cdn-dp-core.c | 1 - drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 1 - drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 1 - drivers/gpu/drm/rockchip/inno_hdmi.c | 1 - drivers/gpu/drm/rockchip/rk3066_hdmi.c | 1 - drivers/gpu/drm/rockchip/rockchip_drm_drv.h | 17 +++++++++++++++++ drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 12 ------------ drivers/gpu/drm/rockchip/rockchip_drm_vop2.h | 16 +--------------- drivers/gpu/drm/rockchip/rockchip_lvds.c | 1 - drivers/gpu/drm/rockchip/rockchip_rgb.c | 1 - 11 files changed, 18 insertions(+), 35 deletions(-)
drivers/gpu/drm/rockchip/analogix_dp-rockchip.c +0 -1
@@ -30,7 +30,6 @@#include <drm/drm_simple_kms_helper.h> #include "rockchip_drm_drv.h" -#include "rockchip_drm_vop.h" #define RK3288_GRF_SOC_CON6 0x25c#define RK3288_EDP_LCDC_SEL BIT(5)
drivers/gpu/drm/rockchip/cdn-dp-core.c +0 -1
@@ -24,7 +24,6 @@#include "cdn-dp-core.h" #include "cdn-dp-reg.h" -#include "rockchip_drm_vop.h" static inline struct cdn_dp_device *connector_to_dp (struct drm_connector *connector) {
drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c +0 -1
@@ -26,7 +26,6 @@#include <drm/drm_simple_kms_helper.h> #include "rockchip_drm_drv.h" -#include "rockchip_drm_vop.h" #define DSI_PHY_RSTZ 0xa0#define PHY_DISFORCEPLL 0
drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +0 -1
@@ -18,7 +18,6 @@#include <drm/drm_simple_kms_helper.h> #include "rockchip_drm_drv.h" -#include "rockchip_drm_vop.h" #define RK3228_GRF_SOC_CON2 0x0408#define RK3228_HDMI_SDAIN_MSK BIT(14)
drivers/gpu/drm/rockchip/inno_hdmi.c +0 -1
@@ -23,7 +23,6 @@#include <drm/drm_simple_kms_helper.h> #include "rockchip_drm_drv.h" -#include "rockchip_drm_vop.h" #include "inno_hdmi.h"
drivers/gpu/drm/rockchip/rk3066_hdmi.c +0 -1
@@ -17,7 +17,6 @@#include "rk3066_hdmi.h" #include "rockchip_drm_drv.h" -#include "rockchip_drm_vop.h" #define DEFAULT_PLLA_RATE 30000000
drivers/gpu/drm/rockchip/rockchip_drm_drv.h +17 -0
@@ -20,6 +20,23 @@#define ROCKCHIP_MAX_CONNECTOR 2#define ROCKCHIP_MAX_CRTC 4 +/* +* display output interface supported by rockchip lcdc +*/ +#define ROCKCHIP_OUT_MODE_P888 0 +#define ROCKCHIP_OUT_MODE_BT1120 0 +#define ROCKCHIP_OUT_MODE_P666 1 +#define ROCKCHIP_OUT_MODE_P565 2 +#define ROCKCHIP_OUT_MODE_BT656 5 +#define ROCKCHIP_OUT_MODE_S888 8 +#define ROCKCHIP_OUT_MODE_S888_DUMMY 12 +#define ROCKCHIP_OUT_MODE_YUV420 14 +/* for use special outface */ +#define ROCKCHIP_OUT_MODE_AAAA 15 + +/* output flags */ +#define ROCKCHIP_OUTPUT_DSI_DUAL BIT(0) +struct drm_device ;struct drm_connector ;struct iommu_domain ;
drivers/gpu/drm/rockchip/rockchip_drm_vop.h +0 -12
@@ -277,18 +277,6 @@ struct vop_data {/* dst alpha ctrl define */ #define DST_FACTOR_M0 (x) (((x) & 0x7) << 6) -/* -* display output interface supported by rockchip lcdc -*/ -#define ROCKCHIP_OUT_MODE_P888 0 -#define ROCKCHIP_OUT_MODE_P666 1 -#define ROCKCHIP_OUT_MODE_P565 2 -/* for use special outface */ -#define ROCKCHIP_OUT_MODE_AAAA 15 - -/* output flags */ -#define ROCKCHIP_OUTPUT_DSI_DUAL BIT(0) -enum alpha_mode {ALPHA_STRAIGHT ,ALPHA_INVERSE ,
drivers/gpu/drm/rockchip/rockchip_drm_vop2.h +1 -15
@@ -7,10 +7,9 @@#ifndef _ROCKCHIP_DRM_VOP2_H#define _ROCKCHIP_DRM_VOP2_H -#include "rockchip_drm_vop.h" -#include <linux/regmap.h> #include <drm/drm_modes.h> +#include "rockchip_drm_vop.h" #define VOP_FEATURE_OUTPUT_10BIT BIT(0)
@@ -169,19 +168,6 @@ struct vop2_data {#define WB_YRGB_FIFO_FULL_INTR BIT(18)#define WB_COMPLETE_INTR BIT(19) -/* -* display output interface supported by rockchip lcdc -*/ -#define ROCKCHIP_OUT_MODE_P888 0 -#define ROCKCHIP_OUT_MODE_BT1120 0 -#define ROCKCHIP_OUT_MODE_P666 1 -#define ROCKCHIP_OUT_MODE_P565 2 -#define ROCKCHIP_OUT_MODE_BT656 5 -#define ROCKCHIP_OUT_MODE_S888 8 -#define ROCKCHIP_OUT_MODE_S888_DUMMY 12 -#define ROCKCHIP_OUT_MODE_YUV420 14 -/* for use special outface */ -#define ROCKCHIP_OUT_MODE_AAAA 15enum vop_csc_format {CSC_BT601L ,
drivers/gpu/drm/rockchip/rockchip_lvds.c +0 -1
@@ -27,7 +27,6 @@#include <drm/drm_simple_kms_helper.h> #include "rockchip_drm_drv.h" -#include "rockchip_drm_vop.h" #include "rockchip_lvds.h" #define DISPLAY_OUTPUT_RGB 0
drivers/gpu/drm/rockchip/rockchip_rgb.c +0 -1
@@ -19,7 +19,6 @@#include <drm/drm_simple_kms_helper.h> #include "rockchip_drm_drv.h" -#include "rockchip_drm_vop.h" #include "rockchip_rgb.h" struct rockchip_rgb {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 34/393 drm/rockchip: vop2: include rockchip_drm_drv.h
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Min-Hua Chen <[email protected]>
[ Upstream commit 77b1ccb2a27c7b3b118a03bf1730def92070d31b ]
Move rockchip_drm_drv.h in rockchip_drm_vop2.h to fix the follow sparse warning:
ARCH=arm64 LLVM=1 make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' mrproper defconfig all -j12
drivers/gpu/drm/rockchip/rockchip_vop2_reg.c:502:24: sparse:
warning: symbol 'vop2_platform_driver' was not declared. Should it be static?
It is also beneficial for the upcoming support for rk3576.
--- drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 1 - drivers/gpu/drm/rockchip/rockchip_drm_vop2.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +0 -1
@@ -33,7 +33,6 @@#include <uapi/linux/videodev2.h> #include <dt-bindings/soc/rockchip,vop2.h> -#include "rockchip_drm_drv.h" #include "rockchip_drm_gem.h" #include "rockchip_drm_fb.h" #include "rockchip_drm_vop2.h"
drivers/gpu/drm/rockchip/rockchip_drm_vop2.h +1 -0
@@ -9,6 +9,7 @@#include <linux/regmap.h> #include <drm/drm_modes.h> +#include "rockchip_drm_drv.h" #include "rockchip_drm_vop.h" #define VOP_FEATURE_OUTPUT_10BIT BIT(0)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 35/393 drm/amdgpu/vcn: reset fw_shared under SRIOV
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bokun Zhang <[email protected]>
[ Upstream commit 3676f37a88432132bcff55a17dc48911239b6d98 ]
- The previous patch only considered the case for baremetal and is not applicable for SRIOV code path. We also need to init fw_share for SRIOV VF
--- drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c +2 -0
@@ -896,6 +896,8 @@ static int vcn_v4_0_3_start_sriov(struct amdgpu_device *adev)for (i =0 ; i < adev->vcn.num_vcn_inst; i++) { vcn_inst =GET_INST (VCN , i); +vcn_v4_0_3_fw_shared_init (adev, vcn_inst); +memset (&header,0 ,sizeof (struct mmsch_v4_0_3_init_header )); header.version =MMSCH_VERSION ; header.total_size =sizeof (struct mmsch_v4_0_3_init_header ) >>2 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 36/393 OPP: add index check to assert to avoid buffer overflow in _read_freq()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Neil Armstrong <[email protected]>
[ Upstream commit d659bc68ed489022ea33342cfbda2911a81e7a0d ]
Pass the freq index to the assert function to make sure we do not read a freq out of the opp->rates[] table when called from the indexed variants:dev_pm_opp_find_freq_exact_indexed() or dev_pm_opp_find_freq_ceil/floor_indexed().
Add a secondary parameter to the assert function, unused for assert_single_clk() then add assert_clk_index() which will check for the clock index when called from the _indexed() find functions.
--- drivers/opp/core.c | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-)
drivers/opp/core.c +27 -15
@@ -101,11 +101,21 @@ struct opp_table *_find_opp_table(struct device *dev)* representation in the OPP table and manage the clock configuration themselves * in an platform specific way. */ -static bool assert_single_clk (struct opp_table *opp_table) +static bool assert_single_clk (struct opp_table *opp_table, +unsigned int __always_unused index) {return !WARN_ON (opp_table->clk_count >1 ); } +/* +* Returns true if clock table is large enough to contain the clock index. +*/ +static bool assert_clk_index (struct opp_table *opp_table, +unsigned int index) +{ +return opp_table->clk_count > index; +} +/** * dev_pm_opp_get_voltage() - Gets the voltage corresponding to an opp * @opp: opp for which voltage has to be returned for
@@ -499,12 +509,12 @@ static struct dev_pm_opp *_opp_table_find_key(struct opp_table *opp_table,unsigned long (*read)(struct dev_pm_opp *opp,int index), bool (*compare)(struct dev_pm_opp **opp, struct dev_pm_opp *temp_opp,unsigned long opp_key,unsigned long key), - bool (*assert)(struct opp_table *opp_table)) + bool (*assert)(struct opp_table *opp_table, unsigned int index)) { struct dev_pm_opp *temp_opp, *opp = ERR_PTR(-ERANGE);/* Assert that the requirement is met */ -if (assert && !assert (opp_table)) +if (assert && !assert (opp_table, index))return ERR_PTR (-EINVAL );mutex_lock (&opp_table->lock);
@@ -532,7 +542,7 @@ _find_key(struct device *dev, unsigned long *key, int index, bool available,unsigned long (*read)(struct dev_pm_opp *opp,int index), bool (*compare)(struct dev_pm_opp **opp, struct dev_pm_opp *temp_opp,unsigned long opp_key,unsigned long key), - bool (*assert)(struct opp_table *opp_table)) + bool (*assert)(struct opp_table *opp_table, unsigned int index)) { struct opp_table *opp_table;struct dev_pm_opp *opp;
@@ -555,7 +565,7 @@ _find_key(struct device *dev, unsigned long *key, int index, bool available,static struct dev_pm_opp *_find_key_exact (struct device *dev,unsigned long key,int index,bool available,unsigned long (*read)(struct dev_pm_opp *opp,int index), -bool (*assert)(struct opp_table *opp_table)) +bool (*assert)(struct opp_table *opp_table,unsigned int index)) {/* * The value of key will be updated here, but will be ignored as the
@@ -568,7 +578,7 @@ static struct dev_pm_opp *_find_key_exact(struct device *dev,static struct dev_pm_opp *_opp_table_find_key_ceil (struct opp_table *opp_table,unsigned long *key,int index,bool available,unsigned long (*read)(struct dev_pm_opp *opp,int index), -bool (*assert)(struct opp_table *opp_table)) +bool (*assert)(struct opp_table *opp_table,unsigned int index)) {return _opp_table_find_key (opp_table, key, index, available, read, _compare_ceil, assert);
@@ -577,7 +587,7 @@ static struct dev_pm_opp *_opp_table_find_key_ceil(struct opp_table *opp_table,static struct dev_pm_opp *_find_key_ceil (struct device *dev,unsigned long *key,int index,bool available,unsigned long (*read)(struct dev_pm_opp *opp,int index), -bool (*assert)(struct opp_table *opp_table)) +bool (*assert)(struct opp_table *opp_table,unsigned int index)) {return _find_key (dev, key, index, available, read, _compare_ceil, assert);
@@ -586,7 +596,7 @@ static struct dev_pm_opp *_find_key_ceil(struct device *dev, unsigned long *key,static struct dev_pm_opp *_find_key_floor (struct device *dev,unsigned long *key,int index,bool available,unsigned long (*read)(struct dev_pm_opp *opp,int index), -bool (*assert)(struct opp_table *opp_table)) +bool (*assert)(struct opp_table *opp_table,unsigned int index)) {return _find_key (dev, key, index, available, read, _compare_floor, assert);
@@ -647,7 +657,8 @@ struct dev_pm_opp * dev_pm_opp_find_freq_exact_indexed(struct device *dev, unsigned long freq, u32 index, bool available) { - return _find_key_exact(dev, freq, index, available, _read_freq, NULL); + return _find_key_exact(dev, freq, index, available, _read_freq, + assert_clk_index); }EXPORT_SYMBOL_GPL (dev_pm_opp_find_freq_exact_indexed);
@@ -707,7 +718,8 @@ struct dev_pm_opp * dev_pm_opp_find_freq_ceil_indexed(struct device *dev, unsigned long *freq, u32 index) { - return _find_key_ceil(dev, freq, index, true, _read_freq, NULL); + return _find_key_ceil(dev, freq, index, true, _read_freq, + assert_clk_index); }EXPORT_SYMBOL_GPL (dev_pm_opp_find_freq_ceil_indexed);
@@ -760,7 +772,7 @@ struct dev_pm_opp * dev_pm_opp_find_freq_floor_indexed(struct device *dev, unsigned long *freq, u32 index) { - return _find_key_floor(dev, freq, index, true, _read_freq, NULL); + return _find_key_floor(dev, freq, index, true, _read_freq, assert_clk_index); }EXPORT_SYMBOL_GPL (dev_pm_opp_find_freq_floor_indexed);
@@ -1676,7 +1688,7 @@ void dev_pm_opp_remove(struct device *dev, unsigned long freq)if (IS_ERR (opp_table))return ; -if (!assert_single_clk (opp_table)) +if (!assert_single_clk (opp_table,0 )) goto put_table;mutex_lock (&opp_table->lock);
@@ -2027,7 +2039,7 @@ int _opp_add_v1(struct opp_table *opp_table, struct device *dev,unsigned long tol;int ret; -if (!assert_single_clk (opp_table)) +if (!assert_single_clk (opp_table,0 ))return -EINVAL ; new_opp =_opp_allocate (opp_table);
@@ -2889,7 +2901,7 @@ static int _opp_set_availability(struct device *dev, unsigned long freq,return r; } -if (!assert_single_clk (opp_table)) { +if (!assert_single_clk (opp_table,0 )) { r = -EINVAL ; goto put_table; }
@@ -2965,7 +2977,7 @@ int dev_pm_opp_adjust_voltage(struct device *dev, unsigned long freq,return r; } -if (!assert_single_clk (opp_table)) { +if (!assert_single_clk (opp_table,0 )) { r = -EINVAL ; goto put_table; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 37/393 OPP: fix dev_pm_opp_find_bw_*() when bandwidth table not initialized
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Neil Armstrong <[email protected]>
[ Upstream commit b44b9bc7cab2967c3d6a791b1cd542c89fc07f0e ]
If a driver calls dev_pm_opp_find_bw_ceil/floor() the retrieve bandwidth from the OPP table but the bandwidth table was not created because the interconnect properties were missing in the OPP consumer node, the kernel will crash with:
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000004 ... pc : _read_bw+0x8/0x10 lr : _opp_table_find_key+0x9c/0x174 ... Call trace: _read_bw+0x8/0x10 (P) _opp_table_find_key+0x9c/0x174 (L) _find_key+0x98/0x168 dev_pm_opp_find_bw_ceil+0x50/0x88
...
In order to fix the crash, create an assert function to check if the bandwidth table was created before trying to get a bandwidth with _read_bw().
--- drivers/opp/core.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/opp/core.c +13 -2
@@ -116,6 +116,15 @@ static bool assert_clk_index(struct opp_table *opp_table,return opp_table->clk_count > index; } +/* +* Returns true if bandwidth table is large enough to contain the bandwidth index. +*/ +static bool assert_bandwidth_index (struct opp_table *opp_table, +unsigned int index) +{ +return opp_table->path_count > index; +} +/** * dev_pm_opp_get_voltage() - Gets the voltage corresponding to an opp * @opp: opp for which voltage has to be returned for
@@ -850,7 +859,8 @@ struct dev_pm_opp *dev_pm_opp_find_bw_ceil(struct device *dev, unsigned int *bw,unsigned long temp = *bw;struct dev_pm_opp *opp; - opp =_find_key_ceil (dev, &temp, index, true, _read_bw,NULL ); + opp =_find_key_ceil (dev, &temp, index, true, _read_bw, + assert_bandwidth_index); *bw = temp;return opp; }
@@ -881,7 +891,8 @@ struct dev_pm_opp *dev_pm_opp_find_bw_floor(struct device *dev,unsigned long temp = *bw;struct dev_pm_opp *opp; - opp =_find_key_floor (dev, &temp, index, true, _read_bw,NULL ); + opp =_find_key_floor (dev, &temp, index, true, _read_bw, + assert_bandwidth_index); *bw = temp;return opp; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 38/393 drm/msm/dpu: link DSPP_2/_3 blocks on SM8150
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit ac440a31e523805939215b24d2f0c451b48d5891 ]
Link DSPP_2 to the LM_2 and DSPP_3 to the LM_3 mixer blocks. This allows using colour transformation matrix (aka night mode) with more outputs at the same time.
Patchwork: https://patchwork.freedesktop.org/patch/629952/
--- drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_0_sm8150.h | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_0_sm8150.h +2 -0
@@ -164,6 +164,7 @@ static const struct dpu_lm_cfg sm8150_lm[] = { .sblk = &sdm845_lm_sblk, .lm_pair = LM_3, .pingpong = PINGPONG_2, + .dspp = DSPP_2, }, { .name = "lm_3", .id = LM_3, .base = 0x47000, .len = 0x320,
@@ -171,6 +172,7 @@ static const struct dpu_lm_cfg sm8150_lm[] = { .sblk = &sdm845_lm_sblk, .lm_pair = LM_2, .pingpong = PINGPONG_3, + .dspp = DSPP_3, }, { .name = "lm_4", .id = LM_4, .base = 0x48000, .len = 0x320,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 39/393 drm/msm/dpu: link DSPP_2/_3 blocks on SC8180X
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit 0986163245df6bece47113e506143a7e87b0097d ]
Link DSPP_2 to the LM_2 and DSPP_3 to the LM_3 mixer blocks. This allows using colour transformation matrix (aka night mode) with more outputs at the same time.
Patchwork: https://patchwork.freedesktop.org/patch/629954/
--- drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h +2 -0
@@ -163,6 +163,7 @@ static const struct dpu_lm_cfg sc8180x_lm[] = { .sblk = &sdm845_lm_sblk, .lm_pair = LM_3, .pingpong = PINGPONG_2, + .dspp = DSPP_2, }, { .name = "lm_3", .id = LM_3, .base = 0x47000, .len = 0x320,
@@ -170,6 +171,7 @@ static const struct dpu_lm_cfg sc8180x_lm[] = { .sblk = &sdm845_lm_sblk, .lm_pair = LM_2, .pingpong = PINGPONG_3, + .dspp = DSPP_3, }, { .name = "lm_4", .id = LM_4, .base = 0x48000, .len = 0x320,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 40/393 drm/msm/dpu: link DSPP_2/_3 blocks on SM8250
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit 8252028092f86d413b3a83e5e76a9615073a0c7f ]
Link DSPP_2 to the LM_2 and DSPP_3 to the LM_3 mixer blocks. This allows using colour transformation matrix (aka night mode) with more outputs at the same time.
Patchwork: https://patchwork.freedesktop.org/patch/629956/
--- drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_0_sm8250.h | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_0_sm8250.h +2 -0
@@ -163,6 +163,7 @@ static const struct dpu_lm_cfg sm8250_lm[] = { .sblk = &sdm845_lm_sblk, .lm_pair = LM_3, .pingpong = PINGPONG_2, + .dspp = DSPP_2, }, { .name = "lm_3", .id = LM_3, .base = 0x47000, .len = 0x320,
@@ -170,6 +171,7 @@ static const struct dpu_lm_cfg sm8250_lm[] = { .sblk = &sdm845_lm_sblk, .lm_pair = LM_2, .pingpong = PINGPONG_3, + .dspp = DSPP_3, }, { .name = "lm_4", .id = LM_4, .base = 0x48000, .len = 0x320,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 41/393 drm/msm/dpu: link DSPP_2/_3 blocks on SM8350
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit 42323d3c9e04c725d27606c31663b80a7cc30218 ]
Link DSPP_2 to the LM_2 and DSPP_3 to the LM_3 mixer blocks. This allows using colour transformation matrix (aka night mode) with more outputs at the same time.
Patchwork: https://patchwork.freedesktop.org/patch/629959/
--- drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_0_sm8350.h | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_0_sm8350.h +2 -0
@@ -163,6 +163,7 @@ static const struct dpu_lm_cfg sm8350_lm[] = { .sblk = &sdm845_lm_sblk, .lm_pair = LM_3, .pingpong = PINGPONG_2, + .dspp = DSPP_2, }, { .name = "lm_3", .id = LM_3, .base = 0x47000, .len = 0x320,
@@ -170,6 +171,7 @@ static const struct dpu_lm_cfg sm8350_lm[] = { .sblk = &sdm845_lm_sblk, .lm_pair = LM_2, .pingpong = PINGPONG_3, + .dspp = DSPP_3, }, { .name = "lm_4", .id = LM_4, .base = 0x48000, .len = 0x320,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 42/393 drm/msm/dpu: link DSPP_2/_3 blocks on SM8550
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit e21f9d85b05361bc343b11ecf84ac12c9cccbc3e ]
Link DSPP_2 to the LM_2 and DSPP_3 to the LM_3 mixer blocks. This allows using colour transformation matrix (aka night mode) with more outputs at the same time.
Patchwork: https://patchwork.freedesktop.org/patch/629961/
--- drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_9_0_sm8550.h | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_9_0_sm8550.h +2 -0
@@ -181,6 +181,7 @@ static const struct dpu_lm_cfg sm8550_lm[] = { .sblk = &sdm845_lm_sblk, .lm_pair = LM_3, .pingpong = PINGPONG_2, + .dspp = DSPP_2, }, { .name = "lm_3", .id = LM_3, .base = 0x47000, .len = 0x320,
@@ -188,6 +189,7 @@ static const struct dpu_lm_cfg sm8550_lm[] = { .sblk = &sdm845_lm_sblk, .lm_pair = LM_2, .pingpong = PINGPONG_3, + .dspp = DSPP_3, }, { .name = "lm_4", .id = LM_4, .base = 0x48000, .len = 0x320,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 43/393 drm/msm: Check return value of of_dma_configure()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sui Jingfeng <[email protected]>
[ Upstream commit b34a7401ffaee45354e81b38a4d072794079cfd6 ]
Because the of_dma_configure() will returns '-EPROBE_DEFER' if the probe procedure of the specific platform IOMMU driver is not finished yet. It can also return other error code for various reasons.
Stop pretending that it will always suceess, quit if it fail.
Patchwork: https://patchwork.freedesktop.org/patch/622782/
--- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +6 -2
@@ -1510,7 +1510,9 @@ int a6xx_gmu_wrapper_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node) gmu->dev = &pdev->dev; -of_dma_configure (gmu->dev, node, true); + ret =of_dma_configure (gmu->dev, node, true); +if (ret) +return ret;pm_runtime_enable (gmu->dev);
@@ -1574,7 +1576,9 @@ int a6xx_gmu_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node) gmu->dev = &pdev->dev; -of_dma_configure (gmu->dev, node, true); + ret =of_dma_configure (gmu->dev, node, true); +if (ret) +return ret;/* Fow now, don't do anything fancy until we get our feet under us */ gmu->idle_level =GMU_IDLE_STATE_ACTIVE ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 44/393 drm/bridge: it6505: Change definition of AUX_FIFO_MAX_SIZE
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hermes Wu <[email protected]>
[ Upstream commit c14870218c14532b0f0a7805b96a4d3c92d06fb2 ]
The hardware AUX FIFO is 16 bytes
Change definition of AUX_FIFO_MAX_SIZE to 16
--- drivers/gpu/drm/bridge/ite-it6505.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/ite-it6505.c +1 -1
@@ -299,7 +299,7 @@#define MAX_CR_LEVEL 0x03#define MAX_EQ_LEVEL 0x03#define AUX_WAIT_TIMEOUT_MS 15 -#define AUX_FIFO_MAX_SIZE 32 +#define AUX_FIFO_MAX_SIZE 16#define PIXEL_CLK_DELAY 1#define PIXEL_CLK_INVERSE 0#define ADJUST_PHASE_THRESHOLD 80000
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 45/393 drm/amdgpu: tear down ttm range manager for doorbell in amdgpu_ttm_fini()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiang Liu <[email protected]>
[ Upstream commit 60a2c0c12b644450e420ffc42291d1eb248bacb7 ]
Tear down ttm range manager for doorbell in function amdgpu_ttm_fini(), to avoid memory leakage.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1 -0
@@ -2049,6 +2049,7 @@ void amdgpu_ttm_fini(struct amdgpu_device *adev)ttm_range_man_fini (&adev->mman.bdev,AMDGPU_PL_GDS );ttm_range_man_fini (&adev->mman.bdev,AMDGPU_PL_GWS );ttm_range_man_fini (&adev->mman.bdev,AMDGPU_PL_OA ); +ttm_range_man_fini (&adev->mman.bdev,AMDGPU_PL_DOORBELL );ttm_device_fini (&adev->mman.bdev); adev->mman.initialized = false;DRM_INFO ("amdgpu: ttm finalized\n" );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 46/393 genirq: Make handle_enforce_irqctx() unconditionally available
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <[email protected]>
[ Upstream commit 8d187a77f04c14fb459a5301d69f733a5a1396bc ]
Commit 1b57d91b969c ("irqchip/gic-v2, v3: Prevent SW resends entirely") sett the flag which enforces interrupt handling in interrupt context and prevents software base resends for ARM GIC v2/v3.
But it missed that the helper function which checks the flag was hidden behind CONFIG_GENERIC_PENDING_IRQ, which is not set by ARM[64].
Make the helper unconditionally available so that the enforcement actually works.
--- kernel/irq/internals.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
kernel/irq/internals.h +3 -6
@@ -434,10 +434,6 @@ static inline struct cpumask *irq_desc_get_pending_mask(struct irq_desc *desc) {return desc->pending_mask; } -static inline bool handle_enforce_irqctx (struct irq_data *data) -{ -return irqd_is_handle_enforce_irqctx (data); -}bool irq_fixup_move_pending (struct irq_desc *desc,bool force_clear);#else /* CONFIG_GENERIC_PENDING_IRQ */ static inline bool irq_can_move_pcntxt (struct irq_data *data)
@@ -464,11 +460,12 @@ static inline bool irq_fixup_move_pending(struct irq_desc *desc, bool fclear) {return false; } +#endif /* !CONFIG_GENERIC_PENDING_IRQ */ +static inline bool handle_enforce_irqctx (struct irq_data *data) { -return false; +return irqd_is_handle_enforce_irqctx (data); } -#endif /* !CONFIG_GENERIC_PENDING_IRQ */ #if !defined(CONFIG_IRQ_DOMAIN ) || !defined(CONFIG_IRQ_DOMAIN_HIERARCHY )static inline int irq_domain_activate_irq (struct irq_data *data,bool reserve)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 47/393 ipmi: ipmb: Add check devm_kasprintf() returned value
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Charles Han <[email protected]>
[ Upstream commit 2378bd0b264ad3a1f76bd957caf33ee0c7945351 ]
devm_kasprintf() can return a NULL pointer on failure but this returned value is not checked.
Message-ID: <[email protected]>
--- drivers/char/ipmi/ipmb_dev_int.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/char/ipmi/ipmb_dev_int.c +3 -0
@@ -321,6 +321,9 @@ static int ipmb_probe(struct i2c_client *client) ipmb_dev->miscdev.name =devm_kasprintf (&client->dev,GFP_KERNEL ,"%s%d" ,"ipmb-" , client->adapter->nr); +if (!ipmb_dev->miscdev.name) +return -ENOMEM ; + ipmb_dev->miscdev.fops = &ipmb_fops; ipmb_dev->miscdev.parent = &client->dev; ret =misc_register (&ipmb_dev->miscdev);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 48/393 wifi: ath11k: Fix unexpected return buffer manager error for WCN6750/WCN6855
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Balaji Pothunoori <[email protected]>
[ Upstream commit 78e154d42f2c72905fe66a400847e1b2b101b7b2 ]
The following error messages were encountered while parsing fragmented RX packets for WCN6750/WCN6855:
ath11k 17a10040.wifi: invalid return buffer manager 4
This issue arose due to a hardcoded check for HAL_RX_BUF_RBM_SW3_BM introduced in 'commit 71c748b5e01e ("ath11k: Fix unexpected return buffer manager error for QCA6390")'
For WCN6750 and WCN6855, the return buffer manager ID should be HAL_RX_BUF_RBM_SW1_BM. The incorrect conditional check caused fragmented packets to be dropped, resulting in the above error log.
Fix this by adding a check for HAL_RX_BUF_RBM_SW1_BM.
Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.2.0.c2-00258-QCAMSLSWPL-1
Tested-on: WCN6855 hw2.1 WLAN.HSP.1.1-04479-QCAHSPSWPL_V1_V2_SILICONZ_IOE-1
--- drivers/net/wireless/ath/ath11k/dp_rx.c | 1 + drivers/net/wireless/ath/ath11k/hal_rx.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath11k/dp_rx.c +1 -0
@@ -3811,6 +3811,7 @@ int ath11k_dp_process_rx_err(struct ath11k_base *ab, struct napi_struct *napi,ath11k_hal_rx_msdu_link_info_get (link_desc_va, &num_msdus, msdu_cookies, &rbm);if (rbm !=HAL_RX_BUF_RBM_WBM_IDLE_DESC_LIST && + rbm !=HAL_RX_BUF_RBM_SW1_BM && rbm !=HAL_RX_BUF_RBM_SW3_BM ) { ab->soc_stats.invalid_rbm++;ath11k_warn (ab,"invalid return buffer manager %d\n" , rbm);
drivers/net/wireless/ath/ath11k/hal_rx.c +2 -1
@@ -372,7 +372,8 @@ int ath11k_hal_wbm_desc_parse_err(struct ath11k_base *ab, void *desc, ret_buf_mgr =FIELD_GET (BUFFER_ADDR_INFO1_RET_BUF_MGR , wbm_desc->buf_addr_info.info1); -if (ret_buf_mgr !=HAL_RX_BUF_RBM_SW3_BM ) { +if (ret_buf_mgr !=HAL_RX_BUF_RBM_SW1_BM && + ret_buf_mgr !=HAL_RX_BUF_RBM_SW3_BM ) { ab->soc_stats.invalid_rbm++;return -EINVAL ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 49/393 wifi: rtlwifi: do not complete firmware loading needlessly
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thadeu Lima de Souza Cascardo <[email protected]>
[ Upstream commit e73e11d303940119e41850a0452a0deda2cc4eb5 ]
The only code waiting for completion is driver removal, which will not be called when probe returns a failure. So this completion is unnecessary.
--- drivers/net/wireless/realtek/rtlwifi/pci.c | 1 - drivers/net/wireless/realtek/rtlwifi/usb.c | 1 - 2 files changed, 2 deletions(-)
drivers/net/wireless/realtek/rtlwifi/pci.c +0 -1
@@ -2268,7 +2268,6 @@ int rtl_pci_probe(struct pci_dev *pdev,pci_iounmap (pdev, (void __iomem *)rtlpriv->io.pci_mem_start);pci_release_regions (pdev); -complete (&rtlpriv->firmware_loading_complete); fail1:if (hw)
drivers/net/wireless/realtek/rtlwifi/usb.c +0 -1
@@ -1066,7 +1066,6 @@ int rtl_usb_probe(struct usb_interface *intf, error_out2:_rtl_usb_io_handler_release (hw);usb_put_dev (udev); -complete (&rtlpriv->firmware_loading_complete);kfree (rtlpriv->usb_data);ieee80211_free_hw (hw);return -ENODEV ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 50/393 wifi: rtlwifi: rtl8192se: rise completion of firmware loading as last step
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thadeu Lima de Souza Cascardo <[email protected]>
[ Upstream commit 8559a9e0c457729fe3edb3176bbf7c7874f482b0 ]
Just like in commit 4dfde294b979 ("rtlwifi: rise completion at the last step of firmware callback"), only signal completion once the function is finished. Otherwise, the module removal waiting for the completion could free the memory that the callback will still use before returning.
--- drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c +4 -3
@@ -67,22 +67,23 @@ static void rtl92se_fw_cb(const struct firmware *firmware, void *context)rtl_dbg (rtlpriv,COMP_ERR ,DBG_LOUD ,"Firmware callback routine entered!\n" ); -complete (&rtlpriv->firmware_loading_complete);if (!firmware) {pr_err ("Firmware %s not available\n" , fw_name); rtlpriv->max_fw_size =0 ; -return ; + goto exit; }if (firmware->size > rtlpriv->max_fw_size) {pr_err ("Firmware is too big!\n" ); rtlpriv->max_fw_size =0 ;release_firmware (firmware); -return ; + goto exit; } pfirmware = (struct rt_firmware *)rtlpriv->rtlhal.pfirmware;memcpy (pfirmware->sz_fw_tmpbuffer, firmware->data, firmware->size); pfirmware->sz_fw_tmpbufferlen = firmware->size;release_firmware (firmware); +exit: +complete (&rtlpriv->firmware_loading_complete); }static int rtl92s_init_sw_vars (struct ieee80211_hw *hw)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 51/393 wifi: rtlwifi: wait for firmware loading before releasing memory
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thadeu Lima de Souza Cascardo <[email protected]>
[ Upstream commit b4b26642b31ef282df6ff7ea8531985edfdef12a ]
At probe error path, the firmware loading work may have already been queued. In such a case, it will try to access memory allocated by the probe function, which is about to be released. In such paths, wait for the firmware worker to finish before releasing memory.
--- drivers/net/wireless/realtek/rtlwifi/usb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/realtek/rtlwifi/usb.c +3 -1
@@ -1054,13 +1054,15 @@ int rtl_usb_probe(struct usb_interface *intf, err =ieee80211_register_hw (hw);if (err) {pr_err ("Can't register mac80211 hw.\n" ); - goto error_out; + goto error_init_vars; } rtlpriv->mac80211.mac80211_registered =1 ;set_bit (RTL_STATUS_INTERFACE_START , &rtlpriv->status);return 0 ; +error_init_vars: +wait_for_completion (&rtlpriv->firmware_loading_complete); error_out:rtl_deinit_core (hw); error_out2:
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 52/393 wifi: rtlwifi: fix init_sw_vars leak when probe fails
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thadeu Lima de Souza Cascardo <[email protected]>
[ Upstream commit 00260350aed80c002df270c805ca443ec9a719a6 ]
If ieee80211_register_hw fails, the memory allocated for the firmware will not be released. Call deinit_sw_vars as the function that undoes the allocationes done by init_sw_vars.
--- drivers/net/wireless/realtek/rtlwifi/usb.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/realtek/rtlwifi/usb.c +1 -0
@@ -1063,6 +1063,7 @@ int rtl_usb_probe(struct usb_interface *intf, error_init_vars:wait_for_completion (&rtlpriv->firmware_loading_complete); + rtlpriv->cfg->ops->deinit_sw_vars (hw); error_out:rtl_deinit_core (hw); error_out2:
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 53/393 wifi: rtlwifi: usb: fix workqueue leak when probe fails
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thadeu Lima de Souza Cascardo <[email protected]>
[ Upstream commit f79bc5c67867c19ce2762e7934c20dbb835ed82c ]
rtl_init_core creates a workqueue that is then assigned to rtl_wq. rtl_deinit_core does not destroy it. It is left to rtl_usb_deinit, which must be called in the probe error path.
--- drivers/net/wireless/realtek/rtlwifi/usb.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/realtek/rtlwifi/usb.c +1 -0
@@ -1065,6 +1065,7 @@ int rtl_usb_probe(struct usb_interface *intf,wait_for_completion (&rtlpriv->firmware_loading_complete); rtlpriv->cfg->ops->deinit_sw_vars (hw); error_out: +rtl_usb_deinit (hw);rtl_deinit_core (hw); error_out2:_rtl_usb_io_handler_release (hw);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 54/393 wifi: wcn36xx: fix channel survey memory allocation size
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Barnabás Czémán <[email protected]>
[ Upstream commit 6200d947f050efdba4090dfefd8a01981363d954 ]
KASAN reported a memory allocation issue in wcn->chan_survey due to incorrect size calculation.
This commit uses kcalloc to allocate memory for wcn->chan_survey, ensuring proper initialization and preventing the use of uninitialized values when there are no frames on the channel.
--- drivers/net/wireless/ath/wcn36xx/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/wcn36xx/main.c +4 -1
@@ -1586,7 +1586,10 @@ static int wcn36xx_probe(struct platform_device *pdev) } n_channels = wcn_band_2ghz.n_channels + wcn_band_5ghz.n_channels; - wcn->chan_survey =devm_kmalloc (wcn->dev, n_channels,GFP_KERNEL ); + wcn->chan_survey =devm_kcalloc (wcn->dev, + n_channels, +sizeof (struct wcn36xx_chan_survey ), +GFP_KERNEL );if (!wcn->chan_survey) { ret = -ENOMEM ; goto out_wq;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 55/393 net_sched: sch_sfq: annotate data-races around q->perturb_period
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit a17ef9e6c2c1cf0fc6cd6ca6a9ce525c67d1da7f ]
sfq_perturbation() reads q->perturb_period locklessly. Add annotations to fix potential issues.
Stable-dep-of: 10685681bafc ("net_sched: sch_sfq: don't allow 1 packet limit")
--- net/sched/sch_sfq.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
net/sched/sch_sfq.c +9 -4
@@ -608,6 +608,7 @@ static void sfq_perturbation(struct timer_list *t)struct Qdisc *sch = q->sch;spinlock_t *root_lock;siphash_key_t nkey; +int period;get_random_bytes (&nkey,sizeof (nkey));rcu_read_lock ();
@@ -618,8 +619,12 @@ static void sfq_perturbation(struct timer_list *t)sfq_rehash (sch);spin_unlock (root_lock); -if (q->perturb_period) -mod_timer (&q->perturb_timer, jiffies + q->perturb_period); +/* q->perturb_period can change under us from +* sfq_change() and sfq_destroy(). +*/ + period =READ_ONCE (q->perturb_period); +if (period) +mod_timer (&q->perturb_timer, jiffies + period);rcu_read_unlock (); }
@@ -662,7 +667,7 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt) q->quantum = ctl->quantum; q->scaled_quantum =SFQ_ALLOT_SIZE (q->quantum); } - q->perturb_period = ctl->perturb_period *HZ ; +WRITE_ONCE (q->perturb_period, ctl->perturb_period *HZ );if (ctl->flows) q->maxflows =min_t (u32, ctl->flows,SFQ_MAX_FLOWS );if (ctl->divisor) {
@@ -724,7 +729,7 @@ static void sfq_destroy(struct Qdisc *sch)struct sfq_sched_data *q =qdisc_priv (sch);tcf_block_put (q->block); - q->perturb_period =0 ; +WRITE_ONCE (q->perturb_period,0 );del_timer_sync (&q->perturb_timer);sfq_free (q->ht);sfq_free (q->slots);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 56/393 net_sched: sch_sfq: handle bigger packets
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit e4650d7ae4252f67e997a632adfae0dd74d3a99a ]
SFQ has an assumption on dealing with packets smaller than 64KB.
Even before BIG TCP, TCA_STAB can provide arbitrary big values in qdisc_pkt_len(skb)
It is time to switch (struct sfq_slot)->allot to a 32bit field.
sizeof(struct sfq_slot) is now 64 bytes, giving better cache locality.
Stable-dep-of: 10685681bafc ("net_sched: sch_sfq: don't allow 1 packet limit")
--- net/sched/sch_sfq.c | 39 +++++++++++++-------------------------- 1 file changed, 13 insertions(+), 26 deletions(-)
net/sched/sch_sfq.c +13 -26
@@ -77,12 +77,6 @@#define SFQ_EMPTY_SLOT 0xffff#define SFQ_DEFAULT_HASH_DIVISOR 1024 -/* We use 16 bits to store allot, and want to handle packets up to 64K -* Scale allot by 8 (1<<3) so that no overflow occurs. -*/ -#define SFQ_ALLOT_SHIFT 3 -#define SFQ_ALLOT_SIZE (X ) DIV_ROUND_UP(X, 1 << SFQ_ALLOT_SHIFT) -/* This type should contain at least SFQ_MAX_DEPTH + 1 + SFQ_MAX_FLOWS values */ typedef u16 sfq_index ;
@@ -104,7 +98,7 @@ struct sfq_slot {sfq_index next;/* next slot in sfq RR chain */ struct sfq_head dep;/* anchor in dep[] chains */ unsigned short hash;/* hash value (index in ht[]) */ -short allot;/* credit for this slot */ +int allot;/* credit for this slot */ unsigned int backlog;struct red_vars vars;
@@ -120,7 +114,6 @@ struct sfq_sched_data {siphash_key_t perturbation;u8 cur_depth;/* depth of longest slot */ u8 flags; -unsigned short scaled_quantum;/* SFQ_ALLOT_SIZE(quantum) */ struct tcf_proto __rcu *filter_list;struct tcf_block *block;sfq_index *ht;/* Hash table ('divisor' slots) */
@@ -456,7 +449,7 @@ sfq_enqueue(struct sk_buff *skb, struct Qdisc *sch, struct sk_buff **to_free)*/ q->tail = slot;/* We could use a bigger initial quantum for new flows */ - slot->allot = q->scaled_quantum; + slot->allot = q->quantum; }if (++sch->q.qlen <= q->limit)return NET_XMIT_SUCCESS ;
@@ -493,7 +486,7 @@ sfq_dequeue(struct Qdisc *sch) slot = &q->slots[a];if (slot->allot <=0 ) { q->tail = slot; - slot->allot += q->scaled_quantum; + slot->allot += q->quantum; goto next_slot; } skb =slot_dequeue_head (slot);
@@ -512,7 +505,7 @@ sfq_dequeue(struct Qdisc *sch) } q->tail->next = next_a; }else { - slot->allot -=SFQ_ALLOT_SIZE (qdisc_pkt_len (skb)); + slot->allot -=qdisc_pkt_len (skb); }return skb; }
@@ -595,7 +588,7 @@ static void sfq_rehash(struct Qdisc *sch) q->tail->next = x; } q->tail = slot; - slot->allot = q->scaled_quantum; + slot->allot = q->quantum; } } sch->q.qlen -= dropped;
@@ -628,7 +621,8 @@ static void sfq_perturbation(struct timer_list *t)rcu_read_unlock (); } -static int sfq_change (struct Qdisc *sch,struct nlattr *opt) +static int sfq_change (struct Qdisc *sch,struct nlattr *opt, +struct netlink_ext_ack *extack) {struct sfq_sched_data *q =qdisc_priv (sch);struct tc_sfq_qopt *ctl =nla_data (opt);
@@ -646,14 +640,10 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt) (!is_power_of_2(ctl->divisor) || ctl->divisor > 65536))return -EINVAL ; -/* slot->allot is a short, make sure quantum is not too big. */ -if (ctl->quantum) { -unsigned int scaled =SFQ_ALLOT_SIZE (ctl->quantum); - -if (scaled <=0 || scaled >SHRT_MAX ) -return -EINVAL ; +if ((int )ctl->quantum <0 ) { +NL_SET_ERR_MSG_MOD (extack,"invalid quantum" ); +return -EINVAL ; } -if (ctl_v1 && !red_check_params (ctl_v1->qth_min, ctl_v1->qth_max, ctl_v1->Wlog, ctl_v1->Scell_log,NULL ))return -EINVAL ;
@@ -663,10 +653,8 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt)return -ENOMEM ; }sch_tree_lock (sch); -if (ctl->quantum) { +if (ctl->quantum) q->quantum = ctl->quantum; - q->scaled_quantum =SFQ_ALLOT_SIZE (q->quantum); - }WRITE_ONCE (q->perturb_period, ctl->perturb_period *HZ );if (ctl->flows) q->maxflows =min_t (u32, ctl->flows,SFQ_MAX_FLOWS );
@@ -762,12 +750,11 @@ static int sfq_init(struct Qdisc *sch, struct nlattr *opt, q->divisor =SFQ_DEFAULT_HASH_DIVISOR ; q->maxflows =SFQ_DEFAULT_FLOWS ; q->quantum =psched_mtu (qdisc_dev (sch)); - q->scaled_quantum =SFQ_ALLOT_SIZE (q->quantum); q->perturb_period =0 ;get_random_bytes (&q->perturbation,sizeof (q->perturbation));if (opt) { -int err =sfq_change (sch, opt); +int err =sfq_change (sch, opt, extack);if (err)return err; }
@@ -878,7 +865,7 @@ static int sfq_dump_class_stats(struct Qdisc *sch, unsigned long cl,if (idx !=SFQ_EMPTY_SLOT ) {const struct sfq_slot *slot = &q->slots[idx]; - xstats.allot = slot->allot <<SFQ_ALLOT_SHIFT ; + xstats.allot = slot->allot; qs.qlen = slot->qlen; qs.backlog = slot->backlog; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 57/393 net_sched: sch_sfq: dont allow 1 packet limit
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Octavian Purdila <[email protected]>
[ Upstream commit 10685681bafce6febb39770f3387621bf5d67d0b ]
The current implementation does not work correctly with a limit of
1. iproute2 actually checks for this and this patch adds the check in kernel as well.
This fixes the following syzkaller reported crash:
UBSAN: array-index-out-of-bounds in net/sched/sch_sfq.c:210:6 index 65535 is out of range for type 'struct sfq_head[128]' CPU: 0 PID: 2569 Comm: syz-executor101 Not tainted 5.10.0-smp-DEV #1 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x125/0x19f lib/dump_stack.c:120 ubsan_epilogue lib/ubsan.c:148 [inline] __ubsan_handle_out_of_bounds+0xed/0x120 lib/ubsan.c:347 sfq_link net/sched/sch_sfq.c:210 [inline] sfq_dec+0x528/0x600 net/sched/sch_sfq.c:238 sfq_dequeue+0x39b/0x9d0 net/sched/sch_sfq.c:500 sfq_reset+0x13/0x50 net/sched/sch_sfq.c:525 qdisc_reset+0xfe/0x510 net/sched/sch_generic.c:1026 tbf_reset+0x3d/0x100 net/sched/sch_tbf.c:319 qdisc_reset+0xfe/0x510 net/sched/sch_generic.c:1026 dev_reset_queue+0x8c/0x140 net/sched/sch_generic.c:1296 netdev_for_each_tx_queue include/linux/netdevice.h:2350 [inline] dev_deactivate_many+0x6dc/0xc20 net/sched/sch_generic.c:1362 __dev_close_many+0x214/0x350 net/core/dev.c:1468 dev_close_many+0x207/0x510 net/core/dev.c:1506 unregister_netdevice_many+0x40f/0x16b0 net/core/dev.c:10738 unregister_netdevice_queue+0x2be/0x310 net/core/dev.c:10695 unregister_netdevice include/linux/netdevice.h:2893 [inline] __tun_detach+0x6b6/0x1600 drivers/net/tun.c:689 tun_detach drivers/net/tun.c:705 [inline] tun_chr_close+0x104/0x1b0 drivers/net/tun.c:3640 __fput+0x203/0x840 fs/file_table.c:280 task_work_run+0x129/0x1b0 kernel/task_work.c:185 exit_task_work include/linux/task_work.h:33 [inline] do_exit+0x5ce/0x2200 kernel/exit.c:931 do_group_exit+0x144/0x310 kernel/exit.c:1046 __do_sys_exit_group kernel/exit.c:1057 [inline] __se_sys_exit_group kernel/exit.c:1055 [inline] __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1055 do_syscall_64+0x6c/0xd0 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7fe5e7b52479 Code: Unable to access opcode bytes at RIP 0x7fe5e7b5244f. RSP: 002b:00007ffd3c800398 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fe5e7b52479 RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000000 RBP: 00007fe5e7bcd2d0 R08: ffffffffffffffb8 R09: 0000000000000014 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fe5e7bcd2d0 R13: 0000000000000000 R14: 00007fe5e7bcdd20 R15: 00007fe5e7b24270
The crash can be also be reproduced with the following (with a tc recompiled to allow for sfq limits of 1):
tc qdisc add dev dummy0 handle 1: root tbf rate 1Kbit burst 100b lat 1s ../iproute2-6.9.0/tc/tc qdisc add dev dummy0 handle 2: parent 1:10 sfq limit 1 ifconfig dummy0 up
ping -I dummy0 -f -c2 -W0.1 8.8.8.8
sleep 1
Scenario that triggers the crash:
* the first packet is sent and queued in TBF and SFQ; qdisc qlen is 1
* TBF dequeues: it peeks from SFQ which moves the packet to the gso_skb list and keeps qdisc qlen set to 1. TBF is out of tokens so it schedules itself for later.
* the second packet is sent and TBF tries to queues it to SFQ. qdisc qlen is now 2 and because the SFQ limit is 1 the packet is dropped by SFQ. At this point qlen is 1, and all of the SFQ slots are empty, however q->tail is not NULL.
At this point, assuming no more packets are queued, when sch_dequeue runs again it will decrement the qlen for the current empty slot causing an underflow and the subsequent out of bounds access.
--- net/sched/sch_sfq.c | 4 ++++ 1 file changed, 4 insertions(+)
net/sched/sch_sfq.c +4 -0
@@ -652,6 +652,10 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt,if (!p)return -ENOMEM ; } +if (ctl->limit ==1 ) { +NL_SET_ERR_MSG_MOD (extack,"invalid limit" ); +return -EINVAL ; + }sch_tree_lock (sch);if (ctl->quantum) q->quantum = ctl->quantum;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 58/393 spi: zynq-qspi: Add check for clk_enable()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mingwei Zheng <[email protected]>
[ Upstream commit 8332e667099712e05ec87ba2058af394b51ebdc9 ]
Add check for the return value of clk_enable() to catch the potential error.
--- drivers/spi/spi-zynq-qspi.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/spi/spi-zynq-qspi.c +11 -2
@@ -379,12 +379,21 @@ static int zynq_qspi_setup_op(struct spi_device *spi) {struct spi_controller *ctlr = spi->master;struct zynq_qspi *qspi =spi_controller_get_devdata (ctlr); +int ret;if (ctlr->busy)return -EBUSY ; -clk_enable (qspi->refclk); -clk_enable (qspi->pclk); + ret =clk_enable (qspi->refclk); +if (ret) +return ret; + + ret =clk_enable (qspi->pclk); +if (ret) { +clk_disable (qspi->refclk); +return ret; + } +zynq_qspi_write (qspi,ZYNQ_QSPI_ENABLE_OFFSET ,ZYNQ_QSPI_ENABLE_ENABLE_MASK );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 59/393 rxrpc: Fix handling of received connection abort
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <[email protected]>
[ Upstream commit 0e56ebde245e4799ce74d38419426f2a80d39950 ]
Fix the handling of a connection abort that we've received. Though the abort is at the connection level, it needs propagating to the calls on that connection. Whilst the propagation bit is performed, the calls aren't then woken up to go and process their termination, and as no further input is forthcoming, they just hang.
Also add some tracing for the logging of connection aborts.
--- include/trace/events/rxrpc.h | 25 +++++++++++++++++++++++++ net/rxrpc/conn_event.c | 12 ++++++++---- 2 files changed, 33 insertions(+), 4 deletions(-)
include/trace/events/rxrpc.h +25 -0
@@ -117,6 +117,7 @@#define rxrpc_call_poke_traces \ EM(rxrpc_call_poke_abort, "Abort") \ EM(rxrpc_call_poke_complete, "Compl") \ + EM(rxrpc_call_poke_conn_abort, "Conn-abort") \ EM(rxrpc_call_poke_error, "Error") \ EM(rxrpc_call_poke_idle, "Idle") \ EM(rxrpc_call_poke_start, "Start") \
@@ -278,6 +279,7 @@ EM(rxrpc_call_see_activate_client, "SEE act-clnt") \ EM(rxrpc_call_see_connect_failed, "SEE con-fail") \ EM(rxrpc_call_see_connected, "SEE connect ") \ + EM(rxrpc_call_see_conn_abort, "SEE conn-abt") \ EM(rxrpc_call_see_disconnected, "SEE disconn ") \ EM(rxrpc_call_see_distribute_error, "SEE dist-err") \EM (rxrpc_call_see_input,"SEE input " ) \
@@ -961,6 +963,29 @@ TRACE_EVENT(rxrpc_rx_abort, __entry->abort_code) ); +TRACE_EVENT (rxrpc_rx_conn_abort, + TP_PROTO(const struct rxrpc_connection *conn, const struct sk_buff *skb), + +TP_ARGS (conn, skb), + +TP_STRUCT__entry ( + __field(unsigned int, conn) + __field(rxrpc_serial_t, serial) +__field (u32, abort_code) + ), + +TP_fast_assign ( + __entry->conn = conn->debug_id; + __entry->serial = rxrpc_skb(skb)->hdr.serial; + __entry->abort_code = skb->priority; + ), + +TP_printk ("C=%08x ABORT %08x ac=%d" , + __entry->conn, + __entry->serial, + __entry->abort_code) + ); + TRACE_EVENT(rxrpc_rx_challenge, TP_PROTO(struct rxrpc_connection *conn, rxrpc_serial_t serial, u32 version, u32 nonce, u32 min_level),
net/rxrpc/conn_event.c +8 -4
@@ -63,11 +63,12 @@ int rxrpc_abort_conn(struct rxrpc_connection *conn, struct sk_buff *skb,/* * Mark a connection as being remotely aborted. */ -static bool rxrpc_input_conn_abort (struct rxrpc_connection *conn, +static void rxrpc_input_conn_abort (struct rxrpc_connection *conn,struct sk_buff *skb) { -return rxrpc_set_conn_aborted (conn, skb, skb->priority, -ECONNABORTED , -RXRPC_CALL_REMOTELY_ABORTED ); +trace_rxrpc_rx_conn_abort (conn, skb); +rxrpc_set_conn_aborted (conn, skb, skb->priority, -ECONNABORTED , +RXRPC_CALL_REMOTELY_ABORTED ); }/*
@@ -202,11 +203,14 @@ static void rxrpc_abort_calls(struct rxrpc_connection *conn)for (i =0 ; i <RXRPC_MAXCALLS ; i++) { call = conn->channels[i].call; -if (call) +if (call) { +rxrpc_see_call (call, rxrpc_call_see_conn_abort);rxrpc_set_call_completion (call, conn->completion, conn->abort_code, conn->error); +rxrpc_poke_call (call, rxrpc_call_poke_conn_abort); + } }_leave ("" );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 60/393 dt-bindings: mmc: controller: clarify the address-cells description
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Neil Armstrong <[email protected]>
[ Upstream commit b2b8e93ec00b8110cb37cbde5400d5abfdaed6a7 ]
The term "slot ID" has nothing to do with the SDIO function number which is specified in the reg property of the subnodes, rephrase the description to be more accurate.
Message-ID: <20241128-topic-amlogic-arm32-upstream-bindings-fixes-convert-meson-mx-sdio-v4-1-11d9f9200a59@linaro.org>
--- Documentation/devicetree/bindings/mmc/mmc-controller.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/mmc/mmc-controller.yaml +1 -1
@@ -25,7 +25,7 @@ properties: "#address-cells": const: 1 description: | - The cell is the slot ID if a function subnode is used. + The cell is the SDIO function number if a function subnode is used. "#size-cells": const: 0
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 61/393 serial: sc16is7xx: use device_property APIs when configuring irda mode
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hugo Villeneuve <[email protected]>
[ Upstream commit 1a0a2a1e57aa8dcdae25229f6e95cf6bd4817faf ]
Convert driver to be property provider agnostic and allow it to be used on non-OF platforms.
Stable-dep-of: 28fa3291cad1 ("clk: fix an OF node reference leak in of_clk_get_parent_name()")
--- drivers/tty/serial/sc16is7xx.c | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-)
drivers/tty/serial/sc16is7xx.c +24 -10
@@ -1410,6 +1410,29 @@ static int sc16is7xx_setup_gpio_chip(struct sc16is7xx_port *s) }#endif +static void sc16is7xx_setup_irda_ports (struct sc16is7xx_port *s) +{ +int i; +int ret; +int count; +u32 irda_port[2 ]; +struct device *dev = s->p[0 ].port.dev; + + count =device_property_count_u32 (dev,"irda-mode-ports" ); +if (count <0 || count >ARRAY_SIZE (irda_port)) +return ; + + ret =device_property_read_u32_array (dev,"irda-mode-ports" , + irda_port, count); +if (ret) +return ; + +for (i =0 ; i < count; i++) { +if (irda_port[i] < s->devtype->nr_uart) + s->p[irda_port[i]].irda_mode = true; + } +} +/* * Configure ports designated to operate as modem control lines. */
@@ -1603,16 +1626,7 @@ static int sc16is7xx_probe(struct device *dev,sc16is7xx_power (&s->p[i].port,0 ); } -if (dev->of_node) { -struct property *prop; -const __be32 *p; -u32 u; - -of_property_for_each_u32 (dev->of_node,"irda-mode-ports" , - prop, p, u) -if (u < devtype->nr_uart) - s->p[u].irda_mode = true; - } +sc16is7xx_setup_irda_ports (s); ret =sc16is7xx_setup_mctrl_ports (s, regmaps[0 ]);if (ret)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 62/393 clk: si5351: allow PLLs to be adjusted without reset
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alvin Šipraga <[email protected]>
[ Upstream commit b2adbc9cea752539f6421e9d4642408f666c1251 ]
Introduce a new PLL reset mode flag which controls whether or not to reset a PLL after adjusting its rate. The mode can be configured through platform data or device tree.
Since commit 6dc669a22c77 ("clk: si5351: Add PLL soft reset"), the driver unconditionally resets a PLL whenever its rate is adjusted. The rationale was that a PLL reset was required to get three outputs working at the same time. Before this change, the driver never reset the PLLs.
Commit b26ff127c52c ("clk: si5351: Apply PLL soft reset before enabling the outputs") subsequently introduced an option to reset the PLL when enabling a clock output that sourced it. Here, the rationale was that this is required to get a deterministic phase relationship between multiple output clocks.
This clearly shows that it is useful to reset the PLLs in applications where multiple clock outputs are used. However, the Si5351 also allows for glitch-free rate adjustment of its PLLs if one avoids resetting the PLL. In our audio application where a single Si5351 clock output is used to supply a runtime adjustable bit clock, this unconditional PLL reset behaviour introduces unwanted glitches in the clock output.
It would appear that the problem being solved in the former commit may be solved by using the optional device tree property introduced in the latter commit, obviating the need for an unconditional PLL reset after rate adjustment. But it's not OK to break the default behaviour of the driver, and it cannot be assumed that all device trees are using the property introduced in the latter commit. Hence, the new behaviour is made opt-in.
Stable-dep-of: 28fa3291cad1 ("clk: fix an OF node reference leak in of_clk_get_parent_name()")
--- drivers/clk/clk-si5351.c | 47 ++++++++++++++++++++++++++-- include/linux/platform_data/si5351.h | 2 ++ 2 files changed, 46 insertions(+), 3 deletions(-)
drivers/clk/clk-si5351.c +44 -3
@@ -506,6 +506,8 @@ static int si5351_pll_set_rate(struct clk_hw *hw, unsigned long rate, {struct si5351_hw_data *hwdata = container_of(hw, struct si5351_hw_data, hw); +struct si5351_platform_data *pdata = + hwdata->drvdata->client->dev.platform_data;u8 reg = (hwdata->num ==0 ) ?SI5351_PLLA_PARAMETERS :SI5351_PLLB_PARAMETERS ;
@@ -518,9 +520,10 @@ static int si5351_pll_set_rate(struct clk_hw *hw, unsigned long rate, (hwdata->params.p2 == 0) ? SI5351_CLK_INTEGER_MODE : 0);/* Do a pll soft reset on the affected pll */ -si5351_reg_write (hwdata->drvdata,SI5351_PLL_RESET , - hwdata->num ==0 ?SI5351_PLL_RESET_A : -SI5351_PLL_RESET_B ); +if (pdata->pll_reset[hwdata->num]) +si5351_reg_write (hwdata->drvdata,SI5351_PLL_RESET , + hwdata->num ==0 ?SI5351_PLL_RESET_A : +SI5351_PLL_RESET_B ); dev_dbg(&hwdata->drvdata->client->dev, "%s - %s: p1 = %lu, p2 = %lu, p3 = %lu, parent_rate = %lu, rate = %lu\n",
@@ -1222,6 +1225,44 @@ static int si5351_dt_parse(struct i2c_client *client, } } +/* +* Parse PLL reset mode. For compatibility with older device trees, the +* default is to always reset a PLL after setting its rate. +*/ + pdata->pll_reset[0 ] = true; + pdata->pll_reset[1 ] = true; + +of_property_for_each_u32 (np,"silabs,pll-reset-mode" , prop, p, num) { +if (num >=2 ) { +dev_err (&client->dev, +"invalid pll %d on pll-reset-mode prop\n" , num); +return -EINVAL ; + } + + p =of_prop_next_u32 (prop, p, &val); +if (!p) { +dev_err (&client->dev, +"missing pll-reset-mode for pll %d\n" , num); +return -EINVAL ; + } + +switch (val) { +case 0 : +/* Reset PLL whenever its rate is adjusted */ + pdata->pll_reset[num] = true; +break ; +case 1 : +/* Don't reset PLL whenever its rate is adjusted */ + pdata->pll_reset[num] = false; +break ; +default : +dev_err (&client->dev, +"invalid pll-reset-mode %d for pll %d\n" , val, + num); +return -EINVAL ; + } + } +/* per clkout properties */ for_each_child_of_node (np, child) {if (of_property_read_u32 (child,"reg" , &num)) {
include/linux/platform_data/si5351.h +2 -0
@@ -105,10 +105,12 @@ struct si5351_clkout_config {* @clk_xtal: xtal input clock * @clk_clkin: clkin input clock * @pll_src: array of pll source clock setting +* @pll_reset: array indicating if plls should be reset after setting the rate * @clkout: array of clkout configuration */ struct si5351_platform_data {enum si5351_pll_src pll_src[2 ]; +bool pll_reset[2 ];struct si5351_clkout_config clkout[8 ]; };
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 63/393 of: remove internal arguments from of_property_for_each_u32()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Luca Ceresoli <[email protected]>
[ Upstream commit 9722c3b66e21ff08aec570d02a97d331087fd70f ]
The of_property_for_each_u32() macro needs five parameters, two of which are primarily meant as internal variables for the macro itself (in the for() clause). Yet these two parameters are used by a few drivers, and this can be considered misuse or at least bad practice.
Now that the kernel uses C11 to build, these two parameters can be avoided by declaring them internally, thus changing this pattern:
struct property *prop;
const __be32 *p;
u32 val;
of_property_for_each_u32(np, "xyz", prop, p, val) { ... }
to this:
u32 val;
of_property_for_each_u32(np, "xyz", val) { ... }
However two variables cannot be declared in the for clause even with C11, so declare one struct that contain the two variables we actually need. As the variables inside this struct are not meant to be used by users of this macro, give the struct instance the noticeable name "_it" so it is visible during code reviews, helping to avoid new code to use it directly.
Most usages are trivially converted as they do not use those two parameters, as expected. The non-trivial cases are:
- drivers/clk/clk.c, of_clk_get_parent_name(): easily doable anyway
- drivers/clk/clk-si5351.c, si5351_dt_parse(): this is more complex as the checks had to be replicated in a different way, making code more verbose and somewhat uglier, but I refrained from a full rework to keep as much of the original code untouched having no hardware to test my changes
All the changes have been build tested. The few for which I have the hardware have been runtime-tested too.
Stable-dep-of: 28fa3291cad1 ("clk: fix an OF node reference leak in of_clk_get_parent_name()")
--- arch/powerpc/sysdev/xive/native.c | 4 +-- arch/powerpc/sysdev/xive/spapr.c | 3 +- drivers/bus/ti-sysc.c | 4 +-- drivers/clk/clk-conf.c | 4 +-- drivers/clk/clk-si5351.c | 43 +++++++++++++++---------- drivers/clk/clk.c | 12 +++---- drivers/clk/qcom/common.c | 4 +-- drivers/clk/sunxi/clk-simple-gates.c | 4 +-- drivers/clk/sunxi/clk-sun8i-bus-gates.c | 4 +-- drivers/clocksource/samsung_pwm_timer.c | 4 +-- drivers/gpio/gpio-brcmstb.c | 5 +-- drivers/iio/adc/ti_am335x_adc.c | 4 +-- drivers/irqchip/irq-atmel-aic-common.c | 4 +-- drivers/irqchip/irq-pic32-evic.c | 4 +-- drivers/mfd/ti_am335x_tscadc.c | 4 +-- drivers/pinctrl/nxp/pinctrl-s32cc.c | 4 +-- drivers/pinctrl/pinctrl-k210.c | 4 +-- drivers/pwm/pwm-samsung.c | 4 +-- drivers/tty/sysrq.c | 4 +-- drivers/usb/misc/usb251xb.c | 4 +-- include/linux/of.h | 15 ++++----- sound/soc/codecs/arizona.c | 12 +++---- 22 files changed, 61 insertions(+), 93 deletions(-)
arch/powerpc/sysdev/xive/native.c +1 -3
@@ -559,9 +559,7 @@ bool __init xive_native_init(void)struct device_node *np;struct resource r;void __iomem *tima; -struct property *prop;u8 max_prio =7 ; -const __be32 *p;u32 val, cpu;s64 rc;
@@ -592,7 +590,7 @@ bool __init xive_native_init(void) max_prio = val -1 ;/* Iterate the EQ sizes and pick one */ -of_property_for_each_u32 (np,"ibm,xive-eq-sizes" , prop, p, val) { +of_property_for_each_u32 (np,"ibm,xive-eq-sizes" , val) { xive_queue_shift = val;if (val ==PAGE_SHIFT )break ;
arch/powerpc/sysdev/xive/spapr.c +1 -2
@@ -814,7 +814,6 @@ bool __init xive_spapr_init(void)struct device_node *np;struct resource r;void __iomem *tima; -struct property *prop;u8 max_prio;u32 val;u32 len;
@@ -866,7 +865,7 @@ bool __init xive_spapr_init(void) }/* Iterate the EQ sizes and pick one */ -of_property_for_each_u32 (np,"ibm,xive-eq-sizes" , prop, reg, val) { +of_property_for_each_u32 (np,"ibm,xive-eq-sizes" , val) { xive_queue_shift = val;if (val ==PAGE_SHIFT )break ;
drivers/bus/ti-sysc.c +1 -3
@@ -2283,11 +2283,9 @@ static int sysc_init_idlemode(struct sysc *ddata, u8 *idlemodes, const char *name) {struct device_node *np = ddata->dev->of_node; -struct property *prop; -const __be32 *p;u32 val; -of_property_for_each_u32 (np, name, prop, p, val) { +of_property_for_each_u32 (np, name, val) {if (val >=SYSC_NR_IDLEMODES ) {dev_err (ddata->dev,"invalid idlemode: %i\n" , val);return -EINVAL ;
drivers/clk/clk-conf.c +1 -3
@@ -81,13 +81,11 @@ static int __set_clk_parents(struct device_node *node, bool clk_supplier)static int __set_clk_rates (struct device_node *node,bool clk_supplier) {struct of_phandle_args clkspec; -struct property *prop; -const __be32 *cur;int rc, index =0 ;struct clk *clk;u32 rate; -of_property_for_each_u32 (node,"assigned-clock-rates" , prop, cur, rate) { +of_property_for_each_u32 (node,"assigned-clock-rates" , rate) {if (rate) { rc =of_parse_phandle_with_args (node,"assigned-clocks" ,"#clock-cells" , index, &clkspec);
drivers/clk/clk-si5351.c +26 -17
73 lines not on this page · raw message
drivers/clk/clk.c +5 -7
@@ -5316,9 +5316,8 @@ EXPORT_SYMBOL_GPL(of_clk_get_parent_count);const char *of_clk_get_parent_name (const struct device_node *np,int index) {struct of_phandle_args clkspec; -struct property *prop;const char *clk_name; -const __be32 *vp; +bool found = false;u32 pv;int rc;int count;
@@ -5335,15 +5334,16 @@ const char *of_clk_get_parent_name(const struct device_node *np, int index)/* if there is an indices property, use it to transfer the index * specified into an array offset for the clock-output-names property. */ -of_property_for_each_u32 (clkspec.np,"clock-indices" , prop, vp, pv) { +of_property_for_each_u32 (clkspec.np,"clock-indices" , pv) {if (index == pv) { index = count; + found = true;break ; } count++; }/* We went off the end of 'clock-indices' without finding it */ -if (prop && !vp) +if (of_property_present (clkspec.np,"clock-indices" ) && !found)return NULL ; if (of_property_read_string_index(clkspec.np, "clock-output-names",
@@ -5456,14 +5456,12 @@ static int parent_ready(struct device_node *np)int of_clk_detect_critical (struct device_node *np,int index,unsigned long *flags) { -struct property *prop; -const __be32 *cur;uint32_t idx;if (!np || !flags)return -EINVAL ; -of_property_for_each_u32 (np,"clock-critical" , prop, cur, idx) +of_property_for_each_u32 (np,"clock-critical" , idx)if (index == idx) *flags |=CLK_IS_CRITICAL ;
drivers/clk/qcom/common.c +1 -3
@@ -208,11 +208,9 @@ EXPORT_SYMBOL_GPL(qcom_cc_register_sleep_clk);static void qcom_cc_drop_protected (struct device *dev,struct qcom_cc *cc) {struct device_node *np = dev->of_node; -struct property *prop; -const __be32 *p;u32 i; -of_property_for_each_u32 (np,"protected-clocks" , prop, p, i) { +of_property_for_each_u32 (np,"protected-clocks" , i) {if (i >= cc->num_rclks)continue ;
drivers/clk/sunxi/clk-simple-gates.c +1 -3
@@ -21,11 +21,9 @@ static void __init sunxi_simple_gates_setup(struct device_node *node, {struct clk_onecell_data *clk_data;const char *clk_parent, *clk_name; -struct property *prop;struct resource res;void __iomem *clk_reg;void __iomem *reg; -const __be32 *p;int number, i =0 , j;u8 clk_bit;u32 index;
@@ -47,7 +45,7 @@ static void __init sunxi_simple_gates_setup(struct device_node *node,if (!clk_data->clks) goto err_free_data; -of_property_for_each_u32 (node,"clock-indices" , prop, p, index) { +of_property_for_each_u32 (node,"clock-indices" , index) {of_property_read_string_index (node,"clock-output-names" , i, &clk_name);
drivers/clk/sunxi/clk-sun8i-bus-gates.c +1 -3
@@ -24,11 +24,9 @@ static void __init sun8i_h3_bus_gates_init(struct device_node *node)const char *parents[PARENT_MAX ];struct clk_onecell_data *clk_data;const char *clk_name; -struct property *prop;struct resource res;void __iomem *clk_reg;void __iomem *reg; -const __be32 *p;int number, i;u8 clk_bit;int index;
@@ -58,7 +56,7 @@ static void __init sun8i_h3_bus_gates_init(struct device_node *node) goto err_free_data; i =0 ; -of_property_for_each_u32 (node,"clock-indices" , prop, p, index) { +of_property_for_each_u32 (node,"clock-indices" , index) {of_property_read_string_index (node,"clock-output-names" , i, &clk_name);
drivers/clocksource/samsung_pwm_timer.c +1 -3
@@ -418,8 +418,6 @@ void __init samsung_pwm_clocksource_init(void __iomem *base,static int __init samsung_pwm_alloc (struct device_node *np,const struct samsung_pwm_variant *variant) { -struct property *prop; -const __be32 *cur;u32 val;int i, ret;
@@ -427,7 +425,7 @@ static int __init samsung_pwm_alloc(struct device_node *np,for (i =0 ; i <SAMSUNG_PWM_NUM ; ++i) pwm.irq[i] =irq_of_parse_and_map (np, i); -of_property_for_each_u32 (np,"samsung,pwm-outputs" , prop, cur, val) { +of_property_for_each_u32 (np,"samsung,pwm-outputs" , val) {if (val >=SAMSUNG_PWM_NUM ) {pr_warn ("%s: invalid channel index in samsung,pwm-outputs property\n" , __func__);continue ;
drivers/gpio/gpio-brcmstb.c +1 -4
@@ -594,8 +594,6 @@ static int brcmstb_gpio_probe(struct platform_device *pdev)void __iomem *reg_base;struct brcmstb_gpio_priv *priv;struct resource *res; -struct property *prop; -const __be32 *p;u32 bank_width;int num_banks =0 ;int err;
@@ -640,8 +638,7 @@ static int brcmstb_gpio_probe(struct platform_device *pdev) flags =BGPIOF_BIG_ENDIAN_BYTE_ORDER ;#endif -of_property_for_each_u32 (np,"brcm,gpio-bank-widths" , prop, p, - bank_width) { +of_property_for_each_u32 (np,"brcm,gpio-bank-widths" , bank_width) {struct brcmstb_gpio_bank *bank;struct gpio_chip *gc;
drivers/iio/adc/ti_am335x_adc.c +1 -3
@@ -564,13 +564,11 @@ static int tiadc_parse_dt(struct platform_device *pdev, struct tiadc_device *adc_dev) {struct device_node *node = pdev->dev.of_node; -struct property *prop; -const __be32 *cur;int channels =0 ;u32 val;int i; -of_property_for_each_u32 (node,"ti,adc-channels" , prop, cur, val) { +of_property_for_each_u32 (node,"ti,adc-channels" , val) { adc_dev->channel_line[channels] = val;/* Set Default values for optional DT parameters */
drivers/irqchip/irq-atmel-aic-common.c +1 -3
@@ -111,8 +111,6 @@ static void __init aic_common_ext_irq_of_init(struct irq_domain *domain)struct device_node *node =irq_domain_get_of_node (domain);struct irq_chip_generic *gc;struct aic_chip_data *aic; -struct property *prop; -const __be32 *p;u32 hwirq; gc =irq_get_domain_generic_chip (domain,0 );
@@ -120,7 +118,7 @@ static void __init aic_common_ext_irq_of_init(struct irq_domain *domain) aic = gc->private; aic->ext_irqs |=1 ; -of_property_for_each_u32 (node,"atmel,external-irqs" , prop, p, hwirq) { +of_property_for_each_u32 (node,"atmel,external-irqs" , hwirq) { gc =irq_get_domain_generic_chip (domain, hwirq);if (!gc) { pr_warn("AIC: external irq %d >= %d skip it\n",
drivers/irqchip/irq-pic32-evic.c +1 -3
@@ -190,13 +190,11 @@ static void __init pic32_ext_irq_of_init(struct irq_domain *domain) {struct device_node *node =irq_domain_get_of_node (domain);struct evic_chip_data *priv = domain->host_data; -struct property *prop; -const __le32 *p;u32 hwirq;int i =0 ;const char *pname ="microchip,external-irqs" ; -of_property_for_each_u32 (node, pname, prop, p, hwirq) { +of_property_for_each_u32 (node, pname, hwirq) {if (i >=ARRAY_SIZE (priv->ext_irqs)) {pr_warn ("More than %d external irq, skip rest\n" ,ARRAY_SIZE (priv->ext_irqs));
drivers/mfd/ti_am335x_tscadc.c +1 -3
@@ -119,8 +119,6 @@ static int ti_tscadc_probe(struct platform_device *pdev)struct clk *clk;struct device_node *node;struct mfd_cell *cell; -struct property *prop; -const __be32 *cur;bool use_tsc = false, use_mag = false;u32 val;int err;
@@ -167,7 +165,7 @@ static int ti_tscadc_probe(struct platform_device *pdev) } node =of_get_child_by_name (pdev->dev.of_node,"adc" ); -of_property_for_each_u32 (node,"ti,adc-channels" , prop, cur, val) { +of_property_for_each_u32 (node,"ti,adc-channels" , val) { adc_channels++;if (val >7 ) { dev_err(&pdev->dev, " PIN numbers are 0..7 (not %d)\n",
drivers/pinctrl/nxp/pinctrl-s32cc.c +1 -3
@@ -735,9 +735,7 @@ static int s32_pinctrl_parse_groups(struct device_node *np,struct s32_pin_group *grp, struct s32_pinctrl_soc_info *info) { - const __be32 *p; struct device *dev; -struct property *prop;unsigned int *pins, *sss;int i, npins;u32 pinmux;
@@ -768,7 +766,7 @@ static int s32_pinctrl_parse_groups(struct device_node *np,return -ENOMEM ; i =0 ; -of_property_for_each_u32 (np,"pinmux" , prop, p, pinmux) { +of_property_for_each_u32 (np,"pinmux" , pinmux) { pins[i] =get_pin_no (pinmux); sss[i] =get_pin_func (pinmux);
drivers/pinctrl/pinctrl-k210.c +1 -3
@@ -763,8 +763,6 @@ static int k210_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,unsigned int *reserved_maps, unsigned int *num_maps) { - struct property *prop; -const __be32 *p; int ret, pinmux_groups;u32 pinmux_group;unsigned long *configs =NULL ;
@@ -797,7 +795,7 @@ static int k210_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,if (ret <0 ) goto exit; -of_property_for_each_u32 (np,"pinmux" , prop, p, pinmux_group) { +of_property_for_each_u32 (np,"pinmux" , pinmux_group) {const char *group_name, *func_name;u32 pin =FIELD_GET (K210_PG_PIN , pinmux_group);u32 func =FIELD_GET (K210_PG_FUNC , pinmux_group);
drivers/pwm/pwm-samsung.c +1 -3
@@ -521,8 +521,6 @@ static int pwm_samsung_parse_dt(struct samsung_pwm_chip *chip) {struct device_node *np = chip->chip.dev->of_node;const struct of_device_id *match; -struct property *prop; -const __be32 *cur;u32 val; match =of_match_node (samsung_pwm_matches, np);
@@ -531,7 +529,7 @@ static int pwm_samsung_parse_dt(struct samsung_pwm_chip *chip)memcpy (&chip->variant, match->data,sizeof (chip->variant)); -of_property_for_each_u32 (np,"samsung,pwm-outputs" , prop, cur, val) { +of_property_for_each_u32 (np,"samsung,pwm-outputs" , val) {if (val >=SAMSUNG_PWM_NUM ) { dev_err(chip->chip.dev, "%s: invalid channel index in samsung,pwm-outputs property\n",
drivers/tty/sysrq.c +1 -3
@@ -759,8 +759,6 @@ static void sysrq_of_get_keyreset_config(void) {u32 key;struct device_node *np; -struct property *prop; -const __be32 *p; np =of_find_node_by_path ("/chosen/linux,sysrq-reset-seq" );if (!np) {
@@ -771,7 +769,7 @@ static void sysrq_of_get_keyreset_config(void)/* Reset in case a __weak definition was present */ sysrq_reset_seq_len =0 ; -of_property_for_each_u32 (np,"keyset" , prop, p, key) { +of_property_for_each_u32 (np,"keyset" , key) {if (key ==KEY_RESERVED || key >KEY_MAX || sysrq_reset_seq_len ==SYSRQ_KEY_RESET_MAX )break ;
drivers/usb/misc/usb251xb.c +1 -3
@@ -382,11 +382,9 @@ static void usb251xb_get_ports_field(struct usb251xb *hub, bool ds_only, u8 *fld) { struct device *dev = hub->dev; -struct property *prop; -const __be32 *p;u32 port; -of_property_for_each_u32 (dev->of_node, prop_name, prop, p, port) { +of_property_for_each_u32 (dev->of_node, prop_name, port) {if ((port >= ds_only ?1 :0 ) && (port <= port_cnt)) *fld |=BIT (port);else
include/linux/of.h +7 -8
@@ -423,11 +423,9 @@ extern int of_detach_node(struct device_node *);#define of_match_ptr (_ptr) (_ptr)/* -* struct property *prop; -* const __be32 *p; * u32 u; * -* of_property_for_each_u32(np, "propname", prop, p, u) +* of_property_for_each_u32(np, "propname", u) * printk("U32 value: %x\n", u); */ const __be32 *of_prop_next_u32(struct property *prop, const __be32 *cur,
@@ -1399,11 +1397,12 @@ static inline int of_property_read_s32(const struct device_node *np, err ==0 ; \ err = of_phandle_iterator_next(it)) -#define of_property_for_each_u32 (np, propname, prop, p, u) \ - for (prop = of_find_property(np, propname, NULL), \ - p = of_prop_next_u32(prop, NULL, &u); \ - p; \ - p = of_prop_next_u32(prop, p, &u)) +#define of_property_for_each_u32 (np, propname, u) \ + for (struct {struct property *prop; const __be32 *item; } _it = \ + {of_find_property(np, propname, NULL), \ + of_prop_next_u32(_it.prop, NULL, &u)}; \ + _it.item; \ + _it.item = of_prop_next_u32(_it.prop, _it.item, &u))#define of_property_for_each_string (np, propname, prop, s) \ for (prop = of_find_property(np, propname, NULL), \
sound/soc/codecs/arizona.c +5 -7
@@ -2786,15 +2786,13 @@ int arizona_of_get_audio_pdata(struct arizona *arizona) {struct arizona_pdata *pdata = &arizona->pdata;struct device_node *np = arizona->dev->of_node; -struct property *prop; -const __be32 *cur;u32 val;u32 pdm_val[ARIZONA_MAX_PDM_SPK ];int ret;int count =0 ; count =0 ; -of_property_for_each_u32 (np,"wlf,inmode" , prop, cur, val) { +of_property_for_each_u32 (np,"wlf,inmode" , val) {if (count ==ARRAY_SIZE (pdata->inmode))break ;
@@ -2803,7 +2801,7 @@ int arizona_of_get_audio_pdata(struct arizona *arizona) } count =0 ; -of_property_for_each_u32 (np,"wlf,dmic-ref" , prop, cur, val) { +of_property_for_each_u32 (np,"wlf,dmic-ref" , val) {if (count ==ARRAY_SIZE (pdata->dmic_ref))break ;
@@ -2812,7 +2810,7 @@ int arizona_of_get_audio_pdata(struct arizona *arizona) } count =0 ; -of_property_for_each_u32 (np,"wlf,out-mono" , prop, cur, val) { +of_property_for_each_u32 (np,"wlf,out-mono" , val) {if (count ==ARRAY_SIZE (pdata->out_mono))break ;
@@ -2821,7 +2819,7 @@ int arizona_of_get_audio_pdata(struct arizona *arizona) } count =0 ; -of_property_for_each_u32 (np,"wlf,max-channels-clocked" , prop, cur, val) { +of_property_for_each_u32 (np,"wlf,max-channels-clocked" , val) {if (count ==ARRAY_SIZE (pdata->max_channels_clocked))break ;
@@ -2830,7 +2828,7 @@ int arizona_of_get_audio_pdata(struct arizona *arizona) } count =0 ; -of_property_for_each_u32 (np,"wlf,out-volume-limit" , prop, cur, val) { +of_property_for_each_u32 (np,"wlf,out-volume-limit" , val) {if (count ==ARRAY_SIZE (pdata->out_vol_limit))break ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 64/393 clk: fix an OF node reference leak in of_clk_get_parent_name()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joe Hattori <[email protected]>
[ Upstream commit 28fa3291cad1c201967ef93edc6e7f8ccc9afbc0 ]
Current implementation of of_clk_get_parent_name() leaks an OF node reference on error path. Add a of_node_put() call before returning an error.
This bug was found by an experimental static analysis tool that I am developing.
--- drivers/clk/clk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/clk/clk.c +3 -1
@@ -5343,8 +5343,10 @@ const char *of_clk_get_parent_name(const struct device_node *np, int index) count++; }/* We went off the end of 'clock-indices' without finding it */ -if (of_property_present (clkspec.np,"clock-indices" ) && !found) +if (of_property_present (clkspec.np,"clock-indices" ) && !found) { +of_node_put (clkspec.np);return NULL ; + } if (of_property_read_string_index(clkspec.np, "clock-output-names", index,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 65/393 dt-bindings: leds: class-multicolor: Fix path to color definitions
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
[ Upstream commit 609bc99a4452ffbce82d10f024a85d911c42e6cd ]
The LED color definitions have always been ininclude/dt-bindings/leds/common.h in upstream.
--- .../devicetree/bindings/leds/leds-class-multicolor.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/leds/leds-class-multicolor.yaml +1 -1
@@ -27,7 +27,7 @@ properties: description: | For multicolor LED support this property should be defined as either LED_COLOR_ID_RGB or LED_COLOR_ID_MULTI which can be found in - include/linux/leds/common.h. + include/dt-bindings/leds/common.h. enum: [ 8, 9 ] required:
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 66/393 wifi: rtlwifi: remove unused check_buddy_priv
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thadeu Lima de Souza Cascardo <[email protected]>
[ Upstream commit 2fdac64c3c35858aa8ac5caa70b232e03456e120 ]
Commit 2461c7d60f9f ("rtlwifi: Update header file") introduced a global list of private data structures.
Later on, commit 26634c4b1868 ("rtlwifi Modify existing bits to match vendor version 2013.02.07") started adding the private data to that list at probe time and added a hook, check_buddy_priv to find the private data from a similar device.
However, that function was never used.
Besides, though there is a lock for that list, it is never used. And when the probe fails, the private data is never removed from the list. This would cause a second probe to access freed memory.
Remove the unused hook, structures and members, which will prevent the potential race condition on the list and its corruption during a second probe when probe fails.
--- drivers/net/wireless/realtek/rtlwifi/base.c | 7 ---- drivers/net/wireless/realtek/rtlwifi/base.h | 1 - drivers/net/wireless/realtek/rtlwifi/pci.c | 44 --------------------- drivers/net/wireless/realtek/rtlwifi/wifi.h | 12 ------ 4 files changed, 64 deletions(-)
drivers/net/wireless/realtek/rtlwifi/base.c +0 -7
@@ -2710,9 +2710,6 @@ MODULE_AUTHOR("Larry Finger <[email protected]>");MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Realtek 802.11n PCI wireless core" ); -struct rtl_global_var rtl_global_var = {}; -EXPORT_SYMBOL_GPL (rtl_global_var); -static int __init rtl_core_module_init (void ) {BUILD_BUG_ON (TX_PWR_BY_RATE_NUM_RATE <TX_PWR_BY_RATE_NUM_SECTION );
@@ -2726,10 +2723,6 @@ static int __init rtl_core_module_init(void)/* add debugfs */ rtl_debugfs_add_topdir (); -/* init some global vars */ -INIT_LIST_HEAD (&rtl_global_var.glb_priv_list); -spin_lock_init (&rtl_global_var.glb_list_lock); -return 0 ; }
drivers/net/wireless/realtek/rtlwifi/base.h +0 -1
@@ -124,7 +124,6 @@ int rtl_send_smps_action(struct ieee80211_hw *hw,u8 *rtl_find_ie (u8 *data,unsigned int len,u8 ie);void rtl_recognize_peer (struct ieee80211_hw *hw,u8 *data,unsigned int len);u8 rtl_tid_to_ac (u8 tid); -extern struct rtl_global_var rtl_global_var;void rtl_phy_scan_operation_backup (struct ieee80211_hw *hw,u8 operation);#endif
drivers/net/wireless/realtek/rtlwifi/pci.c +0 -44
74 lines not on this page · raw message
drivers/net/wireless/realtek/rtlwifi/wifi.h +0 -12
@@ -2321,8 +2321,6 @@ struct rtl_intf_ops {void (*read_efuse_byte)(struct ieee80211_hw *hw,u16 _offset,u8 *pbuf);int (*adapter_start)(struct ieee80211_hw *hw);void (*adapter_stop)(struct ieee80211_hw *hw); -bool (*check_buddy_priv)(struct ieee80211_hw *hw, -struct rtl_priv **buddy_priv); int (*adapter_tx)(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
@@ -2566,14 +2564,6 @@ struct dig_t {u32 rssi_max; }; -struct rtl_global_var { -/* from this list we can get -* other adapter's rtl_priv -*/ -struct list_head glb_priv_list; -spinlock_t glb_list_lock; -}; -#define IN_4WAY_TIMEOUT_TIME (30 * MSEC_PER_SEC)/* 30 seconds */ struct rtl_btc_info {
@@ -2719,9 +2709,7 @@ struct rtl_scan_list {struct rtl_priv {struct ieee80211_hw *hw;struct completion firmware_loading_complete; -struct list_head list;struct rtl_priv *buddy_priv; -struct rtl_global_var *glb_var;struct rtl_dmsp_ctl dmsp_ctl;struct rtl_locks locks;struct rtl_works works;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 67/393 wifi: rtlwifi: destroy workqueue at rtl_deinit_core
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thadeu Lima de Souza Cascardo <[email protected]>
[ Upstream commit d8ece6fc3694657e4886191b32ca1690af11adda ]
rtl_wq is allocated at rtl_init_core, so it makes more sense to destroy it at rtl_deinit_core. In the case of USB, where _rtl_usb_init does not require anything to be undone, that is fine. But for PCI, rtl_pci_init, which is called after rtl_init_core, needs to deallocate data, but only if it has been called.
That means that destroying the workqueue needs to be done whether rtl_pci_init has been called or not. And since rtl_pci_deinit was doing it, it has to be moved out of there.
It makes more sense to move it to rtl_deinit_core and have it done in both cases, USB and PCI.
Since this is a requirement for a followup memory leak fix, mark this as fixing such memory leak.
--- drivers/net/wireless/realtek/rtlwifi/base.c | 6 ++++++ drivers/net/wireless/realtek/rtlwifi/pci.c | 2 -- drivers/net/wireless/realtek/rtlwifi/usb.c | 5 ----- 3 files changed, 6 insertions(+), 7 deletions(-)
drivers/net/wireless/realtek/rtlwifi/base.c +6 -0
@@ -575,9 +575,15 @@ static void rtl_free_entries_from_ack_queue(struct ieee80211_hw *hw,void rtl_deinit_core (struct ieee80211_hw *hw) { +struct rtl_priv *rtlpriv =rtl_priv (hw); +rtl_c2hcmd_launcher (hw,0 );rtl_free_entries_from_scan_list (hw);rtl_free_entries_from_ack_queue (hw, false); +if (rtlpriv->works.rtl_wq) { +destroy_workqueue (rtlpriv->works.rtl_wq); + rtlpriv->works.rtl_wq =NULL ; + } }EXPORT_SYMBOL_GPL (rtl_deinit_core);
drivers/net/wireless/realtek/rtlwifi/pci.c +0 -2
@@ -1657,8 +1657,6 @@ static void rtl_pci_deinit(struct ieee80211_hw *hw)synchronize_irq (rtlpci->pdev->irq);tasklet_kill (&rtlpriv->works.irq_tasklet);cancel_work_sync (&rtlpriv->works.lps_change_work); - -destroy_workqueue (rtlpriv->works.rtl_wq); }static int rtl_pci_init (struct ieee80211_hw *hw,struct pci_dev *pdev)
drivers/net/wireless/realtek/rtlwifi/usb.c +0 -5
@@ -660,11 +660,6 @@ static void _rtl_usb_cleanup_rx(struct ieee80211_hw *hw)tasklet_kill (&rtlusb->rx_work_tasklet);cancel_work_sync (&rtlpriv->works.lps_change_work); -if (rtlpriv->works.rtl_wq) { -destroy_workqueue (rtlpriv->works.rtl_wq); - rtlpriv->works.rtl_wq =NULL ; - } -skb_queue_purge (&rtlusb->rx_queue);while ((urb =usb_get_from_anchor (&rtlusb->rx_cleanup_urbs))) {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 68/393 wifi: rtlwifi: fix memory leaks and invalid access at probe error path
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thadeu Lima de Souza Cascardo <[email protected]>
[ Upstream commit e7ceefbfd8d447abc8aca8ab993a942803522c06 ]
Deinitialize at reverse order when probe fails.
When init_sw_vars fails, rtl_deinit_core should not be called, specially now that it destroys the rtl_wq workqueue.
And call rtl_pci_deinit and deinit_sw_vars, otherwise, memory will be leaked.
Remove pci_set_drvdata call as it will already be cleaned up by the core driver code and could lead to memory leaks too. cf. commit 8d450935ae7f ("wireless: rtlwifi: remove unnecessary pci_set_drvdata()") and commit 3d86b93064c7 ("rtlwifi: Fix PCI probe error path orphaned memory").
--- drivers/net/wireless/realtek/rtlwifi/pci.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/net/wireless/realtek/rtlwifi/pci.c +8 -5
@@ -2167,7 +2167,7 @@ int rtl_pci_probe(struct pci_dev *pdev,if (rtlpriv->cfg->ops->init_sw_vars (hw)) {pr_err ("Can't init_sw_vars\n" ); err = -ENODEV ; - goto fail3; + goto fail2; }rtl_init_sw_leds (hw);
@@ -2185,14 +2185,14 @@ int rtl_pci_probe(struct pci_dev *pdev, err =rtl_pci_init (hw, pdev);if (err) {pr_err ("Failed to init PCI\n" ); - goto fail3; + goto fail4; } err =ieee80211_register_hw (hw);if (err) {pr_err ("Can't register mac80211 hw.\n" ); err = -ENODEV ; - goto fail3; + goto fail5; } rtlpriv->mac80211.mac80211_registered =1 ;
@@ -2215,9 +2215,12 @@ int rtl_pci_probe(struct pci_dev *pdev,set_bit (RTL_STATUS_INTERFACE_START , &rtlpriv->status);return 0 ; -fail3: -pci_set_drvdata (pdev,NULL ); +fail5: +rtl_pci_deinit (hw); +fail4:rtl_deinit_core (hw); +fail3: + rtlpriv->cfg->ops->deinit_sw_vars (hw); fail2:if (rtlpriv->io.pci_mem_start !=0 )
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 69/393 wifi: rtlwifi: pci: wait for firmware loading before releasing memory
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thadeu Lima de Souza Cascardo <[email protected]>
[ Upstream commit b59b86c5d08be7d761c04affcbcec8184738c200 ]
At probe error path, the firmware loading work may have already been queued. In such a case, it will try to access memory allocated by the probe function, which is about to be released. In such paths, wait for the firmware worker to finish before releasing memory.
--- drivers/net/wireless/realtek/rtlwifi/pci.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/realtek/rtlwifi/pci.c +1 -0
@@ -2220,6 +2220,7 @@ int rtl_pci_probe(struct pci_dev *pdev, fail4:rtl_deinit_core (hw); fail3: +wait_for_completion (&rtlpriv->firmware_loading_complete); rtlpriv->cfg->ops->deinit_sw_vars (hw); fail2:
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 70/393 HID: multitouch: fix support for Goodix PID 0x01e9
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiri Kosina <[email protected]>
[ Upstream commit 8ade5e05bd094485ce370fad66a6a3fb6f50bfbc ]
Commit c8000deb68365b ("HID: multitouch: Add support for GT7868Q") added support for 0x01e8 and 0x01e9, but the mt_device[] entries were added twice for 0x01e8 and there was none added for 0x01e9. Fix that.
--- drivers/hid/hid-multitouch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/hid-multitouch.c +1 -1
@@ -2072,7 +2072,7 @@ static const struct hid_device_id mt_devices[] = { I2C_DEVICE_ID_GOODIX_01E8) }, { .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT_NSMU,HID_DEVICE (BUS_I2C ,HID_GROUP_ANY ,I2C_VENDOR_ID_GOODIX , - I2C_DEVICE_ID_GOODIX_01E8) }, + I2C_DEVICE_ID_GOODIX_01E9) }, /* GoodTouch panels */ { .driver_data = MT_CLS_NSMU,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 71/393 regulator: dt-bindings: mt6315: Drop regulator-compatible property
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen-Yu Tsai <[email protected]>
[ Upstream commit 08242719a8af603db54a2a79234a8fe600680105 ]
The "regulator-compatible" property has been deprecated since 2012 in commit 13511def87b9 ("regulator: deprecate regulator-compatible DT property"), which is so old it's not even mentioned in the converted regulator bindings YAML file. It should not have been used for new submissions such as the MT6315.
Drop the property from the MT6315 regulator binding and its examples.
--- .../devicetree/bindings/regulator/mt6315-regulator.yaml | 6 ------ 1 file changed, 6 deletions(-)
Documentation/devicetree/bindings/regulator/mt6315-regulator.yaml +0 -6
@@ -31,10 +31,6 @@ properties: $ref: regulator.yaml# unevaluatedProperties: false - properties: - regulator-compatible: - pattern: "^vbuck[1-4]$" - additionalProperties: false required:
@@ -52,7 +48,6 @@ examples: regulators { vbuck1 { - regulator-compatible = "vbuck1"; regulator-min-microvolt = <300000>; regulator-max-microvolt = <1193750>; regulator-enable-ramp-delay = <256>;
@@ -60,7 +55,6 @@ examples: }; vbuck3 { - regulator-compatible = "vbuck3"; regulator-min-microvolt = <300000>; regulator-max-microvolt = <1193750>; regulator-enable-ramp-delay = <256>;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 72/393 wifi: brcmfmac: add missing header include for brcmf_dbg
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marcel Hamer <[email protected]>
[ Upstream commit b05d30c2b6df7e2172b18bf1baee9b202f9c6b53 ]
Including the fwil.h header file can lead to a build error:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h: \
In function ‘brcmf_fil_cmd_int_set’:drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h:90:9: error: implicit \
declaration of function ‘brcmf_dbg’ [-Werror=implicit-function-declaration]
90 | brcmf_dbg(FIL, "ifidx=%d, cmd=%d, value=%d\n", ifp->ifidx, cmd, data);
| ^~~~~~~~~The error is often avoided because the debug.h header file is included before the fwil.h header file.
This makes sure the header include order is irrelevant by explicitly adding the debug.h header.
--- drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h +2 -0
@@ -6,6 +6,8 @@#ifndef _fwil_h_#define _fwil_h_ +#include "debug.h" +/******************************************************************************* * Dongle command codes that are interpreted by firmware ******************************************************************************/
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 73/393 ACPI: fan: cleanup resources in the error path of .probe()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joe Hattori <[email protected]>
[ Upstream commit c759bc8e9046f9812238f506d70f07d3ea4206d4 ]
Call thermal_cooling_device_unregister() and sysfs_remove_link() in the error path of acpi_fan_probe() to fix possible memory leak.
This bug was found by an experimental static analysis tool that I am developing.
--- drivers/acpi/fan_core.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/acpi/fan_core.c +8 -2
@@ -367,19 +367,25 @@ static int acpi_fan_probe(struct platform_device *pdev) result =sysfs_create_link (&pdev->dev.kobj, &cdev->device.kobj,"thermal_cooling" ); -if (result) +if (result) {dev_err (&pdev->dev,"Failed to create sysfs link 'thermal_cooling'\n" ); + goto err_unregister; + } result =sysfs_create_link (&cdev->device.kobj, &pdev->dev.kobj,"device" );if (result) {dev_err (&pdev->dev,"Failed to create sysfs link 'device'\n" ); - goto err_end; + goto err_remove_link; }return 0 ; +err_remove_link: +sysfs_remove_link (&pdev->dev.kobj,"thermal_cooling" ); +err_unregister: +thermal_cooling_device_unregister (cdev); err_end:if (fan->acpi4)acpi_fan_delete_attributes (device);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 74/393 cpupower: fix TSC MHz calculation
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: He Rongguang <[email protected]>
[ Upstream commit 9d6c0e58514f8b57cd9c2c755e41623d6a966025 ]
Commit 'cpupower: Make TSC read per CPU for Mperf monitor' (c2adb1877b7) changes TSC counter reads per cpu, but left time diff global (from start of all cpus to end of all cpus), thus diff(time) is too large for a cpu's tsc counting, resulting in far less than acutal TSC_Mhz and thus cpupower monitor showing far less than actual cpu realtime frequency.
/proc/cpuinfo shows frequency:
cat /proc/cpuinfo | egrep -e 'processor' -e 'MHz'
...
processor : 171
cpu MHz : 4108.498
...
before fix (System 100% busy):
| Mperf || Idle_Stats CPU| C0 | Cx | Freq || POLL | C1 | C2 171| 0.77| 99.23| 2279|| 0.00| 0.00| 0.00
after fix (System 100% busy):
| Mperf || Idle_Stats CPU| C0 | Cx | Freq || POLL | C1 | C2 171| 0.46| 99.54| 4095|| 0.00| 0.00| 0.00
--- .../cpupower/utils/idle_monitor/mperf_monitor.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
tools/power/cpupower/utils/idle_monitor/mperf_monitor.c +9 -6
@@ -33,7 +33,7 @@ static int mperf_get_count_percent(unsigned int self_id, double *percent, unsigned int cpu);static int mperf_get_count_freq (unsigned int id,unsigned long long *count,unsigned int cpu); -static struct timespec time_start, time_end; +static struct timespec *time_start, *time_end;static cstate_t mperf_cstates[MPERF_CSTATE_COUNT ] = { {
@@ -174,7 +174,7 @@ static int mperf_get_count_percent(unsigned int id, double *percent,dprint ("%s: TSC Ref - mperf_diff: %llu, tsc_diff: %llu\n" , mperf_cstates[id].name, mperf_diff, tsc_diff); }else if (max_freq_mode ==MAX_FREQ_SYSFS ) { - timediff = max_frequency *timespec_diff_us (time_start, time_end); + timediff = max_frequency *timespec_diff_us (time_start[cpu], time_end[cpu]); *percent =100.0 * mperf_diff / timediff;dprint ("%s: MAXFREQ - mperf_diff: %llu, time_diff: %llu\n" , mperf_cstates[id].name, mperf_diff, timediff);
@@ -207,7 +207,7 @@ static int mperf_get_count_freq(unsigned int id, unsigned long long *count,if (max_freq_mode ==MAX_FREQ_TSC_REF ) {/* Calculate max_freq from TSC count */ tsc_diff = tsc_at_measure_end[cpu] - tsc_at_measure_start[cpu]; - time_diff =timespec_diff_us (time_start, time_end); + time_diff =timespec_diff_us (time_start[cpu], time_end[cpu]); max_frequency = tsc_diff / time_diff; }
@@ -226,9 +226,8 @@ static int mperf_start(void) {int cpu; -clock_gettime (CLOCK_REALTIME , &time_start); -for (cpu =0 ; cpu < cpu_count; cpu++) { +clock_gettime (CLOCK_REALTIME , &time_start[cpu]);mperf_get_tsc (&tsc_at_measure_start[cpu]);mperf_init_stats (cpu); }
@@ -243,9 +242,9 @@ static int mperf_stop(void)for (cpu =0 ; cpu < cpu_count; cpu++) {mperf_measure_stats (cpu);mperf_get_tsc (&tsc_at_measure_end[cpu]); +clock_gettime (CLOCK_REALTIME , &time_end[cpu]); } -clock_gettime (CLOCK_REALTIME , &time_end);return 0 ; }
@@ -349,6 +348,8 @@ struct cpuidle_monitor *mperf_register(void) aperf_current_count =calloc (cpu_count,sizeof (unsigned long long )); tsc_at_measure_start =calloc (cpu_count,sizeof (unsigned long long )); tsc_at_measure_end =calloc (cpu_count,sizeof (unsigned long long )); + time_start =calloc (cpu_count,sizeof (struct timespec )); + time_end =calloc (cpu_count,sizeof (struct timespec )); mperf_monitor.name_len =strlen (mperf_monitor.name);return &mperf_monitor; }
@@ -361,6 +362,8 @@ void mperf_unregister(void)free (aperf_current_count);free (tsc_at_measure_start);free (tsc_at_measure_end); +free (time_start); +free (time_end);free (is_valid); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 75/393 dt-bindings: mfd: bd71815: Fix rsense and typos
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matti Vaittinen <[email protected]>
[ Upstream commit 6856edf7ead8c54803216a38a7b227bcb3dadff7 ]
The sense resistor used for measuring currents is typically some tens of milli Ohms. It has accidentally been documented to be tens of mega Ohms. Fix the size of this resistor and a few copy-paste errors while at it.
Drop the unsuitable 'rohm,charger-sense-resistor-ohms' property (which can't represent resistors smaller than one Ohm), and introduce a new 'rohm,charger-sense-resistor-micro-ohms' property with appropriate minimum, maximum and default values instead.
--- .../bindings/mfd/rohm,bd71815-pmic.yaml | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
Documentation/devicetree/bindings/mfd/rohm,bd71815-pmic.yaml +10 -10
@@ -50,15 +50,15 @@ properties: minimum: 0 maximum: 1 - rohm,charger-sense-resistor-ohms: - minimum: 10000000 - maximum: 50000000 + rohm,charger-sense-resistor-micro-ohms: + minimum: 10000 + maximum: 50000 description: | - BD71827 and BD71828 have SAR ADC for measuring charging currents. - External sense resistor (RSENSE in data sheet) should be used. If - something other but 30MOhm resistor is used the resistance value - should be given here in Ohms. - default: 30000000 + BD71815 has SAR ADC for measuring charging currents. External sense + resistor (RSENSE in data sheet) should be used. If something other + but a 30 mOhm resistor is used the resistance value should be given + here in micro Ohms. + default: 30000 regulators: $ref: ../regulator/rohm,bd71815-regulator.yaml
@@ -67,7 +67,7 @@ properties: gpio-reserved-ranges: description: | - Usage of BD71828 GPIO pins can be changed via OTP. This property can be + Usage of BD71815 GPIO pins can be changed via OTP. This property can be used to mark the pins which should not be configured for GPIO. Please see the ../gpio/gpio.txt for more information.
@@ -113,7 +113,7 @@ examples: gpio-controller; #gpio-cells = <2>; - rohm,charger-sense-resistor-ohms = <10000000>; + rohm,charger-sense-resistor-micro-ohms = <10000>; regulators { buck1: buck1 {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 76/393 leds: netxbig: Fix an OF node reference leak in netxbig_leds_get_of_pdata()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joe Hattori <[email protected]>
[ Upstream commit 0508316be63bb735f59bdc8fe4527cadb62210ca ]
netxbig_leds_get_of_pdata() does not release the OF node obtained by of_parse_phandle() when of_find_device_by_node() fails. Add an of_node_put() call to fix the leak.
This bug was found by an experimental static analysis tool that I am developing.
--- drivers/leds/leds-netxbig.c | 1 + 1 file changed, 1 insertion(+)
drivers/leds/leds-netxbig.c +1 -0
@@ -440,6 +440,7 @@ static int netxbig_leds_get_of_pdata(struct device *dev, } gpio_ext_pdev =of_find_device_by_node (gpio_ext_np);if (!gpio_ext_pdev) { +of_node_put (gpio_ext_np);dev_err (dev,"Failed to find platform device for gpio-ext\n" );return -ENODEV ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 77/393 inetpeer: remove create argument of inet_getpeer_v[46]()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 661cd8fc8e9039819ca0c22e0add52b632240a9e ]
All callers of inet_getpeer_v4() and inet_getpeer_v6() want to create an inetpeer.
Stable-dep-of: a853c609504e ("inetpeer: do not get a refcount in inet_getpeer()")
--- include/net/inetpeer.h | 9 ++++----- net/ipv4/icmp.c | 2 +- net/ipv4/ip_fragment.c | 2 +- net/ipv4/route.c | 4 ++-- net/ipv6/icmp.c | 2 +- net/ipv6/ip6_output.c | 2 +- net/ipv6/ndisc.c | 2 +- 7 files changed, 11 insertions(+), 12 deletions(-)
include/net/inetpeer.h +4 -5
@@ -101,25 +101,24 @@ struct inet_peer *inet_getpeer(struct inet_peer_base *base,static inline struct inet_peer *inet_getpeer_v4 (struct inet_peer_base *base,__be32 v4daddr, -int vif,int create) +int vif) {struct inetpeer_addr daddr; daddr.a4.addr = v4daddr; daddr.a4.vif = vif; daddr.family =AF_INET ; -return inet_getpeer (base, &daddr, create); +return inet_getpeer (base, &daddr,1 ); }static inline struct inet_peer *inet_getpeer_v6 (struct inet_peer_base *base, -const struct in6_addr *v6daddr, -int create) +const struct in6_addr *v6daddr) {struct inetpeer_addr daddr; daddr.a6 = *v6daddr; daddr.family =AF_INET6 ; -return inet_getpeer (base, &daddr, create); +return inet_getpeer (base, &daddr,1 ); } static inline int inetpeer_addr_cmp(const struct inetpeer_addr *a,
net/ipv4/icmp.c +1 -1
@@ -326,7 +326,7 @@ static bool icmpv4_xrlim_allow(struct net *net, struct rtable *rt, goto out; vif =l3mdev_master_ifindex (dst->dev); - peer =inet_getpeer_v4 (net->ipv4.peers, fl4->daddr, vif,1 ); + peer =inet_getpeer_v4 (net->ipv4.peers, fl4->daddr, vif); rc =inet_peer_xrlim_allow (peer,READ_ONCE (net->ipv4.sysctl_icmp_ratelimit));if (peer)
net/ipv4/ip_fragment.c +1 -1
@@ -89,7 +89,7 @@ static void ip4_frag_init(struct inet_frag_queue *q, const void *a) q->key.v4 = *key; qp->ecn =0 ; qp->peer = q->fqdir->max_dist ? -inet_getpeer_v4 (net->ipv4.peers, key->saddr, key->vif,1 ) : +inet_getpeer_v4 (net->ipv4.peers, key->saddr, key->vif) :NULL ; }
net/ipv4/route.c +2 -2
@@ -885,7 +885,7 @@ void ip_rt_send_redirect(struct sk_buff *skb)rcu_read_unlock (); net =dev_net (rt->dst.dev); - peer =inet_getpeer_v4 (net->ipv4.peers,ip_hdr (skb)->saddr, vif,1 ); + peer =inet_getpeer_v4 (net->ipv4.peers,ip_hdr (skb)->saddr, vif);if (!peer) {icmp_send (skb,ICMP_REDIRECT ,ICMP_REDIR_HOST ,rt_nexthop (rt,ip_hdr (skb)->daddr));
@@ -988,7 +988,7 @@ static int ip_error(struct sk_buff *skb) } peer =inet_getpeer_v4 (net->ipv4.peers,ip_hdr (skb)->saddr, -l3mdev_master_ifindex (skb->dev),1 ); +l3mdev_master_ifindex (skb->dev)); send = true;if (peer) {
net/ipv6/icmp.c +1 -1
@@ -222,7 +222,7 @@ static bool icmpv6_xrlim_allow(struct sock *sk, u8 type,if (rt->rt6i_dst.plen <128 ) tmo >>= ((128 - rt->rt6i_dst.plen)>>5 ); - peer =inet_getpeer_v6 (net->ipv6.peers, &fl6->daddr,1 ); + peer =inet_getpeer_v6 (net->ipv6.peers, &fl6->daddr); res =inet_peer_xrlim_allow (peer, tmo);if (peer)inet_putpeer (peer);
net/ipv6/ip6_output.c +1 -1
@@ -612,7 +612,7 @@ int ip6_forward(struct sk_buff *skb)else target = &hdr->daddr; - peer =inet_getpeer_v6 (net->ipv6.peers, &hdr->daddr,1 ); + peer =inet_getpeer_v6 (net->ipv6.peers, &hdr->daddr);/* Limit redirects both by destination (here) and by source (inside ndisc_send_redirect)
net/ipv6/ndisc.c +1 -1
@@ -1717,7 +1717,7 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target) "Redirect: destination is not a neighbour\n"); goto release; } - peer =inet_getpeer_v6 (net->ipv6.peers, &ipv6_hdr (skb)->saddr,1 ); + peer =inet_getpeer_v6 (net->ipv6.peers, &ipv6_hdr (skb)->saddr); ret =inet_peer_xrlim_allow (peer,1 *HZ );if (peer)inet_putpeer (peer);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 78/393 inetpeer: remove create argument of inet_getpeer()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 7a596a50c4a4eab946aec149171c72321b4934aa ]
All callers of inet_getpeer() want to create an inetpeer.
Stable-dep-of: a853c609504e ("inetpeer: do not get a refcount in inet_getpeer()")
--- include/net/inetpeer.h | 7 +++---- net/ipv4/inetpeer.c | 11 ++--------- 2 files changed, 5 insertions(+), 13 deletions(-)
include/net/inetpeer.h +3 -4
@@ -96,8 +96,7 @@ static inline struct in6_addr *inetpeer_get_addr_v6(struct inetpeer_addr *iaddr)/* can be called with or without local BH being disabled */ struct inet_peer *inet_getpeer (struct inet_peer_base *base, -const struct inetpeer_addr *daddr, -int create); +const struct inetpeer_addr *daddr); static inline struct inet_peer *inet_getpeer_v4(struct inet_peer_base *base, __be32 v4daddr,
@@ -108,7 +107,7 @@ static inline struct inet_peer *inet_getpeer_v4(struct inet_peer_base *base, daddr.a4.addr = v4daddr; daddr.a4.vif = vif; daddr.family =AF_INET ; -return inet_getpeer (base, &daddr,1 ); +return inet_getpeer (base, &daddr); } static inline struct inet_peer *inet_getpeer_v6(struct inet_peer_base *base,
@@ -118,7 +117,7 @@ static inline struct inet_peer *inet_getpeer_v6(struct inet_peer_base *base, daddr.a6 = *v6daddr; daddr.family =AF_INET6 ; -return inet_getpeer (base, &daddr,1 ); +return inet_getpeer (base, &daddr); } static inline int inetpeer_addr_cmp(const struct inetpeer_addr *a,
net/ipv4/inetpeer.c +2 -9
@@ -177,13 +177,11 @@ static void inet_peer_gc(struct inet_peer_base *base, }struct inet_peer *inet_getpeer (struct inet_peer_base *base, -const struct inetpeer_addr *daddr, -int create) +const struct inetpeer_addr *daddr) {struct inet_peer *p, *gc_stack[PEER_MAX_GC ];struct rb_node **pp, *parent;unsigned int gc_cnt, seq; -int invalidated;/* Attempt a lockless lookup first. * Because of a concurrent writer, we might not find an existing entry.
@@ -191,16 +189,11 @@ struct inet_peer *inet_getpeer(struct inet_peer_base *base,rcu_read_lock (); seq =read_seqbegin (&base->lock); p =lookup (daddr, base, seq,NULL , &gc_cnt, &parent, &pp); - invalidated =read_seqretry (&base->lock, seq);rcu_read_unlock ();if (p)return p; -/* If no writer did a change during our lookup, we can return early. */ -if (!create && !invalidated) -return NULL ; -/* retry an exact lookup, taking the lock before. * At least, nodes should be hot in our cache. */
@@ -209,7 +202,7 @@ struct inet_peer *inet_getpeer(struct inet_peer_base *base, gc_cnt =0 ; p =lookup (daddr, base, seq, gc_stack, &gc_cnt, &parent, &pp); -if (!p && create) { +if (!p) { p =kmem_cache_alloc (peer_cachep,GFP_ATOMIC );if (p) { p->daddr = *daddr;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 79/393 inetpeer: update inetpeer timestamp in inet_getpeer()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 50b362f21d6c10b0f7939c1482c6a1b43da82f1a ]
inet_putpeer() will be removed in the following patch, because we will no longer use refcounts.
Update inetpeer timestamp (p->dtime) at lookup time.
Stable-dep-of: a853c609504e ("inetpeer: do not get a refcount in inet_getpeer()")
--- net/ipv4/inetpeer.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
net/ipv4/inetpeer.c +4 -8
@@ -98,6 +98,7 @@ static struct inet_peer *lookup(const struct inetpeer_addr *daddr, {struct rb_node **pp, *parent, *next;struct inet_peer *p; +u32 now; pp = &base->rb_root.rb_node; parent =NULL ;
@@ -113,6 +114,9 @@ static struct inet_peer *lookup(const struct inetpeer_addr *daddr,if (cmp ==0 ) {if (!refcount_inc_not_zero (&p->refcnt))break ; + now = jiffies; +if (READ_ONCE (p->dtime) != now) +WRITE_ONCE (p->dtime, now);return p; }if (gc_stack) {
@@ -158,9 +162,6 @@ static void inet_peer_gc(struct inet_peer_base *base,for (i =0 ; i < gc_cnt; i++) { p = gc_stack[i]; -/* The READ_ONCE() pairs with the WRITE_ONCE() -* in inet_putpeer() -*/ delta = (__u32 )jiffies -READ_ONCE (p->dtime);if (delta < ttl || !refcount_dec_if_one (&p->refcnt))
@@ -232,11 +233,6 @@ EXPORT_SYMBOL_GPL(inet_getpeer);void inet_putpeer (struct inet_peer *p) { -/* The WRITE_ONCE() pairs with itself (we run lockless) -* and the READ_ONCE() in inet_peer_gc() -*/ -WRITE_ONCE (p->dtime, (__u32 )jiffies); -if (refcount_dec_and_test (&p->refcnt))call_rcu (&p->rcu, inetpeer_free_rcu); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 80/393 inetpeer: do not get a refcount in inet_getpeer()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit a853c609504e2d1d83e71285e3622fda1f1451d8 ]
All inet_getpeer() callers except ip4_frag_init() don't need to acquire a permanent refcount on the inetpeer.
They can switch to full RCU protection.
Move the refcount_inc_not_zero() into ip4_frag_init(), so that all the other callers no longer have to perform a pair of expensive atomic operations on a possibly contended cache line.
inet_putpeer() no longer needs to be exported.
After this patch, my DUT can receive 8,400,000 UDP packets per second targeting closed ports, using 50% less cpu cycles than before.
Also change two calls to l3mdev_master_ifindex() by l3mdev_master_ifindex_rcu() (Ido ideas)
--- net/ipv4/icmp.c | 9 ++++----- net/ipv4/inetpeer.c | 8 ++------ net/ipv4/ip_fragment.c | 15 ++++++++++----- net/ipv4/route.c | 15 ++++++++------- net/ipv6/icmp.c | 4 ++-- net/ipv6/ip6_output.c | 4 ++-- net/ipv6/ndisc.c | 6 ++++-- 7 files changed, 32 insertions(+), 29 deletions(-)
net/ipv4/icmp.c +4 -5
@@ -316,7 +316,6 @@ static bool icmpv4_xrlim_allow(struct net *net, struct rtable *rt,struct dst_entry *dst = &rt->dst;struct inet_peer *peer;bool rc = true; -int vif;if (!apply_ratelimit)return true;
@@ -325,12 +324,12 @@ static bool icmpv4_xrlim_allow(struct net *net, struct rtable *rt,if (dst->dev && (dst->dev->flags&IFF_LOOPBACK )) goto out; - vif =l3mdev_master_ifindex (dst->dev); - peer =inet_getpeer_v4 (net->ipv4.peers, fl4->daddr, vif); +rcu_read_lock (); + peer =inet_getpeer_v4 (net->ipv4.peers, fl4->daddr, +l3mdev_master_ifindex_rcu (dst->dev)); rc =inet_peer_xrlim_allow (peer,READ_ONCE (net->ipv4.sysctl_icmp_ratelimit)); -if (peer) -inet_putpeer (peer); +rcu_read_unlock (); out:if (!rc)__ICMP_INC_STATS (net,ICMP_MIB_RATELIMITHOST );
net/ipv4/inetpeer.c +2 -6
@@ -112,8 +112,6 @@ static struct inet_peer *lookup(const struct inetpeer_addr *daddr, p = rb_entry(parent, struct inet_peer, rb_node); cmp =inetpeer_addr_cmp (daddr, &p->daddr);if (cmp ==0 ) { -if (!refcount_inc_not_zero (&p->refcnt)) -break ; now = jiffies;if (READ_ONCE (p->dtime) != now)WRITE_ONCE (p->dtime, now);
@@ -177,6 +175,7 @@ static void inet_peer_gc(struct inet_peer_base *base, } } +/* Must be called under RCU : No refcount change is done here. */ struct inet_peer *inet_getpeer (struct inet_peer_base *base,const struct inetpeer_addr *daddr) {
@@ -187,10 +186,8 @@ struct inet_peer *inet_getpeer(struct inet_peer_base *base,/* Attempt a lockless lookup first. * Because of a concurrent writer, we might not find an existing entry. */ -rcu_read_lock (); seq =read_seqbegin (&base->lock); p =lookup (daddr, base, seq,NULL , &gc_cnt, &parent, &pp); -rcu_read_unlock ();if (p)return p;
@@ -208,7 +205,7 @@ struct inet_peer *inet_getpeer(struct inet_peer_base *base,if (p) { p->daddr = *daddr; p->dtime = (__u32 )jiffies; -refcount_set (&p->refcnt,2 ); +refcount_set (&p->refcnt,1 );atomic_set (&p->rid,0 ); p->metrics[RTAX_LOCK -1 ] =INETPEER_METRICS_NEW ; p->rate_tokens =0 ;
@@ -236,7 +233,6 @@ void inet_putpeer(struct inet_peer *p)if (refcount_dec_and_test (&p->refcnt))call_rcu (&p->rcu, inetpeer_free_rcu); } -EXPORT_SYMBOL_GPL (inet_putpeer);/* * Check transmit rate limitation for given message.
net/ipv4/ip_fragment.c +10 -5
@@ -82,15 +82,20 @@ static int ip_frag_reasm(struct ipq *qp, struct sk_buff *skb,static void ip4_frag_init (struct inet_frag_queue *q,const void *a) { struct ipq *qp = container_of(q, struct ipq, q); -struct net *net = q->fqdir->net; -const struct frag_v4_compare_key *key = a; +struct net *net = q->fqdir->net; +struct inet_peer *p =NULL ; q->key.v4 = *key; qp->ecn =0 ; - qp->peer = q->fqdir->max_dist ? -inet_getpeer_v4 (net->ipv4.peers, key->saddr, key->vif) : -NULL ; +if (q->fqdir->max_dist) { +rcu_read_lock (); + p =inet_getpeer_v4 (net->ipv4.peers, key->saddr, key->vif); +if (p && !refcount_inc_not_zero (&p->refcnt)) + p =NULL ; +rcu_read_unlock (); + } + qp->peer = p; }static void ip4_frag_free (struct inet_frag_queue *q)
net/ipv4/route.c +8 -7
@@ -882,11 +882,11 @@ void ip_rt_send_redirect(struct sk_buff *skb) } log_martians =IN_DEV_LOG_MARTIANS (in_dev); vif =l3mdev_master_ifindex_rcu (rt->dst.dev); -rcu_read_unlock (); net =dev_net (rt->dst.dev); peer =inet_getpeer_v4 (net->ipv4.peers,ip_hdr (skb)->saddr, vif);if (!peer) { +rcu_read_unlock ();icmp_send (skb,ICMP_REDIRECT ,ICMP_REDIR_HOST ,rt_nexthop (rt,ip_hdr (skb)->daddr));return ;
@@ -905,7 +905,7 @@ void ip_rt_send_redirect(struct sk_buff *skb)*/ if (peer->n_redirects >= ip_rt_redirect_number) { peer->rate_last = jiffies; - goto out_put_peer; + goto out_unlock; }/* Check for load limit; set rate_last to the latest sent
@@ -926,8 +926,8 @@ void ip_rt_send_redirect(struct sk_buff *skb) &ip_hdr (skb)->saddr,inet_iif (skb), &ip_hdr(skb)->daddr, &gw); } -out_put_peer: -inet_putpeer (peer); +out_unlock: +rcu_read_unlock (); }static int ip_error (struct sk_buff *skb)
@@ -987,9 +987,9 @@ static int ip_error(struct sk_buff *skb)break ; } +rcu_read_lock (); peer =inet_getpeer_v4 (net->ipv4.peers,ip_hdr (skb)->saddr, -l3mdev_master_ifindex (skb->dev)); - +l3mdev_master_ifindex_rcu (skb->dev)); send = true;if (peer) { now = jiffies;
@@ -1001,8 +1001,9 @@ static int ip_error(struct sk_buff *skb) peer->rate_tokens -= ip_rt_error_cost; else send = false; -inet_putpeer (peer); } +rcu_read_unlock (); +if (send)icmp_send (skb,ICMP_DEST_UNREACH , code,0 );
net/ipv6/icmp.c +2 -2
@@ -222,10 +222,10 @@ static bool icmpv6_xrlim_allow(struct sock *sk, u8 type,if (rt->rt6i_dst.plen <128 ) tmo >>= ((128 - rt->rt6i_dst.plen)>>5 ); +rcu_read_lock (); peer =inet_getpeer_v6 (net->ipv6.peers, &fl6->daddr); res =inet_peer_xrlim_allow (peer, tmo); -if (peer) -inet_putpeer (peer); +rcu_read_unlock (); }if (!res) __ICMP6_INC_STATS(net, ip6_dst_idev(dst),
net/ipv6/ip6_output.c +2 -2
@@ -612,6 +612,7 @@ int ip6_forward(struct sk_buff *skb)else target = &hdr->daddr; +rcu_read_lock (); peer =inet_getpeer_v6 (net->ipv6.peers, &hdr->daddr);/* Limit redirects both by destination (here)
@@ -619,8 +620,7 @@ int ip6_forward(struct sk_buff *skb)*/ if (inet_peer_xrlim_allow (peer,1 *HZ ))ndisc_send_redirect (skb, target); -if (peer) -inet_putpeer (peer); +rcu_read_unlock (); }else {int addrtype =ipv6_addr_type (&hdr->saddr);
net/ipv6/ndisc.c +4 -2
@@ -1717,10 +1717,12 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target) "Redirect: destination is not a neighbour\n"); goto release; } + +rcu_read_lock (); peer =inet_getpeer_v6 (net->ipv6.peers, &ipv6_hdr (skb)->saddr); ret =inet_peer_xrlim_allow (peer,1 *HZ ); -if (peer) -inet_putpeer (peer); +rcu_read_unlock (); +if (!ret) goto release;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 81/393 pwm: stm32-lp: Add check for clk_enable()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mingwei Zheng <[email protected]>
[ Upstream commit cce16e7f6216227964cda25f5f23634bce2c500f ]
Add check for the return value of clk_enable() to catch the potential error.
We used APP-Miner to find it.
--- drivers/pwm/pwm-stm32-lp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/pwm/pwm-stm32-lp.c +6 -2
@@ -168,8 +168,12 @@ static int stm32_pwm_lp_get_state(struct pwm_chip *chip,regmap_read (priv->regmap,STM32_LPTIM_CR , &val); state->enabled = !!FIELD_GET (STM32_LPTIM_ENABLE , val);/* Keep PWM counter clock refcount in sync with PWM initial state */ -if (state->enabled) -clk_enable (priv->clk); +if (state->enabled) { +int ret =clk_enable (priv->clk); + +if (ret) +return ret; + }regmap_read (priv->regmap,STM32_LPTIM_CFGR , &val); presc =FIELD_GET (STM32_LPTIM_PRESC , val);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 82/393 cpufreq: schedutil: Fix superfluous updates caused by need_freq_update
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sultan Alsawaf (unemployed) <[email protected]>
[ Upstream commit 8e461a1cb43d69d2fc8a97e61916dce571e6bb31 ]
A redundant frequency update is only truly needed when there is a policy limits change with a driver that specifies CPUFREQ_NEED_UPDATE_LIMITS.
In spite of that, drivers specifying CPUFREQ_NEED_UPDATE_LIMITS receive a frequency update _all the time_, not just for a policy limits change, because need_freq_update is never cleared.
Furthermore, ignore_dl_rate_limit()'s usage of need_freq_update also leads to a redundant frequency update, regardless of whether or not the driver specifies CPUFREQ_NEED_UPDATE_LIMITS, when the next chosen frequency is the same as the current one.
Fix the superfluous updates by only honoring CPUFREQ_NEED_UPDATE_LIMITS when there's a policy limits change, and clearing need_freq_update when a requisite redundant update occurs.
This is neatly achieved by moving up the CPUFREQ_NEED_UPDATE_LIMITS test and instead setting need_freq_update to false in sugov_update_next_freq().
--- kernel/sched/cpufreq_schedutil.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/sched/cpufreq_schedutil.c +2 -2
@@ -83,7 +83,7 @@ static bool sugov_should_update_freq(struct sugov_policy *sg_policy, u64 time)if (unlikely (sg_policy->limits_changed)) { sg_policy->limits_changed = false; - sg_policy->need_freq_update = true; + sg_policy->need_freq_update =cpufreq_driver_test_flags (CPUFREQ_NEED_UPDATE_LIMITS );return true; }
@@ -96,7 +96,7 @@ static bool sugov_update_next_freq(struct sugov_policy *sg_policy, u64 time, unsigned int next_freq) {if (sg_policy->need_freq_update) - sg_policy->need_freq_update =cpufreq_driver_test_flags (CPUFREQ_NEED_UPDATE_LIMITS ); + sg_policy->need_freq_update = false;else if (sg_policy->next_freq == next_freq)return false;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 83/393 gpio: pca953x: Drop unused fields in struct pca953x_platform_data
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Shevchenko <[email protected]>
[ Upstream commit 2f4d3e293392571e02b106c8b431b638bd029276 ]
New code should solely use firmware nodes for the specifics and not any callbacks.
Stable-dep-of: 7cef813a91c4 ("gpio: pca953x: log an error when failing to get the reset GPIO")
--- drivers/gpio/gpio-pca953x.c | 37 ++++++--------------------- include/linux/platform_data/pca953x.h | 13 ---------- 2 files changed, 8 insertions(+), 42 deletions(-)
drivers/gpio/gpio-pca953x.c +8 -29
@@ -211,7 +211,6 @@ struct pca953x_chip {struct i2c_client *client;struct gpio_chip gpio_chip; -const char *const *names;unsigned long driver_data;struct regulator *regulator;
@@ -712,7 +711,6 @@ static void pca953x_setup_gpio(struct pca953x_chip *chip, int gpios) gc->label =dev_name (&chip->client->dev); gc->parent = &chip->client->dev; gc->owner =THIS_MODULE ; - gc->names = chip->names; }#ifdef CONFIG_GPIO_PCA953X_IRQ
@@ -1000,7 +998,7 @@ static int pca953x_irq_setup(struct pca953x_chip *chip, }#endif -static int device_pca95xx_init (struct pca953x_chip *chip,u32 invert) +static int device_pca95xx_init (struct pca953x_chip *chip) {DECLARE_BITMAP (val,MAX_LINE );u8 regaddr;
@@ -1018,24 +1016,21 @@ static int device_pca95xx_init(struct pca953x_chip *chip, u32 invert)if (ret) goto out; -/* set platform specific polarity inversion */ -if (invert) -bitmap_fill (val,MAX_LINE ); -else -bitmap_zero (val,MAX_LINE ); +/* clear polarity inversion */ +bitmap_zero (val,MAX_LINE ); ret =pca953x_write_regs (chip, chip->regs->invert, val); out:return ret; } -static int device_pca957x_init (struct pca953x_chip *chip,u32 invert) +static int device_pca957x_init (struct pca953x_chip *chip) {DECLARE_BITMAP (val,MAX_LINE );unsigned int i;int ret; - ret =device_pca95xx_init (chip, invert); + ret =device_pca95xx_init (chip);if (ret) goto out;
@@ -1056,9 +1051,8 @@ static int pca953x_probe(struct i2c_client *client) {struct pca953x_platform_data *pdata;struct pca953x_chip *chip; -int irq_base =0 ; +int irq_base;int ret; -u32 invert =0 ;struct regulator *reg;const struct regmap_config *regmap_config;
@@ -1070,8 +1064,6 @@ static int pca953x_probe(struct i2c_client *client)if (pdata) { irq_base = pdata->irq_base; chip->gpio_start = pdata->gpio_base; - invert = pdata->invert; - chip->names = pdata->names; }else {struct gpio_desc *reset_gpio;
@@ -1160,10 +1152,10 @@ static int pca953x_probe(struct i2c_client *client)*/ if (PCA_CHIP_TYPE (chip->driver_data) ==PCA957X_TYPE ) { chip->regs = &pca957x_regs; - ret =device_pca957x_init (chip, invert); + ret =device_pca957x_init (chip); }else { chip->regs = &pca953x_regs; - ret =device_pca95xx_init (chip, invert); + ret =device_pca95xx_init (chip); }if (ret) goto err_exit;
@@ -1176,13 +1168,6 @@ static int pca953x_probe(struct i2c_client *client)if (ret) goto err_exit; -if (pdata && pdata->setup) { - ret = pdata->setup (client, chip->gpio_chip.base, - chip->gpio_chip.ngpio, pdata->context); -if (ret <0 ) -dev_warn (&client->dev,"setup failed, %d\n" , ret); - } -return 0 ; err_exit:
@@ -1192,14 +1177,8 @@ static int pca953x_probe(struct i2c_client *client)static void pca953x_remove (struct i2c_client *client) { -struct pca953x_platform_data *pdata =dev_get_platdata (&client->dev);struct pca953x_chip *chip =i2c_get_clientdata (client); -if (pdata && pdata->teardown) { - pdata->teardown (client, chip->gpio_chip.base, - chip->gpio_chip.ngpio, pdata->context); - } -regulator_disable (chip->regulator); }
include/linux/platform_data/pca953x.h +0 -13
@@ -11,21 +11,8 @@ struct pca953x_platform_data {/* number of the first GPIO */ unsigned gpio_base; -/* initial polarity inversion setting */ -u32 invert; -/* interrupt base */ int irq_base; - -void *context;/* param to setup/teardown */ - -int (*setup)(struct i2c_client *client, -unsigned gpio,unsigned ngpio, -void *context); -void (*teardown)(struct i2c_client *client, -unsigned gpio,unsigned ngpio, -void *context); - const char *const *names; };#endif /* _LINUX_PCA953X_H */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 84/393 gpio: pca953x: Fully convert to device managed resources
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Shevchenko <[email protected]>
[ Upstream commit 53c59d66c44c5eb98b34da9967f937e5387f8624 ]
Curtrently the error path is unsynchronised with removal due to regulator being disabled before other device managed resources are handled. Correct that by wrapping regulator enablement in the respective call.
Stable-dep-of: 7cef813a91c4 ("gpio: pca953x: log an error when failing to get the reset GPIO")
--- drivers/gpio/gpio-pca953x.c | 68 +++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 33 deletions(-)
drivers/gpio/gpio-pca953x.c +35 -33
@@ -1047,13 +1047,40 @@ static int device_pca957x_init(struct pca953x_chip *chip)return ret; } +static void pca953x_disable_regulator (void *reg) +{ +regulator_disable (reg); +} + +static int pca953x_get_and_enable_regulator (struct pca953x_chip *chip) +{ +struct device *dev = &chip->client->dev; +struct regulator *reg = chip->regulator; +int ret; + + reg =devm_regulator_get (dev,"vcc" ); +if (IS_ERR (reg)) +return dev_err_probe (dev,PTR_ERR (reg),"reg get err\n" ); + + ret =regulator_enable (reg); +if (ret) +return dev_err_probe (dev, ret,"reg en err\n" ); + + ret =devm_add_action_or_reset (dev, pca953x_disable_regulator, reg); +if (ret) +return ret; + + chip->regulator = reg; +return 0 ; +} +static int pca953x_probe (struct i2c_client *client) { +struct device *dev = &client->dev;struct pca953x_platform_data *pdata;struct pca953x_chip *chip;int irq_base;int ret; -struct regulator *reg;const struct regmap_config *regmap_config; chip =devm_kzalloc (&client->dev,sizeof (*chip),GFP_KERNEL );
@@ -1088,16 +1115,9 @@ static int pca953x_probe(struct i2c_client *client)if (!chip->driver_data)return -ENODEV ; - reg =devm_regulator_get (&client->dev,"vcc" ); -if (IS_ERR (reg)) -return dev_err_probe (&client->dev,PTR_ERR (reg),"reg get err\n" ); - - ret =regulator_enable (reg); -if (ret) { -dev_err (&client->dev,"reg en err: %d\n" , ret); + ret =pca953x_get_and_enable_regulator (chip); +if (ret)return ret; - } - chip->regulator = reg;i2c_set_clientdata (client, chip);
@@ -1120,10 +1140,8 @@ static int pca953x_probe(struct i2c_client *client) } chip->regmap =devm_regmap_init_i2c (client, regmap_config); -if (IS_ERR (chip->regmap)) { - ret =PTR_ERR (chip->regmap); - goto err_exit; - } +if (IS_ERR (chip->regmap)) +return PTR_ERR (chip->regmap);regcache_mark_dirty (chip->regmap);
@@ -1158,28 +1176,13 @@ static int pca953x_probe(struct i2c_client *client) ret =device_pca95xx_init (chip); }if (ret) - goto err_exit; +return ret; ret =pca953x_irq_setup (chip, irq_base);if (ret) - goto err_exit; - - ret =devm_gpiochip_add_data (&client->dev, &chip->gpio_chip, chip); -if (ret) - goto err_exit; - -return 0 ; - -err_exit: -regulator_disable (chip->regulator); -return ret; -} - -static void pca953x_remove (struct i2c_client *client) -{ -struct pca953x_chip *chip =i2c_get_clientdata (client); +return ret; -regulator_disable (chip->regulator); +return devm_gpiochip_add_data (dev, &chip->gpio_chip, chip); }#ifdef CONFIG_PM_SLEEP
@@ -1347,7 +1350,6 @@ static struct i2c_driver pca953x_driver = { .acpi_match_table = pca953x_acpi_ids, }, .probe = pca953x_probe, - .remove = pca953x_remove, .id_table = pca953x_id, };
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 85/393 gpio: pca953x: log an error when failing to get the reset GPIO
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Luca Ceresoli <[email protected]>
[ Upstream commit 7cef813a91c468253c80633891393478b9f2c966 ]
When the dirver fails getting this GPIO, it fails silently. Log an error message to make debugging a lot easier by just reading dmesg.
--- drivers/gpio/gpio-pca953x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpio/gpio-pca953x.c +2 -1
@@ -1107,7 +1107,8 @@ static int pca953x_probe(struct i2c_client *client) reset_gpio =devm_gpiod_get_optional (&client->dev,"reset" ,GPIOD_OUT_LOW );if (IS_ERR (reset_gpio)) -return PTR_ERR (reset_gpio); +return dev_err_probe (dev,PTR_ERR (reset_gpio), +"Failed to get reset gpio\n" ); } chip->client = client;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 86/393 cpufreq: qcom: Fix qcom_cpufreq_hw_recalc_rate() to query LUT if LMh IRQ is not available
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Manivannan Sadhasivam <[email protected]>
[ Upstream commit 85d8b11351a8f15d6ec7a5e97909861cb3b6bcec ]
Currently, qcom_cpufreq_hw_recalc_rate() returns the LMh throttled frequency for the domain even if LMh IRQ is not available. But as per qcom_cpufreq_hw_get(), the driver has to query LUT entries to get the actual frequency of the domain. So do the same in qcom_cpufreq_hw_recalc_rate().
While doing so, refactor the existing qcom_cpufreq_hw_get() function so that qcom_cpufreq_hw_recalc_rate() can make use of the existing code and avoid code duplication. This also requires setting the qcom_cpufreq_data::policy even if LMh IRQ is not available.
--- drivers/cpufreq/qcom-cpufreq-hw.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
drivers/cpufreq/qcom-cpufreq-hw.c +11 -10
@@ -142,14 +142,12 @@ static unsigned long qcom_lmh_get_throttle_freq(struct qcom_cpufreq_data *data) }/* Get the frequency requested by the cpufreq core for the CPU */ -static unsigned int qcom_cpufreq_get_freq (unsigned int cpu) +static unsigned int qcom_cpufreq_get_freq (struct cpufreq_policy *policy) {struct qcom_cpufreq_data *data;const struct qcom_cpufreq_soc_data *soc_data; -struct cpufreq_policy *policy;unsigned int index; - policy =cpufreq_cpu_get_raw (cpu);if (!policy)return 0 ;
@@ -162,12 +160,10 @@ static unsigned int qcom_cpufreq_get_freq(unsigned int cpu)return policy->freq_table[index].frequency; } -static unsigned int qcom_cpufreq_hw_get (unsigned int cpu) +static unsigned int __qcom_cpufreq_hw_get (struct cpufreq_policy *policy) {struct qcom_cpufreq_data *data; -struct cpufreq_policy *policy; - policy =cpufreq_cpu_get_raw (cpu);if (!policy)return 0 ;
@@ -176,7 +172,12 @@ static unsigned int qcom_cpufreq_hw_get(unsigned int cpu)if (data->throttle_irq >=0 )return qcom_lmh_get_throttle_freq (data) /HZ_PER_KHZ ; -return qcom_cpufreq_get_freq (cpu); +return qcom_cpufreq_get_freq (policy); +} + +static unsigned int qcom_cpufreq_hw_get (unsigned int cpu) +{ +return __qcom_cpufreq_hw_get (cpufreq_cpu_get_raw (cpu)); } static unsigned int qcom_cpufreq_hw_fast_switch(struct cpufreq_policy *policy,
@@ -362,7 +363,7 @@ static void qcom_lmh_dcvs_notify(struct qcom_cpufreq_data *data)* If h/w throttled frequency is higher than what cpufreq has requested * for, then stop polling and switch back to interrupt mechanism. */ -if (throttled_freq >=qcom_cpufreq_get_freq (cpu)) +if (throttled_freq >=qcom_cpufreq_get_freq (cpufreq_cpu_get_raw (cpu)))enable_irq (data->throttle_irq);else mod_delayed_work(system_highpri_wq, &data->throttle_work,
@@ -440,7 +441,6 @@ static int qcom_cpufreq_hw_lmh_init(struct cpufreq_policy *policy, int index)return data->throttle_irq; data->cancel_throttle = false; - data->policy = policy;mutex_init (&data->throttle_lock);INIT_DEFERRABLE_WORK (&data->throttle_work, qcom_lmh_dcvs_poll);
@@ -551,6 +551,7 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy) policy->driver_data = data; policy->dvfs_possible_from_any_cpu = true; + data->policy = policy; ret =qcom_cpufreq_hw_read_lut (cpu_dev, policy);if (ret) {
@@ -623,7 +624,7 @@ static unsigned long qcom_cpufreq_hw_recalc_rate(struct clk_hw *hw, unsigned lon { struct qcom_cpufreq_data *data = container_of(hw, struct qcom_cpufreq_data, cpu_clk); -return qcom_lmh_get_throttle_freq (data); +return __qcom_cpufreq_hw_get (data->policy) *HZ_PER_KHZ ; }static const struct clk_ops qcom_cpufreq_hw_clk_ops = {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 87/393 cpufreq: qcom: Implement clk_ops::determine_rate() for qcom_cpufreq* clocks
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Manivannan Sadhasivam <[email protected]>
[ Upstream commit a9ba290d0b829012574b6821ba08815046e60c94 ]
determine_rate() callback is used by the clk_set_rate() API to get the closest rate of the target rate supported by the clock. If this callback is not implemented (nor round_rate() callback), then the API will assume that the clock cannot set the requested rate. And since there is no parent, it will return -EINVAL.
This is not an issue right now as clk_set_rate() mistakenly compares the target rate with cached rate and bails out early. But once that is fixed to compare the target rate with the actual rate of the clock (returned by recalc_rate()), then clk_set_rate() for this clock will start to fail as below:
cpu cpu0: _opp_config_clk_single: failed to set clock rate: -22
So implement the determine_rate() callback that just returns the actual rate at which the clock is passed to the CPUs in a domain.
--- drivers/cpufreq/qcom-cpufreq-hw.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/cpufreq/qcom-cpufreq-hw.c +13 -0
@@ -627,8 +627,21 @@ static unsigned long qcom_cpufreq_hw_recalc_rate(struct clk_hw *hw, unsigned lonreturn __qcom_cpufreq_hw_get (data->policy) *HZ_PER_KHZ ; } +/* +* Since we cannot determine the closest rate of the target rate, let's just +* return the actual rate at which the clock is running at. This is needed to +* make clk_set_rate() API work properly. +*/ +static int qcom_cpufreq_hw_determine_rate (struct clk_hw *hw,struct clk_rate_request *req) +{ + req->rate =qcom_cpufreq_hw_recalc_rate (hw,0 ); + +return 0 ; +} +static const struct clk_ops qcom_cpufreq_hw_clk_ops = { .recalc_rate = qcom_cpufreq_hw_recalc_rate, + .determine_rate = qcom_cpufreq_hw_determine_rate, };static int qcom_cpufreq_hw_driver_probe (struct platform_device *pdev)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 88/393 clk: imx8mp: Fix clkout1/2 support
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Vasut <[email protected]>
[ Upstream commit a9b7c84d22fb1687d63ca2a386773015cf59436b ]
The CLKOUTn may be fed from PLL1/2/3, but the PLL1/2/3 has to be enabled first by setting PLL_CLKE bit 11 in CCM_ANALOG_SYS_PLLn_GEN_CTRL register. The CCM_ANALOG_SYS_PLLn_GEN_CTRL bit 11 is modeled by plln_out clock. Fix the clock tree and place the clkout1/2 under plln_sel instead of plain plln to let the clock subsystem correctly control the bit 11 and enable the PLL in case the CLKOUTn is supplied by PLL1/2/3.
--- drivers/clk/imx/clk-imx8mp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/clk/imx/clk-imx8mp.c +3 -2
@@ -399,8 +399,9 @@ static const char * const imx8mp_dram_core_sels[] = {"dram_pll_out", "dram_alt_rstatic const char *const imx8mp_clkout_sels[] = {"audio_pll1_out" ,"audio_pll2_out" ,"video_pll1_out" ,"dummy" ,"dummy" ,"gpu_pll_out" ,"vpu_pll_out" , -"arm_pll_out" ,"sys_pll1" ,"sys_pll2" ,"sys_pll3" , -"dummy" ,"dummy" ,"osc_24m" ,"dummy" ,"osc_32k" }; +"arm_pll_out" ,"sys_pll1_out" ,"sys_pll2_out" , +"sys_pll3_out" ,"dummy" ,"dummy" ,"osc_24m" , +"dummy" ,"osc_32k" };static struct clk_hw **hws;static struct clk_hw_onecell_data *clk_hw_data;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 89/393 team: prevent adding a device which is already a team device lower
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Octavian Purdila <[email protected]>
[ Upstream commit 3fff5da4ca2164bb4d0f1e6cd33f6eb8a0e73e50 ]
Prevent adding a device which is already a team device lower, e.g. adding veth0 if vlan1 was already added and veth0 is a lower of vlan1.
This is not useful in practice and can lead to recursive locking:
$ ip link add veth0 type veth peer name veth1 $ ip link set veth0 up $ ip link set veth1 up $ ip link add link veth0 name veth0.1 type vlan protocol 802.1Q id 1 $ ip link add team0 type team $ ip link set veth0.1 down $ ip link set veth0.1 master team0 team0: Port device veth0.1 added $ ip link set veth0 down $ ip link set veth0 master team0
============================================
WARNING: possible recursive locking detected
6.13.0-rc2-virtme-00441-ga14a429069bb #46 Not tainted
--------------------------------------------
ip/7684 is trying to acquire lock:ffff888016848e00 (team->team_lock_key){+.+.}-{4:4}, at: team_device_event (drivers/net/team/team_core.c:2928 drivers/net/team/team_core.c:2951 drivers/net/team/team_core.c:2973)
but task is already holding lock:ffff888016848e00 (team->team_lock_key){+.+.}-{4:4}, at: team_add_slave (drivers/net/team/team_core.c:1147 drivers/net/team/team_core.c:1977)
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----lock(team->team_lock_key);lock(team->team_lock_key);
*** DEADLOCK ***
May be due to missing lock nesting notation
2 locks held by ip/7684:
stack backtrace: CPU: 3 UID: 0 PID: 7684 Comm: ip Not tainted 6.13.0-rc2-virtme-00441-ga14a429069bb #46 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: <TASK>
dump_stack_lvl (lib/dump_stack.c:122)
print_deadlock_bug.cold (kernel/locking/lockdep.c:3040) __lock_acquire (kernel/locking/lockdep.c:3893 kernel/locking/lockdep.c:5226) ? netlink_broadcast_filtered (net/netlink/af_netlink.c:1548)
lock_acquire.part.0 (kernel/locking/lockdep.c:467 kernel/locking/lockdep.c:5851) ? team_device_event (drivers/net/team/team_core.c:2928 drivers/net/team/team_core.c:2951 drivers/net/team/team_core.c:2973) ? trace_lock_acquire (./include/trace/events/lock.h:24 (discriminator 2)) ? team_device_event (drivers/net/team/team_core.c:2928 drivers/net/team/team_core.c:2951 drivers/net/team/team_core.c:2973) ? lock_acquire (kernel/locking/lockdep.c:5822) ? team_device_event (drivers/net/team/team_core.c:2928 drivers/net/team/team_core.c:2951 drivers/net/team/team_core.c:2973) __mutex_lock (kernel/locking/mutex.c:587 kernel/locking/mutex.c:735) ? team_device_event (drivers/net/team/team_core.c:2928 drivers/net/team/team_core.c:2951 drivers/net/team/team_core.c:2973) ? team_device_event (drivers/net/team/team_core.c:2928 drivers/net/team/team_core.c:2951 drivers/net/team/team_core.c:2973) ? fib_sync_up (net/ipv4/fib_semantics.c:2167) ? team_device_event (drivers/net/team/team_core.c:2928 drivers/net/team/team_core.c:2951 drivers/net/team/team_core.c:2973) team_device_event (drivers/net/team/team_core.c:2928 drivers/net/team/team_core.c:2951 drivers/net/team/team_core.c:2973)
notifier_call_chain (kernel/notifier.c:85) call_netdevice_notifiers_info (net/core/dev.c:1996) __dev_notify_flags (net/core/dev.c:8993)
? __dev_change_flags (net/core/dev.c:8975) dev_change_flags (net/core/dev.c:9027) vlan_device_event (net/8021q/vlan.c:85 net/8021q/vlan.c:470) ? br_device_event (net/bridge/br.c:143) notifier_call_chain (kernel/notifier.c:85) call_netdevice_notifiers_info (net/core/dev.c:1996)
dev_open (net/core/dev.c:1519 net/core/dev.c:1505) team_add_slave (drivers/net/team/team_core.c:1219 drivers/net/team/team_core.c:1977)
? __pfx_team_add_slave (drivers/net/team/team_core.c:1972) do_set_master (net/core/rtnetlink.c:2917) do_setlink.isra.0 (net/core/rtnetlink.c:3117)
--- drivers/net/team/team.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/net/team/team.c +7 -0
@@ -1169,6 +1169,13 @@ static int team_port_add(struct team *team, struct net_device *port_dev,return -EBUSY ; } +if (netdev_has_upper_dev (port_dev, dev)) { +NL_SET_ERR_MSG (extack,"Device is already a lower device of the team interface" ); +netdev_err (dev,"Device %s is already a lower device of the team interface\n" , + portname); +return -EBUSY ; + } +if (port_dev->features &NETIF_F_VLAN_CHALLENGED &&vlan_uses_dev (dev)) {NL_SET_ERR_MSG (extack,"Device is VLAN challenged and team device has VLAN set up" );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 90/393 dt-bindings: clock: sunxi: Export PLL_VIDEO_2X and PLL_MIPI
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vasily Khoruzhick <[email protected]>
[ Upstream commit 9897831de614f1d8d5184547f0e7bf7665eed436 ]
Export PLL_VIDEO_2X and PLL_MIPI, these will be used to explicitly select TCON0 clock parent in dts
Stable-dep-of: 0f368cb7ef10 ("clk: sunxi-ng: a64: drop redundant CLK_PLL_VIDEO0_2X and CLK_PLL_MIPI")
--- include/dt-bindings/clock/sun50i-a64-ccu.h | 2 ++ 1 file changed, 2 insertions(+)
include/dt-bindings/clock/sun50i-a64-ccu.h +2 -0
@@ -44,7 +44,9 @@#define _DT_BINDINGS_CLK_SUN50I_A64_H_#define CLK_PLL_VIDEO0 7 +#define CLK_PLL_VIDEO0_2X 8#define CLK_PLL_PERIPH0 11 +#define CLK_PLL_MIPI 17#define CLK_CPUX 21#define CLK_BUS_MIPI_DSI 28
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 91/393 clk: sunxi-ng: a64: drop redundant CLK_PLL_VIDEO0_2X and CLK_PLL_MIPI
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vasily Khoruzhick <[email protected]>
[ Upstream commit 0f368cb7ef103f284f75e962c4c89da5aa8ccec7 ]
Drop redundant CLK_PLL_VIDEO0_2X and CLK_PLL.MIPI. These are now defined in dt-bindings/clock/sun50i-a64-ccu.h
--- drivers/clk/sunxi-ng/ccu-sun50i-a64.h | 2 -- 1 file changed, 2 deletions(-)
drivers/clk/sunxi-ng/ccu-sun50i-a64.h +0 -2
@@ -21,7 +21,6 @@/* PLL_VIDEO0 exported for HDMI PHY */ -#define CLK_PLL_VIDEO0_2X 8#define CLK_PLL_VE 9#define CLK_PLL_DDR0 10
@@ -32,7 +31,6 @@#define CLK_PLL_PERIPH1_2X 14#define CLK_PLL_VIDEO1 15#define CLK_PLL_GPU 16 -#define CLK_PLL_MIPI 17#define CLK_PLL_HSIC 18#define CLK_PLL_DE 19#define CLK_PLL_DDR1 20
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 92/393 clk: sunxi-ng: a64: stop force-selecting PLL-MIPI as TCON0 parent
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vasily Khoruzhick <[email protected]>
[ Upstream commit 383ca7bee8a93be9ff5a072936981c2710d2856b ]
Stop force-selecting PLL-MIPI as TCON0 parent, since it breaks video output on Pinebook that uses RGB to eDP bridge.
Partially revert commit ca1170b69968 ("clk: sunxi-ng: a64: force select PLL_MIPI in TCON0 mux"), while still leaving CLK_SET_RATE_NO_REPARENT flag set, since we do not want the clock to be reparented.
The issue is that apparently different TCON0 outputs require a different clock, or the mux might be selecting the output type.
I did an experiment: I manually configured PLL_MIPI and PLL_VIDEO0_2X to the same clock rate and flipped the switch with devmem. Experiment clearly showed that whenever PLL_MIPI is selected as TCON0 clock parent, the video output stops working.
Therefore, TCON0 clock parent corresponding to the output type must be assigned in the device tree.
--- drivers/clk/sunxi-ng/ccu-sun50i-a64.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)
drivers/clk/sunxi-ng/ccu-sun50i-a64.c +4 -9
@@ -533,11 +533,11 @@ static SUNXI_CCU_M_WITH_MUX_GATE(de_clk, "de", de_parents, CLK_SET_RATE_PARENT);/* -* DSI output seems to work only when PLL_MIPI selected. Set it and prevent -* the mux from reparenting. +* Experiments showed that RGB output requires pll-video0-2x, while DSI +* requires pll-mipi. It will not work with incorrect clock, the screen will +* be blank. +* sun50i-a64.dtsi assigns pll-mipi as TCON0 parent by default */ -#define SUN50I_A64_TCON0_CLK_REG 0x118 -static const char *const tcon0_parents[] = {"pll-mipi" ,"pll-video0-2x" };static const u8 tcon0_table[] = {0 ,2 , }; static SUNXI_CCU_MUX_TABLE_WITH_GATE_CLOSEST(tcon0_clk, "tcon0", tcon0_parents,
@@ -957,11 +957,6 @@ static int sun50i_a64_ccu_probe(struct platform_device *pdev)writel (0x515 , reg +SUN50I_A64_PLL_MIPI_REG ); -/* Set PLL MIPI as parent for TCON0 */ - val =readl (reg +SUN50I_A64_TCON0_CLK_REG ); - val &= ~GENMASK (26 ,24 ); -writel (val | (0 <<24 ), reg +SUN50I_A64_TCON0_CLK_REG ); - ret =devm_sunxi_ccu_probe (&pdev->dev, reg, &sun50i_a64_ccu_desc);if (ret)return ret;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 93/393 regulator: of: Implement the unwind path of of_regulator_match()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joe Hattori <[email protected]>
[ Upstream commit dddca3b2fc676113c58b04aaefe84bfb958ac83e ]
of_regulator_match() does not release the OF node reference in the error path, resulting in an OF node leak. Therefore, call of_node_put() on the obtained nodes before returning the EINVAL error.
Since it is possible that some drivers call this function and do not exit on failure, such as s2mps11_pmic_driver, clear the init_data and of_node in the error path.
This was reported by an experimental verification tool that I am developing. As I do not have access to actual devices nor the QEMU board configuration to test drivers that call this function, no runtime test was able to be performed.
--- drivers/regulator/of_regulator.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
drivers/regulator/of_regulator.c +13 -1
@@ -435,7 +435,7 @@ int of_regulator_match(struct device *dev, struct device_node *node,"failed to parse DT for regulator %pOFn\n" , child);of_node_put (child); -return -EINVAL ; + goto err_put; } match->of_node =of_node_get (child); count++;
@@ -444,6 +444,18 @@ int of_regulator_match(struct device *dev, struct device_node *node, }return count; + +err_put: +for (i =0 ; i < num_matches; i++) { +struct of_regulator_match *match = &matches[i]; + + match->init_data =NULL ; +if (match->of_node) { +of_node_put (match->of_node); + match->of_node =NULL ; + } + } +return -EINVAL ; }EXPORT_SYMBOL_GPL (of_regulator_match);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 94/393 ax25: rcu protect dev->ax25_ptr
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 95fc45d1dea8e1253f8ec58abc5befb71553d666 ]
syzbot found a lockdep issue [1].
We should remove ax25 RTNL dependency in ax25_setsockopt()
This should also fix a variety of possible UAF in ax25.
[1]
WARNING: possible circular locking dependency detected 6.13.0-rc3-syzkaller-00762-g9268abe611b0 #0 Not tainted
------------------------------------------------------
syz.5.1818/12806 is trying to acquire lock:
ffffffff8fcb3988 (rtnl_mutex){+.+.}-{4:4}, at: ax25_setsockopt+0xa55/0xe90 net/ax25/af_ax25.c:680
but task is already holding lock:
ffff8880617ac258 (sk_lock-AF_AX25){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1618 [inline] ffff8880617ac258 (sk_lock-AF_AX25){+.+.}-{0:0}, at: ax25_setsockopt+0x209/0xe90 net/ax25/af_ax25.c:574
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (sk_lock-AF_AX25){+.+.}-{0:0}:
lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
lock_sock_nested+0x48/0x100 net/core/sock.c:3642
lock_sock include/net/sock.h:1618 [inline]
ax25_kill_by_device net/ax25/af_ax25.c:101 [inline]
ax25_device_event+0x24d/0x580 net/ax25/af_ax25.c:146
notifier_call_chain+0x1a5/0x3f0 kernel/notifier.c:85
__dev_notify_flags+0x207/0x400
dev_change_flags+0xf0/0x1a0 net/core/dev.c:9026
dev_ifsioc+0x7c8/0xe70 net/core/dev_ioctl.c:563
dev_ioctl+0x719/0x1340 net/core/dev_ioctl.c:820
sock_do_ioctl+0x240/0x460 net/socket.c:1234
sock_ioctl+0x626/0x8e0 net/socket.c:1339
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:906 [inline]
__se_sys_ioctl+0xf5/0x170 fs/ioctl.c:892
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f-> #0 (rtnl_mutex){+.+.}-{4:4}:
check_prev_add kernel/locking/lockdep.c:3161 [inline]
check_prevs_add kernel/locking/lockdep.c:3280 [inline]
validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3904
__lock_acquire+0x1397/0x2100 kernel/locking/lockdep.c:5226
lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
__mutex_lock_common kernel/locking/mutex.c:585 [inline]
__mutex_lock+0x1ac/0xee0 kernel/locking/mutex.c:735
ax25_setsockopt+0xa55/0xe90 net/ax25/af_ax25.c:680
do_sock_setsockopt+0x3af/0x720 net/socket.c:2324
__sys_setsockopt net/socket.c:2349 [inline]
__do_sys_setsockopt net/socket.c:2355 [inline]
__se_sys_setsockopt net/socket.c:2352 [inline]
__x64_sys_setsockopt+0x1ee/0x280 net/socket.c:2352
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7fother info that might help us debug this:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(sk_lock-AF_AX25);
lock(rtnl_mutex);
lock(sk_lock-AF_AX25); lock(rtnl_mutex);
*** DEADLOCK ***
1 lock held by syz.5.1818/12806:
#0: ffff8880617ac258 (sk_lock-AF_AX25){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1618 [inline] #0: ffff8880617ac258 (sk_lock-AF_AX25){+.+.}-{0:0}, at: ax25_setsockopt+0x209/0xe90 net/ax25/af_ax25.c:574
stack backtrace: CPU: 1 UID: 0 PID: 12806 Comm: syz.5.1818 Not tainted 6.13.0-rc3-syzkaller-00762-g9268abe611b0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: <TASK> __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_circular_bug+0x13a/0x1b0 kernel/locking/lockdep.c:2074 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2206 check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3904 __lock_acquire+0x1397/0x2100 kernel/locking/lockdep.c:5226 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849 __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0x1ac/0xee0 kernel/locking/mutex.c:735 ax25_setsockopt+0xa55/0xe90 net/ax25/af_ax25.c:680 do_sock_setsockopt+0x3af/0x720 net/socket.c:2324 __sys_setsockopt net/socket.c:2349 [inline] __do_sys_setsockopt net/socket.c:2355 [inline] __se_sys_setsockopt net/socket.c:2352 [inline] __x64_sys_setsockopt+0x1ee/0x280 net/socket.c:2352 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f7b62385d29
--- include/linux/netdevice.h | 2 +- include/net/ax25.h | 10 +++++----- net/ax25/af_ax25.c | 12 ++++++------ net/ax25/ax25_dev.c | 4 ++-- net/ax25/ax25_ip.c | 3 ++- net/ax25/ax25_out.c | 22 +++++++++++++++++----- net/ax25/ax25_route.c | 2 ++ 7 files changed, 35 insertions(+), 20 deletions(-)
include/linux/netdevice.h +1 -1
@@ -2217,7 +2217,7 @@ struct net_device {void *atalk_ptr;#endif #if IS_ENABLED (CONFIG_AX25 ) -void *ax25_ptr; +struct ax25_dev __rcu *ax25_ptr;#endif #if IS_ENABLED (CONFIG_CFG80211 )struct wireless_dev *ieee80211_ptr;
include/net/ax25.h +5 -5
@@ -229,6 +229,7 @@ typedef struct ax25_dev {#endif refcount_t refcount;bool device_up; +struct rcu_head rcu; } ax25_dev; typedef struct ax25_cb {
@@ -288,9 +289,8 @@ static inline void ax25_dev_hold(ax25_dev *ax25_dev)static inline void ax25_dev_put (ax25_dev *ax25_dev) { -if (refcount_dec_and_test (&ax25_dev->refcount)) { -kfree (ax25_dev); - } +if (refcount_dec_and_test (&ax25_dev->refcount)) +kfree_rcu (ax25_dev, rcu); }static inline __be16 ax25_type_trans (struct sk_buff *skb,struct net_device *dev) {
@@ -333,9 +333,9 @@ void ax25_digi_invert(const ax25_digi *, ax25_digi *);extern spinlock_t ax25_dev_lock;#if IS_ENABLED (CONFIG_AX25 ) -static inline ax25_dev *ax25_dev_ax25dev (struct net_device *dev) +static inline ax25_dev *ax25_dev_ax25dev (const struct net_device *dev) { -return dev->ax25_ptr; +return rcu_dereference_rtnl (dev->ax25_ptr); }#endif
net/ax25/af_ax25.c +6 -6
@@ -467,7 +467,7 @@ static int ax25_ctl_ioctl(const unsigned int cmd, void __user *arg) goto out_put; } -static void ax25_fillin_cb_from_dev (ax25_cb *ax25,ax25_dev *ax25_dev) +static void ax25_fillin_cb_from_dev (ax25_cb *ax25,const ax25_dev *ax25_dev) { ax25->rtt =msecs_to_jiffies (ax25_dev->values[AX25_VALUES_T1 ]) /2 ; ax25->t1 =msecs_to_jiffies (ax25_dev->values[AX25_VALUES_T1 ]);
@@ -677,22 +677,22 @@ static int ax25_setsockopt(struct socket *sock, int level, int optname,break ; } -rtnl_lock (); - dev =__dev_get_by_name (&init_net, devname); +rcu_read_lock (); + dev =dev_get_by_name_rcu (&init_net, devname);if (!dev) { -rtnl_unlock (); +rcu_read_unlock (); res = -ENODEV ;break ; } ax25->ax25_dev =ax25_dev_ax25dev (dev);if (!ax25->ax25_dev) { -rtnl_unlock (); +rcu_read_unlock (); res = -ENODEV ;break ; }ax25_fillin_cb (ax25, ax25->ax25_dev); -rtnl_unlock (); +rcu_read_unlock ();break ;default :
net/ax25/ax25_dev.c +2 -2
@@ -87,7 +87,7 @@ void ax25_dev_device_up(struct net_device *dev)spin_lock_bh (&ax25_dev_lock);list_add (&ax25_dev->list, &ax25_dev_list); - dev->ax25_ptr = ax25_dev; +rcu_assign_pointer (dev->ax25_ptr, ax25_dev);spin_unlock_bh (&ax25_dev_lock);ax25_register_dev_sysctl (ax25_dev);
@@ -122,7 +122,7 @@ void ax25_dev_device_down(struct net_device *dev) } } - dev->ax25_ptr =NULL ; +RCU_INIT_POINTER (dev->ax25_ptr,NULL );spin_unlock_bh (&ax25_dev_lock);netdev_put (dev, &ax25_dev->dev_tracker);ax25_dev_put (ax25_dev);
net/ax25/ax25_ip.c +2 -1
@@ -122,6 +122,7 @@ netdev_tx_t ax25_ip_xmit(struct sk_buff *skb)if (dev ==NULL ) dev = skb->dev; +rcu_read_lock ();if ((ax25_dev =ax25_dev_ax25dev (dev)) ==NULL ) {kfree_skb (skb); goto put;
@@ -202,7 +203,7 @@ netdev_tx_t ax25_ip_xmit(struct sk_buff *skb)ax25_queue_xmit (skb, dev); put: - +rcu_read_unlock ();ax25_route_lock_unuse ();return NETDEV_TX_OK ; }
net/ax25/ax25_out.c +17 -5
@@ -39,10 +39,14 @@ ax25_cb *ax25_send_frame(struct sk_buff *skb, int paclen, const ax25_address *sr* specified. */ if (paclen ==0 ) { -if ((ax25_dev =ax25_dev_ax25dev (dev)) ==NULL ) +rcu_read_lock (); + ax25_dev =ax25_dev_ax25dev (dev); +if (!ax25_dev) { +rcu_read_unlock ();return NULL ; - + } paclen = ax25_dev->values[AX25_VALUES_PACLEN ]; +rcu_read_unlock (); }/*
@@ -53,13 +57,19 @@ ax25_cb *ax25_send_frame(struct sk_buff *skb, int paclen, const ax25_address *srreturn ax25;/* It already existed */ } -if ((ax25_dev =ax25_dev_ax25dev (dev)) ==NULL ) +rcu_read_lock (); + ax25_dev =ax25_dev_ax25dev (dev); +if (!ax25_dev) { +rcu_read_unlock ();return NULL ; + } -if ((ax25 =ax25_create_cb ()) ==NULL ) +if ((ax25 =ax25_create_cb ()) ==NULL ) { +rcu_read_unlock ();return NULL ; - + }ax25_fillin_cb (ax25, ax25_dev); +rcu_read_unlock (); ax25->source_addr = *src; ax25->dest_addr = *dest;
@@ -358,7 +368,9 @@ void ax25_queue_xmit(struct sk_buff *skb, struct net_device *dev) {unsigned char *ptr; +rcu_read_lock (); skb->protocol =ax25_type_trans (skb,ax25_fwd_dev (dev)); +rcu_read_unlock (); ptr =skb_push (skb,1 ); *ptr =0x00 ;/* KISS */
net/ax25/ax25_route.c +2 -0
@@ -406,6 +406,7 @@ int ax25_rt_autobind(ax25_cb *ax25, ax25_address *addr)ax25_route_lock_unuse ();return -EHOSTUNREACH ; } +rcu_read_lock ();if ((ax25->ax25_dev =ax25_dev_ax25dev (ax25_rt->dev)) ==NULL ) { err = -EHOSTUNREACH ; goto put;
@@ -442,6 +443,7 @@ int ax25_rt_autobind(ax25_cb *ax25, ax25_address *addr) } put: +rcu_read_unlock ();ax25_route_lock_unuse ();return err; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 95/393 OPP: OF: Fix an OF node leak in _opp_add_static_v2()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joe Hattori <[email protected]>
[ Upstream commit 1d38eb7f7b26261a0b642f6e0923269c7c000a97 ]
_opp_add_static_v2() leaks the obtained OF node reference when _of_opp_alloc_required_opps() fails. Add an of_node_put() call in the error path.
--- drivers/opp/of.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/opp/of.c +3 -1
@@ -932,7 +932,7 @@ static struct dev_pm_opp *_opp_add_static_v2(struct opp_table *opp_table, ret =_of_opp_alloc_required_opps (opp_table, new_opp);if (ret) - goto free_opp; + goto put_node;if (!of_property_read_u32 (np,"clock-latency-ns" , &val)) new_opp->clock_latency_ns = val;
@@ -982,6 +982,8 @@ static struct dev_pm_opp *_opp_add_static_v2(struct opp_table *opp_table, free_required_opps:_of_opp_free_required_opps (opp_table, new_opp); +put_node: +of_node_put (np); free_opp:_opp_free (new_opp);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 96/393 ipmi: ssif_bmc: Fix new request loss when bmc ready for a response
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Quan Nguyen <[email protected]>
[ Upstream commit 83d8c79aa958e37724ed9c14dc7d0f66a48ad864 ]
Cosmo found that when there is a new request comes in while BMC is ready for a response, the complete_response(), which is called to complete the pending response, would accidentally clear out that new request and force ssif_bmc to move back to abort state again.
This commit is to address that issue.
Message-ID: <[email protected]>
--- drivers/char/ipmi/ssif_bmc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/char/ipmi/ssif_bmc.c +3 -2
@@ -292,7 +292,6 @@ static void complete_response(struct ssif_bmc_ctx *ssif_bmc) ssif_bmc->nbytes_processed =0 ; ssif_bmc->remain_len =0 ; ssif_bmc->busy = false; -memset (&ssif_bmc->part_buf,0 ,sizeof (struct ssif_part_buffer ));wake_up_all (&ssif_bmc->wait_queue); }
@@ -744,9 +743,11 @@ static void on_stop_event(struct ssif_bmc_ctx *ssif_bmc, u8 *val) ssif_bmc->aborting = true; } }else if (ssif_bmc->state ==SSIF_RES_SENDING ) { -if (ssif_bmc->is_singlepart_read || ssif_bmc->block_num ==0xFF ) +if (ssif_bmc->is_singlepart_read || ssif_bmc->block_num ==0xFF ) { +memset (&ssif_bmc->part_buf,0 ,sizeof (struct ssif_part_buffer ));/* Invalidate response buffer to denote it is sent */ complete_response (ssif_bmc); + } ssif_bmc->state =SSIF_READY ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 97/393 wifi: ath12k: fix tx power, max reg power update to firmware
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sathishkumar Muruganandam <[email protected]>
[ Upstream commit 3540bba855b4b422e8b977d11aa8173ccb4f089d ]
Currently, when the vdev start WMI cmd is sent from host, vdev related parameters such as max_reg_power, max_power, and max_antenna_gain are multiplied by 2 before being sent to the firmware. This is incorrect because the firmware uses 1 dBm steps for power calculations.
This leads to incorrect power values being used in the firmware and radio, potentially causing incorrect behavior.
Fix the update of max_reg_power, max_power, and max_antenna_gain values in the ath12k_mac_vdev_start_restart function, ensuring accurate power settings in the firmware by sending these values as-is, without multiplication.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00214-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
--- drivers/net/wireless/ath/ath12k/mac.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath12k/mac.c +3 -3
@@ -5823,9 +5823,9 @@ ath12k_mac_vdev_start_restart(struct ath12k_vif *arvif, arg.mode = ath12k_phymodes[chandef->chan->band][chandef->width]; arg.min_power =0 ; - arg.max_power = chandef->chan->max_power *2 ; - arg.max_reg_power = chandef->chan->max_reg_power *2 ; - arg.max_antenna_gain = chandef->chan->max_antenna_gain *2 ; + arg.max_power = chandef->chan->max_power; + arg.max_reg_power = chandef->chan->max_reg_power; + arg.max_antenna_gain = chandef->chan->max_antenna_gain; arg.pref_tx_streams = ar->num_tx_chains; arg.pref_rx_streams = ar->num_rx_chains;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 98/393 clk: qcom: gcc-sdm845: Do not use shared clk_ops for QUPs
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amit Pundir <[email protected]>
[ Upstream commit f760a4bb5e927a133dcd75f7b69ccae2a331e42c ]
Similar to the earlier fixes meant for sm8x50 and x1e platforms, we have to stop using the shared clk ops for sdm845 QUPs as well.
As Stephen Boyd pointed out in earlier fixes, there wasn't a problem to mark QUP clks shared until we started parking shared RCGs at clk registration time in commit 01a0a6cc8cfd ("clk: qcom: Park shared RCGs upon registration"). Parking at init is actually harmful to the UART when earlycon is used. If the device is pumping out data while the frequency changes and we see garbage on the serial console until the driver can probe and actually set a proper frequency.
This patch reverts the QUP clk sharing ops part of commit 06391eddb60a ("clk: qcom: Add Global Clock controller (GCC) driver for SDM845"), so that the QUPs on sdm845 don't get parked during clk registration and break UART operations.
--- drivers/clk/qcom/gcc-sdm845.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-)
drivers/clk/qcom/gcc-sdm845.c +16 -16
@@ -454,7 +454,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s0_clk_src_init = { .name = "gcc_qupv3_wrap0_s0_clk_src", .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap0_s0_clk_src = {
@@ -470,7 +470,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s1_clk_src_init = { .name = "gcc_qupv3_wrap0_s1_clk_src", .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap0_s1_clk_src = {
@@ -486,7 +486,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s2_clk_src_init = { .name = "gcc_qupv3_wrap0_s2_clk_src", .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap0_s2_clk_src = {
@@ -502,7 +502,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s3_clk_src_init = { .name = "gcc_qupv3_wrap0_s3_clk_src", .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap0_s3_clk_src = {
@@ -518,7 +518,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s4_clk_src_init = { .name = "gcc_qupv3_wrap0_s4_clk_src", .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap0_s4_clk_src = {
@@ -534,7 +534,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s5_clk_src_init = { .name = "gcc_qupv3_wrap0_s5_clk_src", .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap0_s5_clk_src = {
@@ -550,7 +550,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s6_clk_src_init = { .name = "gcc_qupv3_wrap0_s6_clk_src", .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap0_s6_clk_src = {
@@ -566,7 +566,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s7_clk_src_init = { .name = "gcc_qupv3_wrap0_s7_clk_src", .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap0_s7_clk_src = {
@@ -582,7 +582,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s0_clk_src_init = { .name = "gcc_qupv3_wrap1_s0_clk_src", .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap1_s0_clk_src = {
@@ -598,7 +598,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s1_clk_src_init = { .name = "gcc_qupv3_wrap1_s1_clk_src", .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap1_s1_clk_src = {
@@ -614,7 +614,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s2_clk_src_init = { .name = "gcc_qupv3_wrap1_s2_clk_src", .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap1_s2_clk_src = {
@@ -630,7 +630,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s3_clk_src_init = { .name = "gcc_qupv3_wrap1_s3_clk_src", .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap1_s3_clk_src = {
@@ -646,7 +646,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s4_clk_src_init = { .name = "gcc_qupv3_wrap1_s4_clk_src", .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap1_s4_clk_src = {
@@ -662,7 +662,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s5_clk_src_init = { .name = "gcc_qupv3_wrap1_s5_clk_src", .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap1_s5_clk_src = {
@@ -678,7 +678,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s6_clk_src_init = { .name = "gcc_qupv3_wrap1_s6_clk_src", .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap1_s6_clk_src = {
@@ -694,7 +694,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s7_clk_src_init = { .name = "gcc_qupv3_wrap1_s7_clk_src", .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, };static struct clk_rcg2 gcc_qupv3_wrap1_s7_clk_src = {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 99/393 HID: hid-thrustmaster: Fix warning in thrustmaster_probe by adding endpoint check
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karol Przybylski <[email protected]>
[ Upstream commit 50420d7c79c37a3efe4010ff9b1bb14bc61ebccf ]
syzbot has found a type mismatch between a USB pipe and the transfer endpoint, which is triggered by the hid-thrustmaster driver[1]. There is a number of similar, already fixed issues [2].
In this case as in others, implementing check for endpoint type fixes the issue.
[1] https://syzkaller.appspot.com/bug?extid=040e8b3db6a96908d470
[2] https://syzkaller.appspot.com/bug?extid=348331f63b034f89b622
--- drivers/hid/hid-thrustmaster.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/hid/hid-thrustmaster.c +8 -0
@@ -170,6 +170,14 @@ static void thrustmaster_interrupts(struct hid_device *hdev) ep = &usbif->cur_altsetting->endpoint[1 ]; b_ep = ep->desc.bEndpointAddress; +/* Are the expected endpoints present? */ +u8 ep_addr[1 ] = {b_ep}; + +if (!usb_check_int_endpoints (usbif, ep_addr)) { +hid_err (hdev,"Unexpected non-int endpoint\n" ); +return ; + } +for (i =0 ; i <ARRAY_SIZE (setup_arr); ++i) {memcpy (send_buf, setup_arr[i], setup_arr_sizes[i]);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 100/393 HID: fix generic desktop D-Pad controls
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Terry Tritton <[email protected]>
[ Upstream commit 80818fdc068eaab729bb793d790ae9fd053f7053 ]
The addition of the "System Do Not Disturb" event code caused the Generic Desktop D-Pad configuration to be skipped. This commit allows both to be configured without conflicting with each other.
--- drivers/hid/hid-input.c | 37 +++++++++++++++++-------------------- include/linux/hid.h | 1 + 2 files changed, 18 insertions(+), 20 deletions(-)
drivers/hid/hid-input.c +17 -20
@@ -810,10 +810,23 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielbreak ; } -if ((usage->hid &0xf0 ) ==0x90 ) {/* SystemControl*/ -switch (usage->hid &0xf ) { -case 0xb :map_key_clear (KEY_DO_NOT_DISTURB );break ; -default : goto ignore; +if ((usage->hid &0xf0 ) ==0x90 ) {/* SystemControl & D-pad */ +switch (usage->hid) { +case HID_GD_UP : usage->hat_dir =1 ;break ; +case HID_GD_DOWN : usage->hat_dir =5 ;break ; +case HID_GD_RIGHT : usage->hat_dir =3 ;break ; +case HID_GD_LEFT : usage->hat_dir =7 ;break ; +case HID_GD_DO_NOT_DISTURB : +map_key_clear (KEY_DO_NOT_DISTURB );break ; +default : goto unknown; + } + +if (usage->hid <=HID_GD_LEFT ) { +if (field->dpad) { +map_abs (field->dpad); + goto ignore; + } +map_abs (ABS_HAT0X ); }break ; }
@@ -844,22 +857,6 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fielif (field->application ==HID_GD_SYSTEM_CONTROL ) goto ignore; -if ((usage->hid &0xf0 ) ==0x90 ) {/* D-pad */ -switch (usage->hid) { -case HID_GD_UP : usage->hat_dir =1 ;break ; -case HID_GD_DOWN : usage->hat_dir =5 ;break ; -case HID_GD_RIGHT : usage->hat_dir =3 ;break ; -case HID_GD_LEFT : usage->hat_dir =7 ;break ; -default : goto unknown; - } -if (field->dpad) { -map_abs (field->dpad); - goto ignore; - } -map_abs (ABS_HAT0X ); -break ; - } -switch (usage->hid) {/* These usage IDs map directly to the usage codes. */ case HID_GD_X :case HID_GD_Y :case HID_GD_Z :
include/linux/hid.h +1 -0
@@ -218,6 +218,7 @@ struct hid_item {#define HID_GD_DOWN 0x00010091#define HID_GD_RIGHT 0x00010092#define HID_GD_LEFT 0x00010093 +#define HID_GD_DO_NOT_DISTURB 0x0001009b/* Microsoft Win8 Wireless Radio Controls CA usage codes */ #define HID_GD_RFKILL_BTN 0x000100c6#define HID_GD_RFKILL_LED 0x000100c7
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 101/393 leds: cht-wcove: Use devm_led_classdev_register() to avoid memory leak
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joe Hattori <[email protected]>
[ Upstream commit 417cad5dc782096350e6a967ee5dd3417a19a24e ]
cht_wc_leds_probe() leaks memory when the second led_classdev_register() call in the for-loop fails as it does not call the cleanup function led_classdev_unregister() on the first device. Avoid this leak by calling devm_led_classdev_register().
--- drivers/leds/leds-cht-wcove.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/leds/leds-cht-wcove.c +1 -5
@@ -394,7 +394,7 @@ static int cht_wc_leds_probe(struct platform_device *pdev) led->cdev.pattern_clear = cht_wc_leds_pattern_clear; led->cdev.max_brightness =255 ; - ret =led_classdev_register (&pdev->dev, &led->cdev); + ret =devm_led_classdev_register (&pdev->dev, &led->cdev);if (ret <0 )return ret; }
@@ -406,10 +406,6 @@ static int cht_wc_leds_probe(struct platform_device *pdev)static void cht_wc_leds_remove (struct platform_device *pdev) {struct cht_wc_leds *leds =platform_get_drvdata (pdev); -int i; - -for (i =0 ; i <CHT_WC_LED_COUNT ; i++) -led_classdev_unregister (&leds->leds[i].cdev);/* Restore LED1 regs if hw-control was active else leave LED1 off */ if (!(leds->led1_initial_regs.ctrl &CHT_WC_LED1_SWCTL ))
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 102/393 mfd: syscon: Remove extern from function prototypes
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Griffin <[email protected]>
[ Upstream commit 0db017f8edd9b9af818bc1d68ba578df1b4c4628 ]
The kernel coding style does not require 'extern' in function prototypes in .h files, so remove them as they are not needed.
To avoid checkpatch warnings such as
CHECK: Lines should not end with a '('
+struct regmap *syscon_regmap_lookup_by_phandle(
The indentation is also updated. No functional changes in this patch.
Stable-dep-of: 805f7aaf7fee ("mfd: syscon: Fix race in device_node_get_regmap()")
--- include/linux/mfd/syscon.h | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-)
include/linux/mfd/syscon.h +11 -14
@@ -17,20 +17,17 @@struct device_node ;#ifdef CONFIG_MFD_SYSCON -extern struct regmap *device_node_to_regmap (struct device_node *np); -extern struct regmap *syscon_node_to_regmap (struct device_node *np); -extern struct regmap *syscon_regmap_lookup_by_compatible (const char *s); -extern struct regmap *syscon_regmap_lookup_by_phandle ( -struct device_node *np, -const char *property); -extern struct regmap *syscon_regmap_lookup_by_phandle_args ( -struct device_node *np, -const char *property, -int arg_count, -unsigned int *out_args); -extern struct regmap *syscon_regmap_lookup_by_phandle_optional ( -struct device_node *np, -const char *property); +struct regmap *device_node_to_regmap (struct device_node *np); +struct regmap *syscon_node_to_regmap (struct device_node *np); +struct regmap *syscon_regmap_lookup_by_compatible (const char *s); +struct regmap *syscon_regmap_lookup_by_phandle (struct device_node *np, +const char *property); +struct regmap *syscon_regmap_lookup_by_phandle_args (struct device_node *np, +const char *property, +int arg_count, +unsigned int *out_args); +struct regmap *syscon_regmap_lookup_by_phandle_optional (struct device_node *np, +const char *property);#else static inline struct regmap *device_node_to_regmap (struct device_node *np) {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 103/393 mfd: syscon: Add of_syscon_register_regmap() API
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Griffin <[email protected]>
[ Upstream commit 769cb63166d90f1fadafa4352f180cbd96b6cb77 ]
The of_syscon_register_regmap() API allows an externally created regmap to be registered with syscon. This regmap can then be returned to client drivers using the syscon_regmap_lookup_by_phandle() APIs.
The API is used by platforms where mmio access to the syscon registers is not possible, and a underlying soc driver like exynos-pmu provides a SoC specific regmap that can issue a SMC or hypervisor call to write the register.
This approach keeps the SoC complexities out of syscon, but allows common drivers such as syscon-poweroff, syscon-reboot and friends that are used by many SoCs already to be re-used.
Stable-dep-of: 805f7aaf7fee ("mfd: syscon: Fix race in device_node_get_regmap()")
--- drivers/mfd/syscon.c | 48 ++++++++++++++++++++++++++++++++++++++ include/linux/mfd/syscon.h | 8 +++++++ 2 files changed, 56 insertions(+)
drivers/mfd/syscon.c +48 -0
@@ -192,6 +192,54 @@ static struct regmap *device_node_get_regmap(struct device_node *np,return syscon->regmap; } +/** +* of_syscon_register_regmap() - Register regmap for specified device node +* @np: Device tree node +* @regmap: Pointer to regmap object +* +* Register an externally created regmap object with syscon for the specified +* device tree node. This regmap will then be returned to client drivers using +* the syscon_regmap_lookup_by_phandle() API. +* +* Return: 0 on success, negative error code on failure. +*/ +int of_syscon_register_regmap (struct device_node *np,struct regmap *regmap) +{ +struct syscon *entry, *syscon =NULL ; +int ret; + +if (!np || !regmap) +return -EINVAL ; + + syscon =kzalloc (sizeof (*syscon),GFP_KERNEL ); +if (!syscon) +return -ENOMEM ; + +/* check if syscon entry already exists */ +spin_lock (&syscon_list_slock); + +list_for_each_entry (entry, &syscon_list, list) +if (entry->np == np) { + ret = -EEXIST ; + goto err_unlock; + } + + syscon->regmap = regmap; + syscon->np = np; + +/* register the regmap in syscon list */ +list_add_tail (&syscon->list, &syscon_list); +spin_unlock (&syscon_list_slock); + +return 0 ; + +err_unlock: +spin_unlock (&syscon_list_slock); +kfree (syscon); +return ret; +} +EXPORT_SYMBOL_GPL (of_syscon_register_regmap); +struct regmap *device_node_to_regmap (struct device_node *np) {return device_node_get_regmap (np, false);
include/linux/mfd/syscon.h +8 -0
@@ -28,6 +28,8 @@ struct regmap *syscon_regmap_lookup_by_phandle_args(struct device_node *np, unsigned int *out_args);struct regmap *syscon_regmap_lookup_by_phandle_optional (struct device_node *np,const char *property); +int of_syscon_register_regmap (struct device_node *np, +struct regmap *regmap);#else static inline struct regmap *device_node_to_regmap (struct device_node *np) {
@@ -67,6 +69,12 @@ static inline struct regmap *syscon_regmap_lookup_by_phandle_optional(return NULL ; } +static inline int of_syscon_register_regmap (struct device_node *np, +struct regmap *regmap) +{ +return -EOPNOTSUPP ; +} +#endif #endif /* __LINUX_MFD_SYSCON_H__ */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 104/393 mfd: syscon: Use scoped variables with memory allocators to simplify error paths
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 82f898f47112bc7b787cb9ce8803c4e2f9f60c89 ]
Allocate the memory with scoped/cleanup.h to reduce error handling and make the code a bit simpler.
Stable-dep-of: 805f7aaf7fee ("mfd: syscon: Fix race in device_node_get_regmap()")
--- drivers/mfd/syscon.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-)
drivers/mfd/syscon.c +7 -13
@@ -8,6 +8,7 @@* Author: Dong Aisheng <[email protected]> */ +#include <linux/cleanup.h> #include <linux/clk.h> #include <linux/err.h> #include <linux/hwspinlock.h>
@@ -45,7 +46,6 @@ static const struct regmap_config syscon_regmap_config = {static struct syscon *of_syscon_register (struct device_node *np,bool check_res) {struct clk *clk; -struct syscon *syscon;struct regmap *regmap;void __iomem *base;u32 reg_io_width;
@@ -54,20 +54,16 @@ static struct syscon *of_syscon_register(struct device_node *np, bool check_res)struct resource res;struct reset_control *reset; - syscon =kzalloc (sizeof (*syscon),GFP_KERNEL ); + struct syscon *syscon __free(kfree) = kzalloc(sizeof(*syscon), GFP_KERNEL);if (!syscon)return ERR_PTR (-ENOMEM ); -if (of_address_to_resource (np,0 , &res)) { - ret = -ENOMEM ; - goto err_map; - } +if (of_address_to_resource (np,0 , &res)) +return ERR_PTR (-ENOMEM ); base =of_iomap (np,0 ); -if (!base) { - ret = -ENOMEM ; - goto err_map; - } +if (!base) +return ERR_PTR (-ENOMEM );/* Parse the device's DT node for an endianness specification */ if (of_property_read_bool (np,"big-endian" ))
@@ -152,7 +148,7 @@ static struct syscon *of_syscon_register(struct device_node *np, bool check_res)list_add_tail (&syscon->list, &syscon_list);spin_unlock (&syscon_list_slock); -return syscon; +return_ptr (syscon); err_reset:reset_control_put (reset);
@@ -163,8 +159,6 @@ static struct syscon *of_syscon_register(struct device_node *np, bool check_res)regmap_exit (regmap); err_regmap:iounmap (base); -err_map: -kfree (syscon);return ERR_PTR (ret); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 105/393 mfd: syscon: Fix race in device_node_get_regmap()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rob Herring (Arm) <[email protected]>
[ Upstream commit 805f7aaf7fee14a57b56af01d270edf6c10765e8 ]
It is possible for multiple, simultaneous callers calling device_node_get_regmap() with the same node to fail to find an entry in the syscon_list. There is a period of time while the first caller is calling of_syscon_register() that subsequent callers also fail to find an entry in the syscon_list and then call of_syscon_register() a second time.
Fix this by keeping the lock held until after of_syscon_register() completes and adds the node to syscon_list. Convert the spinlock to a mutex as many of the functions called in of_syscon_register() such as kzalloc() and of_clk_get() may sleep.
--- drivers/mfd/syscon.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
drivers/mfd/syscon.c +10 -9
@@ -15,6 +15,7 @@#include <linux/io.h> #include <linux/init.h> #include <linux/list.h> +#include <linux/mutex.h> #include <linux/of.h> #include <linux/of_address.h> #include <linux/of_platform.h>
@@ -27,7 +28,7 @@static struct platform_driver syscon_driver; -static DEFINE_SPINLOCK (syscon_list_slock); +static DEFINE_MUTEX (syscon_list_lock);static LIST_HEAD (syscon_list);struct syscon {
@@ -54,6 +55,8 @@ static struct syscon *of_syscon_register(struct device_node *np, bool check_res)struct resource res;struct reset_control *reset; +WARN_ON (!mutex_is_locked (&syscon_list_lock)); + struct syscon *syscon __free(kfree) = kzalloc(sizeof(*syscon), GFP_KERNEL);if (!syscon)return ERR_PTR (-ENOMEM );
@@ -144,9 +147,7 @@ static struct syscon *of_syscon_register(struct device_node *np, bool check_res) syscon->regmap = regmap; syscon->np = np; -spin_lock (&syscon_list_slock);list_add_tail (&syscon->list, &syscon_list); -spin_unlock (&syscon_list_slock);return_ptr (syscon);
@@ -167,7 +168,7 @@ static struct regmap *device_node_get_regmap(struct device_node *np, {struct syscon *entry, *syscon =NULL ; -spin_lock (&syscon_list_slock); +mutex_lock (&syscon_list_lock);list_for_each_entry (entry, &syscon_list, list)if (entry->np == np) {
@@ -175,11 +176,11 @@ static struct regmap *device_node_get_regmap(struct device_node *np,break ; } -spin_unlock (&syscon_list_slock); -if (!syscon) syscon =of_syscon_register (np, check_res); +mutex_unlock (&syscon_list_lock); +if (IS_ERR (syscon))return ERR_CAST (syscon);
@@ -210,7 +211,7 @@ int of_syscon_register_regmap(struct device_node *np, struct regmap *regmap)return -ENOMEM ;/* check if syscon entry already exists */ -spin_lock (&syscon_list_slock); +mutex_lock (&syscon_list_lock);list_for_each_entry (entry, &syscon_list, list)if (entry->np == np) {
@@ -223,12 +224,12 @@ int of_syscon_register_regmap(struct device_node *np, struct regmap *regmap)/* register the regmap in syscon list */ list_add_tail (&syscon->list, &syscon_list); -spin_unlock (&syscon_list_slock); +mutex_unlock (&syscon_list_lock);return 0 ; err_unlock: -spin_unlock (&syscon_list_slock); +mutex_unlock (&syscon_list_lock);kfree (syscon);return ret; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 106/393 samples/landlock: Fix possible NULL dereference in parse_path()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zichen Xie <[email protected]>
[ Upstream commit 078bf9438a31567e2c0587159ccefde835fb1ced ]
malloc() may return NULL, leading to NULL dereference. Add a NULL check.
--- samples/landlock/sandboxer.c | 7 +++++++ 1 file changed, 7 insertions(+)
samples/landlock/sandboxer.c +7 -0
@@ -65,6 +65,9 @@ static int parse_path(char *env_path, const char ***const path_list) } } *path_list =malloc (num_paths *sizeof (**path_list)); +if (!*path_list) +return -1 ; +for (i =0 ; i < num_paths; i++) (*path_list)[i] =strsep (&env_path,ENV_PATH_TOKEN );
@@ -100,6 +103,10 @@ static int populate_ruleset(const char *const env_var, const int ruleset_fd, env_path_name =strdup (env_path_name);unsetenv (env_var); num_paths =parse_path (env_path_name, &path_list); +if (num_paths <0 ) { +fprintf (stderr,"Failed to allocate memory\n" ); + goto out_free_name; + }if (num_paths ==1 && path_list[0 ][0 ] =='\0' ) {/* * Allows to not use all possible restrictions (e.g. use
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 107/393 wifi: wlcore: fix unbalanced pm_runtime calls
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andreas Kemnade <[email protected]>
[ Upstream commit 996c934c8c196144af386c4385f61fcd5349af28 ]
If firmware boot failes, runtime pm is put too often:
[12092.708099] wlcore: ERROR firmware boot failed despite 3 retries [12092.708099] wl18xx_driver wl18xx.1.auto: Runtime PM usage count underflow!
Fix that by redirecting all error gotos before runtime_get so that runtime is not put.
--- drivers/net/wireless/ti/wlcore/main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/wireless/ti/wlcore/main.c +5 -5
@@ -2533,24 +2533,24 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw,if (test_bit (WL1271_FLAG_RECOVERY_IN_PROGRESS , &wl->flags) ||test_bit (WLVIF_FLAG_INITIALIZED , &wlvif->flags)) { ret = -EBUSY ; - goto out; + goto out_unlock; } ret =wl12xx_init_vif_data (wl, vif);if (ret <0 ) - goto out; + goto out_unlock; wlvif->wl = wl; role_type =wl12xx_get_role_type (wl, wlvif);if (role_type ==WL12XX_INVALID_ROLE_TYPE ) { ret = -EINVAL ; - goto out; + goto out_unlock; } ret =wlcore_allocate_hw_queue_base (wl, wlvif);if (ret <0 ) - goto out; + goto out_unlock;/* * TODO: after the nvs issue will be solved, move this block
@@ -2565,7 +2565,7 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw, ret =wl12xx_init_fw (wl);if (ret <0 ) - goto out; + goto out_unlock; }/*
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 108/393 wifi: mt76: mt7915: Fix mesh scan on MT7916 DBDC
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicolas Cavallari <[email protected]>
[ Upstream commit f21b77cb556296116b1cce1d62295d13e35da574 ]
commit c4f075582304 ("wifi: mt76: mt7915: fix command timeout in AP stop period") changes the behavior of mt7915_bss_info_changed() in mesh mode when enable_beacon becomes false: it calls mt7915_mcu_add_bss_info(..., false) and mt7915_mcu_add_sta(..., false) while the previous code didn't. These sends mcu commands that apparently confuse the firmware.
This breaks scanning while in mesh mode on AsiaRF MT7916 DBDC-based cards:
scanning works but no mesh frames get sent afterwards and the firmware seems to be hosed. It breaks on MT7916 DBDC but not on MT7915 DBDC.
--- drivers/net/wireless/mediatek/mt76/mt7915/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7915/main.c +2 -1
@@ -614,8 +614,9 @@ static void mt7915_bss_info_changed(struct ieee80211_hw *hw,if (changed &BSS_CHANGED_ASSOC ) set_bss_info = vif->cfg.assoc;if (changed &BSS_CHANGED_BEACON_ENABLED && + info->enable_beacon && vif->type !=NL80211_IFTYPE_AP ) - set_bss_info = set_sta = info->enable_beacon; + set_bss_info = set_sta =1 ;if (set_bss_info ==1 )mt7915_mcu_add_bss_info (phy, vif, true);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 109/393 wifi: mac80211: prohibit deactivating all links
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
[ Upstream commit 7553477cbfd784b128297f9ed43751688415bbaa ]
In the internal API this calls this is a WARN_ON, but that should remain since internally we want to know about bugs that may cause this. Prevent deactivating all links in the debugfs write directly.
--- net/mac80211/debugfs_netdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/debugfs_netdev.c +1 -1
@@ -616,7 +616,7 @@ static ssize_t ieee80211_if_parse_active_links(struct ieee80211_sub_if_data *sda {u16 active_links; -if (kstrtou16 (buf,0 , &active_links)) +if (kstrtou16 (buf,0 , &active_links) || !active_links)return -EINVAL ;return ieee80211_set_active_links (&sdata->vif, active_links) ?: buflen;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 110/393 wifi: mac80211: fix tid removal during mesh forwarding
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Strohman <[email protected]>
[ Upstream commit 3aaa1a5a9a2ceeb32afa6ea4110a92338a863c33 ]
With change (wifi: mac80211: fix receiving A-MSDU frames on mesh interfaces), a non-zero TID assignment is lost during slow path mesh forwarding.
Prior to this change, ieee80211_rx_h_mesh_fwding() left the TID intact in the header.
As a result of this header corruption, packets belonging to non-zero TIDs will get treating as belonging TID 0 by functions such as ieee80211_get_tid(). While this miscategorization by itself is an issue, there are additional ramifications
due to the fact that skb->priority still reflects the mesh forwarded packet's ingress (correct) TID.
The mt7915 driver inspects the TID recorded within skb->priority and relays this to the hardware/radio during TX. The radio firmware appears to react to this by changing the sequence control header, but it does not also ensure/correct the TID in the QoS control header. As a result, the receiver will see packets with sequence numbers corresponding to the wrong TID. The receiver of the forwarded packet will see TID 0 in QoS control but a sequence number corresponding to the correct (different) TID in sequence control. This causes data stalls for TID 0 until the TID 0 sequence number advances past what the receiver believes it should be due to this bug.
Mesh routing mpath changes cause a brief transition from fast path forwarding to slow path forwarding. Since this bug only affects the slow path forwarding, mpath changes bring opportunity for the bug to be triggered. In the author's case, he was experiencing TID 0 data stalls after mpath changes on an intermediate mesh node.
These observed stalls may be specific
to mediatek radios. But the inconsistency between the packet header and skb->priority may cause problems for other drivers as well. Regardless if this causes connectivity issues on other radios, this change is necessary in order transmit (forward) the packet on the correct TID and to have a consistent view a packet's TID within mac80211.
--- net/mac80211/rx.c | 1 + 1 file changed, 1 insertion(+)
net/mac80211/rx.c +1 -0
@@ -2957,6 +2957,7 @@ ieee80211_rx_mesh_data(struct ieee80211_sub_if_data *sdata, struct sta_info *sta }IEEE80211_IFSTA_MESH_CTR_INC (ifmsh, fwded_frames); +ieee80211_set_qos_hdr (sdata, fwd_skb);ieee80211_add_pending_skb (local, fwd_skb); rx_accept:
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 111/393 wifi: mac80211: Fix common size calculation for ML element
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilan Peer <[email protected]>
[ Upstream commit 19aa842dcbb5860509b7e1b7745dbae0b791f6c4 ]
When the ML type is EPCS the control bitmap is reserved, the length is always 7 and is captured by the 1st octet after the control.
--- include/linux/ieee80211.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
include/linux/ieee80211.h +3 -8
@@ -4826,28 +4826,24 @@ static inline u8 ieee80211_mle_common_size(const u8 *data) {const struct ieee80211_multi_link_elem *mle = (const void *)data;u16 control =le16_to_cpu (mle->control); -u8 common =0 ;switch (u16_get_bits (control,IEEE80211_ML_CONTROL_TYPE )) {case IEEE80211_ML_CONTROL_TYPE_BASIC :case IEEE80211_ML_CONTROL_TYPE_PREQ :case IEEE80211_ML_CONTROL_TYPE_TDLS :case IEEE80211_ML_CONTROL_TYPE_RECONF : +case IEEE80211_ML_CONTROL_TYPE_PRIO_ACCESS :/* * The length is the first octet pointed by mle->variable so no * need to add anything */ break ; -case IEEE80211_ML_CONTROL_TYPE_PRIO_ACCESS : -if (control &IEEE80211_MLC_PRIO_ACCESS_PRES_AP_MLD_MAC_ADDR ) - common +=ETH_ALEN ; -return common;default :WARN_ON (1 );return 0 ; } -return sizeof (*mle) + common + mle->variable[0 ]; +return sizeof (*mle) + mle->variable[0 ]; }/**
@@ -4989,8 +4985,7 @@ static inline bool ieee80211_mle_size_ok(const u8 *data, size_t len) check_common_len = true;break ;case IEEE80211_ML_CONTROL_TYPE_PRIO_ACCESS : -if (control &IEEE80211_MLC_PRIO_ACCESS_PRES_AP_MLD_MAC_ADDR ) - common +=ETH_ALEN ; + common =ETH_ALEN +1 ;break ;default :/* we don't know this type */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 112/393 wifi: mac80211: dont flush non-uploaded STAs
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
[ Upstream commit aa3ce3f8fafa0b8fb062f28024855ea8cb3f3450 ]
If STA state is pre-moved to AUTHORIZED (such as in IBSS scenarios) and insertion fails, the station is freed. In this case, the driver never knew about the station, so trying to flush it is unexpected and may crash.
Check if the sta was uploaded to the driver before and fix this.
--- net/mac80211/driver-ops.h | 3 +++ 1 file changed, 3 insertions(+)
net/mac80211/driver-ops.h +3 -0
@@ -665,6 +665,9 @@ static inline void drv_flush_sta(struct ieee80211_local *local,if (sdata && !check_sdata_in_driver (sdata))return ; +if (!sta->uploaded) +return ; +trace_drv_flush_sta (local, sdata, &sta->sta);if (local->ops->flush_sta) local->ops->flush_sta (&local->hw, &sdata->vif, &sta->sta);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 113/393 clk: ralink: mtmips: remove duplicated xtal clock for Ralink SoC RT3883
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sergio Paracuellos <[email protected]>
[ Upstream commit 830d8062d25581cf0beaa334486eea06834044da ]
Ralink SoC RT3883 has already 'xtal' defined as a base clock so there is no need to redefine it again in fixed clocks section. Hence, remove the duplicate one from there.
--- drivers/clk/ralink/clk-mtmips.c | 1 - 1 file changed, 1 deletion(-)
drivers/clk/ralink/clk-mtmips.c +0 -1
@@ -264,7 +264,6 @@ static int mtmips_register_pherip_clocks(struct device_node *np, }static struct mtmips_clk_fixed rt3883_fixed_clocks[] = { -CLK_FIXED ("xtal" ,NULL ,40000000 ),CLK_FIXED ("periph" ,"xtal" ,40000000 ) };
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 114/393 net/smc: fix data error when recvmsg with MSG_PEEK flag
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guangguan Wang <[email protected]>
[ Upstream commit a4b6539038c1aa1ae871aacf6e41b566c3613993 ]
When recvmsg with MSG_PEEK flag, the data will be copied to user's buffer without advancing consume cursor and without reducing the length of rx available data. Once the expected peek length is larger than the value of bytes_to_rcv, in the loop of do while in smc_rx_recvmsg, the first loop will copy bytes_to_rcv bytes of data from the position local_tx_ctrl.cons, the second loop will copy the min(bytes_to_rcv, read_remaining) bytes from the position local_tx_ctrl.cons again because of the lacking of process with advancing consume cursor and reducing the length of available data. So do the subsequent loops. The data copied in the second loop and the subsequent loops will result in data error, as it should not be copied if no more data arrives and it should be copied from the position advancing bytes_to_rcv bytes from the local_tx_ctrl.cons if more data arrives.
This issue can be reproduce by the following python script:server.py:
import socket
import timeserver_ip = '0.0.0.0'server_port = 12346server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server_socket.bind((server_ip, server_port)) server_socket.listen(1)
print('Server is running and listening for connections...') conn, addr = server_socket.accept()print('Connected by', addr)
while True:
data = conn.recv(1024)
if not data:
break
print('Received request:', data.decode()) conn.sendall(b'Hello, client!\n')
time.sleep(5)
conn.sendall(b'Hello, again!\n')conn.close()
client.py:
import socketserver_ip = '<server ip>'server_port = 12346
resp=b'Hello, client!\nHello, again!\n'client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client_socket.connect((server_ip, server_port))
request = 'Hello, server!' client_socket.sendall(request.encode())peek_data = client_socket.recv(len(resp),
socket.MSG_PEEK | socket.MSG_WAITALL)print('Peeked data:', peek_data.decode()) client_socket.close()
--- net/smc/af_smc.c | 2 +- net/smc/smc_rx.c | 37 +++++++++++++++++++++---------------- net/smc/smc_rx.h | 8 ++++---- 3 files changed, 26 insertions(+), 21 deletions(-)
net/smc/af_smc.c +1 -1
@@ -2745,7 +2745,7 @@ static int smc_accept(struct socket *sock, struct socket *new_sock,release_sock (clcsk); }else if (!atomic_read (&smc_sk (nsk)->conn.bytes_to_rcv)) {lock_sock (nsk); -smc_rx_wait (smc_sk (nsk), &timeo, smc_rx_data_available); +smc_rx_wait (smc_sk (nsk), &timeo,0 , smc_rx_data_available);release_sock (nsk); } }
net/smc/smc_rx.c +21 -16
@@ -238,22 +238,23 @@ static int smc_rx_splice(struct pipe_inode_info *pipe, char *src, size_t len,return -ENOMEM ; } -static int smc_rx_data_available_and_no_splice_pend (struct smc_connection *conn) +static int smc_rx_data_available_and_no_splice_pend (struct smc_connection *conn,size_t peeked) { -return atomic_read (&conn->bytes_to_rcv) && +return smc_rx_data_available (conn, peeked) && !atomic_read (&conn->splice_pending); }/* blocks rcvbuf consumer until >=len bytes available or timeout or interrupted * @smc smc socket * @timeo pointer to max seconds to wait, pointer to value 0 for no timeout +* @peeked number of bytes already peeked * @fcrit add'l criterion to evaluate as function pointer * Returns: * 1 if at least 1 byte available in rcvbuf or if socket error/shutdown. * 0 otherwise (nothing in rcvbuf nor timeout, e.g. interrupted). */ -int smc_rx_wait (struct smc_sock *smc,long *timeo, -int (*fcrit)(struct smc_connection *conn)) +int smc_rx_wait (struct smc_sock *smc,long *timeo,size_t peeked, +int (*fcrit)(struct smc_connection *conn,size_t baseline)) {DEFINE_WAIT_FUNC (wait, woken_wake_function);struct smc_connection *conn = &smc->conn;
@@ -262,7 +263,7 @@ int smc_rx_wait(struct smc_sock *smc, long *timeo,struct sock *sk = &smc->sk;int rc; -if (fcrit (conn)) +if (fcrit (conn, peeked))return 1 ;sk_set_bit (SOCKWQ_ASYNC_WAITDATA , sk);add_wait_queue (sk_sleep (sk), &wait);
@@ -271,7 +272,7 @@ int smc_rx_wait(struct smc_sock *smc, long *timeo, cflags->peer_conn_abort ||READ_ONCE (sk->sk_shutdown) &RCV_SHUTDOWN || conn->killed || -fcrit (conn), +fcrit (conn, peeked), &wait);remove_wait_queue (sk_sleep (sk), &wait);sk_clear_bit (SOCKWQ_ASYNC_WAITDATA , sk);
@@ -322,11 +323,11 @@ static int smc_rx_recv_urg(struct smc_sock *smc, struct msghdr *msg, int len,return -EAGAIN ; } -static bool smc_rx_recvmsg_data_available (struct smc_sock *smc) +static bool smc_rx_recvmsg_data_available (struct smc_sock *smc,size_t peeked) {struct smc_connection *conn = &smc->conn; -if (smc_rx_data_available (conn)) +if (smc_rx_data_available (conn, peeked))return true;else if (conn->urg_state ==SMC_URG_VALID )/* we received a single urgent Byte - skip */
@@ -344,10 +345,10 @@ static bool smc_rx_recvmsg_data_available(struct smc_sock *smc)int smc_rx_recvmsg (struct smc_sock *smc,struct msghdr *msg,struct pipe_inode_info *pipe,size_t len,int flags) { -size_t copylen, read_done =0 , read_remaining = len; +size_t copylen, read_done =0 , read_remaining = len, peeked_bytes =0 ;size_t chunk_len, chunk_off, chunk_len_sum;struct smc_connection *conn = &smc->conn; -int (*func)(struct smc_connection *conn); +int (*func)(struct smc_connection *conn,size_t baseline);union smc_host_cursor cons;int readable, chunk;char *rcvbuf_base;
@@ -384,14 +385,14 @@ int smc_rx_recvmsg(struct smc_sock *smc, struct msghdr *msg,if (conn->killed)break ; -if (smc_rx_recvmsg_data_available (smc)) +if (smc_rx_recvmsg_data_available (smc, peeked_bytes)) goto copy;if (sk->sk_shutdown &RCV_SHUTDOWN ) {/* smc_cdc_msg_recv_action() could have run after * above smc_rx_recvmsg_data_available() */ -if (smc_rx_recvmsg_data_available (smc)) +if (smc_rx_recvmsg_data_available (smc, peeked_bytes)) goto copy;break ; }
@@ -425,26 +426,28 @@ int smc_rx_recvmsg(struct smc_sock *smc, struct msghdr *msg, } } -if (!smc_rx_data_available (conn)) { -smc_rx_wait (smc, &timeo, smc_rx_data_available); +if (!smc_rx_data_available (conn, peeked_bytes)) { +smc_rx_wait (smc, &timeo, peeked_bytes, smc_rx_data_available);continue ; } copy:/* initialize variables for 1st iteration of subsequent loop */ /* could be just 1 byte, even after waiting on data above */ - readable =atomic_read (&conn->bytes_to_rcv); + readable =smc_rx_data_available (conn, peeked_bytes); splbytes =atomic_read (&conn->splice_pending);if (!readable || (msg && splbytes)) {if (splbytes) func = smc_rx_data_available_and_no_splice_pend;else func = smc_rx_data_available; -smc_rx_wait (smc, &timeo, func); +smc_rx_wait (smc, &timeo, peeked_bytes, func);continue ; }smc_curs_copy (&cons, &conn->local_tx_ctrl.cons, conn); +if ((flags &MSG_PEEK ) && peeked_bytes) +smc_curs_add (conn->rmb_desc->len, &cons, peeked_bytes);/* subsequent splice() calls pick up where previous left */ if (splbytes)smc_curs_add (conn->rmb_desc->len, &cons, splbytes);
@@ -480,6 +483,8 @@ int smc_rx_recvmsg(struct smc_sock *smc, struct msghdr *msg, } read_remaining -= chunk_len; read_done += chunk_len; +if (flags &MSG_PEEK ) + peeked_bytes += chunk_len;if (chunk_len_sum == copylen)break ;/* either on 1st or 2nd iteration */
net/smc/smc_rx.h +4 -4
@@ -21,11 +21,11 @@ void smc_rx_init(struct smc_sock *smc);int smc_rx_recvmsg (struct smc_sock *smc,struct msghdr *msg,struct pipe_inode_info *pipe,size_t len,int flags); -int smc_rx_wait (struct smc_sock *smc,long *timeo, -int (*fcrit)(struct smc_connection *conn)); -static inline int smc_rx_data_available (struct smc_connection *conn) +int smc_rx_wait (struct smc_sock *smc,long *timeo,size_t peeked, +int (*fcrit)(struct smc_connection *conn,size_t baseline)); +static inline int smc_rx_data_available (struct smc_connection *conn,size_t peeked) { -return atomic_read (&conn->bytes_to_rcv); +return atomic_read (&conn->bytes_to_rcv) - peeked; }#endif /* SMC_RX_H */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 115/393 landlock: Handle weird files
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mickaël Salaün <[email protected]>
[ Upstream commit 49440290a0935f428a1e43a5ac8dc275a647ff80 ]
A corrupted filesystem (e.g. bcachefs) might return weird files. Instead of throwing a warning and allowing access to such file, treat them as regular files.
--- security/landlock/fs.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
security/landlock/fs.c +5 -6
@@ -664,10 +664,6 @@ static inline access_mask_t get_mode_access(const umode_t mode)switch (mode &S_IFMT ) {case S_IFLNK :return LANDLOCK_ACCESS_FS_MAKE_SYM ; -case 0 : -/* A zero mode translates to S_IFREG. */ -case S_IFREG : -return LANDLOCK_ACCESS_FS_MAKE_REG ;case S_IFDIR :return LANDLOCK_ACCESS_FS_MAKE_DIR ;case S_IFCHR :
@@ -678,9 +674,12 @@ static inline access_mask_t get_mode_access(const umode_t mode)return LANDLOCK_ACCESS_FS_MAKE_FIFO ;case S_IFSOCK :return LANDLOCK_ACCESS_FS_MAKE_SOCK ; +case S_IFREG : +case 0 : +/* A zero mode translates to S_IFREG. */ default : -WARN_ON_ONCE (1 ); -return 0 ; +/* Treats weird files as regular files. */ +return LANDLOCK_ACCESS_FS_MAKE_REG ; } }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 116/393 wifi: mt76: mt76u_vendor_request: Do not print error messages when -EPROTO
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: WangYuli <[email protected]>
[ Upstream commit f1b1e133a770fcdbd89551651232b034d2f7a27a ]
When initializing the network card, unplugging the device will trigger an -EPROTO error, resulting in a flood of error messages being printed frantically.
The exception is printed as follows:
mt76x2u 2-2.4:1.0: vendor request req:47 off:9018 failed:-71
mt76x2u 2-2.4:1.0: vendor request req:47 off:9018 failed:-71
...It will continue to print more than 2000 times for about 5 minutes, causing the usb device to be unable to be disconnected. During this period, the usb port cannot recognize the new device because the old device has not disconnected.
There may be other operating methods that cause -EPROTO, but -EPROTO is a low-level hardware error. It is unwise to repeat vendor requests expecting to read correct data. It is a better choice to treat -EPROTO and -ENODEV the same way.
Similar to commit 9b0f100c1970 ("mt76: usb: process URBs with status EPROTO properly") do no schedule rx_worker for urb marked with status set -EPROTO. I also reproduced this situation when plugging and unplugging the device, and this patch is effective.
Just do not vendor request again for urb marked with status set -EPROTO.
--- drivers/net/wireless/mediatek/mt76/usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/mediatek/mt76/usb.c +2 -2
@@ -33,9 +33,9 @@ int __mt76u_vendor_request(struct mt76_dev *dev, u8 req, u8 req_type, ret =usb_control_msg (udev, pipe, req, req_type, val, offset, buf, len,MT_VEND_REQ_TOUT_MS ); -if (ret == -ENODEV ) +if (ret == -ENODEV || ret == -EPROTO )set_bit (MT76_REMOVED , &dev->phy.state); -if (ret >=0 || ret == -ENODEV ) +if (ret >=0 || ret == -ENODEV || ret == -EPROTO )return ret;usleep_range (5000 ,10000 ); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 117/393 wifi: mt76: mt7921: fix using incorrect group cipher after disconnection.
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Lo <[email protected]>
[ Upstream commit aa566ac6b7272e7ea5359cb682bdca36d2fc7e73 ]
To avoid incorrect cipher after disconnection, we should do the key deletion process in this case.
--- drivers/net/wireless/mediatek/mt76/mt7921/main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7921/main.c +7 -1
@@ -519,7 +519,13 @@ static int mt7921_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, }else {if (idx == *wcid_keyidx) *wcid_keyidx =-1 ; - goto out; + +/* For security issue we don't trigger the key deletion when +* reassociating. But we should trigger the deletion process +* to avoid using incorrect cipher after disconnection, +*/ +if (vif->type !=NL80211_IFTYPE_STATION || vif->cfg.assoc) + goto out; }mt76_wcid_key_setup (&dev->mt76, wcid, key);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 118/393 wifi: mt76: mt7915: fix overflows seen when writing limit attributes
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: xueqin Luo <[email protected]>
[ Upstream commit 64d571742b0ae44eee5efd51e2d4a09d7f6782fc ]
DIV_ROUND_CLOSEST() after kstrtoul() results in an overflow if a large number such as 18446744073709551615 is provided by the user. Fix it by reordering clamp_val() and DIV_ROUND_CLOSEST() operations. This commit was inspired by commit: 57ee12b6c514.
--- drivers/net/wireless/mediatek/mt76/mt7915/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7915/init.c +1 -1
@@ -82,7 +82,7 @@ static ssize_t mt7915_thermal_temp_store(struct device *dev,return ret;mutex_lock (&phy->dev->mt76.mutex); - val =clamp_val (DIV_ROUND_CLOSEST (val,1000 ),60 ,130 ); + val =DIV_ROUND_CLOSEST (clamp_val (val,60 *1000 ,130 *1000 ),1000 ); if ((i - 1 == MT7915_CRIT_TEMP_IDX && val > phy->throttle_temp[MT7915_MAX_TEMP_IDX]) ||
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 119/393 wifi: mt76: mt7996: fix rx filter setting for bfee functionality
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <[email protected]>
[ Upstream commit 858fd2a53877b2e8b1d991a5a861ac34a0f55ef8 ]
Fix rx filter setting to prevent dropping NDPA frames. Without this change, bfee functionality may behave abnormally.
--- drivers/net/wireless/mediatek/mt76/mt7996/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7996/main.c +1 -2
@@ -474,8 +474,7 @@ static void mt7996_configure_filter(struct ieee80211_hw *hw,MT76_FILTER (CONTROL ,MT_WF_RFCR_DROP_CTS |MT_WF_RFCR_DROP_RTS | -MT_WF_RFCR_DROP_CTL_RSV | -MT_WF_RFCR_DROP_NDPA ); +MT_WF_RFCR_DROP_CTL_RSV ); *total_flags = flags;mt76_wr (dev,MT_WF_RFCR (phy->mt76->band_idx), phy->rxfilter);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 120/393 wifi: mt76: mt7915: firmware restart on devices with a second pcie link
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <[email protected]>
[ Upstream commit 9b60e2ae511c959024ecf6578b3fbe85cd06d7cc ]
It seems that the firmware checks the register used for detecting matching PCIe links in order to figure out if a secondary PCIe link is enabled. Write the register again just before starting the firmware on hw reset, in order to fix an issue that left the second band unusable after restart.
--- drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 2 ++ drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h | 1 + drivers/net/wireless/mediatek/mt76/mt7915/pci.c | 1 + 3 files changed, 4 insertions(+)
drivers/net/wireless/mediatek/mt76/mt7915/mac.c +2 -0
@@ -1383,6 +1383,8 @@ mt7915_mac_restart(struct mt7915_dev *dev)if (dev_is_pci (mdev->dev)) {mt76_wr (dev,MT_PCIE_MAC_INT_ENABLE ,0xff );if (dev->hif2) { +mt76_wr (dev,MT_PCIE_RECOG_ID , + dev->hif2->index |MT_PCIE_RECOG_ID_SEM );if (is_mt7915 (mdev))mt76_wr (dev,MT_PCIE1_MAC_INT_ENABLE ,0xff );else
drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h +1 -0
@@ -191,6 +191,7 @@ struct mt7915_hif {struct device *dev;void __iomem *regs;int irq; +u32 index; };struct mt7915_phy {
drivers/net/wireless/mediatek/mt76/mt7915/pci.c +1 -0
@@ -42,6 +42,7 @@ static struct mt7915_hif *mt7915_pci_get_hif2(u32 idx)continue ;get_device (hif->dev); + hif->index = idx; goto out; } hif =NULL ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 121/393 wifi: mt76: connac: move mt7615_mcu_del_wtbl_all to connac
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <[email protected]>
[ Upstream commit b2141eadf8be6285ff8980cab153079231cab4fd ]
Preparation for reusing it in mt7915
Stable-dep-of: cd043bbba6f9 ("wifi: mt76: mt7915: fix omac index assignment after hardware reset")
--- drivers/net/wireless/mediatek/mt76/mt7615/init.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 10 ---------- drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h | 1 - drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c | 11 +++++++++++ drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h | 1 + 5 files changed, 13 insertions(+), 12 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7615/init.c +1 -1
@@ -325,7 +325,7 @@ void mt7615_init_work(struct mt7615_dev *dev)mt7615_mcu_set_eeprom (dev);mt7615_mac_init (dev);mt7615_phy_init (dev); -mt7615_mcu_del_wtbl_all (dev); +mt76_connac_mcu_del_wtbl_all (&dev->mt76);mt7615_check_offload_capability (dev); }EXPORT_SYMBOL_GPL (mt7615_init_work);
drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +0 -10
@@ -1876,16 +1876,6 @@ int mt7615_mcu_set_dbdc(struct mt7615_dev *dev) sizeof(req), true); } -int mt7615_mcu_del_wtbl_all (struct mt7615_dev *dev) -{ -struct wtbl_req_hdr req = { - .operation =WTBL_RESET_ALL , - }; - -return mt76_mcu_send_msg (&dev->mt76,MCU_EXT_CMD (WTBL_UPDATE ), - &req,sizeof (req), true); -} -int mt7615_mcu_set_fcc5_lpn (struct mt7615_dev *dev,int val) {struct {
drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h +0 -1
@@ -399,7 +399,6 @@ void mt7615_mac_set_rates(struct mt7615_phy *phy, struct mt7615_sta *sta, struct ieee80211_tx_rate *rates);void mt7615_pm_wake_work (struct work_struct *work);void mt7615_pm_power_save_work (struct work_struct *work); -int mt7615_mcu_del_wtbl_all (struct mt7615_dev *dev);int mt7615_mcu_set_chan_info (struct mt7615_phy *phy,int cmd);int mt7615_mcu_set_wmm (struct mt7615_dev *dev,u8 queue,const struct ieee80211_tx_queue_params *params);
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c +11 -0
@@ -2926,6 +2926,17 @@ int mt76_connac_mcu_restart(struct mt76_dev *dev) }EXPORT_SYMBOL_GPL (mt76_connac_mcu_restart); +int mt76_connac_mcu_del_wtbl_all (struct mt76_dev *dev) +{ +struct wtbl_req_hdr req = { + .operation =WTBL_RESET_ALL , + }; + +return mt76_mcu_send_msg (dev,MCU_EXT_CMD (WTBL_UPDATE ), + &req,sizeof (req), true); +} +EXPORT_SYMBOL_GPL (mt76_connac_mcu_del_wtbl_all); +int mt76_connac_mcu_rdd_cmd (struct mt76_dev *dev,int cmd,u8 index,u8 rx_sel,u8 val) {
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h +1 -0
@@ -1914,6 +1914,7 @@ void mt76_connac_mcu_wtbl_smps_tlv(struct sk_buff *skb, void *sta_wtbl, void *wtbl_tlv);int mt76_connac_mcu_set_pm (struct mt76_dev *dev,int band,int enter);int mt76_connac_mcu_restart (struct mt76_dev *dev); +int mt76_connac_mcu_del_wtbl_all (struct mt76_dev *dev);int mt76_connac_mcu_rdd_cmd (struct mt76_dev *dev,int cmd,u8 index,u8 rx_sel,u8 val);int mt76_connac_mcu_sta_wed_update (struct mt76_dev *dev,struct sk_buff *skb);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 122/393 wifi: mt76: mt7915: improve hardware restart reliability
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <[email protected]>
[ Upstream commit 328e35c7bfc673cde5a3a453318d044f8f83b505 ]
- use reconfig_complete to restart mac_work / queues
- reset full wtbl after firmware init
- clear wcid and vif mask to avoid leak
- fix sta poll list corruption
Stable-dep-of: cd043bbba6f9 ("wifi: mt76: mt7915: fix omac index assignment after hardware reset")
--- .../net/wireless/mediatek/mt76/mt7915/mac.c | 25 ++++++++++--------- .../net/wireless/mediatek/mt76/mt7915/main.c | 12 +++++++++ .../net/wireless/mediatek/mt76/mt7915/mcu.c | 2 ++ 3 files changed, 27 insertions(+), 12 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7915/mac.c +13 -12
@@ -1459,26 +1459,27 @@ mt7915_mac_full_reset(struct mt7915_dev *dev)if (!mt7915_mac_restart (dev))break ; } -mutex_unlock (&dev->mt76.mutex);if (i ==10 )dev_err (dev->mt76.dev,"chip full reset failed\n" ); -ieee80211_restart_hw (mt76_hw (dev)); -if (ext_phy) -ieee80211_restart_hw (ext_phy->hw); +spin_lock_bh (&dev->mt76.sta_poll_lock); +while (!list_empty (&dev->mt76.sta_poll_list)) +list_del_init (dev->mt76.sta_poll_list.next); +spin_unlock_bh (&dev->mt76.sta_poll_lock); -ieee80211_wake_queues (mt76_hw (dev)); -if (ext_phy) -ieee80211_wake_queues (ext_phy->hw); +memset (dev->mt76.wcid_mask,0 ,sizeof (dev->mt76.wcid_mask)); + dev->mt76.vif_mask =0 ; + i =mt76_wcid_alloc (dev->mt76.wcid_mask,MT7915_WTBL_STA ); + dev->mt76.global_wcid.idx = i; dev->recovery.hw_full_reset = false; -ieee80211_queue_delayed_work (mt76_hw (dev), &dev->mphy.mac_work, -MT7915_WATCHDOG_TIME ); + +mutex_unlock (&dev->mt76.mutex); + +ieee80211_restart_hw (mt76_hw (dev));if (ext_phy) -ieee80211_queue_delayed_work (ext_phy->hw, - &ext_phy->mac_work, -MT7915_WATCHDOG_TIME ); +ieee80211_restart_hw (ext_phy->hw); }/* system error recovery */
drivers/net/wireless/mediatek/mt76/mt7915/main.c +12 -0
@@ -1650,6 +1650,17 @@ mt7915_net_fill_forward_path(struct ieee80211_hw *hw, }#endif +static void +mt7915_reconfig_complete (struct ieee80211_hw *hw, +enum ieee80211_reconfig_type reconfig_type) +{ +struct mt7915_phy *phy =mt7915_hw_phy (hw); + +ieee80211_wake_queues (hw); +ieee80211_queue_delayed_work (hw, &phy->mt76->mac_work, +MT7915_WATCHDOG_TIME ); +} +const struct ieee80211_ops mt7915_ops = { .tx = mt7915_tx, .start = mt7915_start,
@@ -1704,4 +1715,5 @@ const struct ieee80211_ops mt7915_ops = {#ifdef CONFIG_NET_MEDIATEK_SOC_WED .net_fill_forward_path = mt7915_net_fill_forward_path, #endif + .reconfig_complete = mt7915_reconfig_complete, };
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c +2 -0
@@ -2351,6 +2351,8 @@ int mt7915_mcu_init_firmware(struct mt7915_dev *dev)if (ret)return ret; +mt76_connac_mcu_del_wtbl_all (&dev->mt76); +if ((mtk_wed_device_active (&dev->mt76.mmio.wed) &&is_mt7915 (&dev->mt76)) || !mtk_wed_get_rx_capa (&dev->mt76.mmio.wed))
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 123/393 wifi: mt76: mt7915: fix omac index assignment after hardware reset
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <[email protected]>
[ Upstream commit cd043bbba6f9b71ebe0781d1bd2107565363c4b9 ]
Reset per-phy mac address slot mask in order to avoid leaking entries.
--- drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/wireless/mediatek/mt76/mt7915/mac.c +5 -0
@@ -1439,9 +1439,11 @@ static void mt7915_mac_full_reset(struct mt7915_dev *dev) {struct mt76_phy *ext_phy; +struct mt7915_phy *phy2;int i; ext_phy = dev->mt76.phys[MT_BAND1 ]; + phy2 = ext_phy ? ext_phy->priv :NULL ; dev->recovery.hw_full_reset = true;
@@ -1470,6 +1472,9 @@ mt7915_mac_full_reset(struct mt7915_dev *dev)memset (dev->mt76.wcid_mask,0 ,sizeof (dev->mt76.wcid_mask)); dev->mt76.vif_mask =0 ; + dev->phy.omac_mask =0 ; +if (phy2) + phy2->omac_mask =0 ; i =mt76_wcid_alloc (dev->mt76.wcid_mask,MT7915_WTBL_STA ); dev->mt76.global_wcid.idx = i;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 124/393 wifi: mt76: mt7915: fix register mapping
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Chiu <[email protected]>
[ Upstream commit dd1649ef966bb87053c17385ea2cfd1758f5385b ]
Bypass the entry when ofs is equal to dev->reg.map[i].size. Without this patch, it would get incorrect register mapping when the CR address is located at the boundary of an entry.
--- drivers/net/wireless/mediatek/mt76/mt7915/mmio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7915/mmio.c +1 -1
@@ -484,7 +484,7 @@ static u32 __mt7915_reg_addr(struct mt7915_dev *dev, u32 addr)continue ; ofs = addr - dev->reg.map[i].phys; -if (ofs > dev->reg.map[i].size) +if (ofs >= dev->reg.map[i].size)continue ;return dev->reg.map[i].maps + ofs;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 125/393 wifi: mt76: mt7996: fix register mapping
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Chiu <[email protected]>
[ Upstream commit d07ecb4f7070e84de49e8fa4e5a83dd52716d805 ]
Bypass the entry when ofs is equal to dev->reg.map[i].size. Without this patch, it would get incorrect register mapping when the CR address is located at the boundary of an entry.
--- drivers/net/wireless/mediatek/mt76/mt7996/mmio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7996/mmio.c +1 -1
@@ -119,7 +119,7 @@ static u32 __mt7996_reg_addr(struct mt7996_dev *dev, u32 addr)continue ; ofs = addr - dev->reg.map[i].phys; -if (ofs > dev->reg.map[i].size) +if (ofs >= dev->reg.map[i].size)continue ;return dev->reg.map[i].mapped + ofs;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 126/393 wifi: mt76: mt7996: add max mpdu len capability
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Chiu <[email protected]>
[ Upstream commit 1816ad9381e0c150e4c44ce6dd6ee2c52008a052 ]
Set max mpdu len to 11454 according to hardware capability. Without this patch, the max ampdu length would be 3895 and count not get expected performance.
--- drivers/net/wireless/mediatek/mt76/mt7996/init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7996/init.c +3 -1
@@ -729,7 +729,9 @@ mt7996_init_eht_caps(struct mt7996_phy *phy, enum nl80211_band band, eht_cap_elem->mac_cap_info[0 ] =IEEE80211_EHT_MAC_CAP0_EPCS_PRIO_ACCESS | -IEEE80211_EHT_MAC_CAP0_OM_CONTROL ; +IEEE80211_EHT_MAC_CAP0_OM_CONTROL | +u8_encode_bits (IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_11454 , +IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_MASK ); eht_cap_elem->phy_cap_info[0 ] = IEEE80211_EHT_PHY_CAP0_NDP_4_EHT_LFT_32_GI |
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 127/393 wifi: mt76: mt7996: fix the capability of reception of EHT MU PPDU
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Howard Hsu <[email protected]>
[ Upstream commit 2ffbdfc1bd78ba944c5754791c84f32232b513c6 ]
This commit includes two changes. First, enable "EHT MU PPDU With 4x EHT-LTF And 0.8us GI" in EHT Phy capabilities element since hardware can support. Second, fix the value of "Maximum number of supported EHT LTFs" in the same element, where the previous setting of 3 in Bit 3-4 was incorrect.
--- drivers/net/wireless/mediatek/mt76/mt7996/init.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7996/init.c +2 -3
@@ -773,21 +773,20 @@ mt7996_init_eht_caps(struct mt7996_phy *phy, enum nl80211_band band,IEEE80211_EHT_PHY_CAP3_CODEBOOK_7_5_MU_FDBK ; eht_cap_elem->phy_cap_info[4 ] = +IEEE80211_EHT_PHY_CAP4_EHT_MU_PPDU_4_EHT_LTF_08_GI |u8_encode_bits (min_t (int, sts -1 ,2 ),IEEE80211_EHT_PHY_CAP4_MAX_NC_MASK ); eht_cap_elem->phy_cap_info[5 ] =u8_encode_bits (IEEE80211_EHT_PHY_CAP5_COMMON_NOMINAL_PKT_PAD_16US ,IEEE80211_EHT_PHY_CAP5_COMMON_NOMINAL_PKT_PAD_MASK ) | -u8_encode_bits (u8_get_bits (0x11 ,GENMASK (1 ,0 )), +u8_encode_bits (u8_get_bits (1 ,GENMASK (1 ,0 )),IEEE80211_EHT_PHY_CAP5_MAX_NUM_SUPP_EHT_LTF_MASK ); val = width ==NL80211_CHAN_WIDTH_320 ?0xf : width ==NL80211_CHAN_WIDTH_160 ?0x7 : width ==NL80211_CHAN_WIDTH_80 ?0x3 :0x1 ; eht_cap_elem->phy_cap_info[6 ] = -u8_encode_bits (u8_get_bits (0x11 ,GENMASK (4 ,2 )), -IEEE80211_EHT_PHY_CAP6_MAX_NUM_SUPP_EHT_LTF_MASK ) |u8_encode_bits (val,IEEE80211_EHT_PHY_CAP6_MCS15_SUPP_MASK ); val = u8_encode_bits(nss, IEEE80211_EHT_MCS_NSS_RX) |
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 128/393 wifi: mt76: mt7996: fix HE Phy capability
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Howard Hsu <[email protected]>
[ Upstream commit 7e3aef59a403ade5dd4ea02edc2d7138a66d74b6 ]
Set HE SU PPDU And HE MU PPDU With 4x HE-LTF And 0.8 us GI within HE PHY Capabilities element as 1 since hardware can support.
--- drivers/net/wireless/mediatek/mt76/mt7996/init.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7996/init.c +4 -2
@@ -619,6 +619,9 @@ mt7996_init_he_caps(struct mt7996_phy *phy, enum nl80211_band band, he_cap_elem->phy_cap_info[2 ] =IEEE80211_HE_PHY_CAP2_STBC_TX_UNDER_80MHZ |IEEE80211_HE_PHY_CAP2_STBC_RX_UNDER_80MHZ ; + he_cap_elem->phy_cap_info[7 ] = +IEEE80211_HE_PHY_CAP7_HE_SU_MU_PPDU_4XLTF_AND_08_US_GI ; +switch (iftype) {case NL80211_IFTYPE_AP : he_cap_elem->mac_cap_info[0 ] |=IEEE80211_HE_MAC_CAP0_TWT_RES ;
@@ -658,8 +661,7 @@ mt7996_init_he_caps(struct mt7996_phy *phy, enum nl80211_band band,IEEE80211_HE_PHY_CAP6_PARTIAL_BW_EXT_RANGE |IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT ; he_cap_elem->phy_cap_info[7 ] |= -IEEE80211_HE_PHY_CAP7_POWER_BOOST_FACTOR_SUPP | -IEEE80211_HE_PHY_CAP7_HE_SU_MU_PPDU_4XLTF_AND_08_US_GI ; +IEEE80211_HE_PHY_CAP7_POWER_BOOST_FACTOR_SUPP ; he_cap_elem->phy_cap_info[8 ] |=IEEE80211_HE_PHY_CAP8_20MHZ_IN_40MHZ_HE_PPDU_IN_2G | IEEE80211_HE_PHY_CAP8_20MHZ_IN_160MHZ_HE_PPDU |
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 129/393 wifi: mt76: mt7996: fix incorrect indexing of MIB FW event
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Lin <[email protected]>
[ Upstream commit 5c2a25a1ab76a2976dddc5ffd58498866f3ef7c2 ]
Fix wrong calculation of the channel times due to incorrect interpretation from the FW event.
--- .../net/wireless/mediatek/mt76/mt7996/mcu.c | 45 ++++++++++++------- 1 file changed, 29 insertions(+), 16 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c +29 -16
@@ -3189,6 +3189,13 @@ int mt7996_mcu_get_chip_config(struct mt7996_dev *dev, u32 *cap) int mt7996_mcu_get_chan_mib_info(struct mt7996_phy *phy, bool chan_switch) { + enum { + IDX_TX_TIME, + IDX_RX_TIME, + IDX_OBSS_AIRTIME, + IDX_NON_WIFI_TIME, + IDX_NUM + }; struct { struct { u8 band;
@@ -3198,16 +3205,15 @@ int mt7996_mcu_get_chan_mib_info(struct mt7996_phy *phy, bool chan_switch)__le16 tag;__le16 len;__le32 offs; - } data[4 ]; + } data[IDX_NUM ]; }__packed req = { .hdr.band = phy->mt76->band_idx, }; -/* strict order */ static const u32 offs[] = { -UNI_MIB_TX_TIME , -UNI_MIB_RX_TIME , -UNI_MIB_OBSS_AIRTIME , -UNI_MIB_NON_WIFI_TIME , + [IDX_TX_TIME ] =UNI_MIB_TX_TIME , + [IDX_RX_TIME ] =UNI_MIB_RX_TIME , + [IDX_OBSS_AIRTIME ] =UNI_MIB_OBSS_AIRTIME , + [IDX_NON_WIFI_TIME ] =UNI_MIB_NON_WIFI_TIME , };struct mt76_channel_state *state = phy->mt76->chan_state;struct mt76_channel_state *state_ts = &phy->state_ts;
@@ -3216,7 +3222,7 @@ int mt7996_mcu_get_chan_mib_info(struct mt7996_phy *phy, bool chan_switch)struct sk_buff *skb;int i, ret; -for (i =0 ; i <4 ; i++) { +for (i =0 ; i <IDX_NUM ; i++) { req.data[i].tag =cpu_to_le16 (UNI_CMD_MIB_DATA ); req.data[i].len =cpu_to_le16 (sizeof (req.data[i])); req.data[i].offs =cpu_to_le32 (offs[i]);
@@ -3235,17 +3241,24 @@ int mt7996_mcu_get_chan_mib_info(struct mt7996_phy *phy, bool chan_switch) goto out;#define __res_u64 (s) le64_to_cpu(res[s].data) - state->cc_tx +=__res_u64 (1 ) - state_ts->cc_tx; - state->cc_bss_rx +=__res_u64 (2 ) - state_ts->cc_bss_rx; - state->cc_rx +=__res_u64 (2 ) +__res_u64 (3 ) - state_ts->cc_rx; - state->cc_busy +=__res_u64 (0 ) +__res_u64 (1 ) +__res_u64 (2 ) +__res_u64 (3 ) - + state->cc_tx +=__res_u64 (IDX_TX_TIME ) - state_ts->cc_tx; + state->cc_bss_rx +=__res_u64 (IDX_RX_TIME ) - state_ts->cc_bss_rx; + state->cc_rx +=__res_u64 (IDX_RX_TIME ) + +__res_u64 (IDX_OBSS_AIRTIME ) - + state_ts->cc_rx; + state->cc_busy +=__res_u64 (IDX_TX_TIME ) + +__res_u64 (IDX_RX_TIME ) + +__res_u64 (IDX_OBSS_AIRTIME ) + +__res_u64 (IDX_NON_WIFI_TIME ) - state_ts->cc_busy; - out: - state_ts->cc_tx =__res_u64 (1 ); - state_ts->cc_bss_rx =__res_u64 (2 ); - state_ts->cc_rx =__res_u64 (2 ) +__res_u64 (3 ); - state_ts->cc_busy =__res_u64 (0 ) +__res_u64 (1 ) +__res_u64 (2 ) +__res_u64 (3 ); + state_ts->cc_tx =__res_u64 (IDX_TX_TIME ); + state_ts->cc_bss_rx =__res_u64 (IDX_RX_TIME ); + state_ts->cc_rx =__res_u64 (IDX_RX_TIME ) +__res_u64 (IDX_OBSS_AIRTIME ); + state_ts->cc_busy =__res_u64 (IDX_TX_TIME ) + +__res_u64 (IDX_RX_TIME ) + +__res_u64 (IDX_OBSS_AIRTIME ) + +__res_u64 (IDX_NON_WIFI_TIME );#undef __res_u64dev_kfree_skb (skb);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 130/393 wifi: mt76: mt7996: fix ldpc setting
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Chiu <[email protected]>
[ Upstream commit da8352da1e4f476fdbf549a4efce4f3c618fde3b ]
The non-AP interfaces would not use conf->vht_ldpc so they never set STA_CAP_VHT_LDPC even if peer-station support LDPC.
Check conf->vht_ldpc only for AP interface.
Without this patch, station only uses BCC to transmit packet in VHT mode.
--- drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c +1 -1
@@ -1723,7 +1723,7 @@ mt7996_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7996_dev *dev, cap |=STA_CAP_VHT_TX_STBC ;if (sta->deflink.vht_cap.cap &IEEE80211_VHT_CAP_RXSTBC_1 ) cap |=STA_CAP_VHT_RX_STBC ; -if (vif->bss_conf.vht_ldpc && +if ((vif->type !=NL80211_IFTYPE_AP || vif->bss_conf.vht_ldpc) && (sta->deflink.vht_cap.cap &IEEE80211_VHT_CAP_RXLDPC )) cap |=STA_CAP_VHT_LDPC ;
Signature · 1 line
2.39.5