All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laxman Dewangan <ldewangan@nvidia.com>
To: Krzysztof Kozlowski <k.kozlowski@samsung.com>,
	<lee.jones@linaro.org>, <alexandre.belloni@free-electrons.com>,
	<javier@osg.samsung.com>
Cc: <cw00.choi@samsung.com>, <linux-kernel@vger.kernel.org>,
	<rtc-linux@googlegroups.com>
Subject: Re: [PATCH V2 5/5] rtc: max77686: move initialisation of rtc regmap, irq chip locally
Date: Wed, 3 Feb 2016 18:43:23 +0530	[thread overview]
Message-ID: <56B1FCF3.2040307@nvidia.com> (raw)
In-Reply-To: <56B1E2F3.9010502@samsung.com>


On Wednesday 03 February 2016 04:52 PM, Krzysztof Kozlowski wrote:
> On 03.02.2016 19:45, Krzysztof Kozlowski wrote:
>> On 03.02.2016 18:30, Laxman Dewangan wrote:
>>>   
>>>   err_rtc:
>>> +	if (info->rtc)
>>> +		i2c_unregister_device(info->rtc);
>>> +	regmap_del_irq_chip(info->rtc_irq, info->rtc_irq_data);
>>> +
>> You should clean up in reverse order of allocation, so first
>> regmap_del_irq_chip then i2c_unregister_device. This
>> is a common pattern of cleaning up. Sometimes such order
>> is even necessary because of dependencies between
>> components... which is not a case here but still the
>> natural way is reversing the allocation code.

I made the change in other place (remove callback) but not this place. 
It is just missed by me. my bad..
Will do in next patch.

>> [   88.296055] [<c00eaa6c>] (do_filp_open) from [<c00dc29c>] (do_sys_open+0x114/0x1c0)
>> [   88.303699] [<c00dc29c>] (do_sys_open) from [<c000f8c0>] (ret_fast_syscall+0x0/0x3c)
>> [   88.311419] Code: e7905003 e3550000 0a00001f e5943014 (e7950003)
>> [   88.317573] ---[ end trace 9502799e3ea05a80 ]---
> However removal of "remove" callback helps... which could be expected...
> maybe it is not an error of the driver itself?


OK, looked it and found that we are registering the chip_irq as normal 
and interrupt as devm_*.
So when we remove, we delete the regmap_irq_chip first and then free 
irq. That is creating issue.

It seems I can not use the devm_requested_irq_thread() and need to use 
requested_irq_thread()  for proper sequence of freeing it.

Otherwise we need to add the devm_regmap_add_irq_chip() first and then 
use it.

I am spinning the series to use the requested_thread_irq() only to avoid 
unbind issue.

WARNING: multiple messages have this Message-ID (diff)
From: Laxman Dewangan <ldewangan@nvidia.com>
To: Krzysztof Kozlowski <k.kozlowski@samsung.com>,
	<lee.jones@linaro.org>, <alexandre.belloni@free-electrons.com>,
	<javier@osg.samsung.com>
Cc: <cw00.choi@samsung.com>, <linux-kernel@vger.kernel.org>,
	<rtc-linux@googlegroups.com>
Subject: [rtc-linux] Re: [PATCH V2 5/5] rtc: max77686: move initialisation of rtc regmap, irq chip locally
Date: Wed, 3 Feb 2016 18:43:23 +0530	[thread overview]
Message-ID: <56B1FCF3.2040307@nvidia.com> (raw)
In-Reply-To: <56B1E2F3.9010502@samsung.com>


On Wednesday 03 February 2016 04:52 PM, Krzysztof Kozlowski wrote:
> On 03.02.2016 19:45, Krzysztof Kozlowski wrote:
>> On 03.02.2016 18:30, Laxman Dewangan wrote:
>>>   
>>>   err_rtc:
>>> +	if (info->rtc)
>>> +		i2c_unregister_device(info->rtc);
>>> +	regmap_del_irq_chip(info->rtc_irq, info->rtc_irq_data);
>>> +
>> You should clean up in reverse order of allocation, so first
>> regmap_del_irq_chip then i2c_unregister_device. This
>> is a common pattern of cleaning up. Sometimes such order
>> is even necessary because of dependencies between
>> components... which is not a case here but still the
>> natural way is reversing the allocation code.

