diff options
author | Jerome Glisse <jglisse@redhat.com> | 2010-01-07 09:39:14 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-01-07 22:12:20 -0500 |
commit | 003e69f9862bcda89a75c27750efdbc17ac02945 (patch) | |
tree | 6a172f0fae732500196f7a5103bdf94044573856 | |
parent | e77cef9c2d87db835ad9d70cde4a9b00b0ca2262 (diff) |
drm/radeon/kms: Don't try to enable IRQ if we have no handler installed
If for any reason we haven't installed handler we shouldn't try to
enable IRQ/MSI on the hw so we don't get unhandled IRQ/MSI which
makes the kernel sad.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | drivers/gpu/drm/radeon/r100.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r600.c | 7 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_irq_kms.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/rs600.c | 8 |
4 files changed, 28 insertions, 5 deletions
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index d2b789e67c39..8760d66e058a 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c | |||
@@ -131,7 +131,8 @@ void r100_hpd_init(struct radeon_device *rdev) | |||
131 | break; | 131 | break; |
132 | } | 132 | } |
133 | } | 133 | } |
134 | r100_irq_set(rdev); | 134 | if (rdev->irq.installed) |
135 | r100_irq_set(rdev); | ||
135 | } | 136 | } |
136 | 137 | ||
137 | void r100_hpd_fini(struct radeon_device *rdev) | 138 | void r100_hpd_fini(struct radeon_device *rdev) |
@@ -243,6 +244,11 @@ int r100_irq_set(struct radeon_device *rdev) | |||
243 | { | 244 | { |
244 | uint32_t tmp = 0; | 245 | uint32_t tmp = 0; |
245 | 246 | ||
247 | if (!rdev->irq.installed) { | ||
248 | WARN(1, "Can't enable IRQ/MSI because no handler is installed.\n"); | ||
249 | WREG32(R_000040_GEN_INT_CNTL, 0); | ||
250 | return -EINVAL; | ||
251 | } | ||
246 | if (rdev->irq.sw_int) { | 252 | if (rdev->irq.sw_int) { |
247 | tmp |= RADEON_SW_INT_ENABLE; | 253 | tmp |= RADEON_SW_INT_ENABLE; |
248 | } | 254 | } |
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index 0c065f425c84..1f4f83d6fbe6 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -285,7 +285,8 @@ void r600_hpd_init(struct radeon_device *rdev) | |||
285 | } | 285 | } |
286 | } | 286 | } |
287 | } | 287 | } |
288 | r600_irq_set(rdev); | 288 | if (rdev->irq.installed) |
289 | r600_irq_set(rdev); | ||
289 | } | 290 | } |
290 | 291 | ||
291 | void r600_hpd_fini(struct radeon_device *rdev) | 292 | void r600_hpd_fini(struct radeon_device *rdev) |
@@ -2461,6 +2462,10 @@ int r600_irq_set(struct radeon_device *rdev) | |||
2461 | u32 mode_int = 0; | 2462 | u32 mode_int = 0; |
2462 | u32 hpd1, hpd2, hpd3, hpd4 = 0, hpd5 = 0, hpd6 = 0; | 2463 | u32 hpd1, hpd2, hpd3, hpd4 = 0, hpd5 = 0, hpd6 = 0; |
2463 | 2464 | ||
2465 | if (!rdev->irq.installed) { | ||
2466 | WARN(1, "Can't enable IRQ/MSI because no handler is installed.\n"); | ||
2467 | return -EINVAL; | ||
2468 | } | ||
2464 | /* don't enable anything if the ih is disabled */ | 2469 | /* don't enable anything if the ih is disabled */ |
2465 | if (!rdev->ih.enabled) | 2470 | if (!rdev->ih.enabled) |
2466 | return 0; | 2471 | return 0; |
diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c b/drivers/gpu/drm/radeon/radeon_irq_kms.c index 9223296fe37b..3cfd60fd0083 100644 --- a/drivers/gpu/drm/radeon/radeon_irq_kms.c +++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c | |||
@@ -97,6 +97,7 @@ void radeon_driver_irq_uninstall_kms(struct drm_device *dev) | |||
97 | rdev->irq.sw_int = false; | 97 | rdev->irq.sw_int = false; |
98 | for (i = 0; i < 2; i++) { | 98 | for (i = 0; i < 2; i++) { |
99 | rdev->irq.crtc_vblank_int[i] = false; | 99 | rdev->irq.crtc_vblank_int[i] = false; |
100 | rdev->irq.hpd[i] = false; | ||
100 | } | 101 | } |
101 | radeon_irq_set(rdev); | 102 | radeon_irq_set(rdev); |
102 | } | 103 | } |
@@ -128,17 +129,22 @@ int radeon_irq_kms_init(struct radeon_device *rdev) | |||
128 | DRM_INFO("radeon: using MSI.\n"); | 129 | DRM_INFO("radeon: using MSI.\n"); |
129 | } | 130 | } |
130 | } | 131 | } |
131 | drm_irq_install(rdev->ddev); | ||
132 | rdev->irq.installed = true; | 132 | rdev->irq.installed = true; |
133 | r = drm_irq_install(rdev->ddev); | ||
134 | if (r) { | ||
135 | rdev->irq.installed = false; | ||
136 | return r; | ||
137 | } | ||
133 | DRM_INFO("radeon: irq initialized.\n"); | 138 | DRM_INFO("radeon: irq initialized.\n"); |
134 | return 0; | 139 | return 0; |
135 | } | 140 | } |
136 | 141 | ||
137 | void radeon_irq_kms_fini(struct radeon_device *rdev) | 142 | void radeon_irq_kms_fini(struct radeon_device *rdev) |
138 | { | 143 | { |
144 | drm_vblank_cleanup(rdev->ddev); | ||
139 | if (rdev->irq.installed) { | 145 | if (rdev->irq.installed) { |
140 | rdev->irq.installed = false; | ||
141 | drm_irq_uninstall(rdev->ddev); | 146 | drm_irq_uninstall(rdev->ddev); |
147 | rdev->irq.installed = false; | ||
142 | if (rdev->msi_enabled) | 148 | if (rdev->msi_enabled) |
143 | pci_disable_msi(rdev->pdev); | 149 | pci_disable_msi(rdev->pdev); |
144 | } | 150 | } |
diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c index a0378c57e4ec..d5255751e7b3 100644 --- a/drivers/gpu/drm/radeon/rs600.c +++ b/drivers/gpu/drm/radeon/rs600.c | |||
@@ -135,7 +135,8 @@ void rs600_hpd_init(struct radeon_device *rdev) | |||
135 | break; | 135 | break; |
136 | } | 136 | } |
137 | } | 137 | } |
138 | rs600_irq_set(rdev); | 138 | if (rdev->irq.installed) |
139 | rs600_irq_set(rdev); | ||
139 | } | 140 | } |
140 | 141 | ||
141 | void rs600_hpd_fini(struct radeon_device *rdev) | 142 | void rs600_hpd_fini(struct radeon_device *rdev) |
@@ -316,6 +317,11 @@ int rs600_irq_set(struct radeon_device *rdev) | |||
316 | u32 hpd2 = RREG32(R_007D18_DC_HOT_PLUG_DETECT2_INT_CONTROL) & | 317 | u32 hpd2 = RREG32(R_007D18_DC_HOT_PLUG_DETECT2_INT_CONTROL) & |
317 | ~S_007D18_DC_HOT_PLUG_DETECT2_INT_EN(1); | 318 | ~S_007D18_DC_HOT_PLUG_DETECT2_INT_EN(1); |
318 | 319 | ||
320 | if (!rdev->irq.installed) { | ||
321 | WARN(1, "Can't enable IRQ/MSI because no handler is installed.\n"); | ||
322 | WREG32(R_000040_GEN_INT_CNTL, 0); | ||
323 | return -EINVAL; | ||
324 | } | ||
319 | if (rdev->irq.sw_int) { | 325 | if (rdev->irq.sw_int) { |
320 | tmp |= S_000040_SW_INT_EN(1); | 326 | tmp |= S_000040_SW_INT_EN(1); |
321 | } | 327 | } |