From: Timur Tabi <timur@tabi.org>
To: linux-fbdev@vger.kernel.org
Subject: Re: [PATCH 2/2] drivers/video: fsl-diu-fb: fix bugs in interrupt handling
Date: Thu, 17 Jan 2013 22:20:04 +0000 [thread overview]
Message-ID: <50F87914.8000609@tabi.org> (raw)
In-Reply-To: <1358454518-14032-2-git-send-email-agust@denx.de>
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
next prev parent reply other threads:[~2013-01-17 22:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-17 20:28 [PATCH 2/2] drivers/video: fsl-diu-fb: fix bugs in interrupt handling Anatolij Gustschin
2013-01-17 22:20 ` Timur Tabi [this message]
2013-01-17 23:11 ` Anatolij Gustschin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50F87914.8000609@tabi.org \
--to=timur@tabi.org \
--cc=linux-fbdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).