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 3126D3815DE for ; Fri, 20 Mar 2026 12:42: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=1774010527; cv=none; b=V1lGR8gGrZpgfrbzh4WMsAm88+XVq7CrAICupEOw1YF5E+O2qwHFZypaNqvugnRBFkGpupoSnEB4tADSfl6HoMMU/Wqdlsgvfo579yK2HNqejO++8W6xD5uXKp+cGxoFCuhBpQlsjFf13bzAtI6TZapRUKxfk3oVmMEfesDa3fI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774010527; c=relaxed/simple; bh=BS2+cD9ShaGwzrty8uN2FdypxsSObW+xNB2F+0E3J9U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QcaMKYXzV03Gd2pjQpjLk9d6cT8H0hquIG4lpQ7y+J29yrUBCQTXJ9Vu0NziIM7o+LEWOaBh8v0E+7CtJMmjVWr9doEB5qGgK2P2mHOiY7HjDjiQUwds2GfEghfV9lwDgEZfmvor/V3XzbaALX8VEPN/3v8MOiKhJemzdqNV7sI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lYvl7zH2; 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="lYvl7zH2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC55BC2BCB4; Fri, 20 Mar 2026 12:42:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774010526; bh=BS2+cD9ShaGwzrty8uN2FdypxsSObW+xNB2F+0E3J9U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lYvl7zH2L9zaLhYx8EPf53hKo+zr18rFvYhM2AbMgFP4xxOzG7zoSpcqiZ5nI4v0n NdNlwzlP6iOrtoHccKTfF2wy1IgsHvgn+K1kMUWqaPQ9Fc9Iu17oWV61Fx3wDbVQCM BQEWR+llpys9mnkrdFAU/9/axD8r+2EoYPO0meuwEMq/00G7ZQLJJKOm8M+SeBZNA3 BYMQ/sytjMgt5Z44ett5yE8nlZdn50IjaCwBg++1A+xiE5/3DgoeMrpdcKk+qrH+IQ anC0BxYjFCKNLuSJzwGq2bVZOW4uPttlVlNn2YzjfenaqZPU/1KTNOCFDh/CZzZoFD omafNIMB2Kzxw== From: Sasha Levin To: stable@vger.kernel.org Cc: Kevin Hao , Quanyang Wang , Simon Horman , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.19.y 2/2] net: macb: Reinitialize tx/rx queue pointer registers and rx ring during resume Date: Fri, 20 Mar 2026 08:42:03 -0400 Message-ID: <20260320124203.4124440-2-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260320124203.4124440-1-sashal@kernel.org> References: <2026032059-helpline-reason-16c7@gregkh> <20260320124203.4124440-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 d81fe135dcba4..a0802177a7a24 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -5949,8 +5949,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