From patchwork Wed Apr 3 10:48:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diogo Ivo X-Patchwork-Id: 13615836 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 A077DCD128A for ; Wed, 3 Apr 2024 10:49:15 +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:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GJBw4e0Y3XiY6kB1tvuGMxY4WssXjD5dSmOeTPzlziA=; b=F6lUFmRI78ia0T H+7Q7qgvQgg6unPLahxWdGsTFOyqUsJ8EnyrvE5U8EfF5e1cNwZCHWhQJtgSdX9K8/rUTOHLWPJJi z1z+8Ice1S1VvQqJjN/sGrc9MsCE7JE9jCFR3fZXvcf26RjfTctrWcLBRFWWNSZmCbPjZvxtAWCVj KetZ5a0TtrxE0GPd+xX2Ve5GzO/O3hmOXIGbM3kqZcmsw6rqzQKZgp/ITIStl40kQZh73e6CYRDpx cRuWuExyMqjNboijg01i8IH03tfRS5V7NL+Fa3YTQZ3IP9MaLiuauV2CufwPP4veu6HSA+bQeoDle a/FuBI699IwOxl4JK/Rw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rryAr-0000000FdB1-3bpC; Wed, 03 Apr 2024 10:48:57 +0000 Received: from mta-64-226.siemens.flowmailer.net ([185.136.64.226]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rryAW-0000000FcvW-3WYB for linux-arm-kernel@lists.infradead.org; Wed, 03 Apr 2024 10:48:40 +0000 Received: by mta-64-226.siemens.flowmailer.net with ESMTPSA id 202404031048336f34ced971b1d87896 for ; Wed, 03 Apr 2024 12:48:34 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=diogo.ivo@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=mT1ZqN3HVk2/tJvY22Xtc/ZtSAN7kqkeHXbh9Kuw+D8=; b=WNQvrGOU1i8BlgE3MpUlB2mmsG+67QeTufrGEbrsFNVVbSwq6hNDGstk5ZH8jz9KyTS+5a KLHnCWWHhkFia/b5wYD6L6bWtTcFWISS3J53cy/Vz1G8q8oPURhlIS1xb1xpI+FuF2zQbHz+ ozE/5onhzjBv8XKTvRxJCmrDD14b0=; From: Diogo Ivo To: danishanwar@ti.com, rogerq@kernel.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, andrew@lunn.ch, hkallweit1@gmail.com, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org Cc: Diogo Ivo , jan.kiszka@siemens.com Subject: [PATCH net-next v6 07/10] net: ti: icssg-prueth: Adjust the number of TX channels for SR1.0 Date: Wed, 3 Apr 2024 11:48:17 +0100 Message-ID: <20240403104821.283832-8-diogo.ivo@siemens.com> In-Reply-To: <20240403104821.283832-1-diogo.ivo@siemens.com> References: <20240403104821.283832-1-diogo.ivo@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1320519:519-21489:flowmailer X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240403_034837_167481_C1528F0E X-CRM114-Status: GOOD ( 10.89 ) 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 As SR1.0 uses the current higher priority channel to send commands to the firmware, take this into account when setting/getting the number of channels to/from the user. Based on the work of Roger Quadros in TI's 5.10 SDK [1]. [1]: https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/?h=ti-linux-5.10.y Co-developed-by: Jan Kiszka Signed-off-by: Jan Kiszka Signed-off-by: Diogo Ivo Reviewed-by: Roger Quadros Reviewed-by: MD Danish Anwar --- Changes in v5: - Restrict number of TX channels to 1 to avoid timeouts - Added Reviewed-by tag from Danish Changes in v4: - Add Reviewed-by from Roger Changes in v3: - Address Roger's comments on SR1.0 handling drivers/net/ethernet/ti/icssg/icssg_ethtool.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/ethernet/ti/icssg/icssg_ethtool.c b/drivers/net/ethernet/ti/icssg/icssg_ethtool.c index 9a7dd7efcf69..ca20325d4d3e 100644 --- a/drivers/net/ethernet/ti/icssg/icssg_ethtool.c +++ b/drivers/net/ethernet/ti/icssg/icssg_ethtool.c @@ -142,6 +142,9 @@ static int emac_set_channels(struct net_device *ndev, emac->tx_ch_num = ch->tx_count; + if (emac->is_sr1) + emac->tx_ch_num++; + return 0; } @@ -152,8 +155,17 @@ static void emac_get_channels(struct net_device *ndev, ch->max_rx = 1; ch->max_tx = PRUETH_MAX_TX_QUEUES; + + /* Disable multiple TX channels due to timeouts + * when using more than one queue */ + if (emac->is_sr1) + ch->max_tx = 1; + ch->rx_count = 1; ch->tx_count = emac->tx_ch_num; + + if (emac->is_sr1) + ch->tx_count--; } static const struct ethtool_rmon_hist_range emac_rmon_ranges[] = {