From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sinan Kaya Subject: Re: [PATCH] ACPI / GED: unregister interrupts during shutdown Date: Wed, 6 Dec 2017 11:55:41 -0500 Message-ID: References: <1512507705-2411-1-git-send-email-okaya@codeaurora.org> <0b661eec-f9c7-7818-ad09-f3d488adcefe@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Language: en-US Sender: linux-acpi-owner@vger.kernel.org To: "Rafael J. Wysocki" Cc: ACPI Devel Maling List , Timur Tabi , "Rafael J. Wysocki" , linux-arm-msm@vger.kernel.org, "linux-arm-kernel@lists.infradead.org" , Linux Kernel Mailing List List-Id: linux-arm-msm@vger.kernel.org On 12/6/2017 11:41 AM, Rafael J. Wysocki wrote: > On Wed, Dec 6, 2017 at 5:11 PM, Sinan Kaya wrote: >> On 12/6/2017 9:57 AM, Sinan Kaya wrote: >>>> Yes, it should, so I'm not sure why you need the list in the first place. >>>> >>>> Also it looks like something along the lines of devres_release_all() >>>> should be sufficient. >>> Good suggestion, let me test this. >>> >> >> I tried to pull the code into GED but the API is not public. I also looked >> at how it is used. I was afraid to mess up with the internals of base.c by >> calling devres_release_all() externally first and by the driver framework >> next. I moved away from this approach. > > Are you sure it is called by the core in the shutdown path? Sorry, I was thinking about a general case not the shutdown path. If we open this API and have device drivers call it from arbitrary places; then we could be opening a new can of worms that show up during device driver removal. If you feel confident (I'm not), I can pursue this approach too. > >> I just fixed the function rename and changed the dev_info() to dev_dbg(). > > And why do you need the list? > > ged_shutdown() will be called for every device for which ged_probe() > has been called. The problem I had here is that =the last argument is the context pointer when I call devm_free_irq(). If I don't pass the same context I used during IRQ registration, then the IRQ free API fails. That's why, I needed to keep the event pointer around until the IRQ free is called. -- Sinan Kaya Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752559AbdLFQzq (ORCPT ); Wed, 6 Dec 2017 11:55:46 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:38318 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752079AbdLFQzo (ORCPT ); Wed, 6 Dec 2017 11:55:44 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 5375260398 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=okaya@codeaurora.org Subject: Re: [PATCH] ACPI / GED: unregister interrupts during shutdown To: "Rafael J. Wysocki" Cc: ACPI Devel Maling List , Timur Tabi , "Rafael J. Wysocki" , linux-arm-msm@vger.kernel.org, "linux-arm-kernel@lists.infradead.org" , Linux Kernel Mailing List References: <1512507705-2411-1-git-send-email-okaya@codeaurora.org> <0b661eec-f9c7-7818-ad09-f3d488adcefe@codeaurora.org> From: Sinan Kaya Message-ID: Date: Wed, 6 Dec 2017 11:55:41 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/6/2017 11:41 AM, Rafael J. Wysocki wrote: > On Wed, Dec 6, 2017 at 5:11 PM, Sinan Kaya wrote: >> On 12/6/2017 9:57 AM, Sinan Kaya wrote: >>>> Yes, it should, so I'm not sure why you need the list in the first place. >>>> >>>> Also it looks like something along the lines of devres_release_all() >>>> should be sufficient. >>> Good suggestion, let me test this. >>> >> >> I tried to pull the code into GED but the API is not public. I also looked >> at how it is used. I was afraid to mess up with the internals of base.c by >> calling devres_release_all() externally first and by the driver framework >> next. I moved away from this approach. > > Are you sure it is called by the core in the shutdown path? Sorry, I was thinking about a general case not the shutdown path. If we open this API and have device drivers call it from arbitrary places; then we could be opening a new can of worms that show up during device driver removal. If you feel confident (I'm not), I can pursue this approach too. > >> I just fixed the function rename and changed the dev_info() to dev_dbg(). > > And why do you need the list? > > ged_shutdown() will be called for every device for which ged_probe() > has been called. The problem I had here is that =the last argument is the context pointer when I call devm_free_irq(). If I don't pass the same context I used during IRQ registration, then the IRQ free API fails. That's why, I needed to keep the event pointer around until the IRQ free is called. -- Sinan Kaya Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. From mboxrd@z Thu Jan 1 00:00:00 1970 From: okaya@codeaurora.org (Sinan Kaya) Date: Wed, 6 Dec 2017 11:55:41 -0500 Subject: [PATCH] ACPI / GED: unregister interrupts during shutdown In-Reply-To: References: <1512507705-2411-1-git-send-email-okaya@codeaurora.org> <0b661eec-f9c7-7818-ad09-f3d488adcefe@codeaurora.org> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 12/6/2017 11:41 AM, Rafael J. Wysocki wrote: > On Wed, Dec 6, 2017 at 5:11 PM, Sinan Kaya wrote: >> On 12/6/2017 9:57 AM, Sinan Kaya wrote: >>>> Yes, it should, so I'm not sure why you need the list in the first place. >>>> >>>> Also it looks like something along the lines of devres_release_all() >>>> should be sufficient. >>> Good suggestion, let me test this. >>> >> >> I tried to pull the code into GED but the API is not public. I also looked >> at how it is used. I was afraid to mess up with the internals of base.c by >> calling devres_release_all() externally first and by the driver framework >> next. I moved away from this approach. > > Are you sure it is called by the core in the shutdown path? Sorry, I was thinking about a general case not the shutdown path. If we open this API and have device drivers call it from arbitrary places; then we could be opening a new can of worms that show up during device driver removal. If you feel confident (I'm not), I can pursue this approach too. > >> I just fixed the function rename and changed the dev_info() to dev_dbg(). > > And why do you need the list? > > ged_shutdown() will be called for every device for which ged_probe() > has been called. The problem I had here is that =the last argument is the context pointer when I call devm_free_irq(). If I don't pass the same context I used during IRQ registration, then the IRQ free API fails. That's why, I needed to keep the event pointer around until the IRQ free is called. -- Sinan Kaya Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.