From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8C37E1DE3DB for ; Fri, 20 Mar 2026 14:14:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774016045; cv=none; b=kFlbWWDZWz6RZ/H5LdxjHPOYxD8o64Px86UYEJBq0VsRo1yML40Cw67o60LeFU9YaVa/hOeHNpmvEA3sJUraZ5ZNOIoUKCNagTxFNYGxL2jPeJgmYi42/IWTNMrpspQDmxe7ohqWOek/CAhcAZxRGxW75CtLK5y0WP3vn40vAvs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774016045; c=relaxed/simple; bh=BflMWPmlP25JgJWy91RWDkqDAt09DAGOdBH4DpSetEM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CzWPjgIgA/yhx9yp+UCfVcBlVC9jRuY9JqRDMwjHbbnWT8wn2tKfz4UCIg+B232MWcgwIw/x46LWTz6x2GBTYSQM9QKWl6XlKP0y6JzVSTjKhtHahk5EhNsmKhpsSSQgfJLaZIt42MLCmmxKnbmxe5PeShT1rI9kCrHoAmu+WZY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qKIrCEgD; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qKIrCEgD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8BC52C2BCB2; Fri, 20 Mar 2026 14:14:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774016045; bh=BflMWPmlP25JgJWy91RWDkqDAt09DAGOdBH4DpSetEM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qKIrCEgDogHwxRlG8BTaDpQv6q6dxQrKIi22iVRXNCmoiuMLxSYu3oWa4l1qYIlVJ o2poBQGiPFEpSy2VY5+54cHm03Y7p9qstud/Gnjhm+Yz6B8FWPX3gA7v2+fsvE0+Gr KH8DYZwXbkZ2oXrZT/eOMDnIUOyzfk4zVOTlwIJUdtsj+qV0tjxmiYkqZRJA0zXk8a ZajVJ780T6wKlAd/nXUX+jRwHxnWMAl8bhb18dxr/abONOKRiiAoEe/tbfinnJRml4 M3/fAl+8CHUnK1dR+6wfIjejXotu3QUN0kv9e1h3YZCfviatEfU8fr31wFBUhcFnMK Do8XDZ6QPjIhg== From: Sasha Levin To: stable@vger.kernel.org Cc: Kevin Hao , Simon Horman , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.12.y 1/2] net: macb: Introduce gem_init_rx_ring() Date: Fri, 20 Mar 2026 10:14:00 -0400 Message-ID: <20260320141401.4172666-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <2026032001-carnival-rewind-d710@gregkh> References: <2026032001-carnival-rewind-d710@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Kevin Hao [ Upstream commit 1a7124ecd655bcaf1845197fe416aa25cff4c3ea ] Extract the initialization code for the GEM RX ring into a new function. This change will be utilized in a subsequent patch. No functional changes are introduced. Signed-off-by: Kevin Hao Reviewed-by: Simon Horman Link: https://patch.msgid.link/20260312-macb-versal-v1-1-467647173fa4@gmail.com Signed-off-by: Jakub Kicinski Stable-dep-of: 718d0766ce4c ("net: macb: Reinitialize tx/rx queue pointer registers and rx ring during resume") Signed-off-by: Sasha Levin --- drivers/net/ethernet/cadence/macb_main.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index f258c4b82c74d..17d1057d2630c 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -2608,6 +2608,14 @@ static void macb_init_tieoff(struct macb *bp) desc->ctrl = 0; } +static void gem_init_rx_ring(struct macb_queue *queue) +{ + queue->rx_tail = 0; + queue->rx_prepared_head = 0; + + gem_rx_refill(queue); +} + static void gem_init_rings(struct macb *bp) { struct macb_queue *queue; @@ -2625,10 +2633,7 @@ static void gem_init_rings(struct macb *bp) queue->tx_head = 0; queue->tx_tail = 0; - queue->rx_tail = 0; - queue->rx_prepared_head = 0; - - gem_rx_refill(queue); + gem_init_rx_ring(queue); } macb_init_tieoff(bp); -- 2.51.0