diff --git a/dde_linux/src/lib/usb/include/signal.h b/dde_linux/src/lib/usb/include/signal.h index bf3e2ea8b0..8b3d0e4f0f 100644 --- a/dde_linux/src/lib/usb/include/signal.h +++ b/dde_linux/src/lib/usb/include/signal.h @@ -116,7 +116,6 @@ namespace Irq { void init(Genode::Signal_receiver *recv); void check_irq(); - void wait_for_irq(); } namespace Event diff --git a/dde_linux/src/lib/usb/nic/nic.cc b/dde_linux/src/lib/usb/nic/nic.cc index 41e986d29d..c5f78fa17f 100644 --- a/dde_linux/src/lib/usb/nic/nic.cc +++ b/dde_linux/src/lib/usb/nic/nic.cc @@ -98,8 +98,9 @@ class Skb /* wait until some SKBs are freed */ - for (_wait_free = false; !_wait_free;) - Irq::wait_for_irq(); + _wait_free = false; + //PDBG("wait for free skbs ..."); + _wait_event(_wait_free); return alloc(); } diff --git a/dde_linux/src/lib/usb/signal/irq.cc b/dde_linux/src/lib/usb/signal/irq.cc index c5debb4062..e75aa37755 100644 --- a/dde_linux/src/lib/usb/signal/irq.cc +++ b/dde_linux/src/lib/usb/signal/irq.cc @@ -22,7 +22,6 @@ extern "C" { /* our local incarnation of sender and receiver */ static Signal_helper *_signal = 0; static Genode::Lock _irq_sync(Genode::Lock::LOCKED); -static Genode::Lock _irq_wait(Genode::Lock::LOCKED); /** * This contains the Linux-driver handlers @@ -81,9 +80,6 @@ class Irq_context : public Driver_context, static Genode::Lock handler_lock; Genode::Lock::Guard guard(handler_lock); - /* unlock if main thread is waiting */ - _irq_wait.unlock(); - Irq_context *ctx = static_cast(irq); /* set context & submit signal */ @@ -124,7 +120,7 @@ class Irq_context : public Driver_context, /* report IRQ to all clients */ for (Irq_handler *h = _handler_list.first(); h; h = h->next()) { - if ((handled = _handle_one(h))) + if (_handle_one(h)) break; dde_kit_log(DEBUG_IRQ, "IRQ: %u ret: %u h: %p dev: %p", _irq, handled, h->handler, h->dev); @@ -195,13 +191,6 @@ void Irq::check_irq() } -void Irq::wait_for_irq() -{ - while (!Irq_context::check_irq()) - _irq_wait.lock(); -} - - /*********************** ** linux/interrupt.h ** ***********************/