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 C7DDF34C150; Fri, 21 Nov 2025 13:53:32 +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=1763733212; cv=none; b=Gk5IAluUltaaOwn86UT0n4nBcr3bIotk6ndNcq83qABmoASNG4qQ6R0xlZrm+QvrpWl6zuEJ5DfiinDKty+ZCvLNVm7jZM+0eP9O9pDkBFZ3Y4Wbu/KPJiBR1bP3qRMWM2aEEOSUljXiBLEKDw6/eu/D6V1Q5OQE9tlISYodJiM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763733212; c=relaxed/simple; bh=hk9rGIg3j6mNJ87k03zFN594Gw3684lDR/lIkqHPsA4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IxScz/1u7uPcCDgTWt4gF9g45Phzzba54QSfGia86xCkFCnAqf4WQtaJ/+ORUFW/L5ki18nISGsmT+3pXP4E8PoXRj7iUFlWC8M8vvqKlXQmEYtLhKsX4SUyk2sFKlqUEkzAXfgJuRjdBOLElEPRLYT6AUCg6D7+Nr3fG27J6iM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=meOwp+ag; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="meOwp+ag" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4CDECC4CEF1; Fri, 21 Nov 2025 13:53:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1763733212; bh=hk9rGIg3j6mNJ87k03zFN594Gw3684lDR/lIkqHPsA4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=meOwp+agXqKqECtxnK33MwbIbTC21Vrban4bbP41I7VVKuiWGQ7C0kNLjJm5tOUNi HduNR2nkfn5mTM1WrqS9F5HlLiFRAHj56EKOcb1TnHWQWJCWf1eSH58bd8NmypU+nQ 0iB/3MKfhaI+hqL7LgTQ6W6gGQa/0ev0f7l0nAkM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jonas Gorski , Florian Fainelli , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.6 347/529] net: dsa: b53: stop reading ARL entries if search is done Date: Fri, 21 Nov 2025 14:10:46 +0100 Message-ID: <20251121130243.378293613@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251121130230.985163914@linuxfoundation.org> References: <20251121130230.985163914@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jonas Gorski [ Upstream commit 0be04b5fa62a82a9929ca261f6c9f64a3d0a28da ] The switch clears the ARL_SRCH_STDN bit when the search is done, i.e. it finished traversing the ARL table. This means that there will be no valid result, so we should not attempt to read and process any further entries. We only ever check the validity of the entries for 4 ARL bin chips, and only after having passed the first entry to the b53_fdb_copy(). This means that we always pass an invalid entry at the end to the b53_fdb_copy(). b53_fdb_copy() does check the validity though before passing on the entry, so it never gets passed on. On < 4 ARL bin chips, we will even continue reading invalid entries until we reach the result limit. Fixes: 1da6df85c6fb ("net: dsa: b53: Implement ARL add/del/dump operations") Signed-off-by: Jonas Gorski Reviewed-by: Florian Fainelli Link: https://patch.msgid.link/20251102100758.28352-3-jonas.gorski@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/dsa/b53/b53_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c index 3c5bf65aca6a2..ffe8db7c2f1f4 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -1816,7 +1816,7 @@ static int b53_arl_search_wait(struct b53_device *dev) do { b53_read8(dev, B53_ARLIO_PAGE, B53_ARL_SRCH_CTL, ®); if (!(reg & ARL_SRCH_STDN)) - return 0; + return -ENOENT; if (reg & ARL_SRCH_VLID) return 0; -- 2.51.0