From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754601AbcFPMkn (ORCPT ); Thu, 16 Jun 2016 08:40:43 -0400 Received: from smtpoutz28.laposte.net ([194.117.213.103]:39114 "EHLO smtp.laposte.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754119AbcFPMkl (ORCPT ); Thu, 16 Jun 2016 08:40:41 -0400 Subject: Re: Using irq-crossbar.c To: Marc Zyngier References: <575ADEBA.2030202@laposte.net> <575AE52E.9020005@arm.com> <575ED54B.7080905@laposte.net> <575EDE48.6090006@arm.com> <576032D3.5050108@laposte.net> <5760332B.1060904@laposte.net> Cc: Thomas Gleixner , LKML , Grygorii Strashko , Mason , =?UTF-8?B?TcOlbnMgUnVsbGfDpXJk?= From: Sebastian Frias Message-ID: <57629E1E.6080205@laposte.net> Date: Thu, 16 Jun 2016 14:39:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <5760332B.1060904@laposte.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-VR-SrcIP: 83.142.147.193 X-VR-FullState: 0 X-VR-Score: -100 X-VR-Cause-1: gggruggvucftvghtrhhoucdtuddrfeekledrkeekgdehhecutefuodetggdotefrodftvfcurfhrohhf X-VR-Cause-2: ihhlvgemucfntefrqffuvffgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhs X-VR-Cause-3: ucdlqddutddtmdenucfjughrpefuvfhfhffkffgfgggjtgfgsehtjegrtddtfeejnecuhfhrohhmpefu X-VR-Cause-4: vggsrghsthhirghnucfhrhhirghsuceoshhfkeegsehlrghpohhsthgvrdhnvghtqeenucfkphepkeef X-VR-Cause-5: rddugedvrddugeejrdduleefnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhhtpdhhvghloheplgdu X-VR-Cause-6: jedvrddvjedrtddrvddugegnpdhinhgvthepkeefrddugedvrddugeejrdduleefpdhmrghilhhfrhho X-VR-Cause-7: mhepshhfkeegsehlrghpohhsthgvrdhnvghtpdhrtghpthhtohepmhgrrhgtrdiihihnghhivghrsegr X-VR-Cause-8: rhhmrdgtohhm X-VR-AvState: No X-VR-State: 0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Marc, On 06/14/2016 06:39 PM, Sebastian Frias wrote: > On 06/14/2016 06:37 PM, Sebastian Frias wrote: >>>>> Also, without seeing the code, >>>>> it is pretty difficult to make any meaningful comment... >>>> >>>> Base code is either 4.7rc1 or 4.4. >>>> The irq-crossbar code is not much different from TI, but you can find it attached. >>> >>> Please post it separately (and inline), the email client I have here >>> makes it hard to review attached patches. >> >> Ok, I'll post it in a separate email and inline. >> > > Here it goes: > > > IRQCHIP_DECLARE(tangox_intc, "sigma,smp-irq-mux", tangox_of_irq_mux_init); > > I have tested the code, and aside from the missing #interrupt-cells in the DT that you pointed out, it seems it is working (devices using IRQ appear functional), here's some log: tangox_irq_mux_domain_translate(): domain 0xcf805000 tangox_irq_mux_domain_translate(): hwirq 1 (0x1) type 4 (0x4) tangox_irq_mux_domain_alloc(): domain 0xcf805000, virq 18 (0x12) nr_irqs 1 tangox_allocate_gic_irq(): domain 0xcf805000, virq 18 (0x12) hwirq 1 (0x1) tangox_setup_irq_route(): route irq 1 (@ 0xf006f804) => irq 23 tangox_irq_mux_domain_translate(): domain 0xcf805000 tangox_irq_mux_domain_translate(): hwirq 38 (0x26) type 4 (0x4) tangox_irq_mux_domain_alloc(): domain 0xcf805000, virq 19 (0x13) nr_irqs 1 tangox_allocate_gic_irq(): domain 0xcf805000, virq 19 (0x13) hwirq 38 (0x26) tangox_setup_irq_route(): route irq 38 (@ 0xf006f898) => irq 22 tangox_irq_mux_domain_translate(): domain 0xcf805000 tangox_irq_mux_domain_translate(): hwirq 67 (0x43) type 4 (0x4) tangox_irq_mux_domain_alloc(): domain 0xcf805000, virq 20 (0x14) nr_irqs 1 tangox_allocate_gic_irq(): domain 0xcf805000, virq 20 (0x14) hwirq 67 (0x43) tangox_setup_irq_route(): route irq 67 (@ 0xf006f90c) => irq 21 Since irq-tango_v2.c is similar to irq-crossbar.c from TI (since it is based on it), I was wondering what is the policy or recommendation in such cases? Should I attempt to merge the code (mainly the way to set up the registers) on irq-crossbar.c or should we consider irq-tango_v2.c to live its own life? NOTE: IMHO, irq-crossbar.c could benefit from clearer names for some DT properties, because "max_irqs" and "max-crossbar-sources" are not straight forward names for "mux_outputs" and "mux_inputs" (respectively) NOTE2: current irq-tango_v2.c code still has a 24 IRQ limitation since it is not using any API that would allow it to setup IRQ sharing. Thanks in advance. Best regards, Sebastian