From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755323AbcITP3h (ORCPT ); Tue, 20 Sep 2016 11:29:37 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:36567 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753182AbcITP3e (ORCPT ); Tue, 20 Sep 2016 11:29:34 -0400 Subject: Re: [PATCH v5 2/9] drivers: irqchip: Add STM32 external interrupts support To: Thomas Gleixner References: <1473432124-6784-1-git-send-email-alexandre.torgue@st.com> <1473432124-6784-3-git-send-email-alexandre.torgue@st.com> <6941f61d-0b33-4108-0135-b11887cd0488@st.com> <39c4ceee-7e05-ebfd-2ea0-3c4e1c4ea619@st.com> <053a37f4-aa10-46ea-f477-8ae55bb5773f@st.com> CC: Mark Rutland , , Daniel Thompson , Jason Cooper , , Marc Zyngier , , Linus Walleij , , , Rob Herring , Maxime Coquelin , , From: Alexandre Torgue Message-ID: <2095bf33-2940-3294-afd6-a28a48762569@st.com> Date: Tue, 20 Sep 2016 17:28:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.48.0.2] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-09-20_06:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thomas, On 09/20/2016 04:02 PM, Thomas Gleixner wrote: > On Tue, 20 Sep 2016, Alexandre Torgue wrote: >> On 09/20/2016 02:44 PM, Thomas Gleixner wrote: >>> Free will be called when a interrupt in the child domain is torn down, >>> i.e. when irq_domain_free_irqs() is called. And it will be called for both >>> domains like the alloc callback is invoked on both domains via >>> irq_domain_alloc_irqs(). >> >> Thanks Thomas for this clarification (I'm sure now that we need .free >> callbacks). >> irq_domain_free_irqs() is called in 2 scenario: >> 1- when issue occurs in irq_create_fwspec_mapping() >> 2- when irq_dispose_mapping() is called >> >> Case 2 is the one I tested some times ago. In this case, I need to mask >> interrupts in .free callback of EXTI (parent) domain to avoid spurious >> interrupts. > > And why would irq_dispose_mapping() be called on an unmasked, i.e. active, > interrupt? The masking is just papering over that. Ok. So my test was wrong and irq_dispose_mapping() has to be called when irq is masked (for example just after free_irq()). For sure in this case the mask inside exti free callback has no sens (catch :)) I will change .free callback by: static void stm32_exti_free(struct irq_domain *d, unsigned int virq, unsigned int nr_irqs) { struct irq_data *data = irq_domain_get_irq_data(d, virq); irq_domain_reset_irq_data(data); } so if you agree I will resend only patches concerning stm32 exti driver [1],[2],[3],[4] Thanks for your time. alex > > Thanks, > > tglx >