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 B27CA3128CC for ; Fri, 20 Mar 2026 13:53: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=1774014785; cv=none; b=gL1n1LxqusJfygRwL0ejY6KAtXCZponr2b/mi8E+7lw+0jvurD8FuJcedgHaW80imOXhjVfdJ1/OPfoyCriDPLhmKiVYbYcu4CeaEmsJAivywDFCd+vSTTPPKGSzPxdrqMbrI/yDhKrrnO44OM1Q579h2aJEHcILCWxbhWU9xqw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774014785; c=relaxed/simple; bh=+y9LofBvK6d5gnrFH5lk9oK5STXzijOgHD1+B2NQ/9Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=olLZg7AQiBCp4kclGVHFqESdpHP0JNK/SNGSS7IGT3DF9DLHOE4uQLad6EDL6ZYAZ2JquzLPIOYwiL3BPQY3OaHTlAj1WOLS1/hAK1XmS/hnBmNWlq1xCCpZey6e0ghGmSqmfuTmp6e+L/Y5RrkItNCdjlAelp22wQWT33rWhGo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BdmlMspM; 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="BdmlMspM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87502C19425; Fri, 20 Mar 2026 13:53:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774014785; bh=+y9LofBvK6d5gnrFH5lk9oK5STXzijOgHD1+B2NQ/9Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BdmlMspMeu0CRqUuoWZG6Junr/16roxZfcpY+29NmiAwNUndHDERD2H7BAzzpNa9O A2Mesm9QwBWb8wIyHzHj8ymBzO9ZOVnu8yazYFghYojVaOaYAcwxLqPmQUoqYCLxTu YBrmEGK8hVRQKcNZmgt2T2TkHKbpRpoAzq0H44raErmmluVTd+Kt4BM51245wA/T7G yP/06MU4qo0QGMR80GhB9MXs0IyINh2Co6nkuSy34Ql6OHWVtTCp5lLSNdCycOS8g5 RiNN3MYn1Vgw6M1Srn2Wz/Pdl3lU0Eiiz12PPVWu2wpIAz1APsKUeli8FR2k+BRon1 B5hO1BBSAt4zQ== From: Sasha Levin To: stable@vger.kernel.org Cc: Kevin Hao , Quanyang Wang , Simon Horman , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.18.y 2/2] net: macb: Reinitialize tx/rx queue pointer registers and rx ring during resume Date: Fri, 20 Mar 2026 09:53:02 -0400 Message-ID: <20260320135302.4165461-2-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260320135302.4165461-1-sashal@kernel.org> References: <2026032059-clad-unselfish-9202@gregkh> <20260320135302.4165461-1-sashal@kernel.org> 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 718d0766ce4c7634ce62fa78b526ea7263487edd ] On certain platforms, such as AMD Versal boards, the tx/rx queue pointer registers are cleared after suspend, and the rx queue pointer register is also disabled during suspend if WOL is enabled. Previously, we assumed that these registers would be restored by macb_mac_link_up(). However, in commit bf9cf80cab81, macb_init_buffers() was moved from macb_mac_link_up() to macb_open(). Therefore, we should call macb_init_buffers() to reinitialize the tx/rx queue pointer registers during resume. Due to the reset of these two registers, we also need to adjust the tx/rx rings accordingly. The tx ring will be handled by gem_shuffle_tx_rings() in macb_mac_link_up(), so we only need to initialize the rx ring here. Fixes: bf9cf80cab81 ("net: macb: Fix tx/rx malfunction after phy link down and up") Reported-by: Quanyang Wang Signed-off-by: Kevin Hao Tested-by: Quanyang Wang Cc: stable@vger.kernel.org Reviewed-by: Simon Horman Link: https://patch.msgid.link/20260312-macb-versal-v1-2-467647173fa4@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/cadence/macb_main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index a20985f28f789..87fe529b740ed 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -5856,8 +5856,18 @@ static int __maybe_unused macb_resume(struct device *dev) rtnl_unlock(); } + if (!(bp->caps & MACB_CAPS_MACB_IS_EMAC)) + macb_init_buffers(bp); + for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue) { + if (!(bp->caps & MACB_CAPS_MACB_IS_EMAC)) { + if (macb_is_gem(bp)) + gem_init_rx_ring(queue); + else + macb_init_rx_ring(queue); + } + napi_enable(&queue->napi_rx); napi_enable(&queue->napi_tx); } -- 2.51.0