Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/nvidia Fix previous; pci_intr_setattr takes a p...
details: https://anonhg.NetBSD.org/src/rev/ebf948fc0839
branches: trunk
changeset: 352993:ebf948fc0839
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Sun Apr 16 22:38:04 2017 +0000
description:
Fix previous; pci_intr_setattr takes a pci_intr_handle_t not the driver's
opaque handle.
diffstat:
sys/arch/arm/nvidia/tegra_pcie.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diffs (53 lines):
diff -r 85fde1fcc0f7 -r ebf948fc0839 sys/arch/arm/nvidia/tegra_pcie.c
--- a/sys/arch/arm/nvidia/tegra_pcie.c Sun Apr 16 21:39:49 2017 +0000
+++ b/sys/arch/arm/nvidia/tegra_pcie.c Sun Apr 16 22:38:04 2017 +0000
@@ -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 <jmcneill%invisible.ca@localhost>
@@ -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 @@
#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 @@
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 @@
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);
Home |
Main Index |
Thread Index |
Old Index