summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2013-10-11 14:41:27 +1000
committerBen Skeggs <bskeggs@redhat.com>2013-11-08 15:39:00 +1000
commit6dcee40a9bc5fefea324581bea3a39be153c2572 (patch)
tree1d8ea6bb169aea430c5c7589e310faf8fded820d /drivers/gpu/drm/nouveau
parentcfc2f2637ab7c8db29ec408cc1504f572cff6694 (diff)
downloadtalos-op-linux-6dcee40a9bc5fefea324581bea3a39be153c2572.tar.gz
talos-op-linux-6dcee40a9bc5fefea324581bea3a39be153c2572.zip
drm/nouveau/mc: have single entry and exit points to the interrupt handler
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/mc/base.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/drivers/gpu/drm/nouveau/core/subdev/mc/base.c b/drivers/gpu/drm/nouveau/core/subdev/mc/base.c
index be5bdeef50e6..f26fcbd2237d 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/mc/base.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/mc/base.c
@@ -31,29 +31,30 @@ nouveau_mc_intr(int irq, void *arg)
struct nouveau_mc *pmc = arg;
const struct nouveau_mc_intr *map = pmc->intr_map;
struct nouveau_subdev *unit;
- u32 stat, intr;
+ u32 intr, stat;
- intr = stat = nv_rd32(pmc, 0x000100);
- if (intr == 0xffffffff)
- return IRQ_NONE;
- while (stat && map->stat) {
- if (stat & map->stat) {
- unit = nouveau_subdev(pmc, map->unit);
- if (unit && unit->intr)
- unit->intr(unit);
- intr &= ~map->stat;
- }
- map++;
- }
+ intr = nv_rd32(pmc, 0x000100);
+ if (intr == 0xffffffff) /* likely fallen off the bus */
+ intr = 0x00000000;
- if (pmc->use_msi)
- nv_wr08(pmc, 0x088068, 0xff);
+ if ((stat = intr) != 0) {
+ while (map->stat) {
+ if (intr & map->stat) {
+ unit = nouveau_subdev(pmc, map->unit);
+ if (unit && unit->intr)
+ unit->intr(unit);
+ stat &= ~map->stat;
+ }
+ map++;
+ }
- if (intr) {
- nv_error(pmc, "unknown intr 0x%08x\n", stat);
+ if (pmc->use_msi)
+ nv_wr08(pmc, 0x088068, 0xff);
+ if (stat)
+ nv_error(pmc, "unknown intr 0x%08x\n", stat);
}
- return stat ? IRQ_HANDLED : IRQ_NONE;
+ return intr ? IRQ_HANDLED : IRQ_NONE;
}
int
OpenPOWER on IntegriCloud