From owner-svn-src-stable-9@FreeBSD.ORG Sun Apr 21 12:17:00 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6485DF1; Sun, 21 Apr 2013 12:17:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3CCF811AD; Sun, 21 Apr 2013 12:17:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3LCGxYr082440; Sun, 21 Apr 2013 12:16:59 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3LCGxYo082438; Sun, 21 Apr 2013 12:16:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304211216.r3LCGxYo082438@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 21 Apr 2013 12:16:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249723 - in stable/9/sys/dev: ata pci X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2013 12:17:00 -0000 Author: kib Date: Sun Apr 21 12:16:59 2013 New Revision: 249723 URL: http://svnweb.freebsd.org/changeset/base/249723 Log: MFC r249476: Esnure that PCI bus BUS_GET_DMA_TAG() method sees the actual PCI device which makes the request for dma tag, instead of some descendant of the PCI device, by creating a pass-through trampoline for vga_pci and ata_pci buses. Modified: stable/9/sys/dev/ata/ata-pci.c stable/9/sys/dev/pci/vga_pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ata/ata-pci.c ============================================================================== --- stable/9/sys/dev/ata/ata-pci.c Sun Apr 21 11:12:44 2013 (r249722) +++ stable/9/sys/dev/ata/ata-pci.c Sun Apr 21 12:16:59 2013 (r249723) @@ -572,6 +572,13 @@ ata_pci_child_location_str(device_t dev, return (0); } +static bus_dma_tag_t +ata_pci_get_dma_tag(device_t bus, device_t child) +{ + + return (bus_get_dma_tag(bus)); +} + static device_method_t ata_pci_methods[] = { /* device interface */ DEVMETHOD(device_probe, ata_pci_probe), @@ -594,6 +601,7 @@ static device_method_t ata_pci_methods[] DEVMETHOD(pci_write_config, ata_pci_write_config), DEVMETHOD(bus_print_child, ata_pci_print_child), DEVMETHOD(bus_child_location_str, ata_pci_child_location_str), + DEVMETHOD(bus_get_dma_tag, ata_pci_get_dma_tag), DEVMETHOD_END }; Modified: stable/9/sys/dev/pci/vga_pci.c ============================================================================== --- stable/9/sys/dev/pci/vga_pci.c Sun Apr 21 11:12:44 2013 (r249722) +++ stable/9/sys/dev/pci/vga_pci.c Sun Apr 21 12:16:59 2013 (r249723) @@ -393,6 +393,13 @@ vga_pci_msix_count(device_t dev, device_ return (pci_msix_count(dev)); } +static bus_dma_tag_t +vga_pci_get_dma_tag(device_t bus, device_t child) +{ + + return (bus_get_dma_tag(bus)); +} + static device_method_t vga_pci_methods[] = { /* Device interface */ DEVMETHOD(device_probe, vga_pci_probe), @@ -410,6 +417,7 @@ static device_method_t vga_pci_methods[] DEVMETHOD(bus_release_resource, vga_pci_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_get_dma_tag, vga_pci_get_dma_tag), /* PCI interface */ DEVMETHOD(pci_read_config, vga_pci_read_config),