Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi Fix DMA size reporting. Previously it could re...



details:   https://anonhg.NetBSD.org/src/rev/6025a7b5ffc7
branches:  trunk
changeset: 1015478:6025a7b5ffc7
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sat Oct 24 08:55:23 2020 +0000

description:
Fix DMA size reporting.  Previously it could report 64bit DMA when the tag
wasn't available (and it fell back to 32bit tag)

diffstat:

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

diffs (31 lines):

diff -r 7e49470c9b0a -r 6025a7b5ffc7 sys/dev/acpi/xhci_acpi.c
--- a/sys/dev/acpi/xhci_acpi.c  Sat Oct 24 08:50:17 2020 +0000
+++ b/sys/dev/acpi/xhci_acpi.c  Sat Oct 24 08:55:23 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xhci_acpi.c,v 1.7 2020/01/31 23:12:13 jmcneill Exp $ */
+/* $NetBSD: xhci_acpi.c,v 1.8 2020/10/24 08:55:23 skrll 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.7 2020/01/31 23:12:13 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci_acpi.c,v 1.8 2020/10/24 08:55:23 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -129,10 +129,9 @@
        }
 
        hccparams = bus_space_read_4(sc->sc_iot, sc->sc_ioh, XHCI_HCCPARAMS);
-       if (XHCI_HCC_AC64(hccparams)) {
+       if (XHCI_HCC_AC64(hccparams) && BUS_DMA_TAG_VALID(aa->aa_dmat64)) {
                aprint_verbose_dev(self, "using 64-bit DMA\n");
-               sc->sc_bus.ub_dmatag = BUS_DMA_TAG_VALID(aa->aa_dmat64) ?
-                   aa->aa_dmat64 : aa->aa_dmat;
+               sc->sc_bus.ub_dmatag = aa->aa_dmat64;
        } else {
                aprint_verbose_dev(self, "using 32-bit DMA\n");
                sc->sc_bus.ub_dmatag = aa->aa_dmat;



Home | Main Index | Thread Index | Old Index