From: Wolfram Sang <w.sang@pengutronix.de>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: nsekhar@ti.com, khilman@ti.com, ben-linux@fluff.org,
grant.likely@secretlab.ca, rob.herring@calxeda.com,
davinci-linux-open-source@linux.davincidsp.com,
linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree-discuss@lists.ozlabs.org
Subject: Re: question about drivers/i2c/busses/i2c-davinci.c
Date: Thu, 24 Jan 2013 13:36:15 +0100 [thread overview]
Message-ID: <20130124123615.GG12933@pengutronix.de> (raw)
In-Reply-To: <alpine.DEB.2.02.1301062057260.2029@localhost6.localdomain6>
[-- 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 --]
prev parent reply other threads:[~2013-01-24 12:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-06 20:00 Julia Lawall
2013-01-24 12:36 ` Wolfram Sang [this message]
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=20130124123615.GG12933@pengutronix.de \
--to=w.sang@pengutronix.de \
--cc=ben-linux@fluff.org \
--cc=davinci-linux-open-source@linux.davincidsp.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=julia.lawall@lip6.fr \
--cc=khilman@ti.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nsekhar@ti.com \
--cc=rob.herring@calxeda.com \
/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
all inboxes | Powered by JetHome®