[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53F60A92.4040702@linaro.org>
Date: Thu, 21 Aug 2014 17:04:50 +0200
From: Tomasz Nowicki <tomasz.nowicki@...aro.org>
To: Mika Westerberg <mika.westerberg@...ux.intel.com>
CC: rjw@...ysocki.net, linus.walleij@...aro.org, gnurou@...il.com,
linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
linaro-acpi@...ts.linaro.org
Subject: Re: [PATCH] ACPI: Add GPIO-signaled event emulator.
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists