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 7AB351DE3DB for ; Fri, 20 Mar 2026 14:14:06 +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=1774016046; cv=none; b=o1EVEJN6UPIhH3q7rphS1+3k+4DtesoVoYU6vxJBThwm0OXYO+W1K+99dUSYC8rb3BV1owCyZPCiVYHKf/n7cpZuYmmgEfIk7zXKd/wjmK1BmXmu6kF1j/LG6/XVGkLXMoZTHKOWiAf5AF2FhvLhgauZpRWitMVYa0Zsw/fF33Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774016046; c=relaxed/simple; bh=YMlfCEz33n30zwFmMdduM+SWaK4Nxc5/zHqhYXHi0hg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aAwMO4Hi5XsjrFbdQ26EI49UbmwGmm6L9srAGi72Fe1wEMGP3etVLKwtveKhbZNW2bESiheTNRFuH38DTD9yrsWQEkIy/UMwM6z7JMD/i6PnonfZgNHo0Iac5GZY1C/x7lI9J1DQwKhNE1EaGosaRx30l6kWGVFLbmNgRLoxA2o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZXth8R1P; 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="ZXth8R1P" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7370DC2BCB3; Fri, 20 Mar 2026 14:14:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774016046; bh=YMlfCEz33n30zwFmMdduM+SWaK4Nxc5/zHqhYXHi0hg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZXth8R1PmKJMVAHvTS00+bXkT3Kp59XLP03w5Hv0B1LIwGtOACUA8/1Wfum16AWTs qR8wgqVxNQmUOHlVvuRyVhMUBkNm3s3JeWTtHYgdpdRjM808UHZT6hSrjM1VW7gLn/ wWnryYl3reNGrXdTj6cczqkrxxXtrLYKEYW4GZDCwevtEnjBTBNgYiswcVgyZPUeQw SKzMR8ZZL/o5RfDMjD1AypBEhPAHIbTfqa+gDi9nhzY0oD3RG1YoelfTHuaY+zinBV MRaPx7K7TS8MppfUcBNVx4miKk8s1th6UfduXZXKNqB+1EtUXG9XKcZkCZVPlUb1y4 x92/S24M2W13A== From: Sasha Levin To: stable@vger.kernel.org Cc: Kevin Hao , Quanyang Wang , Simon Horman , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.12.y 2/2] net: macb: Reinitialize tx/rx queue pointer registers and rx ring during resume Date: Fri, 20 Mar 2026 10:14:01 -0400 Message-ID: <20260320141401.4172666-2-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260320141401.4172666-1-sashal@kernel.org> References: <2026032001-carnival-rewind-d710@gregkh> <20260320141401.4172666-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 17d1057d2630c..bddcf777c296e 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -5435,8 +5435,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