]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdgpu: Replace in_interrupt() usage in gmc_v*_process_interrupt()
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Tue, 9 Feb 2021 12:44:37 +0000 (13:44 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 24 Mar 2021 03:27:58 +0000 (23:27 -0400)
commitabc0ffeae294ae8cf954b30e468ad921dba26675
tree013d11e20c2cbb83e55b3cf23467723b9bb9a2c8
parentcafaa9568e4a6ed637c9b65c61287296d033bb86
drm/amdgpu: Replace in_interrupt() usage in gmc_v*_process_interrupt()

The usage of in_interrupt() in gmc_v*_process_interrupt() is intended to
use a different code path if invoked from the interrupt handler vs
invoked from the workqueue.

The usage of in_interrupt() in drivers is phased out and Linus clearly
requested that code which changes behaviour depending on context should
either be separated or the context be conveyed in an argument passed by the
caller, which usually knows the context.

gmc_v*_process_interrupt() is invoked via the ->process() callback
from amdgpu_ih_process() which in turn is invoked either from
amdgpu_irq_handler() (the interrupt handler) or from
amdgpu_irq_handle_*() which is a workqueue.

amdgpu_irq::ih is always processed from the interrupt handler, the other
three struct amdgpu_ih_ring members are processed from a workqueue.

Replace the in_interrupt() check with a comparison against adev->irq.ih.
A similar check is already done to check if the ih pointer is from
ih_soft.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c