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/drm drm: add missing KERNEL_LOCK aroun...



details:   https://anonhg.NetBSD.org/src/rev/4373445ae6ec
branches:  trunk
changeset: 1029073:4373445ae6ec
user:      chs <chs%NetBSD.org@localhost>
date:      Mon Dec 20 20:34:58 2021 +0000

description:
drm: add missing KERNEL_LOCK around calls to config_found().

diffstat:

 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fb.c     |  6 ++++--
 sys/external/bsd/drm2/dist/drm/i915/display/intel_fbdev.c |  6 ++++--
 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c    |  6 ++++--
 sys/external/bsd/drm2/dist/drm/radeon/radeon_fb.c         |  6 ++++--
 sys/external/bsd/drm2/drm/drmfb.c                         |  6 ++++--
 5 files changed, 20 insertions(+), 10 deletions(-)

diffs (144 lines):

diff -r e18353d93095 -r 4373445ae6ec sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fb.c
--- a/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fb.c     Mon Dec 20 20:33:20 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fb.c     Mon Dec 20 20:34:58 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amdgpu_fb.c,v 1.10 2021/12/19 12:02:39 riastradh Exp $ */
+/*     $NetBSD: amdgpu_fb.c,v 1.11 2021/12/20 20:34:58 chs Exp $       */
 
 /*
  * Copyright © 2007 David Airlie
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_fb.c,v 1.10 2021/12/19 12:02:39 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_fb.c,v 1.11 2021/12/20 20:34:58 chs Exp $");
 
 #include <linux/module.h>
 #include <linux/pm_runtime.h>
@@ -274,8 +274,10 @@
        afa.afa_fb_ptr = amdgpu_bo_kptr(abo);
        afa.afa_fb_linebytes = mode_cmd.pitches[0];
 
+       KERNEL_LOCK(1, NULL);
        helper->fbdev = config_found(adev->ddev->dev, &afa, NULL,
            CFARGS(.iattr = "amdgpufbbus"));
+       KERNEL_UNLOCK_ONE(NULL);
        if (helper->fbdev == NULL) {
                DRM_ERROR("failed to attach amdgpufb\n");
                goto out;
diff -r e18353d93095 -r 4373445ae6ec sys/external/bsd/drm2/dist/drm/i915/display/intel_fbdev.c
--- a/sys/external/bsd/drm2/dist/drm/i915/display/intel_fbdev.c Mon Dec 20 20:33:20 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/display/intel_fbdev.c Mon Dec 20 20:34:58 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intel_fbdev.c,v 1.9 2021/12/19 12:32:15 riastradh Exp $        */
+/*     $NetBSD: intel_fbdev.c,v 1.10 2021/12/20 20:34:58 chs Exp $     */
 
 /*
  * Copyright © 2007 David Airlie
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intel_fbdev.c,v 1.9 2021/12/19 12:32:15 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_fbdev.c,v 1.10 2021/12/20 20:34:58 chs Exp $");
 
 #include <linux/async.h>
 #include <linux/console.h>
@@ -264,8 +264,10 @@
         * XXX Should do this asynchronously, since we hold
         * dev->struct_mutex.
         */
+       KERNEL_LOCK(1, NULL);
        helper->fbdev = config_found(dev->dev, &ifa, NULL,
            CFARGS(.iattr = "intelfbbus"));
+       KERNEL_UNLOCK_ONE(NULL);
        if (helper->fbdev == NULL) {
                DRM_ERROR("unable to attach intelfb\n");
                ret = -ENXIO;
diff -r e18353d93095 -r 4373445ae6ec sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c    Mon Dec 20 20:33:20 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fbcon.c    Mon Dec 20 20:34:58 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveau_fbcon.c,v 1.15 2021/12/19 11:34:44 riastradh Exp $     */
+/*     $NetBSD: nouveau_fbcon.c,v 1.16 2021/12/20 20:34:58 chs Exp $   */
 
 /*
  * Copyright © 2007 David Airlie
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_fbcon.c,v 1.15 2021/12/19 11:34:44 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_fbcon.c,v 1.16 2021/12/20 20:34:58 chs Exp $");
 
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -420,8 +420,10 @@
        nfa.nfa_fb_ptr = nvbo_kmap_obj_iovirtual(nvbo);
        nfa.nfa_fb_linebytes = mode_cmd.pitches[0];
 
+       KERNEL_LOCK(1, NULL);
        helper->fbdev = config_found(dev->dev, &nfa, nouveau_fbcon_print,
            CFARGS(.iattr = "nouveaufbbus"));
+       KERNEL_UNLOCK_ONE(NULL);
        if (helper->fbdev == NULL) {
                goto out_unlock;
        }
diff -r e18353d93095 -r 4373445ae6ec sys/external/bsd/drm2/dist/drm/radeon/radeon_fb.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/radeon_fb.c Mon Dec 20 20:33:20 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/radeon_fb.c Mon Dec 20 20:34:58 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: radeon_fb.c,v 1.14 2021/12/19 10:46:44 riastradh Exp $ */
+/*     $NetBSD: radeon_fb.c,v 1.15 2021/12/20 20:34:58 chs Exp $       */
 
 /*
  * Copyright © 2007 David Airlie
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: radeon_fb.c,v 1.14 2021/12/19 10:46:44 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_fb.c,v 1.15 2021/12/20 20:34:58 chs Exp $");
 
 #include <linux/module.h>
 #include <linux/pci.h>
@@ -275,8 +275,10 @@
        rfa.rfa_fb_ptr = rbo->kptr;
        rfa.rfa_fb_linebytes = mode_cmd.pitches[0];
 
+       KERNEL_LOCK(1, NULL);
        helper->fbdev = config_found(rdev->ddev->dev, &rfa, NULL,
            CFARGS(.iattr = "radeonfbbus"));
+       KERNEL_UNLOCK_ONE(NULL);
        if (helper->fbdev == NULL) {
                DRM_ERROR("failed to attach genfb\n");
                goto out;
diff -r e18353d93095 -r 4373445ae6ec sys/external/bsd/drm2/drm/drmfb.c
--- a/sys/external/bsd/drm2/drm/drmfb.c Mon Dec 20 20:33:20 2021 +0000
+++ b/sys/external/bsd/drm2/drm/drmfb.c Mon Dec 20 20:34:58 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drmfb.c,v 1.11 2021/12/20 00:27:53 riastradh Exp $     */
+/*     $NetBSD: drmfb.c,v 1.12 2021/12/20 20:34:59 chs Exp $   */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drmfb.c,v 1.11 2021/12/20 00:27:53 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drmfb.c,v 1.12 2021/12/20 20:34:59 chs Exp $");
 
 #ifdef _KERNEL_OPT
 #include "vga.h"
@@ -156,7 +156,9 @@
        genfb_ops.genfb_enable_polling = drmfb_genfb_enable_polling;
        genfb_ops.genfb_disable_polling = drmfb_genfb_disable_polling;
 
+       KERNEL_LOCK(1, NULL);
        error = genfb_attach(&sc->sc_genfb, &genfb_ops);
+       KERNEL_UNLOCK_ONE(NULL);
        if (error) {
                aprint_error_dev(sc->sc_da.da_dev,
                    "failed to attach genfb: %d\n", error);



Home | Main Index | Thread Index | Old Index