OSDN Git Service

drm/amdkfd: Provide SMI events watch
authorAmber Lin <Amber.Lin@amd.com>
Wed, 13 May 2020 12:19:29 +0000 (08:19 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 15 Jul 2020 17:27:34 +0000 (13:27 -0400)
commit938a0650aae6275ba8e924685836bdee2c6aa3db
treee36ae92e190417ebe89b75ed95101dd0d6fb1780
parent85e7151baa2ffc76edd9a0267caffd369ab6cd93
drm/amdkfd: Provide SMI events watch

When the compute is malfunctioning or performance drops, the system admin
will use SMI (System Management Interface) tool to monitor/diagnostic what
went wrong. This patch provides an event watch interface for the user
space to register devices and subscribe events they are interested. After
registered, the user can use annoymous file descriptor's poll function
with wait-time specified and wait for events to happen. Once an event
happens, the user can use read() to retrieve information related to the
event.

VM fault event is done in this patch.

v2: - remove UNREGISTER and add event ENABLE/DISABLE
    - correct kfifo usage
    - move event message API to kfd_ioctl.h
v3: send the event msg in text than in binary
v4: support multiple clients
v5: move events enablement from ioctl to fd write
v6: sparse fix

Signed-off-by: Amber Lin <Amber.Lin@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/Makefile
drivers/gpu/drm/amd/amdkfd/cik_event_interrupt.c
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
drivers/gpu/drm/amd/amdkfd/kfd_device.c
drivers/gpu/drm/amd/amdkfd/kfd_int_process_v9.c
drivers/gpu/drm/amd/amdkfd/kfd_priv.h
drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c [new file with mode: 0644]
drivers/gpu/drm/amd/amdkfd/kfd_smi_events.h [new file with mode: 0644]
include/uapi/linux/kfd_ioctl.h