From patchwork Wed Sep 4 09:38:45 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: 13790270 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 EAC4F1CF5E7 for ; Wed, 4 Sep 2024 09:43:31 +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=1725443013; cv=none; b=KoVkK++BNuBSw+YwE7llUt09tYoqOJpWFIlNe7yn0+7TrWgKQ+YYfWzgxtJNxrBKqUsPT45QmAIZad0W5PAqoYXkhfz6EDukqAV3tTeNC0pOBegE9tUPWqLcBpIekDOyF3wvh02lTM6rDioZoUIOViMZZJ7ekPXQQLesZsLwESM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725443013; c=relaxed/simple; bh=3ptH2n7r/gVscgLaWDzzanS1BG1v/bLRzofb0SP59uc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=p5+e/TOxCTQ9VSpvP+i8s9A6j5vgPwtwZDFZcqUInMZBvf00lOzYel0/vRITX3AHiSX4QermGEWELLdlhLaMLs+nAj63FZG34XN5xcv0CFQaYIwv9VAoWPsdtJhKFQeU20VqoUHxyaYuX45G3gIIhMhQ8m9kpFM5sSBQGcUJ35k= 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 1slmXy-0005t5-DW for netdev@vger.kernel.org; Wed, 04 Sep 2024 11:43:30 +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 1slmXx-005QFO-Ul for netdev@vger.kernel.org; Wed, 04 Sep 2024 11:43:30 +0200 Received: from dspam.blackshift.org (localhost [127.0.0.1]) by bjornoya.blackshift.org (Postfix) with SMTP id 5D42F3323E7 for ; Wed, 04 Sep 2024 09:42:26 +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 D6EC4332368; Wed, 04 Sep 2024 09:42:22 +0000 (UTC) Received: from blackshift.org (localhost [::1]) by hardanger.blackshift.org (OpenSMTPD) with ESMTP id 4adc3eb7; Wed, 4 Sep 2024 09:42:22 +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 10/20] can: rockchip_canfd: rkcanfd_register_done(): add warning for erratum 5 Date: Wed, 4 Sep 2024 11:38:45 +0200 Message-ID: <20240904094218.1925386-11-mkl@pengutronix.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240904094218.1925386-1-mkl@pengutronix.de> References: <20240904094218.1925386-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)