All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomasz Nowicki <tomasz.nowicki@linaro.org>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: rjw@rjwysocki.net, linus.walleij@linaro.org, gnurou@gmail.com,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	linaro-acpi@lists.linaro.org
Subject: Re: [PATCH] ACPI: Add GPIO-signaled event emulator.
Date: Thu, 21 Aug 2014 17:04:50 +0200	[thread overview]
Message-ID: <53F60A92.4040702@linaro.org> (raw)
In-Reply-To: <20140821145405.GU1660@lahna.fi.intel.com>

On 21.08.2014 16:54, Mika Westerberg wrote:
> On Thu, Aug 21, 2014 at 04:39:46PM +0200, Tomasz Nowicki wrote:
>>>> +{
>>>> +	struct gpio_pin_data *pin_data, *temp;
>>>> +
>>>> +	list_for_each_entry_safe(pin_data, temp, &pin_data_list, list)
>>>> +		kfree(pin_data);
>>>
>>> I suppose you want to first remove the directory entries and then the
>>> pin data. Otherwise if you get pre-empted at this point and someone
>>> tries to use your debugfs files, bad things might happen.
>> Good catch!
>>
>>>
>>>> +
>>>> +	debugfs_remove_recursive(acpi_evt_debugfs_dir);
>>>
>>> Since this already removes everything below this dentry, why do you need
>>> to store the pointer in gpio_pin_parent_data?
>> Not sure I got the question.
>>
>> GPIO device instance (debugfs dir) is parent for all its pins (debugfs
>> nodes). I am using gpio_pin_parent_data as container to pass info for all
>> children so I can create debugfs node inside of parent related debugfs dir.
>>
>> pin_data_list, however, is used to keep pointers to allocated memory (one
>> for each pins). debugfs_remove_recursive won't free it.
>
> Yes but it removes the debugfs entries below so you don't need to store
> the children debugfs dentries.
>
I don't, gpio_pin_parent_data (local variable) keeps pointer to *parent 
debugfs dentries* only. gpio_pin_parent_data name might be misleading, I 
will rename it to gpio_parent_data in next version.

Regards,
Tomasz

  reply	other threads:[~2014-08-21 15:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-20 14:58 [PATCH] ACPI: Add GPIO-signaled event emulator Tomasz Nowicki
2014-08-21 10:45 ` Mika Westerberg
2014-08-21 14:39   ` Tomasz Nowicki
2014-08-21 14:54     ` Mika Westerberg
2014-08-21 15:04       ` Tomasz Nowicki [this message]
2014-08-25 22:39     ` Rafael J. Wysocki
2014-08-28 11:19       ` Tomasz Nowicki
2014-08-29 22:37         ` Rafael J. Wysocki

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=53F60A92.4040702@linaro.org \
    --to=tomasz.nowicki@linaro.org \
    --cc=gnurou@gmail.com \
    --cc=linaro-acpi@lists.linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=rjw@rjwysocki.net \
    /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.