Hello FreeBSD community!
As you can see here: https://forums.freebsd.org/threads/ar9271-usb-driver.93007/, we are developing the AR9271 USB driver. We want to integrate it with an existing ATH driver.
Existing ATH driver uses PCI communication, which is fast and doesn't require synchronization.
Our driver uses USB communication with
The challenge is that ATH drivers use separate locks. After integrating our code, the scenario looks like this:
In this example
The problem is that the
We don't know how to fix the problem.
Would appreciate any tips you can offer!
Cheers,
Mikolaj
As you can see here: https://forums.freebsd.org/threads/ar9271-usb-driver.93007/, we are developing the AR9271 USB driver. We want to integrate it with an existing ATH driver.
Existing ATH driver uses PCI communication, which is fast and doesn't require synchronization.
Our driver uses USB communication with
msleep
and interrupts to wake it up.The challenge is that ATH drivers use separate locks. After integrating our code, the scenario looks like this:
C:
ATH_LOCK();
/* Our code */
ATH_USB_LOCK();
msleep(...); // Wait for wakeup from USB interrupt
ATH_USB_UNLOCK();
/* Our code end */
ATH_UNLOCK();
ATH_LOCK
and ATH_USB_LOCK
are mtx_lock
of different mutexes. There are different recursive locks in the ATH driver so it's not always ATH_LOCK
.The problem is that the
msleep
drops the outer mutex.We don't know how to fix the problem.
Would appreciate any tips you can offer!
Cheers,
Mikolaj