From 0c0888473decef2e06e8ea5d5cb2306501a2f822 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Tue, 5 Nov 2013 09:09:30 +1000 Subject: [PATCH] drm/nouveau/mc: fix (incorrect) reporting of unknown pending intr bits Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/core/subdev/mc/base.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/nouveau/core/subdev/mc/base.c b/drivers/gpu/drm/nouveau/core/subdev/mc/base.c index fb3837c027da..bc19aa497d5b 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/mc/base.c +++ b/drivers/gpu/drm/nouveau/core/subdev/mc/base.c @@ -25,6 +25,15 @@ #include #include +static inline u32 +nouveau_mc_intr_mask(struct nouveau_mc *pmc) +{ + u32 intr = nv_rd32(pmc, 0x000100); + if (intr == 0xffffffff) /* likely fallen off the bus */ + intr = 0x00000000; + return intr; +} + static irqreturn_t nouveau_mc_intr(int irq, void *arg) { @@ -37,16 +46,12 @@ nouveau_mc_intr(int irq, void *arg) nv_wr32(pmc, 0x000140, 0x00000000); nv_rd32(pmc, 0x000140); - - intr = nv_rd32(pmc, 0x000100); - if (intr == 0xffffffff) /* likely fallen off the bus */ - intr = 0x00000000; - + intr = nouveau_mc_intr_mask(pmc); if (pmc->use_msi) oclass->msi_rearm(pmc); if (intr) { - u32 stat = nv_rd32(pmc, 0x000100); + u32 stat = intr = nouveau_mc_intr_mask(pmc); while (map->stat) { if (intr & map->stat) { unit = nouveau_subdev(pmc, map->unit); -- 2.11.0