drm/amdgpu: drop the drm irq pre/post/un install callbacks
The preinstall callback didn't do anything because not all of the IPs were initialized when it was called. Move the postinstall setup into sequence in the driver. The uninstall callback disabled all interrupt source, but it got called too late in the driver sequence and caused problems with IPs who already freed the relevant data structures. Move the call into the right place in the driver sequence. Acked-by: Christian König <christian.koenig@amd.com> Acked-by: Harry Wentland <harry.wentland@amd.com> Tested-By: Mikita Lipski <mikita.lipski@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
04f618eb3b
commit
9950cda2a0
|
@ -1483,6 +1483,9 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev)
|
||||||
adev->ip_blocks[i].status.hw = false;
|
adev->ip_blocks[i].status.hw = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* disable all interrupts */
|
||||||
|
amdgpu_irq_disable_all(adev);
|
||||||
|
|
||||||
for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
|
for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
|
||||||
if (!adev->ip_blocks[i].status.sw)
|
if (!adev->ip_blocks[i].status.sw)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -856,9 +856,6 @@ static struct drm_driver kms_driver = {
|
||||||
.disable_vblank = amdgpu_disable_vblank_kms,
|
.disable_vblank = amdgpu_disable_vblank_kms,
|
||||||
.get_vblank_timestamp = drm_calc_vbltimestamp_from_scanoutpos,
|
.get_vblank_timestamp = drm_calc_vbltimestamp_from_scanoutpos,
|
||||||
.get_scanout_position = amdgpu_get_crtc_scanout_position,
|
.get_scanout_position = amdgpu_get_crtc_scanout_position,
|
||||||
.irq_preinstall = amdgpu_irq_preinstall,
|
|
||||||
.irq_postinstall = amdgpu_irq_postinstall,
|
|
||||||
.irq_uninstall = amdgpu_irq_uninstall,
|
|
||||||
.irq_handler = amdgpu_irq_handler,
|
.irq_handler = amdgpu_irq_handler,
|
||||||
.ioctls = amdgpu_ioctls_kms,
|
.ioctls = amdgpu_ioctls_kms,
|
||||||
.gem_free_object_unlocked = amdgpu_gem_object_free,
|
.gem_free_object_unlocked = amdgpu_gem_object_free,
|
||||||
|
|
|
@ -92,7 +92,7 @@ static void amdgpu_irq_reset_work_func(struct work_struct *work)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Disable *all* interrupts */
|
/* Disable *all* interrupts */
|
||||||
static void amdgpu_irq_disable_all(struct amdgpu_device *adev)
|
void amdgpu_irq_disable_all(struct amdgpu_device *adev)
|
||||||
{
|
{
|
||||||
unsigned long irqflags;
|
unsigned long irqflags;
|
||||||
unsigned i, j, k;
|
unsigned i, j, k;
|
||||||
|
@ -122,55 +122,6 @@ static void amdgpu_irq_disable_all(struct amdgpu_device *adev)
|
||||||
spin_unlock_irqrestore(&adev->irq.lock, irqflags);
|
spin_unlock_irqrestore(&adev->irq.lock, irqflags);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* amdgpu_irq_preinstall - drm irq preinstall callback
|
|
||||||
*
|
|
||||||
* @dev: drm dev pointer
|
|
||||||
*
|
|
||||||
* Gets the hw ready to enable irqs (all asics).
|
|
||||||
* This function disables all interrupt sources on the GPU.
|
|
||||||
*/
|
|
||||||
void amdgpu_irq_preinstall(struct drm_device *dev)
|
|
||||||
{
|
|
||||||
struct amdgpu_device *adev = dev->dev_private;
|
|
||||||
|
|
||||||
/* Disable *all* interrupts */
|
|
||||||
amdgpu_irq_disable_all(adev);
|
|
||||||
/* Clear bits */
|
|
||||||
amdgpu_ih_process(adev);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* amdgpu_irq_postinstall - drm irq preinstall callback
|
|
||||||
*
|
|
||||||
* @dev: drm dev pointer
|
|
||||||
*
|
|
||||||
* Handles stuff to be done after enabling irqs (all asics).
|
|
||||||
* Returns 0 on success.
|
|
||||||
*/
|
|
||||||
int amdgpu_irq_postinstall(struct drm_device *dev)
|
|
||||||
{
|
|
||||||
dev->max_vblank_count = 0x00ffffff;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* amdgpu_irq_uninstall - drm irq uninstall callback
|
|
||||||
*
|
|
||||||
* @dev: drm dev pointer
|
|
||||||
*
|
|
||||||
* This function disables all interrupt sources on the GPU (all asics).
|
|
||||||
*/
|
|
||||||
void amdgpu_irq_uninstall(struct drm_device *dev)
|
|
||||||
{
|
|
||||||
struct amdgpu_device *adev = dev->dev_private;
|
|
||||||
|
|
||||||
if (adev == NULL) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
amdgpu_irq_disable_all(adev);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* amdgpu_irq_handler - irq handler
|
* amdgpu_irq_handler - irq handler
|
||||||
*
|
*
|
||||||
|
@ -261,6 +212,7 @@ int amdgpu_irq_init(struct amdgpu_device *adev)
|
||||||
cancel_work_sync(&adev->reset_work);
|
cancel_work_sync(&adev->reset_work);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
adev->ddev->max_vblank_count = 0x00ffffff;
|
||||||
|
|
||||||
DRM_DEBUG("amdgpu: irq initialized.\n");
|
DRM_DEBUG("amdgpu: irq initialized.\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -78,9 +78,7 @@ struct amdgpu_irq {
|
||||||
uint32_t srbm_soft_reset;
|
uint32_t srbm_soft_reset;
|
||||||
};
|
};
|
||||||
|
|
||||||
void amdgpu_irq_preinstall(struct drm_device *dev);
|
void amdgpu_irq_disable_all(struct amdgpu_device *adev);
|
||||||
int amdgpu_irq_postinstall(struct drm_device *dev);
|
|
||||||
void amdgpu_irq_uninstall(struct drm_device *dev);
|
|
||||||
irqreturn_t amdgpu_irq_handler(int irq, void *arg);
|
irqreturn_t amdgpu_irq_handler(int irq, void *arg);
|
||||||
|
|
||||||
int amdgpu_irq_init(struct amdgpu_device *adev);
|
int amdgpu_irq_init(struct amdgpu_device *adev);
|
||||||
|
|
Loading…
Reference in New Issue