milos-linux/drivers
Honglei Huang ce3fb4b971 drm/amdgpu: drop retry loop in amdgpu_hmm_range_get_pages
commit 342981fff32802a819d6fc7cf3c9fedf9f3d9d60 upstream.

Since commit c08972f55594 ("drm/amdgpu: fix amdgpu_hmm_range_get_pages")
moved mmu_interval_read_begin() out of the per-chunk loop, the
captured notifier_seq is no longer refreshed across retries. As a
result, the existing -EBUSY retry path can never make progress:

  hmm_range_fault() returns -EBUSY only when
  mmu_interval_check_retry(notifier, notifier_seq) reports that the
  sequence is stale. Once the sequence has advanced, the stored seq
  will never match again, so every subsequent call within the same
  invocation returns -EBUSY immediately.

The "goto retry" therefore degenerates into a busy spin that simply
burns CPU for the full HMM_RANGE_DEFAULT_TIMEOUT (~1s) window before
finally bailing out with -EAGAIN. This is pure latency with no chance
of recovery, and it actively hurts the KFD userptr stack: the caller
ends up blocked for a second while holding mmap_lock, only to return
-EAGAIN to the restore worker (or to userspace) which would have
re-driven the operation immediately anyway.

Drop the retry/timeout entirely and let -EBUSY propagate straight to
out_free_pfns, where it is already translated to -EAGAIN. Recovery is
handled at a higher level: the KFD restore_userptr_worker reschedules
itself, and the userptr ioctl path returns -EAGAIN to userspace.

