diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2013-11-05 09:09:30 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2013-11-08 15:39:57 +1000 |
commit | 0c0888473decef2e06e8ea5d5cb2306501a2f822 (patch) | |
tree | c72651e4c10a1d73ce1e656b5def9267b5ed434c /drivers | |
parent | 8df1d0c07f18bd84ea7d8c7bc2cff45ba2b09680 (diff) |
drm/nouveau/mc: fix (incorrect) reporting of unknown pending intr bits
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/mc/base.c | 17 |
1 files 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 fb3837c027d..bc19aa497d5 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 <subdev/mc.h> #include <core/option.h> +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); |