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/include/linux kfifo is used under a sp...



details:   https://anonhg.NetBSD.org/src/rev/98125d2033fc
branches:  trunk
changeset: 366294:98125d2033fc
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 14:41:53 2018 +0000

description:
kfifo is used under a spin lock, so its lock must be a spin lock.

>From mrg@.

diffstat:

 sys/external/bsd/drm2/include/linux/kfifo.h |  16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diffs (72 lines):

diff -r 0a19bc0eb7a7 -r 98125d2033fc sys/external/bsd/drm2/include/linux/kfifo.h
--- a/sys/external/bsd/drm2/include/linux/kfifo.h       Mon Aug 27 14:41:41 2018 +0000
+++ b/sys/external/bsd/drm2/include/linux/kfifo.h       Mon Aug 27 14:41:53 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kfifo.h,v 1.2 2018/08/27 14:00:26 riastradh Exp $      */
+/*     $NetBSD: kfifo.h,v 1.3 2018/08/27 14:41:53 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
        /* Type pun!  Hope void * == struct whatever *.  */
        memcpy(bufp, &buf, sizeof(void *));
 
-       mutex_init(&meta->kfm_lock, MUTEX_DEFAULT, IPL_NONE);
+       mutex_init(&meta->kfm_lock, MUTEX_DEFAULT, IPL_VM);
        meta->kfm_head = 0;
        meta->kfm_tail = 0;
        meta->kfm_nbytes = nbytes;
@@ -120,7 +120,7 @@
        char *dst = ptr;
        size_t copied = 0;
 
-       mutex_enter(&meta->kfm_lock);
+       mutex_spin_enter(&meta->kfm_lock);
        const size_t head = meta->kfm_head;
        const size_t tail = meta->kfm_tail;
        const size_t nbytes = meta->kfm_nbytes;
@@ -140,7 +140,7 @@
                        copied = size;
                }
        }
-       mutex_exit(&meta->kfm_lock);
+       mutex_spin_exit(&meta->kfm_lock);
 
        return copied;
 }
@@ -155,7 +155,7 @@
        char *dst = ptr;
        size_t copied = 0;
 
-       mutex_enter(&meta->kfm_lock);
+       mutex_spin_enter(&meta->kfm_lock);
        const size_t head = meta->kfm_head;
        const size_t tail = meta->kfm_tail;
        const size_t nbytes = meta->kfm_nbytes;
@@ -178,7 +178,7 @@
                        copied = size;
                }
        }
-       mutex_exit(&meta->kfm_lock);
+       mutex_spin_exit(&meta->kfm_lock);
 
        return copied;
 }
@@ -193,7 +193,7 @@
        char *dst = buf;
        size_t copied = 0;
 
-       mutex_enter(&meta->kfm_lock);
+       mutex_spin_enter(&meta->kfm_lock);
        const size_t head = meta->kfm_head;
        const size_t tail = meta->kfm_tail;
        const size_t nbytes = meta->kfm_nbytes;
@@ -215,7 +215,7 @@
                        copied = size;
                }
        }
-       mutex_exit(&meta->kfm_lock);
+       mutex_spin_exit(&meta->kfm_lock);
 
        return copied;
 }



Home | Main Index | Thread Index | Old Index