No functional regression: the previous behaviour on -EBUSY was already
to fail with -EAGAIN after a 1s stall; we just skip the stall.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Honglei Huang <honghuan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-06-19 13:50:58 +02:00
..
accel accel/amdxdna: Fix mm_struct reference leak in aie2_populate_range() 2026-06-11 09:50:07 -07:00
accessibility
acpi ACPI: button: Add missing device class clearing on probe failures 2026-05-25 09:52:34 +02:00
amba
android rust_binder: Avoid holding lock when dropping delivered_death 2026-05-22 11:55:48 +02:00
ata ata: libata-scsi: do not needlessly defer commands when using PMP with FBS 2026-05-18 12:26:51 +02:00
atm
auxdisplay auxdisplay: Kconfig: drop unneeded quotes in PANEL_BOOT_MESSAGE dep 2026-05-17 07:58:30 +02:00
base driver core: reject devices with unregistered buses 2026-06-19 13:50:57 +02:00
bcma
block zram: fix use-after-free in zram_bvec_write_partial() 2026-06-03 16:25:50 -07:00
bluetooth Bluetooth: hci_qca: Use 100 ms SSR delay for rampatch and NVM loading 2026-05-27 16:44:02 -04:00
bus
cache
cdrom
cdx
char
clk Qualcomm clock fixes for v7.1 2026-05-28 18:21:54 -07:00
clocksource
comedi comedi: comedi_test: fix check for valid scan_begin_src in waveform_ai_cmdtest() 2026-05-21 10:34:04 +02:00
connector
counter
cpufreq amd-pstate fixes for 7.1 (2026-06-02) 2026-06-08 15:20:04 +02:00
cpuidle
crypto
cxl
dax
dca
devfreq
dibs
dio
dma
dma-buf dma-buf: fix UAF in dma_buf_fd() tracepoint 2026-05-28 20:05:43 +05:30
dpll dpll: zl3073x: make frequency monitor a per-device attribute 2026-05-28 14:05:29 +02:00
edac
eisa
extcon
firewire
firmware Char/Misc driver fixes for 7.1-final 2026-06-12 09:00:28 -07:00
fpga
fsi
fwctl fwctl: pds: Validate RPC input size before parsing 2026-05-19 10:44:32 -03:00
gnss
gpib Revert "gpib: cb7210: Fix region leak when request_irq fails" 2026-05-30 12:25:36 +02:00
gpio gpiolib: handle gpio-hogs only once 2026-06-10 10:12:57 +02:00
gpu drm/amdgpu: drop retry loop in amdgpu_hmm_range_get_pages 2026-06-19 13:50:58 +02:00
greybus
hid HID: Input: Add battery list cleanup with devm action 2026-06-19 13:50:58 +02:00
hsi
hte
hv mshv: support 1G hugepages by passing them as 2M-aligned chunks 2026-05-27 15:30:15 -07:00
hwmon hwmon: (pmbus/adm1266) serialize sequencer_state debugfs read with pmbus_lock 2026-05-21 07:00:39 -07:00
hwspinlock
hwtracing
i2c i2c: imx-lpi2c: fix resource leaks switching to devm_dma_request_chan() 2026-06-09 10:13:09 +02:00
i3c
idle
iio
infiniband RDMA/srp: bound SRP_RSP sense copy by the received length 2026-06-08 13:43:23 -03:00
input Input updates for v7.1-rc6 2026-06-07 08:40:53 -07:00
interconnect
iommu dma-mapping fixes for Linux 7.1 2026-06-11 14:22:26 -07:00
ipack
irqchip irqchip/renesas-rzt2h: Use pm_runtime_put_sync() in probe error path 2026-05-21 20:11:29 +02:00
leds
macintosh
mailbox
mcb
md - fix race condition in dm-cache-policy-smq 2026-06-01 19:55:30 -07:00
media media: rc: igorplugusb: fix control request setup packet 2026-05-30 18:21:47 +02:00
memory
memstick
message
mfd
misc misc: fastrpc: fix use-after-free race in fastrpc_map_create 2026-06-05 17:20:51 +02:00
mmc MMC core: 2026-06-03 09:09:24 -07:00
most
mtd
mux
net octeontx2-af: fix IP fragment flag corruption on custom KPU profile load 2026-06-11 12:59:34 +02:00
nfc nfc: nxp-nci: i2c: use rising-edge IRQ on ACPI systems 2026-05-18 18:30:36 +02:00
ntb
nubus
nvdimm
nvme Including fixes from netfilter. 2026-05-28 13:13:48 -07:00
nvmem nvmem: core: fix use-after-free bugs in error paths 2026-06-05 17:18:58 +02:00
of
opp
parisc
parport parport: Fix race between port and client registration 2026-05-22 12:19:02 +02:00
pci pci-v7.1-fixes-2 2026-05-21 15:02:12 -07:00
pcmcia
peci
perf
phy phy: qcom: qmp-usbc: Fix out-of-bounds array access in dp swing config 2026-05-19 15:42:11 +05:30
pinctrl Revert "pinctrl-amd: enable IRQ for WACF2200 touchscreen on Lenovo Yoga 7 14AGP11" 2026-05-30 00:00:33 +02:00
platform platform-drivers-x86 for v7.1-4 2026-05-22 15:45:26 -07:00
pmdomain pmdomain: imx: fix OF node refcount 2026-06-03 11:49:37 +02:00
pnp
power
powercap
pps
ps3
ptp ptp: ocp: fix resource freeing order 2026-06-09 19:26:56 -07:00
pwm
rapidio
ras
regulator regulator: mt6363: select CONFIG_IRQ_DOMAIN 2026-05-26 15:17:16 +01:00
remoteproc
resctrl
reset
rpmsg
rtc
s390
sbus
scsi SCSI fixes on 20260531 2026-05-31 08:45:08 -07:00
sh
siox
slimbus slimbus: qcom-ngd-ctrl: Avoid ABBA on tx_lock/ctrl->lock 2026-06-05 17:19:51 +02:00
soc soc: fixes for 7.3, part 3 2026-06-12 08:44:56 -07:00
soundwire
spi spi: Fixes for v7.1 2026-06-12 11:06:16 -07:00
spmi
ssb
staging Staging driver fixes for 7.1-final 2026-06-12 10:10:12 -07:00
target scsi: target: iscsi: Validate CHAP_R length before base64 decode 2026-05-22 23:06:00 -04:00
tc
tee QCOMTEE fix for v7.1 2026-05-28 15:31:48 +02:00
thermal
thunderbolt thunderbolt: Limit XDomain response copy to actual frame size 2026-05-26 15:18:31 +02:00
tty serial: dz: Enable modular build 2026-05-22 11:52:34 +02:00
ufs soc: fixes for 7.1, part 2 2026-06-02 10:54:11 -07:00
uio uio: uio_pci_generic_sva: fix double free of devm_kzalloc() memory 2026-05-22 12:19:02 +02:00
usb USB: serial: kl5kusb105: fix bulk-out buffer overflow 2026-06-08 13:43:10 +02:00
vdpa
vfio
vhost
video
virt virt: sev-guest: Explicitly leak pages in unknown state 2026-05-20 18:03:17 -07:00
virtio
w1
watchdog
xen
zorro
Kconfig
Makefile