Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/acpi Choose between dmat and dmat64, instead of rely...



details:   https://anonhg.NetBSD.org/src/rev/6c6a68c37317
branches:  trunk
changeset: 848225:6c6a68c37317
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Tue Jan 21 11:29:17 2020 +0000

description:
Choose between dmat and dmat64, instead of relying on subregion of the 32-bit tag

diffstat:

 sys/dev/acpi/xhci_acpi.c |  15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diffs (38 lines):

diff -r 10919a05c3a4 -r 6c6a68c37317 sys/dev/acpi/xhci_acpi.c
--- a/sys/dev/acpi/xhci_acpi.c  Tue Jan 21 11:24:47 2020 +0000
+++ b/sys/dev/acpi/xhci_acpi.c  Tue Jan 21 11:29:17 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xhci_acpi.c,v 1.5 2019/06/22 19:35:40 jmcneill Exp $ */
+/* $NetBSD: xhci_acpi.c,v 1.6 2020/01/21 11:29:17 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xhci_acpi.c,v 1.5 2019/06/22 19:35:40 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci_acpi.c,v 1.6 2020/01/21 11:29:17 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -130,16 +130,11 @@
        hccparams = bus_space_read_4(sc->sc_iot, sc->sc_ioh, XHCI_HCCPARAMS);
        if (XHCI_HCC_AC64(hccparams)) {
                aprint_verbose_dev(self, "using 64-bit DMA\n");
-               sc->sc_bus.ub_dmatag = aa->aa_dmat;
+               sc->sc_bus.ub_dmatag = BUS_DMA_TAG_VALID(aa->aa_dmat64) ?
+                   aa->aa_dmat64 : aa->aa_dmat;
        } else {
                aprint_verbose_dev(self, "using 32-bit DMA\n");
-               error = bus_dmatag_subregion(aa->aa_dmat, 0, 0xffffffff,
-                   &sc->sc_bus.ub_dmatag, BUS_DMA_WAITOK);
-               if (error != 0) {
-                       aprint_error_dev(self, "couldn't create DMA tag: %d\n",
-                           error);
-                       return;
-               }
+               sc->sc_bus.ub_dmatag = aa->aa_dmat;
        }
 
         ih = acpi_intr_establish(self, (uint64_t)aa->aa_node->ad_handle,



Home | Main Index | Thread Index | Old Index