All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Sinan Kaya <okaya@codeaurora.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Timur Tabi <timur@codeaurora.org>,
	linux-arm-msm@vger.kernel.org,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ACPI / GED: unregister interrupts during shutdown
Date: Thu, 7 Dec 2017 18:10:23 +0100	[thread overview]
Message-ID: <CAJZ5v0g7APeWHkL+c5LT7sx4xpZn=TxCSpt5y=DU7yOiyUkNRg@mail.gmail.com> (raw)
In-Reply-To: <e17a3ac6-aac3-09ee-7307-01ddc780507a@codeaurora.org>

On Thu, Dec 7, 2017 at 3:52 PM, Sinan Kaya <okaya@codeaurora.org> wrote:
> Rafael,
>
> On 12/7/2017 8:00 AM, Rafael J. Wysocki wrote:
>>> Just don't use devm_request_threaded_irq()?  :)
>>>
>>> Seriously, those are just "helper" functions if your code happens to
>>> follow the pattern they provide, if not, then don't use them, it's not
>>> that hard to provide the correct code to unwind things properly by "open
>>> coding" this logic as needed.
>>>
>>> The devm_*irq() functions are known for not being able to be used all of
>>> the time for lots of shutdown and cleanup issues, this isn't the first
>>> time it has happened, which is why we are very careful when taking
>>> "cleanup" patches that use those functions.
>> I see, thanks for the clarification.
>>
>> OK, we'll need to rework the driver somewhat, then.
>
> Even if we got rid of devm_*irq() functions, I see that the free_irq() function
> requires dev_id argument.
>
>          * There can be multiple actions per IRQ descriptor, find the right
>          * one based on the dev_id:
>
> I still need to keep track of the dev_ids attached to request_irq() functions.

Right.

> My take away from the discussion is:
> 1. don't use devm family of functions for IRQ registration/free
> 2. still keep track of the events
> 3. call free_irq on shutdown.

Yes.  And on remove too.

Thanks,
Rafael

WARNING: multiple messages have this Message-ID (diff)
From: rafael@kernel.org (Rafael J. Wysocki)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ACPI / GED: unregister interrupts during shutdown
Date: Thu, 7 Dec 2017 18:10:23 +0100	[thread overview]
Message-ID: <CAJZ5v0g7APeWHkL+c5LT7sx4xpZn=TxCSpt5y=DU7yOiyUkNRg@mail.gmail.com> (raw)
In-Reply-To: <e17a3ac6-aac3-09ee-7307-01ddc780507a@codeaurora.org>

On Thu, Dec 7, 2017 at 3:52 PM, Sinan Kaya <okaya@codeaurora.org> wrote:
> Rafael,
>
> On 12/7/2017 8:00 AM, Rafael J. Wysocki wrote:
>>> Just don't use devm_request_threaded_irq()?  :)
>>>
>>> Seriously, those are just "helper" functions if your code happens to
>>> follow the pattern they provide, if not, then don't use them, it's not
>>> that hard to provide the correct code to unwind things properly by "open
>>> coding" this logic as needed.
>>>
>>> The devm_*irq() functions are known for not being able to be used all of
>>> the time for lots of shutdown and cleanup issues, this isn't the first
>>> time it has happened, which is why we are very careful when taking
>>> "cleanup" patches that use those functions.
>> I see, thanks for the clarification.
>>
>> OK, we'll need to rework the driver somewhat, then.
>
> Even if we got rid of devm_*irq() functions, I see that the free_irq() function
> requires dev_id argument.
>
>          * There can be multiple actions per IRQ descriptor, find the right
>          * one based on the dev_id:
>
> I still need to keep track of the dev_ids attached to request_irq() functions.

Right.

> My take away from the discussion is:
> 1. don't use devm family of functions for IRQ registration/free
> 2. still keep track of the events
> 3. call free_irq on shutdown.

Yes.  And on remove too.

Thanks,
Rafael

  reply	other threads:[~2017-12-07 17:10 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-05 21:01 [PATCH] ACPI / GED: unregister interrupts during shutdown Sinan Kaya
2017-12-05 21:01 ` Sinan Kaya
2017-12-05 22:18 ` Rafael J. Wysocki
2017-12-05 22:18   ` Rafael J. Wysocki
2017-12-05 22:18   ` Rafael J. Wysocki
2017-12-06 13:24   ` Sinan Kaya
2017-12-06 13:24     ` Sinan Kaya
2017-12-06 13:24     ` Sinan Kaya
2017-12-06 13:37     ` Rafael J. Wysocki
2017-12-06 13:37       ` Rafael J. Wysocki
2017-12-06 13:37       ` Rafael J. Wysocki
2017-12-06 14:57       ` Sinan Kaya
2017-12-06 14:57         ` Sinan Kaya
2017-12-06 14:57         ` Sinan Kaya
2017-12-06 16:11         ` Sinan Kaya
2017-12-06 16:11           ` Sinan Kaya
2017-12-06 16:11           ` Sinan Kaya
2017-12-06 16:41           ` Rafael J. Wysocki
2017-12-06 16:41             ` Rafael J. Wysocki
2017-12-06 16:41             ` Rafael J. Wysocki
2017-12-06 16:55             ` Sinan Kaya
2017-12-06 16:55               ` Sinan Kaya
2017-12-06 16:55               ` Sinan Kaya
2017-12-06 17:16               ` Rafael J. Wysocki
2017-12-06 17:16                 ` Rafael J. Wysocki
2017-12-06 17:16                 ` Rafael J. Wysocki
2017-12-06 23:19                 ` Rafael J. Wysocki
2017-12-06 23:19                   ` Rafael J. Wysocki
2017-12-06 23:19                   ` Rafael J. Wysocki
2017-12-07  8:29                   ` Greg Kroah-Hartman
2017-12-07  8:29                     ` Greg Kroah-Hartman
2017-12-07  8:29                     ` Greg Kroah-Hartman
2017-12-07 13:00                     ` Rafael J. Wysocki
2017-12-07 13:00                       ` Rafael J. Wysocki
2017-12-07 13:00                       ` Rafael J. Wysocki
2017-12-07 14:52                       ` Sinan Kaya
2017-12-07 14:52                         ` Sinan Kaya
2017-12-07 14:52                         ` Sinan Kaya
2017-12-07 17:10                         ` Rafael J. Wysocki [this message]
2017-12-07 17:10                           ` Rafael J. Wysocki
2017-12-07 17:10                           ` Rafael J. Wysocki
2017-12-07 17:18                           ` Sinan Kaya
2017-12-07 17:18                             ` Sinan Kaya
2017-12-07 17:18                             ` Sinan Kaya

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='CAJZ5v0g7APeWHkL+c5LT7sx4xpZn=TxCSpt5y=DU7yOiyUkNRg@mail.gmail.com' \
    --to=rafael@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=okaya@codeaurora.org \
    --cc=rjw@rjwysocki.net \
    --cc=timur@codeaurora.org \
    /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.