From c18fa7a94f26253eefbf2fff12edebb28d5c302e Mon Sep 17 00:00:00 2001 From: "Thomas E. Spanjaard" Date: Sun, 9 Dec 2007 22:32:16 +0000 Subject: [PATCH] Fix a bug where all 'generic' ATA controllers were handled as if they had a DMA engine. DragonFly-bug: http://bugs.dragonflybsd.org/issue879 --- sys/dev/disk/nata/ata-pci.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/disk/nata/ata-pci.c b/sys/dev/disk/nata/ata-pci.c index 84c58c23fa..09f9d04a83 100644 --- a/sys/dev/disk/nata/ata-pci.c +++ b/sys/dev/disk/nata/ata-pci.c @@ -24,7 +24,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ata/ata-pci.c,v 1.121 2007/02/23 12:18:33 piso Exp $ - * $DragonFly: src/sys/dev/disk/nata/ata-pci.c,v 1.7 2007/12/02 05:03:17 sephe Exp $ + * $DragonFly: src/sys/dev/disk/nata/ata-pci.c,v 1.8 2007/12/09 22:32:16 tgen Exp $ */ #include "opt_ata.h" @@ -217,7 +217,6 @@ ata_pci_attach(device_t dev) else ctlr->channels = 1; ctlr->allocate = ata_pci_allocate; - ctlr->dmainit = ata_pci_dmainit; ctlr->dev = dev; /* if needed try to enable busmastering */ @@ -233,6 +232,8 @@ ata_pci_attach(device_t dev) ctlr->r_rid1 = ATA_BMADDR_RID; ctlr->r_res1 = bus_alloc_resource_any(dev, ctlr->r_type1, &ctlr->r_rid1, RF_ACTIVE); + /* Only set a dma init function if the device actually supports it. */ + ctlr->dmainit = ata_pci_dmainit; } if (ctlr->chipinit(dev)) -- 2.41.0