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 72AEF18C034; Thu, 17 Apr 2025 18:29:04 +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=1744914544; cv=none; b=Cj4ff2tXYSPTvMHDHcRsO+DAlw/tB+vUvYc0GlCUgF7uQPxZu9Nt//Kjmf3z2BirW4yJTwhag+C1GI+Nrpcwjd89loA7UVCbf7sOK+eoe2k/S1niuwit0N8vlS8WYy47aJgzojorfLSa/JAtmX5LBA/KIziDWsBP52HWafg31tI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744914544; c=relaxed/simple; bh=u2sMMrf16IdE8Ua1wWl4dVriGe5h8veVWFK1OJDzp7Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=evcBqMVdU9QgDlZukt05JA2QqdBnpXKHSFQZhSJsh4TXh5BSDHEZJP9jMzksWyfIeQ0RfhFH244Rg3KiCSo+jDw+VkF0MU8x3Ajy0o35bZS7JLVutWJ/lC6TTsMFkfhVmlDojJry+4iRG8EJjjGpzxMy0fX1Nrw2pxv7sGCUu4o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=yAL4Cb1n; 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="yAL4Cb1n" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BEF2FC4CEE4; Thu, 17 Apr 2025 18:29:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1744914544; bh=u2sMMrf16IdE8Ua1wWl4dVriGe5h8veVWFK1OJDzp7Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yAL4Cb1n+jZ3EVZVZLyl4nIFXkLaLcuIh57Tz4frR7xnqtQfFRui6vvUZJXaT2LR9 73BzNPMCB0WVEllzFFDJaYzvgZIR5sa4vtEyStCgdoLp6Av7WHyiAVpIORvZakwEBk oz1hUjbSzW/8k4nNK0huytUQCJ9oO+2v8IvcXRrc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Marek=20Beh=C3=BAn?= , Andrew Lunn , Jakub Kicinski Subject: [PATCH 6.13 251/414] net: dsa: mv88e6xxx: workaround RGMII transmit delay erratum for 6320 family Date: Thu, 17 Apr 2025 19:50:09 +0200 Message-ID: <20250417175121.515219292@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250417175111.386381660@linuxfoundation.org> References: <20250417175111.386381660@linuxfoundation.org> User-Agent: quilt/0.68 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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.13-stable review patch. If anyone has any objections, please let me know. ------------------ From: Marek BehĂșn commit 1ebc8e1ef906db9c08e9abe9776d85ddec837725 upstream. Implement the workaround for erratum 3.3 RGMII timing may be out of spec when transmit delay is enabled for the 6320 family, which says: When transmit delay is enabled via Port register 1 bit 14 = 1, duty cycle may be out of spec. Under very rare conditions this may cause the attached device receive CRC errors. Signed-off-by: Marek BehĂșn Cc: # 5.4.x Reviewed-by: Andrew Lunn Link: https://patch.msgid.link/20250317173250.28780-8-kabel@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/dsa/mv88e6xxx/chip.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -3690,6 +3690,21 @@ static int mv88e6xxx_stats_setup(struct return mv88e6xxx_g1_stats_clear(chip); } +static int mv88e6320_setup_errata(struct mv88e6xxx_chip *chip) +{ + u16 dummy; + int err; + + /* Workaround for erratum + * 3.3 RGMII timing may be out of spec when transmit delay is enabled + */ + err = mv88e6xxx_port_hidden_write(chip, 0, 0xf, 0x7, 0xe000); + if (err) + return err; + + return mv88e6xxx_port_hidden_read(chip, 0, 0xf, 0x7, &dummy); +} + /* Check if the errata has already been applied. */ static bool mv88e6390_setup_errata_applied(struct mv88e6xxx_chip *chip) { @@ -5146,6 +5161,7 @@ static const struct mv88e6xxx_ops mv88e6 static const struct mv88e6xxx_ops mv88e6320_ops = { /* MV88E6XXX_FAMILY_6320 */ + .setup_errata = mv88e6320_setup_errata, .ieee_pri_map = mv88e6085_g1_ieee_pri_map, .ip_pri_map = mv88e6085_g1_ip_pri_map, .irl_init_all = mv88e6352_g2_irl_init_all, @@ -5195,6 +5211,7 @@ static const struct mv88e6xxx_ops mv88e6 static const struct mv88e6xxx_ops mv88e6321_ops = { /* MV88E6XXX_FAMILY_6320 */ + .setup_errata = mv88e6320_setup_errata, .ieee_pri_map = mv88e6085_g1_ieee_pri_map, .ip_pri_map = mv88e6085_g1_ip_pri_map, .irl_init_all = mv88e6352_g2_irl_init_all,