* question about drivers/i2c/busses/i2c-davinci.c
@ 2013-01-06 20:00 Julia Lawall
[not found] ` <alpine.DEB.2.02.1301062057260.2029-bi+AKbBUZKagILUCTcTcHdKyNwTtLsGr@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2013-01-06 20:00 UTC (permalink / raw)
To: nsekhar-l0cyMroinI0, khilman-l0cyMroinI0,
w.sang-bIcnvbaLZ9MEGnE8C9+IrQ, ben-linux-elnMNo+KYs3YtjvyW6yDsg,
grant.likely-s3s/WqlpOiPyB63q8FvJNQ,
rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/,
linux-i2c-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ
The function davinci_i2c_remove in drivers/i2c/busses/i2c-davinci.c
contains the following code:
put_device(&pdev->dev);
clk_disable_unprepare(dev->clk);
clk_put(dev->clk);
dev->clk = NULL;
davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, 0);
free_irq(dev->irq, dev);
Is there any danger in putting free_irq(dev->irq, dev); after
put_device(&pdev->dev);, because the interrupt handler i2c_davinci_isr can
eg refer to dev->dev.
thanks,
julia
^ permalink raw reply [flat|nested] 2+ messages in thread[parent not found: <alpine.DEB.2.02.1301062057260.2029-bi+AKbBUZKagILUCTcTcHdKyNwTtLsGr@public.gmane.org>]
* Re: question about drivers/i2c/busses/i2c-davinci.c [not found] ` <alpine.DEB.2.02.1301062057260.2029-bi+AKbBUZKagILUCTcTcHdKyNwTtLsGr@public.gmane.org> @ 2013-01-24 12:36 ` Wolfram Sang 0 siblings, 0 replies; 2+ messages in thread From: Wolfram Sang @ 2013-01-24 12:36 UTC (permalink / raw) To: Julia Lawall Cc: nsekhar-l0cyMroinI0, khilman-l0cyMroinI0, ben-linux-elnMNo+KYs3YtjvyW6yDsg, grant.likely-s3s/WqlpOiPyB63q8FvJNQ, rob.herring-bsGFqQB8/DxBDgjK7y7TUQ, davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/, linux-i2c-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ [-- Attachment #1: Type: text/plain, Size: 1227 bytes --] On Sun, Jan 06, 2013 at 09:00:59PM +0100, Julia Lawall wrote: > The function davinci_i2c_remove in drivers/i2c/busses/i2c-davinci.c > contains the following code: > > put_device(&pdev->dev); > > clk_disable_unprepare(dev->clk); > clk_put(dev->clk); > dev->clk = NULL; > > davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, 0); > free_irq(dev->irq, dev); > > Is there any danger in putting free_irq(dev->irq, dev); after > put_device(&pdev->dev);, because the interrupt handler > i2c_davinci_isr can eg refer to dev->dev. Not having a clock doesn't sound exactly thrilling either when servicing an interrupt. I've seen something like this in the remove path of another driver today as well. I assume a lot of drivers might have such issues. It is also one of the subtle issues with devm_request_irq. The remove path can already render the ISR unusable/oopsable but devm will free the interrupt only after remove has finished. Interrupts need to be properly masked out before. Regards, Wolfram -- Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ | [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 198 bytes --] ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-01-24 12:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-06 20:00 question about drivers/i2c/busses/i2c-davinci.c Julia Lawall
[not found] ` <alpine.DEB.2.02.1301062057260.2029-bi+AKbBUZKagILUCTcTcHdKyNwTtLsGr@public.gmane.org>
2013-01-24 12:36 ` Wolfram Sang
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).