svn commit: r354702 - in head/sys/dev/ntb: . ntb_hw

Alexander Motin mav at FreeBSD.org
Thu Nov 14 04:35:00 UTC 2019


Author: mav
Date: Thu Nov 14 04:34:58 2019
New Revision: 354702
URL: https://svnweb.freebsd.org/changeset/base/354702

Log:
  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

Modified:
  head/sys/dev/ntb/ntb.c
  head/sys/dev/ntb/ntb.h
  head/sys/dev/ntb/ntb_hw/ntb_hw_amd.c
  head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c
  head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c

Modified: head/sys/dev/ntb/ntb.c
==============================================================================
--- head/sys/dev/ntb/ntb.c	Thu Nov 14 04:34:17 2019	(r354701)
+++ head/sys/dev/ntb/ntb.c	Thu Nov 14 04:34:58 2019	(r354702)
@@ -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)
 {

Modified: head/sys/dev/ntb/ntb.h
==============================================================================
--- head/sys/dev/ntb/ntb.h	Thu Nov 14 04:34:17 2019	(r354701)
+++ head/sys/dev/ntb/ntb.h	Thu Nov 14 04:34:58 2019	(r354702)
@@ -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

Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_amd.c
==============================================================================
--- head/sys/dev/ntb/ntb_hw/ntb_hw_amd.c	Thu Nov 14 04:34:17 2019	(r354701)
+++ head/sys/dev/ntb/ntb_hw/ntb_hw_amd.c	Thu Nov 14 04:34:58 2019	(r354702)
@@ -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),

Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c
==============================================================================
--- head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c	Thu Nov 14 04:34:17 2019	(r354701)
+++ head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c	Thu Nov 14 04:34:58 2019	(r354702)
@@ -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),

Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c
==============================================================================
--- head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c	Thu Nov 14 04:34:17 2019	(r354701)
+++ head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c	Thu Nov 14 04:34:58 2019	(r354702)
@@ -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),


More information about the svn-src-head mailing list