Skip to content

Commit a27e569

Browse files
lynxeye-devBen Skeggs
authored andcommitted
drm/nouveau: use MSI interrupts
MSIs were only problematic on some old, broken chipsets. But now that we already see systems where PCI legacy interrupts are somewhat flaky, it's really time to move to MSIs. v2 (Ben Skeggs): blacklist BR02 boards Signed-off-by: Lucas Stach <[email protected]> Signed-off-by: Ben Skeggs <[email protected]>
1 parent 4b31ebc commit a27e569

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

drivers/gpu/drm/nouveau/core/include/subdev/mc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ struct nouveau_mc_intr {
1212
struct nouveau_mc {
1313
struct nouveau_subdev base;
1414
const struct nouveau_mc_intr *intr_map;
15+
bool use_msi;
1516
};
1617

1718
static inline struct nouveau_mc *

drivers/gpu/drm/nouveau/core/os.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <linux/reboot.h>
2020
#include <linux/interrupt.h>
2121
#include <linux/log2.h>
22+
#include <linux/pm_runtime.h>
2223

2324
#include <asm/unaligned.h>
2425

drivers/gpu/drm/nouveau/core/subdev/mc/base.c

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*/
2424

2525
#include <subdev/mc.h>
26-
#include <linux/pm_runtime.h>
26+
#include <core/option.h>
2727

2828
static irqreturn_t
2929
nouveau_mc_intr(int irq, void *arg)
@@ -47,6 +47,9 @@ nouveau_mc_intr(int irq, void *arg)
4747
map++;
4848
}
4949

50+
if (pmc->use_msi)
51+
nv_wr08(pmc->base.base.parent, 0x00088068, 0xff);
52+
5053
if (intr) {
5154
nv_error(pmc, "unknown intr 0x%08x\n", stat);
5255
}
@@ -81,6 +84,8 @@ _nouveau_mc_dtor(struct nouveau_object *object)
8184
struct nouveau_device *device = nv_device(object);
8285
struct nouveau_mc *pmc = (void *)object;
8386
free_irq(device->pdev->irq, pmc);
87+
if (pmc->use_msi)
88+
pci_disable_msi(device->pdev);
8489
nouveau_subdev_destroy(&pmc->base);
8590
}
8691

@@ -102,6 +107,23 @@ nouveau_mc_create_(struct nouveau_object *parent, struct nouveau_object *engine,
102107

103108
pmc->intr_map = intr_map;
104109

110+
switch (device->pdev->device & 0x0ff0) {
111+
case 0x00f0: /* BR02? */
112+
case 0x02e0: /* BR02? */
113+
pmc->use_msi = false;
114+
break;
115+
default:
116+
pmc->use_msi = nouveau_boolopt(device->cfgopt, "NvMSI", true);
117+
if (pmc->use_msi) {
118+
pmc->use_msi = pci_enable_msi(device->pdev) == 0;
119+
if (pmc->use_msi) {
120+
nv_info(pmc, "MSI interrupts enabled\n");
121+
nv_wr08(device, 0x00088068, 0xff);
122+
}
123+
}
124+
break;
125+
}
126+
105127
ret = request_irq(device->pdev->irq, nouveau_mc_intr,
106128
IRQF_SHARED, "nouveau", pmc);
107129
if (ret < 0)

0 commit comments

Comments
 (0)