Date: Tue, 03 Feb 2026 03:22:00 +0000 From: Kyle Evans <kevans@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Abdelkader Boudih <freebsd@seuros.com> Subject: git: ed3a2469a71e - main - uart: fix sleeping while holding mutex in uart_tty_detach() Message-ID: <698169d8.3e247.38c763e5@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=ed3a2469a71e0ef48cf8e636c35e64a011756da3 commit ed3a2469a71e0ef48cf8e636c35e64a011756da3 Author: Abdelkader Boudih <freebsd@seuros.com> AuthorDate: 2026-02-03 03:21:43 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2026-02-03 03:21:43 +0000 uart: fix sleeping while holding mutex in uart_tty_detach() Move swi_remove() call before acquiring the tty lock. swi_remove() calls intr_event_remove_handler() which may sleep via msleep(), causing a lock order violation when called with the tty mutex held. The software interrupt handler removal operates on the interrupt event structure independently and does not require the tty lock. This matches the pattern used in other drivers such as tcp_hpts.c where swi_remove() is called without holding other locks. Reviewed by: imp, kevans MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D54953 --- sys/dev/uart/uart_tty.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/uart/uart_tty.c b/sys/dev/uart/uart_tty.c index d15d1d0c6ac2..7f0f730b3b6e 100644 --- a/sys/dev/uart/uart_tty.c +++ b/sys/dev/uart/uart_tty.c @@ -447,8 +447,9 @@ uart_tty_detach(struct uart_softc *sc) tp = sc->sc_u.u_tty.tp; - tty_lock(tp); swi_remove(sc->sc_softih); + + tty_lock(tp); tty_rel_gone(tp); return (0);home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?698169d8.3e247.38c763e5>
