From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754213AbdHUQN2 (ORCPT ); Mon, 21 Aug 2017 12:13:28 -0400 Received: from smtp5-g21.free.fr ([212.27.42.5]:62349 "EHLO smtp5-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753959AbdHUQN0 (ORCPT ); Mon, 21 Aug 2017 12:13:26 -0400 Subject: Re: [PATCH v6] irqchip: Add support for tango interrupt router From: Mason To: Marc Zyngier , Thomas Gleixner , Jason Cooper Cc: Thomas Petazzoni , Mark Rutland , Thibaud Cornic , LKML , Linux ARM References: <657580dd-0cfe-e377-e425-0deabf6d20c3@free.fr> <20170606175219.34ef62b9@free-electrons.com> <24f34220-a017-f4e0-b72e-d1fdb014c0e1@free.fr> <9f384711-eef0-5117-b89c-9d2dc16e5ae5@free.fr> <473118cd-20dc-3534-d0d8-88799e3d2c3b@free.fr> <21670cea-beaf-8a41-84fb-f3c892527b0e@free.fr> Message-ID: Date: Mon, 21 Aug 2017 18:13:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.1 MIME-Version: 1.0 In-Reply-To: <21670cea-beaf-8a41-84fb-f3c892527b0e@free.fr> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20/08/2017 19:22, Mason wrote: > On 07/08/2017 14:47, Marc Zyngier wrote: > >> On 01/08/17 17:56, Mason wrote: >> >>> +static int tango_set_type(struct irq_data *data, uint flow_type) >>> +{ >>> + return 0; >> >> What does this mean? Either you can do a set-type (and you do it), or >> you cannot, and you fail. At least you check that what you're asked to >> do matches the configuration. > > IIRC, __irq_set_trigger() barfed when I did it differently. The way the problem manifests is that /proc/interrupts cannot determine the trigger types. (I think the issue might be deeper than this cosmetic aspect.) # cat /proc/interrupts CPU0 CPU1 CPU2 CPU3 40: 1832 333 2378 471 GIC-0 29 Edge twd 41: 487 0 0 0 mapper 1 Edge serial 44: 50 0 0 0 mapper 38 Edge eth0 51: 3 0 0 0 mapper 37 Edge phy_interrupt (1 and 38 are actually level interrupts.) ret = sprintf(buf, "%s\n", irqd_is_level_type(&desc->irq_data) ? "level" : "edge"); __irq_set_trigger() is a no-op when irq_set_type is not implemented. But if the callback returns 0, then __irq_set_trigger() eventually calls irqd_clear(&desc->irq_data, IRQD_TRIGGER_MASK); irqd_set(&desc->irq_data, flags); Should I be calling irqd_get_trigger_type() myself earlier, perhaps in the domain alloc function? That's what drivers/irqchip/irq-pic32-evic.c seems to do. The comment seems to state otherwise though: /* * Must only be called inside irq_chip.irq_set_type() functions. */ static inline void irqd_set_trigger_type(struct irq_data *d, u32 type) Regards.