From patchwork Mon Sep 2 14:54:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Machon X-Patchwork-Id: 13787416 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 AE3CACA0ED3 for ; Mon, 2 Sep 2024 15:07:55 +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:CC:To:In-Reply-To:References :Message-ID:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=O+058WvxoIFujx6TYl7Y/WS7cfDXKm0AdOZPedkzlps=; b=Y903A0uYwld2xg1mENTYYbVi4w /E3neBshLSh8h6luXBaV7kQ/eSoZokS+A4vpxad0qr7nGaMi0oqxncRTZVkAGLyEfcJcSfDWV+uRc EhU29RdOP4j/nLEx2FjQADWrFoUvDz9cQg8MaVgcbpIRUuKQLY+CgGMWWQIihdtvNvNmS6h6JJnDv JKfITJ01uYW99iyp4OhQQAxQD9Ek5ZQxr0fCo/gy7C6oninKLc8iRMF9FmMnjUwl8EpL8C9/Eq6QM mD6OuYamom1XB7EaAucu9dK1Gd2wneWmuXHBQGmrzugbxSKRcyR4Wo6AGZ2Z+GY+jDMb8SNpaiKrp EJDFx/qw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sl8eg-0000000EnHQ-2yXm; Mon, 02 Sep 2024 15:07:46 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sl8Ss-0000000EkKn-0wLZ for linux-arm-kernel@lists.infradead.org; Mon, 02 Sep 2024 14:55:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1725288933; x=1756824933; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=xRg5RV5ook/I7L7TEqs4RihaENNMpGqSI1p9RqlWG78=; b=cqSc7JI5OL27L4zNhOPOZT/uhCnDx1GOA7+fbh+wqalxfVm8Ytdpc8Qy /s9md0Z2Qc/DXPdiE3ZwUVOzChwyZ7LK51k3iWicblcbOjZox0UBGONOR bRPKdulYxHB3cNzFNB6DxFi6XD3oAg5f+hmdDhC4Af//vwznmzE5KCdpH nS2dgDRqIwUxWpj2EcAD3Fz3b+fzt01Ef8G8bj55IOSPeY1kfg1fKVBXf ttgPVu0VnkDJG9aT5VVk+yNWC6hZJdX8dSmfUbgIRJFF+FfjCf1bympK7 eMpTkXI8iDQgvYEjSFwSq5lInPOabeu+637roFxkPo9ZNpfBx7dDNFDzP Q==; X-CSE-ConnectionGUID: 6WD2x+lUSXKxeZe2mffqQA== X-CSE-MsgGUID: RqWNjkf+SjaOBDncqe/Qpg== X-IronPort-AV: E=Sophos;i="6.10,195,1719903600"; d="scan'208";a="31128333" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 02 Sep 2024 07:55:31 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 2 Sep 2024 07:55:08 -0700 Received: from [10.205.21.108] (10.10.85.11) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Mon, 2 Sep 2024 07:55:05 -0700 From: Daniel Machon Date: Mon, 2 Sep 2024 16:54:17 +0200 Subject: [PATCH net-next 12/12] net: sparx5: ditch sparx5_fdma_rx/tx_reload() functions MIME-Version: 1.0 Message-ID: <20240902-fdma-sparx5-v1-12-1e7d5e5a9f34@microchip.com> References: <20240902-fdma-sparx5-v1-0-1e7d5e5a9f34@microchip.com> In-Reply-To: <20240902-fdma-sparx5-v1-0-1e7d5e5a9f34@microchip.com> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Lars Povlsen , "Steen Hegelund" , Horatiu Vultur , , , CC: , , , =?utf-8?q?Jens_Emil_Schulz_=C3=98st?= =?utf-8?q?ergaard?= X-Mailer: b4 0.14-dev X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240902_075534_415558_2300F558 X-CRM114-Status: GOOD ( 10.15 ) 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 These direction specific functions can be ditched in favor of a single function: sparx5_fdma_reload(), which retrieves the channel id from the fdma struct instead. Signed-off-by: Daniel Machon Reviewed-by: Steen Hegelund Reviewed-by: Jens Emil Schulz Østergaard Reviewed-by: Horatiu Vultur --- drivers/net/ethernet/microchip/sparx5/sparx5_fdma.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_fdma.c b/drivers/net/ethernet/microchip/sparx5/sparx5_fdma.c index 7e1bdd0344d0..61df874b7623 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_fdma.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_fdma.c @@ -133,16 +133,10 @@ static void sparx5_fdma_tx_deactivate(struct sparx5 *sparx5, struct sparx5_tx *t sparx5, FDMA_CH_ACTIVATE); } -static void sparx5_fdma_rx_reload(struct sparx5 *sparx5, struct sparx5_rx *rx) +static void sparx5_fdma_reload(struct sparx5 *sparx5, struct fdma *fdma) { /* Reload the RX channel */ - spx5_wr(BIT(rx->fdma.channel_id), sparx5, FDMA_CH_RELOAD); -} - -static void sparx5_fdma_tx_reload(struct sparx5 *sparx5, struct sparx5_tx *tx) -{ - /* Reload the TX channel */ - spx5_wr(BIT(tx->fdma.channel_id), sparx5, FDMA_CH_RELOAD); + spx5_wr(BIT(fdma->channel_id), sparx5, FDMA_CH_RELOAD); } static bool sparx5_fdma_rx_get_frame(struct sparx5 *sparx5, struct sparx5_rx *rx) @@ -213,7 +207,7 @@ static int sparx5_fdma_napi_callback(struct napi_struct *napi, int weight) sparx5, FDMA_INTR_DB_ENA); } if (counter) - sparx5_fdma_rx_reload(sparx5, rx); + sparx5_fdma_reload(sparx5, fdma); return counter; } @@ -246,7 +240,7 @@ int sparx5_fdma_xmit(struct sparx5 *sparx5, u32 *ifh, struct sk_buff *skb) sparx5_fdma_tx_activate(sparx5, tx); first_time = false; } else { - sparx5_fdma_tx_reload(sparx5, tx); + sparx5_fdma_reload(sparx5, fdma); } return NETDEV_TX_OK; }