linux/drivers/gpu/drm
Tobias Klausmann e94c55b8e0 nouveau: Skip unvailable ttm page entries
Starting with commit f295c8cfec
("drm/nouveau: fix dma syncing warning with debugging on.")
the following oops occures:

   BUG: kernel NULL pointer dereference, address: 0000000000000000
   #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: 1013 Comm: Xorg.bin Tainted: G E     5.11.0-desktop-rc0+ #2
   Hardware name: Acer Aspire VN7-593G/Pluto_KLS, BIOS V1.11 08/01/2018
   RIP: 0010:nouveau_bo_sync_for_device+0x40/0xb0 [nouveau]
   Call Trace:
    nouveau_bo_validate+0x5d/0x80 [nouveau]
    nouveau_gem_ioctl_pushbuf+0x662/0x1120 [nouveau]
    ? nouveau_gem_ioctl_new+0xf0/0xf0 [nouveau]
    drm_ioctl_kernel+0xa6/0xf0 [drm]
    drm_ioctl+0x1f4/0x3a0 [drm]
    ? nouveau_gem_ioctl_new+0xf0/0xf0 [nouveau]
    nouveau_drm_ioctl+0x50/0xa0 [nouveau]
    __x64_sys_ioctl+0x7e/0xb0
    do_syscall_64+0x33/0x80
    entry_SYSCALL_64_after_hwframe+0x44/0xae
   ---[ end trace ccfb1e7f4064374f ]---
   RIP: 0010:nouveau_bo_sync_for_device+0x40/0xb0 [nouveau]

The underlying problem is not introduced by the commit, yet it uncovered the
underlying issue. The cited commit relies on valid pages. This is not given for
due to some bugs. For now, just warn and work around the issue by just ignoring
the bad ttm objects.
Below is some debug info gathered while debugging this issue:

nouveau 0000:01:00.0: DRM: ttm_dma->num_pages: 2048
nouveau 0000:01:00.0: DRM: ttm_dma->pages is NULL
nouveau 0000:01:00.0: DRM: ttm_dma: 00000000e96058e7
nouveau 0000:01:00.0: DRM: ttm_dma->page_flags:
nouveau 0000:01:00.0: DRM: ttm_dma:   Populated: 1
nouveau 0000:01:00.0: DRM: ttm_dma:   No Retry: 0
nouveau 0000:01:00.0: DRM: ttm_dma:   SG: 256
nouveau 0000:01:00.0: DRM: ttm_dma:   Zero Alloc: 0
nouveau 0000:01:00.0: DRM: ttm_dma:   Swapped: 0

