History log of /netbsd-src/sys/external/bsd/drm2/linux/linux_ww_mutex.c (Results 1 – 16 of 16)
Revision Date Author Comments
# 1bc3b861 29-Jul-2023 riastradh <riastradh@NetBSD.org>

drm/linux_ww_mutex: Fix ww acquire context ordering.

XXX pullup-8
XXX pullup-9
XXX pullup-10


# b9b36368 29-Jul-2023 riastradh <riastradh@NetBSD.org>

drm/linux_ww_mutex: Fix wait loops.

If cv_wait_sig returns because a signal is delivered, we may
nonetheless have been granted the lock. It is harmless for us to
ignore this fact in three of the fo

drm/linux_ww_mutex: Fix wait loops.

If cv_wait_sig returns because a signal is delivered, we may
nonetheless have been granted the lock. It is harmless for us to
ignore this fact in three of the four paths, but in
ww_mutex_state_wait_sig, we may now have ownership of the lock and
MUST NOT return failure because the caller MUST release the lock
before destroying the ww_acquire_ctx.

While here, restructure the other three loops for clarity, so they
match the structure of the fourth and so they have a little less
impenetrable negation.

PR kern/57537

XXX pullup-8
XXX pullup-9
XXX pullup-10

show more ...


# a9f92eb7 18-Mar-2022 riastradh <riastradh@NetBSD.org>

drm: In ww_mutex_unlock, do lockdebug check first.

This way we get a full lockdebug dump when LOCKDEBUG is enabled,
instead of just the panic message (which includes the lock address
you could pass

drm: In ww_mutex_unlock, do lockdebug check first.

This way we get a full lockdebug dump when LOCKDEBUG is enabled,
instead of just the panic message (which includes the lock address
you could pass to `show lock' in ddb, but let's get the dump by
default even if you don't enter ddb).

Also in the KASSERT print the mutex.

show more ...


# f48e2d77 26-Dec-2021 riastradh <riastradh@NetBSD.org>

drm: Allow ww_mutex_lock after ww_acquire_done if we already hold it.

In other words, if ww_mutex_lock would return -EALREADY, that's OK and
does not warrant an assertion.

PR kern/56557


# 1d2fb504 24-Dec-2021 riastradh <riastradh@NetBSD.org>

Revert "drm: Fix missing newline in DRM_WARN."

Accidentally included more than I intended here.


# 826f1879 24-Dec-2021 riastradh <riastradh@NetBSD.org>

drm: Fix missing newline in DRM_WARN.


# f5962ff8 19-Dec-2021 riastradh <riastradh@NetBSD.org>

drm: Spruce up ww_mutex comments. Audit return values.


# c95f5ba4 19-Dec-2021 riastradh <riastradh@NetBSD.org>

linux/ww_mutex: Disable locking-against-self asserts in trylock.

This seems to be done intentionally in Linux.


# da53b7a5 19-Dec-2021 riastradh <riastradh@NetBSD.org>

Implement dma_resv_locking_ctx more carefully.


# 00cd510a 09-May-2019 ozaki-r <ozaki-r@NetBSD.org>

Avoid prepending a timestamp to lock debug outputs on ddb

Lock printer functions (lockops_t#lo_dump) use printf_nolog to print, but
printf_nolog now prepends a timestamp which is unnecessary for ddb

Avoid prepending a timestamp to lock debug outputs on ddb

Lock printer functions (lockops_t#lo_dump) use printf_nolog to print, but
printf_nolog now prepends a timestamp which is unnecessary for ddb:

db{0}> show all locks/t
[Locks tracked through LWPs]
Locks held by an LWP (iperf):
Lock 0 (initialized at soinit)
lock address : 0xffffedeb84b06080 type : sleep/adaptive
initialized : 0xffffffff806d8c3f
shared holds : 0 exclusive: 1
shares wanted: 0 exclusive: 11
current cpu : 0 last held: 1
current lwp : 0xffffedeb849ff040 last held: 0xffffedeb7dfdb240
last locked* : 0xffffffff806d8335 unlocked : 0xffffffff806d8385
[ 79103.0868574] owner field : 0xffffedeb7dfdb240 wait/spin: 1/0

Fix it by passing a printer function to lo_dump functions, i.e., make the
functions use db_printf on ddb.

show more ...


# 8c07fa7c 16-Apr-2019 mrg <mrg@NetBSD.org>

fix various problems i've seen where cv_*wait*() return ERESTART,
which is -3 in netbsd, which we have mapped linux ERESTARTSYS to.

this has a problem because linux code often returns errors and
poi

fix various problems i've seen where cv_*wait*() return ERESTART,
which is -3 in netbsd, which we have mapped linux ERESTARTSYS to.

this has a problem because linux code often returns errors and
pointers in the same value, and pointer values between -4095 and
-1 are considered as error returns, but -3 ends up as 3 and thus
is not considered an error, and mayhem ensues.

with this in place my kabylake system seems actually stable, i
have not triggered any of my prior issues in almost 4 weeks now.


Taylor asked me to write up a description and then wrote most of
the text below for me :-)


In Linux code, we always work with ERESTARTSYS so the code meaning
start over is a positive NetBSD errno safe for PTR_ERR/ERR_PTR.
To achieve this:
1. adapt all cv_waits that return to Linux so they map ERESTART to
ERESTARTSYS, and
2. adapt all returns to userland so they convert ERESTARTSYS to
ERESTART.
Leave EINTR and all other error codes alone.

show more ...


# 5f9c05cc 27-Aug-2018 riastradh <riastradh@NetBSD.org>

Use Linux atomic64 for ww mutex class.

This way we can take advantage of the hash-locked atomic64 on
platforms that lack native atomic_inc_64_nv.


# e7f0067c 16-Sep-2017 christos <christos@NetBSD.org>

more const


# d65bfa51 25-Aug-2017 riastradh <riastradh@NetBSD.org>

Fix lockdebug_locked annotations.

When thread A grants ownership to thread B waiting with a context,
thread B needs to assert lockdebug_locked; otherwise, when it
releases, lockdebug_unlocked thinks

Fix lockdebug_locked annotations.

When thread A grants ownership to thread B waiting with a context,
thread B needs to assert lockdebug_locked; otherwise, when it
releases, lockdebug_unlocked thinks it's releasing an unlocked
ww_mutex.

Fixes LOCKDEBUG failure with radeon noticed by martin@.

show more ...


# 6543027a 21-May-2015 riastradh <riastradh@NetBSD.org>

Adapt ww_mutex to use LOCKDEBUG.

Should help track down PR 49862.


# e04e273f 08-Jan-2015 riastradh <riastradh@NetBSD.org>

Move Linux ww_mutex code into a .c file where it belongs.