All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com>
Cc: Oleksandr Kravchenko <x0199363@ti.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org, Grant Likely <grant.likely@linaro.org>,
	Rob Herring <rob.herring@calxeda.com>,
	Rob Landley <rob@landley.net>,
	jic23@cam.ac.uk, Peter Meerwald <pmeerw@pmeerw.net>,
	holler@ahsoftware.de, srinivas.pandruvada@intel.com,
	devicetree-discuss@lists.ozlabs.org
Subject: Re: [PATCH] iio: add APDS9300 ambilent light sensor driver
Date: Mon, 15 Jul 2013 17:54:03 +0200	[thread overview]
Message-ID: <51E41B1B.7000100@metafoo.de> (raw)
In-Reply-To: <CAGH3dro7MxDJRB=5gsBysiKVvXLskZFuagiBMznUnAjCMoZsTQ@mail.gmail.com>

On 07/15/2013 04:54 PM, Oleksandr Kravchenko wrote:
> I can't to find devm_iio_device_alloc() in my kernel v3.11-rc1
> 

It doesn't exist yet, but it should be too hard to implement one.

- Lars

> On Mon, Jul 15, 2013 at 3:35 PM, Lars-Peter Clausen <lars@metafoo.de> wrote:
>> On 07/15/2013 02:27 PM, Oleksandr Kravchenko wrote:
>>> Thank you for review! But I don't completely understand one of your comment:
>>>
>>>>> +static int als_probe(struct i2c_client *client, const struct i2c_device_id *id)
>>> [...]
>>>>> +     if (client->irq) {
>>>>> +             ret = devm_request_threaded_irq(&client->dev, client->irq,
>>>>> +                             NULL, als_interrupt_handler,
>>>>> +                             IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
>>>>> +                             ALS_IRQ_NAME, indio_dev);
>>>>
>>>> This is a bit racy, you access memory in the irq handler that is freed
>>>> before the irq is freed.
>>>
>>> Do you mean than that indio_dev may be used in interrupt handler after
>>> iio_device_free(indio_dev) called in als_remove() function?
>>>
>>> If so, can I use disable_irq() in als_remove() before iio_device_free()
>>> to avoid this problem?
>>>
>>
>> Just add a devm_iio_device_alloc() and use that, instead of trying to bodch
>> around the issue.
>>
> 
> 
> 


      reply	other threads:[~2013-07-15 15:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-10 13:08 [PATCH] iio: add APDS9300 ambilent light sensor driver Oleksandr Kravchenko
2013-07-10 13:08 ` Oleksandr Kravchenko
2013-07-12 17:04 ` Lars-Peter Clausen
2013-07-15 12:27   ` Oleksandr Kravchenko
2013-07-15 12:35     ` Lars-Peter Clausen
2013-07-15 14:54       ` Oleksandr Kravchenko
2013-07-15 15:54         ` Lars-Peter Clausen [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=51E41B1B.7000100@metafoo.de \
    --to=lars@metafoo.de \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@linaro.org \
    --cc=holler@ahsoftware.de \
    --cc=jic23@cam.ac.uk \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=o.v.kravchenko@globallogic.com \
    --cc=pmeerw@pmeerw.net \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    --cc=srinivas.pandruvada@intel.com \
    --cc=x0199363@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.