This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#11130 - Rewrite ascodec_as3514.c to use interrupts
Attached to Project:
Rockbox
Opened by Tobias Diedrich (ranma) - Friday, 19 March 2010, 19:53 GMT+2
Last edited by Tobias Diedrich (ranma) - Tuesday, 23 March 2010, 10:06 GMT+2
Opened by Tobias Diedrich (ranma) - Friday, 19 March 2010, 19:53 GMT+2
Last edited by Tobias Diedrich (ranma) - Tuesday, 23 March 2010, 10:06 GMT+2
|
DetailsThis patch rewrites ascodec_as3514.c to use interrupts.
It gets rid of the ascodec mutex and instead introduces a mutex in adc-as3514.c. Requests are handled using a simple request queue, and allows asynchronous request to be started from interrupt context. The (20+sizeof(struct wakeup)) bytes request struct is either allocated on the stack (synchronous read/write) or has to be allocated statically by the caller (asynchronous read). The asynchronous write is used in system-as3525.c (which is run with interrupts disabled). asynchronous reads are used by another pending patch of mine implementing AUDIO_IRQ (int 9) handling for usb_plug detection without needing a thread. |
This task depends upon
Closed by Tobias Diedrich (ranma)
Tuesday, 23 March 2010, 10:06 GMT+2
Reason for closing: Accepted
Additional comments about closing: Committed
Tuesday, 23 March 2010, 10:06 GMT+2
Reason for closing: Accepted
Additional comments about closing: Committed
You changed ascodec_lock() into a adc specific lock in adc-as3514.c, but this file is also used by e200v1/c200v1 : doesn't it cause a problem for those devices?
When I attach the USB cable while in the Rockbox menu I intermittently get a black screen lockup that requires a long poweroff (10 secs) to recover.
All other functions appear normal.
Only with this patch? Or with 11130+11131 applied?
Since 11130 doesn't change the usb detection I wonder why it should cause a lockup on usb plugin...
Hmm, backlight is controlled using as3514 on e200 though and system_reboot() calls _backlight_off() (why? If it reboots the backlight will be turned back on very soon anyway...). So if system_reboot() is called with interrupts disabled it would hang. Though it's should be called from the usb thread, which means interrupts should be enabled and I don't see why suddenly at that point the interrupt wouldn't fire if it has been working fine that far...
Can you try this?
It will fall back to polling if irqs are disabled.
So far, with minimal testing, the new patch looks good. I have not had any lockups, yet. I will continue testing throughout the day. I will also test it with 11131 also applied.