From owner-svn-src-all@freebsd.org Thu Nov 14 04:35:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46C0C1C5BBF; Thu, 14 Nov 2019 04:35:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47D7tr1B3jz49bS; Thu, 14 Nov 2019 04:35:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07EC022FE2; Thu, 14 Nov 2019 04:35:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAE4YxLZ031984; Thu, 14 Nov 2019 04:34:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAE4YxNh031979; Thu, 14 Nov 2019 04:34:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201911140434.xAE4YxNh031979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 14 Nov 2019 04:34:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354702 - in head/sys/dev/ntb: . ntb_hw X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys/dev/ntb: . ntb_hw X-SVN-Commit-Revision: 354702 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Nov 2019 04:35:00 -0000 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),