From patchwork Wed Oct 16 21:51:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Kleine-Budde X-Patchwork-Id: 13839005 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 95A811D5CCD for ; Wed, 16 Oct 2024 21:52:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729115553; cv=none; b=fM6OfZ5xHLHkLpETpsD+z0Vktnrra2iyclDxSur8AC74jdTBH7daIGsuB8EU8GzXpein08biaa7vDBe++0RoxJqIlvmabf07OtgM8HlJ3stj2RVuS97en4CMzkhMRYFuwjaCoDRpnVH4WHZRrC7oXKusTYG3WJsNMShF0yxBin8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729115553; c=relaxed/simple; bh=PQKfRdtWTAXIoydlgwBAzBYY+iXP63O77c6zthztjaI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HSY35SQQCl/FxAwOZiZhdigeqG3sYanVQu4nngpyuiM82tjuhSgyIzHxEoau33KaiIWWkAJvS0xKhV+nOX5Pv3CzANTWAF0DmqoHMd6ZRqdpH0+XXPMFER5kGrRZVuXLUHUm97gzZPiz3V6+ZtucqMjQPoPQqvTe0HutEFlsmNw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t1BwT-0003N6-D8 for imx@lists.linux.dev; Wed, 16 Oct 2024 23:52:29 +0200 Received: from [2a0a:edc0:0:b01:1d::7b] (helo=bjornoya.blackshift.org) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t1BwP-002ORk-4X for imx@lists.linux.dev; Wed, 16 Oct 2024 23:52:25 +0200 Received: from dspam.blackshift.org (localhost [127.0.0.1]) by bjornoya.blackshift.org (Postfix) with SMTP id 5B7103548EE for ; Wed, 16 Oct 2024 21:52:24 +0000 (UTC) Received: from hardanger.blackshift.org (unknown [172.20.34.65]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by bjornoya.blackshift.org (Postfix) with ESMTPS id 7FCC4354889; Wed, 16 Oct 2024 21:52:20 +0000 (UTC) Received: from [172.20.34.65] (localhost [::1]) by hardanger.blackshift.org (OpenSMTPD) with ESMTP id 21637288; Wed, 16 Oct 2024 21:52:19 +0000 (UTC) From: Marc Kleine-Budde Date: Wed, 16 Oct 2024 23:51:56 +0200 Subject: [PATCH net-next 08/13] net: fec: fec_probe(): let IRQ name reflect its function Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241016-fec-cleanups-v1-8-de783bd15e6a@pengutronix.de> References: <20241016-fec-cleanups-v1-0-de783bd15e6a@pengutronix.de> In-Reply-To: <20241016-fec-cleanups-v1-0-de783bd15e6a@pengutronix.de> To: Wei Fang , Shenwei Wang , Clark Wang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Richard Cochran Cc: imx@lists.linux.dev, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, Marc Kleine-Budde X-Mailer: b4 0.15-dev-dedf8 X-Developer-Signature: v=1; a=openpgp-sha256; l=3400; i=mkl@pengutronix.de; h=from:subject:message-id; bh=PQKfRdtWTAXIoydlgwBAzBYY+iXP63O77c6zthztjaI=; b=owEBbQGS/pANAwAKASg4oj56LbxvAcsmYgBnEDWJdz6WPFmpuJICJRNYxZ0KdNuJR/sWUfgxB D0rz1IkzxSJATMEAAEKAB0WIQRQQLqG4LYE3Sm8Pl8oOKI+ei28bwUCZxA1iQAKCRAoOKI+ei28 b45PB/95196jockvrCj++TeD3Deyrjep2aMyesqXSzHsOAPmOGnzeG15CitaHzVyHAMlJBugVgv w4E9+/4itXm/PLyDPYoiaqz+g88u/LNU86m4cCuxFPgtGZuMu/AsoNvJOVH2HamuRIbTzGY88UM nbbjxzmt+7aSrnHfS5e0djP5uvTznt+bPQqz0R+yytmFmdGBspz9jNWxHbyFjT0f1tokRMq3C/s 60wgFI5zTzht19p81U8fX4XJ6HXgP/CrdmWhkrzeXEZ1/ZLuKrSlPhC2jaFBDJfr4dUy4Jsy+nQ LKbS9dtKMJojYzTMoo8sHI2n3zpkOZ48BeNYz0AdGBiI4eGu X-Developer-Key: i=mkl@pengutronix.de; a=openpgp; fpr=C1400BA0B3989E6FBC7D5B5C2B5EE211C58AEA54 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: imx@lists.linux.dev The FEC IP core in the i.MX7 and newer SoCs has 4 IRQs. The first 3 correspond to the 3 RX/TX queues, the 4th is for processing Pulses Per Second. In addition, the 1st IRQ handles the remaining IRQ sources of the IP core. They are all displayed with the same name in /proc/interrupts: | 208: 0 0 0 0 GICv3 150 Level 30be0000.ethernet | 209: 0 0 0 0 GICv3 151 Level 30be0000.ethernet | 210: 3898 0 0 0 GICv3 152 Level 30be0000.ethernet | 211: 0 0 0 0 GICv3 153 Level 30be0000.ethernet For easier debugging make the name of the IRQ reflect its function. Use the postfix "-RxTx" and the queue number for the first 3 IRQs, add "+misc" for the 1st IRQ. The postfix "-PPS" specifies the PPS IRQ. With this change /proc/interrupts looks like this: | 208: 2 0 0 0 GICv3 150 Level 30be0000.ethernet-RxTx1 | 209: 0 0 0 0 GICv3 151 Level 30be0000.ethernet-RxTx2 | 210: 3526 0 0 0 GICv3 152 Level 30be0000.ethernet-RxTx0+misc | 211: 0 0 0 0 GICv3 153 Level 30be0000.ethernet-PPS Signed-off-by: Marc Kleine-Budde Reviewed-by: Frank Li Reviewed-by: Wei Fang --- drivers/net/ethernet/freescale/fec_main.c | 9 ++++++++- drivers/net/ethernet/freescale/fec_ptp.c | 5 ++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index f124ffe3619d82dc089f8494d33d2398e6f631fb..c8b2170735e599cd10492169ab32d0e20b28311b 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -4492,8 +4492,15 @@ fec_probe(struct platform_device *pdev) goto failed_init; for (i = 0; i < irq_cnt; i++) { + const char *dev_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s-RxTx%d%s", + pdev->name, i, i == 0 ? "+misc" : ""); int irq_num; + if (!dev_name) { + ret = -ENOMEM; + goto failed_irq; + } + if (fep->quirks & FEC_QUIRK_DT_IRQ2_IS_MAIN_IRQ) irq_num = (i + irq_cnt - 1) % irq_cnt; else @@ -4508,7 +4515,7 @@ fec_probe(struct platform_device *pdev) goto failed_irq; } ret = devm_request_irq(&pdev->dev, irq, fec_enet_interrupt, - 0, pdev->name, ndev); + 0, dev_name, ndev); if (ret) goto failed_irq; diff --git a/drivers/net/ethernet/freescale/fec_ptp.c b/drivers/net/ethernet/freescale/fec_ptp.c index 8722f623d9e47e385439f1cee8c677e2b95b236d..0ac89fed366a83bcbfc900ea4409f4e98c4e14da 100644 --- a/drivers/net/ethernet/freescale/fec_ptp.c +++ b/drivers/net/ethernet/freescale/fec_ptp.c @@ -749,8 +749,11 @@ void fec_ptp_init(struct platform_device *pdev, int irq_idx) * only the PTP_CLOCK_PPS clock events should stop */ if (irq >= 0) { + const char *dev_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, + "%s-PPS", pdev->name); + ret = devm_request_irq(&pdev->dev, irq, fec_pps_interrupt, - 0, pdev->name, ndev); + 0, dev_name ? dev_name : pdev->name, ndev); if (ret < 0) dev_warn(&pdev->dev, "request for pps irq failed(%d)\n", ret);