summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorjmcneill <jmcneill@NetBSD.org>2019-10-14 00:15:13 +0000
committerjmcneill <jmcneill@NetBSD.org>2019-10-14 00:15:13 +0000
commitc2f26d5004c9f372658fa232fe2c4eaa43bc4756 (patch)
treef061ff49412af3159f568849e698465892a69753 /sys/dev
parent5ed22c423a16d5a8d4881ee826551c7493c9064b (diff)
The MCFG base address field is the physical address of the base of mmio
space relative to bus 0, not the start bus number specified in the table entry.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/acpi/acpi_mcfg.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/acpi/acpi_mcfg.c b/sys/dev/acpi/acpi_mcfg.c
index e139fbb876e..855105bf0ef 100644
--- a/sys/dev/acpi/acpi_mcfg.c
+++ b/sys/dev/acpi/acpi_mcfg.c
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_mcfg.c,v 1.16 2018/12/20 19:16:17 jmcneill Exp $ */
+/* $NetBSD: acpi_mcfg.c,v 1.17 2019/10/14 00:15:13 jmcneill Exp $ */
/*-
* Copyright (C) 2015 NONAKA Kimihiro <nonaka@NetBSD.org>
@@ -28,7 +28,7 @@
#include "opt_pci.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_mcfg.c,v 1.16 2018/12/20 19:16:17 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_mcfg.c,v 1.17 2019/10/14 00:15:13 jmcneill Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -575,7 +575,7 @@ acpimcfg_map_bus(device_t self, pci_chipset_tag_t pc, int bus)
return 0;
mb = &seg->ms_bus[boff];
- baddr = seg->ms_address + (boff * ACPIMCFG_SIZE_PER_BUS);
+ baddr = seg->ms_address + (bus * ACPIMCFG_SIZE_PER_BUS);
/* Map extended configration space of all dev/func. */
error = bus_space_map(seg->ms_bst, baddr, ACPIMCFG_SIZE_PER_BUS, 0,
@@ -832,7 +832,7 @@ acpimcfg_configure_bus(device_t self, pci_chipset_tag_t pc, ACPI_HANDLE handle,
for (b = seg->ms_bus_start; b <= seg->ms_bus_end; b++) {
boff = b - seg->ms_bus_start;
mb = &seg->ms_bus[boff];
- baddr = seg->ms_address + (boff * ACPIMCFG_SIZE_PER_BUS);
+ baddr = seg->ms_address + (b * ACPIMCFG_SIZE_PER_BUS);
/* Map extended configration space of all dev/func. */
error = bus_space_map(seg->ms_bst, baddr, ACPIMCFG_SIZE_PER_BUS, 0,