mirror of https://gitee.com/openkylin/linux.git
drm/nouveau/mc: have single entry and exit points to the interrupt handler
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
parent
cfc2f2637a
commit
6dcee40a9b
|
@ -31,29 +31,30 @@ nouveau_mc_intr(int irq, void *arg)
|
||||||
struct nouveau_mc *pmc = arg;
|
struct nouveau_mc *pmc = arg;
|
||||||
const struct nouveau_mc_intr *map = pmc->intr_map;
|
const struct nouveau_mc_intr *map = pmc->intr_map;
|
||||||
struct nouveau_subdev *unit;
|
struct nouveau_subdev *unit;
|
||||||
u32 stat, intr;
|
u32 intr, stat;
|
||||||
|
|
||||||
intr = stat = nv_rd32(pmc, 0x000100);
|
intr = nv_rd32(pmc, 0x000100);
|
||||||
if (intr == 0xffffffff)
|
if (intr == 0xffffffff) /* likely fallen off the bus */
|
||||||
return IRQ_NONE;
|
intr = 0x00000000;
|
||||||
while (stat && map->stat) {
|
|
||||||
if (stat & map->stat) {
|
if ((stat = intr) != 0) {
|
||||||
unit = nouveau_subdev(pmc, map->unit);
|
while (map->stat) {
|
||||||
if (unit && unit->intr)
|
if (intr & map->stat) {
|
||||||
unit->intr(unit);
|
unit = nouveau_subdev(pmc, map->unit);
|
||||||
intr &= ~map->stat;
|
if (unit && unit->intr)
|
||||||
|
unit->intr(unit);
|
||||||
|
stat &= ~map->stat;
|
||||||
|
}
|
||||||
|
map++;
|
||||||
}
|
}
|
||||||
map++;
|
|
||||||
|
if (pmc->use_msi)
|
||||||
|
nv_wr08(pmc, 0x088068, 0xff);
|
||||||
|
if (stat)
|
||||||
|
nv_error(pmc, "unknown intr 0x%08x\n", stat);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pmc->use_msi)
|
return intr ? IRQ_HANDLED : IRQ_NONE;
|
||||||
nv_wr08(pmc, 0x088068, 0xff);
|
|
||||||
|
|
||||||
if (intr) {
|
|
||||||
nv_error(pmc, "unknown intr 0x%08x\n", stat);
|
|
||||||
}
|
|
||||||
|
|
||||||
return stat ? IRQ_HANDLED : IRQ_NONE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
Loading…
Reference in New Issue