From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Rafael J. Wysocki" Subject: Re: [PATCH] ACPI / GED: unregister interrupts during shutdown Date: Thu, 7 Dec 2017 18:10:23 +0100 Message-ID: References: <1512507705-2411-1-git-send-email-okaya@codeaurora.org> <20171207082958.GA11882@kroah.com> <2960222.F3CtrQ5k26@aspire.rjw.lan> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from mail-oi0-f68.google.com ([209.85.218.68]:33185 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752822AbdLGRKY (ORCPT ); Thu, 7 Dec 2017 12:10:24 -0500 In-Reply-To: Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Sinan Kaya Cc: "Rafael J. Wysocki" , Greg Kroah-Hartman , "Rafael J. Wysocki" , ACPI Devel Maling List , Timur Tabi , linux-arm-msm@vger.kernel.org, "linux-arm-kernel@lists.infradead.org" , Linux Kernel Mailing List On Thu, Dec 7, 2017 at 3:52 PM, Sinan Kaya 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932358AbdLGRK2 (ORCPT ); Thu, 7 Dec 2017 12:10:28 -0500 Received: from mail-oi0-f68.google.com ([209.85.218.68]:33185 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752822AbdLGRKY (ORCPT ); Thu, 7 Dec 2017 12:10:24 -0500 X-Google-Smtp-Source: AGs4zMaIwIaTxbjVQYTOlkgK9Zd2YKrs7xxOZOfuMwzxI+AJfRxiTfgQRnPK9Fa3Nfjgy60u9L0ApA0ipiSAxqW2gXo= MIME-Version: 1.0 In-Reply-To: References: <1512507705-2411-1-git-send-email-okaya@codeaurora.org> <20171207082958.GA11882@kroah.com> <2960222.F3CtrQ5k26@aspire.rjw.lan> From: "Rafael J. Wysocki" Date: Thu, 7 Dec 2017 18:10:23 +0100 X-Google-Sender-Auth: I5V7JgMA8PJxLVxnyqnemSXHqaQ Message-ID: Subject: Re: [PATCH] ACPI / GED: unregister interrupts during shutdown To: Sinan Kaya Cc: "Rafael J. Wysocki" , Greg Kroah-Hartman , "Rafael J. Wysocki" , ACPI Devel Maling List , Timur Tabi , linux-arm-msm@vger.kernel.org, "linux-arm-kernel@lists.infradead.org" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 7, 2017 at 3:52 PM, Sinan Kaya 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: rafael@kernel.org (Rafael J. Wysocki) Date: Thu, 7 Dec 2017 18:10:23 +0100 Subject: [PATCH] ACPI / GED: unregister interrupts during shutdown In-Reply-To: References: <1512507705-2411-1-git-send-email-okaya@codeaurora.org> <20171207082958.GA11882@kroah.com> <2960222.F3CtrQ5k26@aspire.rjw.lan> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Thu, Dec 7, 2017 at 3:52 PM, Sinan Kaya 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