From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3F236C54E41 for ; Sat, 9 Mar 2024 13:13:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1LG9eSMTv7q6jwRRiaOlxSZb3ru6CQDKi2KX5ayLl3Q=; b=hBO0PtfprkvET+ Q1v/Bub+LDvFnmmxtWLA+rKUY0eBcadATYtEeHc6RI88o/V+E0i84XTAUMbrtrBrSZVYmHsrGTPyW LsFTPPbeLhcw1P4VCdB8SpWHk8h8+TOx8Jf9EKXFGccxoaLOoglPQQ2PVh3dRm5MZwcwOo/Jfm5ho oGsANYPInLaVUkhFLU5m5gKCD389SWovfgz+zsm10ynQxfhtvq29+fju1qacQtOC78+Shgha9PxAa XwZH8FcmffynIijWmWWoJ+cZ8XSoidrV6OLYJIUEZkyrKDuHx4MIILkbmid1qxa9YEeJVi35Y2C3c icqQ0dp8kbXd/beyyJww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1riwVw-0000000DPBx-0cq2; Sat, 09 Mar 2024 13:13:24 +0000 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1riwVs-0000000DPBJ-1j5R for linux-arm-kernel@lists.infradead.org; Sat, 09 Mar 2024 13:13:22 +0000 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-5682f48532eso2363647a12.1 for ; Sat, 09 Mar 2024 05:13:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1709989994; x=1710594794; darn=lists.infradead.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Abv+15fdn0L/XDhBzoC17DusvY5uSXBbJbLmOstC0WQ=; b=FFp1X2WA6K9hnq9jKjbEuz42lGzMALqsjb7sglVjeClO6NVblPg6SUi4wKt4gKNYWa QY0dIliA0emBlffYCOlIepll/qi8hkcmk4e1x8BlAfe5VjeS9MsgsViXB14ZfGWYLK5+ QouPxRpifqJvLDk856DCd9TTNYH8cO7b8289/phbejsNM3QlhRVRA+tK+ZmgGQRFLQv1 WgDic0/nvhD2pqygo7zs/YC85xlF6ECj9bBbV0yiIhuers7merC9KHOfWfvQs2fL8H39 BFQFDGCbDZCwkO0KP/rLcz4ORyXzRb26WiZ/hVQBCbpDfCewIXQTWFX04LYaTjAL0/oX WXyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709989994; x=1710594794; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Abv+15fdn0L/XDhBzoC17DusvY5uSXBbJbLmOstC0WQ=; b=nPZ3Q3fljg4EDYLmSDR9rs6GMR1ufu2SIcqTZTqc2gRUecVty0B9oi4dMofD3pg0yp rTtdBZRzQ0Z8aRXo312++z/VLcemqM/aNVo7CMHg3WwkCbVG3WGucy7WalS5l6Zmmb05 pWDivuqDwcMAfkNRzYqqzAmhTKC2S+PO78LWeiWAxe0X60gYBJ+fzq9eiHjd2gvYSn5A s0E7o1xuO/uKnRq63JYOgGRUJ55wYXlUA+KuSJ/AHiWGpCUVuJvvXpic/A07PNF3qeGI 8K/G7J3CZ+D7UTyMvTPrTlntpG0sbexyEoi6wPzyX2CBftcz1G2eNYIb+kXia4KuigCm sHZw== X-Forwarded-Encrypted: i=1; AJvYcCU5hM5iOIVYwznIKkxiWA/doSBM9l40dxXLES2d9N6Dup2qv4oe9FP//51OfmF8mxO3pz2rBdfaz2tq7Rw5iS1usd9O5M3teP0nOH9WXVslIxx633Y= X-Gm-Message-State: AOJu0YwCDR2sMnE9/ml1gQtQflL1ESAgbMQVEz4Qbjfm+0Q2v/hyWFvV tTFb8qPOylebrdXodYxXAAv/ccYrNMWP519mAWvm36TTO23+61qVuFmbrAh5fk4= X-Google-Smtp-Source: AGHT+IHUEJd9GymArjfnENyTdsTXEpA0t/Co7CCxqshkpXpgwTMIjLYBdoTn4ia2QcajVEN7dKgDxA== X-Received: by 2002:a50:955e:0:b0:565:4b37:4578 with SMTP id v30-20020a50955e000000b005654b374578mr1980118eda.14.1709989993946; Sat, 09 Mar 2024 05:13:13 -0800 (PST) Received: from [192.168.32.2] ([147.161.131.117]) by smtp.gmail.com with ESMTPSA id a3-20020a50e703000000b005661badcccesm854704edn.87.2024.03.09.05.13.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 09 Mar 2024 05:13:13 -0800 (PST) Message-ID: Date: Sat, 9 Mar 2024 15:13:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 29/39] irqchip/atmel-aic5: Add support to get nirqs from DT for sam9x60 & sam9x7 Content-Language: en-US To: Varshini.Rajendran@microchip.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, tglx@linutronix.de, Nicolas.Ferre@microchip.com, alexandre.belloni@bootlin.com, andre.przywara@arm.com, mani@kernel.org, shawnguo@kernel.org, Durai.ManickamKR@microchip.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20240223171342.669133-1-varshini.rajendran@microchip.com> <20240223172905.673053-1-varshini.rajendran@microchip.com> From: claudiu beznea In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240309_051320_609717_8273D889 X-CRM114-Status: GOOD ( 24.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 08.03.2024 10:50, Varshini.Rajendran@microchip.com wrote: > On 03/03/24 5:51 pm, claudiu beznea wrote: >> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe >> >> On 23.02.2024 19:29, Varshini Rajendran wrote: >>> Add support to get number of IRQs from the respective DT node for sam9x60 >>> and sam9x7 devices. Since only this factor differs between the two SoCs, >>> this patch adds support for the same. Adapt the sam9x60 dtsi >>> accordingly. >>> >>> Signed-off-by: Varshini Rajendran >>> --- >>> Changes in v4: >>> - Changed the implementation to fetch the NIRQs from DT as per the >>> comment to avoid introducing a new compatible when this is the only >>> difference between the SoCs related to this IP. >>> --- >>> arch/arm/boot/dts/microchip/sam9x60.dtsi | 1 + >>> drivers/irqchip/irq-atmel-aic5.c | 11 ++++++++--- >>> 2 files changed, 9 insertions(+), 3 deletions(-) >>> >>> diff --git a/arch/arm/boot/dts/microchip/sam9x60.dtsi b/arch/arm/boot/dts/microchip/sam9x60.dtsi >>> index 73d570a17269..e405f68c9f54 100644 >>> --- a/arch/arm/boot/dts/microchip/sam9x60.dtsi >>> +++ b/arch/arm/boot/dts/microchip/sam9x60.dtsi >>> @@ -1201,6 +1201,7 @@ aic: interrupt-controller@fffff100 { >>> interrupt-controller; >>> reg = <0xfffff100 0x100>; >>> atmel,external-irqs = <31>; >>> + microchip,nr-irqs = <50>; >>> }; >>> >>> dbgu: serial@fffff200 { >>> diff --git a/drivers/irqchip/irq-atmel-aic5.c b/drivers/irqchip/irq-atmel-aic5.c >>> index 145535bd7560..5d96ad8860d3 100644 >>> --- a/drivers/irqchip/irq-atmel-aic5.c >>> +++ b/drivers/irqchip/irq-atmel-aic5.c >>> @@ -398,11 +398,16 @@ static int __init sama5d4_aic5_of_init(struct device_node *node, >>> } >>> IRQCHIP_DECLARE(sama5d4_aic5, "atmel,sama5d4-aic", sama5d4_aic5_of_init); >>> >>> -#define NR_SAM9X60_IRQS 50 >>> - >>> static int __init sam9x60_aic5_of_init(struct device_node *node, >>> struct device_node *parent) >>> { >>> - return aic5_of_init(node, parent, NR_SAM9X60_IRQS); >>> + int ret, nr_irqs; >>> + >>> + ret = of_property_read_u32(node, "microchip,nr-irqs", &nr_irqs); >>> + if (ret) { >>> + pr_err("Not found microchip,nr-irqs property\n"); >> >> This breaks the ABI. You should ensure old device trees are still working >> with this patch. > > The only older device that uses this API is sam9x60 and the newly added > sam9x7. This change has been tested to be working fine in both the > devices. As Conor explained, the code in this patch should work with device trees from previous kernel releases (thus not having microchip,nr-irqs DT binding). > If you still want me to use the macros as a fallback in the > failure case I can do it. But this change was proposed to avoid adding > macros in the first place. I can remove the error check just like they > do while getting other device tree properties. Or if this is just a > concern of the old devices working with the new change, then sam9x60 > works. Please let me know how to proceed. >> >>> + return ret; >>> + } >>> + return aic5_of_init(node, parent, nr_irqs); >>> } >>> IRQCHIP_DECLARE(sam9x60_aic5, "microchip,sam9x60-aic", sam9x60_aic5_of_init); > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel