From 67daf5a73e1ca30df16ec720fb59887b35880db8 Mon Sep 17 00:00:00 2001 From: TuxSH <1922548+TuxSH@users.noreply.github.com> Date: Sun, 2 Feb 2020 19:03:04 +0000 Subject: [PATCH] =?UTF-8?q?thermosph=C3=A8re:=20fix=20deadlock?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- thermosphere/src/transport_interface.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/thermosphere/src/transport_interface.c b/thermosphere/src/transport_interface.c index a985e9826..5c7e41dda 100644 --- a/thermosphere/src/transport_interface.c +++ b/thermosphere/src/transport_interface.c @@ -159,8 +159,11 @@ TransportInterface *transportInterfaceCreate( void transportInterfaceAcquire(TransportInterface *iface) { + // Allow interrupts to be taken here if the caller allows it + recursiveSpinlockLock(&iface->lock); + // Get the lock, prevent the interrupt from being pending if there's incoming data - u64 flags = recursiveSpinlockLockMaskIrq(&iface->lock); + u64 flags = maskIrq(); switch (iface->type) { case TRANSPORT_INTERFACE_TYPE_UART: {