2009-09-09 20:29:29

by Jerome Glisse

[permalink] [raw]
Subject: [PATCH] drm/radeon/kms: Don't try to process irq when we are unloading

If module is being unloaded we should not try to handle irq especialy
we should not call into drm helper or we could hard hang the computer
free_irq will call the irq handler to make sure we behave properly.

Signed-off-by: Jerome Glisse <[email protected]>
---
drivers/gpu/drm/radeon/r100.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index 5708c07..36d0ba2 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -319,6 +319,9 @@ int r100_irq_process(struct radeon_device *rdev)
if (!status) {
return IRQ_NONE;
}
+ if (rdev->shutdown) {
+ return IRQ_NONE;
+ }
while (status) {
/* SW interrupt */
if (status & RADEON_SW_INT_TEST) {
--
1.6.4.1


2009-09-10 00:10:05

by Dave Airlie

[permalink] [raw]
Subject: Re: [PATCH] drm/radeon/kms: Don't try to process irq when we are unloading

On Wed, 9 Sep 2009, Jerome Glisse wrote:

> If module is being unloaded we should not try to handle irq especialy
> we should not call into drm helper or we could hard hang the computer
> free_irq will call the irq handler to make sure we behave properly.

Should you not just ack all irqs here before returning, else we'll
just get called again.

Dave.

>
> Signed-off-by: Jerome Glisse <[email protected]>
> ---
> drivers/gpu/drm/radeon/r100.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
> index 5708c07..36d0ba2 100644
> --- a/drivers/gpu/drm/radeon/r100.c
> +++ b/drivers/gpu/drm/radeon/r100.c
> @@ -319,6 +319,9 @@ int r100_irq_process(struct radeon_device *rdev)
> if (!status) {
> return IRQ_NONE;
> }
> + if (rdev->shutdown) {
> + return IRQ_NONE;
> + }
> while (status) {
> /* SW interrupt */
> if (status & RADEON_SW_INT_TEST) {
>