From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751260AbdGOXrQ (ORCPT ); Sat, 15 Jul 2017 19:47:16 -0400 Received: from smtp2-g21.free.fr ([212.27.42.2]:54938 "EHLO smtp2-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751198AbdGOXrP (ORCPT ); Sat, 15 Jul 2017 19:47:15 -0400 Subject: Re: [RFC PATCH v2] irqchip: Add support for tango interrupt router From: Mason To: Marc Zyngier Cc: Thomas Petazzoni , Thomas Gleixner , Jason Cooper , Mark Rutland , Thibaud Cornic , LKML , Linux ARM References: <657580dd-0cfe-e377-e425-0deabf6d20c3@free.fr> <20170606175219.34ef62b9@free-electrons.com> Message-ID: <24f34220-a017-f4e0-b72e-d1fdb014c0e1@free.fr> Date: Sun, 16 Jul 2017 01:46:58 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/07/2017 15:06, Mason wrote: > I have two remaining issues: > > 1) In the ISR, I get the hwirq from the GIC. What is the > API to translate that to the SPI? I'm currently just > subtracting 32. gic_set_type() in drivers/irqchip/irq-gic.c /* SPIs have restrictions on the supported types */ if (gicirq >= 32 && type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING) return -EINVAL; gic_irq_domain_translate() in the same file: /* Get the interrupt number and add 16 to skip over SGIs */ *hwirq = fwspec->param[1] + 16; /* * For SPIs, we need to add 16 more to get the GIC irq * ID number */ if (!fwspec->param[0]) *hwirq += 16; So it seems "acceptable" to compute spi = d->hwirq - 32; > 2) I'm currently using a single domain, with a > handle_simple_irq domain handler. That's probably > wrong. Should I define two domains, one for edge > IRQs and one for level IRQs, and use the appropriate > handler? Should both domain have 128 entries? > (I.e. are they indexed by the hwirq?) > And should I use linear or tree? I will read this again carefully: https://www.kernel.org/doc/Documentation/IRQ-domain.txt Regards.