Received: by 10.223.185.116 with SMTP id b49csp1781024wrg; Thu, 22 Feb 2018 03:03:45 -0800 (PST) X-Google-Smtp-Source: AH8x227Xa178LjJcDZYWkd0b9TU14Uz0cHM4Dllxx98s29/m22VsbIPQ5tDYBUANRnjqdsoXdyn2 X-Received: by 10.101.80.3 with SMTP id f3mr5463346pgo.242.1519297425430; Thu, 22 Feb 2018 03:03:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519297425; cv=none; d=google.com; s=arc-20160816; b=A9uVGhCLk2I35n4sWWNtcyIWboF5LEBT5eqrozi9gIaZqD+/iRqWQLH9xzL4DPnCAa 9a9kxOqlwCjvkSNT0Tz8WEfwv63cGysRURcPhf0BJEOCX2B8GS8r6zcagLMeN1deDlNB wbB4YPpqA12ccO/mDuTJyzU1hrKauwwJgRI7IOkZFzX24kSjZpRjSDR5cgBc6A0IXH/3 XWQYnneXudvz+O9NM3/RLJboUrVZKNkTL9Y/J9fg08tddg+G4yGnF/vwwei60v7TE9Ki zf751I0reJVh3nIbO8GYWbSl1Joubjqfz5cTrXJvUY98KrJY7RhSX97kCvkWuQrew/lj nQcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=UrG/RjsSHkBTkJDqGJLR4pYdV5n+xEYz9ee72HLIZtw=; b=pNN9siocwQwYBEzDRyid9afpKfjvhDmMcZMhvmAxAqboA24VPbsRMcIM70t/wUFLaQ 2Cvp48ZW1XQDwro604WxvtcYKbxQRpi8QY2aqJo2Z/ILF+FwLJPhxHlB1X/wXGFuRkVR GERtxBdLWrYpVIQBN2pJYj0sDjuCFySAMUoM3wN2V8/AFvOboZgqAq+6yt7gY3pUR/pg 9Jmtj51X2c+ixYTNAKx9vWhhkJCGPb0jwlyNVe8vjXyPUSsSPdb5L8otlf7ob6NT/8wN ImfX3c63O5BYaCXo/+RuHYVQNPLidBoiLOsCdkS3yq6P+YYMbVXbHeC6xl3pHdB3YMlO 39jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Aq+BQble; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l14si897692pgc.615.2018.02.22.03.03.30; Thu, 22 Feb 2018 03:03:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Aq+BQble; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753647AbeBVLB2 (ORCPT + 99 others); Thu, 22 Feb 2018 06:01:28 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:40170 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753627AbeBVLBZ (ORCPT ); Thu, 22 Feb 2018 06:01:25 -0500 Received: by mail-lf0-f66.google.com with SMTP id 37so6785338lfs.7; Thu, 22 Feb 2018 03:01:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=UrG/RjsSHkBTkJDqGJLR4pYdV5n+xEYz9ee72HLIZtw=; b=Aq+BQbleApAhdZVTct4VRQjIrIQX4ElEi8vCQTnaqNO4wELkQdMpcxo4HVADL83Y33 MHqQMeRdxb/McOLQBdD+bxEeQOEGCN6HJxV5g8UPQQ3vbF01NzxJwk7lOYgSa4XipuZh lWD3qO29D5C9QtfYWn2+S/cagCtFV4W6H9sl9C4hCafxwwM+ggs96bbFEO4u3r6sDKx1 bY8oT46w4Jkc1hPucPo6Ak0BOEGTD/qMcX+n2GtupE3cXSpW0jEiHdkPdSMUeq2IMm6+ 5OIiZPScCz8hDyia8XN+RSjW91Y/hpSo2JJGSUoge8UpBdlJEXuZMy16zsOXfwL1C9fw fjlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=UrG/RjsSHkBTkJDqGJLR4pYdV5n+xEYz9ee72HLIZtw=; b=bO/MPfexy5XJmL3uikAgPN64i3VjPFa+1ksu3qcNUJNf+g1snmqHuJ4jC1E426VCp5 qjHpixXK/rhC/qMquswvkjqsXYPGbGi3paIJNXvVePEybRgRrgS0MVsaVNOu+IGq06fD zz8GBEh5hh8YqU/vuJtNt15AO70tkYC+Vp3OxKYbINA9rfiOM9TpekQ9lRjLRVlj1snc uWBd3kE3dwd1WgAOJVhXyka/jPz0Gr1T2OQJwq8XgKd7qAWhb59caq0GedsBEieK4EE1 LxHwBl9A4x5eQJo4nAc1Ct7LaeU1iThHe2W5XyrfBgY9n2mV1Lza4KNFgLJma5lNw9lh +9Fw== X-Gm-Message-State: APf1xPC02BTc6rFoJOova4dy72Z5XUZ6wMRyKJqSgKo47IDf5yeutvvz QjIiWhFWeZ0JAQBzii5xmUutrBbSK48ZEna1UjU= X-Received: by 10.25.155.211 with SMTP id d202mr4746940lfe.125.1519297283022; Thu, 22 Feb 2018 03:01:23 -0800 (PST) MIME-Version: 1.0 Received: by 10.25.72.134 with HTTP; Thu, 22 Feb 2018 03:01:22 -0800 (PST) In-Reply-To: References: <1519221027-4028-2-git-send-email-radoslaw.pietrzyk@gmail.com> From: =?UTF-8?Q?Rados=C5=82aw_Pietrzyk?= Date: Thu, 22 Feb 2018 12:01:22 +0100 Message-ID: Subject: Re: [1/2] ARM: irqchip: stm32: Optimizes and cleans up stm32-exti irq_domain To: Ludovic BARRE Cc: Thomas Gleixner , Jason Cooper , Marc Zyngier , Maxime Coquelin , Alexandre Torgue , Linus Walleij , Benjamin Gaignard , Philipp Zabel , open list , "moderated list:ARM/STM32 ARCHITECTURE" , linux-gpio@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ludovic, I have tested on stm32f429-disco and it works without a problem. handle_edge_irq is not used in current implementation because it is substituted by handle_simple_irq in an alloc callback either way which causes that irq_ack callback is not invoked as well (acking is done in chained handler). 2018-02-22 11:55 GMT+01:00 Ludovic BARRE : > Hi Radek > > I've tested your change on stm32h743i-eval.dts board > and gpio-keys tests are not functional. > No interrupt occurs when we push or release button > (cat /proc/interrupt). > > Board: stm32h743i-eval.dts > Test description: gpio-keys (gpioc 13 => exti 13), with gpio or interrupt > property. > > comment below > > > On 02/21/2018 02:50 PM, radek wrote: >> >> - allocates generic chip with handle_simple_irq >> which simplifies irq_domain_ops.alloc callback >> - removes ack register from generic chip which is not used for >> handle_simple_irq as acking is done in a chained handler >> - removes unneeded irq_domain_ops.xlate callback >> >> Signed-off-by: Radoslaw Pietrzyk >> --- >> drivers/irqchip/irq-stm32-exti.c | 10 +--------- >> 1 file changed, 1 insertion(+), 9 deletions(-) >> >> diff --git a/drivers/irqchip/irq-stm32-exti.c >> b/drivers/irqchip/irq-stm32-exti.c >> index 36f0fbe..42e74e3 100644 >> --- a/drivers/irqchip/irq-stm32-exti.c >> +++ b/drivers/irqchip/irq-stm32-exti.c >> @@ -176,16 +176,12 @@ static int stm32_irq_set_wake(struct irq_data *data, >> unsigned int on) >> static int stm32_exti_alloc(struct irq_domain *d, unsigned int virq, >> unsigned int nr_irqs, void *data) >> { >> - struct irq_chip_generic *gc; >> struct irq_fwspec *fwspec = data; >> irq_hw_number_t hwirq; >> hwirq = fwspec->param[0]; >> - gc = irq_get_domain_generic_chip(d, hwirq); >> irq_map_generic_chip(d, virq, hwirq); >> - irq_domain_set_info(d, virq, hwirq, &gc->chip_types->chip, gc, >> - handle_simple_irq, NULL, NULL); >> return 0; >> } >> @@ -200,7 +196,6 @@ static void stm32_exti_free(struct irq_domain *d, >> unsigned int virq, >> struct irq_domain_ops irq_exti_domain_ops = { >> .map = irq_map_generic_chip, >> - .xlate = irq_domain_xlate_onetwocell, >> .alloc = stm32_exti_alloc, >> .free = stm32_exti_free, >> }; >> @@ -231,7 +226,7 @@ __init stm32_exti_init(const struct stm32_exti_bank >> **stm32_exti_banks, >> } >> ret = irq_alloc_domain_generic_chips(domain, IRQS_PER_BANK, 1, >> "exti", >> - handle_edge_irq, clr, 0, 0); >> + handle_simple_irq, clr, 0, >> 0); > > > EXTI hardware block is trigged on pulse event rising or failing edge. > Why do you change to handle_simple_irq ? > >> if (ret) { >> pr_err("%pOF: Could not allocate generic interrupt >> chip.\n", >> node); >> @@ -246,13 +241,10 @@ __init stm32_exti_init(const struct stm32_exti_bank >> **stm32_exti_banks, >> gc->reg_base = base; >> gc->chip_types->type = IRQ_TYPE_EDGE_BOTH; >> - gc->chip_types->chip.irq_ack = irq_gc_ack_set_bit; >> gc->chip_types->chip.irq_mask = irq_gc_mask_clr_bit; >> gc->chip_types->chip.irq_unmask = irq_gc_mask_set_bit; >> gc->chip_types->chip.irq_set_type = stm32_irq_set_type; >> gc->chip_types->chip.irq_set_wake = stm32_irq_set_wake; >> - gc->chip_types->regs.ack = stm32_bank->pr_ofst; >> - gc->chip_types->regs.mask = stm32_bank->imr_ofst; >> gc->private = (void *)stm32_bank; >> /* Determine number of irqs supported */ >> > > BR > Ludo