Signed-off-by: Tobias Klausmann <tobias.klausmann@freenet.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210313222159.3346-1-tobias.klausmann@freenet.de
2021-03-19 10:38:31 +10:00
..
amd drm/amd/display: Remove MPC gamut remap logic for DCN30 2021-03-18 00:05:22 -04:00
arc
arm
armada
aspeed
ast
atmel-hlcdc
bochs
bridge drm pull for 5.12-rc1 2021-02-21 14:44:44 -08:00
etnaviv
exynos
fsl-dcu
gma500 platform-drivers-x86 for v5.12-1 2021-02-22 08:50:01 -08:00
hisilicon
i2c
i810
i915 i915/perf: Start hrtimer only if sampling the OA buffer 2021-03-17 12:51:37 +02:00
imx
ingenic
kmb
lib
lima
mcde
mediatek
meson drm: meson_drv add shutdown function 2021-03-11 11:11:33 +01:00
mga
mgag200
msm drm fixes for 5.12-rc1 + msm-next 2021-02-25 12:10:22 -08:00
mxsfb
nouveau nouveau: Skip unvailable ttm page entries 2021-03-19 10:38:31 +10:00
omapdrm drm/omap: dsi: fix unsigned expression compared with zero 2021-03-17 13:59:23 +02:00
panel drm/panel: kd35t133: allow using non-continuous dsi clock 2021-02-25 10:18:45 +01:00
panfrost
pl111 ARM updates for 5.12-rc1: 2021-02-22 14:27:07 -08:00
qxl qxl: Fix uninitialised struct field head.surface_id 2021-03-11 11:11:33 +01:00
r128
radeon Merge tag 'amd-drm-fixes-5.12-2021-03-10' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes 2021-03-12 11:20:02 +10:00
rcar-du
rockchip drm/rockchip: Require the YTR modifier for AFBC 2021-02-25 10:18:45 +01:00
savage
scheduler
selftests
shmobile
sis
sti
stm
sun4i drm pull for 5.12-rc1 2021-02-21 14:44:44 -08:00
tdfx
tegra
tidss
tilcdc doc: use KCFLAGS instead of EXTRA_CFLAGS to pass flags from command line 2021-02-22 13:59:10 -07:00
tiny drm: Use USB controller's DMA mask when importing dmabufs 2021-03-11 11:11:33 +01:00
ttm drm/ttm: Fix TTM page pool accounting 2021-03-11 11:11:33 +01:00
tve200
udl drm: Use USB controller's DMA mask when importing dmabufs 2021-03-11 11:11:33 +01:00
v3d
vboxvideo
vc4 drm pull for 5.12-rc1 2021-02-21 14:44:44 -08:00
vgem
via
virtio
vkms
vmwgfx mm: use is_cow_mapping() across tree where proper 2021-03-13 11:27:30 -08:00
xen
xlnx
zte
Kconfig Merge tag 'amd-drm-fixes-5.12-2021-03-10' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes 2021-03-12 11:20:02 +10:00
Makefile
drm_agpsupport.c
drm_atomic.c
drm_atomic_helper.c
drm_atomic_state_helper.c
drm_atomic_uapi.c
drm_auth.c
drm_blend.c
drm_bridge.c
drm_bridge_connector.c
drm_bufs.c
drm_cache.c
drm_client.c
drm_client_modeset.c
drm_color_mgmt.c
drm_connector.c
drm_context.c
drm_crtc.c
drm_crtc_helper.c
drm_crtc_helper_internal.h
drm_crtc_internal.h
drm_damage_helper.c
drm_debugfs.c
drm_debugfs_crc.c
drm_dma.c
drm_dp_aux_dev.c
drm_dp_cec.c
drm_dp_dual_mode_helper.c
drm_dp_helper.c
drm_dp_mst_topology.c drm pull for 5.12-rc1 2021-02-21 14:44:44 -08:00
drm_dp_mst_topology_internal.h
drm_drv.c
drm_dsc.c
drm_dumb_buffers.c
drm_edid.c
drm_edid_load.c
drm_encoder.c
drm_encoder_slave.c
drm_fb_cma_helper.c
drm_fb_helper.c drm/fb-helper: only unmap if buffer not null 2021-03-11 11:08:14 +01:00
drm_file.c drm/drm_vblank: set the dma-fence timestamp during send_vblank_event 2021-02-24 21:05:54 +05:30
drm_flip_work.c
drm_format_helper.c
drm_fourcc.c
drm_framebuffer.c
drm_gem.c
drm_gem_cma_helper.c
drm_gem_framebuffer_helper.c
drm_gem_shmem_helper.c drm/shmem-helpers: vunmap: Don't put pages for dma-buf 2021-03-11 11:11:33 +01:00
drm_gem_ttm_helper.c
drm_gem_vram_helper.c
drm_hashtab.c
drm_hdcp.c
drm_internal.h
drm_ioc32.c drm/compat: Clear bounce structures 2021-03-11 11:11:33 +01:00
drm_ioctl.c
drm_irq.c
drm_kms_helper_common.c
drm_lease.c
drm_legacy.h
drm_legacy_misc.c
drm_lock.c
drm_managed.c
drm_memory.c
drm_mipi_dbi.c
drm_mipi_dsi.c
drm_mm.c
drm_mode_config.c
drm_mode_object.c
drm_modes.c
drm_modeset_helper.c
drm_modeset_lock.c
drm_of.c
drm_panel.c
drm_panel_orientation_quirks.c
drm_pci.c
drm_plane.c
drm_plane_helper.c
drm_prime.c
drm_print.c
drm_probe_helper.c
drm_property.c
drm_rect.c
drm_scatter.c
drm_scdc_helper.c
drm_self_refresh_helper.c
drm_simple_kms_helper.c
drm_syncobj.c
drm_sysfs.c
drm_trace.h
drm_trace_points.c
drm_vblank.c drm/drm_vblank: set the dma-fence timestamp during send_vblank_event 2021-02-24 21:05:54 +05:30
drm_vblank_work.c
drm_vm.c
drm_vma_manager.c
drm_writeback.c