Module Name: src
Committed By: jmcneill
Date: Sun Apr 16 22:38:04 UTC 2017
Modified Files:
src/sys/arch/arm/nvidia: tegra_pcie.c
Log Message:
Fix previous; pci_intr_setattr takes a pci_intr_handle_t not the driver's
opaque handle.
To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/nvidia/tegra_pcie.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/arm/nvidia/tegra_pcie.c
diff -u src/sys/arch/arm/nvidia/tegra_pcie.c:1.16 src/sys/arch/arm/nvidia/tegra_pcie.c:1.17
--- src/sys/arch/arm/nvidia/tegra_pcie.c:1.16 Sun Apr 16 18:05:35 2017
+++ src/sys/arch/arm/nvidia/tegra_pcie.c Sun Apr 16 22:38:04 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_pcie.c,v 1.16 2017/04/16 18:05:35 jmcneill Exp $ */
+/* $NetBSD: tegra_pcie.c,v 1.17 2017/04/16 22:38:04 jmcneill Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <[email protected]>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tegra_pcie.c,v 1.16 2017/04/16 18:05:35 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_pcie.c,v 1.17 2017/04/16 22:38:04 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -52,6 +52,9 @@ __KERNEL_RCSID(0, "$NetBSD: tegra_pcie.c
#include <dev/fdt/fdtvar.h>
+/* Interrupt handle flags */
+#define IH_MPSAFE 0x80000000
+
static int tegra_pcie_match(device_t, cfdata_t, void *);
static void tegra_pcie_attach(device_t, device_t, void *);
@@ -591,11 +594,12 @@ tegra_pcie_intr_evcnt(void *v, pci_intr_
static int
tegra_pcie_intr_setattr(void *v, pci_intr_handle_t *ih, int attr, uint64_t data)
{
- struct tegra_pcie_ih *pcie_ih = (struct tegra_pcie_ih *)*ih;
-
switch (attr) {
case PCI_INTR_MPSAFE:
- pcie_ih->ih_mpsafe = data;
+ if (data)
+ *ih |= IH_MPSAFE;
+ else
+ *ih &= ~IH_MPSAFE;
return 0;
default:
return ENODEV;
@@ -616,7 +620,7 @@ tegra_pcie_intr_establish(void *v, pci_i
pcie_ih->ih_callback = callback;
pcie_ih->ih_arg = arg;
pcie_ih->ih_ipl = ipl;
- pcie_ih->ih_mpsafe = 0;
+ pcie_ih->ih_mpsafe = (ih & IH_MPSAFE) != 0;
mutex_enter(&sc->sc_lock);
TAILQ_INSERT_TAIL(&sc->sc_intrs, pcie_ih, ih_entry);