From patchwork Wed Sep 4 12:55:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Kleine-Budde X-Patchwork-Id: 13790840 X-Patchwork-Delegate: kuba@kernel.org Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 739611DB54A for ; Wed, 4 Sep 2024 13:03:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725454993; cv=none; b=VOsxqAmY3DUKHzb6f/DXtUnpldp607qvPQK+6OWtQukMqsOQkzhfn7/rS4a4Roec+lCAIgW8S1FEMfK7gMg8Vah3nqZP0nFVRjIGTlWFS7W2GKNYV3k72w6PCD2WrfGYScZ4rRrwqTQZ/wJ17leLDmL1pnT1+uMCb/9TXLcCQlI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725454993; c=relaxed/simple; bh=3ptH2n7r/gVscgLaWDzzanS1BG1v/bLRzofb0SP59uc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BWfVrW/rX+/OZkzLvsERqemtT59plljeji9QsyjhjuZFrLgsfRtM3NXs5uepf2o8vQXFS+dnkLsVJHx8NyXEo75FV1usCJ7sjEPnYE70ZTMPEydVLeMLZfwzy6yD2PlcDvYhrurG9J6dai8z/KRz8IvfglHTdpKb33ua6YN/zNI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1slpfB-00071M-81 for netdev@vger.kernel.org; Wed, 04 Sep 2024 15:03:09 +0200 Received: from [2a0a:edc0:0:b01:1d::7b] (helo=bjornoya.blackshift.org) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1slpf6-005SWd-Az for netdev@vger.kernel.org; Wed, 04 Sep 2024 15:03:04 +0200 Received: from dspam.blackshift.org (localhost [127.0.0.1]) by bjornoya.blackshift.org (Postfix) with SMTP id E8B7D3327E8 for ; Wed, 04 Sep 2024 13:03:03 +0000 (UTC) Received: from hardanger.blackshift.org (unknown [172.20.34.65]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by bjornoya.blackshift.org (Postfix) with ESMTPS id 7183933276E; Wed, 04 Sep 2024 13:03:00 +0000 (UTC) Received: from blackshift.org (localhost [::1]) by hardanger.blackshift.org (OpenSMTPD) with ESMTP id fdb45ed1; Wed, 4 Sep 2024 13:02:59 +0000 (UTC) From: Marc Kleine-Budde To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, linux-can@vger.kernel.org, kernel@pengutronix.de, Marc Kleine-Budde , Alibek Omarov , Heiko Stuebner Subject: [PATCH net-next 08/18] can: rockchip_canfd: rkcanfd_register_done(): add warning for erratum 5 Date: Wed, 4 Sep 2024 14:55:24 +0200 Message-ID: <20240904130256.1965582-9-mkl@pengutronix.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240904130256.1965582-1-mkl@pengutronix.de> References: <20240904130256.1965582-1-mkl@pengutronix.de> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Tests on the rk3568v2 and rk3568v3 show that a reduced "baudclk" (e.g. 80MHz, compared to the standard 300MHz) significantly increases the possibility of incorrect FIFO counters, i.e. erratum 5. Print an info message if the clock is below the known good value of 300MHz. Tested-by: Alibek Omarov Acked-by: Heiko Stuebner Link: https://patch.msgid.link/20240904-rockchip-canfd-v5-10-8ae22bcb27cc@pengutronix.de Signed-off-by: Marc Kleine-Budde --- drivers/net/can/rockchip/rockchip_canfd-core.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/can/rockchip/rockchip_canfd-core.c b/drivers/net/can/rockchip/rockchip_canfd-core.c index 40911bb63623..d6c0f2fe8d2b 100644 --- a/drivers/net/can/rockchip/rockchip_canfd-core.c +++ b/drivers/net/can/rockchip/rockchip_canfd-core.c @@ -738,6 +738,13 @@ static void rkcanfd_register_done(const struct rkcanfd_priv *priv) FIELD_GET(RKCANFD_REG_RTL_VERSION_MAJOR, dev_id), FIELD_GET(RKCANFD_REG_RTL_VERSION_MINOR, dev_id), priv->devtype_data.quirks); + + if (priv->devtype_data.quirks & RKCANFD_QUIRK_RK3568_ERRATUM_5 && + priv->can.clock.freq < RKCANFD_ERRATUM_5_SYSCLOCK_HZ_MIN) + netdev_info(priv->ndev, + "Erratum 5: CAN clock frequency (%luMHz) lower than known good (%luMHz), expect degraded performance\n", + priv->can.clock.freq / MEGA, + RKCANFD_ERRATUM_5_SYSCLOCK_HZ_MIN / MEGA); } static int rkcanfd_register(struct rkcanfd_priv *priv)