Thread (3 messages) flat view 3 messages, 2 authors, 2013-01-17

Re: [PATCH 2/2] drivers/video: fsl-diu-fb: fix bugs in interrupt handling

From: Timur Tabi <hidden>
Date: 2013-01-17 22:20:04

Anatolij Gustschin wrote:
Since commit f74de500 "drivers/video: fsl-diu-fb: streamline
enabling of interrupts" the interrupt handling in the driver
is broken. Enabling diu interrupt causes an interrupt storm and
results in system lockup.

The cookie for the interrupt handler function passed to request_irq()
is wrong (it must be a pointer to the diu struct, and not the address
of the pointer to the diu struct). As a result the interrupt handler
can not read diu registers and acknowledge the interrupt. Fix cookie
arguments for request_irq() and free_irq().
Ok, thanks for catching this.  I don't know how I missed it.
Masking the diu interrupts in probe() must happen before install_fb()
calls since this function registers framebuffer devices and if fbcon
tries to take over framebuffer after registering a framebuffer device,
it will call fb_open of the diu driver and enable the interrupts. But
at this time the diu interrupt handler is not registered yet. Therefore
we must mask the diu interrupts before registering the framebuffers
and enable the interrupts after registering the handler.
The root cause of this problem is that the hardware is initialized in the
.probe(), but it should instead be initialized in the .open.  This has
been a major design flaw in the DIU driver that I've hoping to fix, but I
never got around to it (and probably never will).

This is why you need hacks like can_handle_irq.  So I'm not crazy about
this patch.  I think you need to get rid of can_handle_irq and allow the
interrupt handler to be registered before the hardware is initialized.

-- 
Timur Tabi
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help