* [PATCH] uio: fix devm_request_irq usage
@ 2013-12-20 14:19 Aaro Koskinen
2013-12-20 16:49 ` Greg Kroah-Hartman
0 siblings, 1 reply; 4+ messages in thread
From: Aaro Koskinen @ 2013-12-20 14:19 UTC (permalink / raw)
To: Hans J. Koch, Greg Kroah-Hartman, linux-kernel, Michal Simek
Cc: Aaro Koskinen
Commit e6789cd3dfb553077606ccafeb05e0043f072481 (uio: Simplify uio error
path by using devres functions) converted uio to use devm_request_irq().
This introduced a change in behaviour since the IRQ is associated with
the parent device instead of the created UIO device. The IRQ will remain
active after uio_unregister_device() is called, and some drivers will
crash because of this. The patch fixes this.
Signed-off-by: Aaro Koskinen <aaro.koskinen@nsn.com>
---
drivers/uio/uio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index f7beb6e..a673e5b 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -847,7 +847,7 @@ int __uio_register_device(struct module *owner,
info->uio_dev = idev;
if (info->irq && (info->irq != UIO_IRQ_CUSTOM)) {
- ret = devm_request_irq(parent, info->irq, uio_interrupt,
+ ret = devm_request_irq(idev->dev, info->irq, uio_interrupt,
info->irq_flags, info->name, idev);
if (ret)
goto err_request_irq;
--
1.8.5.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] uio: fix devm_request_irq usage
2013-12-20 14:19 [PATCH] uio: fix devm_request_irq usage Aaro Koskinen
@ 2013-12-20 16:49 ` Greg Kroah-Hartman
2013-12-20 18:01 ` Aaro Koskinen
0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2013-12-20 16:49 UTC (permalink / raw)
To: Aaro Koskinen; +Cc: Hans J. Koch, linux-kernel, Michal Simek
On Fri, Dec 20, 2013 at 04:19:47PM +0200, Aaro Koskinen wrote:
> Commit e6789cd3dfb553077606ccafeb05e0043f072481 (uio: Simplify uio error
> path by using devres functions) converted uio to use devm_request_irq().
> This introduced a change in behaviour since the IRQ is associated with
> the parent device instead of the created UIO device. The IRQ will remain
> active after uio_unregister_device() is called, and some drivers will
> crash because of this. The patch fixes this.
What drivers crash because of this? Any in-kernel drivers?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] uio: fix devm_request_irq usage
2013-12-20 16:49 ` Greg Kroah-Hartman
@ 2013-12-20 18:01 ` Aaro Koskinen
2013-12-20 18:56 ` Greg Kroah-Hartman
0 siblings, 1 reply; 4+ messages in thread
From: Aaro Koskinen @ 2013-12-20 18:01 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Aaro Koskinen, Hans J. Koch, linux-kernel, Michal Simek
Hi,
On Fri, Dec 20, 2013 at 08:49:13AM -0800, Greg Kroah-Hartman wrote:
> On Fri, Dec 20, 2013 at 04:19:47PM +0200, Aaro Koskinen wrote:
> > Commit e6789cd3dfb553077606ccafeb05e0043f072481 (uio: Simplify uio error
> > path by using devres functions) converted uio to use devm_request_irq().
> > This introduced a change in behaviour since the IRQ is associated with
> > the parent device instead of the created UIO device. The IRQ will remain
> > active after uio_unregister_device() is called, and some drivers will
> > crash because of this. The patch fixes this.
>
> What drivers crash because of this? Any in-kernel drivers?
I saw a crash with Intel DPDK (http://www.dpdk.org/) igb_uio
driver. Basically, they do:
uio_unregister_device
pci_disable_msix <-- this will BUG() if there is an active IRQ
I cannot test any of the in-tree UIO drivers, but at least some
of them seem to release resources the IRQ handler might use after
uio_unregister_device(). So if the IRQ fires results would not probably
be very good.
A.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] uio: fix devm_request_irq usage
2013-12-20 18:01 ` Aaro Koskinen
@ 2013-12-20 18:56 ` Greg Kroah-Hartman
0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2013-12-20 18:56 UTC (permalink / raw)
To: Aaro Koskinen; +Cc: Aaro Koskinen, Hans J. Koch, linux-kernel, Michal Simek
On Fri, Dec 20, 2013 at 08:01:13PM +0200, Aaro Koskinen wrote:
> Hi,
>
> On Fri, Dec 20, 2013 at 08:49:13AM -0800, Greg Kroah-Hartman wrote:
> > On Fri, Dec 20, 2013 at 04:19:47PM +0200, Aaro Koskinen wrote:
> > > Commit e6789cd3dfb553077606ccafeb05e0043f072481 (uio: Simplify uio error
> > > path by using devres functions) converted uio to use devm_request_irq().
> > > This introduced a change in behaviour since the IRQ is associated with
> > > the parent device instead of the created UIO device. The IRQ will remain
> > > active after uio_unregister_device() is called, and some drivers will
> > > crash because of this. The patch fixes this.
> >
> > What drivers crash because of this? Any in-kernel drivers?
>
> I saw a crash with Intel DPDK (http://www.dpdk.org/) igb_uio
> driver. Basically, they do:
>
> uio_unregister_device
> pci_disable_msix <-- this will BUG() if there is an active IRQ
>
> I cannot test any of the in-tree UIO drivers, but at least some
> of them seem to release resources the IRQ handler might use after
> uio_unregister_device(). So if the IRQ fires results would not probably
> be very good.
Ok, thanks, I'll queue this up for 3.14-rc1 and tag it for 3.13-stable
so that people who have external modules can get the fix then.
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-12-20 18:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-20 14:19 [PATCH] uio: fix devm_request_irq usage Aaro Koskinen
2013-12-20 16:49 ` Greg Kroah-Hartman
2013-12-20 18:01 ` Aaro Koskinen
2013-12-20 18:56 ` Greg Kroah-Hartman
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).