aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ntb
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2019-11-14 04:34:58 +0000
committerAlexander Motin <mav@FreeBSD.org>2019-11-14 04:34:58 +0000
commit7f215e071e924e6dae7fdab1d2f131c730c4e7b2 (patch)
tree14b141b75f39e3cb03497d72c9e23bc772eccbe9 /sys/dev/ntb
parent6d515b0cc7415205f67edb622dffc8ec9f8c65b7 (diff)
Make ntb(4) send bus_get_dma_tag() requests to parent buses passing real
bus' child pointers instead of grandchilds. DMAR does not like requests from devices not parented directly by PCI. MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=354702
Diffstat (limited to 'sys/dev/ntb')
-rw-r--r--sys/dev/ntb/ntb.c7
-rw-r--r--sys/dev/ntb/ntb.h1
-rw-r--r--sys/dev/ntb/ntb_hw/ntb_hw_amd.c1
-rw-r--r--sys/dev/ntb/ntb_hw/ntb_hw_intel.c1
-rw-r--r--sys/dev/ntb/ntb_hw/ntb_hw_plx.c1
5 files changed, 11 insertions, 0 deletions
diff --git a/sys/dev/ntb/ntb.c b/sys/dev/ntb/ntb.c
index 3f5d9bbb2db0..ca71e99de190 100644
--- a/sys/dev/ntb/ntb.c
+++ b/sys/dev/ntb/ntb.c
@@ -205,6 +205,13 @@ ntb_print_child(device_t dev, device_t child)
return (retval);
}
+bus_dma_tag_t
+ntb_get_dma_tag(device_t bus, device_t child)
+{
+
+ return (bus_get_dma_tag(bus));
+}
+
void
ntb_link_event(device_t dev)
{
diff --git a/sys/dev/ntb/ntb.h b/sys/dev/ntb/ntb.h
index 3ca76c994d22..3c31d48276b6 100644
--- a/sys/dev/ntb/ntb.h
+++ b/sys/dev/ntb/ntb.h
@@ -39,6 +39,7 @@ int ntb_unregister_device(device_t ntb);
int ntb_child_location_str(device_t dev, device_t child, char *buf,
size_t buflen);
int ntb_print_child(device_t dev, device_t child);
+bus_dma_tag_t ntb_get_dma_tag(device_t bus, device_t child);
/*
* ntb_link_event() - notify driver context of a change in link status
diff --git a/sys/dev/ntb/ntb_hw/ntb_hw_amd.c b/sys/dev/ntb/ntb_hw/ntb_hw_amd.c
index e64d119e6be2..43f135576a3c 100644
--- a/sys/dev/ntb/ntb_hw/ntb_hw_amd.c
+++ b/sys/dev/ntb/ntb_hw/ntb_hw_amd.c
@@ -1266,6 +1266,7 @@ static device_method_t ntb_amd_methods[] = {
/* Bus interface */
DEVMETHOD(bus_child_location_str, ntb_child_location_str),
DEVMETHOD(bus_print_child, ntb_print_child),
+ DEVMETHOD(bus_get_dma_tag, ntb_get_dma_tag),
/* NTB interface */
DEVMETHOD(ntb_port_number, amd_ntb_port_number),
diff --git a/sys/dev/ntb/ntb_hw/ntb_hw_intel.c b/sys/dev/ntb/ntb_hw/ntb_hw_intel.c
index 26207938fda1..a0e95c861a25 100644
--- a/sys/dev/ntb/ntb_hw/ntb_hw_intel.c
+++ b/sys/dev/ntb/ntb_hw/ntb_hw_intel.c
@@ -3124,6 +3124,7 @@ static device_method_t ntb_intel_methods[] = {
/* Bus interface */
DEVMETHOD(bus_child_location_str, ntb_child_location_str),
DEVMETHOD(bus_print_child, ntb_print_child),
+ DEVMETHOD(bus_get_dma_tag, ntb_get_dma_tag),
/* NTB interface */
DEVMETHOD(ntb_port_number, intel_ntb_port_number),
DEVMETHOD(ntb_peer_port_count, intel_ntb_peer_port_count),
diff --git a/sys/dev/ntb/ntb_hw/ntb_hw_plx.c b/sys/dev/ntb/ntb_hw/ntb_hw_plx.c
index a1459da6ce22..5872d0d5e656 100644
--- a/sys/dev/ntb/ntb_hw/ntb_hw_plx.c
+++ b/sys/dev/ntb/ntb_hw/ntb_hw_plx.c
@@ -1046,6 +1046,7 @@ static device_method_t ntb_plx_methods[] = {
/* Bus interface */
DEVMETHOD(bus_child_location_str, ntb_child_location_str),
DEVMETHOD(bus_print_child, ntb_print_child),
+ DEVMETHOD(bus_get_dma_tag, ntb_get_dma_tag),
/* NTB interface */
DEVMETHOD(ntb_port_number, ntb_plx_port_number),
DEVMETHOD(ntb_peer_port_count, ntb_plx_peer_port_count),