Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu amdgpu: Don't unma...



details:   https://anonhg.NetBSD.org/src/rev/ffe44cc7d1de
branches:  trunk
changeset: 1029003:ffe44cc7d1de
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 12:41:33 2021 +0000

description:
amdgpu: Don't unmap doorbells if we didn't map them.

diffstat:

 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (32 lines):

diff -r 3bed04e3acc5 -r ffe44cc7d1de sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c
--- a/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c Sun Dec 19 12:41:23 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c Sun Dec 19 12:41:33 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amdgpu_device.c,v 1.15 2021/12/19 12:41:23 riastradh Exp $     */
+/*     $NetBSD: amdgpu_device.c,v 1.16 2021/12/19 12:41:33 riastradh Exp $     */
 
 /*
  * Copyright 2008 Advanced Micro Devices, Inc.
@@ -28,7 +28,7 @@
  *          Jerome Glisse
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_device.c,v 1.15 2021/12/19 12:41:23 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_device.c,v 1.16 2021/12/19 12:41:33 riastradh Exp $");
 
 #include <linux/power_supply.h>
 #include <linux/kthread.h>
@@ -816,8 +816,11 @@
 static void amdgpu_device_doorbell_fini(struct amdgpu_device *adev)
 {
 #ifdef __NetBSD__
-       bus_space_unmap(adev->doorbell.bst, adev->doorbell.bsh,
-           adev->doorbell.num_doorbells * sizeof(u32));
+       if (adev->doorbell.num_doorbells) {
+               bus_space_unmap(adev->doorbell.bst, adev->doorbell.bsh,
+                   adev->doorbell.num_doorbells * sizeof(u32));
+               adev->doorbell.num_doorbells = 0;
+       }
 #else
        iounmap(adev->doorbell.ptr);
        adev->doorbell.ptr = NULL;



Home | Main Index | Thread Index | Old Index