Since commit 8e1f385104ac ("kill task_struct->thread_group") remove
the thread_group, we will encounter below issue.
(gdb) lx-ps
TASK PID COMM
0xffff800086503340 0 swapper/0
Python Exception <class 'gdb.error'>: There is no member named thread_group.
Error occurred in Python: There is no member named thread_group.
We use signal->thread_head to iterate all threads instead.
Fixes: 8e1f385104ac ("kill task_struct->thread_group")
Cc: stable(a)vger.kernel.org
Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee(a)mediatek.com>
---
scripts/gdb/linux/tasks.py | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/scripts/gdb/linux/tasks.py b/scripts/gdb/linux/tasks.py
index 17ec19e9b5bf..7c32f4c8284b 100644
--- a/scripts/gdb/linux/tasks.py
+++ b/scripts/gdb/linux/tasks.py
@@ -13,7 +13,7 @@
import gdb
-from linux import utils
+from linux import utils, lists
task_type = utils.CachedType("struct task_struct")
@@ -25,13 +25,9 @@ def task_lists():
t = g = init_task
while True:
- while True:
- yield t
-
- t = utils.container_of(t['thread_group']['next'],
- task_ptr_type, "thread_group")
- if t == g:
- break
+ thread_head = t['signal']['thread_head']
+ for thread in lists.list_for_each_entry(thread_head, task_ptr_type, 'thread_node'):
+ yield thread
t = g = utils.container_of(g['tasks']['next'],
task_ptr_type, "tasks")
--
2.18.0
This is the start of the stable review cycle for the 5.4.262 release.
There are 152 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 Tue, 28 Nov 2023 15:43:06 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.262-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.4.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 5.4.262-rc4
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: bogus EBUSY when deleting flowtable after flush (for 5.4)
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: disable toggling dormant table state more than once
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: fix table flag updates
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nftables: update table flags from the commit phase
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: double hook unregistration in netns path
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: unregister flowtable hooks on netns exit
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: fix memleak when more than 255 elements expired
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nft_set_hash: try later when GC hits EAGAIN on iteration
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nft_set_rbtree: use read spinlock to avoid datapath contention
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nft_set_rbtree: skip sync GC for new elements in this transaction
Florian Westphal <fw(a)strlen.de>
netfilter: nf_tables: defer gc run if previous batch is still pending
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: use correct lock to protect gc_list
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: GC transaction race with abort path
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: GC transaction race with netns dismantle
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: fix GC transaction races with netns and netlink event exit path
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: remove busy mark and gc batch API
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nft_set_hash: mark set element as dead when deleting from packet path
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: adapt set backend to use GC transaction API
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: GC transaction API to avoid race with control plane
Florian Westphal <fw(a)strlen.de>
netfilter: nf_tables: don't skip expired elements during walk
Florian Westphal <fw(a)strlen.de>
netfilter: nft_set_rbtree: fix overlap expiration walk
Florian Westphal <fw(a)strlen.de>
netfilter: nft_set_rbtree: fix null deref on element insertion
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nft_set_rbtree: Switch to node list walk for overlap detection
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: drop map element references from preparation phase
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nftables: rename set element data activation/deactivation functions
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: pass context to nft_set_destroy()
Steven Rostedt (Google) <rostedt(a)goodmis.org>
tracing: Have trace_event_file have ref counters
Christian König <christian.koenig(a)amd.com>
drm/amdgpu: fix error handling in amdgpu_bo_list_get()
Kemeng Shi <shikemeng(a)huaweicloud.com>
ext4: remove gdb backup copy for meta bg in setup_new_flex_group_blocks
Zhang Yi <yi.zhang(a)huawei.com>
ext4: correct the start block of counting reserved clusters
Kemeng Shi <shikemeng(a)huaweicloud.com>
ext4: correct return value of ext4_convert_meta_bg
Kemeng Shi <shikemeng(a)huaweicloud.com>
ext4: correct offset of gdb backup in non meta_bg group to update_backups
Max Kellermann <max.kellermann(a)ionos.com>
ext4: apply umask if ACL support is disabled
Heiner Kallweit <hkallweit1(a)gmail.com>
Revert "net: r8169: Disable multicast filter for RTL8168H and RTL8107E"
Mahmoud Adam <mngyadam(a)amazon.com>
nfsd: fix file memleak on client_opens_release
Vikash Garodia <quic_vgarodia(a)quicinc.com>
media: venus: hfi: add checks to handle capabilities from firmware
Vikash Garodia <quic_vgarodia(a)quicinc.com>
media: venus: hfi: fix the check to handle session buffer requirement
Vikash Garodia <quic_vgarodia(a)quicinc.com>
media: venus: hfi_parser: Add check to keep the number of codecs within range
Sean Young <sean(a)mess.org>
media: sharp: fix sharp encoding
Sean Young <sean(a)mess.org>
media: lirc: drop trailing space from scancode transmit
Heiner Kallweit <hkallweit1(a)gmail.com>
i2c: i801: fix potential race in i801_block_transaction_byte_by_byte
Alexander Sverdlin <alexander.sverdlin(a)siemens.com>
net: dsa: lan9303: consequently nested-lock physical MDIO
Johnathan Mantey <johnathanx.mantey(a)intel.com>
Revert ncsi: Propagate carrier gain/loss events to the NCSI controller
Guan Wentao <guanwentao(a)uniontech.com>
Bluetooth: btusb: Add 0bda:b85b for Fn-Link RTL8852BE
Masum Reza <masumrezarock100(a)gmail.com>
Bluetooth: btusb: Add RTW8852BE device 13d3:3570 to device tables
Larry Finger <Larry.Finger(a)lwfinger.net>
bluetooth: Add device 13d3:3571 to device tables
Larry Finger <Larry.Finger(a)lwfinger.net>
bluetooth: Add device 0bda:887b to device tables
Artem Lukyanov <dukzcry(a)ya.ru>
Bluetooth: btusb: Add Realtek RTL8852BE support ID 0x0cb8:0xc559
Joseph Hwang <josephsih(a)chromium.org>
Bluetooth: btusb: add Realtek 8822CE to usb_device_id table
Alain Michaud <alainm(a)chromium.org>
Bluetooth: btusb: Add flag to define wideband speech capability
Pavel Krasavin <pkrasavin(a)imaqliq.com>
tty: serial: meson: fix hard LOCKUP on crtscts mode
Lad Prabhakar <prabhakar.mahadev-lad.rj(a)bp.renesas.com>
serial: meson: Use platform_get_irq() to get the interrupt
Neil Armstrong <narmstrong(a)baylibre.com>
tty: serial: meson: retrieve port FIFO size from DT
Colin Ian King <colin.king(a)canonical.com>
serial: meson: remove redundant initialization of variable id
Chandradeep Dey <codesigning(a)chandradeepdey.com>
ALSA: hda/realtek - Enable internal speaker of ASUS K6500ZC
Takashi Iwai <tiwai(a)suse.de>
ALSA: info: Fix potential deadlock at disconnection
Helge Deller <deller(a)gmx.de>
parisc/pgtable: Do not drop upper 5 address bits of physical address
Helge Deller <deller(a)gmx.de>
parisc: Prevent booting 64-bit kernels on PA1.x machines
Joshua Yeong <joshua.yeong(a)starfivetech.com>
i3c: master: cdns: Fix reading status register
Zi Yan <ziy(a)nvidia.com>
mm/cma: use nth_page() in place of direct struct page manipulation
Alain Volmat <alain.volmat(a)foss.st.com>
dmaengine: stm32-mdma: correct desc prep when channel running
Sanjuán García, Jorge <Jorge.SanjuanGarcia(a)duagon.com>
mcb: fix error handling for different scenarios when parsing
Benjamin Bara <benjamin.bara(a)skidata.com>
i2c: core: Run atomic i2c xfer when !preemptible
Benjamin Bara <benjamin.bara(a)skidata.com>
kernel/reboot: emergency_restart: Set correct system_state
Eric Biggers <ebiggers(a)google.com>
quota: explicitly forbid quota files from being encrypted
Zhihao Cheng <chengzhihao1(a)huawei.com>
jbd2: fix potential data lost in recovering journal raced with synchronizing fs bdev
Josef Bacik <josef(a)toxicpanda.com>
btrfs: don't arbitrarily slow down delalloc if we're committing
Brian Geffon <bgeffon(a)google.com>
PM: hibernate: Clean up sync_read handling in snapshot_write_next()
Brian Geffon <bgeffon(a)google.com>
PM: hibernate: Use __get_safe_page() rather than touching the list
Dan Carpenter <dan.carpenter(a)linaro.org>
mmc: vub300: fix an error code
Kathiravan Thirumoorthy <quic_kathirav(a)quicinc.com>
clk: qcom: ipq8074: drop the CLK_SET_RATE_PARENT flag from PLL clocks
Helge Deller <deller(a)gmx.de>
parisc/pdc: Add width field to struct pdc_model
Uwe Kleine-König <u.kleine-koenig(a)pengutronix.de>
PCI: keystone: Don't discard .probe() callback
Uwe Kleine-König <u.kleine-koenig(a)pengutronix.de>
PCI: keystone: Don't discard .remove() callback
Herve Codina <herve.codina(a)bootlin.com>
genirq/generic_chip: Make irq_remove_generic_chip() irqdomain aware
Rong Chen <rong.chen(a)amlogic.com>
mmc: meson-gx: Remove setting of CMD_CFG_ERROR
Werner Sembach <wse(a)tuxedocomputers.com>
ACPI: resource: Do IRQ override on TongFang GMxXGxx
Lukas Wunner <lukas(a)wunner.de>
PCI/sysfs: Protect driver's D3cold preference from user space
David Woodhouse <dwmw(a)amazon.co.uk>
hvc/xen: fix error path in xen_hvc_init() to always register frontend driver
Paul Moore <paul(a)paul-moore.com>
audit: don't WARN_ON_ONCE(!current->mm) in audit_exe_compare()
Paul Moore <paul(a)paul-moore.com>
audit: don't take task_lock() in audit_exe_compare() code path
Maciej S. Szmigiero <maciej.szmigiero(a)oracle.com>
KVM: x86: Ignore MSR_AMD64_TW_CFG access
Nicolas Saenz Julienne <nsaenz(a)amazon.com>
KVM: x86: hyper-v: Don't auto-enable stimer on write from user-space
Pu Wen <puwen(a)hygon.cn>
x86/cpu/hygon: Fix the CPU topology evaluation for real
Chandrakanth patil <chandrakanth.patil(a)broadcom.com>
scsi: megaraid_sas: Increase register read retry rount from 3 to 30 for selected registers
Shung-Hsi Yu <shung-hsi.yu(a)suse.com>
bpf: Fix precision tracking for BPF_ALU | BPF_TO_BE | BPF_END
Kees Cook <keescook(a)chromium.org>
randstruct: Fix gcc-plugin performance mode to stay in group
Vikash Garodia <quic_vgarodia(a)quicinc.com>
media: venus: hfi: add checks to perform sanity on queue pointers
Anastasia Belova <abelova(a)astralinux.ru>
cifs: spnego: add ';' in HOST_KEY_LEN
Zhang Rui <rui.zhang(a)intel.com>
tools/power/turbostat: Fix a knl bug
Vlad Buslov <vladbu(a)nvidia.com>
macvlan: Don't propagate promisc change to lower dev in passthru
Rahul Rameshbabu <rrameshbabu(a)nvidia.com>
net/mlx5e: Check return value of snprintf writing to fw_version buffer for representors
Leon Romanovsky <leonro(a)nvidia.com>
net/mlx5_core: Clean driver version and name
Dust Li <dust.li(a)linux.alibaba.com>
net/mlx5e: fix double free of encap_header
Baruch Siach <baruch(a)tkos.co.il>
net: stmmac: fix rx budget limit check
Jose Abreu <Jose.Abreu(a)synopsys.com>
net: stmmac: Rework stmmac_rx()
Linkui Xiao <xiaolinkui(a)kylinos.cn>
netfilter: nf_conntrack_bridge: initialize err to 0
Linus Walleij <linus.walleij(a)linaro.org>
net: ethernet: cortina: Fix MTU max setting
Linus Walleij <linus.walleij(a)linaro.org>
net: ethernet: cortina: Handle large frames
Linus Walleij <linus.walleij(a)linaro.org>
net: ethernet: cortina: Fix max RX frame define
Eric Dumazet <edumazet(a)google.com>
bonding: stop the device in bond_setup_by_slave()
Eric Dumazet <edumazet(a)google.com>
ptp: annotate data-race around q->head and q->tail
Juergen Gross <jgross(a)suse.com>
xen/events: fix delayed eoi list handling
Willem de Bruijn <willemb(a)google.com>
ppp: limit MRU to 64K
Shigeru Yoshida <syoshida(a)redhat.com>
tipc: Fix kernel-infoleak due to uninitialized TLV value
Yonglong Liu <liuyonglong(a)huawei.com>
net: hns3: fix variable may not initialized problem in hns3_init_mac_addr()
Shigeru Yoshida <syoshida(a)redhat.com>
tty: Fix uninit-value access in ppp_sync_receive()
Eric Dumazet <edumazet(a)google.com>
ipvlan: add ipvlan_route_v6_outbound() helper
Olga Kornievskaia <kolga(a)netapp.com>
NFSv4.1: fix SP4_MACH_CRED protection for pnfs IO
Miri Korenblit <miriam.rachel.korenblit(a)intel.com>
wifi: iwlwifi: Use FW rate for non-data frames
Dan Carpenter <dan.carpenter(a)linaro.org>
pwm: Fix double shift bug
Tony Lindgren <tony(a)atomide.com>
ASoC: ti: omap-mcbsp: Fix runtime PM underflow warnings
Douglas Anderson <dianders(a)chromium.org>
kgdb: Flush console before entering kgdb on panic
Wayne Lin <wayne.lin(a)amd.com>
drm/amd/display: Avoid NULL dereference of timing generator
Ilpo Järvinen <ilpo.jarvinen(a)linux.intel.com>
media: cobalt: Use FIELD_GET() to extract Link Width
Bob Peterson <rpeterso(a)redhat.com>
gfs2: ignore negated quota changes
Hans Verkuil <hverkuil-cisco(a)xs4all.nl>
media: vivid: avoid integer overflow
Rajeshwar R Shinde <coolrrsh(a)gmail.com>
media: gspca: cpia1: shift-out-of-bounds in set_flicker
Axel Lin <axel.lin(a)ingics.com>
i2c: sun6i-p2wi: Prevent potential division by zero
Hardik Gajjar <hgajjar(a)de.adit-jv.com>
usb: gadget: f_ncm: Always set current gadget in ncm_bind()
Yi Yang <yiyang13(a)huawei.com>
tty: vcc: Add check for kstrdup() in vcc_probe()
Jiri Kosina <jkosina(a)suse.cz>
HID: Add quirk for Dell Pro Wireless Keyboard and Mouse KM5221W
Wenchao Hao <haowenchao2(a)huawei.com>
scsi: libfc: Fix potential NULL pointer dereference in fc_lport_ptp_setup()
Ilpo Järvinen <ilpo.jarvinen(a)linux.intel.com>
atm: iphase: Do PCI error checks on own line
Ilpo Järvinen <ilpo.jarvinen(a)linux.intel.com>
PCI: tegra194: Use FIELD_GET()/FIELD_PREP() with Link Width fields
Cezary Rojewski <cezary.rojewski(a)intel.com>
ALSA: hda: Fix possible null-ptr-deref when assigning a stream
Vincent Whitchurch <vincent.whitchurch(a)axis.com>
ARM: 9320/1: fix stack depot IRQ stack filter
Manas Ghandat <ghandatmanas(a)gmail.com>
jfs: fix array-index-out-of-bounds in diAlloc
Manas Ghandat <ghandatmanas(a)gmail.com>
jfs: fix array-index-out-of-bounds in dbFindLeaf
Juntong Deng <juntong.deng(a)outlook.com>
fs/jfs: Add validity check for db_maxag and db_agpref
Juntong Deng <juntong.deng(a)outlook.com>
fs/jfs: Add check for negative db_l2nbperpage
Ilpo Järvinen <ilpo.jarvinen(a)linux.intel.com>
RDMA/hfi1: Use FIELD_GET() to extract Link Width
Lu Jialin <lujialin4(a)huawei.com>
crypto: pcrypt - Fix hungtask for PADATA_RESET
zhujun2 <zhujun2(a)cmss.chinamobile.com>
selftests/efivarfs: create-read: fix a resource leak
Qu Huang <qu.huang(a)linux.dev>
drm/amdgpu: Fix a null pointer access when the smc_rreg pointer is NULL
Mario Limonciello <mario.limonciello(a)amd.com>
drm/amd: Fix UBSAN array-index-out-of-bounds for Polaris and Tonga
Mario Limonciello <mario.limonciello(a)amd.com>
drm/amd: Fix UBSAN array-index-out-of-bounds for SMU7
baozhu.liu <lucas.liu(a)siengine.com>
drm/komeda: drop all currently held locks if deadlock happens
Olli Asikainen <olli.asikainen(a)gmail.com>
platform/x86: thinkpad_acpi: Add battery quirk for Thinkpad X120e
ZhengHan Wang <wzhmmmmm(a)gmail.com>
Bluetooth: Fix double free in hci_conn_cleanup
Douglas Anderson <dianders(a)chromium.org>
wifi: ath10k: Don't touch the CE interrupt registers after power up
Eric Dumazet <edumazet(a)google.com>
net: annotate data-races around sk->sk_dst_pending_confirm
Eric Dumazet <edumazet(a)google.com>
net: annotate data-races around sk->sk_tx_queue_mapping
Dmitry Antipov <dmantipov(a)yandex.ru>
wifi: ath10k: fix clang-specific fortify warning
Dmitry Antipov <dmantipov(a)yandex.ru>
wifi: ath9k: fix clang-specific fortify warnings
Ping-Ke Shih <pkshih(a)realtek.com>
wifi: mac80211: don't return unset power in ieee80211_get_tx_power()
Dmitry Antipov <dmantipov(a)yandex.ru>
wifi: mac80211_hwsim: fix clang-specific fortify warning
Mike Rapoport (IBM) <rppt(a)kernel.org>
x86/mm: Drop the 4 MB restriction on minimal NUMA node memory size
Ronald Wahl <ronald.wahl(a)raritan.com>
clocksource/drivers/timer-atmel-tcb: Fix initialization on SAM9 hardware
Jacky Bai <ping.bai(a)nxp.com>
clocksource/drivers/timer-imx-gpt: Fix potential memory leak
Shuai Xue <xueshuai(a)linux.alibaba.com>
perf/core: Bail out early if the request AUX area is out of bound
John Stultz <jstultz(a)google.com>
locking/ww_mutex/test: Fix potential workqueue corruption
-------------
Diffstat:
Makefile | 4 +-
arch/arm/include/asm/exception.h | 4 -
arch/parisc/include/uapi/asm/pdc.h | 1 +
arch/parisc/kernel/entry.S | 7 +-
arch/parisc/kernel/head.S | 5 +-
arch/x86/include/asm/msr-index.h | 1 +
arch/x86/include/asm/numa.h | 7 -
arch/x86/kernel/cpu/hygon.c | 8 +-
arch/x86/kvm/hyperv.c | 10 +-
arch/x86/kvm/x86.c | 2 +
arch/x86/mm/numa.c | 7 -
crypto/pcrypt.c | 4 +
drivers/acpi/resource.c | 12 +
drivers/atm/iphase.c | 20 +-
drivers/bluetooth/btusb.c | 35 +-
drivers/clk/qcom/gcc-ipq8074.c | 6 -
drivers/clocksource/timer-atmel-tcb.c | 1 +
drivers/clocksource/timer-imx-gpt.c | 18 +-
drivers/dma/stm32-mdma.c | 4 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 1 +
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 6 +
drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 4 +-
drivers/gpu/drm/amd/include/pptable.h | 4 +-
drivers/gpu/drm/amd/powerplay/hwmgr/pptable_v1_0.h | 16 +-
.../drm/arm/display/komeda/komeda_pipeline_state.c | 9 +-
drivers/hid/hid-ids.h | 1 +
drivers/hid/hid-quirks.c | 1 +
drivers/i2c/busses/i2c-i801.c | 19 +-
drivers/i2c/busses/i2c-sun6i-p2wi.c | 5 +
drivers/i2c/i2c-core.h | 2 +-
drivers/i3c/master/i3c-master-cdns.c | 6 +-
drivers/infiniband/hw/hfi1/pcie.c | 9 +-
drivers/mcb/mcb-core.c | 1 +
drivers/mcb/mcb-parse.c | 2 +-
drivers/media/pci/cobalt/cobalt-driver.c | 11 +-
drivers/media/platform/qcom/venus/hfi_msgs.c | 2 +-
drivers/media/platform/qcom/venus/hfi_parser.c | 15 +
drivers/media/platform/qcom/venus/hfi_venus.c | 10 +
drivers/media/platform/vivid/vivid-rds-gen.c | 2 +-
drivers/media/rc/ir-sharp-decoder.c | 8 +-
drivers/media/rc/lirc_dev.c | 6 +-
drivers/media/usb/gspca/cpia1.c | 3 +
drivers/mmc/host/meson-gx-mmc.c | 1 -
drivers/mmc/host/vub300.c | 1 +
drivers/net/bonding/bond_main.c | 6 +
drivers/net/dsa/lan9303_mdio.c | 4 +-
drivers/net/ethernet/cortina/gemini.c | 45 +-
drivers/net/ethernet/cortina/gemini.h | 4 +-
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/devlink.c | 2 +-
.../net/ethernet/mellanox/mlx5/core/en/tc_tun.c | 10 +-
.../net/ethernet/mellanox/mlx5/core/en_ethtool.c | 4 +-
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 13 +-
.../ethernet/mellanox/mlx5/core/ipoib/ethtool.c | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/main.c | 10 +-
.../net/ethernet/mellanox/mlx5/core/mlx5_core.h | 3 -
drivers/net/ethernet/realtek/r8169_main.c | 4 +-
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 148 +++---
drivers/net/ipvlan/ipvlan_core.c | 41 +-
drivers/net/macvlan.c | 2 +-
drivers/net/ppp/ppp_synctty.c | 6 +-
drivers/net/wireless/ath/ath10k/debug.c | 2 +-
drivers/net/wireless/ath/ath10k/snoc.c | 18 +-
drivers/net/wireless/ath/ath9k/debug.c | 2 +-
drivers/net/wireless/ath/ath9k/htc_drv_debug.c | 2 +-
drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 14 +-
drivers/net/wireless/mac80211_hwsim.c | 2 +-
drivers/pci/controller/dwc/pci-keystone.c | 8 +-
drivers/pci/controller/dwc/pcie-tegra194.c | 9 +-
drivers/pci/pci-acpi.c | 2 +-
drivers/pci/pci-sysfs.c | 5 +-
drivers/platform/x86/thinkpad_acpi.c | 1 +
drivers/ptp/ptp_chardev.c | 3 +-
drivers/ptp/ptp_clock.c | 5 +-
drivers/ptp/ptp_private.h | 8 +-
drivers/ptp/ptp_sysfs.c | 3 +-
drivers/scsi/libfc/fc_lport.c | 6 +
drivers/scsi/megaraid/megaraid_sas_base.c | 4 +-
drivers/tty/hvc/hvc_xen.c | 5 +-
drivers/tty/serial/meson_uart.c | 33 +-
drivers/tty/vcc.c | 16 +-
drivers/usb/gadget/function/f_ncm.c | 27 +-
drivers/xen/events/events_base.c | 4 +-
fs/btrfs/delalloc-space.c | 3 -
fs/cifs/cifs_spnego.c | 4 +-
fs/ext4/acl.h | 5 +
fs/ext4/extents_status.c | 4 +-
fs/ext4/resize.c | 19 +-
fs/gfs2/quota.c | 11 +
fs/jbd2/recovery.c | 8 +
fs/jfs/jfs_dmap.c | 23 +-
fs/jfs/jfs_imap.c | 5 +-
fs/nfs/nfs4proc.c | 5 +-
fs/nfsd/nfs4state.c | 2 +-
fs/quota/dquot.c | 14 +
include/linux/mlx5/driver.h | 2 +
include/linux/pwm.h | 4 +-
include/linux/trace_events.h | 4 +
include/net/netfilter/nf_tables.h | 129 ++----
include/net/sock.h | 26 +-
include/uapi/linux/netfilter/nf_tables.h | 1 +
kernel/audit_watch.c | 9 +-
kernel/bpf/verifier.c | 7 +-
kernel/debug/debug_core.c | 3 +
kernel/events/ring_buffer.c | 6 +
kernel/irq/generic-chip.c | 25 +-
kernel/locking/test-ww_mutex.c | 20 +-
kernel/padata.c | 2 +-
kernel/power/snapshot.c | 16 +-
kernel/reboot.c | 1 +
kernel/trace/trace.c | 15 +
kernel/trace/trace.h | 3 +
kernel/trace/trace_events.c | 39 +-
kernel/trace/trace_events_filter.c | 3 +
mm/cma.c | 2 +-
net/bluetooth/hci_conn.c | 6 +-
net/bluetooth/hci_sysfs.c | 23 +-
net/bridge/netfilter/nf_conntrack_bridge.c | 2 +-
net/core/sock.c | 2 +-
net/ipv4/tcp_output.c | 2 +-
net/mac80211/cfg.c | 4 +
net/ncsi/ncsi-aen.c | 5 -
net/netfilter/nf_tables_api.c | 512 +++++++++++++++++----
net/netfilter/nft_chain_filter.c | 3 +
net/netfilter/nft_set_bitmap.c | 5 +-
net/netfilter/nft_set_hash.c | 110 +++--
net/netfilter/nft_set_rbtree.c | 375 ++++++++++++---
net/tipc/netlink_compat.c | 1 +
scripts/gcc-plugins/randomize_layout_plugin.c | 11 +-
sound/core/info.c | 21 +-
sound/hda/hdac_stream.c | 6 +-
sound/pci/hda/patch_realtek.c | 1 +
sound/soc/ti/omap-mcbsp.c | 6 +-
tools/power/x86/turbostat/turbostat.c | 2 +-
tools/testing/selftests/efivarfs/create-read.c | 2 +
135 files changed, 1626 insertions(+), 679 deletions(-)
If bus is marked as multi_link, but number of masters in the stream is
not higher than bus->hw_sync_min_links (bus->multi_link && m_rt_count >=
bus->hw_sync_min_links), bank switching should not happen. The first
part of do_bank_switch() code properly takes these conditions into
account, but second part (sdw_ml_sync_bank_switch()) relies purely on
bus->multi_link property. This is not balanced and leads to NULL
pointer dereference:
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
...
Call trace:
wait_for_completion_timeout+0x124/0x1f0
do_bank_switch+0x370/0x6f8
sdw_prepare_stream+0x2d0/0x438
qcom_snd_sdw_prepare+0xa0/0x118
sm8450_snd_prepare+0x128/0x148
snd_soc_link_prepare+0x5c/0xe8
__soc_pcm_prepare+0x28/0x1ec
dpcm_be_dai_prepare+0x1e0/0x2c0
dpcm_fe_dai_prepare+0x108/0x28c
snd_pcm_do_prepare+0x44/0x68
snd_pcm_action_single+0x54/0xc0
snd_pcm_action_nonatomic+0xe4/0xec
snd_pcm_prepare+0xc4/0x114
snd_pcm_common_ioctl+0x1154/0x1cc0
snd_pcm_ioctl+0x54/0x74
Fixes: ce6e74d008ff ("soundwire: Add support for multi link bank switch")
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski(a)linaro.org>
---
drivers/soundwire/stream.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c
index 9dc6399f206a..f9c0adc0738d 100644
--- a/drivers/soundwire/stream.c
+++ b/drivers/soundwire/stream.c
@@ -742,14 +742,15 @@ static int sdw_bank_switch(struct sdw_bus *bus, int m_rt_count)
* sdw_ml_sync_bank_switch: Multilink register bank switch
*
* @bus: SDW bus instance
+ * @multi_link: whether this is a multi-link stream with hardware-based sync
*
* Caller function should free the buffers on error
*/
-static int sdw_ml_sync_bank_switch(struct sdw_bus *bus)
+static int sdw_ml_sync_bank_switch(struct sdw_bus *bus, bool multi_link)
{
unsigned long time_left;
- if (!bus->multi_link)
+ if (!multi_link)
return 0;
/* Wait for completion of transfer */
@@ -847,7 +848,7 @@ static int do_bank_switch(struct sdw_stream_runtime *stream)
bus->bank_switch_timeout = DEFAULT_BANK_SWITCH_TIMEOUT;
/* Check if bank switch was successful */
- ret = sdw_ml_sync_bank_switch(bus);
+ ret = sdw_ml_sync_bank_switch(bus, multi_link);
if (ret < 0) {
dev_err(bus->dev,
"multi link bank switch failed: %d\n", ret);
--
2.34.1
The patch below does not apply to the 4.19-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-4.19.y
git checkout FETCH_HEAD
git cherry-pick -x b022f0c7e404887a7c5229788fc99eff9f9a80d5
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023102138-riverbed-senator-e356@gregkh' --subject-prefix 'PATCH 4.19.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From b022f0c7e404887a7c5229788fc99eff9f9a80d5 Mon Sep 17 00:00:00 2001
From: Francis Laniel <flaniel(a)linux.microsoft.com>
Date: Fri, 20 Oct 2023 13:42:49 +0300
Subject: [PATCH] tracing/kprobes: Return EADDRNOTAVAIL when func matches
several symbols
When a kprobe is attached to a function that's name is not unique (is
static and shares the name with other functions in the kernel), the
kprobe is attached to the first function it finds. This is a bug as the
function that it is attaching to is not necessarily the one that the
user wants to attach to.
Instead of blindly picking a function to attach to what is ambiguous,
error with EADDRNOTAVAIL to let the user know that this function is not
unique, and that the user must use another unique function with an
address offset to get to the function they want to attach to.
Link: https://lore.kernel.org/all/20231020104250.9537-2-flaniel@linux.microsoft.c…
Cc: stable(a)vger.kernel.org
Fixes: 413d37d1eb69 ("tracing: Add kprobe-based event tracer")
Suggested-by: Masami Hiramatsu <mhiramat(a)kernel.org>
Signed-off-by: Francis Laniel <flaniel(a)linux.microsoft.com>
Link: https://lore.kernel.org/lkml/20230819101105.b0c104ae4494a7d1f2eea742@kernel…
Acked-by: Masami Hiramatsu (Google) <mhiramat(a)kernel.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat(a)kernel.org>
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index 3d7a180a8427..a8fef6ab0872 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -705,6 +705,25 @@ static struct notifier_block trace_kprobe_module_nb = {
.priority = 1 /* Invoked after kprobe module callback */
};
+static int count_symbols(void *data, unsigned long unused)
+{
+ unsigned int *count = data;
+
+ (*count)++;
+
+ return 0;
+}
+
+static unsigned int number_of_same_symbols(char *func_name)
+{
+ unsigned int count;
+
+ count = 0;
+ kallsyms_on_each_match_symbol(count_symbols, func_name, &count);
+
+ return count;
+}
+
static int __trace_kprobe_create(int argc, const char *argv[])
{
/*
@@ -836,6 +855,31 @@ static int __trace_kprobe_create(int argc, const char *argv[])
}
}
+ if (symbol && !strchr(symbol, ':')) {
+ unsigned int count;
+
+ count = number_of_same_symbols(symbol);
+ if (count > 1) {
+ /*
+ * Users should use ADDR to remove the ambiguity of
+ * using KSYM only.
+ */
+ trace_probe_log_err(0, NON_UNIQ_SYMBOL);
+ ret = -EADDRNOTAVAIL;
+
+ goto error;
+ } else if (count == 0) {
+ /*
+ * We can return ENOENT earlier than when register the
+ * kprobe.
+ */
+ trace_probe_log_err(0, BAD_PROBE_ADDR);
+ ret = -ENOENT;
+
+ goto error;
+ }
+ }
+
trace_probe_log_set_index(0);
if (event) {
ret = traceprobe_parse_event_name(&event, &group, gbuf,
@@ -1695,6 +1739,7 @@ static int unregister_kprobe_event(struct trace_kprobe *tk)
}
#ifdef CONFIG_PERF_EVENTS
+
/* create a trace_kprobe, but don't add it to global lists */
struct trace_event_call *
create_local_trace_kprobe(char *func, void *addr, unsigned long offs,
@@ -1705,6 +1750,24 @@ create_local_trace_kprobe(char *func, void *addr, unsigned long offs,
int ret;
char *event;
+ if (func) {
+ unsigned int count;
+
+ count = number_of_same_symbols(func);
+ if (count > 1)
+ /*
+ * Users should use addr to remove the ambiguity of
+ * using func only.
+ */
+ return ERR_PTR(-EADDRNOTAVAIL);
+ else if (count == 0)
+ /*
+ * We can return ENOENT earlier than when register the
+ * kprobe.
+ */
+ return ERR_PTR(-ENOENT);
+ }
+
/*
* local trace_kprobes are not added to dyn_event, so they are never
* searched in find_trace_kprobe(). Therefore, there is no concern of
diff --git a/kernel/trace/trace_probe.h b/kernel/trace/trace_probe.h
index 02b432ae7513..850d9ecb6765 100644
--- a/kernel/trace/trace_probe.h
+++ b/kernel/trace/trace_probe.h
@@ -450,6 +450,7 @@ extern int traceprobe_define_arg_fields(struct trace_event_call *event_call,
C(BAD_MAXACT, "Invalid maxactive number"), \
C(MAXACT_TOO_BIG, "Maxactive is too big"), \
C(BAD_PROBE_ADDR, "Invalid probed address or symbol"), \
+ C(NON_UNIQ_SYMBOL, "The symbol is not unique"), \
C(BAD_RETPROBE, "Retprobe address must be an function entry"), \
C(NO_TRACEPOINT, "Tracepoint is not found"), \
C(BAD_ADDR_SUFFIX, "Invalid probed address suffix"), \
The vmd_pm_enable_quirk() helper is called from pci_walk_bus() during
probe to enable ASPM for controllers with VMD_FEAT_BIOS_PM_QUIRK set.
Since pci_walk_bus() already holds a pci_bus_sem read lock, use the new
locked helper to enable link states in order to avoid a potential
deadlock (e.g. in case someone takes a write lock before reacquiring
the read lock).
Fixes: f492edb40b54 ("PCI: vmd: Add quirk to configure PCIe ASPM and LTR")
Cc: stable(a)vger.kernel.org # 6.3
Cc: Michael Bottini <michael.a.bottini(a)linux.intel.com>
Cc: David E. Box <david.e.box(a)linux.intel.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam(a)linaro.org>
Signed-off-by: Johan Hovold <johan+linaro(a)kernel.org>
---
drivers/pci/controller/vmd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
index 94ba61fe1c44..0452cbc362ee 100644
--- a/drivers/pci/controller/vmd.c
+++ b/drivers/pci/controller/vmd.c
@@ -751,7 +751,7 @@ static int vmd_pm_enable_quirk(struct pci_dev *pdev, void *userdata)
if (!(features & VMD_FEAT_BIOS_PM_QUIRK))
return 0;
- pci_enable_link_state(pdev, PCIE_LINK_STATE_ALL);
+ pci_enable_link_state_locked(pdev, PCIE_LINK_STATE_ALL);
pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_LTR);
if (!pos)
--
2.41.0
When typec_altmode_put_partner is called by a plug altmode upon release,
the port altmode the plug belongs to will not remove its reference to the
plug. The check to see if the altmode being released evaluates against the
released altmode's partner instead of the calling altmode itself, so change
adev in typec_altmode_put_partner to properly refer to the altmode being
released.
typec_altmode_set_partner is not run for port altmodes, so also add a check
in typec_altmode_release to prevent typec_altmode_put_partner() calls on
port altmode release.
---
Changes since v1:
* Changed commit message for clarity
* Added check to typec_altmode_release to only call put_partner if altmode
belongs to port partner or plug
---
Fixes: 8a37d87d72f0 ("usb: typec: Bus type for alternate modes")
Cc: stable(a)vger.kernel.org
Signed-off-by: RD Babiera <rdbabiera(a)google.com>
---
drivers/usb/typec/class.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c
index 2e0451bd336e..16a670828dde 100644
--- a/drivers/usb/typec/class.c
+++ b/drivers/usb/typec/class.c
@@ -267,7 +267,7 @@ static void typec_altmode_put_partner(struct altmode *altmode)
if (!partner)
return;
- adev = &partner->adev;
+ adev = &altmode->adev;
if (is_typec_plug(adev->dev.parent)) {
struct typec_plug *plug = to_typec_plug(adev->dev.parent);
@@ -497,7 +497,8 @@ static void typec_altmode_release(struct device *dev)
{
struct altmode *alt = to_altmode(to_typec_altmode(dev));
- typec_altmode_put_partner(alt);
+ if (!is_typec_port(dev->parent))
+ typec_altmode_put_partner(alt);
altmode_id_remove(alt->adev.dev.parent, alt->id);
kfree(alt);
base-commit: b85ea95d086471afb4ad062012a4d73cd328fa86
--
2.43.0.rc1.413.gea7ed67945-goog
This is the start of the stable review cycle for the 4.19.300 release.
There are 92 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 Tue, 28 Nov 2023 15:43:06 +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/v4.x/stable-review/patch-4.19.300-r…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.19.300-rc3
Eric Dumazet <edumazet(a)google.com>
net: sched: fix race condition in qdisc_graft()
Matthew Wilcox (Oracle) <willy(a)infradead.org>
iomap: Set all uptodate bits for an Uptodate page
Dongli Zhang <dongli.zhang(a)oracle.com>
scsi: virtio_scsi: limit number of hw queues by nr_cpu_ids
Christian König <christian.koenig(a)amd.com>
drm/amdgpu: fix error handling in amdgpu_bo_list_get()
Kemeng Shi <shikemeng(a)huaweicloud.com>
ext4: remove gdb backup copy for meta bg in setup_new_flex_group_blocks
Kemeng Shi <shikemeng(a)huaweicloud.com>
ext4: correct return value of ext4_convert_meta_bg
Kemeng Shi <shikemeng(a)huaweicloud.com>
ext4: correct offset of gdb backup in non meta_bg group to update_backups
Max Kellermann <max.kellermann(a)ionos.com>
ext4: apply umask if ACL support is disabled
Heiner Kallweit <hkallweit1(a)gmail.com>
Revert "net: r8169: Disable multicast filter for RTL8168H and RTL8107E"
Vikash Garodia <quic_vgarodia(a)quicinc.com>
media: venus: hfi: add checks to handle capabilities from firmware
Vikash Garodia <quic_vgarodia(a)quicinc.com>
media: venus: hfi: fix the check to handle session buffer requirement
Vikash Garodia <quic_vgarodia(a)quicinc.com>
media: venus: hfi_parser: Add check to keep the number of codecs within range
Sean Young <sean(a)mess.org>
media: sharp: fix sharp encoding
Sean Young <sean(a)mess.org>
media: lirc: drop trailing space from scancode transmit
Heiner Kallweit <hkallweit1(a)gmail.com>
i2c: i801: fix potential race in i801_block_transaction_byte_by_byte
Alexander Sverdlin <alexander.sverdlin(a)siemens.com>
net: dsa: lan9303: consequently nested-lock physical MDIO
Pavel Krasavin <pkrasavin(a)imaqliq.com>
tty: serial: meson: fix hard LOCKUP on crtscts mode
Lad Prabhakar <prabhakar.mahadev-lad.rj(a)bp.renesas.com>
serial: meson: Use platform_get_irq() to get the interrupt
Neil Armstrong <narmstrong(a)baylibre.com>
tty: serial: meson: retrieve port FIFO size from DT
Colin Ian King <colin.king(a)canonical.com>
serial: meson: remove redundant initialization of variable id
Loys Ollivier <lollivier(a)baylibre.com>
tty: serial: meson: if no alias specified use an available id
Chandradeep Dey <codesigning(a)chandradeepdey.com>
ALSA: hda/realtek - Enable internal speaker of ASUS K6500ZC
Takashi Iwai <tiwai(a)suse.de>
ALSA: info: Fix potential deadlock at disconnection
Helge Deller <deller(a)gmx.de>
parisc/pgtable: Do not drop upper 5 address bits of physical address
Helge Deller <deller(a)gmx.de>
parisc: Prevent booting 64-bit kernels on PA1.x machines
Alain Volmat <alain.volmat(a)foss.st.com>
dmaengine: stm32-mdma: correct desc prep when channel running
Sanjuán García, Jorge <Jorge.SanjuanGarcia(a)duagon.com>
mcb: fix error handling for different scenarios when parsing
Eric Biggers <ebiggers(a)google.com>
quota: explicitly forbid quota files from being encrypted
Zhihao Cheng <chengzhihao1(a)huawei.com>
jbd2: fix potential data lost in recovering journal raced with synchronizing fs bdev
Brian Geffon <bgeffon(a)google.com>
PM: hibernate: Clean up sync_read handling in snapshot_write_next()
Brian Geffon <bgeffon(a)google.com>
PM: hibernate: Use __get_safe_page() rather than touching the list
Dan Carpenter <dan.carpenter(a)linaro.org>
mmc: vub300: fix an error code
Kathiravan Thirumoorthy <quic_kathirav(a)quicinc.com>
clk: qcom: ipq8074: drop the CLK_SET_RATE_PARENT flag from PLL clocks
Helge Deller <deller(a)gmx.de>
parisc/pdc: Add width field to struct pdc_model
Uwe Kleine-König <u.kleine-koenig(a)pengutronix.de>
PCI: keystone: Don't discard .probe() callback
Uwe Kleine-König <u.kleine-koenig(a)pengutronix.de>
PCI: keystone: Don't discard .remove() callback
Herve Codina <herve.codina(a)bootlin.com>
genirq/generic_chip: Make irq_remove_generic_chip() irqdomain aware
Rong Chen <rong.chen(a)amlogic.com>
mmc: meson-gx: Remove setting of CMD_CFG_ERROR
Lukas Wunner <lukas(a)wunner.de>
PCI/sysfs: Protect driver's D3cold preference from user space
David Woodhouse <dwmw(a)amazon.co.uk>
hvc/xen: fix error path in xen_hvc_init() to always register frontend driver
Paul Moore <paul(a)paul-moore.com>
audit: don't WARN_ON_ONCE(!current->mm) in audit_exe_compare()
Paul Moore <paul(a)paul-moore.com>
audit: don't take task_lock() in audit_exe_compare() code path
Maciej S. Szmigiero <maciej.szmigiero(a)oracle.com>
KVM: x86: Ignore MSR_AMD64_TW_CFG access
Kees Cook <keescook(a)chromium.org>
randstruct: Fix gcc-plugin performance mode to stay in group
Vikash Garodia <quic_vgarodia(a)quicinc.com>
media: venus: hfi: add checks to perform sanity on queue pointers
Anastasia Belova <abelova(a)astralinux.ru>
cifs: spnego: add ';' in HOST_KEY_LEN
Vlad Buslov <vladbu(a)nvidia.com>
macvlan: Don't propagate promisc change to lower dev in passthru
Linus Walleij <linus.walleij(a)linaro.org>
net: ethernet: cortina: Fix MTU max setting
Linus Walleij <linus.walleij(a)linaro.org>
net: ethernet: cortina: Handle large frames
Linus Walleij <linus.walleij(a)linaro.org>
net: ethernet: cortina: Fix max RX frame define
Eric Dumazet <edumazet(a)google.com>
ptp: annotate data-race around q->head and q->tail
Juergen Gross <jgross(a)suse.com>
xen/events: fix delayed eoi list handling
Willem de Bruijn <willemb(a)google.com>
ppp: limit MRU to 64K
Shigeru Yoshida <syoshida(a)redhat.com>
tipc: Fix kernel-infoleak due to uninitialized TLV value
Shigeru Yoshida <syoshida(a)redhat.com>
tty: Fix uninit-value access in ppp_sync_receive()
Eric Dumazet <edumazet(a)google.com>
ipvlan: add ipvlan_route_v6_outbound() helper
Olga Kornievskaia <kolga(a)netapp.com>
NFSv4.1: fix SP4_MACH_CRED protection for pnfs IO
Dan Carpenter <dan.carpenter(a)linaro.org>
pwm: Fix double shift bug
Wayne Lin <wayne.lin(a)amd.com>
drm/amd/display: Avoid NULL dereference of timing generator
Bob Peterson <rpeterso(a)redhat.com>
gfs2: ignore negated quota changes
Hans Verkuil <hverkuil-cisco(a)xs4all.nl>
media: vivid: avoid integer overflow
Rajeshwar R Shinde <coolrrsh(a)gmail.com>
media: gspca: cpia1: shift-out-of-bounds in set_flicker
Axel Lin <axel.lin(a)ingics.com>
i2c: sun6i-p2wi: Prevent potential division by zero
Hardik Gajjar <hgajjar(a)de.adit-jv.com>
usb: gadget: f_ncm: Always set current gadget in ncm_bind()
Yi Yang <yiyang13(a)huawei.com>
tty: vcc: Add check for kstrdup() in vcc_probe()
Jiri Kosina <jkosina(a)suse.cz>
HID: Add quirk for Dell Pro Wireless Keyboard and Mouse KM5221W
Wenchao Hao <haowenchao2(a)huawei.com>
scsi: libfc: Fix potential NULL pointer dereference in fc_lport_ptp_setup()
Ilpo Järvinen <ilpo.jarvinen(a)linux.intel.com>
atm: iphase: Do PCI error checks on own line
Cezary Rojewski <cezary.rojewski(a)intel.com>
ALSA: hda: Fix possible null-ptr-deref when assigning a stream
Vincent Whitchurch <vincent.whitchurch(a)axis.com>
ARM: 9320/1: fix stack depot IRQ stack filter
Manas Ghandat <ghandatmanas(a)gmail.com>
jfs: fix array-index-out-of-bounds in diAlloc
Manas Ghandat <ghandatmanas(a)gmail.com>
jfs: fix array-index-out-of-bounds in dbFindLeaf
Juntong Deng <juntong.deng(a)outlook.com>
fs/jfs: Add validity check for db_maxag and db_agpref
Juntong Deng <juntong.deng(a)outlook.com>
fs/jfs: Add check for negative db_l2nbperpage
Ilpo Järvinen <ilpo.jarvinen(a)linux.intel.com>
RDMA/hfi1: Use FIELD_GET() to extract Link Width
Lu Jialin <lujialin4(a)huawei.com>
crypto: pcrypt - Fix hungtask for PADATA_RESET
zhujun2 <zhujun2(a)cmss.chinamobile.com>
selftests/efivarfs: create-read: fix a resource leak
Qu Huang <qu.huang(a)linux.dev>
drm/amdgpu: Fix a null pointer access when the smc_rreg pointer is NULL
Mario Limonciello <mario.limonciello(a)amd.com>
drm/amd: Fix UBSAN array-index-out-of-bounds for Polaris and Tonga
Mario Limonciello <mario.limonciello(a)amd.com>
drm/amd: Fix UBSAN array-index-out-of-bounds for SMU7
Olli Asikainen <olli.asikainen(a)gmail.com>
platform/x86: thinkpad_acpi: Add battery quirk for Thinkpad X120e
ZhengHan Wang <wzhmmmmm(a)gmail.com>
Bluetooth: Fix double free in hci_conn_cleanup
Eric Dumazet <edumazet(a)google.com>
net: annotate data-races around sk->sk_dst_pending_confirm
Eric Dumazet <edumazet(a)google.com>
net: annotate data-races around sk->sk_tx_queue_mapping
Dmitry Antipov <dmantipov(a)yandex.ru>
wifi: ath10k: fix clang-specific fortify warning
Dmitry Antipov <dmantipov(a)yandex.ru>
wifi: ath9k: fix clang-specific fortify warnings
Ping-Ke Shih <pkshih(a)realtek.com>
wifi: mac80211: don't return unset power in ieee80211_get_tx_power()
Mike Rapoport (IBM) <rppt(a)kernel.org>
x86/mm: Drop the 4 MB restriction on minimal NUMA node memory size
Ronald Wahl <ronald.wahl(a)raritan.com>
clocksource/drivers/timer-atmel-tcb: Fix initialization on SAM9 hardware
Jacky Bai <ping.bai(a)nxp.com>
clocksource/drivers/timer-imx-gpt: Fix potential memory leak
Shuai Xue <xueshuai(a)linux.alibaba.com>
perf/core: Bail out early if the request AUX area is out of bound
John Stultz <jstultz(a)google.com>
locking/ww_mutex/test: Fix potential workqueue corruption
-------------
Diffstat:
Makefile | 4 +-
arch/arm/include/asm/exception.h | 4 --
arch/parisc/include/uapi/asm/pdc.h | 1 +
arch/parisc/kernel/entry.S | 7 ++--
arch/parisc/kernel/head.S | 5 +--
arch/x86/include/asm/msr-index.h | 1 +
arch/x86/include/asm/numa.h | 7 ----
arch/x86/kvm/x86.c | 2 +
arch/x86/mm/numa.c | 7 ----
crypto/pcrypt.c | 4 ++
drivers/atm/iphase.c | 20 +++++-----
drivers/clk/qcom/gcc-ipq8074.c | 6 ---
drivers/clocksource/tcb_clksrc.c | 1 +
drivers/clocksource/timer-imx-gpt.c | 18 ++++++---
drivers/dma/stm32-mdma.c | 4 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 1 +
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 6 +++
drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 4 +-
drivers/gpu/drm/amd/include/pptable.h | 4 +-
drivers/gpu/drm/amd/powerplay/hwmgr/pptable_v1_0.h | 16 ++++----
drivers/hid/hid-ids.h | 1 +
drivers/hid/hid-quirks.c | 1 +
drivers/i2c/busses/i2c-i801.c | 19 +++++----
drivers/i2c/busses/i2c-sun6i-p2wi.c | 5 +++
drivers/infiniband/hw/hfi1/pcie.c | 9 +----
drivers/mcb/mcb-core.c | 1 +
drivers/mcb/mcb-parse.c | 2 +-
drivers/media/platform/qcom/venus/hfi_msgs.c | 2 +-
drivers/media/platform/qcom/venus/hfi_parser.c | 15 ++++++++
drivers/media/platform/qcom/venus/hfi_venus.c | 10 +++++
drivers/media/platform/vivid/vivid-rds-gen.c | 2 +-
drivers/media/rc/ir-sharp-decoder.c | 8 ++--
drivers/media/rc/lirc_dev.c | 6 ++-
drivers/media/usb/gspca/cpia1.c | 3 ++
drivers/mmc/host/meson-gx-mmc.c | 1 -
drivers/mmc/host/vub300.c | 1 +
drivers/net/dsa/lan9303_mdio.c | 4 +-
drivers/net/ethernet/cortina/gemini.c | 45 ++++++++++++++--------
drivers/net/ethernet/cortina/gemini.h | 4 +-
drivers/net/ethernet/realtek/r8169_main.c | 4 +-
drivers/net/ipvlan/ipvlan_core.c | 41 ++++++++++++--------
drivers/net/macvlan.c | 2 +-
drivers/net/ppp/ppp_synctty.c | 6 ++-
drivers/net/wireless/ath/ath10k/debug.c | 2 +-
drivers/net/wireless/ath/ath9k/debug.c | 2 +-
drivers/net/wireless/ath/ath9k/htc_drv_debug.c | 2 +-
drivers/pci/controller/dwc/pci-keystone.c | 8 ++--
drivers/pci/pci-acpi.c | 2 +-
drivers/pci/pci-sysfs.c | 5 +--
drivers/platform/x86/thinkpad_acpi.c | 1 +
drivers/ptp/ptp_chardev.c | 3 +-
drivers/ptp/ptp_clock.c | 5 ++-
drivers/ptp/ptp_private.h | 8 +++-
drivers/ptp/ptp_sysfs.c | 3 +-
drivers/scsi/libfc/fc_lport.c | 6 +++
drivers/scsi/virtio_scsi.c | 1 +
drivers/tty/hvc/hvc_xen.c | 5 ++-
drivers/tty/serial/meson_uart.c | 44 ++++++++++++++++-----
drivers/tty/vcc.c | 16 ++++++--
drivers/usb/gadget/function/f_ncm.c | 27 ++++++-------
drivers/xen/events/events_base.c | 4 +-
fs/cifs/cifs_spnego.c | 4 +-
fs/ext4/acl.h | 5 +++
fs/ext4/resize.c | 19 ++++-----
fs/gfs2/quota.c | 11 ++++++
fs/iomap.c | 3 ++
fs/jbd2/recovery.c | 8 ++++
fs/jfs/jfs_dmap.c | 23 ++++++++---
fs/jfs/jfs_imap.c | 5 ++-
fs/nfs/nfs4proc.c | 5 ++-
fs/quota/dquot.c | 14 +++++++
include/linux/pwm.h | 4 +-
include/net/sock.h | 26 +++++++++----
kernel/audit_watch.c | 9 ++++-
kernel/events/ring_buffer.c | 6 +++
kernel/irq/generic-chip.c | 25 +++++++++---
kernel/locking/test-ww_mutex.c | 20 ++++++----
kernel/padata.c | 2 +-
kernel/power/snapshot.c | 16 ++++----
net/bluetooth/hci_conn.c | 6 +--
net/bluetooth/hci_sysfs.c | 23 +++++------
net/core/sock.c | 2 +-
net/ipv4/tcp_output.c | 2 +-
net/mac80211/cfg.c | 4 ++
net/sched/sch_api.c | 5 ++-
net/tipc/netlink_compat.c | 1 +
scripts/gcc-plugins/randomize_layout_plugin.c | 11 ++++--
sound/core/info.c | 21 ++++++----
sound/hda/hdac_stream.c | 6 ++-
sound/pci/hda/patch_realtek.c | 1 +
tools/testing/selftests/efivarfs/create-read.c | 2 +
91 files changed, 482 insertions(+), 265 deletions(-)
Non-KMS drivers have been removed from DRM. Update the TODO list
accordingly.
Signed-off-by: Thomas Zimmermann <tzimmermann(a)suse.de>
Fixes: a276afc19eec ("drm: Remove some obsolete drm pciids(tdfx, mga, i810, savage, r128, sis, via)")
Cc: Cai Huoqing <cai.huoqing(a)linux.dev>
Cc: Daniel Vetter <daniel.vetter(a)ffwll.ch>
Cc: Dave Airlie <airlied(a)redhat.com>
Cc: Thomas Zimmermann <tzimmermann(a)suse.de>
Cc: Maarten Lankhorst <maarten.lankhorst(a)linux.intel.com>
Cc: Maxime Ripard <mripard(a)kernel.org>
Cc: David Airlie <airlied(a)gmail.com>
Cc: Daniel Vetter <daniel(a)ffwll.ch>
Cc: Jonathan Corbet <corbet(a)lwn.net>
Cc: dri-devel(a)lists.freedesktop.org
Cc: <stable(a)vger.kernel.org> # v6.3+
Cc: linux-doc(a)vger.kernel.org
---
Documentation/gpu/todo.rst | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
index b62c7fa0c2bcc..3bdb8787960be 100644
--- a/Documentation/gpu/todo.rst
+++ b/Documentation/gpu/todo.rst
@@ -337,8 +337,8 @@ connector register/unregister fixes
Level: Intermediate
-Remove load/unload callbacks from all non-DRIVER_LEGACY drivers
----------------------------------------------------------------
+Remove load/unload callbacks
+----------------------------
The load/unload callbacks in struct &drm_driver are very much midlayers, plus
for historical reasons they get the ordering wrong (and we can't fix that)
@@ -347,8 +347,7 @@ between setting up the &drm_driver structure and calling drm_dev_register().
- Rework drivers to no longer use the load/unload callbacks, directly coding the
load/unload sequence into the driver's probe function.
-- Once all non-DRIVER_LEGACY drivers are converted, disallow the load/unload
- callbacks for all modern drivers.
+- Once all drivers are converted, remove the load/unload callbacks.
Contact: Daniel Vetter
--
2.42.1
The acpi_video code was storing the acpi_video_device as driver-data
in the acpi_device children of the acpi_video_bus acpi_device.
But the acpi_video driver only binds to the bus acpi_device.
It uses, but does not bind to, the children. Since it is not
the driver it should not be using the driver_data of the children's
acpi_device-s.
Since commit 0d16710146a1 ("ACPI: bus: Set driver_data to NULL every
time .add() fails") the childen's driver_data ends up getting set
to NULL after a driver fails to bind to the children leading to a NULL
pointer deref in video_get_max_state when registering the cooling-dev:
[ 3.148958] BUG: kernel NULL pointer dereference, address: 0000000000000090
<snip>
[ 3.149015] Hardware name: Sony Corporation VPCSB2X9R/VAIO, BIOS R2087H4 06/15/2012
[ 3.149021] RIP: 0010:video_get_max_state+0x17/0x30 [video]
<snip>
[ 3.149105] Call Trace:
[ 3.149110] <TASK>
[ 3.149114] ? __die+0x23/0x70
[ 3.149126] ? page_fault_oops+0x171/0x4e0
[ 3.149137] ? exc_page_fault+0x7f/0x180
[ 3.149147] ? asm_exc_page_fault+0x26/0x30
[ 3.149158] ? video_get_max_state+0x17/0x30 [video 9b6f3f0d19d7b4a0e2df17a2d8b43bc19c2ed71f]
[ 3.149176] ? __pfx_video_get_max_state+0x10/0x10 [video 9b6f3f0d19d7b4a0e2df17a2d8b43bc19c2ed71f]
[ 3.149192] __thermal_cooling_device_register.part.0+0xf2/0x2f0
[ 3.149205] acpi_video_bus_register_backlight.part.0.isra.0+0x414/0x570 [video 9b6f3f0d19d7b4a0e2df17a2d8b43bc19c2ed71f]
[ 3.149227] acpi_video_register_backlight+0x57/0x80 [video 9b6f3f0d19d7b4a0e2df17a2d8b43bc19c2ed71f]
[ 3.149245] intel_acpi_video_register+0x68/0x90 [i915 1f3a758130b32ef13d301d4f8f78c7d766d57f2a]
[ 3.149669] intel_display_driver_register+0x28/0x50 [i915 1f3a758130b32ef13d301d4f8f78c7d766d57f2a]
[ 3.150064] i915_driver_probe+0x790/0xb90 [i915 1f3a758130b32ef13d301d4f8f78c7d766d57f2a]
[ 3.150402] local_pci_probe+0x45/0xa0
[ 3.150412] pci_device_probe+0xc1/0x260
<snip>
Fix this by directly using the acpi_video_device as devdata for
the cooling-device, which avoids the need to set driver-data on
the children at all.
Fixes: 0d16710146a1 ("ACPI: bus: Set driver_data to NULL every time .add() fails")
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/9718
Cc: Michal Wilczynski <michal.wilczynski(a)intel.com>
Cc: 6.6+ <stable(a)vger.kernel.org> # 6.6+
Signed-off-by: Hans de Goede <hdegoede(a)redhat.com>
---
drivers/acpi/acpi_video.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c
index 5eded14f8853..7cd91e85c62a 100644
--- a/drivers/acpi/acpi_video.c
+++ b/drivers/acpi/acpi_video.c
@@ -253,8 +253,7 @@ static const struct backlight_ops acpi_backlight_ops = {
static int video_get_max_state(struct thermal_cooling_device *cooling_dev,
unsigned long *state)
{
- struct acpi_device *device = cooling_dev->devdata;
- struct acpi_video_device *video = acpi_driver_data(device);
+ struct acpi_video_device *video = cooling_dev->devdata;
*state = video->brightness->count - ACPI_VIDEO_FIRST_LEVEL - 1;
return 0;
@@ -263,8 +262,7 @@ static int video_get_max_state(struct thermal_cooling_device *cooling_dev,
static int video_get_cur_state(struct thermal_cooling_device *cooling_dev,
unsigned long *state)
{
- struct acpi_device *device = cooling_dev->devdata;
- struct acpi_video_device *video = acpi_driver_data(device);
+ struct acpi_video_device *video = cooling_dev->devdata;
unsigned long long level;
int offset;
@@ -283,8 +281,7 @@ static int video_get_cur_state(struct thermal_cooling_device *cooling_dev,
static int
video_set_cur_state(struct thermal_cooling_device *cooling_dev, unsigned long state)
{
- struct acpi_device *device = cooling_dev->devdata;
- struct acpi_video_device *video = acpi_driver_data(device);
+ struct acpi_video_device *video = cooling_dev->devdata;
int level;
if (state >= video->brightness->count - ACPI_VIDEO_FIRST_LEVEL)
@@ -1125,7 +1122,6 @@ static int acpi_video_bus_get_one_device(struct acpi_device *device, void *arg)
strcpy(acpi_device_name(device), ACPI_VIDEO_DEVICE_NAME);
strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS);
- device->driver_data = data;
data->device_id = device_id;
data->video = video;
@@ -1747,8 +1743,8 @@ static void acpi_video_dev_register_backlight(struct acpi_video_device *device)
device->backlight->props.brightness =
acpi_video_get_brightness(device->backlight);
- device->cooling_dev = thermal_cooling_device_register("LCD",
- device->dev, &video_cooling_ops);
+ device->cooling_dev = thermal_cooling_device_register("LCD", device,
+ &video_cooling_ops);
if (IS_ERR(device->cooling_dev)) {
/*
* Set cooling_dev to NULL so we don't crash trying to free it.
--
2.43.0
In "r8169_phylink_handler", for rtl8125, it will call "rtl_reset_work"->
"rtl_hw_start"->"rtl_jumbo_config"->"phy_start_aneg". When call
"r8169_phylink_handler", PHY lock is acquired. But "phy_start_aneg"
will also try to acquire PHY lock. That will cause deadlock.
In this path, use "_phy_start_aneg", unlocked version "phy_start_aneg",
to prevent deadlock in "r8169_phylink_handler".
Fixes: 453a77894efa ("r8169: don't advertise pause in jumbo mode")
Cc: stable(a)vger.kernel.org
Signed-off-by: ChunHao Lin <hau(a)realtek.com>
---
drivers/net/ethernet/realtek/r8169_main.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index 473b3245754f..2e3e42a98edd 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -2415,11 +2415,22 @@ static void rtl_jumbo_config(struct rtl8169_private *tp)
/* Chip doesn't support pause in jumbo mode */
if (jumbo) {
+ int lock;
+
linkmode_clear_bit(ETHTOOL_LINK_MODE_Pause_BIT,
tp->phydev->advertising);
linkmode_clear_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
tp->phydev->advertising);
- phy_start_aneg(tp->phydev);
+
+ if (!mutex_trylock(&tp->phydev->lock))
+ lock = 0;
+ else
+ lock = 1;
+
+ _phy_start_aneg(tp->phydev);
+
+ if (lock)
+ mutex_unlock(&tp->phydev->lock);
}
}
--
2.39.2
The patch titled
Subject: scripts/gdb/tasks: fix lx-ps command error
has been added to the -mm mm-hotfixes-unstable branch. Its filename is
scripts-gdb-tasks-fix-lx-ps-command-error.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patche…
This patch will later appear in the mm-hotfixes-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: Kuan-Ying Lee <Kuan-Ying.Lee(a)mediatek.com>
Subject: scripts/gdb/tasks: fix lx-ps command error
Date: Mon, 27 Nov 2023 15:04:01 +0800
Since commit 8e1f385104ac ("kill task_struct->thread_group") remove
the thread_group, we will encounter below issue.
(gdb) lx-ps
TASK PID COMM
0xffff800086503340 0 swapper/0
Python Exception <class 'gdb.error'>: There is no member named thread_group.
Error occurred in Python: There is no member named thread_group.
We use signal->thread_head to iterate all threads instead.
Link: https://lkml.kernel.org/r/20231127070404.4192-2-Kuan-Ying.Lee@mediatek.com
Fixes: 8e1f385104ac ("kill task_struct->thread_group")
Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee(a)mediatek.com>
Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno(a)collabora.com>
Cc: Chinwen Chang <chinwen.chang(a)mediatek.com>
Cc: Kuan-Ying Lee <Kuan-Ying.Lee(a)mediatek.com>
Cc: Matthias Brugger <matthias.bgg(a)gmail.com>
Cc: Qun-Wei Lin <qun-wei.lin(a)mediatek.com>
Cc: Oleg Nesterov <oleg(a)redhat.com>
Cc: <stable(a)vger.kernel.org>
Cc: Andrey Konovalov <andreyknvl(a)google.com>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
---
scripts/gdb/linux/tasks.py | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
--- a/scripts/gdb/linux/tasks.py~scripts-gdb-tasks-fix-lx-ps-command-error
+++ a/scripts/gdb/linux/tasks.py
@@ -13,7 +13,7 @@
import gdb
-from linux import utils
+from linux import utils, lists
task_type = utils.CachedType("struct task_struct")
@@ -25,13 +25,9 @@ def task_lists():
t = g = init_task
while True:
- while True:
- yield t
-
- t = utils.container_of(t['thread_group']['next'],
- task_ptr_type, "thread_group")
- if t == g:
- break
+ thread_head = t['signal']['thread_head']
+ for thread in lists.list_for_each_entry(thread_head, task_ptr_type, 'thread_node'):
+ yield thread
t = g = utils.container_of(g['tasks']['next'],
task_ptr_type, "tasks")
_
Patches currently in -mm which might be from Kuan-Ying.Lee(a)mediatek.com are
scripts-gdb-tasks-fix-lx-ps-command-error.patch
scripts-gdb-stackdepot-rename-pool_index_cached-to-pools_num.patch
scripts-gdb-remove-exception-handling-and-refine-print-format.patch
The patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
git checkout FETCH_HEAD
git cherry-pick -x b022f0c7e404887a7c5229788fc99eff9f9a80d5
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023102127-unbeaten-sandlot-da45@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From b022f0c7e404887a7c5229788fc99eff9f9a80d5 Mon Sep 17 00:00:00 2001
From: Francis Laniel <flaniel(a)linux.microsoft.com>
Date: Fri, 20 Oct 2023 13:42:49 +0300
Subject: [PATCH] tracing/kprobes: Return EADDRNOTAVAIL when func matches
several symbols
When a kprobe is attached to a function that's name is not unique (is
static and shares the name with other functions in the kernel), the
kprobe is attached to the first function it finds. This is a bug as the
function that it is attaching to is not necessarily the one that the
user wants to attach to.
Instead of blindly picking a function to attach to what is ambiguous,
error with EADDRNOTAVAIL to let the user know that this function is not
unique, and that the user must use another unique function with an
address offset to get to the function they want to attach to.
Link: https://lore.kernel.org/all/20231020104250.9537-2-flaniel@linux.microsoft.c…
Cc: stable(a)vger.kernel.org
Fixes: 413d37d1eb69 ("tracing: Add kprobe-based event tracer")
Suggested-by: Masami Hiramatsu <mhiramat(a)kernel.org>
Signed-off-by: Francis Laniel <flaniel(a)linux.microsoft.com>
Link: https://lore.kernel.org/lkml/20230819101105.b0c104ae4494a7d1f2eea742@kernel…
Acked-by: Masami Hiramatsu (Google) <mhiramat(a)kernel.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat(a)kernel.org>
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index 3d7a180a8427..a8fef6ab0872 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -705,6 +705,25 @@ static struct notifier_block trace_kprobe_module_nb = {
.priority = 1 /* Invoked after kprobe module callback */
};
+static int count_symbols(void *data, unsigned long unused)
+{
+ unsigned int *count = data;
+
+ (*count)++;
+
+ return 0;
+}
+
+static unsigned int number_of_same_symbols(char *func_name)
+{
+ unsigned int count;
+
+ count = 0;
+ kallsyms_on_each_match_symbol(count_symbols, func_name, &count);
+
+ return count;
+}
+
static int __trace_kprobe_create(int argc, const char *argv[])
{
/*
@@ -836,6 +855,31 @@ static int __trace_kprobe_create(int argc, const char *argv[])
}
}
+ if (symbol && !strchr(symbol, ':')) {
+ unsigned int count;
+
+ count = number_of_same_symbols(symbol);
+ if (count > 1) {
+ /*
+ * Users should use ADDR to remove the ambiguity of
+ * using KSYM only.
+ */
+ trace_probe_log_err(0, NON_UNIQ_SYMBOL);
+ ret = -EADDRNOTAVAIL;
+
+ goto error;
+ } else if (count == 0) {
+ /*
+ * We can return ENOENT earlier than when register the
+ * kprobe.
+ */
+ trace_probe_log_err(0, BAD_PROBE_ADDR);
+ ret = -ENOENT;
+
+ goto error;
+ }
+ }
+
trace_probe_log_set_index(0);
if (event) {
ret = traceprobe_parse_event_name(&event, &group, gbuf,
@@ -1695,6 +1739,7 @@ static int unregister_kprobe_event(struct trace_kprobe *tk)
}
#ifdef CONFIG_PERF_EVENTS
+
/* create a trace_kprobe, but don't add it to global lists */
struct trace_event_call *
create_local_trace_kprobe(char *func, void *addr, unsigned long offs,
@@ -1705,6 +1750,24 @@ create_local_trace_kprobe(char *func, void *addr, unsigned long offs,
int ret;
char *event;
+ if (func) {
+ unsigned int count;
+
+ count = number_of_same_symbols(func);
+ if (count > 1)
+ /*
+ * Users should use addr to remove the ambiguity of
+ * using func only.
+ */
+ return ERR_PTR(-EADDRNOTAVAIL);
+ else if (count == 0)
+ /*
+ * We can return ENOENT earlier than when register the
+ * kprobe.
+ */
+ return ERR_PTR(-ENOENT);
+ }
+
/*
* local trace_kprobes are not added to dyn_event, so they are never
* searched in find_trace_kprobe(). Therefore, there is no concern of
diff --git a/kernel/trace/trace_probe.h b/kernel/trace/trace_probe.h
index 02b432ae7513..850d9ecb6765 100644
--- a/kernel/trace/trace_probe.h
+++ b/kernel/trace/trace_probe.h
@@ -450,6 +450,7 @@ extern int traceprobe_define_arg_fields(struct trace_event_call *event_call,
C(BAD_MAXACT, "Invalid maxactive number"), \
C(MAXACT_TOO_BIG, "Maxactive is too big"), \
C(BAD_PROBE_ADDR, "Invalid probed address or symbol"), \
+ C(NON_UNIQ_SYMBOL, "The symbol is not unique"), \
C(BAD_RETPROBE, "Retprobe address must be an function entry"), \
C(NO_TRACEPOINT, "Tracepoint is not found"), \
C(BAD_ADDR_SUFFIX, "Invalid probed address suffix"), \
The patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x b022f0c7e404887a7c5229788fc99eff9f9a80d5
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023102135-shuffle-blank-783e@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From b022f0c7e404887a7c5229788fc99eff9f9a80d5 Mon Sep 17 00:00:00 2001
From: Francis Laniel <flaniel(a)linux.microsoft.com>
Date: Fri, 20 Oct 2023 13:42:49 +0300
Subject: [PATCH] tracing/kprobes: Return EADDRNOTAVAIL when func matches
several symbols
When a kprobe is attached to a function that's name is not unique (is
static and shares the name with other functions in the kernel), the
kprobe is attached to the first function it finds. This is a bug as the
function that it is attaching to is not necessarily the one that the
user wants to attach to.
Instead of blindly picking a function to attach to what is ambiguous,
error with EADDRNOTAVAIL to let the user know that this function is not
unique, and that the user must use another unique function with an
address offset to get to the function they want to attach to.
Link: https://lore.kernel.org/all/20231020104250.9537-2-flaniel@linux.microsoft.c…
Cc: stable(a)vger.kernel.org
Fixes: 413d37d1eb69 ("tracing: Add kprobe-based event tracer")
Suggested-by: Masami Hiramatsu <mhiramat(a)kernel.org>
Signed-off-by: Francis Laniel <flaniel(a)linux.microsoft.com>
Link: https://lore.kernel.org/lkml/20230819101105.b0c104ae4494a7d1f2eea742@kernel…
Acked-by: Masami Hiramatsu (Google) <mhiramat(a)kernel.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat(a)kernel.org>
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index 3d7a180a8427..a8fef6ab0872 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -705,6 +705,25 @@ static struct notifier_block trace_kprobe_module_nb = {
.priority = 1 /* Invoked after kprobe module callback */
};
+static int count_symbols(void *data, unsigned long unused)
+{
+ unsigned int *count = data;
+
+ (*count)++;
+
+ return 0;
+}
+
+static unsigned int number_of_same_symbols(char *func_name)
+{
+ unsigned int count;
+
+ count = 0;
+ kallsyms_on_each_match_symbol(count_symbols, func_name, &count);
+
+ return count;
+}
+
static int __trace_kprobe_create(int argc, const char *argv[])
{
/*
@@ -836,6 +855,31 @@ static int __trace_kprobe_create(int argc, const char *argv[])
}
}
+ if (symbol && !strchr(symbol, ':')) {
+ unsigned int count;
+
+ count = number_of_same_symbols(symbol);
+ if (count > 1) {
+ /*
+ * Users should use ADDR to remove the ambiguity of
+ * using KSYM only.
+ */
+ trace_probe_log_err(0, NON_UNIQ_SYMBOL);
+ ret = -EADDRNOTAVAIL;
+
+ goto error;
+ } else if (count == 0) {
+ /*
+ * We can return ENOENT earlier than when register the
+ * kprobe.
+ */
+ trace_probe_log_err(0, BAD_PROBE_ADDR);
+ ret = -ENOENT;
+
+ goto error;
+ }
+ }
+
trace_probe_log_set_index(0);
if (event) {
ret = traceprobe_parse_event_name(&event, &group, gbuf,
@@ -1695,6 +1739,7 @@ static int unregister_kprobe_event(struct trace_kprobe *tk)
}
#ifdef CONFIG_PERF_EVENTS
+
/* create a trace_kprobe, but don't add it to global lists */
struct trace_event_call *
create_local_trace_kprobe(char *func, void *addr, unsigned long offs,
@@ -1705,6 +1750,24 @@ create_local_trace_kprobe(char *func, void *addr, unsigned long offs,
int ret;
char *event;
+ if (func) {
+ unsigned int count;
+
+ count = number_of_same_symbols(func);
+ if (count > 1)
+ /*
+ * Users should use addr to remove the ambiguity of
+ * using func only.
+ */
+ return ERR_PTR(-EADDRNOTAVAIL);
+ else if (count == 0)
+ /*
+ * We can return ENOENT earlier than when register the
+ * kprobe.
+ */
+ return ERR_PTR(-ENOENT);
+ }
+
/*
* local trace_kprobes are not added to dyn_event, so they are never
* searched in find_trace_kprobe(). Therefore, there is no concern of
diff --git a/kernel/trace/trace_probe.h b/kernel/trace/trace_probe.h
index 02b432ae7513..850d9ecb6765 100644
--- a/kernel/trace/trace_probe.h
+++ b/kernel/trace/trace_probe.h
@@ -450,6 +450,7 @@ extern int traceprobe_define_arg_fields(struct trace_event_call *event_call,
C(BAD_MAXACT, "Invalid maxactive number"), \
C(MAXACT_TOO_BIG, "Maxactive is too big"), \
C(BAD_PROBE_ADDR, "Invalid probed address or symbol"), \
+ C(NON_UNIQ_SYMBOL, "The symbol is not unique"), \
C(BAD_RETPROBE, "Retprobe address must be an function entry"), \
C(NO_TRACEPOINT, "Tracepoint is not found"), \
C(BAD_ADDR_SUFFIX, "Invalid probed address suffix"), \
The patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.4.y
git checkout FETCH_HEAD
git cherry-pick -x b022f0c7e404887a7c5229788fc99eff9f9a80d5
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023102137-mobster-sheath-bfb3@gregkh' --subject-prefix 'PATCH 5.4.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From b022f0c7e404887a7c5229788fc99eff9f9a80d5 Mon Sep 17 00:00:00 2001
From: Francis Laniel <flaniel(a)linux.microsoft.com>
Date: Fri, 20 Oct 2023 13:42:49 +0300
Subject: [PATCH] tracing/kprobes: Return EADDRNOTAVAIL when func matches
several symbols
When a kprobe is attached to a function that's name is not unique (is
static and shares the name with other functions in the kernel), the
kprobe is attached to the first function it finds. This is a bug as the
function that it is attaching to is not necessarily the one that the
user wants to attach to.
Instead of blindly picking a function to attach to what is ambiguous,
error with EADDRNOTAVAIL to let the user know that this function is not
unique, and that the user must use another unique function with an
address offset to get to the function they want to attach to.
Link: https://lore.kernel.org/all/20231020104250.9537-2-flaniel@linux.microsoft.c…
Cc: stable(a)vger.kernel.org
Fixes: 413d37d1eb69 ("tracing: Add kprobe-based event tracer")
Suggested-by: Masami Hiramatsu <mhiramat(a)kernel.org>
Signed-off-by: Francis Laniel <flaniel(a)linux.microsoft.com>
Link: https://lore.kernel.org/lkml/20230819101105.b0c104ae4494a7d1f2eea742@kernel…
Acked-by: Masami Hiramatsu (Google) <mhiramat(a)kernel.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat(a)kernel.org>
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index 3d7a180a8427..a8fef6ab0872 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -705,6 +705,25 @@ static struct notifier_block trace_kprobe_module_nb = {
.priority = 1 /* Invoked after kprobe module callback */
};
+static int count_symbols(void *data, unsigned long unused)
+{
+ unsigned int *count = data;
+
+ (*count)++;
+
+ return 0;
+}
+
+static unsigned int number_of_same_symbols(char *func_name)
+{
+ unsigned int count;
+
+ count = 0;
+ kallsyms_on_each_match_symbol(count_symbols, func_name, &count);
+
+ return count;
+}
+
static int __trace_kprobe_create(int argc, const char *argv[])
{
/*
@@ -836,6 +855,31 @@ static int __trace_kprobe_create(int argc, const char *argv[])
}
}
+ if (symbol && !strchr(symbol, ':')) {
+ unsigned int count;
+
+ count = number_of_same_symbols(symbol);
+ if (count > 1) {
+ /*
+ * Users should use ADDR to remove the ambiguity of
+ * using KSYM only.
+ */
+ trace_probe_log_err(0, NON_UNIQ_SYMBOL);
+ ret = -EADDRNOTAVAIL;
+
+ goto error;
+ } else if (count == 0) {
+ /*
+ * We can return ENOENT earlier than when register the
+ * kprobe.
+ */
+ trace_probe_log_err(0, BAD_PROBE_ADDR);
+ ret = -ENOENT;
+
+ goto error;
+ }
+ }
+
trace_probe_log_set_index(0);
if (event) {
ret = traceprobe_parse_event_name(&event, &group, gbuf,
@@ -1695,6 +1739,7 @@ static int unregister_kprobe_event(struct trace_kprobe *tk)
}
#ifdef CONFIG_PERF_EVENTS
+
/* create a trace_kprobe, but don't add it to global lists */
struct trace_event_call *
create_local_trace_kprobe(char *func, void *addr, unsigned long offs,
@@ -1705,6 +1750,24 @@ create_local_trace_kprobe(char *func, void *addr, unsigned long offs,
int ret;
char *event;
+ if (func) {
+ unsigned int count;
+
+ count = number_of_same_symbols(func);
+ if (count > 1)
+ /*
+ * Users should use addr to remove the ambiguity of
+ * using func only.
+ */
+ return ERR_PTR(-EADDRNOTAVAIL);
+ else if (count == 0)
+ /*
+ * We can return ENOENT earlier than when register the
+ * kprobe.
+ */
+ return ERR_PTR(-ENOENT);
+ }
+
/*
* local trace_kprobes are not added to dyn_event, so they are never
* searched in find_trace_kprobe(). Therefore, there is no concern of
diff --git a/kernel/trace/trace_probe.h b/kernel/trace/trace_probe.h
index 02b432ae7513..850d9ecb6765 100644
--- a/kernel/trace/trace_probe.h
+++ b/kernel/trace/trace_probe.h
@@ -450,6 +450,7 @@ extern int traceprobe_define_arg_fields(struct trace_event_call *event_call,
C(BAD_MAXACT, "Invalid maxactive number"), \
C(MAXACT_TOO_BIG, "Maxactive is too big"), \
C(BAD_PROBE_ADDR, "Invalid probed address or symbol"), \
+ C(NON_UNIQ_SYMBOL, "The symbol is not unique"), \
C(BAD_RETPROBE, "Retprobe address must be an function entry"), \
C(NO_TRACEPOINT, "Tracepoint is not found"), \
C(BAD_ADDR_SUFFIX, "Invalid probed address suffix"), \
Hi,
We provide estimation & quantities takeoff services. We are providing 98-100 accuracy in our estimates and take-offs. Please tell us if you need any estimating services regarding your projects.
Send over the plans and mention the exact scope of work and shortly we will get back with a proposal on which our charges and turnaround time will be mentioned
You may ask for sample estimates and take-offs. Thanks.
Kind Regards
Callahan Bryson
Dreamland Estimation, LLC
Like other ASUS models the Asus Vivobook E1504FA requires an entry in
the quirk list to enable the internal microphone.
Showing
with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions 7
sound/soc/amd/yc/acp6x-mach.c
@@ -283,6 +283,13 @@ static const struct dmi_system_id
yc_acp_quirk_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "M6500RC"),
}
},
{
.driver_data = &acp6x_card,
.matches = {
DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER
INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "E1504FA"),
}
},
{
I have this laptop and I have tested this patch successfully.
Malcolm
The patch below does not apply to the 6.5-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.5.y
git checkout FETCH_HEAD
git cherry-pick -x 793838138c157d4c49f4fb744b170747e3dabf58
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112456-linked-nape-bf19@gregkh' --subject-prefix 'PATCH 6.5.y' HEAD^..
Possible dependencies:
793838138c15 ("prctl: Disable prctl(PR_SET_MDWE) on parisc")
24e41bf8a6b4 ("mm: add a NO_INHERIT flag to the PR_SET_MDWE prctl")
0da668333fb0 ("mm: make PR_MDWE_REFUSE_EXEC_GAIN an unsigned long")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 793838138c157d4c49f4fb744b170747e3dabf58 Mon Sep 17 00:00:00 2001
From: Helge Deller <deller(a)gmx.de>
Date: Sat, 18 Nov 2023 19:33:35 +0100
Subject: [PATCH] prctl: Disable prctl(PR_SET_MDWE) on parisc
systemd-254 tries to use prctl(PR_SET_MDWE) for it's MemoryDenyWriteExecute
functionality, but fails on parisc which still needs executable stacks in
certain combinations of gcc/glibc/kernel.
Disable prctl(PR_SET_MDWE) by returning -EINVAL for now on parisc, until
userspace has catched up.
Signed-off-by: Helge Deller <deller(a)gmx.de>
Co-developed-by: Linus Torvalds <torvalds(a)linux-foundation.org>
Reported-by: Sam James <sam(a)gentoo.org>
Closes: https://github.com/systemd/systemd/issues/29775
Tested-by: Sam James <sam(a)gentoo.org>
Link: https://lore.kernel.org/all/875y2jro9a.fsf@gentoo.org/
Cc: <stable(a)vger.kernel.org> # v6.3+
diff --git a/kernel/sys.c b/kernel/sys.c
index 420d9cb9cc8e..e219fcfa112d 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -2394,6 +2394,10 @@ static inline int prctl_set_mdwe(unsigned long bits, unsigned long arg3,
if (bits & PR_MDWE_NO_INHERIT && !(bits & PR_MDWE_REFUSE_EXEC_GAIN))
return -EINVAL;
+ /* PARISC cannot allow mdwe as it needs writable stacks */
+ if (IS_ENABLED(CONFIG_PARISC))
+ return -EINVAL;
+
current_bits = get_current_mdwe();
if (current_bits && current_bits != bits)
return -EPERM; /* Cannot unset the flags */
Invoke drm_plane_helper_funcs.end_fb_access before
drm_atomic_helper_commit_hw_done(). The latter function hands over
ownership of the plane state to the following commit, which might
free it. Releasing resources in end_fb_access then operates on undefined
state. This bug has been observed with non-blocking commits when they
are being queued up quickly.
Here is an example stack trace from the bug report. The plane state has
been free'd already, so the pages for drm_gem_fb_vunmap() are gone.
Unable to handle kernel paging request at virtual address 0000000100000049
[...]
drm_gem_fb_vunmap+0x18/0x74
drm_gem_end_shadow_fb_access+0x1c/0x2c
drm_atomic_helper_cleanup_planes+0x58/0xd8
drm_atomic_helper_commit_tail+0x90/0xa0
commit_tail+0x15c/0x188
commit_work+0x14/0x20
For aborted commits, it is still ok to run end_fb_access as part of the
plane's cleanup. Add a test to drm_atomic_helper_cleanup_planes().
Reported-by: Alyssa Ross <hi(a)alyssa.is>
Closes: https://lore.kernel.org/dri-devel/87leazm0ya.fsf@alyssa.is/
Suggested-by: Daniel Vetter <daniel(a)ffwll.ch>
Fixes: 94d879eaf7fb ("drm/atomic-helper: Add {begin,end}_fb_access to plane helpers")
Signed-off-by: Thomas Zimmermann <tzimmermann(a)suse.de>
Cc: <stable(a)vger.kernel.org> # v6.2+
---
drivers/gpu/drm/drm_atomic_helper.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index c3f677130def0..08d0511405e90 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -2784,6 +2784,17 @@ void drm_atomic_helper_commit_planes(struct drm_device *dev,
funcs->atomic_flush(crtc, old_state);
}
+
+ /*
+ * Signal end of framebuffer access here before hw_done. After hw_done,
+ * a later commit might have already released the plane state.
+ */
+ for_each_oldnew_plane_in_state(old_state, plane, old_plane_state, new_plane_state, i) {
+ const struct drm_plane_helper_funcs *funcs = plane->helper_private;
+
+ if (funcs->end_fb_access)
+ funcs->end_fb_access(plane, new_plane_state);
+ }
}
EXPORT_SYMBOL(drm_atomic_helper_commit_planes);
@@ -2924,6 +2935,12 @@ void drm_atomic_helper_cleanup_planes(struct drm_device *dev,
for_each_oldnew_plane_in_state(old_state, plane, old_plane_state, new_plane_state, i) {
const struct drm_plane_helper_funcs *funcs = plane->helper_private;
+ /*
+ * Only clean up here if we're aborting the commit.
+ */
+ if (new_plane_state == plane->state)
+ continue;
+
if (funcs->end_fb_access)
funcs->end_fb_access(plane, new_plane_state);
}
--
2.42.1
The ttyname buffer for the ledtrig_tty_data struct is allocated in the
sysfs ttyname_store() function. This buffer must be released on trigger
deactivation. This was missing and is thus a memory leak.
While we are at it, the tty handler in the ledtrig_tty_data struct should
also be returned in case of the trigger deactivation call.
Cc: stable(a)vger.kernel.org
Fixes: fd4a641ac88f ("leds: trigger: implement a tty trigger")
Signed-off-by: Florian Eckert <fe(a)dev.tdt.de>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig(a)pengutronix.de>
---
v1 -> v2:
Add Cc: tag
v2 -> v3:
Add Reviewed-by and resend witout changes
drivers/leds/trigger/ledtrig-tty.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/leds/trigger/ledtrig-tty.c b/drivers/leds/trigger/ledtrig-tty.c
index 8ae0d2d284af..3e69a7bde928 100644
--- a/drivers/leds/trigger/ledtrig-tty.c
+++ b/drivers/leds/trigger/ledtrig-tty.c
@@ -168,6 +168,10 @@ static void ledtrig_tty_deactivate(struct led_classdev *led_cdev)
cancel_delayed_work_sync(&trigger_data->dwork);
+ kfree(trigger_data->ttyname);
+ tty_kref_put(trigger_data->tty);
+ trigger_data->tty = NULL;
+
kfree(trigger_data);
}
--
2.30.2
Two series lived in parallel for some time, which led to this situation:
- The nvmem-layout container is used for dynamic layouts
- We now expect fixed layouts to also use the nvmem-layout container but
this does not require any additional driver, the support is built-in the
nvmem core.
Ensure we don't refuse to probe for wrong reasons.
Fixes: 27f699e578b1 ("nvmem: core: add support for fixed cells *layout*")
Cc: stable(a)vger.kernel.org
Reported-by: Luca Ceresoli <luca.ceresoli(a)bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal(a)bootlin.com>
---
Please note this is a temporary fix as this piece of code is going to
disappear when the NVMEM layouts 'as devices' series gets in.
drivers/nvmem/core.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index bf42b7e826db..608b352a7d91 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -796,6 +796,12 @@ static struct nvmem_layout *nvmem_layout_get(struct nvmem_device *nvmem)
if (!layout_np)
return NULL;
+ /* Fixed layouts don't have a matching driver */
+ if (of_device_is_compatible(layout_np, "fixed-layout")) {
+ of_node_put(layout_np);
+ return NULL;
+ }
+
/*
* In case the nvmem device was built-in while the layout was built as a
* module, we shall manually request the layout driver loading otherwise
--
2.34.1
The power domain scaling setup for QCS404 and MSM8909 in
cpufreq-com-nvmem does not work correctly at the moment because the
genpd core ignores all the performance state votes that are specified in
the CPU OPP table. This happens because nothing in the driver makes the
genpd core aware that the power domains are actively being consumed by
the CPU.
Fix this by marking the devices as runtime active. Also mark the devices
to be in the "awake path" during system suspend so that performance
state votes necessary for the CPU are preserved during system suspend.
While all the patches in this series are needed for full functionality,
the cpufreq and pmdomain patches can be merged independently. There is
no compile-time dependency between those two.
Signed-off-by: Stephan Gerhold <stephan.gerhold(a)kernkonzept.com>
---
Changes in v3:
- Drop patches with MSM8909 definitions that were applied already
- Add extra patch to fix system suspend properly by using
device_set_awake_path() instead of dev_pm_syscore_device()
- Set GENPD_FLAG_ACTIVE_WAKEUP for rpmpd so that performance state votes
needed by the CPU are preserved during suspend
- Link to v2: https://lore.kernel.org/r/20231018-msm8909-cpufreq-v2-0-0962df95f654@kernko…
Changes in v2:
- Reword commit messages based on discussion with Uffe
- Use generic power domain name "perf" (Uffe)
- Fix pm_runtime error handling (Uffe)
- Add allocation cleanup patch as preparation
- Fix ordering of qcom,msm8909 compatible (Konrad)
- cpufreq-dt-platdev blocklist/dt-bindings patches were applied already
- Link to v1: https://lore.kernel.org/r/20230912-msm8909-cpufreq-v1-0-767ce66b544b@kernko…
---
Stephan Gerhold (3):
cpufreq: qcom-nvmem: Enable virtual power domain devices
cpufreq: qcom-nvmem: Preserve PM domain votes in system suspend
pmdomain: qcom: rpmpd: Set GENPD_FLAG_ACTIVE_WAKEUP
drivers/cpufreq/qcom-cpufreq-nvmem.c | 73 ++++++++++++++++++++++++++++++++++--
drivers/pmdomain/qcom/rpmpd.c | 1 +
2 files changed, 71 insertions(+), 3 deletions(-)
---
base-commit: b85ea95d086471afb4ad062012a4d73cd328fa86
change-id: 20230906-msm8909-cpufreq-dff238de9ff3
Best regards,
--
Stephan Gerhold <stephan.gerhold(a)kernkonzept.com>
Kernkonzept GmbH at Dresden, Germany, HRB 31129, CEO Dr.-Ing. Michael Hohmuth
In https://github.com/szabgab/perlmaven.com/issues/583 we see to find
the simple answer to "What printed 'Out of memory', one must consult the
experts.
Therefore the "Out of memory" message needs to be prefixed with the name
of the kernel, or something. Anything. Thanks.
This is the start of the stable review cycle for the 5.4.262 release.
There are 153 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 Mon, 27 Nov 2023 19:43:06 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.262-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.4.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 5.4.262-rc3
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: bogus EBUSY when deleting flowtable after flush (for 5.4)
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: disable toggling dormant table state more than once
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: fix table flag updates
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nftables: update table flags from the commit phase
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: double hook unregistration in netns path
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: unregister flowtable hooks on netns exit
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: fix memleak when more than 255 elements expired
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nft_set_hash: try later when GC hits EAGAIN on iteration
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nft_set_rbtree: use read spinlock to avoid datapath contention
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nft_set_rbtree: skip sync GC for new elements in this transaction
Florian Westphal <fw(a)strlen.de>
netfilter: nf_tables: defer gc run if previous batch is still pending
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: use correct lock to protect gc_list
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: GC transaction race with abort path
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: GC transaction race with netns dismantle
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: fix GC transaction races with netns and netlink event exit path
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: remove busy mark and gc batch API
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nft_set_hash: mark set element as dead when deleting from packet path
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: adapt set backend to use GC transaction API
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: GC transaction API to avoid race with control plane
Florian Westphal <fw(a)strlen.de>
netfilter: nf_tables: don't skip expired elements during walk
Florian Westphal <fw(a)strlen.de>
netfilter: nft_set_rbtree: fix overlap expiration walk
Florian Westphal <fw(a)strlen.de>
netfilter: nft_set_rbtree: fix null deref on element insertion
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nft_set_rbtree: Switch to node list walk for overlap detection
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: drop map element references from preparation phase
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nftables: rename set element data activation/deactivation functions
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: pass context to nft_set_destroy()
Steven Rostedt (Google) <rostedt(a)goodmis.org>
tracing: Have trace_event_file have ref counters
Christian König <christian.koenig(a)amd.com>
drm/amdgpu: fix error handling in amdgpu_bo_list_get()
Kemeng Shi <shikemeng(a)huaweicloud.com>
ext4: remove gdb backup copy for meta bg in setup_new_flex_group_blocks
Zhang Yi <yi.zhang(a)huawei.com>
ext4: correct the start block of counting reserved clusters
Kemeng Shi <shikemeng(a)huaweicloud.com>
ext4: correct return value of ext4_convert_meta_bg
Kemeng Shi <shikemeng(a)huaweicloud.com>
ext4: correct offset of gdb backup in non meta_bg group to update_backups
Max Kellermann <max.kellermann(a)ionos.com>
ext4: apply umask if ACL support is disabled
Heiner Kallweit <hkallweit1(a)gmail.com>
Revert "net: r8169: Disable multicast filter for RTL8168H and RTL8107E"
Mahmoud Adam <mngyadam(a)amazon.com>
nfsd: fix file memleak on client_opens_release
Vikash Garodia <quic_vgarodia(a)quicinc.com>
media: venus: hfi: add checks to handle capabilities from firmware
Vikash Garodia <quic_vgarodia(a)quicinc.com>
media: venus: hfi: fix the check to handle session buffer requirement
Vikash Garodia <quic_vgarodia(a)quicinc.com>
media: venus: hfi_parser: Add check to keep the number of codecs within range
Sean Young <sean(a)mess.org>
media: sharp: fix sharp encoding
Sean Young <sean(a)mess.org>
media: lirc: drop trailing space from scancode transmit
Heiner Kallweit <hkallweit1(a)gmail.com>
i2c: i801: fix potential race in i801_block_transaction_byte_by_byte
Alexander Sverdlin <alexander.sverdlin(a)siemens.com>
net: dsa: lan9303: consequently nested-lock physical MDIO
Johnathan Mantey <johnathanx.mantey(a)intel.com>
Revert ncsi: Propagate carrier gain/loss events to the NCSI controller
Guan Wentao <guanwentao(a)uniontech.com>
Bluetooth: btusb: Add 0bda:b85b for Fn-Link RTL8852BE
Masum Reza <masumrezarock100(a)gmail.com>
Bluetooth: btusb: Add RTW8852BE device 13d3:3570 to device tables
Larry Finger <Larry.Finger(a)lwfinger.net>
bluetooth: Add device 13d3:3571 to device tables
Larry Finger <Larry.Finger(a)lwfinger.net>
bluetooth: Add device 0bda:887b to device tables
Artem Lukyanov <dukzcry(a)ya.ru>
Bluetooth: btusb: Add Realtek RTL8852BE support ID 0x0cb8:0xc559
Joseph Hwang <josephsih(a)chromium.org>
Bluetooth: btusb: add Realtek 8822CE to usb_device_id table
Alain Michaud <alainm(a)chromium.org>
Bluetooth: btusb: Add flag to define wideband speech capability
Pavel Krasavin <pkrasavin(a)imaqliq.com>
tty: serial: meson: fix hard LOCKUP on crtscts mode
Lad Prabhakar <prabhakar.mahadev-lad.rj(a)bp.renesas.com>
serial: meson: Use platform_get_irq() to get the interrupt
Neil Armstrong <narmstrong(a)baylibre.com>
tty: serial: meson: retrieve port FIFO size from DT
Colin Ian King <colin.king(a)canonical.com>
serial: meson: remove redundant initialization of variable id
Chandradeep Dey <codesigning(a)chandradeepdey.com>
ALSA: hda/realtek - Enable internal speaker of ASUS K6500ZC
Takashi Iwai <tiwai(a)suse.de>
ALSA: info: Fix potential deadlock at disconnection
Helge Deller <deller(a)gmx.de>
parisc/pgtable: Do not drop upper 5 address bits of physical address
Helge Deller <deller(a)gmx.de>
parisc: Prevent booting 64-bit kernels on PA1.x machines
Joshua Yeong <joshua.yeong(a)starfivetech.com>
i3c: master: cdns: Fix reading status register
Zi Yan <ziy(a)nvidia.com>
mm/cma: use nth_page() in place of direct struct page manipulation
Heiko Carstens <hca(a)linux.ibm.com>
s390/cmma: fix handling of swapper_pg_dir and invalid_pg_dir
Alain Volmat <alain.volmat(a)foss.st.com>
dmaengine: stm32-mdma: correct desc prep when channel running
Sanjuán García, Jorge <Jorge.SanjuanGarcia(a)duagon.com>
mcb: fix error handling for different scenarios when parsing
Benjamin Bara <benjamin.bara(a)skidata.com>
i2c: core: Run atomic i2c xfer when !preemptible
Benjamin Bara <benjamin.bara(a)skidata.com>
kernel/reboot: emergency_restart: Set correct system_state
Eric Biggers <ebiggers(a)google.com>
quota: explicitly forbid quota files from being encrypted
Zhihao Cheng <chengzhihao1(a)huawei.com>
jbd2: fix potential data lost in recovering journal raced with synchronizing fs bdev
Josef Bacik <josef(a)toxicpanda.com>
btrfs: don't arbitrarily slow down delalloc if we're committing
Brian Geffon <bgeffon(a)google.com>
PM: hibernate: Clean up sync_read handling in snapshot_write_next()
Brian Geffon <bgeffon(a)google.com>
PM: hibernate: Use __get_safe_page() rather than touching the list
Dan Carpenter <dan.carpenter(a)linaro.org>
mmc: vub300: fix an error code
Kathiravan Thirumoorthy <quic_kathirav(a)quicinc.com>
clk: qcom: ipq8074: drop the CLK_SET_RATE_PARENT flag from PLL clocks
Helge Deller <deller(a)gmx.de>
parisc/pdc: Add width field to struct pdc_model
Uwe Kleine-König <u.kleine-koenig(a)pengutronix.de>
PCI: keystone: Don't discard .probe() callback
Uwe Kleine-König <u.kleine-koenig(a)pengutronix.de>
PCI: keystone: Don't discard .remove() callback
Herve Codina <herve.codina(a)bootlin.com>
genirq/generic_chip: Make irq_remove_generic_chip() irqdomain aware
Rong Chen <rong.chen(a)amlogic.com>
mmc: meson-gx: Remove setting of CMD_CFG_ERROR
Werner Sembach <wse(a)tuxedocomputers.com>
ACPI: resource: Do IRQ override on TongFang GMxXGxx
Lukas Wunner <lukas(a)wunner.de>
PCI/sysfs: Protect driver's D3cold preference from user space
David Woodhouse <dwmw(a)amazon.co.uk>
hvc/xen: fix error path in xen_hvc_init() to always register frontend driver
Paul Moore <paul(a)paul-moore.com>
audit: don't WARN_ON_ONCE(!current->mm) in audit_exe_compare()
Paul Moore <paul(a)paul-moore.com>
audit: don't take task_lock() in audit_exe_compare() code path
Maciej S. Szmigiero <maciej.szmigiero(a)oracle.com>
KVM: x86: Ignore MSR_AMD64_TW_CFG access
Nicolas Saenz Julienne <nsaenz(a)amazon.com>
KVM: x86: hyper-v: Don't auto-enable stimer on write from user-space
Pu Wen <puwen(a)hygon.cn>
x86/cpu/hygon: Fix the CPU topology evaluation for real
Chandrakanth patil <chandrakanth.patil(a)broadcom.com>
scsi: megaraid_sas: Increase register read retry rount from 3 to 30 for selected registers
Shung-Hsi Yu <shung-hsi.yu(a)suse.com>
bpf: Fix precision tracking for BPF_ALU | BPF_TO_BE | BPF_END
Kees Cook <keescook(a)chromium.org>
randstruct: Fix gcc-plugin performance mode to stay in group
Vikash Garodia <quic_vgarodia(a)quicinc.com>
media: venus: hfi: add checks to perform sanity on queue pointers
Anastasia Belova <abelova(a)astralinux.ru>
cifs: spnego: add ';' in HOST_KEY_LEN
Zhang Rui <rui.zhang(a)intel.com>
tools/power/turbostat: Fix a knl bug
Vlad Buslov <vladbu(a)nvidia.com>
macvlan: Don't propagate promisc change to lower dev in passthru
Rahul Rameshbabu <rrameshbabu(a)nvidia.com>
net/mlx5e: Check return value of snprintf writing to fw_version buffer for representors
Leon Romanovsky <leonro(a)nvidia.com>
net/mlx5_core: Clean driver version and name
Dust Li <dust.li(a)linux.alibaba.com>
net/mlx5e: fix double free of encap_header
Baruch Siach <baruch(a)tkos.co.il>
net: stmmac: fix rx budget limit check
Jose Abreu <Jose.Abreu(a)synopsys.com>
net: stmmac: Rework stmmac_rx()
Linkui Xiao <xiaolinkui(a)kylinos.cn>
netfilter: nf_conntrack_bridge: initialize err to 0
Linus Walleij <linus.walleij(a)linaro.org>
net: ethernet: cortina: Fix MTU max setting
Linus Walleij <linus.walleij(a)linaro.org>
net: ethernet: cortina: Handle large frames
Linus Walleij <linus.walleij(a)linaro.org>
net: ethernet: cortina: Fix max RX frame define
Eric Dumazet <edumazet(a)google.com>
bonding: stop the device in bond_setup_by_slave()
Eric Dumazet <edumazet(a)google.com>
ptp: annotate data-race around q->head and q->tail
Juergen Gross <jgross(a)suse.com>
xen/events: fix delayed eoi list handling
Willem de Bruijn <willemb(a)google.com>
ppp: limit MRU to 64K
Shigeru Yoshida <syoshida(a)redhat.com>
tipc: Fix kernel-infoleak due to uninitialized TLV value
Yonglong Liu <liuyonglong(a)huawei.com>
net: hns3: fix variable may not initialized problem in hns3_init_mac_addr()
Shigeru Yoshida <syoshida(a)redhat.com>
tty: Fix uninit-value access in ppp_sync_receive()
Eric Dumazet <edumazet(a)google.com>
ipvlan: add ipvlan_route_v6_outbound() helper
Olga Kornievskaia <kolga(a)netapp.com>
NFSv4.1: fix SP4_MACH_CRED protection for pnfs IO
Miri Korenblit <miriam.rachel.korenblit(a)intel.com>
wifi: iwlwifi: Use FW rate for non-data frames
Dan Carpenter <dan.carpenter(a)linaro.org>
pwm: Fix double shift bug
Tony Lindgren <tony(a)atomide.com>
ASoC: ti: omap-mcbsp: Fix runtime PM underflow warnings
Douglas Anderson <dianders(a)chromium.org>
kgdb: Flush console before entering kgdb on panic
Wayne Lin <wayne.lin(a)amd.com>
drm/amd/display: Avoid NULL dereference of timing generator
Ilpo Järvinen <ilpo.jarvinen(a)linux.intel.com>
media: cobalt: Use FIELD_GET() to extract Link Width
Bob Peterson <rpeterso(a)redhat.com>
gfs2: ignore negated quota changes
Hans Verkuil <hverkuil-cisco(a)xs4all.nl>
media: vivid: avoid integer overflow
Rajeshwar R Shinde <coolrrsh(a)gmail.com>
media: gspca: cpia1: shift-out-of-bounds in set_flicker
Axel Lin <axel.lin(a)ingics.com>
i2c: sun6i-p2wi: Prevent potential division by zero
Hardik Gajjar <hgajjar(a)de.adit-jv.com>
usb: gadget: f_ncm: Always set current gadget in ncm_bind()
Yi Yang <yiyang13(a)huawei.com>
tty: vcc: Add check for kstrdup() in vcc_probe()
Jiri Kosina <jkosina(a)suse.cz>
HID: Add quirk for Dell Pro Wireless Keyboard and Mouse KM5221W
Wenchao Hao <haowenchao2(a)huawei.com>
scsi: libfc: Fix potential NULL pointer dereference in fc_lport_ptp_setup()
Ilpo Järvinen <ilpo.jarvinen(a)linux.intel.com>
atm: iphase: Do PCI error checks on own line
Ilpo Järvinen <ilpo.jarvinen(a)linux.intel.com>
PCI: tegra194: Use FIELD_GET()/FIELD_PREP() with Link Width fields
Cezary Rojewski <cezary.rojewski(a)intel.com>
ALSA: hda: Fix possible null-ptr-deref when assigning a stream
Vincent Whitchurch <vincent.whitchurch(a)axis.com>
ARM: 9320/1: fix stack depot IRQ stack filter
Manas Ghandat <ghandatmanas(a)gmail.com>
jfs: fix array-index-out-of-bounds in diAlloc
Manas Ghandat <ghandatmanas(a)gmail.com>
jfs: fix array-index-out-of-bounds in dbFindLeaf
Juntong Deng <juntong.deng(a)outlook.com>
fs/jfs: Add validity check for db_maxag and db_agpref
Juntong Deng <juntong.deng(a)outlook.com>
fs/jfs: Add check for negative db_l2nbperpage
Ilpo Järvinen <ilpo.jarvinen(a)linux.intel.com>
RDMA/hfi1: Use FIELD_GET() to extract Link Width
Lu Jialin <lujialin4(a)huawei.com>
crypto: pcrypt - Fix hungtask for PADATA_RESET
zhujun2 <zhujun2(a)cmss.chinamobile.com>
selftests/efivarfs: create-read: fix a resource leak
Qu Huang <qu.huang(a)linux.dev>
drm/amdgpu: Fix a null pointer access when the smc_rreg pointer is NULL
Mario Limonciello <mario.limonciello(a)amd.com>
drm/amd: Fix UBSAN array-index-out-of-bounds for Polaris and Tonga
Mario Limonciello <mario.limonciello(a)amd.com>
drm/amd: Fix UBSAN array-index-out-of-bounds for SMU7
baozhu.liu <lucas.liu(a)siengine.com>
drm/komeda: drop all currently held locks if deadlock happens
Olli Asikainen <olli.asikainen(a)gmail.com>
platform/x86: thinkpad_acpi: Add battery quirk for Thinkpad X120e
ZhengHan Wang <wzhmmmmm(a)gmail.com>
Bluetooth: Fix double free in hci_conn_cleanup
Douglas Anderson <dianders(a)chromium.org>
wifi: ath10k: Don't touch the CE interrupt registers after power up
Eric Dumazet <edumazet(a)google.com>
net: annotate data-races around sk->sk_dst_pending_confirm
Eric Dumazet <edumazet(a)google.com>
net: annotate data-races around sk->sk_tx_queue_mapping
Dmitry Antipov <dmantipov(a)yandex.ru>
wifi: ath10k: fix clang-specific fortify warning
Dmitry Antipov <dmantipov(a)yandex.ru>
wifi: ath9k: fix clang-specific fortify warnings
Ping-Ke Shih <pkshih(a)realtek.com>
wifi: mac80211: don't return unset power in ieee80211_get_tx_power()
Dmitry Antipov <dmantipov(a)yandex.ru>
wifi: mac80211_hwsim: fix clang-specific fortify warning
Mike Rapoport (IBM) <rppt(a)kernel.org>
x86/mm: Drop the 4 MB restriction on minimal NUMA node memory size
Ronald Wahl <ronald.wahl(a)raritan.com>
clocksource/drivers/timer-atmel-tcb: Fix initialization on SAM9 hardware
Jacky Bai <ping.bai(a)nxp.com>
clocksource/drivers/timer-imx-gpt: Fix potential memory leak
Shuai Xue <xueshuai(a)linux.alibaba.com>
perf/core: Bail out early if the request AUX area is out of bound
John Stultz <jstultz(a)google.com>
locking/ww_mutex/test: Fix potential workqueue corruption
-------------
Diffstat:
Makefile | 4 +-
arch/arm/include/asm/exception.h | 4 -
arch/parisc/include/uapi/asm/pdc.h | 1 +
arch/parisc/kernel/entry.S | 7 +-
arch/parisc/kernel/head.S | 5 +-
arch/s390/mm/page-states.c | 6 +
arch/x86/include/asm/msr-index.h | 1 +
arch/x86/include/asm/numa.h | 7 -
arch/x86/kernel/cpu/hygon.c | 8 +-
arch/x86/kvm/hyperv.c | 10 +-
arch/x86/kvm/x86.c | 2 +
arch/x86/mm/numa.c | 7 -
crypto/pcrypt.c | 4 +
drivers/acpi/resource.c | 12 +
drivers/atm/iphase.c | 20 +-
drivers/bluetooth/btusb.c | 35 +-
drivers/clk/qcom/gcc-ipq8074.c | 6 -
drivers/clocksource/timer-atmel-tcb.c | 1 +
drivers/clocksource/timer-imx-gpt.c | 18 +-
drivers/dma/stm32-mdma.c | 4 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 1 +
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 6 +
drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 4 +-
drivers/gpu/drm/amd/include/pptable.h | 4 +-
drivers/gpu/drm/amd/powerplay/hwmgr/pptable_v1_0.h | 16 +-
.../drm/arm/display/komeda/komeda_pipeline_state.c | 9 +-
drivers/hid/hid-ids.h | 1 +
drivers/hid/hid-quirks.c | 1 +
drivers/i2c/busses/i2c-i801.c | 19 +-
drivers/i2c/busses/i2c-sun6i-p2wi.c | 5 +
drivers/i2c/i2c-core.h | 2 +-
drivers/i3c/master/i3c-master-cdns.c | 6 +-
drivers/infiniband/hw/hfi1/pcie.c | 9 +-
drivers/mcb/mcb-core.c | 1 +
drivers/mcb/mcb-parse.c | 2 +-
drivers/media/pci/cobalt/cobalt-driver.c | 11 +-
drivers/media/platform/qcom/venus/hfi_msgs.c | 2 +-
drivers/media/platform/qcom/venus/hfi_parser.c | 15 +
drivers/media/platform/qcom/venus/hfi_venus.c | 10 +
drivers/media/platform/vivid/vivid-rds-gen.c | 2 +-
drivers/media/rc/ir-sharp-decoder.c | 8 +-
drivers/media/rc/lirc_dev.c | 6 +-
drivers/media/usb/gspca/cpia1.c | 3 +
drivers/mmc/host/meson-gx-mmc.c | 1 -
drivers/mmc/host/vub300.c | 1 +
drivers/net/bonding/bond_main.c | 6 +
drivers/net/dsa/lan9303_mdio.c | 4 +-
drivers/net/ethernet/cortina/gemini.c | 45 +-
drivers/net/ethernet/cortina/gemini.h | 4 +-
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/devlink.c | 2 +-
.../net/ethernet/mellanox/mlx5/core/en/tc_tun.c | 10 +-
.../net/ethernet/mellanox/mlx5/core/en_ethtool.c | 4 +-
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 13 +-
.../ethernet/mellanox/mlx5/core/ipoib/ethtool.c | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/main.c | 10 +-
.../net/ethernet/mellanox/mlx5/core/mlx5_core.h | 3 -
drivers/net/ethernet/realtek/r8169_main.c | 4 +-
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 148 +++---
drivers/net/ipvlan/ipvlan_core.c | 41 +-
drivers/net/macvlan.c | 2 +-
drivers/net/ppp/ppp_synctty.c | 6 +-
drivers/net/wireless/ath/ath10k/debug.c | 2 +-
drivers/net/wireless/ath/ath10k/snoc.c | 18 +-
drivers/net/wireless/ath/ath9k/debug.c | 2 +-
drivers/net/wireless/ath/ath9k/htc_drv_debug.c | 2 +-
drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 14 +-
drivers/net/wireless/mac80211_hwsim.c | 2 +-
drivers/pci/controller/dwc/pci-keystone.c | 8 +-
drivers/pci/controller/dwc/pcie-tegra194.c | 9 +-
drivers/pci/pci-acpi.c | 2 +-
drivers/pci/pci-sysfs.c | 5 +-
drivers/platform/x86/thinkpad_acpi.c | 1 +
drivers/ptp/ptp_chardev.c | 3 +-
drivers/ptp/ptp_clock.c | 5 +-
drivers/ptp/ptp_private.h | 8 +-
drivers/ptp/ptp_sysfs.c | 3 +-
drivers/scsi/libfc/fc_lport.c | 6 +
drivers/scsi/megaraid/megaraid_sas_base.c | 4 +-
drivers/tty/hvc/hvc_xen.c | 5 +-
drivers/tty/serial/meson_uart.c | 33 +-
drivers/tty/vcc.c | 16 +-
drivers/usb/gadget/function/f_ncm.c | 27 +-
drivers/xen/events/events_base.c | 4 +-
fs/btrfs/delalloc-space.c | 3 -
fs/cifs/cifs_spnego.c | 4 +-
fs/ext4/acl.h | 5 +
fs/ext4/extents_status.c | 4 +-
fs/ext4/resize.c | 19 +-
fs/gfs2/quota.c | 11 +
fs/jbd2/recovery.c | 8 +
fs/jfs/jfs_dmap.c | 23 +-
fs/jfs/jfs_imap.c | 5 +-
fs/nfs/nfs4proc.c | 5 +-
fs/nfsd/nfs4state.c | 2 +-
fs/quota/dquot.c | 14 +
include/linux/mlx5/driver.h | 2 +
include/linux/pwm.h | 4 +-
include/linux/trace_events.h | 4 +
include/net/netfilter/nf_tables.h | 129 ++----
include/net/sock.h | 26 +-
include/uapi/linux/netfilter/nf_tables.h | 1 +
kernel/audit_watch.c | 9 +-
kernel/bpf/verifier.c | 7 +-
kernel/debug/debug_core.c | 3 +
kernel/events/ring_buffer.c | 6 +
kernel/irq/generic-chip.c | 25 +-
kernel/locking/test-ww_mutex.c | 20 +-
kernel/padata.c | 2 +-
kernel/power/snapshot.c | 16 +-
kernel/reboot.c | 1 +
kernel/trace/trace.c | 15 +
kernel/trace/trace.h | 3 +
kernel/trace/trace_events.c | 39 +-
kernel/trace/trace_events_filter.c | 3 +
mm/cma.c | 2 +-
net/bluetooth/hci_conn.c | 6 +-
net/bluetooth/hci_sysfs.c | 23 +-
net/bridge/netfilter/nf_conntrack_bridge.c | 2 +-
net/core/sock.c | 2 +-
net/ipv4/tcp_output.c | 2 +-
net/mac80211/cfg.c | 4 +
net/ncsi/ncsi-aen.c | 5 -
net/netfilter/nf_tables_api.c | 512 +++++++++++++++++----
net/netfilter/nft_chain_filter.c | 3 +
net/netfilter/nft_set_bitmap.c | 5 +-
net/netfilter/nft_set_hash.c | 110 +++--
net/netfilter/nft_set_rbtree.c | 375 ++++++++++++---
net/tipc/netlink_compat.c | 1 +
scripts/gcc-plugins/randomize_layout_plugin.c | 11 +-
sound/core/info.c | 21 +-
sound/hda/hdac_stream.c | 6 +-
sound/pci/hda/patch_realtek.c | 1 +
sound/soc/ti/omap-mcbsp.c | 6 +-
tools/power/x86/turbostat/turbostat.c | 2 +-
tools/testing/selftests/efivarfs/create-read.c | 2 +
136 files changed, 1632 insertions(+), 679 deletions(-)
This is the start of the stable review cycle for the 4.19.300 release.
There are 93 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 Mon, 27 Nov 2023 16:30:48 +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/v4.x/stable-review/patch-4.19.300-r…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.19.300-rc2
Eric Dumazet <edumazet(a)google.com>
net: sched: fix race condition in qdisc_graft()
Matthew Wilcox (Oracle) <willy(a)infradead.org>
iomap: Set all uptodate bits for an Uptodate page
Dongli Zhang <dongli.zhang(a)oracle.com>
scsi: virtio_scsi: limit number of hw queues by nr_cpu_ids
Christian König <christian.koenig(a)amd.com>
drm/amdgpu: fix error handling in amdgpu_bo_list_get()
Kemeng Shi <shikemeng(a)huaweicloud.com>
ext4: remove gdb backup copy for meta bg in setup_new_flex_group_blocks
Kemeng Shi <shikemeng(a)huaweicloud.com>
ext4: correct return value of ext4_convert_meta_bg
Kemeng Shi <shikemeng(a)huaweicloud.com>
ext4: correct offset of gdb backup in non meta_bg group to update_backups
Max Kellermann <max.kellermann(a)ionos.com>
ext4: apply umask if ACL support is disabled
Heiner Kallweit <hkallweit1(a)gmail.com>
Revert "net: r8169: Disable multicast filter for RTL8168H and RTL8107E"
Vikash Garodia <quic_vgarodia(a)quicinc.com>
media: venus: hfi: add checks to handle capabilities from firmware
Vikash Garodia <quic_vgarodia(a)quicinc.com>
media: venus: hfi: fix the check to handle session buffer requirement
Vikash Garodia <quic_vgarodia(a)quicinc.com>
media: venus: hfi_parser: Add check to keep the number of codecs within range
Sean Young <sean(a)mess.org>
media: sharp: fix sharp encoding
Sean Young <sean(a)mess.org>
media: lirc: drop trailing space from scancode transmit
Heiner Kallweit <hkallweit1(a)gmail.com>
i2c: i801: fix potential race in i801_block_transaction_byte_by_byte
Alexander Sverdlin <alexander.sverdlin(a)siemens.com>
net: dsa: lan9303: consequently nested-lock physical MDIO
Pavel Krasavin <pkrasavin(a)imaqliq.com>
tty: serial: meson: fix hard LOCKUP on crtscts mode
Lad Prabhakar <prabhakar.mahadev-lad.rj(a)bp.renesas.com>
serial: meson: Use platform_get_irq() to get the interrupt
Neil Armstrong <narmstrong(a)baylibre.com>
tty: serial: meson: retrieve port FIFO size from DT
Colin Ian King <colin.king(a)canonical.com>
serial: meson: remove redundant initialization of variable id
Loys Ollivier <lollivier(a)baylibre.com>
tty: serial: meson: if no alias specified use an available id
Chandradeep Dey <codesigning(a)chandradeepdey.com>
ALSA: hda/realtek - Enable internal speaker of ASUS K6500ZC
Takashi Iwai <tiwai(a)suse.de>
ALSA: info: Fix potential deadlock at disconnection
Helge Deller <deller(a)gmx.de>
parisc/pgtable: Do not drop upper 5 address bits of physical address
Helge Deller <deller(a)gmx.de>
parisc: Prevent booting 64-bit kernels on PA1.x machines
Heiko Carstens <hca(a)linux.ibm.com>
s390/cmma: fix handling of swapper_pg_dir and invalid_pg_dir
Alain Volmat <alain.volmat(a)foss.st.com>
dmaengine: stm32-mdma: correct desc prep when channel running
Sanjuán García, Jorge <Jorge.SanjuanGarcia(a)duagon.com>
mcb: fix error handling for different scenarios when parsing
Eric Biggers <ebiggers(a)google.com>
quota: explicitly forbid quota files from being encrypted
Zhihao Cheng <chengzhihao1(a)huawei.com>
jbd2: fix potential data lost in recovering journal raced with synchronizing fs bdev
Brian Geffon <bgeffon(a)google.com>
PM: hibernate: Clean up sync_read handling in snapshot_write_next()
Brian Geffon <bgeffon(a)google.com>
PM: hibernate: Use __get_safe_page() rather than touching the list
Dan Carpenter <dan.carpenter(a)linaro.org>
mmc: vub300: fix an error code
Kathiravan Thirumoorthy <quic_kathirav(a)quicinc.com>
clk: qcom: ipq8074: drop the CLK_SET_RATE_PARENT flag from PLL clocks
Helge Deller <deller(a)gmx.de>
parisc/pdc: Add width field to struct pdc_model
Uwe Kleine-König <u.kleine-koenig(a)pengutronix.de>
PCI: keystone: Don't discard .probe() callback
Uwe Kleine-König <u.kleine-koenig(a)pengutronix.de>
PCI: keystone: Don't discard .remove() callback
Herve Codina <herve.codina(a)bootlin.com>
genirq/generic_chip: Make irq_remove_generic_chip() irqdomain aware
Rong Chen <rong.chen(a)amlogic.com>
mmc: meson-gx: Remove setting of CMD_CFG_ERROR
Lukas Wunner <lukas(a)wunner.de>
PCI/sysfs: Protect driver's D3cold preference from user space
David Woodhouse <dwmw(a)amazon.co.uk>
hvc/xen: fix error path in xen_hvc_init() to always register frontend driver
Paul Moore <paul(a)paul-moore.com>
audit: don't WARN_ON_ONCE(!current->mm) in audit_exe_compare()
Paul Moore <paul(a)paul-moore.com>
audit: don't take task_lock() in audit_exe_compare() code path
Maciej S. Szmigiero <maciej.szmigiero(a)oracle.com>
KVM: x86: Ignore MSR_AMD64_TW_CFG access
Kees Cook <keescook(a)chromium.org>
randstruct: Fix gcc-plugin performance mode to stay in group
Vikash Garodia <quic_vgarodia(a)quicinc.com>
media: venus: hfi: add checks to perform sanity on queue pointers
Anastasia Belova <abelova(a)astralinux.ru>
cifs: spnego: add ';' in HOST_KEY_LEN
Vlad Buslov <vladbu(a)nvidia.com>
macvlan: Don't propagate promisc change to lower dev in passthru
Linus Walleij <linus.walleij(a)linaro.org>
net: ethernet: cortina: Fix MTU max setting
Linus Walleij <linus.walleij(a)linaro.org>
net: ethernet: cortina: Handle large frames
Linus Walleij <linus.walleij(a)linaro.org>
net: ethernet: cortina: Fix max RX frame define
Eric Dumazet <edumazet(a)google.com>
ptp: annotate data-race around q->head and q->tail
Juergen Gross <jgross(a)suse.com>
xen/events: fix delayed eoi list handling
Willem de Bruijn <willemb(a)google.com>
ppp: limit MRU to 64K
Shigeru Yoshida <syoshida(a)redhat.com>
tipc: Fix kernel-infoleak due to uninitialized TLV value
Shigeru Yoshida <syoshida(a)redhat.com>
tty: Fix uninit-value access in ppp_sync_receive()
Eric Dumazet <edumazet(a)google.com>
ipvlan: add ipvlan_route_v6_outbound() helper
Olga Kornievskaia <kolga(a)netapp.com>
NFSv4.1: fix SP4_MACH_CRED protection for pnfs IO
Dan Carpenter <dan.carpenter(a)linaro.org>
pwm: Fix double shift bug
Wayne Lin <wayne.lin(a)amd.com>
drm/amd/display: Avoid NULL dereference of timing generator
Bob Peterson <rpeterso(a)redhat.com>
gfs2: ignore negated quota changes
Hans Verkuil <hverkuil-cisco(a)xs4all.nl>
media: vivid: avoid integer overflow
Rajeshwar R Shinde <coolrrsh(a)gmail.com>
media: gspca: cpia1: shift-out-of-bounds in set_flicker
Axel Lin <axel.lin(a)ingics.com>
i2c: sun6i-p2wi: Prevent potential division by zero
Hardik Gajjar <hgajjar(a)de.adit-jv.com>
usb: gadget: f_ncm: Always set current gadget in ncm_bind()
Yi Yang <yiyang13(a)huawei.com>
tty: vcc: Add check for kstrdup() in vcc_probe()
Jiri Kosina <jkosina(a)suse.cz>
HID: Add quirk for Dell Pro Wireless Keyboard and Mouse KM5221W
Wenchao Hao <haowenchao2(a)huawei.com>
scsi: libfc: Fix potential NULL pointer dereference in fc_lport_ptp_setup()
Ilpo Järvinen <ilpo.jarvinen(a)linux.intel.com>
atm: iphase: Do PCI error checks on own line
Cezary Rojewski <cezary.rojewski(a)intel.com>
ALSA: hda: Fix possible null-ptr-deref when assigning a stream
Vincent Whitchurch <vincent.whitchurch(a)axis.com>
ARM: 9320/1: fix stack depot IRQ stack filter
Manas Ghandat <ghandatmanas(a)gmail.com>
jfs: fix array-index-out-of-bounds in diAlloc
Manas Ghandat <ghandatmanas(a)gmail.com>
jfs: fix array-index-out-of-bounds in dbFindLeaf
Juntong Deng <juntong.deng(a)outlook.com>
fs/jfs: Add validity check for db_maxag and db_agpref
Juntong Deng <juntong.deng(a)outlook.com>
fs/jfs: Add check for negative db_l2nbperpage
Ilpo Järvinen <ilpo.jarvinen(a)linux.intel.com>
RDMA/hfi1: Use FIELD_GET() to extract Link Width
Lu Jialin <lujialin4(a)huawei.com>
crypto: pcrypt - Fix hungtask for PADATA_RESET
zhujun2 <zhujun2(a)cmss.chinamobile.com>
selftests/efivarfs: create-read: fix a resource leak
Qu Huang <qu.huang(a)linux.dev>
drm/amdgpu: Fix a null pointer access when the smc_rreg pointer is NULL
Mario Limonciello <mario.limonciello(a)amd.com>
drm/amd: Fix UBSAN array-index-out-of-bounds for Polaris and Tonga
Mario Limonciello <mario.limonciello(a)amd.com>
drm/amd: Fix UBSAN array-index-out-of-bounds for SMU7
Olli Asikainen <olli.asikainen(a)gmail.com>
platform/x86: thinkpad_acpi: Add battery quirk for Thinkpad X120e
ZhengHan Wang <wzhmmmmm(a)gmail.com>
Bluetooth: Fix double free in hci_conn_cleanup
Eric Dumazet <edumazet(a)google.com>
net: annotate data-races around sk->sk_dst_pending_confirm
Eric Dumazet <edumazet(a)google.com>
net: annotate data-races around sk->sk_tx_queue_mapping
Dmitry Antipov <dmantipov(a)yandex.ru>
wifi: ath10k: fix clang-specific fortify warning
Dmitry Antipov <dmantipov(a)yandex.ru>
wifi: ath9k: fix clang-specific fortify warnings
Ping-Ke Shih <pkshih(a)realtek.com>
wifi: mac80211: don't return unset power in ieee80211_get_tx_power()
Mike Rapoport (IBM) <rppt(a)kernel.org>
x86/mm: Drop the 4 MB restriction on minimal NUMA node memory size
Ronald Wahl <ronald.wahl(a)raritan.com>
clocksource/drivers/timer-atmel-tcb: Fix initialization on SAM9 hardware
Jacky Bai <ping.bai(a)nxp.com>
clocksource/drivers/timer-imx-gpt: Fix potential memory leak
Shuai Xue <xueshuai(a)linux.alibaba.com>
perf/core: Bail out early if the request AUX area is out of bound
John Stultz <jstultz(a)google.com>
locking/ww_mutex/test: Fix potential workqueue corruption
-------------
Diffstat:
Makefile | 4 +-
arch/arm/include/asm/exception.h | 4 --
arch/parisc/include/uapi/asm/pdc.h | 1 +
arch/parisc/kernel/entry.S | 7 ++--
arch/parisc/kernel/head.S | 5 +--
arch/s390/mm/page-states.c | 6 +++
arch/x86/include/asm/msr-index.h | 1 +
arch/x86/include/asm/numa.h | 7 ----
arch/x86/kvm/x86.c | 2 +
arch/x86/mm/numa.c | 7 ----
crypto/pcrypt.c | 4 ++
drivers/atm/iphase.c | 20 +++++-----
drivers/clk/qcom/gcc-ipq8074.c | 6 ---
drivers/clocksource/tcb_clksrc.c | 1 +
drivers/clocksource/timer-imx-gpt.c | 18 ++++++---
drivers/dma/stm32-mdma.c | 4 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 1 +
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 6 +++
drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 4 +-
drivers/gpu/drm/amd/include/pptable.h | 4 +-
drivers/gpu/drm/amd/powerplay/hwmgr/pptable_v1_0.h | 16 ++++----
drivers/hid/hid-ids.h | 1 +
drivers/hid/hid-quirks.c | 1 +
drivers/i2c/busses/i2c-i801.c | 19 +++++----
drivers/i2c/busses/i2c-sun6i-p2wi.c | 5 +++
drivers/infiniband/hw/hfi1/pcie.c | 9 +----
drivers/mcb/mcb-core.c | 1 +
drivers/mcb/mcb-parse.c | 2 +-
drivers/media/platform/qcom/venus/hfi_msgs.c | 2 +-
drivers/media/platform/qcom/venus/hfi_parser.c | 15 ++++++++
drivers/media/platform/qcom/venus/hfi_venus.c | 10 +++++
drivers/media/platform/vivid/vivid-rds-gen.c | 2 +-
drivers/media/rc/ir-sharp-decoder.c | 8 ++--
drivers/media/rc/lirc_dev.c | 6 ++-
drivers/media/usb/gspca/cpia1.c | 3 ++
drivers/mmc/host/meson-gx-mmc.c | 1 -
drivers/mmc/host/vub300.c | 1 +
drivers/net/dsa/lan9303_mdio.c | 4 +-
drivers/net/ethernet/cortina/gemini.c | 45 ++++++++++++++--------
drivers/net/ethernet/cortina/gemini.h | 4 +-
drivers/net/ethernet/realtek/r8169_main.c | 4 +-
drivers/net/ipvlan/ipvlan_core.c | 41 ++++++++++++--------
drivers/net/macvlan.c | 2 +-
drivers/net/ppp/ppp_synctty.c | 6 ++-
drivers/net/wireless/ath/ath10k/debug.c | 2 +-
drivers/net/wireless/ath/ath9k/debug.c | 2 +-
drivers/net/wireless/ath/ath9k/htc_drv_debug.c | 2 +-
drivers/pci/controller/dwc/pci-keystone.c | 8 ++--
drivers/pci/pci-acpi.c | 2 +-
drivers/pci/pci-sysfs.c | 5 +--
drivers/platform/x86/thinkpad_acpi.c | 1 +
drivers/ptp/ptp_chardev.c | 3 +-
drivers/ptp/ptp_clock.c | 5 ++-
drivers/ptp/ptp_private.h | 8 +++-
drivers/ptp/ptp_sysfs.c | 3 +-
drivers/scsi/libfc/fc_lport.c | 6 +++
drivers/scsi/virtio_scsi.c | 1 +
drivers/tty/hvc/hvc_xen.c | 5 ++-
drivers/tty/serial/meson_uart.c | 44 ++++++++++++++++-----
drivers/tty/vcc.c | 16 ++++++--
drivers/usb/gadget/function/f_ncm.c | 27 ++++++-------
drivers/xen/events/events_base.c | 4 +-
fs/cifs/cifs_spnego.c | 4 +-
fs/ext4/acl.h | 5 +++
fs/ext4/resize.c | 19 ++++-----
fs/gfs2/quota.c | 11 ++++++
fs/iomap.c | 3 ++
fs/jbd2/recovery.c | 8 ++++
fs/jfs/jfs_dmap.c | 23 ++++++++---
fs/jfs/jfs_imap.c | 5 ++-
fs/nfs/nfs4proc.c | 5 ++-
fs/quota/dquot.c | 14 +++++++
include/linux/pwm.h | 4 +-
include/net/sock.h | 26 +++++++++----
kernel/audit_watch.c | 9 ++++-
kernel/events/ring_buffer.c | 6 +++
kernel/irq/generic-chip.c | 25 +++++++++---
kernel/locking/test-ww_mutex.c | 20 ++++++----
kernel/padata.c | 2 +-
kernel/power/snapshot.c | 16 ++++----
net/bluetooth/hci_conn.c | 6 +--
net/bluetooth/hci_sysfs.c | 23 +++++------
net/core/sock.c | 2 +-
net/ipv4/tcp_output.c | 2 +-
net/mac80211/cfg.c | 4 ++
net/sched/sch_api.c | 5 ++-
net/tipc/netlink_compat.c | 1 +
scripts/gcc-plugins/randomize_layout_plugin.c | 11 ++++--
sound/core/info.c | 21 ++++++----
sound/hda/hdac_stream.c | 6 ++-
sound/pci/hda/patch_realtek.c | 1 +
tools/testing/selftests/efivarfs/create-read.c | 2 +
92 files changed, 488 insertions(+), 265 deletions(-)
Hi Greg
6.6.3-rc2
compiles, boots and runs[1] here on x86_64
(Intel Rocket Lake: i5-11400)
Thanks
[1]
a vbox crash (known bug):
https://www.virtualbox.org/ticket/21898
Tested-by: Ronald Warsow <rwarsow(a)gmx.de>
This is the start of the stable review cycle for the 4.19.300 release.
There are 97 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 Sun, 26 Nov 2023 17:19:17 +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/v4.x/stable-review/patch-4.19.300-r…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.19.300-rc1
Eric Dumazet <edumazet(a)google.com>
net: sched: fix race condition in qdisc_graft()
Matthew Wilcox (Oracle) <willy(a)infradead.org>
iomap: Set all uptodate bits for an Uptodate page
Dongli Zhang <dongli.zhang(a)oracle.com>
scsi: virtio_scsi: limit number of hw queues by nr_cpu_ids
Christian König <christian.koenig(a)amd.com>
drm/amdgpu: fix error handling in amdgpu_bo_list_get()
Kemeng Shi <shikemeng(a)huaweicloud.com>
ext4: remove gdb backup copy for meta bg in setup_new_flex_group_blocks
Kemeng Shi <shikemeng(a)huaweicloud.com>
ext4: correct return value of ext4_convert_meta_bg
Kemeng Shi <shikemeng(a)huaweicloud.com>
ext4: correct offset of gdb backup in non meta_bg group to update_backups
Max Kellermann <max.kellermann(a)ionos.com>
ext4: apply umask if ACL support is disabled
Heiner Kallweit <hkallweit1(a)gmail.com>
Revert "net: r8169: Disable multicast filter for RTL8168H and RTL8107E"
Vikash Garodia <quic_vgarodia(a)quicinc.com>
media: venus: hfi: add checks to handle capabilities from firmware
Vikash Garodia <quic_vgarodia(a)quicinc.com>
media: venus: hfi: fix the check to handle session buffer requirement
Vikash Garodia <quic_vgarodia(a)quicinc.com>
media: venus: hfi_parser: Add check to keep the number of codecs within range
Sean Young <sean(a)mess.org>
media: sharp: fix sharp encoding
Sean Young <sean(a)mess.org>
media: lirc: drop trailing space from scancode transmit
Heiner Kallweit <hkallweit1(a)gmail.com>
i2c: i801: fix potential race in i801_block_transaction_byte_by_byte
Alexander Sverdlin <alexander.sverdlin(a)siemens.com>
net: dsa: lan9303: consequently nested-lock physical MDIO
Pavel Krasavin <pkrasavin(a)imaqliq.com>
tty: serial: meson: fix hard LOCKUP on crtscts mode
Lad Prabhakar <prabhakar.mahadev-lad.rj(a)bp.renesas.com>
serial: meson: Use platform_get_irq() to get the interrupt
Neil Armstrong <narmstrong(a)baylibre.com>
tty: serial: meson: retrieve port FIFO size from DT
Colin Ian King <colin.king(a)canonical.com>
serial: meson: remove redundant initialization of variable id
Dmitry Safonov <dima(a)arista.com>
tty/serial: Migrate meson_uart to use has_sysrq
Loys Ollivier <lollivier(a)baylibre.com>
tty: serial: meson: if no alias specified use an available id
Chandradeep Dey <codesigning(a)chandradeepdey.com>
ALSA: hda/realtek - Enable internal speaker of ASUS K6500ZC
Takashi Iwai <tiwai(a)suse.de>
ALSA: info: Fix potential deadlock at disconnection
Helge Deller <deller(a)gmx.de>
parisc/power: Fix power soft-off when running on qemu
Helge Deller <deller(a)gmx.de>
parisc/pgtable: Do not drop upper 5 address bits of physical address
Helge Deller <deller(a)gmx.de>
parisc: Prevent booting 64-bit kernels on PA1.x machines
Heiko Carstens <hca(a)linux.ibm.com>
s390/cmma: fix handling of swapper_pg_dir and invalid_pg_dir
Heiko Carstens <hca(a)linux.ibm.com>
s390/cmma: fix initial kernel address space page table walk
Alain Volmat <alain.volmat(a)foss.st.com>
dmaengine: stm32-mdma: correct desc prep when channel running
Sanjuán García, Jorge <Jorge.SanjuanGarcia(a)duagon.com>
mcb: fix error handling for different scenarios when parsing
Eric Biggers <ebiggers(a)google.com>
quota: explicitly forbid quota files from being encrypted
Zhihao Cheng <chengzhihao1(a)huawei.com>
jbd2: fix potential data lost in recovering journal raced with synchronizing fs bdev
Brian Geffon <bgeffon(a)google.com>
PM: hibernate: Clean up sync_read handling in snapshot_write_next()
Brian Geffon <bgeffon(a)google.com>
PM: hibernate: Use __get_safe_page() rather than touching the list
Dan Carpenter <dan.carpenter(a)linaro.org>
mmc: vub300: fix an error code
Kathiravan Thirumoorthy <quic_kathirav(a)quicinc.com>
clk: qcom: ipq8074: drop the CLK_SET_RATE_PARENT flag from PLL clocks
Helge Deller <deller(a)gmx.de>
parisc/power: Add power soft-off when running on qemu
Helge Deller <deller(a)gmx.de>
parisc/pdc: Add width field to struct pdc_model
Uwe Kleine-König <u.kleine-koenig(a)pengutronix.de>
PCI: keystone: Don't discard .probe() callback
Uwe Kleine-König <u.kleine-koenig(a)pengutronix.de>
PCI: keystone: Don't discard .remove() callback
Herve Codina <herve.codina(a)bootlin.com>
genirq/generic_chip: Make irq_remove_generic_chip() irqdomain aware
Rong Chen <rong.chen(a)amlogic.com>
mmc: meson-gx: Remove setting of CMD_CFG_ERROR
Lukas Wunner <lukas(a)wunner.de>
PCI/sysfs: Protect driver's D3cold preference from user space
David Woodhouse <dwmw(a)amazon.co.uk>
hvc/xen: fix error path in xen_hvc_init() to always register frontend driver
Paul Moore <paul(a)paul-moore.com>
audit: don't WARN_ON_ONCE(!current->mm) in audit_exe_compare()
Paul Moore <paul(a)paul-moore.com>
audit: don't take task_lock() in audit_exe_compare() code path
Maciej S. Szmigiero <maciej.szmigiero(a)oracle.com>
KVM: x86: Ignore MSR_AMD64_TW_CFG access
Kees Cook <keescook(a)chromium.org>
randstruct: Fix gcc-plugin performance mode to stay in group
Vikash Garodia <quic_vgarodia(a)quicinc.com>
media: venus: hfi: add checks to perform sanity on queue pointers
Anastasia Belova <abelova(a)astralinux.ru>
cifs: spnego: add ';' in HOST_KEY_LEN
Vlad Buslov <vladbu(a)nvidia.com>
macvlan: Don't propagate promisc change to lower dev in passthru
Linus Walleij <linus.walleij(a)linaro.org>
net: ethernet: cortina: Fix MTU max setting
Linus Walleij <linus.walleij(a)linaro.org>
net: ethernet: cortina: Handle large frames
Linus Walleij <linus.walleij(a)linaro.org>
net: ethernet: cortina: Fix max RX frame define
Eric Dumazet <edumazet(a)google.com>
ptp: annotate data-race around q->head and q->tail
Juergen Gross <jgross(a)suse.com>
xen/events: fix delayed eoi list handling
Willem de Bruijn <willemb(a)google.com>
ppp: limit MRU to 64K
Shigeru Yoshida <syoshida(a)redhat.com>
tipc: Fix kernel-infoleak due to uninitialized TLV value
Shigeru Yoshida <syoshida(a)redhat.com>
tty: Fix uninit-value access in ppp_sync_receive()
Eric Dumazet <edumazet(a)google.com>
ipvlan: add ipvlan_route_v6_outbound() helper
Olga Kornievskaia <kolga(a)netapp.com>
NFSv4.1: fix SP4_MACH_CRED protection for pnfs IO
Dan Carpenter <dan.carpenter(a)linaro.org>
pwm: Fix double shift bug
Wayne Lin <wayne.lin(a)amd.com>
drm/amd/display: Avoid NULL dereference of timing generator
Bob Peterson <rpeterso(a)redhat.com>
gfs2: ignore negated quota changes
Hans Verkuil <hverkuil-cisco(a)xs4all.nl>
media: vivid: avoid integer overflow
Rajeshwar R Shinde <coolrrsh(a)gmail.com>
media: gspca: cpia1: shift-out-of-bounds in set_flicker
Axel Lin <axel.lin(a)ingics.com>
i2c: sun6i-p2wi: Prevent potential division by zero
Hardik Gajjar <hgajjar(a)de.adit-jv.com>
usb: gadget: f_ncm: Always set current gadget in ncm_bind()
Yi Yang <yiyang13(a)huawei.com>
tty: vcc: Add check for kstrdup() in vcc_probe()
Jiri Kosina <jkosina(a)suse.cz>
HID: Add quirk for Dell Pro Wireless Keyboard and Mouse KM5221W
Wenchao Hao <haowenchao2(a)huawei.com>
scsi: libfc: Fix potential NULL pointer dereference in fc_lport_ptp_setup()
Ilpo Järvinen <ilpo.jarvinen(a)linux.intel.com>
atm: iphase: Do PCI error checks on own line
Cezary Rojewski <cezary.rojewski(a)intel.com>
ALSA: hda: Fix possible null-ptr-deref when assigning a stream
Vincent Whitchurch <vincent.whitchurch(a)axis.com>
ARM: 9320/1: fix stack depot IRQ stack filter
Manas Ghandat <ghandatmanas(a)gmail.com>
jfs: fix array-index-out-of-bounds in diAlloc
Manas Ghandat <ghandatmanas(a)gmail.com>
jfs: fix array-index-out-of-bounds in dbFindLeaf
Juntong Deng <juntong.deng(a)outlook.com>
fs/jfs: Add validity check for db_maxag and db_agpref
Juntong Deng <juntong.deng(a)outlook.com>
fs/jfs: Add check for negative db_l2nbperpage
Ilpo Järvinen <ilpo.jarvinen(a)linux.intel.com>
RDMA/hfi1: Use FIELD_GET() to extract Link Width
Lu Jialin <lujialin4(a)huawei.com>
crypto: pcrypt - Fix hungtask for PADATA_RESET
zhujun2 <zhujun2(a)cmss.chinamobile.com>
selftests/efivarfs: create-read: fix a resource leak
Qu Huang <qu.huang(a)linux.dev>
drm/amdgpu: Fix a null pointer access when the smc_rreg pointer is NULL
Mario Limonciello <mario.limonciello(a)amd.com>
drm/amd: Fix UBSAN array-index-out-of-bounds for Polaris and Tonga
Mario Limonciello <mario.limonciello(a)amd.com>
drm/amd: Fix UBSAN array-index-out-of-bounds for SMU7
Olli Asikainen <olli.asikainen(a)gmail.com>
platform/x86: thinkpad_acpi: Add battery quirk for Thinkpad X120e
ZhengHan Wang <wzhmmmmm(a)gmail.com>
Bluetooth: Fix double free in hci_conn_cleanup
Eric Dumazet <edumazet(a)google.com>
net: annotate data-races around sk->sk_dst_pending_confirm
Eric Dumazet <edumazet(a)google.com>
net: annotate data-races around sk->sk_tx_queue_mapping
Dmitry Antipov <dmantipov(a)yandex.ru>
wifi: ath10k: fix clang-specific fortify warning
Dmitry Antipov <dmantipov(a)yandex.ru>
wifi: ath9k: fix clang-specific fortify warnings
Ping-Ke Shih <pkshih(a)realtek.com>
wifi: mac80211: don't return unset power in ieee80211_get_tx_power()
Mike Rapoport (IBM) <rppt(a)kernel.org>
x86/mm: Drop the 4 MB restriction on minimal NUMA node memory size
Ronald Wahl <ronald.wahl(a)raritan.com>
clocksource/drivers/timer-atmel-tcb: Fix initialization on SAM9 hardware
Jacky Bai <ping.bai(a)nxp.com>
clocksource/drivers/timer-imx-gpt: Fix potential memory leak
Shuai Xue <xueshuai(a)linux.alibaba.com>
perf/core: Bail out early if the request AUX area is out of bound
John Stultz <jstultz(a)google.com>
locking/ww_mutex/test: Fix potential workqueue corruption
-------------
Diffstat:
Makefile | 4 +-
arch/arm/include/asm/exception.h | 4 --
arch/parisc/include/uapi/asm/pdc.h | 1 +
arch/parisc/kernel/entry.S | 7 ++--
arch/parisc/kernel/head.S | 5 +--
arch/s390/mm/page-states.c | 19 +++++++--
arch/x86/include/asm/msr-index.h | 1 +
arch/x86/include/asm/numa.h | 7 ----
arch/x86/kvm/x86.c | 2 +
arch/x86/mm/numa.c | 7 ----
crypto/pcrypt.c | 4 ++
drivers/atm/iphase.c | 20 +++++----
drivers/clk/qcom/gcc-ipq8074.c | 6 ---
drivers/clocksource/tcb_clksrc.c | 1 +
drivers/clocksource/timer-imx-gpt.c | 18 +++++---
drivers/dma/stm32-mdma.c | 4 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 1 +
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 6 +++
drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 4 +-
drivers/gpu/drm/amd/include/pptable.h | 4 +-
drivers/gpu/drm/amd/powerplay/hwmgr/pptable_v1_0.h | 16 +++----
drivers/hid/hid-ids.h | 1 +
drivers/hid/hid-quirks.c | 1 +
drivers/i2c/busses/i2c-i801.c | 19 ++++-----
drivers/i2c/busses/i2c-sun6i-p2wi.c | 5 +++
drivers/infiniband/hw/hfi1/pcie.c | 9 +---
drivers/mcb/mcb-core.c | 1 +
drivers/mcb/mcb-parse.c | 2 +-
drivers/media/platform/qcom/venus/hfi_msgs.c | 2 +-
drivers/media/platform/qcom/venus/hfi_parser.c | 15 +++++++
drivers/media/platform/qcom/venus/hfi_venus.c | 10 +++++
drivers/media/platform/vivid/vivid-rds-gen.c | 2 +-
drivers/media/rc/ir-sharp-decoder.c | 8 ++--
drivers/media/rc/lirc_dev.c | 6 ++-
drivers/media/usb/gspca/cpia1.c | 3 ++
drivers/mmc/host/meson-gx-mmc.c | 1 -
drivers/mmc/host/vub300.c | 1 +
drivers/net/dsa/lan9303_mdio.c | 4 +-
drivers/net/ethernet/cortina/gemini.c | 45 +++++++++++++-------
drivers/net/ethernet/cortina/gemini.h | 4 +-
drivers/net/ethernet/realtek/r8169_main.c | 4 +-
drivers/net/ipvlan/ipvlan_core.c | 41 +++++++++++-------
drivers/net/macvlan.c | 2 +-
drivers/net/ppp/ppp_synctty.c | 6 ++-
drivers/net/wireless/ath/ath10k/debug.c | 2 +-
drivers/net/wireless/ath/ath9k/debug.c | 2 +-
drivers/net/wireless/ath/ath9k/htc_drv_debug.c | 2 +-
drivers/parisc/power.c | 16 ++++++-
drivers/pci/controller/dwc/pci-keystone.c | 8 ++--
drivers/pci/pci-acpi.c | 2 +-
drivers/pci/pci-sysfs.c | 5 +--
drivers/platform/x86/thinkpad_acpi.c | 1 +
drivers/ptp/ptp_chardev.c | 3 +-
drivers/ptp/ptp_clock.c | 5 ++-
drivers/ptp/ptp_private.h | 8 +++-
drivers/ptp/ptp_sysfs.c | 3 +-
drivers/scsi/libfc/fc_lport.c | 6 +++
drivers/scsi/virtio_scsi.c | 1 +
drivers/tty/hvc/hvc_xen.c | 5 ++-
drivers/tty/serial/meson_uart.c | 49 +++++++++++++++-------
drivers/tty/vcc.c | 16 +++++--
drivers/usb/gadget/function/f_ncm.c | 27 +++++-------
drivers/xen/events/events_base.c | 4 +-
fs/cifs/cifs_spnego.c | 4 +-
fs/ext4/acl.h | 5 +++
fs/ext4/resize.c | 19 ++++-----
fs/gfs2/quota.c | 11 +++++
fs/iomap.c | 3 ++
fs/jbd2/recovery.c | 8 ++++
fs/jfs/jfs_dmap.c | 23 +++++++---
fs/jfs/jfs_imap.c | 5 ++-
fs/nfs/nfs4proc.c | 5 ++-
fs/quota/dquot.c | 14 +++++++
include/linux/pwm.h | 4 +-
include/net/sock.h | 26 ++++++++----
kernel/audit_watch.c | 9 +++-
kernel/events/ring_buffer.c | 6 +++
kernel/irq/generic-chip.c | 25 ++++++++---
kernel/locking/test-ww_mutex.c | 20 +++++----
kernel/padata.c | 2 +-
kernel/power/snapshot.c | 16 ++++---
net/bluetooth/hci_conn.c | 6 +--
net/bluetooth/hci_sysfs.c | 23 +++++-----
net/core/sock.c | 2 +-
net/ipv4/tcp_output.c | 2 +-
net/mac80211/cfg.c | 4 ++
net/sched/sch_api.c | 5 ++-
net/tipc/netlink_compat.c | 1 +
scripts/gcc-plugins/randomize_layout_plugin.c | 11 +++--
sound/core/info.c | 21 ++++++----
sound/hda/hdac_stream.c | 6 ++-
sound/pci/hda/patch_realtek.c | 1 +
tools/testing/selftests/efivarfs/create-read.c | 2 +
93 files changed, 514 insertions(+), 273 deletions(-)
This is the start of the stable review cycle for the 4.14.331 release.
There are 57 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 Sun, 26 Nov 2023 17:19:17 +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/v4.x/stable-review/patch-4.14.331-r…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.14.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.14.331-rc1
Eric Dumazet <edumazet(a)google.com>
net: sched: fix race condition in qdisc_graft()
Dongli Zhang <dongli.zhang(a)oracle.com>
scsi: virtio_scsi: limit number of hw queues by nr_cpu_ids
Kemeng Shi <shikemeng(a)huaweicloud.com>
ext4: remove gdb backup copy for meta bg in setup_new_flex_group_blocks
Kemeng Shi <shikemeng(a)huaweicloud.com>
ext4: correct return value of ext4_convert_meta_bg
Kemeng Shi <shikemeng(a)huaweicloud.com>
ext4: correct offset of gdb backup in non meta_bg group to update_backups
Max Kellermann <max.kellermann(a)ionos.com>
ext4: apply umask if ACL support is disabled
Vikash Garodia <quic_vgarodia(a)quicinc.com>
media: venus: hfi: fix the check to handle session buffer requirement
Sean Young <sean(a)mess.org>
media: sharp: fix sharp encoding
Heiner Kallweit <hkallweit1(a)gmail.com>
i2c: i801: fix potential race in i801_block_transaction_byte_by_byte
Alexander Sverdlin <alexander.sverdlin(a)siemens.com>
net: dsa: lan9303: consequently nested-lock physical MDIO
Takashi Iwai <tiwai(a)suse.de>
ALSA: info: Fix potential deadlock at disconnection
Helge Deller <deller(a)gmx.de>
parisc/power: Fix power soft-off when running on qemu
Helge Deller <deller(a)gmx.de>
parisc/pgtable: Do not drop upper 5 address bits of physical address
Helge Deller <deller(a)gmx.de>
parisc: Prevent booting 64-bit kernels on PA1.x machines
Heiko Carstens <hca(a)linux.ibm.com>
s390/cmma: fix handling of swapper_pg_dir and invalid_pg_dir
Heiko Carstens <hca(a)linux.ibm.com>
s390/cmma: fix initial kernel address space page table walk
Sanjuán García, Jorge <Jorge.SanjuanGarcia(a)duagon.com>
mcb: fix error handling for different scenarios when parsing
Zhihao Cheng <chengzhihao1(a)huawei.com>
jbd2: fix potential data lost in recovering journal raced with synchronizing fs bdev
Herve Codina <herve.codina(a)bootlin.com>
genirq/generic_chip: Make irq_remove_generic_chip() irqdomain aware
Rong Chen <rong.chen(a)amlogic.com>
mmc: meson-gx: Remove setting of CMD_CFG_ERROR
Brian Geffon <bgeffon(a)google.com>
PM: hibernate: Clean up sync_read handling in snapshot_write_next()
Brian Geffon <bgeffon(a)google.com>
PM: hibernate: Use __get_safe_page() rather than touching the list
Dan Carpenter <dan.carpenter(a)linaro.org>
mmc: vub300: fix an error code
Helge Deller <deller(a)gmx.de>
parisc/power: Add power soft-off when running on qemu
Lukas Wunner <lukas(a)wunner.de>
PCI/sysfs: Protect driver's D3cold preference from user space
David Woodhouse <dwmw(a)amazon.co.uk>
hvc/xen: fix error path in xen_hvc_init() to always register frontend driver
Paul Moore <paul(a)paul-moore.com>
audit: don't WARN_ON_ONCE(!current->mm) in audit_exe_compare()
Paul Moore <paul(a)paul-moore.com>
audit: don't take task_lock() in audit_exe_compare() code path
Maciej S. Szmigiero <maciej.szmigiero(a)oracle.com>
KVM: x86: Ignore MSR_AMD64_TW_CFG access
Kees Cook <keescook(a)chromium.org>
randstruct: Fix gcc-plugin performance mode to stay in group
Vikash Garodia <quic_vgarodia(a)quicinc.com>
media: venus: hfi: add checks to perform sanity on queue pointers
Dan Carpenter <dan.carpenter(a)linaro.org>
pwm: Fix double shift bug
Bob Peterson <rpeterso(a)redhat.com>
gfs2: ignore negated quota changes
Hans Verkuil <hverkuil-cisco(a)xs4all.nl>
media: vivid: avoid integer overflow
Rajeshwar R Shinde <coolrrsh(a)gmail.com>
media: gspca: cpia1: shift-out-of-bounds in set_flicker
Axel Lin <axel.lin(a)ingics.com>
i2c: sun6i-p2wi: Prevent potential division by zero
Yi Yang <yiyang13(a)huawei.com>
tty: vcc: Add check for kstrdup() in vcc_probe()
Wenchao Hao <haowenchao2(a)huawei.com>
scsi: libfc: Fix potential NULL pointer dereference in fc_lport_ptp_setup()
Ilpo Järvinen <ilpo.jarvinen(a)linux.intel.com>
atm: iphase: Do PCI error checks on own line
Cezary Rojewski <cezary.rojewski(a)intel.com>
ALSA: hda: Fix possible null-ptr-deref when assigning a stream
Manas Ghandat <ghandatmanas(a)gmail.com>
jfs: fix array-index-out-of-bounds in diAlloc
Manas Ghandat <ghandatmanas(a)gmail.com>
jfs: fix array-index-out-of-bounds in dbFindLeaf
Juntong Deng <juntong.deng(a)outlook.com>
fs/jfs: Add validity check for db_maxag and db_agpref
Juntong Deng <juntong.deng(a)outlook.com>
fs/jfs: Add check for negative db_l2nbperpage
Ilpo Järvinen <ilpo.jarvinen(a)linux.intel.com>
RDMA/hfi1: Use FIELD_GET() to extract Link Width
Lu Jialin <lujialin4(a)huawei.com>
crypto: pcrypt - Fix hungtask for PADATA_RESET
zhujun2 <zhujun2(a)cmss.chinamobile.com>
selftests/efivarfs: create-read: fix a resource leak
Mario Limonciello <mario.limonciello(a)amd.com>
drm/amd: Fix UBSAN array-index-out-of-bounds for Polaris and Tonga
Mario Limonciello <mario.limonciello(a)amd.com>
drm/amd: Fix UBSAN array-index-out-of-bounds for SMU7
Eric Dumazet <edumazet(a)google.com>
net: annotate data-races around sk->sk_dst_pending_confirm
Dmitry Antipov <dmantipov(a)yandex.ru>
wifi: ath10k: fix clang-specific fortify warning
Dmitry Antipov <dmantipov(a)yandex.ru>
wifi: ath9k: fix clang-specific fortify warnings
Ping-Ke Shih <pkshih(a)realtek.com>
wifi: mac80211: don't return unset power in ieee80211_get_tx_power()
Mike Rapoport (IBM) <rppt(a)kernel.org>
x86/mm: Drop the 4 MB restriction on minimal NUMA node memory size
Ronald Wahl <ronald.wahl(a)raritan.com>
clocksource/drivers/timer-atmel-tcb: Fix initialization on SAM9 hardware
Jacky Bai <ping.bai(a)nxp.com>
clocksource/drivers/timer-imx-gpt: Fix potential memory leak
John Stultz <jstultz(a)google.com>
locking/ww_mutex/test: Fix potential workqueue corruption
-------------
Diffstat:
Makefile | 4 ++--
arch/parisc/kernel/entry.S | 7 +++---
arch/parisc/kernel/head.S | 5 ++---
arch/s390/mm/page-states.c | 19 +++++++++++++---
arch/x86/include/asm/msr-index.h | 1 +
arch/x86/include/asm/numa.h | 7 ------
arch/x86/kvm/x86.c | 2 ++
arch/x86/mm/numa.c | 7 ------
crypto/pcrypt.c | 4 ++++
drivers/atm/iphase.c | 20 +++++++++--------
drivers/clocksource/tcb_clksrc.c | 1 +
drivers/clocksource/timer-imx-gpt.c | 18 +++++++++++-----
drivers/gpu/drm/amd/include/pptable.h | 4 ++--
drivers/gpu/drm/amd/powerplay/hwmgr/pptable_v1_0.h | 16 +++++++-------
drivers/i2c/busses/i2c-i801.c | 19 ++++++++--------
drivers/i2c/busses/i2c-sun6i-p2wi.c | 5 +++++
drivers/infiniband/hw/hfi1/pcie.c | 9 ++------
drivers/mcb/mcb-core.c | 1 +
drivers/mcb/mcb-parse.c | 2 +-
drivers/media/platform/qcom/venus/hfi_msgs.c | 2 +-
drivers/media/platform/qcom/venus/hfi_venus.c | 10 +++++++++
drivers/media/platform/vivid/vivid-rds-gen.c | 2 +-
drivers/media/rc/ir-sharp-decoder.c | 8 ++++---
drivers/media/usb/gspca/cpia1.c | 3 +++
drivers/mmc/host/meson-gx-mmc.c | 1 -
drivers/mmc/host/vub300.c | 1 +
drivers/net/dsa/lan9303_mdio.c | 4 ++--
drivers/net/wireless/ath/ath10k/debug.c | 2 +-
drivers/net/wireless/ath/ath9k/debug.c | 2 +-
drivers/net/wireless/ath/ath9k/htc_drv_debug.c | 2 +-
drivers/parisc/power.c | 16 +++++++++++++-
drivers/pci/pci-acpi.c | 2 +-
drivers/pci/pci-sysfs.c | 5 +----
drivers/scsi/libfc/fc_lport.c | 6 ++++++
drivers/scsi/virtio_scsi.c | 1 +
drivers/tty/hvc/hvc_xen.c | 5 +++--
drivers/tty/vcc.c | 16 +++++++++++---
fs/ext4/acl.h | 5 +++++
fs/ext4/resize.c | 19 ++++++----------
fs/gfs2/quota.c | 11 ++++++++++
fs/jbd2/recovery.c | 8 +++++++
fs/jfs/jfs_dmap.c | 23 +++++++++++++++-----
fs/jfs/jfs_imap.c | 5 ++++-
include/linux/pwm.h | 4 ++--
include/net/sock.h | 6 +++---
kernel/audit_watch.c | 9 +++++++-
kernel/irq/generic-chip.c | 25 ++++++++++++++++------
kernel/locking/test-ww_mutex.c | 20 ++++++++++-------
kernel/padata.c | 2 +-
kernel/power/snapshot.c | 16 ++++++--------
net/core/sock.c | 2 +-
net/ipv4/tcp_output.c | 2 +-
net/mac80211/cfg.c | 4 ++++
net/sched/sch_api.c | 5 +++--
scripts/gcc-plugins/randomize_layout_plugin.c | 11 +++++++---
sound/core/info.c | 21 +++++++++++-------
sound/hda/hdac_stream.c | 6 ++++--
tools/testing/selftests/efivarfs/create-read.c | 2 ++
58 files changed, 290 insertions(+), 155 deletions(-)
The callers of vfs_iter_write() are required to hold file_start_write().
file_start_write() is a no-op for the S_ISBLK() case, but it is really
needed when the backing file is a regular file.
We are going to move file_{start,end}_write() into vfs_iter_write(), but
we need to fix this first, so that the fix could be backported to stable
kernels.
Suggested-by: Christoph Hellwig <hch(a)lst.de>
Link: https://lore.kernel.org/r/ZV8ETIpM+wZa33B5@infradead.org/
Cc: stable(a)vger.kernel.org
Signed-off-by: Amir Goldstein <amir73il(a)gmail.com>
---
Hi Martin,
This bug is already fixed by commit "fs: move file_start_write() into
vfs_iter_write()" on the vfs.rw branch in Christian's vfs tree, but
Christoph suggested that I post a separate backportable fix for the scsi
target code.
You may decide if this is worth expediting to v6.7-rc or not.
If not, then I think it would be best if Christian insert this patch
at the bottom of the vfs.rw branch and revert in the later aformentioned
commit.
If you prefer to expedite it to v6.7-rc, then it's probably best to
rebase vfs.rw branch after the fix hits master.
Please let us know how you prefer to handle this patch.
Thanks,
Amir.
drivers/target/target_core_file.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index 4d447520bab8..4e4cf6c34a77 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -332,11 +332,13 @@ static int fd_do_rw(struct se_cmd *cmd, struct file *fd,
}
iov_iter_bvec(&iter, is_write, bvec, sgl_nents, len);
- if (is_write)
+ if (is_write) {
+ file_start_write(fd);
ret = vfs_iter_write(fd, &iter, &pos, 0);
- else
+ file_end_write(fd);
+ } else {
ret = vfs_iter_read(fd, &iter, &pos, 0);
-
+ }
if (is_write) {
if (ret < 0 || ret != data_length) {
pr_err("%s() write returned %d\n", __func__, ret);
@@ -467,7 +469,9 @@ fd_execute_write_same(struct se_cmd *cmd)
}
iov_iter_bvec(&iter, ITER_SOURCE, bvec, nolb, len);
+ file_start_write(fd_dev->fd_file);
ret = vfs_iter_write(fd_dev->fd_file, &iter, &pos, 0);
+ file_end_write(fd_dev->fd_file);
kfree(bvec);
if (ret < 0 || ret != len) {
--
2.34.1
The quilt patch titled
Subject: mm,oom_reaper: avoid run queue_oom_reaper if task is not oom
has been removed from the -mm tree. Its filename was
mmoom_reaper-avoid-run-queue_oom_reaper-if-task-is-not-oom.patch
This patch was dropped because it was nacked
------------------------------------------------------
From: gaoxu <gaoxu2(a)hihonor.com>
Subject: mm,oom_reaper: avoid run queue_oom_reaper if task is not oom
Date: Wed, 22 Nov 2023 12:46:44 +0000
queue_oom_reaper() tests and sets tsk->signal->oom_mm->flags. However, it
is necessary to check if 'tsk' is an OOM victim before executing
'queue_oom_reaper' because the variable may be NULL.
We encountered such an issue, and the log is as follows:
[3701:11_see]Out of memory: Killed process 3154 (system_server)
total-vm:23662044kB, anon-rss:0kB, file-rss:0kB, shmem-rss:0kB,
UID:1000 pgtables:4056kB oom_score_adj:-900
[3701:11_see][RB/E]rb_sreason_str_set: sreason_str set null_pointer
[3701:11_see][RB/E]rb_sreason_str_set: sreason_str set unknown_addr
[3701:11_see]Unable to handle kernel NULL pointer dereference at virtual
address 0000000000000328
[3701:11_see]user pgtable: 4k pages, 39-bit VAs, pgdp=3D00000000821de000
[3701:11_see][0000000000000328] pgd=3D0000000000000000,
p4d=3D0000000000000000,pud=3D0000000000000000
[3701:11_see]tracing off
[3701:11_see]Internal error: Oops: 96000005 [#1] PREEMPT SMP
[3701:11_see]Call trace:
[3701:11_see] queue_oom_reaper+0x30/0x170
[3701:11_see] __oom_kill_process+0x590/0x860
[3701:11_see] oom_kill_process+0x140/0x274
[3701:11_see] out_of_memory+0x2f4/0x54c
[3701:11_see] __alloc_pages_slowpath+0x5d8/0xaac
[3701:11_see] __alloc_pages+0x774/0x800
[3701:11_see] wp_page_copy+0xc4/0x116c
[3701:11_see] do_wp_page+0x4bc/0x6fc
[3701:11_see] handle_pte_fault+0x98/0x2a8
[3701:11_see] __handle_mm_fault+0x368/0x700
[3701:11_see] do_handle_mm_fault+0x160/0x2cc
[3701:11_see] do_page_fault+0x3e0/0x818
[3701:11_see] do_mem_abort+0x68/0x17c
[3701:11_see] el0_da+0x3c/0xa0
[3701:11_see] el0t_64_sync_handler+0xc4/0xec
[3701:11_see] el0t_64_sync+0x1b4/0x1b8
[3701:11_see]tracing off
Link: https://lkml.kernel.org/r/400d13bddb524ef6af37cb2220808c75@hihonor.com
Signed-off-by: Gao Xu <gaoxu2(a)hihonor.com>
Cc: Suren Baghdasaryan <surenb(a)google.com>
Cc: Michal Hocko <mhocko(a)suse.com>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
---
mm/oom_kill.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/mm/oom_kill.c~mmoom_reaper-avoid-run-queue_oom_reaper-if-task-is-not-oom
+++ a/mm/oom_kill.c
@@ -984,7 +984,7 @@ static void __oom_kill_process(struct ta
}
rcu_read_unlock();
- if (can_oom_reap)
+ if (can_oom_reap && tsk_is_oom_victim(victim))
queue_oom_reaper(victim);
mmdrop(mm);
_
Patches currently in -mm which might be from gaoxu2(a)hihonor.com are
Hi Greg
6.6.3-rc1
compiles, boots and runs[1] here on x86_64
(Intel Rocket Lake: i5-11400)
Thanks
[1] a vbox crash I first got known off today:
https://www.virtualbox.org/ticket/21898
Tested-by: Ronald Warsow <rwarsow(a)gmx.de>
Hi Greg, Sasha,
The batch contains Netfilter fixes for -stable 5.4. This batch is
targeting at garbage collection (GC) / set timeout fixes that address
possible UaF and memleaks as well as assorted bugs.
I am using original commit IDs for reference:
1) 0c2a85edd143 ("netfilter: nf_tables: pass context to nft_set_destroy()")
2) f8bb7889af58 ("netfilter: nftables: rename set element data activation/deactivation functions")
3) 628bd3e49cba ("netfilter: nf_tables: drop map element references from preparation phase")
4) c9e6978e2725 ("netfilter: nft_set_rbtree: Switch to node list walk for overlap detection")
5) 61ae320a29b0 ("netfilter: nft_set_rbtree: fix null deref on element insertion")
6) f718863aca46 ("netfilter: nft_set_rbtree: fix overlap expiration walk")
7) 24138933b97b ("netfilter: nf_tables: don't skip expired elements during walk")
8) 5f68718b34a5 ("netfilter: nf_tables: GC transaction API to avoid race with control plane")
9) f6c383b8c31a ("netfilter: nf_tables: adapt set backend to use GC transaction API")
10) c92db3030492 ("netfilter: nft_set_hash: mark set element as dead when deleting from packet path")
11) a2dd0233cbc4 ("netfilter: nf_tables: remove busy mark and gc batch API")
12) 6a33d8b73dfa ("netfilter: nf_tables: fix GC transaction races with netns and netlink event exit path")
13) 02c6c24402bf ("netfilter: nf_tables: GC transaction race with netns dismantle")
14) 720344340fb9 ("netfilter: nf_tables: GC transaction race with abort path")
15) 8357bc946a2a ("netfilter: nf_tables: use correct lock to protect gc_list")
16) 8e51830e29e1 ("netfilter: nf_tables: defer gc run if previous batch is still pending")
17) 2ee52ae94baa ("netfilter: nft_set_rbtree: skip sync GC for new elements in this transaction")
18) 96b33300fba8 ("netfilter: nft_set_rbtree: use read spinlock to avoid datapath contention")
19) b079155faae9 ("netfilter: nft_set_hash: try later when GC hits EAGAIN on iteration")
20) cf5000a7787c ("netfilter: nf_tables: fix memleak when more than 255 elements expired")
21) 6069da443bf6 ("netfilter: nf_tables: unregister flowtable hooks on netns exit")
22) f9a43007d3f7 ("netfilter: nf_tables: double hook unregistration in netns path")
23) 0ce7cf4127f1 ("netfilter: nftables: update table flags from the commit phase")
24) 179d9ba5559a ("netfilter: nf_tables: fix table flag updates")
25) c9bd26513b3a ("netfilter: nf_tables: disable toggling dormant table state more than once")
26) ("netfilter: nf_tables: bogus EBUSY when deleting flowtable after flush (for 5.4)")
does not exist in any tree, but it is required to fix a bogus EBUSY error in 5.4.
This bug was implicitly fixed by 3f0465a9ef02 ("netfilter: nf_tables: dynamically
allocate hooks per net_device in flowtables").
Please apply,
Thanks.
Florian Westphal (4):
netfilter: nft_set_rbtree: fix null deref on element insertion
netfilter: nft_set_rbtree: fix overlap expiration walk
netfilter: nf_tables: don't skip expired elements during walk
netfilter: nf_tables: defer gc run if previous batch is still pending
Pablo Neira Ayuso (22):
netfilter: nf_tables: pass context to nft_set_destroy()
netfilter: nftables: rename set element data activation/deactivation functions
netfilter: nf_tables: drop map element references from preparation phase
netfilter: nft_set_rbtree: Switch to node list walk for overlap detection
netfilter: nf_tables: GC transaction API to avoid race with control plane
netfilter: nf_tables: adapt set backend to use GC transaction API
netfilter: nft_set_hash: mark set element as dead when deleting from packet path
netfilter: nf_tables: remove busy mark and gc batch API
netfilter: nf_tables: fix GC transaction races with netns and netlink event exit path
netfilter: nf_tables: GC transaction race with netns dismantle
netfilter: nf_tables: GC transaction race with abort path
netfilter: nf_tables: use correct lock to protect gc_list
netfilter: nft_set_rbtree: skip sync GC for new elements in this transaction
netfilter: nft_set_rbtree: use read spinlock to avoid datapath contention
netfilter: nft_set_hash: try later when GC hits EAGAIN on iteration
netfilter: nf_tables: fix memleak when more than 255 elements expired
netfilter: nf_tables: unregister flowtable hooks on netns exit
netfilter: nf_tables: double hook unregistration in netns path
netfilter: nftables: update table flags from the commit phase
netfilter: nf_tables: fix table flag updates
netfilter: nf_tables: disable toggling dormant table state more than once
netfilter: nf_tables: bogus EBUSY when deleting flowtable after flush (for 5.4)
include/net/netfilter/nf_tables.h | 129 +++---
include/uapi/linux/netfilter/nf_tables.h | 1 +
net/netfilter/nf_tables_api.c | 512 +++++++++++++++++++----
net/netfilter/nft_chain_filter.c | 3 +
net/netfilter/nft_set_bitmap.c | 5 +-
net/netfilter/nft_set_hash.c | 110 +++--
net/netfilter/nft_set_rbtree.c | 375 +++++++++++++----
7 files changed, 867 insertions(+), 268 deletions(-)
--
2.30.2
The patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x 85dd3af64965c1c0eb7373b340a1b1f7773586b0
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112041-creasing-democrat-d805@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^..
Possible dependencies:
85dd3af64965 ("mmc: sdhci-pci-gli: GL9755: Mask the replay timer timeout of AER")
f3a5b56c1286 ("mmc: sdhci-pci-gli: Add Genesys Logic GL9767 support")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 85dd3af64965c1c0eb7373b340a1b1f7773586b0 Mon Sep 17 00:00:00 2001
From: Victor Shih <victor.shih(a)genesyslogic.com.tw>
Date: Tue, 7 Nov 2023 17:57:41 +0800
Subject: [PATCH] mmc: sdhci-pci-gli: GL9755: Mask the replay timer timeout of
AER
Due to a flaw in the hardware design, the GL9755 replay timer frequently
times out when ASPM is enabled. As a result, the warning messages will
often appear in the system log when the system accesses the GL9755
PCI config. Therefore, the replay timer timeout must be masked.
Fixes: 36ed2fd32b2c ("mmc: sdhci-pci-gli: A workaround to allow GL9755 to enter ASPM L1.2")
Signed-off-by: Victor Shih <victor.shih(a)genesyslogic.com.tw>
Acked-by: Adrian Hunter <adrian.hunter(a)intel.com>
Acked-by: Kai-Heng Feng <kai.heng.geng(a)canonical.com>
Cc: stable(a)vger.kernel.org
Link: https://lore.kernel.org/r/20231107095741.8832-3-victorshihgli@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson(a)linaro.org>
diff --git a/drivers/mmc/host/sdhci-pci-gli.c b/drivers/mmc/host/sdhci-pci-gli.c
index d83261e857a5..044b4704d5bb 100644
--- a/drivers/mmc/host/sdhci-pci-gli.c
+++ b/drivers/mmc/host/sdhci-pci-gli.c
@@ -152,6 +152,9 @@
#define PCI_GLI_9755_PM_CTRL 0xFC
#define PCI_GLI_9755_PM_STATE GENMASK(1, 0)
+#define PCI_GLI_9755_CORRERR_MASK 0x214
+#define PCI_GLI_9755_CORRERR_MASK_REPLAY_TIMER_TIMEOUT BIT(12)
+
#define SDHCI_GLI_9767_GM_BURST_SIZE 0x510
#define SDHCI_GLI_9767_GM_BURST_SIZE_AXI_ALWAYS_SET BIT(8)
@@ -770,6 +773,11 @@ static void gl9755_hw_setting(struct sdhci_pci_slot *slot)
value &= ~PCI_GLI_9755_PM_STATE;
pci_write_config_dword(pdev, PCI_GLI_9755_PM_CTRL, value);
+ /* mask the replay timer timeout of AER */
+ pci_read_config_dword(pdev, PCI_GLI_9755_CORRERR_MASK, &value);
+ value |= PCI_GLI_9755_CORRERR_MASK_REPLAY_TIMER_TIMEOUT;
+ pci_write_config_dword(pdev, PCI_GLI_9755_CORRERR_MASK, value);
+
gl9755_wt_off(pdev);
}
Hi,
I notice a stable-specific regression on Bugzilla [1]. Quoting from it:
> The backport commit to 5.15 branch:
> 9d4f84a15f9c9727bc07f59d9dafc89e65aadb34 "arm64: dts: imx8mp: Add snps,gfladj-refclk-lpm-sel quirk to USB nodes" (from upstream commit 5c3d5ecf48ab06c709c012bf1e8f0c91e1fcd7ad)
> switched from "snps,dis-u2-freeclk-exists-quirk" to "snps,gfladj-refclk-lpm-sel-quirk".
>
> The problem is that the gfladj-refclk-lpm-sel-quirk quirk is not implemented / backported to 5.15 branch.
>
> This commit should be either reverted, or the commit introducing gfladj-refclk-lpm-sel-quirk needs to be merged to 5.15 kernel branch.
>
> As a result of this patch, on Gateworks Venice GW7400 revB board the USB 3.x devices which are connected to the USB Type C port does not enumerate and the following errors are generated:
>
> [ 14.906302] xhci-hcd xhci-hcd.0.auto: Timeout while waiting for setup device command
> [ 15.122383] usb 2-1: device not accepting address 2, error -62
> [ 25.282195] xhci-hcd xhci-hcd.0.auto: Abort failed to stop command ring: -110
> [ 25.297408] xhci-hcd xhci-hcd.0.auto: xHCI host controller not responding, assume dead
> [ 25.305345] xhci-hcd xhci-hcd.0.auto: HC died; cleaning up
> [ 25.311058] xhci-hcd xhci-hcd.0.auto: Timeout while waiting for stop endpoint command
> [ 25.334361] usb usb2-port1: couldn't allocate usb_device
>
> When the commit is reverted the USB 3.x drives works fine.
See Bugzilla for the full thread and attach dmesgs.
Anyway, I'm adding it to regzbot:
#regzbot introduced: 9d4f84a15f9c97 https://bugzilla.kernel.org/show_bug.cgi?id=217670
#regzbot title: regression in USB DWC3 driver due to missing gfladj-refclk-lpm-sel-quirk quirk
Thanks.
[1]: https://bugzilla.kernel.org/show_bug.cgi?id=217670
--
An old man doll... just what I always wanted! - Clara
The patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.4.y
git checkout FETCH_HEAD
git cherry-pick -x bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023110614-natural-tweak-9ee4@gregkh' --subject-prefix 'PATCH 5.4.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 Mon Sep 17 00:00:00 2001
From: "Steven Rostedt (Google)" <rostedt(a)goodmis.org>
Date: Tue, 31 Oct 2023 12:24:53 -0400
Subject: [PATCH] tracing: Have trace_event_file have ref counters
The following can crash the kernel:
# cd /sys/kernel/tracing
# echo 'p:sched schedule' > kprobe_events
# exec 5>>events/kprobes/sched/enable
# > kprobe_events
# exec 5>&-
The above commands:
1. Change directory to the tracefs directory
2. Create a kprobe event (doesn't matter what one)
3. Open bash file descriptor 5 on the enable file of the kprobe event
4. Delete the kprobe event (removes the files too)
5. Close the bash file descriptor 5
The above causes a crash!
BUG: kernel NULL pointer dereference, address: 0000000000000028
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 0 P4D 0
Oops: 0000 [#1] PREEMPT SMP PTI
CPU: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
RIP: 0010:tracing_release_file_tr+0xc/0x50
What happens here is that the kprobe event creates a trace_event_file
"file" descriptor that represents the file in tracefs to the event. It
maintains state of the event (is it enabled for the given instance?).
Opening the "enable" file gets a reference to the event "file" descriptor
via the open file descriptor. When the kprobe event is deleted, the file is
also deleted from the tracefs system which also frees the event "file"
descriptor.
But as the tracefs file is still opened by user space, it will not be
totally removed until the final dput() is called on it. But this is not
true with the event "file" descriptor that is already freed. If the user
does a write to or simply closes the file descriptor it will reference the
event "file" descriptor that was just freed, causing a use-after-free bug.
To solve this, add a ref count to the event "file" descriptor as well as a
new flag called "FREED". The "file" will not be freed until the last
reference is released. But the FREE flag will be set when the event is
removed to prevent any more modifications to that event from happening,
even if there's still a reference to the event "file" descriptor.
Link: https://lore.kernel.org/linux-trace-kernel/20231031000031.1e705592@gandalf.…
Link: https://lore.kernel.org/linux-trace-kernel/20231031122453.7a48b923@gandalf.…
Cc: stable(a)vger.kernel.org
Cc: Mark Rutland <mark.rutland(a)arm.com>
Fixes: f5ca233e2e66d ("tracing: Increase trace array ref count on enable and filter files")
Reported-by: Beau Belgrave <beaub(a)linux.microsoft.com>
Tested-by: Beau Belgrave <beaub(a)linux.microsoft.com>
Reviewed-by: Masami Hiramatsu (Google) <mhiramat(a)kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt(a)goodmis.org>
diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h
index 12207dc6722d..696f8dc4aa53 100644
--- a/include/linux/trace_events.h
+++ b/include/linux/trace_events.h
@@ -492,6 +492,7 @@ enum {
EVENT_FILE_FL_TRIGGER_COND_BIT,
EVENT_FILE_FL_PID_FILTER_BIT,
EVENT_FILE_FL_WAS_ENABLED_BIT,
+ EVENT_FILE_FL_FREED_BIT,
};
extern struct trace_event_file *trace_get_event_file(const char *instance,
@@ -630,6 +631,7 @@ extern int __kprobe_event_add_fields(struct dynevent_cmd *cmd, ...);
* TRIGGER_COND - When set, one or more triggers has an associated filter
* PID_FILTER - When set, the event is filtered based on pid
* WAS_ENABLED - Set when enabled to know to clear trace on module removal
+ * FREED - File descriptor is freed, all fields should be considered invalid
*/
enum {
EVENT_FILE_FL_ENABLED = (1 << EVENT_FILE_FL_ENABLED_BIT),
@@ -643,6 +645,7 @@ enum {
EVENT_FILE_FL_TRIGGER_COND = (1 << EVENT_FILE_FL_TRIGGER_COND_BIT),
EVENT_FILE_FL_PID_FILTER = (1 << EVENT_FILE_FL_PID_FILTER_BIT),
EVENT_FILE_FL_WAS_ENABLED = (1 << EVENT_FILE_FL_WAS_ENABLED_BIT),
+ EVENT_FILE_FL_FREED = (1 << EVENT_FILE_FL_FREED_BIT),
};
struct trace_event_file {
@@ -671,6 +674,7 @@ struct trace_event_file {
* caching and such. Which is mostly OK ;-)
*/
unsigned long flags;
+ atomic_t ref; /* ref count for opened files */
atomic_t sm_ref; /* soft-mode reference counter */
atomic_t tm_ref; /* trigger-mode reference counter */
};
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 2539cfc20a97..9aebf904ff97 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -4978,6 +4978,20 @@ int tracing_open_file_tr(struct inode *inode, struct file *filp)
if (ret)
return ret;
+ mutex_lock(&event_mutex);
+
+ /* Fail if the file is marked for removal */
+ if (file->flags & EVENT_FILE_FL_FREED) {
+ trace_array_put(file->tr);
+ ret = -ENODEV;
+ } else {
+ event_file_get(file);
+ }
+
+ mutex_unlock(&event_mutex);
+ if (ret)
+ return ret;
+
filp->private_data = inode->i_private;
return 0;
@@ -4988,6 +5002,7 @@ int tracing_release_file_tr(struct inode *inode, struct file *filp)
struct trace_event_file *file = inode->i_private;
trace_array_put(file->tr);
+ event_file_put(file);
return 0;
}
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 0e1405abf4f7..b7f4ea25a194 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -1669,6 +1669,9 @@ extern void event_trigger_unregister(struct event_command *cmd_ops,
char *glob,
struct event_trigger_data *trigger_data);
+extern void event_file_get(struct trace_event_file *file);
+extern void event_file_put(struct trace_event_file *file);
+
/**
* struct event_trigger_ops - callbacks for trace event triggers
*
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index f9e3e24d8796..f29e815ca5b2 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -990,13 +990,35 @@ static void remove_subsystem(struct trace_subsystem_dir *dir)
}
}
+void event_file_get(struct trace_event_file *file)
+{
+ atomic_inc(&file->ref);
+}
+
+void event_file_put(struct trace_event_file *file)
+{
+ if (WARN_ON_ONCE(!atomic_read(&file->ref))) {
+ if (file->flags & EVENT_FILE_FL_FREED)
+ kmem_cache_free(file_cachep, file);
+ return;
+ }
+
+ if (atomic_dec_and_test(&file->ref)) {
+ /* Count should only go to zero when it is freed */
+ if (WARN_ON_ONCE(!(file->flags & EVENT_FILE_FL_FREED)))
+ return;
+ kmem_cache_free(file_cachep, file);
+ }
+}
+
static void remove_event_file_dir(struct trace_event_file *file)
{
eventfs_remove_dir(file->ei);
list_del(&file->list);
remove_subsystem(file->system);
free_event_filter(file->filter);
- kmem_cache_free(file_cachep, file);
+ file->flags |= EVENT_FILE_FL_FREED;
+ event_file_put(file);
}
/*
@@ -1369,7 +1391,7 @@ event_enable_read(struct file *filp, char __user *ubuf, size_t cnt,
flags = file->flags;
mutex_unlock(&event_mutex);
- if (!file)
+ if (!file || flags & EVENT_FILE_FL_FREED)
return -ENODEV;
if (flags & EVENT_FILE_FL_ENABLED &&
@@ -1403,7 +1425,7 @@ event_enable_write(struct file *filp, const char __user *ubuf, size_t cnt,
ret = -ENODEV;
mutex_lock(&event_mutex);
file = event_file_data(filp);
- if (likely(file)) {
+ if (likely(file && !(file->flags & EVENT_FILE_FL_FREED))) {
ret = tracing_update_buffers(file->tr);
if (ret < 0) {
mutex_unlock(&event_mutex);
@@ -1683,7 +1705,7 @@ event_filter_read(struct file *filp, char __user *ubuf, size_t cnt,
mutex_lock(&event_mutex);
file = event_file_data(filp);
- if (file)
+ if (file && !(file->flags & EVENT_FILE_FL_FREED))
print_event_filter(file, s);
mutex_unlock(&event_mutex);
@@ -2902,6 +2924,7 @@ trace_create_new_event(struct trace_event_call *call,
atomic_set(&file->tm_ref, 0);
INIT_LIST_HEAD(&file->triggers);
list_add(&file->list, &tr->events);
+ event_file_get(file);
return file;
}
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index 33264e510d16..0c611b281a5b 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -2349,6 +2349,9 @@ int apply_event_filter(struct trace_event_file *file, char *filter_string)
struct event_filter *filter = NULL;
int err;
+ if (file->flags & EVENT_FILE_FL_FREED)
+ return -ENODEV;
+
if (!strcmp(strstrip(filter_string), "0")) {
filter_disable(file);
filter = event_filter(file);
From: "Matthew Wilcox (Oracle)" <willy(a)infradead.org>
commit 4595a298d5563cf76c1d852970f162051fd1a7a6 upstream.
For filesystems with block size < page size, we need to set all the
per-block uptodate bits if the page was already uptodate at the time
we create the per-block metadata. This can happen if the page is
invalidated (eg by a write to drop_caches) but ultimately not removed
from the page cache.
This is a data corruption issue as page writeback skips blocks which
are marked !uptodate.
Fixes: 9dc55f1389f9 ("iomap: add support for sub-pagesize buffered I/O without buffer heads")
Signed-off-by: Matthew Wilcox (Oracle) <willy(a)infradead.org>
Reported-by: Qian Cai <cai(a)redhat.com>
Cc: Brian Foster <bfoster(a)redhat.com>
Reviewed-by: Gao Xiang <hsiangkao(a)redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong(a)oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong(a)oracle.com>
Reviewed-by: Christoph Hellwig <hch(a)lst.de>
Signed-off-by: Shida Zhang <zhangshida(a)kylinos.cn>
---
fs/iomap.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/iomap.c b/fs/iomap.c
index ac7b2152c3ad..04e82b6bd9bf 100644
--- a/fs/iomap.c
+++ b/fs/iomap.c
@@ -109,6 +109,7 @@ static struct iomap_page *
iomap_page_create(struct inode *inode, struct page *page)
{
struct iomap_page *iop = to_iomap_page(page);
+ unsigned int nr_blocks = PAGE_SIZE / i_blocksize(inode);
if (iop || i_blocksize(inode) == PAGE_SIZE)
return iop;
@@ -118,6 +119,8 @@ iomap_page_create(struct inode *inode, struct page *page)
atomic_set(&iop->write_count, 0);
spin_lock_init(&iop->uptodate_lock);
bitmap_zero(iop->uptodate, PAGE_SIZE / SECTOR_SIZE);
+ if (PageUptodate(page))
+ bitmap_fill(iop->uptodate, nr_blocks);
/*
* migrate_page_move_mapping() assumes that pages with private data have
--
2.27.0
This is the fix of CVE-2023-25012 for kernel v5.15.
Upstream commit: https://github.com/torvalds/linux/commit/7644b1a1c9a7ae8ab99175989bfc867605…
The affected code is in io_uring/io_uring.c instead of io_uring/fdinfo.c for v5.15. So the patch applies the same change to io_uring/io_uring.c.
Thanks!
He
Jens Axboe (1):
io_uring/fdinfo: lock SQ thread while retrieving thread cpu/pid
io_uring/io_uring.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
--
2.42.0.869.gea05f2083d-goog
From: Dongli Zhang <dongli.zhang(a)oracle.com>
[ Upstream commit 1978f30a87732d4d9072a20abeded9fe17884f1b ]
When tag_set->nr_maps is 1, the block layer limits the number of hw queues
by nr_cpu_ids. No matter how many hw queues are used by virtio-scsi, as it
has (tag_set->nr_maps == 1), it can use at most nr_cpu_ids hw queues.
In addition, specifically for pci scenario, when the 'num_queues' specified
by qemu is more than maxcpus, virtio-scsi would not be able to allocate
more than maxcpus vectors in order to have a vector for each queue. As a
result, it falls back into MSI-X with one vector for config and one shared
for queues.
Considering above reasons, this patch limits the number of hw queues used
by virtio-scsi by nr_cpu_ids.
Reviewed-by: Stefan Hajnoczi <stefanha(a)redhat.com>
Signed-off-by: Dongli Zhang <dongli.zhang(a)oracle.com>
Signed-off-by: Jens Axboe <axboe(a)kernel.dk>
Signed-off-by: Kunkun Jiang <jiangkunkun(a)huawei.com>
---
drivers/scsi/virtio_scsi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
index 50e87823baab..0b45424e7ca5 100644
--- a/drivers/scsi/virtio_scsi.c
+++ b/drivers/scsi/virtio_scsi.c
@@ -853,6 +853,7 @@ static int virtscsi_probe(struct virtio_device *vdev)
/* We need to know how many queues before we allocate. */
num_queues = virtscsi_config_get(vdev, num_queues) ? : 1;
+ num_queues = min_t(unsigned int, nr_cpu_ids, num_queues);
num_targets = virtscsi_config_get(vdev, max_target) + 1;
--
2.33.0
The patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x 886b92f63573eab4ba30b06c4514b8f4af114e6a
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112409-fructose-spry-be2c@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^..
Possible dependencies:
886b92f63573 ("drm/amdgpu: ungate power gating when system suspend")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 886b92f63573eab4ba30b06c4514b8f4af114e6a Mon Sep 17 00:00:00 2001
From: Perry Yuan <perry.yuan(a)amd.com>
Date: Thu, 27 Jul 2023 01:45:30 -0400
Subject: [PATCH] drm/amdgpu: ungate power gating when system suspend
[Why] During suspend, if GFX DPM is enabled and GFXOFF feature is
enabled the system may get hung. So, it is suggested to disable
GFXOFF feature during suspend and enable it after resume.
[How] Update the code to disable GFXOFF feature during suspend and enable
it after resume.
[ 311.396526] amdgpu 0000:03:00.0: amdgpu: SMU: I'm not done with your previous command: SMN_C2PMSG_66:0x0000001E SMN_C2PMSG_82:0x00000000
[ 311.396530] amdgpu 0000:03:00.0: amdgpu: Fail to disable dpm features!
[ 311.396531] [drm:amdgpu_device_ip_suspend_phase2 [amdgpu]] *ERROR* suspend of IP block <smu> failed -62
Acked-by: Yang Wang <kevinyang.wang(a)amd.com>
Reviewed-by: Kenneth Feng <kenneth.feng(a)amd.com>
Signed-off-by: Perry Yuan <perry.yuan(a)amd.com>
Signed-off-by: Kun Liu <kun.liu2(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
Cc: stable(a)vger.kernel.org
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
index dafb8cc1c684..c8a3bf01743f 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
@@ -3498,6 +3498,8 @@ static void gfx_v10_0_ring_invalidate_tlbs(struct amdgpu_ring *ring,
static void gfx_v10_0_update_spm_vmid_internal(struct amdgpu_device *adev,
unsigned int vmid);
+static int gfx_v10_0_set_powergating_state(void *handle,
+ enum amd_powergating_state state);
static void gfx10_kiq_set_resources(struct amdgpu_ring *kiq_ring, uint64_t queue_mask)
{
amdgpu_ring_write(kiq_ring, PACKET3(PACKET3_SET_RESOURCES, 6));
@@ -7179,6 +7181,13 @@ static int gfx_v10_0_hw_fini(void *handle)
amdgpu_irq_put(adev, &adev->gfx.priv_reg_irq, 0);
amdgpu_irq_put(adev, &adev->gfx.priv_inst_irq, 0);
+ /* WA added for Vangogh asic fixing the SMU suspend failure
+ * It needs to set power gating again during gfxoff control
+ * otherwise the gfxoff disallowing will be failed to set.
+ */
+ if (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(10, 3, 1))
+ gfx_v10_0_set_powergating_state(handle, AMD_PG_STATE_UNGATE);
+
if (!adev->no_hw_access) {
if (amdgpu_async_gfx_ring) {
if (amdgpu_gfx_disable_kgq(adev, 0))
The patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x 5e8a0d3598b47ee5a57708072bdef08816264538
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112445-mutilator-landed-4578@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^..
Possible dependencies:
5e8a0d3598b4 ("drm/amd/display: Negate IPS allow and commit bits")
92e11f0159f6 ("drm/amd/display: Enable more IPS options")
da2d16fcdda3 ("drm/amd/display: Fix IPS handshake for idle optimizations")
d591284288c2 ("drm/amd/display: Add a check for idle power optimization")
d5f9a92bd1e2 ("drm/amd/display: Revert "Improve x86 and dmub ips handshake"")
bf7951561051 ("drm/amd/display: reprogram det size while seamless boot")
d0a767f7b8e2 ("drm/amd/display: Revert "drm/amd/display: Add a check for idle power optimization"")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 5e8a0d3598b47ee5a57708072bdef08816264538 Mon Sep 17 00:00:00 2001
From: Duncan Ma <duncan.ma(a)amd.com>
Date: Wed, 25 Oct 2023 19:07:21 -0400
Subject: [PATCH] drm/amd/display: Negate IPS allow and commit bits
[WHY]
On s0i3, IPS mask isn't saved and restored.
It is reset to zero on exit.
If it is cleared unexpectedly, driver will
proceed operations while DCN is in IPS2 and
cause a hang.
[HOW]
Negate the bit logic. Default value of
zero indicates it is still in IPS2. Driver
must poll for the bit to assert.
Cc: Mario Limonciello <mario.limonciello(a)amd.com>
Cc: Alex Deucher <alexander.deucher(a)amd.com>
Cc: stable(a)vger.kernel.org
Reviewed-by: Charlene Liu <charlene.liu(a)amd.com>
Acked-by: Alex Hung <alex.hung(a)amd.com>
Signed-off-by: Duncan Ma <duncan.ma(a)amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c
index 0fa4fcd00de2..507a7cf56711 100644
--- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c
+++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c
@@ -820,22 +820,22 @@ static void dcn35_set_idle_state(struct clk_mgr *clk_mgr_base, bool allow_idle)
if (dc->config.disable_ips == DMUB_IPS_ENABLE ||
dc->config.disable_ips == DMUB_IPS_DISABLE_DYNAMIC) {
- val |= DMUB_IPS1_ALLOW_MASK;
- val |= DMUB_IPS2_ALLOW_MASK;
- } else if (dc->config.disable_ips == DMUB_IPS_DISABLE_IPS1) {
val = val & ~DMUB_IPS1_ALLOW_MASK;
val = val & ~DMUB_IPS2_ALLOW_MASK;
- } else if (dc->config.disable_ips == DMUB_IPS_DISABLE_IPS2) {
- val |= DMUB_IPS1_ALLOW_MASK;
- val = val & ~DMUB_IPS2_ALLOW_MASK;
- } else if (dc->config.disable_ips == DMUB_IPS_DISABLE_IPS2_Z10) {
+ } else if (dc->config.disable_ips == DMUB_IPS_DISABLE_IPS1) {
val |= DMUB_IPS1_ALLOW_MASK;
val |= DMUB_IPS2_ALLOW_MASK;
+ } else if (dc->config.disable_ips == DMUB_IPS_DISABLE_IPS2) {
+ val = val & ~DMUB_IPS1_ALLOW_MASK;
+ val |= DMUB_IPS2_ALLOW_MASK;
+ } else if (dc->config.disable_ips == DMUB_IPS_DISABLE_IPS2_Z10) {
+ val = val & ~DMUB_IPS1_ALLOW_MASK;
+ val = val & ~DMUB_IPS2_ALLOW_MASK;
}
if (!allow_idle) {
- val = val & ~DMUB_IPS1_ALLOW_MASK;
- val = val & ~DMUB_IPS2_ALLOW_MASK;
+ val |= DMUB_IPS1_ALLOW_MASK;
+ val |= DMUB_IPS2_ALLOW_MASK;
}
dcn35_smu_write_ips_scratch(clk_mgr, val);
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index d8f434738212..76b47f178127 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -4934,8 +4934,8 @@ bool dc_dmub_is_ips_idle_state(struct dc *dc)
if (dc->hwss.get_idle_state)
idle_state = dc->hwss.get_idle_state(dc);
- if ((idle_state & DMUB_IPS1_ALLOW_MASK) ||
- (idle_state & DMUB_IPS2_ALLOW_MASK))
+ if (!(idle_state & DMUB_IPS1_ALLOW_MASK) ||
+ !(idle_state & DMUB_IPS2_ALLOW_MASK))
return true;
return false;
diff --git a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
index e4c007203318..0e07699c1e83 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
+++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
@@ -1202,11 +1202,11 @@ void dc_dmub_srv_exit_low_power_state(const struct dc *dc)
allow_state = dc->hwss.get_idle_state(dc);
dc->hwss.set_idle_state(dc, false);
- if (allow_state & DMUB_IPS2_ALLOW_MASK) {
+ if (!(allow_state & DMUB_IPS2_ALLOW_MASK)) {
// Wait for evaluation time
udelay(dc->debug.ips2_eval_delay_us);
commit_state = dc->hwss.get_idle_state(dc);
- if (commit_state & DMUB_IPS2_COMMIT_MASK) {
+ if (!(commit_state & DMUB_IPS2_COMMIT_MASK)) {
// Tell PMFW to exit low power state
dc->clk_mgr->funcs->exit_low_power_state(dc->clk_mgr);
@@ -1216,7 +1216,7 @@ void dc_dmub_srv_exit_low_power_state(const struct dc *dc)
for (i = 0; i < max_num_polls; ++i) {
commit_state = dc->hwss.get_idle_state(dc);
- if (!(commit_state & DMUB_IPS2_COMMIT_MASK))
+ if (commit_state & DMUB_IPS2_COMMIT_MASK)
break;
udelay(1);
@@ -1235,10 +1235,10 @@ void dc_dmub_srv_exit_low_power_state(const struct dc *dc)
}
dc_dmub_srv_notify_idle(dc, false);
- if (allow_state & DMUB_IPS1_ALLOW_MASK) {
+ if (!(allow_state & DMUB_IPS1_ALLOW_MASK)) {
for (i = 0; i < max_num_polls; ++i) {
commit_state = dc->hwss.get_idle_state(dc);
- if (!(commit_state & DMUB_IPS1_COMMIT_MASK))
+ if (commit_state & DMUB_IPS1_COMMIT_MASK)
break;
udelay(1);
The patch below does not apply to the 6.5-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.5.y
git checkout FETCH_HEAD
git cherry-pick -x 5e8a0d3598b47ee5a57708072bdef08816264538
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112444-virus-dotted-b387@gregkh' --subject-prefix 'PATCH 6.5.y' HEAD^..
Possible dependencies:
5e8a0d3598b4 ("drm/amd/display: Negate IPS allow and commit bits")
92e11f0159f6 ("drm/amd/display: Enable more IPS options")
da2d16fcdda3 ("drm/amd/display: Fix IPS handshake for idle optimizations")
d591284288c2 ("drm/amd/display: Add a check for idle power optimization")
d5f9a92bd1e2 ("drm/amd/display: Revert "Improve x86 and dmub ips handshake"")
bf7951561051 ("drm/amd/display: reprogram det size while seamless boot")
d0a767f7b8e2 ("drm/amd/display: Revert "drm/amd/display: Add a check for idle power optimization"")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 5e8a0d3598b47ee5a57708072bdef08816264538 Mon Sep 17 00:00:00 2001
From: Duncan Ma <duncan.ma(a)amd.com>
Date: Wed, 25 Oct 2023 19:07:21 -0400
Subject: [PATCH] drm/amd/display: Negate IPS allow and commit bits
[WHY]
On s0i3, IPS mask isn't saved and restored.
It is reset to zero on exit.
If it is cleared unexpectedly, driver will
proceed operations while DCN is in IPS2 and
cause a hang.
[HOW]
Negate the bit logic. Default value of
zero indicates it is still in IPS2. Driver
must poll for the bit to assert.
Cc: Mario Limonciello <mario.limonciello(a)amd.com>
Cc: Alex Deucher <alexander.deucher(a)amd.com>
Cc: stable(a)vger.kernel.org
Reviewed-by: Charlene Liu <charlene.liu(a)amd.com>
Acked-by: Alex Hung <alex.hung(a)amd.com>
Signed-off-by: Duncan Ma <duncan.ma(a)amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c
index 0fa4fcd00de2..507a7cf56711 100644
--- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c
+++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c
@@ -820,22 +820,22 @@ static void dcn35_set_idle_state(struct clk_mgr *clk_mgr_base, bool allow_idle)
if (dc->config.disable_ips == DMUB_IPS_ENABLE ||
dc->config.disable_ips == DMUB_IPS_DISABLE_DYNAMIC) {
- val |= DMUB_IPS1_ALLOW_MASK;
- val |= DMUB_IPS2_ALLOW_MASK;
- } else if (dc->config.disable_ips == DMUB_IPS_DISABLE_IPS1) {
val = val & ~DMUB_IPS1_ALLOW_MASK;
val = val & ~DMUB_IPS2_ALLOW_MASK;
- } else if (dc->config.disable_ips == DMUB_IPS_DISABLE_IPS2) {
- val |= DMUB_IPS1_ALLOW_MASK;
- val = val & ~DMUB_IPS2_ALLOW_MASK;
- } else if (dc->config.disable_ips == DMUB_IPS_DISABLE_IPS2_Z10) {
+ } else if (dc->config.disable_ips == DMUB_IPS_DISABLE_IPS1) {
val |= DMUB_IPS1_ALLOW_MASK;
val |= DMUB_IPS2_ALLOW_MASK;
+ } else if (dc->config.disable_ips == DMUB_IPS_DISABLE_IPS2) {
+ val = val & ~DMUB_IPS1_ALLOW_MASK;
+ val |= DMUB_IPS2_ALLOW_MASK;
+ } else if (dc->config.disable_ips == DMUB_IPS_DISABLE_IPS2_Z10) {
+ val = val & ~DMUB_IPS1_ALLOW_MASK;
+ val = val & ~DMUB_IPS2_ALLOW_MASK;
}
if (!allow_idle) {
- val = val & ~DMUB_IPS1_ALLOW_MASK;
- val = val & ~DMUB_IPS2_ALLOW_MASK;
+ val |= DMUB_IPS1_ALLOW_MASK;
+ val |= DMUB_IPS2_ALLOW_MASK;
}
dcn35_smu_write_ips_scratch(clk_mgr, val);
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index d8f434738212..76b47f178127 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -4934,8 +4934,8 @@ bool dc_dmub_is_ips_idle_state(struct dc *dc)
if (dc->hwss.get_idle_state)
idle_state = dc->hwss.get_idle_state(dc);
- if ((idle_state & DMUB_IPS1_ALLOW_MASK) ||
- (idle_state & DMUB_IPS2_ALLOW_MASK))
+ if (!(idle_state & DMUB_IPS1_ALLOW_MASK) ||
+ !(idle_state & DMUB_IPS2_ALLOW_MASK))
return true;
return false;
diff --git a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
index e4c007203318..0e07699c1e83 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
+++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
@@ -1202,11 +1202,11 @@ void dc_dmub_srv_exit_low_power_state(const struct dc *dc)
allow_state = dc->hwss.get_idle_state(dc);
dc->hwss.set_idle_state(dc, false);
- if (allow_state & DMUB_IPS2_ALLOW_MASK) {
+ if (!(allow_state & DMUB_IPS2_ALLOW_MASK)) {
// Wait for evaluation time
udelay(dc->debug.ips2_eval_delay_us);
commit_state = dc->hwss.get_idle_state(dc);
- if (commit_state & DMUB_IPS2_COMMIT_MASK) {
+ if (!(commit_state & DMUB_IPS2_COMMIT_MASK)) {
// Tell PMFW to exit low power state
dc->clk_mgr->funcs->exit_low_power_state(dc->clk_mgr);
@@ -1216,7 +1216,7 @@ void dc_dmub_srv_exit_low_power_state(const struct dc *dc)
for (i = 0; i < max_num_polls; ++i) {
commit_state = dc->hwss.get_idle_state(dc);
- if (!(commit_state & DMUB_IPS2_COMMIT_MASK))
+ if (commit_state & DMUB_IPS2_COMMIT_MASK)
break;
udelay(1);
@@ -1235,10 +1235,10 @@ void dc_dmub_srv_exit_low_power_state(const struct dc *dc)
}
dc_dmub_srv_notify_idle(dc, false);
- if (allow_state & DMUB_IPS1_ALLOW_MASK) {
+ if (!(allow_state & DMUB_IPS1_ALLOW_MASK)) {
for (i = 0; i < max_num_polls; ++i) {
commit_state = dc->hwss.get_idle_state(dc);
- if (!(commit_state & DMUB_IPS1_COMMIT_MASK))
+ if (commit_state & DMUB_IPS1_COMMIT_MASK)
break;
udelay(1);
The patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x 5e8a0d3598b47ee5a57708072bdef08816264538
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112443-poplar-panhandle-d98f@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^..
Possible dependencies:
5e8a0d3598b4 ("drm/amd/display: Negate IPS allow and commit bits")
92e11f0159f6 ("drm/amd/display: Enable more IPS options")
da2d16fcdda3 ("drm/amd/display: Fix IPS handshake for idle optimizations")
d591284288c2 ("drm/amd/display: Add a check for idle power optimization")
d5f9a92bd1e2 ("drm/amd/display: Revert "Improve x86 and dmub ips handshake"")
bf7951561051 ("drm/amd/display: reprogram det size while seamless boot")
d0a767f7b8e2 ("drm/amd/display: Revert "drm/amd/display: Add a check for idle power optimization"")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
2358ecdabe37 ("drm/amd/display: 3.2.254")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 5e8a0d3598b47ee5a57708072bdef08816264538 Mon Sep 17 00:00:00 2001
From: Duncan Ma <duncan.ma(a)amd.com>
Date: Wed, 25 Oct 2023 19:07:21 -0400
Subject: [PATCH] drm/amd/display: Negate IPS allow and commit bits
[WHY]
On s0i3, IPS mask isn't saved and restored.
It is reset to zero on exit.
If it is cleared unexpectedly, driver will
proceed operations while DCN is in IPS2 and
cause a hang.
[HOW]
Negate the bit logic. Default value of
zero indicates it is still in IPS2. Driver
must poll for the bit to assert.
Cc: Mario Limonciello <mario.limonciello(a)amd.com>
Cc: Alex Deucher <alexander.deucher(a)amd.com>
Cc: stable(a)vger.kernel.org
Reviewed-by: Charlene Liu <charlene.liu(a)amd.com>
Acked-by: Alex Hung <alex.hung(a)amd.com>
Signed-off-by: Duncan Ma <duncan.ma(a)amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c
index 0fa4fcd00de2..507a7cf56711 100644
--- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c
+++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c
@@ -820,22 +820,22 @@ static void dcn35_set_idle_state(struct clk_mgr *clk_mgr_base, bool allow_idle)
if (dc->config.disable_ips == DMUB_IPS_ENABLE ||
dc->config.disable_ips == DMUB_IPS_DISABLE_DYNAMIC) {
- val |= DMUB_IPS1_ALLOW_MASK;
- val |= DMUB_IPS2_ALLOW_MASK;
- } else if (dc->config.disable_ips == DMUB_IPS_DISABLE_IPS1) {
val = val & ~DMUB_IPS1_ALLOW_MASK;
val = val & ~DMUB_IPS2_ALLOW_MASK;
- } else if (dc->config.disable_ips == DMUB_IPS_DISABLE_IPS2) {
- val |= DMUB_IPS1_ALLOW_MASK;
- val = val & ~DMUB_IPS2_ALLOW_MASK;
- } else if (dc->config.disable_ips == DMUB_IPS_DISABLE_IPS2_Z10) {
+ } else if (dc->config.disable_ips == DMUB_IPS_DISABLE_IPS1) {
val |= DMUB_IPS1_ALLOW_MASK;
val |= DMUB_IPS2_ALLOW_MASK;
+ } else if (dc->config.disable_ips == DMUB_IPS_DISABLE_IPS2) {
+ val = val & ~DMUB_IPS1_ALLOW_MASK;
+ val |= DMUB_IPS2_ALLOW_MASK;
+ } else if (dc->config.disable_ips == DMUB_IPS_DISABLE_IPS2_Z10) {
+ val = val & ~DMUB_IPS1_ALLOW_MASK;
+ val = val & ~DMUB_IPS2_ALLOW_MASK;
}
if (!allow_idle) {
- val = val & ~DMUB_IPS1_ALLOW_MASK;
- val = val & ~DMUB_IPS2_ALLOW_MASK;
+ val |= DMUB_IPS1_ALLOW_MASK;
+ val |= DMUB_IPS2_ALLOW_MASK;
}
dcn35_smu_write_ips_scratch(clk_mgr, val);
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index d8f434738212..76b47f178127 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -4934,8 +4934,8 @@ bool dc_dmub_is_ips_idle_state(struct dc *dc)
if (dc->hwss.get_idle_state)
idle_state = dc->hwss.get_idle_state(dc);
- if ((idle_state & DMUB_IPS1_ALLOW_MASK) ||
- (idle_state & DMUB_IPS2_ALLOW_MASK))
+ if (!(idle_state & DMUB_IPS1_ALLOW_MASK) ||
+ !(idle_state & DMUB_IPS2_ALLOW_MASK))
return true;
return false;
diff --git a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
index e4c007203318..0e07699c1e83 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
+++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
@@ -1202,11 +1202,11 @@ void dc_dmub_srv_exit_low_power_state(const struct dc *dc)
allow_state = dc->hwss.get_idle_state(dc);
dc->hwss.set_idle_state(dc, false);
- if (allow_state & DMUB_IPS2_ALLOW_MASK) {
+ if (!(allow_state & DMUB_IPS2_ALLOW_MASK)) {
// Wait for evaluation time
udelay(dc->debug.ips2_eval_delay_us);
commit_state = dc->hwss.get_idle_state(dc);
- if (commit_state & DMUB_IPS2_COMMIT_MASK) {
+ if (!(commit_state & DMUB_IPS2_COMMIT_MASK)) {
// Tell PMFW to exit low power state
dc->clk_mgr->funcs->exit_low_power_state(dc->clk_mgr);
@@ -1216,7 +1216,7 @@ void dc_dmub_srv_exit_low_power_state(const struct dc *dc)
for (i = 0; i < max_num_polls; ++i) {
commit_state = dc->hwss.get_idle_state(dc);
- if (!(commit_state & DMUB_IPS2_COMMIT_MASK))
+ if (commit_state & DMUB_IPS2_COMMIT_MASK)
break;
udelay(1);
@@ -1235,10 +1235,10 @@ void dc_dmub_srv_exit_low_power_state(const struct dc *dc)
}
dc_dmub_srv_notify_idle(dc, false);
- if (allow_state & DMUB_IPS1_ALLOW_MASK) {
+ if (!(allow_state & DMUB_IPS1_ALLOW_MASK)) {
for (i = 0; i < max_num_polls; ++i) {
commit_state = dc->hwss.get_idle_state(dc);
- if (!(commit_state & DMUB_IPS1_COMMIT_MASK))
+ if (commit_state & DMUB_IPS1_COMMIT_MASK)
break;
udelay(1);
The patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x 0ee057e66c4b782809a0a9265cdac5542e646706
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112432-schilling-murkiness-4092@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^..
Possible dependencies:
0ee057e66c4b ("drm/amd/display: Fix encoder disable logic")
e0b394a87a11 ("drm/amd/display: Add DCN35 DIO")
25879d7b4986 ("drm/amd/display: Clean FPGA code in dc")
7b1b3f5818c3 ("drm/amd/display: update dig enable sequence")
98ce7d32e215 ("drm/amd/display: convert link.h functions to function pointer style")
22f1482aff4a ("drm/amd/display: add sysfs entry to read PSR residency from firmware")
c186c13e6528 ("drm/amd/display: Drop unnecessary DCN guards")
788c6e2ce5c7 ("drm/amd/display: replace all dc_link function call in link with link functions")
202a3816f37e ("drm/amd/display: move dc_link functions in protocols folder to dc_link_exports")
6455cb522191 ("drm/amd/display: link link_dp_dpia_bw.o in makefile")
76f5dc40ebb1 ("drm/amd/display: move dc_link functions in link root folder to dc_link_exports")
36516001a7c9 ("drm/amd/display: move dc_link functions in accessories folder to dc_link_exports")
1e88eb1b2c25 ("drm/amd/display: Drop CONFIG_DRM_AMD_DC_HDCP")
aee0c07a74d3 ("drm/amd/display: Unify DC logging for BW Alloc")
7ae1dbe6547c ("drm/amd/display: merge dc_link.h into dc.h and dc_types.h")
1099238b966e ("drm/amd/display: Update BW ALLOCATION Function declaration")
a06d565b4a1c ("drm/amd/display: Allocation at stream Enable")
c32699caeca8 ("drm/amd/display: Updating Video Format Fall Back Policy.")
c69fc3d0de6c ("drm/amd/display: Reduce CPU busy-waiting for long delays")
455ad25997ba ("drm/amdgpu: Select DRM_DISPLAY_HDCP_HELPER in amdgpu")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 0ee057e66c4b782809a0a9265cdac5542e646706 Mon Sep 17 00:00:00 2001
From: Nicholas Susanto <nicholas.susanto(a)amd.com>
Date: Wed, 1 Nov 2023 15:30:10 -0400
Subject: [PATCH] drm/amd/display: Fix encoder disable logic
[WHY]
DENTIST hangs when OTG is off and encoder is on. We were not
disabling the encoder properly when switching from extended mode to
external monitor only.
[HOW]
Disable the encoder using an existing enable/disable fifo helper instead
of enc35_stream_encoder_enable.
Cc: Mario Limonciello <mario.limonciello(a)amd.com>
Cc: Alex Deucher <alexander.deucher(a)amd.com>
Cc: stable(a)vger.kernel.org
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas(a)amd.com>
Acked-by: Alex Hung <alex.hung(a)amd.com>
Signed-off-by: Nicholas Susanto <nicholas.susanto(a)amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dio_stream_encoder.c b/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dio_stream_encoder.c
index 001f9eb66920..62a8f0b56006 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dio_stream_encoder.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dio_stream_encoder.c
@@ -261,12 +261,6 @@ static void enc35_stream_encoder_enable(
/* invalid mode ! */
ASSERT_CRITICAL(false);
}
-
- REG_UPDATE(DIG_FE_CLK_CNTL, DIG_FE_CLK_EN, 1);
- REG_UPDATE(DIG_FE_EN_CNTL, DIG_FE_ENABLE, 1);
- } else {
- REG_UPDATE(DIG_FE_EN_CNTL, DIG_FE_ENABLE, 0);
- REG_UPDATE(DIG_FE_CLK_CNTL, DIG_FE_CLK_EN, 0);
}
}
@@ -436,6 +430,8 @@ static void enc35_disable_fifo(struct stream_encoder *enc)
struct dcn10_stream_encoder *enc1 = DCN10STRENC_FROM_STRENC(enc);
REG_UPDATE(DIG_FIFO_CTRL0, DIG_FIFO_ENABLE, 0);
+ REG_UPDATE(DIG_FE_EN_CNTL, DIG_FE_ENABLE, 0);
+ REG_UPDATE(DIG_FE_CLK_CNTL, DIG_FE_CLK_EN, 0);
}
static void enc35_enable_fifo(struct stream_encoder *enc)
@@ -443,6 +439,8 @@ static void enc35_enable_fifo(struct stream_encoder *enc)
struct dcn10_stream_encoder *enc1 = DCN10STRENC_FROM_STRENC(enc);
REG_UPDATE(DIG_FIFO_CTRL0, DIG_FIFO_READ_START_LEVEL, 0x7);
+ REG_UPDATE(DIG_FE_CLK_CNTL, DIG_FE_CLK_EN, 1);
+ REG_UPDATE(DIG_FE_EN_CNTL, DIG_FE_ENABLE, 1);
enc35_reset_fifo(enc, true);
enc35_reset_fifo(enc, false);
The patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x fabd2165d11649ecca5012d786a62ac149e9d83f
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112458-overheat-flagstone-c571@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^..
Possible dependencies:
fabd2165d116 ("drm/amd/display: enable cursor degamma for DCN3+ DRM legacy gamma")
5d945cbcd4b1 ("drm/amd/display: Create a file dedicated to planes")
60693e3a3890 ("Merge tag 'amd-drm-next-5.20-2022-07-14' of https://gitlab.freedesktop.org/agd5f/linux into drm-next")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From fabd2165d11649ecca5012d786a62ac149e9d83f Mon Sep 17 00:00:00 2001
From: Melissa Wen <mwen(a)igalia.com>
Date: Thu, 31 Aug 2023 15:12:28 -0100
Subject: [PATCH] drm/amd/display: enable cursor degamma for DCN3+ DRM legacy
gamma
For DRM legacy gamma, AMD display manager applies implicit sRGB degamma
using a pre-defined sRGB transfer function. It works fine for DCN2
family where degamma ROM and custom curves go to the same color block.
But, on DCN3+, degamma is split into two blocks: degamma ROM for
pre-defined TFs and `gamma correction` for user/custom curves and
degamma ROM settings doesn't apply to cursor plane. To get DRM legacy
gamma working as expected, enable cursor degamma ROM for implict sRGB
degamma on HW with this configuration.
Cc: stable(a)vger.kernel.org
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2803
Fixes: 96b020e2163f ("drm/amd/display: check attr flag before set cursor degamma on DCN3+")
Signed-off-by: Melissa Wen <mwen(a)igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
index df568a7cd005..b97cbc4e5477 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
@@ -1270,6 +1270,13 @@ void amdgpu_dm_plane_handle_cursor_update(struct drm_plane *plane,
attributes.rotation_angle = 0;
attributes.attribute_flags.value = 0;
+ /* Enable cursor degamma ROM on DCN3+ for implicit sRGB degamma in DRM
+ * legacy gamma setup.
+ */
+ if (crtc_state->cm_is_degamma_srgb &&
+ adev->dm.dc->caps.color.dpp.gamma_corr)
+ attributes.attribute_flags.bits.ENABLE_CURSOR_DEGAMMA = 1;
+
attributes.pitch = afb->base.pitches[0] / afb->base.format->cpp[0];
if (crtc_state->stream) {
The patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
git checkout FETCH_HEAD
git cherry-pick -x fabd2165d11649ecca5012d786a62ac149e9d83f
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112457-suspend-washday-4688@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^..
Possible dependencies:
fabd2165d116 ("drm/amd/display: enable cursor degamma for DCN3+ DRM legacy gamma")
5d945cbcd4b1 ("drm/amd/display: Create a file dedicated to planes")
60693e3a3890 ("Merge tag 'amd-drm-next-5.20-2022-07-14' of https://gitlab.freedesktop.org/agd5f/linux into drm-next")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From fabd2165d11649ecca5012d786a62ac149e9d83f Mon Sep 17 00:00:00 2001
From: Melissa Wen <mwen(a)igalia.com>
Date: Thu, 31 Aug 2023 15:12:28 -0100
Subject: [PATCH] drm/amd/display: enable cursor degamma for DCN3+ DRM legacy
gamma
For DRM legacy gamma, AMD display manager applies implicit sRGB degamma
using a pre-defined sRGB transfer function. It works fine for DCN2
family where degamma ROM and custom curves go to the same color block.
But, on DCN3+, degamma is split into two blocks: degamma ROM for
pre-defined TFs and `gamma correction` for user/custom curves and
degamma ROM settings doesn't apply to cursor plane. To get DRM legacy
gamma working as expected, enable cursor degamma ROM for implict sRGB
degamma on HW with this configuration.
Cc: stable(a)vger.kernel.org
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2803
Fixes: 96b020e2163f ("drm/amd/display: check attr flag before set cursor degamma on DCN3+")
Signed-off-by: Melissa Wen <mwen(a)igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
index df568a7cd005..b97cbc4e5477 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
@@ -1270,6 +1270,13 @@ void amdgpu_dm_plane_handle_cursor_update(struct drm_plane *plane,
attributes.rotation_angle = 0;
attributes.attribute_flags.value = 0;
+ /* Enable cursor degamma ROM on DCN3+ for implicit sRGB degamma in DRM
+ * legacy gamma setup.
+ */
+ if (crtc_state->cm_is_degamma_srgb &&
+ adev->dm.dc->caps.color.dpp.gamma_corr)
+ attributes.attribute_flags.bits.ENABLE_CURSOR_DEGAMMA = 1;
+
attributes.pitch = afb->base.pitches[0] / afb->base.format->cpp[0];
if (crtc_state->stream) {
The patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x fabd2165d11649ecca5012d786a62ac149e9d83f
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112455-tiring-graceful-5be4@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^..
Possible dependencies:
fabd2165d116 ("drm/amd/display: enable cursor degamma for DCN3+ DRM legacy gamma")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From fabd2165d11649ecca5012d786a62ac149e9d83f Mon Sep 17 00:00:00 2001
From: Melissa Wen <mwen(a)igalia.com>
Date: Thu, 31 Aug 2023 15:12:28 -0100
Subject: [PATCH] drm/amd/display: enable cursor degamma for DCN3+ DRM legacy
gamma
For DRM legacy gamma, AMD display manager applies implicit sRGB degamma
using a pre-defined sRGB transfer function. It works fine for DCN2
family where degamma ROM and custom curves go to the same color block.
But, on DCN3+, degamma is split into two blocks: degamma ROM for
pre-defined TFs and `gamma correction` for user/custom curves and
degamma ROM settings doesn't apply to cursor plane. To get DRM legacy
gamma working as expected, enable cursor degamma ROM for implict sRGB
degamma on HW with this configuration.
Cc: stable(a)vger.kernel.org
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2803
Fixes: 96b020e2163f ("drm/amd/display: check attr flag before set cursor degamma on DCN3+")
Signed-off-by: Melissa Wen <mwen(a)igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
index df568a7cd005..b97cbc4e5477 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
@@ -1270,6 +1270,13 @@ void amdgpu_dm_plane_handle_cursor_update(struct drm_plane *plane,
attributes.rotation_angle = 0;
attributes.attribute_flags.value = 0;
+ /* Enable cursor degamma ROM on DCN3+ for implicit sRGB degamma in DRM
+ * legacy gamma setup.
+ */
+ if (crtc_state->cm_is_degamma_srgb &&
+ adev->dm.dc->caps.color.dpp.gamma_corr)
+ attributes.attribute_flags.bits.ENABLE_CURSOR_DEGAMMA = 1;
+
attributes.pitch = afb->base.pitches[0] / afb->base.format->cpp[0];
if (crtc_state->stream) {
The patch below does not apply to the 6.5-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.5.y
git checkout FETCH_HEAD
git cherry-pick -x fabd2165d11649ecca5012d786a62ac149e9d83f
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112454-unwoven-shadow-0d71@gregkh' --subject-prefix 'PATCH 6.5.y' HEAD^..
Possible dependencies:
fabd2165d116 ("drm/amd/display: enable cursor degamma for DCN3+ DRM legacy gamma")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From fabd2165d11649ecca5012d786a62ac149e9d83f Mon Sep 17 00:00:00 2001
From: Melissa Wen <mwen(a)igalia.com>
Date: Thu, 31 Aug 2023 15:12:28 -0100
Subject: [PATCH] drm/amd/display: enable cursor degamma for DCN3+ DRM legacy
gamma
For DRM legacy gamma, AMD display manager applies implicit sRGB degamma
using a pre-defined sRGB transfer function. It works fine for DCN2
family where degamma ROM and custom curves go to the same color block.
But, on DCN3+, degamma is split into two blocks: degamma ROM for
pre-defined TFs and `gamma correction` for user/custom curves and
degamma ROM settings doesn't apply to cursor plane. To get DRM legacy
gamma working as expected, enable cursor degamma ROM for implict sRGB
degamma on HW with this configuration.
Cc: stable(a)vger.kernel.org
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2803
Fixes: 96b020e2163f ("drm/amd/display: check attr flag before set cursor degamma on DCN3+")
Signed-off-by: Melissa Wen <mwen(a)igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
index df568a7cd005..b97cbc4e5477 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
@@ -1270,6 +1270,13 @@ void amdgpu_dm_plane_handle_cursor_update(struct drm_plane *plane,
attributes.rotation_angle = 0;
attributes.attribute_flags.value = 0;
+ /* Enable cursor degamma ROM on DCN3+ for implicit sRGB degamma in DRM
+ * legacy gamma setup.
+ */
+ if (crtc_state->cm_is_degamma_srgb &&
+ adev->dm.dc->caps.color.dpp.gamma_corr)
+ attributes.attribute_flags.bits.ENABLE_CURSOR_DEGAMMA = 1;
+
attributes.pitch = afb->base.pitches[0] / afb->base.format->cpp[0];
if (crtc_state->stream) {
The patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x fabd2165d11649ecca5012d786a62ac149e9d83f
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112453-implicate-dimly-d0a5@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^..
Possible dependencies:
fabd2165d116 ("drm/amd/display: enable cursor degamma for DCN3+ DRM legacy gamma")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From fabd2165d11649ecca5012d786a62ac149e9d83f Mon Sep 17 00:00:00 2001
From: Melissa Wen <mwen(a)igalia.com>
Date: Thu, 31 Aug 2023 15:12:28 -0100
Subject: [PATCH] drm/amd/display: enable cursor degamma for DCN3+ DRM legacy
gamma
For DRM legacy gamma, AMD display manager applies implicit sRGB degamma
using a pre-defined sRGB transfer function. It works fine for DCN2
family where degamma ROM and custom curves go to the same color block.
But, on DCN3+, degamma is split into two blocks: degamma ROM for
pre-defined TFs and `gamma correction` for user/custom curves and
degamma ROM settings doesn't apply to cursor plane. To get DRM legacy
gamma working as expected, enable cursor degamma ROM for implict sRGB
degamma on HW with this configuration.
Cc: stable(a)vger.kernel.org
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2803
Fixes: 96b020e2163f ("drm/amd/display: check attr flag before set cursor degamma on DCN3+")
Signed-off-by: Melissa Wen <mwen(a)igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
index df568a7cd005..b97cbc4e5477 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
@@ -1270,6 +1270,13 @@ void amdgpu_dm_plane_handle_cursor_update(struct drm_plane *plane,
attributes.rotation_angle = 0;
attributes.attribute_flags.value = 0;
+ /* Enable cursor degamma ROM on DCN3+ for implicit sRGB degamma in DRM
+ * legacy gamma setup.
+ */
+ if (crtc_state->cm_is_degamma_srgb &&
+ adev->dm.dc->caps.color.dpp.gamma_corr)
+ attributes.attribute_flags.bits.ENABLE_CURSOR_DEGAMMA = 1;
+
attributes.pitch = afb->base.pitches[0] / afb->base.format->cpp[0];
if (crtc_state->stream) {
The patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x ef013f6fcd8affaae4a5bf4b51cb6244c8a2ed3f
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112403-second-camisole-9772@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^..
Possible dependencies:
ef013f6fcd8a ("drm/amd/display: Don't set dpms_off for seamless boot")
850d2fcf3e34 ("drm/amd/display: only check available pipe to disable vbios mode.")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From ef013f6fcd8affaae4a5bf4b51cb6244c8a2ed3f Mon Sep 17 00:00:00 2001
From: Daniel Miess <daniel.miess(a)amd.com>
Date: Fri, 29 Sep 2023 13:04:33 -0400
Subject: [PATCH] drm/amd/display: Don't set dpms_off for seamless boot
[Why]
eDPs fail to light up with seamless boot enabled
[How]
When seamless boot is enabled don't configure dpms_off
in disable_vbios_mode_if_required.
Reviewed-by: Charlene Liu <charlene.liu(a)amd.com>
Cc: Mario Limonciello <mario.limonciello(a)amd.com>
Cc: Alex Deucher <alexander.deucher(a)amd.com>
Cc: stable(a)vger.kernel.org
Acked-by: Tom Chung <chiahsuan.chung(a)amd.com>
Signed-off-by: Daniel Miess <daniel.miess(a)amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index f9aac215ef1f..00d6fce5b766 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -1232,6 +1232,9 @@ static void disable_vbios_mode_if_required(
if (stream == NULL)
continue;
+ if (stream->apply_seamless_boot_optimization)
+ continue;
+
// only looking for first odm pipe
if (pipe->prev_odm_pipe)
continue;
The patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
git checkout FETCH_HEAD
git cherry-pick -x ef013f6fcd8affaae4a5bf4b51cb6244c8a2ed3f
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112403-spendable-tubeless-a40e@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^..
Possible dependencies:
ef013f6fcd8a ("drm/amd/display: Don't set dpms_off for seamless boot")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From ef013f6fcd8affaae4a5bf4b51cb6244c8a2ed3f Mon Sep 17 00:00:00 2001
From: Daniel Miess <daniel.miess(a)amd.com>
Date: Fri, 29 Sep 2023 13:04:33 -0400
Subject: [PATCH] drm/amd/display: Don't set dpms_off for seamless boot
[Why]
eDPs fail to light up with seamless boot enabled
[How]
When seamless boot is enabled don't configure dpms_off
in disable_vbios_mode_if_required.
Reviewed-by: Charlene Liu <charlene.liu(a)amd.com>
Cc: Mario Limonciello <mario.limonciello(a)amd.com>
Cc: Alex Deucher <alexander.deucher(a)amd.com>
Cc: stable(a)vger.kernel.org
Acked-by: Tom Chung <chiahsuan.chung(a)amd.com>
Signed-off-by: Daniel Miess <daniel.miess(a)amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index f9aac215ef1f..00d6fce5b766 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -1232,6 +1232,9 @@ static void disable_vbios_mode_if_required(
if (stream == NULL)
continue;
+ if (stream->apply_seamless_boot_optimization)
+ continue;
+
// only looking for first odm pipe
if (pipe->prev_odm_pipe)
continue;
The patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x ef013f6fcd8affaae4a5bf4b51cb6244c8a2ed3f
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112402-extending-trapeze-1f68@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^..
Possible dependencies:
ef013f6fcd8a ("drm/amd/display: Don't set dpms_off for seamless boot")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From ef013f6fcd8affaae4a5bf4b51cb6244c8a2ed3f Mon Sep 17 00:00:00 2001
From: Daniel Miess <daniel.miess(a)amd.com>
Date: Fri, 29 Sep 2023 13:04:33 -0400
Subject: [PATCH] drm/amd/display: Don't set dpms_off for seamless boot
[Why]
eDPs fail to light up with seamless boot enabled
[How]
When seamless boot is enabled don't configure dpms_off
in disable_vbios_mode_if_required.
Reviewed-by: Charlene Liu <charlene.liu(a)amd.com>
Cc: Mario Limonciello <mario.limonciello(a)amd.com>
Cc: Alex Deucher <alexander.deucher(a)amd.com>
Cc: stable(a)vger.kernel.org
Acked-by: Tom Chung <chiahsuan.chung(a)amd.com>
Signed-off-by: Daniel Miess <daniel.miess(a)amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index f9aac215ef1f..00d6fce5b766 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -1232,6 +1232,9 @@ static void disable_vbios_mode_if_required(
if (stream == NULL)
continue;
+ if (stream->apply_seamless_boot_optimization)
+ continue;
+
// only looking for first odm pipe
if (pipe->prev_odm_pipe)
continue;
The patch below does not apply to the 6.5-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.5.y
git checkout FETCH_HEAD
git cherry-pick -x ef013f6fcd8affaae4a5bf4b51cb6244c8a2ed3f
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112401-usable-palm-6d98@gregkh' --subject-prefix 'PATCH 6.5.y' HEAD^..
Possible dependencies:
ef013f6fcd8a ("drm/amd/display: Don't set dpms_off for seamless boot")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From ef013f6fcd8affaae4a5bf4b51cb6244c8a2ed3f Mon Sep 17 00:00:00 2001
From: Daniel Miess <daniel.miess(a)amd.com>
Date: Fri, 29 Sep 2023 13:04:33 -0400
Subject: [PATCH] drm/amd/display: Don't set dpms_off for seamless boot
[Why]
eDPs fail to light up with seamless boot enabled
[How]
When seamless boot is enabled don't configure dpms_off
in disable_vbios_mode_if_required.
Reviewed-by: Charlene Liu <charlene.liu(a)amd.com>
Cc: Mario Limonciello <mario.limonciello(a)amd.com>
Cc: Alex Deucher <alexander.deucher(a)amd.com>
Cc: stable(a)vger.kernel.org
Acked-by: Tom Chung <chiahsuan.chung(a)amd.com>
Signed-off-by: Daniel Miess <daniel.miess(a)amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index f9aac215ef1f..00d6fce5b766 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -1232,6 +1232,9 @@ static void disable_vbios_mode_if_required(
if (stream == NULL)
continue;
+ if (stream->apply_seamless_boot_optimization)
+ continue;
+
// only looking for first odm pipe
if (pipe->prev_odm_pipe)
continue;
The patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x ef013f6fcd8affaae4a5bf4b51cb6244c8a2ed3f
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112400-quaking-happy-54f2@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^..
Possible dependencies:
ef013f6fcd8a ("drm/amd/display: Don't set dpms_off for seamless boot")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From ef013f6fcd8affaae4a5bf4b51cb6244c8a2ed3f Mon Sep 17 00:00:00 2001
From: Daniel Miess <daniel.miess(a)amd.com>
Date: Fri, 29 Sep 2023 13:04:33 -0400
Subject: [PATCH] drm/amd/display: Don't set dpms_off for seamless boot
[Why]
eDPs fail to light up with seamless boot enabled
[How]
When seamless boot is enabled don't configure dpms_off
in disable_vbios_mode_if_required.
Reviewed-by: Charlene Liu <charlene.liu(a)amd.com>
Cc: Mario Limonciello <mario.limonciello(a)amd.com>
Cc: Alex Deucher <alexander.deucher(a)amd.com>
Cc: stable(a)vger.kernel.org
Acked-by: Tom Chung <chiahsuan.chung(a)amd.com>
Signed-off-by: Daniel Miess <daniel.miess(a)amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index f9aac215ef1f..00d6fce5b766 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -1232,6 +1232,9 @@ static void disable_vbios_mode_if_required(
if (stream == NULL)
continue;
+ if (stream->apply_seamless_boot_optimization)
+ continue;
+
// only looking for first odm pipe
if (pipe->prev_odm_pipe)
continue;
The patch below does not apply to the 6.5-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.5.y
git checkout FETCH_HEAD
git cherry-pick -x 15e6b396f5ac259126f2447fcd2279ed5d3dd14f
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112412-lagoon-yonder-7f24@gregkh' --subject-prefix 'PATCH 6.5.y' HEAD^..
Possible dependencies:
15e6b396f5ac ("drm/amd/display: update blank state on ODM changes")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 15e6b396f5ac259126f2447fcd2279ed5d3dd14f Mon Sep 17 00:00:00 2001
From: Wenjing Liu <wenjing.liu(a)amd.com>
Date: Mon, 14 Aug 2023 17:11:16 -0400
Subject: [PATCH] drm/amd/display: update blank state on ODM changes
When we are dynamically adding new ODM slices, we didn't update
blank state, if the pipe used by new ODM slice is previously blanked,
we will continue outputting blank pixel data on that slice causing
right half of the screen showing blank image.
The previous fix was a temporary hack to directly update current state
when committing new state. This could potentially cause hw and sw
state synchronization issues and it is not permitted by dc commit
design.
Cc: stable(a)vger.kernel.org
Fixes: 7fbf451e7639 ("drm/amd/display: Reinit DPG when exiting dynamic ODM")
Reviewed-by: Dillon Varone <dillon.varone(a)amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz(a)amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
index d3caba52d2fc..f3db16cd10db 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
@@ -1106,29 +1106,6 @@ void dcn20_blank_pixel_data(
v_active,
offset);
- if (!blank && dc->debug.enable_single_display_2to1_odm_policy) {
- /* when exiting dynamic ODM need to reinit DPG state for unused pipes */
- struct pipe_ctx *old_odm_pipe = dc->current_state->res_ctx.pipe_ctx[pipe_ctx->pipe_idx].next_odm_pipe;
-
- odm_pipe = pipe_ctx->next_odm_pipe;
-
- while (old_odm_pipe) {
- if (!odm_pipe || old_odm_pipe->pipe_idx != odm_pipe->pipe_idx)
- dc->hwss.set_disp_pattern_generator(dc,
- old_odm_pipe,
- CONTROLLER_DP_TEST_PATTERN_VIDEOMODE,
- CONTROLLER_DP_COLOR_SPACE_UDEFINED,
- COLOR_DEPTH_888,
- NULL,
- 0,
- 0,
- 0);
- old_odm_pipe = old_odm_pipe->next_odm_pipe;
- if (odm_pipe)
- odm_pipe = odm_pipe->next_odm_pipe;
- }
- }
-
if (!blank)
if (stream_res->abm) {
dc->hwss.set_pipe(pipe_ctx);
@@ -1732,11 +1709,16 @@ static void dcn20_program_pipe(
struct dc_state *context)
{
struct dce_hwseq *hws = dc->hwseq;
- /* Only need to unblank on top pipe */
- if ((pipe_ctx->update_flags.bits.enable || pipe_ctx->stream->update_flags.bits.abm_level)
- && !pipe_ctx->top_pipe && !pipe_ctx->prev_odm_pipe)
- hws->funcs.blank_pixel_data(dc, pipe_ctx, !pipe_ctx->plane_state->visible);
+ /* Only need to unblank on top pipe */
+ if (resource_is_pipe_type(pipe_ctx, OTG_MASTER)) {
+ if (pipe_ctx->update_flags.bits.enable ||
+ pipe_ctx->update_flags.bits.odm ||
+ pipe_ctx->stream->update_flags.bits.abm_level)
+ hws->funcs.blank_pixel_data(dc, pipe_ctx,
+ !pipe_ctx->plane_state ||
+ !pipe_ctx->plane_state->visible);
+ }
/* Only update TG on top pipe */
if (pipe_ctx->update_flags.bits.global_sync && !pipe_ctx->top_pipe
The patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x 15e6b396f5ac259126f2447fcd2279ed5d3dd14f
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112411-drinking-profane-fe9c@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^..
Possible dependencies:
15e6b396f5ac ("drm/amd/display: update blank state on ODM changes")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 15e6b396f5ac259126f2447fcd2279ed5d3dd14f Mon Sep 17 00:00:00 2001
From: Wenjing Liu <wenjing.liu(a)amd.com>
Date: Mon, 14 Aug 2023 17:11:16 -0400
Subject: [PATCH] drm/amd/display: update blank state on ODM changes
When we are dynamically adding new ODM slices, we didn't update
blank state, if the pipe used by new ODM slice is previously blanked,
we will continue outputting blank pixel data on that slice causing
right half of the screen showing blank image.
The previous fix was a temporary hack to directly update current state
when committing new state. This could potentially cause hw and sw
state synchronization issues and it is not permitted by dc commit
design.
Cc: stable(a)vger.kernel.org
Fixes: 7fbf451e7639 ("drm/amd/display: Reinit DPG when exiting dynamic ODM")
Reviewed-by: Dillon Varone <dillon.varone(a)amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz(a)amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
index d3caba52d2fc..f3db16cd10db 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
@@ -1106,29 +1106,6 @@ void dcn20_blank_pixel_data(
v_active,
offset);
- if (!blank && dc->debug.enable_single_display_2to1_odm_policy) {
- /* when exiting dynamic ODM need to reinit DPG state for unused pipes */
- struct pipe_ctx *old_odm_pipe = dc->current_state->res_ctx.pipe_ctx[pipe_ctx->pipe_idx].next_odm_pipe;
-
- odm_pipe = pipe_ctx->next_odm_pipe;
-
- while (old_odm_pipe) {
- if (!odm_pipe || old_odm_pipe->pipe_idx != odm_pipe->pipe_idx)
- dc->hwss.set_disp_pattern_generator(dc,
- old_odm_pipe,
- CONTROLLER_DP_TEST_PATTERN_VIDEOMODE,
- CONTROLLER_DP_COLOR_SPACE_UDEFINED,
- COLOR_DEPTH_888,
- NULL,
- 0,
- 0,
- 0);
- old_odm_pipe = old_odm_pipe->next_odm_pipe;
- if (odm_pipe)
- odm_pipe = odm_pipe->next_odm_pipe;
- }
- }
-
if (!blank)
if (stream_res->abm) {
dc->hwss.set_pipe(pipe_ctx);
@@ -1732,11 +1709,16 @@ static void dcn20_program_pipe(
struct dc_state *context)
{
struct dce_hwseq *hws = dc->hwseq;
- /* Only need to unblank on top pipe */
- if ((pipe_ctx->update_flags.bits.enable || pipe_ctx->stream->update_flags.bits.abm_level)
- && !pipe_ctx->top_pipe && !pipe_ctx->prev_odm_pipe)
- hws->funcs.blank_pixel_data(dc, pipe_ctx, !pipe_ctx->plane_state->visible);
+ /* Only need to unblank on top pipe */
+ if (resource_is_pipe_type(pipe_ctx, OTG_MASTER)) {
+ if (pipe_ctx->update_flags.bits.enable ||
+ pipe_ctx->update_flags.bits.odm ||
+ pipe_ctx->stream->update_flags.bits.abm_level)
+ hws->funcs.blank_pixel_data(dc, pipe_ctx,
+ !pipe_ctx->plane_state ||
+ !pipe_ctx->plane_state->visible);
+ }
/* Only update TG on top pipe */
if (pipe_ctx->update_flags.bits.global_sync && !pipe_ctx->top_pipe
The patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x 302be1cb9f4b02995f3b10c50494d5eb8fdaf5c1
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112402-confidant-chloride-2c78@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^..
Possible dependencies:
302be1cb9f4b ("drm/amd/display: Add smu write msg id fail retry process")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 302be1cb9f4b02995f3b10c50494d5eb8fdaf5c1 Mon Sep 17 00:00:00 2001
From: Fudong Wang <fudong.wang(a)amd.com>
Date: Fri, 11 Aug 2023 08:24:59 +0800
Subject: [PATCH] drm/amd/display: Add smu write msg id fail retry process
A benchmark stress test (12-40 machines x 48hours) found that DCN315 has
cases where DC writes to an indirect register to set the smu clock msg
id, but when we go to read the same indirect register the returned msg
id doesn't match with what we just set it to. So, to fix this retry the
write until the register's value matches with the requested value.
Cc: stable(a)vger.kernel.org # 6.1+
Fixes: f94903996140 ("drm/amd/display: Add DCN315 CLK_MGR")
Reviewed-by: Charlene Liu <charlene.liu(a)amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz(a)amd.com>
Signed-off-by: Fudong Wang <fudong.wang(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_smu.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_smu.c
index 3e0da873cf4c..1042cf1a3ab0 100644
--- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_smu.c
+++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_smu.c
@@ -32,6 +32,7 @@
#define MAX_INSTANCE 6
#define MAX_SEGMENT 6
+#define SMU_REGISTER_WRITE_RETRY_COUNT 5
struct IP_BASE_INSTANCE {
unsigned int segment[MAX_SEGMENT];
@@ -132,6 +133,8 @@ static int dcn315_smu_send_msg_with_param(
unsigned int msg_id, unsigned int param)
{
uint32_t result;
+ uint32_t i = 0;
+ uint32_t read_back_data;
result = dcn315_smu_wait_for_response(clk_mgr, 10, 200000);
@@ -148,10 +151,19 @@ static int dcn315_smu_send_msg_with_param(
/* Set the parameter register for the SMU message, unit is Mhz */
REG_WRITE(MP1_SMN_C2PMSG_37, param);
- /* Trigger the message transaction by writing the message ID */
- generic_write_indirect_reg(CTX,
- REG_NBIO(RSMU_INDEX), REG_NBIO(RSMU_DATA),
- mmMP1_C2PMSG_3, msg_id);
+ for (i = 0; i < SMU_REGISTER_WRITE_RETRY_COUNT; i++) {
+ /* Trigger the message transaction by writing the message ID */
+ generic_write_indirect_reg(CTX,
+ REG_NBIO(RSMU_INDEX), REG_NBIO(RSMU_DATA),
+ mmMP1_C2PMSG_3, msg_id);
+ read_back_data = generic_read_indirect_reg(CTX,
+ REG_NBIO(RSMU_INDEX), REG_NBIO(RSMU_DATA),
+ mmMP1_C2PMSG_3);
+ if (read_back_data == msg_id)
+ break;
+ udelay(2);
+ smu_print("SMU msg id write fail %x times. \n", i + 1);
+ }
result = dcn315_smu_wait_for_response(clk_mgr, 10, 200000);
The patch below does not apply to the 6.5-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.5.y
git checkout FETCH_HEAD
git cherry-pick -x 302be1cb9f4b02995f3b10c50494d5eb8fdaf5c1
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112401-dwarf-gossip-5724@gregkh' --subject-prefix 'PATCH 6.5.y' HEAD^..
Possible dependencies:
302be1cb9f4b ("drm/amd/display: Add smu write msg id fail retry process")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 302be1cb9f4b02995f3b10c50494d5eb8fdaf5c1 Mon Sep 17 00:00:00 2001
From: Fudong Wang <fudong.wang(a)amd.com>
Date: Fri, 11 Aug 2023 08:24:59 +0800
Subject: [PATCH] drm/amd/display: Add smu write msg id fail retry process
A benchmark stress test (12-40 machines x 48hours) found that DCN315 has
cases where DC writes to an indirect register to set the smu clock msg
id, but when we go to read the same indirect register the returned msg
id doesn't match with what we just set it to. So, to fix this retry the
write until the register's value matches with the requested value.
Cc: stable(a)vger.kernel.org # 6.1+
Fixes: f94903996140 ("drm/amd/display: Add DCN315 CLK_MGR")
Reviewed-by: Charlene Liu <charlene.liu(a)amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz(a)amd.com>
Signed-off-by: Fudong Wang <fudong.wang(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_smu.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_smu.c
index 3e0da873cf4c..1042cf1a3ab0 100644
--- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_smu.c
+++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_smu.c
@@ -32,6 +32,7 @@
#define MAX_INSTANCE 6
#define MAX_SEGMENT 6
+#define SMU_REGISTER_WRITE_RETRY_COUNT 5
struct IP_BASE_INSTANCE {
unsigned int segment[MAX_SEGMENT];
@@ -132,6 +133,8 @@ static int dcn315_smu_send_msg_with_param(
unsigned int msg_id, unsigned int param)
{
uint32_t result;
+ uint32_t i = 0;
+ uint32_t read_back_data;
result = dcn315_smu_wait_for_response(clk_mgr, 10, 200000);
@@ -148,10 +151,19 @@ static int dcn315_smu_send_msg_with_param(
/* Set the parameter register for the SMU message, unit is Mhz */
REG_WRITE(MP1_SMN_C2PMSG_37, param);
- /* Trigger the message transaction by writing the message ID */
- generic_write_indirect_reg(CTX,
- REG_NBIO(RSMU_INDEX), REG_NBIO(RSMU_DATA),
- mmMP1_C2PMSG_3, msg_id);
+ for (i = 0; i < SMU_REGISTER_WRITE_RETRY_COUNT; i++) {
+ /* Trigger the message transaction by writing the message ID */
+ generic_write_indirect_reg(CTX,
+ REG_NBIO(RSMU_INDEX), REG_NBIO(RSMU_DATA),
+ mmMP1_C2PMSG_3, msg_id);
+ read_back_data = generic_read_indirect_reg(CTX,
+ REG_NBIO(RSMU_INDEX), REG_NBIO(RSMU_DATA),
+ mmMP1_C2PMSG_3);
+ if (read_back_data == msg_id)
+ break;
+ udelay(2);
+ smu_print("SMU msg id write fail %x times. \n", i + 1);
+ }
result = dcn315_smu_wait_for_response(clk_mgr, 10, 200000);
The patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x 302be1cb9f4b02995f3b10c50494d5eb8fdaf5c1
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112400-pummel-promptly-91f3@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^..
Possible dependencies:
302be1cb9f4b ("drm/amd/display: Add smu write msg id fail retry process")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 302be1cb9f4b02995f3b10c50494d5eb8fdaf5c1 Mon Sep 17 00:00:00 2001
From: Fudong Wang <fudong.wang(a)amd.com>
Date: Fri, 11 Aug 2023 08:24:59 +0800
Subject: [PATCH] drm/amd/display: Add smu write msg id fail retry process
A benchmark stress test (12-40 machines x 48hours) found that DCN315 has
cases where DC writes to an indirect register to set the smu clock msg
id, but when we go to read the same indirect register the returned msg
id doesn't match with what we just set it to. So, to fix this retry the
write until the register's value matches with the requested value.
Cc: stable(a)vger.kernel.org # 6.1+
Fixes: f94903996140 ("drm/amd/display: Add DCN315 CLK_MGR")
Reviewed-by: Charlene Liu <charlene.liu(a)amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz(a)amd.com>
Signed-off-by: Fudong Wang <fudong.wang(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_smu.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_smu.c
index 3e0da873cf4c..1042cf1a3ab0 100644
--- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_smu.c
+++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_smu.c
@@ -32,6 +32,7 @@
#define MAX_INSTANCE 6
#define MAX_SEGMENT 6
+#define SMU_REGISTER_WRITE_RETRY_COUNT 5
struct IP_BASE_INSTANCE {
unsigned int segment[MAX_SEGMENT];
@@ -132,6 +133,8 @@ static int dcn315_smu_send_msg_with_param(
unsigned int msg_id, unsigned int param)
{
uint32_t result;
+ uint32_t i = 0;
+ uint32_t read_back_data;
result = dcn315_smu_wait_for_response(clk_mgr, 10, 200000);
@@ -148,10 +151,19 @@ static int dcn315_smu_send_msg_with_param(
/* Set the parameter register for the SMU message, unit is Mhz */
REG_WRITE(MP1_SMN_C2PMSG_37, param);
- /* Trigger the message transaction by writing the message ID */
- generic_write_indirect_reg(CTX,
- REG_NBIO(RSMU_INDEX), REG_NBIO(RSMU_DATA),
- mmMP1_C2PMSG_3, msg_id);
+ for (i = 0; i < SMU_REGISTER_WRITE_RETRY_COUNT; i++) {
+ /* Trigger the message transaction by writing the message ID */
+ generic_write_indirect_reg(CTX,
+ REG_NBIO(RSMU_INDEX), REG_NBIO(RSMU_DATA),
+ mmMP1_C2PMSG_3, msg_id);
+ read_back_data = generic_read_indirect_reg(CTX,
+ REG_NBIO(RSMU_INDEX), REG_NBIO(RSMU_DATA),
+ mmMP1_C2PMSG_3);
+ if (read_back_data == msg_id)
+ break;
+ udelay(2);
+ smu_print("SMU msg id write fail %x times. \n", i + 1);
+ }
result = dcn315_smu_wait_for_response(clk_mgr, 10, 200000);
The patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x 31220ee9dc5a3e25d38d29d3816b6e79d8c39abc
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112433-stammer-dragging-584f@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^..
Possible dependencies:
31220ee9dc5a ("drm/amdgpu: add missing NULL check")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 31220ee9dc5a3e25d38d29d3816b6e79d8c39abc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig(a)amd.com>
Date: Fri, 6 Oct 2023 14:04:04 +0200
Subject: [PATCH] drm/amdgpu: add missing NULL check
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
bo->tbo.resource can easily be NULL here.
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2902
Signed-off-by: Christian König <christian.koenig(a)amd.com>
Reviewed-by: Alex Deucher <alexander.deucher(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
CC: stable(a)vger.kernel.org
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
index f3ee83cdf97e..d28e21baef16 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
@@ -252,7 +252,7 @@ static inline bool amdgpu_bo_in_cpu_visible_vram(struct amdgpu_bo *bo)
struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);
struct amdgpu_res_cursor cursor;
- if (bo->tbo.resource->mem_type != TTM_PL_VRAM)
+ if (!bo->tbo.resource || bo->tbo.resource->mem_type != TTM_PL_VRAM)
return false;
amdgpu_res_first(bo->tbo.resource, 0, amdgpu_bo_size(bo), &cursor);
The patch below does not apply to the 6.5-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.5.y
git checkout FETCH_HEAD
git cherry-pick -x 31220ee9dc5a3e25d38d29d3816b6e79d8c39abc
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112433-radar-sizably-d777@gregkh' --subject-prefix 'PATCH 6.5.y' HEAD^..
Possible dependencies:
31220ee9dc5a ("drm/amdgpu: add missing NULL check")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 31220ee9dc5a3e25d38d29d3816b6e79d8c39abc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig(a)amd.com>
Date: Fri, 6 Oct 2023 14:04:04 +0200
Subject: [PATCH] drm/amdgpu: add missing NULL check
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
bo->tbo.resource can easily be NULL here.
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2902
Signed-off-by: Christian König <christian.koenig(a)amd.com>
Reviewed-by: Alex Deucher <alexander.deucher(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
CC: stable(a)vger.kernel.org
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
index f3ee83cdf97e..d28e21baef16 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
@@ -252,7 +252,7 @@ static inline bool amdgpu_bo_in_cpu_visible_vram(struct amdgpu_bo *bo)
struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);
struct amdgpu_res_cursor cursor;
- if (bo->tbo.resource->mem_type != TTM_PL_VRAM)
+ if (!bo->tbo.resource || bo->tbo.resource->mem_type != TTM_PL_VRAM)
return false;
amdgpu_res_first(bo->tbo.resource, 0, amdgpu_bo_size(bo), &cursor);
The patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x 31220ee9dc5a3e25d38d29d3816b6e79d8c39abc
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112432-leotard-abnormal-2b87@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^..
Possible dependencies:
31220ee9dc5a ("drm/amdgpu: add missing NULL check")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 31220ee9dc5a3e25d38d29d3816b6e79d8c39abc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig(a)amd.com>
Date: Fri, 6 Oct 2023 14:04:04 +0200
Subject: [PATCH] drm/amdgpu: add missing NULL check
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
bo->tbo.resource can easily be NULL here.
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2902
Signed-off-by: Christian König <christian.koenig(a)amd.com>
Reviewed-by: Alex Deucher <alexander.deucher(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
CC: stable(a)vger.kernel.org
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
index f3ee83cdf97e..d28e21baef16 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
@@ -252,7 +252,7 @@ static inline bool amdgpu_bo_in_cpu_visible_vram(struct amdgpu_bo *bo)
struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);
struct amdgpu_res_cursor cursor;
- if (bo->tbo.resource->mem_type != TTM_PL_VRAM)
+ if (!bo->tbo.resource || bo->tbo.resource->mem_type != TTM_PL_VRAM)
return false;
amdgpu_res_first(bo->tbo.resource, 0, amdgpu_bo_size(bo), &cursor);
The patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.4.y
git checkout FETCH_HEAD
git cherry-pick -x 084f658ece139645d203fa09c77c7f96cb849bb7
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112418-animation-princess-502b@gregkh' --subject-prefix 'PATCH 5.4.y' HEAD^..
Possible dependencies:
084f658ece13 ("drm/amd/display: prevent potential division by zero errors")
e4ed4dbbc838 ("drm/amd/display: Fix LFC multiplier changing erratically")
bb2746ac9143 ("drm/amd/display: Improve LFC behaviour")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 084f658ece139645d203fa09c77c7f96cb849bb7 Mon Sep 17 00:00:00 2001
From: Hamza Mahfooz <hamza.mahfooz(a)amd.com>
Date: Tue, 5 Sep 2023 13:27:22 -0400
Subject: [PATCH] drm/amd/display: prevent potential division by zero errors
There are two places in apply_below_the_range() where it's possible for
a divide by zero error to occur. So, to fix this make sure the divisor
is non-zero before attempting the computation in both cases.
Cc: stable(a)vger.kernel.org
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2637
Fixes: a463b263032f ("drm/amd/display: Fix frames_to_insert math")
Fixes: ded6119e825a ("drm/amd/display: Reinstate LFC optimization")
Reviewed-by: Aurabindo Pillai <aurabindo.pillai(a)amd.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
index dbd60811f95d..ef3a67409021 100644
--- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
+++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
@@ -338,7 +338,9 @@ static void apply_below_the_range(struct core_freesync *core_freesync,
* - Delta for CEIL: delta_from_mid_point_in_us_1
* - Delta for FLOOR: delta_from_mid_point_in_us_2
*/
- if ((last_render_time_in_us / mid_point_frames_ceil) < in_out_vrr->min_duration_in_us) {
+ if (mid_point_frames_ceil &&
+ (last_render_time_in_us / mid_point_frames_ceil) <
+ in_out_vrr->min_duration_in_us) {
/* Check for out of range.
* If using CEIL produces a value that is out of range,
* then we are forced to use FLOOR.
@@ -385,8 +387,9 @@ static void apply_below_the_range(struct core_freesync *core_freesync,
/* Either we've calculated the number of frames to insert,
* or we need to insert min duration frames
*/
- if (last_render_time_in_us / frames_to_insert <
- in_out_vrr->min_duration_in_us){
+ if (frames_to_insert &&
+ (last_render_time_in_us / frames_to_insert) <
+ in_out_vrr->min_duration_in_us){
frames_to_insert -= (frames_to_insert > 1) ?
1 : 0;
}
The patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x 084f658ece139645d203fa09c77c7f96cb849bb7
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112417-strobe-facial-2d94@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^..
Possible dependencies:
084f658ece13 ("drm/amd/display: prevent potential division by zero errors")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 084f658ece139645d203fa09c77c7f96cb849bb7 Mon Sep 17 00:00:00 2001
From: Hamza Mahfooz <hamza.mahfooz(a)amd.com>
Date: Tue, 5 Sep 2023 13:27:22 -0400
Subject: [PATCH] drm/amd/display: prevent potential division by zero errors
There are two places in apply_below_the_range() where it's possible for
a divide by zero error to occur. So, to fix this make sure the divisor
is non-zero before attempting the computation in both cases.
Cc: stable(a)vger.kernel.org
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2637
Fixes: a463b263032f ("drm/amd/display: Fix frames_to_insert math")
Fixes: ded6119e825a ("drm/amd/display: Reinstate LFC optimization")
Reviewed-by: Aurabindo Pillai <aurabindo.pillai(a)amd.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
index dbd60811f95d..ef3a67409021 100644
--- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
+++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
@@ -338,7 +338,9 @@ static void apply_below_the_range(struct core_freesync *core_freesync,
* - Delta for CEIL: delta_from_mid_point_in_us_1
* - Delta for FLOOR: delta_from_mid_point_in_us_2
*/
- if ((last_render_time_in_us / mid_point_frames_ceil) < in_out_vrr->min_duration_in_us) {
+ if (mid_point_frames_ceil &&
+ (last_render_time_in_us / mid_point_frames_ceil) <
+ in_out_vrr->min_duration_in_us) {
/* Check for out of range.
* If using CEIL produces a value that is out of range,
* then we are forced to use FLOOR.
@@ -385,8 +387,9 @@ static void apply_below_the_range(struct core_freesync *core_freesync,
/* Either we've calculated the number of frames to insert,
* or we need to insert min duration frames
*/
- if (last_render_time_in_us / frames_to_insert <
- in_out_vrr->min_duration_in_us){
+ if (frames_to_insert &&
+ (last_render_time_in_us / frames_to_insert) <
+ in_out_vrr->min_duration_in_us){
frames_to_insert -= (frames_to_insert > 1) ?
1 : 0;
}
The patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
git checkout FETCH_HEAD
git cherry-pick -x 084f658ece139645d203fa09c77c7f96cb849bb7
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112416-unsettled-fritter-7dbb@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^..
Possible dependencies:
084f658ece13 ("drm/amd/display: prevent potential division by zero errors")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 084f658ece139645d203fa09c77c7f96cb849bb7 Mon Sep 17 00:00:00 2001
From: Hamza Mahfooz <hamza.mahfooz(a)amd.com>
Date: Tue, 5 Sep 2023 13:27:22 -0400
Subject: [PATCH] drm/amd/display: prevent potential division by zero errors
There are two places in apply_below_the_range() where it's possible for
a divide by zero error to occur. So, to fix this make sure the divisor
is non-zero before attempting the computation in both cases.
Cc: stable(a)vger.kernel.org
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2637
Fixes: a463b263032f ("drm/amd/display: Fix frames_to_insert math")
Fixes: ded6119e825a ("drm/amd/display: Reinstate LFC optimization")
Reviewed-by: Aurabindo Pillai <aurabindo.pillai(a)amd.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
index dbd60811f95d..ef3a67409021 100644
--- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
+++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
@@ -338,7 +338,9 @@ static void apply_below_the_range(struct core_freesync *core_freesync,
* - Delta for CEIL: delta_from_mid_point_in_us_1
* - Delta for FLOOR: delta_from_mid_point_in_us_2
*/
- if ((last_render_time_in_us / mid_point_frames_ceil) < in_out_vrr->min_duration_in_us) {
+ if (mid_point_frames_ceil &&
+ (last_render_time_in_us / mid_point_frames_ceil) <
+ in_out_vrr->min_duration_in_us) {
/* Check for out of range.
* If using CEIL produces a value that is out of range,
* then we are forced to use FLOOR.
@@ -385,8 +387,9 @@ static void apply_below_the_range(struct core_freesync *core_freesync,
/* Either we've calculated the number of frames to insert,
* or we need to insert min duration frames
*/
- if (last_render_time_in_us / frames_to_insert <
- in_out_vrr->min_duration_in_us){
+ if (frames_to_insert &&
+ (last_render_time_in_us / frames_to_insert) <
+ in_out_vrr->min_duration_in_us){
frames_to_insert -= (frames_to_insert > 1) ?
1 : 0;
}
The patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x 084f658ece139645d203fa09c77c7f96cb849bb7
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112415-ecologist-speckled-1802@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^..
Possible dependencies:
084f658ece13 ("drm/amd/display: prevent potential division by zero errors")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 084f658ece139645d203fa09c77c7f96cb849bb7 Mon Sep 17 00:00:00 2001
From: Hamza Mahfooz <hamza.mahfooz(a)amd.com>
Date: Tue, 5 Sep 2023 13:27:22 -0400
Subject: [PATCH] drm/amd/display: prevent potential division by zero errors
There are two places in apply_below_the_range() where it's possible for
a divide by zero error to occur. So, to fix this make sure the divisor
is non-zero before attempting the computation in both cases.
Cc: stable(a)vger.kernel.org
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2637
Fixes: a463b263032f ("drm/amd/display: Fix frames_to_insert math")
Fixes: ded6119e825a ("drm/amd/display: Reinstate LFC optimization")
Reviewed-by: Aurabindo Pillai <aurabindo.pillai(a)amd.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
index dbd60811f95d..ef3a67409021 100644
--- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
+++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
@@ -338,7 +338,9 @@ static void apply_below_the_range(struct core_freesync *core_freesync,
* - Delta for CEIL: delta_from_mid_point_in_us_1
* - Delta for FLOOR: delta_from_mid_point_in_us_2
*/
- if ((last_render_time_in_us / mid_point_frames_ceil) < in_out_vrr->min_duration_in_us) {
+ if (mid_point_frames_ceil &&
+ (last_render_time_in_us / mid_point_frames_ceil) <
+ in_out_vrr->min_duration_in_us) {
/* Check for out of range.
* If using CEIL produces a value that is out of range,
* then we are forced to use FLOOR.
@@ -385,8 +387,9 @@ static void apply_below_the_range(struct core_freesync *core_freesync,
/* Either we've calculated the number of frames to insert,
* or we need to insert min duration frames
*/
- if (last_render_time_in_us / frames_to_insert <
- in_out_vrr->min_duration_in_us){
+ if (frames_to_insert &&
+ (last_render_time_in_us / frames_to_insert) <
+ in_out_vrr->min_duration_in_us){
frames_to_insert -= (frames_to_insert > 1) ?
1 : 0;
}
The patch below does not apply to the 6.5-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.5.y
git checkout FETCH_HEAD
git cherry-pick -x 084f658ece139645d203fa09c77c7f96cb849bb7
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112414-clarify-palatable-0820@gregkh' --subject-prefix 'PATCH 6.5.y' HEAD^..
Possible dependencies:
084f658ece13 ("drm/amd/display: prevent potential division by zero errors")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 084f658ece139645d203fa09c77c7f96cb849bb7 Mon Sep 17 00:00:00 2001
From: Hamza Mahfooz <hamza.mahfooz(a)amd.com>
Date: Tue, 5 Sep 2023 13:27:22 -0400
Subject: [PATCH] drm/amd/display: prevent potential division by zero errors
There are two places in apply_below_the_range() where it's possible for
a divide by zero error to occur. So, to fix this make sure the divisor
is non-zero before attempting the computation in both cases.
Cc: stable(a)vger.kernel.org
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2637
Fixes: a463b263032f ("drm/amd/display: Fix frames_to_insert math")
Fixes: ded6119e825a ("drm/amd/display: Reinstate LFC optimization")
Reviewed-by: Aurabindo Pillai <aurabindo.pillai(a)amd.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
index dbd60811f95d..ef3a67409021 100644
--- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
+++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
@@ -338,7 +338,9 @@ static void apply_below_the_range(struct core_freesync *core_freesync,
* - Delta for CEIL: delta_from_mid_point_in_us_1
* - Delta for FLOOR: delta_from_mid_point_in_us_2
*/
- if ((last_render_time_in_us / mid_point_frames_ceil) < in_out_vrr->min_duration_in_us) {
+ if (mid_point_frames_ceil &&
+ (last_render_time_in_us / mid_point_frames_ceil) <
+ in_out_vrr->min_duration_in_us) {
/* Check for out of range.
* If using CEIL produces a value that is out of range,
* then we are forced to use FLOOR.
@@ -385,8 +387,9 @@ static void apply_below_the_range(struct core_freesync *core_freesync,
/* Either we've calculated the number of frames to insert,
* or we need to insert min duration frames
*/
- if (last_render_time_in_us / frames_to_insert <
- in_out_vrr->min_duration_in_us){
+ if (frames_to_insert &&
+ (last_render_time_in_us / frames_to_insert) <
+ in_out_vrr->min_duration_in_us){
frames_to_insert -= (frames_to_insert > 1) ?
1 : 0;
}
The patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x 084f658ece139645d203fa09c77c7f96cb849bb7
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112414-reluctant-distance-a85c@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^..
Possible dependencies:
084f658ece13 ("drm/amd/display: prevent potential division by zero errors")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 084f658ece139645d203fa09c77c7f96cb849bb7 Mon Sep 17 00:00:00 2001
From: Hamza Mahfooz <hamza.mahfooz(a)amd.com>
Date: Tue, 5 Sep 2023 13:27:22 -0400
Subject: [PATCH] drm/amd/display: prevent potential division by zero errors
There are two places in apply_below_the_range() where it's possible for
a divide by zero error to occur. So, to fix this make sure the divisor
is non-zero before attempting the computation in both cases.
Cc: stable(a)vger.kernel.org
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2637
Fixes: a463b263032f ("drm/amd/display: Fix frames_to_insert math")
Fixes: ded6119e825a ("drm/amd/display: Reinstate LFC optimization")
Reviewed-by: Aurabindo Pillai <aurabindo.pillai(a)amd.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
index dbd60811f95d..ef3a67409021 100644
--- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
+++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
@@ -338,7 +338,9 @@ static void apply_below_the_range(struct core_freesync *core_freesync,
* - Delta for CEIL: delta_from_mid_point_in_us_1
* - Delta for FLOOR: delta_from_mid_point_in_us_2
*/
- if ((last_render_time_in_us / mid_point_frames_ceil) < in_out_vrr->min_duration_in_us) {
+ if (mid_point_frames_ceil &&
+ (last_render_time_in_us / mid_point_frames_ceil) <
+ in_out_vrr->min_duration_in_us) {
/* Check for out of range.
* If using CEIL produces a value that is out of range,
* then we are forced to use FLOOR.
@@ -385,8 +387,9 @@ static void apply_below_the_range(struct core_freesync *core_freesync,
/* Either we've calculated the number of frames to insert,
* or we need to insert min duration frames
*/
- if (last_render_time_in_us / frames_to_insert <
- in_out_vrr->min_duration_in_us){
+ if (frames_to_insert &&
+ (last_render_time_in_us / frames_to_insert) <
+ in_out_vrr->min_duration_in_us){
frames_to_insert -= (frames_to_insert > 1) ?
1 : 0;
}
The patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x 813ba1ff8484e801d2ef155e0e5388b8a7691788
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112458-pretended-legged-8883@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^..
Possible dependencies:
813ba1ff8484 ("drm/amd/display: limit the v_startup workaround to ASICs older than DCN3.1")
63461ea3fb40 ("Revert "drm/amd/display: Remove v_startup workaround for dcn3+"")
3a31e8b89b72 ("drm/amd/display: Remove v_startup workaround for dcn3+")
e95afc1cf7c6 ("drm/amd/display: Enable AdaptiveSync in DC interface")
d5a43956b73b ("drm/amd/display: move dp capability related logic to link_dp_capability")
94dfeaa46925 ("drm/amd/display: move dp phy related logic to link_dp_phy")
630168a97314 ("drm/amd/display: move dp link training logic to link_dp_training")
238debcaebe4 ("drm/amd/display: Use DML for MALL SS and Subvp allocation calculations")
d144b40a4833 ("drm/amd/display: move dc_link_dpia logic to link_dp_dpia")
a28d0bac0956 ("drm/amd/display: move dpcd logic from dc_link_dpcd to link_dpcd")
a98cdd8c4856 ("drm/amd/display: refactor ddc logic from dc_link_ddc to link_ddc")
4370f72e3845 ("drm/amd/display: refactor hpd logic from dc_link to link_hpd")
0e8cf83a2b47 ("drm/amd/display: allow hpo and dio encoder switching during dp retrain test")
7462475e3a06 ("drm/amd/display: move dccg programming from link hwss hpo dp to hwss")
e85d59885409 ("drm/amd/display: use encoder type independent hwss instead of accessing enc directly")
ebf13b72020a ("drm/amd/display: Revert Scaler HCBlank issue workaround")
639f6ad6df7f ("drm/amd/display: Revert Reduce delay when sink device not able to ACK 00340h write")
d5bec4030fd7 ("drm/amd/display: Use DCC meta pitch for MALL allocation requirements")
359bcc904e23 ("drm/amd/display: Fix arithmetic error in MALL size calculations for subvp")
719b59a3fac1 ("drm/amd/display: MALL SS calculations should iterate over all pipes for cursor")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 813ba1ff8484e801d2ef155e0e5388b8a7691788 Mon Sep 17 00:00:00 2001
From: Hamza Mahfooz <hamza.mahfooz(a)amd.com>
Date: Thu, 31 Aug 2023 15:22:35 -0400
Subject: [PATCH] drm/amd/display: limit the v_startup workaround to ASICs
older than DCN3.1
Since, calling dcn20_adjust_freesync_v_startup() on DCN3.1+ ASICs
can cause the display to flicker and underflow to occur, we shouldn't
call it for them. So, ensure that the DCN version is less than
DCN_VERSION_3_1 before calling dcn20_adjust_freesync_v_startup().
Cc: stable(a)vger.kernel.org
Reviewed-by: Fangzhi Zuo <jerry.zuo(a)amd.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
index 1bfdf0271fdf..a68fb45ed487 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
@@ -1099,7 +1099,8 @@ void dcn20_calculate_dlg_params(struct dc *dc,
context->res_ctx.pipe_ctx[i].plane_res.bw.dppclk_khz =
pipes[pipe_idx].clks_cfg.dppclk_mhz * 1000;
context->res_ctx.pipe_ctx[i].pipe_dlg_param = pipes[pipe_idx].pipe.dest;
- if (context->res_ctx.pipe_ctx[i].stream->adaptive_sync_infopacket.valid)
+ if (dc->ctx->dce_version < DCN_VERSION_3_1 &&
+ context->res_ctx.pipe_ctx[i].stream->adaptive_sync_infopacket.valid)
dcn20_adjust_freesync_v_startup(
&context->res_ctx.pipe_ctx[i].stream->timing,
&context->res_ctx.pipe_ctx[i].pipe_dlg_param.vstartup_start);
The patch below does not apply to the 6.5-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.5.y
git checkout FETCH_HEAD
git cherry-pick -x 813ba1ff8484e801d2ef155e0e5388b8a7691788
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112458-decrease-purging-0c4d@gregkh' --subject-prefix 'PATCH 6.5.y' HEAD^..
Possible dependencies:
813ba1ff8484 ("drm/amd/display: limit the v_startup workaround to ASICs older than DCN3.1")
63461ea3fb40 ("Revert "drm/amd/display: Remove v_startup workaround for dcn3+"")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 813ba1ff8484e801d2ef155e0e5388b8a7691788 Mon Sep 17 00:00:00 2001
From: Hamza Mahfooz <hamza.mahfooz(a)amd.com>
Date: Thu, 31 Aug 2023 15:22:35 -0400
Subject: [PATCH] drm/amd/display: limit the v_startup workaround to ASICs
older than DCN3.1
Since, calling dcn20_adjust_freesync_v_startup() on DCN3.1+ ASICs
can cause the display to flicker and underflow to occur, we shouldn't
call it for them. So, ensure that the DCN version is less than
DCN_VERSION_3_1 before calling dcn20_adjust_freesync_v_startup().
Cc: stable(a)vger.kernel.org
Reviewed-by: Fangzhi Zuo <jerry.zuo(a)amd.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
index 1bfdf0271fdf..a68fb45ed487 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
@@ -1099,7 +1099,8 @@ void dcn20_calculate_dlg_params(struct dc *dc,
context->res_ctx.pipe_ctx[i].plane_res.bw.dppclk_khz =
pipes[pipe_idx].clks_cfg.dppclk_mhz * 1000;
context->res_ctx.pipe_ctx[i].pipe_dlg_param = pipes[pipe_idx].pipe.dest;
- if (context->res_ctx.pipe_ctx[i].stream->adaptive_sync_infopacket.valid)
+ if (dc->ctx->dce_version < DCN_VERSION_3_1 &&
+ context->res_ctx.pipe_ctx[i].stream->adaptive_sync_infopacket.valid)
dcn20_adjust_freesync_v_startup(
&context->res_ctx.pipe_ctx[i].stream->timing,
&context->res_ctx.pipe_ctx[i].pipe_dlg_param.vstartup_start);
The patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x 813ba1ff8484e801d2ef155e0e5388b8a7691788
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112457-stillness-wildcat-9d9e@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^..
Possible dependencies:
813ba1ff8484 ("drm/amd/display: limit the v_startup workaround to ASICs older than DCN3.1")
63461ea3fb40 ("Revert "drm/amd/display: Remove v_startup workaround for dcn3+"")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 813ba1ff8484e801d2ef155e0e5388b8a7691788 Mon Sep 17 00:00:00 2001
From: Hamza Mahfooz <hamza.mahfooz(a)amd.com>
Date: Thu, 31 Aug 2023 15:22:35 -0400
Subject: [PATCH] drm/amd/display: limit the v_startup workaround to ASICs
older than DCN3.1
Since, calling dcn20_adjust_freesync_v_startup() on DCN3.1+ ASICs
can cause the display to flicker and underflow to occur, we shouldn't
call it for them. So, ensure that the DCN version is less than
DCN_VERSION_3_1 before calling dcn20_adjust_freesync_v_startup().
Cc: stable(a)vger.kernel.org
Reviewed-by: Fangzhi Zuo <jerry.zuo(a)amd.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
index 1bfdf0271fdf..a68fb45ed487 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
@@ -1099,7 +1099,8 @@ void dcn20_calculate_dlg_params(struct dc *dc,
context->res_ctx.pipe_ctx[i].plane_res.bw.dppclk_khz =
pipes[pipe_idx].clks_cfg.dppclk_mhz * 1000;
context->res_ctx.pipe_ctx[i].pipe_dlg_param = pipes[pipe_idx].pipe.dest;
- if (context->res_ctx.pipe_ctx[i].stream->adaptive_sync_infopacket.valid)
+ if (dc->ctx->dce_version < DCN_VERSION_3_1 &&
+ context->res_ctx.pipe_ctx[i].stream->adaptive_sync_infopacket.valid)
dcn20_adjust_freesync_v_startup(
&context->res_ctx.pipe_ctx[i].stream->timing,
&context->res_ctx.pipe_ctx[i].pipe_dlg_param.vstartup_start);
The patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x ac0ec1c7d1f0d017d0ea44954026d2f138c581e4
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112433-lyrically-emphasis-8c5c@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^..
Possible dependencies:
ac0ec1c7d1f0 ("drm/amd/display: register edp_backlight_control() for DCN301")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From ac0ec1c7d1f0d017d0ea44954026d2f138c581e4 Mon Sep 17 00:00:00 2001
From: Hamza Mahfooz <hamza.mahfooz(a)amd.com>
Date: Tue, 22 Aug 2023 12:31:09 -0400
Subject: [PATCH] drm/amd/display: register edp_backlight_control() for DCN301
As made mention of in commit 099303e9a9bd ("drm/amd/display: eDP
intermittent black screen during PnP"), we need to turn off the
display's backlight before powering off an eDP display. Not doing so
will result in undefined behaviour according to the eDP spec. So, set
DCN301's edp_backlight_control() function pointer to
dce110_edp_backlight_control().
Cc: stable(a)vger.kernel.org
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2765
Fixes: 9c75891feef0 ("drm/amd/display: rework recent update PHY state commit")
Suggested-by: Swapnil Patel <swapnil.patel(a)amd.com>
Reviewed-by: Harry Wentland <harry.wentland(a)amd.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/dc/dcn301/dcn301_init.c b/drivers/gpu/drm/amd/display/dc/dcn301/dcn301_init.c
index 257df8660b4c..61205cdbe2d5 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn301/dcn301_init.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn301/dcn301_init.c
@@ -75,6 +75,7 @@ static const struct hw_sequencer_funcs dcn301_funcs = {
.get_hw_state = dcn10_get_hw_state,
.clear_status_bits = dcn10_clear_status_bits,
.wait_for_mpcc_disconnect = dcn10_wait_for_mpcc_disconnect,
+ .edp_backlight_control = dce110_edp_backlight_control,
.edp_power_control = dce110_edp_power_control,
.edp_wait_for_hpd_ready = dce110_edp_wait_for_hpd_ready,
.set_cursor_position = dcn10_set_cursor_position,
The patch below does not apply to the 6.5-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.5.y
git checkout FETCH_HEAD
git cherry-pick -x ac0ec1c7d1f0d017d0ea44954026d2f138c581e4
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112432-encrypt-frostily-25e1@gregkh' --subject-prefix 'PATCH 6.5.y' HEAD^..
Possible dependencies:
ac0ec1c7d1f0 ("drm/amd/display: register edp_backlight_control() for DCN301")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From ac0ec1c7d1f0d017d0ea44954026d2f138c581e4 Mon Sep 17 00:00:00 2001
From: Hamza Mahfooz <hamza.mahfooz(a)amd.com>
Date: Tue, 22 Aug 2023 12:31:09 -0400
Subject: [PATCH] drm/amd/display: register edp_backlight_control() for DCN301
As made mention of in commit 099303e9a9bd ("drm/amd/display: eDP
intermittent black screen during PnP"), we need to turn off the
display's backlight before powering off an eDP display. Not doing so
will result in undefined behaviour according to the eDP spec. So, set
DCN301's edp_backlight_control() function pointer to
dce110_edp_backlight_control().
Cc: stable(a)vger.kernel.org
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2765
Fixes: 9c75891feef0 ("drm/amd/display: rework recent update PHY state commit")
Suggested-by: Swapnil Patel <swapnil.patel(a)amd.com>
Reviewed-by: Harry Wentland <harry.wentland(a)amd.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/dc/dcn301/dcn301_init.c b/drivers/gpu/drm/amd/display/dc/dcn301/dcn301_init.c
index 257df8660b4c..61205cdbe2d5 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn301/dcn301_init.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn301/dcn301_init.c
@@ -75,6 +75,7 @@ static const struct hw_sequencer_funcs dcn301_funcs = {
.get_hw_state = dcn10_get_hw_state,
.clear_status_bits = dcn10_clear_status_bits,
.wait_for_mpcc_disconnect = dcn10_wait_for_mpcc_disconnect,
+ .edp_backlight_control = dce110_edp_backlight_control,
.edp_power_control = dce110_edp_power_control,
.edp_wait_for_hpd_ready = dce110_edp_wait_for_hpd_ready,
.set_cursor_position = dcn10_set_cursor_position,
The patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x ac0ec1c7d1f0d017d0ea44954026d2f138c581e4
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112431-scolding-varsity-1012@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^..
Possible dependencies:
ac0ec1c7d1f0 ("drm/amd/display: register edp_backlight_control() for DCN301")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From ac0ec1c7d1f0d017d0ea44954026d2f138c581e4 Mon Sep 17 00:00:00 2001
From: Hamza Mahfooz <hamza.mahfooz(a)amd.com>
Date: Tue, 22 Aug 2023 12:31:09 -0400
Subject: [PATCH] drm/amd/display: register edp_backlight_control() for DCN301
As made mention of in commit 099303e9a9bd ("drm/amd/display: eDP
intermittent black screen during PnP"), we need to turn off the
display's backlight before powering off an eDP display. Not doing so
will result in undefined behaviour according to the eDP spec. So, set
DCN301's edp_backlight_control() function pointer to
dce110_edp_backlight_control().
Cc: stable(a)vger.kernel.org
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2765
Fixes: 9c75891feef0 ("drm/amd/display: rework recent update PHY state commit")
Suggested-by: Swapnil Patel <swapnil.patel(a)amd.com>
Reviewed-by: Harry Wentland <harry.wentland(a)amd.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
diff --git a/drivers/gpu/drm/amd/display/dc/dcn301/dcn301_init.c b/drivers/gpu/drm/amd/display/dc/dcn301/dcn301_init.c
index 257df8660b4c..61205cdbe2d5 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn301/dcn301_init.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn301/dcn301_init.c
@@ -75,6 +75,7 @@ static const struct hw_sequencer_funcs dcn301_funcs = {
.get_hw_state = dcn10_get_hw_state,
.clear_status_bits = dcn10_clear_status_bits,
.wait_for_mpcc_disconnect = dcn10_wait_for_mpcc_disconnect,
+ .edp_backlight_control = dce110_edp_backlight_control,
.edp_power_control = dce110_edp_power_control,
.edp_wait_for_hpd_ready = dce110_edp_wait_for_hpd_ready,
.set_cursor_position = dcn10_set_cursor_position,
The patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x 745f17a4166e79315e4b7f33ce89d03e75a76983
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112416-buffoon-yelp-9bd7@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^..
Possible dependencies:
745f17a4166e ("ext4: fix race between writepages and remount")
1b2924393309 ("Revert "ext4: don't clear SB_RDONLY when remounting r/w until quota is re-enabled"")
eb1f822c76be ("ext4: enable the lazy init thread when remounting read/write")
4c0b4818b1f6 ("ext4: improve error recovery code paths in __ext4_remount()")
a44be64bbecb ("ext4: don't clear SB_RDONLY when remounting r/w until quota is re-enabled")
3b50d5018ed0 ("ext4: reflect error codes from ext4_multi_mount_protect() to its callers")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 745f17a4166e79315e4b7f33ce89d03e75a76983 Mon Sep 17 00:00:00 2001
From: Baokun Li <libaokun1(a)huawei.com>
Date: Wed, 24 May 2023 15:25:38 +0800
Subject: [PATCH] ext4: fix race between writepages and remount
We got a WARNING in ext4_add_complete_io:
==================================================================
WARNING: at fs/ext4/page-io.c:231 ext4_put_io_end_defer+0x182/0x250
CPU: 10 PID: 77 Comm: ksoftirqd/10 Tainted: 6.3.0-rc2 #85
RIP: 0010:ext4_put_io_end_defer+0x182/0x250 [ext4]
[...]
Call Trace:
<TASK>
ext4_end_bio+0xa8/0x240 [ext4]
bio_endio+0x195/0x310
blk_update_request+0x184/0x770
scsi_end_request+0x2f/0x240
scsi_io_completion+0x75/0x450
scsi_finish_command+0xef/0x160
scsi_complete+0xa3/0x180
blk_complete_reqs+0x60/0x80
blk_done_softirq+0x25/0x40
__do_softirq+0x119/0x4c8
run_ksoftirqd+0x42/0x70
smpboot_thread_fn+0x136/0x3c0
kthread+0x140/0x1a0
ret_from_fork+0x2c/0x50
==================================================================
Above issue may happen as follows:
cpu1 cpu2
----------------------------|----------------------------
mount -o dioread_lock
ext4_writepages
ext4_do_writepages
*if (ext4_should_dioread_nolock(inode))*
// rsv_blocks is not assigned here
mount -o remount,dioread_nolock
ext4_journal_start_with_reserve
__ext4_journal_start
__ext4_journal_start_sb
jbd2__journal_start
*if (rsv_blocks)*
// h_rsv_handle is not initialized here
mpage_map_and_submit_extent
mpage_map_one_extent
dioread_nolock = ext4_should_dioread_nolock(inode)
if (dioread_nolock && (map->m_flags & EXT4_MAP_UNWRITTEN))
mpd->io_submit.io_end->handle = handle->h_rsv_handle
ext4_set_io_unwritten_flag
io_end->flag |= EXT4_IO_END_UNWRITTEN
// now io_end->handle is NULL but has EXT4_IO_END_UNWRITTEN flag
scsi_finish_command
scsi_io_completion
scsi_io_completion_action
scsi_end_request
blk_update_request
req_bio_endio
bio_endio
bio->bi_end_io > ext4_end_bio
ext4_put_io_end_defer
ext4_add_complete_io
// trigger WARN_ON(!io_end->handle && sbi->s_journal);
The immediate cause of this problem is that ext4_should_dioread_nolock()
function returns inconsistent values in the ext4_do_writepages() and
mpage_map_one_extent(). There are four conditions in this function that
can be changed at mount time to cause this problem. These four conditions
can be divided into two categories:
(1) journal_data and EXT4_EXTENTS_FL, which can be changed by ioctl
(2) DELALLOC and DIOREAD_NOLOCK, which can be changed by remount
The two in the first category have been fixed by commit c8585c6fcaf2
("ext4: fix races between changing inode journal mode and ext4_writepages")
and commit cb85f4d23f79 ("ext4: fix race between writepages and enabling
EXT4_EXTENTS_FL") respectively.
Two cases in the other category have not yet been fixed, and the above
issue is caused by this situation. We refer to the fix for the first
category, when applying options during remount, we grab s_writepages_rwsem
to avoid racing with writepages ops to trigger this problem.
Fixes: 6b523df4fb5a ("ext4: use transaction reservation for extent conversion in ext4_end_io")
Cc: stable(a)vger.kernel.org
Signed-off-by: Baokun Li <libaokun1(a)huawei.com>
Reviewed-by: Jan Kara <jack(a)suse.cz>
Link: https://lore.kernel.org/r/20230524072538.2883391-1-libaokun1@huawei.com
Signed-off-by: Theodore Ts'o <tytso(a)mit.edu>
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 9418359b1d9d..cd4ccae1e28a 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -1676,7 +1676,8 @@ struct ext4_sb_info {
/*
* Barrier between writepages ops and changing any inode's JOURNAL_DATA
- * or EXTENTS flag.
+ * or EXTENTS flag or between writepages ops and changing DELALLOC or
+ * DIOREAD_NOLOCK mount options on remount.
*/
struct percpu_rw_semaphore s_writepages_rwsem;
struct dax_device *s_daxdev;
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 6f48dec19f4a..d062383ea50e 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -6443,6 +6443,7 @@ static int __ext4_remount(struct fs_context *fc, struct super_block *sb)
struct ext4_mount_options old_opts;
ext4_group_t g;
int err = 0;
+ int alloc_ctx;
#ifdef CONFIG_QUOTA
int enable_quota = 0;
int i, j;
@@ -6483,7 +6484,16 @@ static int __ext4_remount(struct fs_context *fc, struct super_block *sb)
}
+ /*
+ * Changing the DIOREAD_NOLOCK or DELALLOC mount options may cause
+ * two calls to ext4_should_dioread_nolock() to return inconsistent
+ * values, triggering WARN_ON in ext4_add_complete_io(). we grab
+ * here s_writepages_rwsem to avoid race between writepages ops and
+ * remount.
+ */
+ alloc_ctx = ext4_writepages_down_write(sb);
ext4_apply_options(fc, sb);
+ ext4_writepages_up_write(sb, alloc_ctx);
if ((old_opts.s_mount_opt & EXT4_MOUNT_JOURNAL_CHECKSUM) ^
test_opt(sb, JOURNAL_CHECKSUM)) {
@@ -6701,6 +6711,8 @@ static int __ext4_remount(struct fs_context *fc, struct super_block *sb)
if (sb_rdonly(sb) && !(old_sb_flags & SB_RDONLY) &&
sb_any_quota_suspended(sb))
dquot_resume(sb, -1);
+
+ alloc_ctx = ext4_writepages_down_write(sb);
sb->s_flags = old_sb_flags;
sbi->s_mount_opt = old_opts.s_mount_opt;
sbi->s_mount_opt2 = old_opts.s_mount_opt2;
@@ -6709,6 +6721,8 @@ static int __ext4_remount(struct fs_context *fc, struct super_block *sb)
sbi->s_commit_interval = old_opts.s_commit_interval;
sbi->s_min_batch_time = old_opts.s_min_batch_time;
sbi->s_max_batch_time = old_opts.s_max_batch_time;
+ ext4_writepages_up_write(sb, alloc_ctx);
+
if (!test_opt(sb, BLOCK_VALIDITY) && sbi->s_system_blks)
ext4_release_system_zone(sb);
#ifdef CONFIG_QUOTA