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 01FC3C61CE8 for ; Sun, 15 Jun 2025 09:56:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:Message-ID:References:In-Reply-To:Subject:Cc:To:From:Date: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=qR3qMDQo9TdMbJqkibA/Cdr7B5FwdnAlAIEIskS1oHs=; b=EwXjq73f7QC28hQgvlM6CwKf7d eAE/mG39ciJI1l1m6XOfbeaklixDQRwv8Dvka1fDbhGgO0wpqvRgrB99WdZ936xuc1LZHldJxrKT2 vf7/yaeDJ4PFuRWm6+FK5soakqoBq9S6Sdf6FIoIMOIJ/2r2KsLMQ1nddqcdM3cTPGwURxa/mWA/L uKgPLt7CDntr+8H8RmRh0RMMuHsFmle+ubxHUZUww2MfxTcelao06RKz8qevoLa/NG+F5mzDzTia/ esmYdL8kUe0FE5eB7A9GduMoS1ebtXXpVXEezDnfqiFKvtgoJ2nkkYrgnmQEzgzaRUdXFWpeeZZMT WXazAdZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uQk6M-00000002PcB-1XLm; Sun, 15 Jun 2025 09:56:34 +0000 Received: from mxout4.routing.net ([2a03:2900:1:a::9]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uQk48-00000002PUd-41nV; Sun, 15 Jun 2025 09:54:18 +0000 Received: from mxbox3.masterlogin.de (unknown [192.168.10.78]) by mxout4.routing.net (Postfix) with ESMTP id 2F25E1005FD; Sun, 15 Jun 2025 09:54:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1749981254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qR3qMDQo9TdMbJqkibA/Cdr7B5FwdnAlAIEIskS1oHs=; b=fwHJ5W9qptWu4Q4AAnsMj141YfE9G8B8ltvngjlidjrkzljURVbuJo4fi7hwgqv6eHmayJ vqfgII+I9Uq6rxYaZltp9jJpziEj+L+5tTASyh1NGH/5jkCcAhPYsmrMWc0/C+lhDfNnmr xDhpCPZcU9v6AAf4iFIJ3cZGdD0FN2E= Received: from webmail.hosting.de (unknown [134.0.26.148]) by mxbox3.masterlogin.de (Postfix) with ESMTPSA id 5862A3601E7; Sun, 15 Jun 2025 09:54:13 +0000 (UTC) MIME-Version: 1.0 Date: Sun, 15 Jun 2025 11:54:13 +0200 From: "Frank Wunderlich (linux)" To: Lorenzo Bianconi , Daniel Golle Cc: Felix Fietkau , Sean Wang , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Frank Wunderlich , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Simon Horman Subject: Re: [PATCH v2] net: ethernet: mtk_eth_soc: support named IRQs In-Reply-To: References: <20250615084521.32329-1-linux@fw-web.de> Message-ID: X-Sender: linux@fw-web.de Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Mail-ID: 8416b7ea-d84c-44e8-bd86-b50db1b64538 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250615_025417_444855_F8DC68C1 X-CRM114-Status: GOOD ( 32.64 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Am 2025-06-15 10:57, schrieb Lorenzo Bianconi: >> From: Frank Wunderlich >> >> Add named interrupts and keep index based fallback for exiting >> devicetrees. >> >> Currently only rx and tx IRQs are defined to be used with mt7988, but >> later extended with RSS/LRO support. >> >> Signed-off-by: Frank Wunderlich >> Reviewed-by: Simon Horman > > Hi Frank, > > I guess my comments on v1 apply even in v2. Can you please take a look? adding your comments (and mine as context) from v1 here: Am 2025-06-15 10:57, schrieb Lorenzo Bianconi: >> From: Frank Wunderlich >> I had to leave flow compatible with this: >> >> > > I guess the best would be to start from 0 even here (and wherever it is > necessary) and avoid reading current irq[0] since it is not actually > used for > !shared_int devices (e.g. MT7988). Agree? > >> >> Here the irqs are taken from index 1 and 2 for >> registration (!shared_int else only 0). So i avoided changing the >> index,but yes index 0 is unset at this time. >> >> I guess the irq0 is not really used here... >> I tested the code on bpi-r4 and have traffic >> rx+tx and no crash. >> imho this field is not used on !shared_int >> because other irq-handlers are used and >> assigned in position above. > > agree. I have not reviewed the code in detail, but this is why > I think we can avoid reading it. i areee, but imho it should be a separate patch because these are 2 different changes >> It looks like the irq[0] is read before...there is a >> message printed for mediatek frame engine >> which uses index 0 and shows an irq 102 on >> index way and 0 on named version...but the >> 102 in index way is not visible in /proc/interrupts. >> So imho this message is misleading. >> >> Intention for this patch is that irq 0 and 3 on >> mt7988 (sdk) are reserved (0 is skipped on >> !shared_int and 3 never read) and should imho >> not listed in devicetree. For further cleaner >> devicetrees (with only needed irqs) and to >> extend additional irqs for rss/lro imho irq >> names make it better readable. > > Same here, if you are not listing them in the device tree, you can > remove them > in the driver too (and adjust the code to keep the backward > compatibility). afaik i have no SHARED_INT board (only mt7621, mt7628) so changing the index-logic will require testing on such boards too. i looked a bit into it and see mt7623 and mt7622 have 3 IRQs defined (!SHARED_INT) and i'm not 100% sure if the first is also skipped (as far as i understood code it should always be skipped). In the end i would change the irq-index part in separate patch once this is accepted to have clean changes and not mixing index with names (at least to allow a revert of second in case of regression). Am 2025-06-15 11:26, schrieb Daniel Golle: > In addition to Lorenzo's comment to reduce the array to the actually > used > IRQs, I think it would be nice to introduce precompiler macros for the > irq > array index, ie. once the array is reduce to size 2 it could be > something > like > > #define MTK_ETH_IRQ_SHARED 0 > #define MTK_ETH_IRQ_TX 0 > #define MTK_ETH_IRQ_RX 1 > #define __MTK_ETH_IRQ_MAX MTK_ETH_IRQ_RX > > That would make all the IRQ code more readable than having to deal with > numerical values. makes sense, i will take this into the second patch. I hope you can agree my thoughts about not mixing these 2 parts :) regards Frank