From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932295AbdHVIUv (ORCPT ); Tue, 22 Aug 2017 04:20:51 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:39916 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932077AbdHVIUq (ORCPT ); Tue, 22 Aug 2017 04:20:46 -0400 Subject: Re: [PATCH v2] irqchip: uniphier-aidet: add UniPhier AIDET irqchip driver To: Masahiro Yamada Cc: Thomas Gleixner , Jason Cooper , Masami Hiramatsu , Jassi Brar , Mauro Carvalho Chehab , Hans Verkuil , Randy Dunlap , devicetree@vger.kernel.org, Linux Kernel Mailing List , "David S. Miller" , Rob Herring , Greg Kroah-Hartman , Mark Rutland , linux-arm-kernel References: <1503309663-2742-1-git-send-email-yamada.masahiro@socionext.com> From: Marc Zyngier Organization: ARM Ltd Message-ID: <046d0078-bb9d-f043-b5b4-481c695e2bea@arm.com> Date: Tue, 22 Aug 2017 09:20:41 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22/08/17 03:03, Masahiro Yamada wrote: > Hi Mark, > > > 2017-08-21 19:25 GMT+09:00 Marc Zyngier : > >>> +static struct irq_chip uniphier_aidet_irq_chip = { >>> + .name = "AIDET", >>> + .irq_mask = irq_chip_mask_parent, >>> + .irq_unmask = irq_chip_unmask_parent, >>> + .irq_eoi = irq_chip_eoi_parent, >>> + .irq_set_type = uniphier_aidet_irq_set_type, >> >> Is this irqchip only used in a uniprocessor system? If not, how is the >> interrupt affinity managed without a irq_set_affinity callback? >> > > > After consideration, some questions popped up. > > > > We can set other hooks, for example, .irq_{enable,disable} if we like. > > .irq_enable = irq_chip_enable_parent, > .irq_disable = irq_chip_disable_parent, > > > I know the parent (GIC) implements unmask/mask instead of enable/disable, > but this is also out of the scope of this driver. > > I am not familiar with the difference between unmask/mask and enable/disable. > IIUC, the difference is that > if enable/disable hooks are missing, IRQs are masked lazily. That's a rather good thing. Disabling interrupts lazily is a net performance gain when you you have to repeatedly mask/unmask interrupts. > If a child irqchip implemented enable/disable, > IRQs would be masked immediately. So, in irq-domain hierarchy, > a child irqchip need to have a good insight about its parent > which is be better, unmask/mask or enable/disable. Not necessarily. irq_chip_enable_parent will call unmask if enable is not implemented in the parent. But you'll loose the benefit of lazy masking of interrupts routed through this controller. There are many other things that are *much* worse, like the need to implement a irq_eoi callback even if the irqchip has no such concept. >> Nit: please use irq_domain_create_hierarchy. > > I'd like to know your intention about your commit > 2a5e9a072da6469a37d1f0b1577416f51223c280 > > Is that mean, irq_domain_add_hierarchy will be deprecated > some time in the future? That's the intent, as we're moving towards a firmware-agnostic irq_domain layer. Think of it as a deprecated interface. > If I grep under drivers/irqchip/, > most drivers are currently using irq_domain_add_hierarchy(), > and this provides a shorter form for DT-based drivers. Yes, we have a lot of legacy, and I don't always catch new additions. Thanks, M. -- Jazz is not dead. It just smells funny...