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 EFB9E1891A0; Tue, 10 Sep 2024 09:51:30 +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=1725961891; cv=none; b=Ejzw0zt4pZHObgjpN4GGtBNoLonYHwBYXU82LQPm1apBL3YBSA/lqzGufyHDlnoz4xqnn/EMsWm63m7L4dprC8CFVmlpaFt011wz5Myy3xLPSpKabxKTmlBhbh0IQapu+5VlIaPWN5/dfUVrnIzC4v1LvNPxn19Jprl/J9sJ+yg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725961891; c=relaxed/simple; bh=+i9ynxDFgnQ2bqUnUppiGsMfqHBSxDycc+u98cESPRY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QK53JVmZFoVW7/S4cX0gl92zSAODqnnit4SwoECaUy41B+dU6KeQeFPg72HplNneE1xi4ori8cjbwmZf3TPpvNTmoCs+DB8u3KIhgG/DYLv7BJM8PTJpDKk4fcMb6OHUeCtNzTgXzvHvdGYvuIY7UR5+A5HEtgDPon2klyehQn8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=jaR7Zmi0; 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="jaR7Zmi0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71382C4CEC3; Tue, 10 Sep 2024 09:51:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1725961890; bh=+i9ynxDFgnQ2bqUnUppiGsMfqHBSxDycc+u98cESPRY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jaR7Zmi0I+28f/GKxvLUzbui4Po3bN4h5NlajsuEKgXlOu2TPg0ywB2afP/ebpmNS qWeM4Ufwzrq05uMslyybeQL0JNtpsGG3DAACKEFyvMrFMi01zapkAN+EVPOtTqpKYb sN9uNL++xxpEC84wTkWj6/WZnuQVgidKVwvbkJF4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Pawel Dembicki , Florian Fainelli , Paolo Abeni , Sasha Levin Subject: [PATCH 6.10 196/375] net: dsa: vsc73xx: fix possible subblocks range of CAPT block Date: Tue, 10 Sep 2024 11:29:53 +0200 Message-ID: <20240910092629.086418775@linuxfoundation.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240910092622.245959861@linuxfoundation.org> References: <20240910092622.245959861@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Pawel Dembicki [ Upstream commit 8e69c96df771ab469cec278edb47009351de4da6 ] CAPT block (CPU Capture Buffer) have 7 sublocks: 0-3, 4, 6, 7. Function 'vsc73xx_is_addr_valid' allows to use only block 0 at this moment. This patch fix it. Fixes: 05bd97fc559d ("net: dsa: Add Vitesse VSC73xx DSA router driver") Signed-off-by: Pawel Dembicki Reviewed-by: Florian Fainelli Link: https://patch.msgid.link/20240903203340.1518789-1-paweldembicki@gmail.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- drivers/net/dsa/vitesse-vsc73xx-core.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/net/dsa/vitesse-vsc73xx-core.c b/drivers/net/dsa/vitesse-vsc73xx-core.c index 56bb77dbd28a..cefddcf3cc6f 100644 --- a/drivers/net/dsa/vitesse-vsc73xx-core.c +++ b/drivers/net/dsa/vitesse-vsc73xx-core.c @@ -34,7 +34,7 @@ #define VSC73XX_BLOCK_ANALYZER 0x2 /* Only subblock 0 */ #define VSC73XX_BLOCK_MII 0x3 /* Subblocks 0 and 1 */ #define VSC73XX_BLOCK_MEMINIT 0x3 /* Only subblock 2 */ -#define VSC73XX_BLOCK_CAPTURE 0x4 /* Only subblock 2 */ +#define VSC73XX_BLOCK_CAPTURE 0x4 /* Subblocks 0-4, 6, 7 */ #define VSC73XX_BLOCK_ARBITER 0x5 /* Only subblock 0 */ #define VSC73XX_BLOCK_SYSTEM 0x7 /* Only subblock 0 */ @@ -370,13 +370,19 @@ int vsc73xx_is_addr_valid(u8 block, u8 subblock) break; case VSC73XX_BLOCK_MII: - case VSC73XX_BLOCK_CAPTURE: case VSC73XX_BLOCK_ARBITER: switch (subblock) { case 0 ... 1: return 1; } break; + case VSC73XX_BLOCK_CAPTURE: + switch (subblock) { + case 0 ... 4: + case 6 ... 7: + return 1; + } + break; } return 0; -- 2.43.0