I made the change in other place (remove callback) but not this place. 
It is just missed by me. my bad..
Will do in next patch.

>> [   88.296055] [<c00eaa6c>] (do_filp_open) from [<c00dc29c>] (do_sys_open+0x114/0x1c0)
>> [   88.303699] [<c00dc29c>] (do_sys_open) from [<c000f8c0>] (ret_fast_syscall+0x0/0x3c)
>> [   88.311419] Code: e7905003 e3550000 0a00001f e5943014 (e7950003)
>> [   88.317573] ---[ end trace 9502799e3ea05a80 ]---
> However removal of "remove" callback helps... which could be expected...
> maybe it is not an error of the driver itself?


OK, looked it and found that we are registering the chip_irq as normal 
and interrupt as devm_*.
So when we remove, we delete the regmap_irq_chip first and then free 
irq. That is creating issue.

It seems I can not use the devm_requested_irq_thread() and need to use 
requested_irq_thread()  for proper sequence of freeing it.

Otherwise we need to add the devm_regmap_add_irq_chip() first and then 
use it.

I am spinning the series to use the requested_thread_irq() only to avoid 
unbind issue.


-- 
-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

  reply	other threads:[~2016-02-03 13:24 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-03  9:30 [PATCH V2 0/5] rtc: max77686: make max77686 rtc driver as IP driver Laxman Dewangan
2016-02-03  9:30 ` [rtc-linux] " Laxman Dewangan
2016-02-03  9:30 ` [PATCH V2 1/5] rtc: max77686: fix checkpatch error Laxman Dewangan
2016-02-03  9:30   ` [rtc-linux] " Laxman Dewangan
2016-02-03  9:30 ` [PATCH V2 2/5] rtc: max77686: use rtc regmap to access RTC registers Laxman Dewangan
2016-02-03  9:30   ` [rtc-linux] " Laxman Dewangan
2016-02-03  9:30 ` [PATCH V2 3/5] rtc: max77686: avoid reference of parent device info multiple palces Laxman Dewangan
2016-02-03  9:30   ` [rtc-linux] " Laxman Dewangan
2016-02-03 12:45   ` Javier Martinez Canillas
2016-02-03 12:45     ` [rtc-linux] " Javier Martinez Canillas
2016-02-03  9:30 ` [PATCH V2 4/5] mfd: max77686: do not set i2c client data for rtc i2c client Laxman Dewangan
2016-02-03  9:30   ` [rtc-linux] " Laxman Dewangan
2016-02-03 10:19   ` Krzysztof Kozlowski
2016-02-03 10:19     ` [rtc-linux] " Krzysztof Kozlowski
2016-02-03 12:47   ` Javier Martinez Canillas
2016-02-03 12:47     ` [rtc-linux] " Javier Martinez Canillas
2016-02-03  9:30 ` [PATCH V2 5/5] rtc: max77686: move initialisation of rtc regmap, irq chip locally Laxman Dewangan
2016-02-03  9:30   ` [rtc-linux] " Laxman Dewangan
2016-02-03 10:45   ` Krzysztof Kozlowski
2016-02-03 10:45     ` [rtc-linux] " Krzysztof Kozlowski
2016-02-03 11:22     ` Krzysztof Kozlowski
2016-02-03 11:22       ` [rtc-linux] " Krzysztof Kozlowski
2016-02-03 13:13       ` Laxman Dewangan [this message]
2016-02-03 13:13         ` Laxman Dewangan
2016-02-03 12:56   ` Javier Martinez Canillas
2016-02-03 12:56     ` [rtc-linux] " Javier Martinez Canillas

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=56B1FCF3.2040307@nvidia.com \
    --to=ldewangan@nvidia.com \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=cw00.choi@samsung.com \
    --cc=javier@osg.samsung.com \
    --cc=k.kozlowski@samsung.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rtc-linux@googlegroups.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.