🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #7800

Re: [PATCH v8 2/2] can: dev: can_tdc_fill_info(): don't read automatic TDCV if interface is down

#7800
From: Vincent Mailhol
Date: Tue, 27 Oct 2026 08:57
30 lines
9998 bytes
On Tue. 27 Oct. 2026 at 07:54, ChunYuZhiQiang <chunyuzhiqiang@yinhe.ht> wrote:
> The automatic TDCV readback calls into the driver via do_get_auto_tdcv().
> Some drivers, such as xcan_get_auto_tdcv(), read controller registers
> without taking a runtime PM reference, so calling this while the
> interface is down can touch registers whose clocks are gated.
>
> Gate do_get_auto_tdcv() on netif_running() in can_tdc_fill_info() and
> adjust can_tdc_get_size() and can_data_bittiming_get_size() so that only
> the automatic TDCV size is skipped when the interface is down. The other
> TDC parameters are still reported, as they are meaningful while the
> interface is down.
>
> This is a defensive hardening based on code inspection; the automatic
> TDCV path has not been triggered on hardware.
> Signed-off-by: ChunYuZhiQiang <chunyuzhiqiang@yinhe.ht>

Reviewed-by: Vincent Mailhol <mailhol@kernel.org>

I think it is still preferable to add a fix tag here:

Fixes: e8060f08cd69 ("can: netlink: add can_priv::do_get_auto_tdcv()
to retrieve tdcv from device")

@Marc, not sure if b4 would automatically pick the Fixes tag. If not,
can you add it while applying?


Yours sincerely,
Vincent Mailhol
Technical Details
Message-ID: <CAMZ6RqL-3EBC=hFmpRyxcD4YA3PiMMnC3o+bAxN+ABDGqCNX6g@mail.gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-352298-linux-kernel-netdev=dewy.ru
References: <20261027065012.191348-1-chunyuzhiqiang@yinhe.ht> <20261027065012.191348-2-chunyuzhiqiang@yinhe.ht>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-352298-linux-kernel-netdev=dewy.ru
From: mailhol@kernel.org (Vincent Mailhol)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH v8 2/2] can: dev: can_tdc_fill_info(): don't read
 automatic TDCV if interface is down
Date: Tue, 27 Oct 2026 09:57:03 +0100
Organization: Usenet Network
Message-ID: <CAMZ6RqL-3EBC=hFmpRyxcD4YA3PiMMnC3o+bAxN+ABDGqCNX6g@mail.gmail.com>
References: <20261027065012.191348-1-chunyuzhiqiang@yinhe.ht> <20261027065012.191348-2-chunyuzhiqiang@yinhe.ht>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Info: usenet.network;
	logging-data="1497277"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:6F+kWa6qCHKOBx+TC+nBO8UDaIo= sha256:pFZ43LGwLPPl8kCW9ustsgPwb8FwY6+Oc3KZvIq8f08=
	sha1:XwlT6kQYwJ/sUGP1Uj5ArAK/aBM= sha256:Nt6EIg4gx+RmCdGSvKPX+GtcaGqJENNsDTf/UerHijg=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 8670A125BE1; Tue, 27 Oct 2026 11:57:56 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.739
X-Spam-Status: No, score=-3.739 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.339, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 00-S0SBX1sfC;
	Tue, 27 Oct 2026 11:57:53 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-352298-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id A292B125BDE; Tue, 27 Oct 2026 11:57:45 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id BC33C29B42; Tue, 27 Oct 2026 08:57:21 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1793091438;
	b=eU4ffFEFM/kGSQfvgMDNy7/D2ssBLdBr0CXTAgxoD7Ho3AMy6zw39kba+yPZs2Zb2bol
	 yPEPVDFGaBlwNvLQVSM8qGGJxlIVXrlGP8j5nY/r6hV8tG8SVnu+dUUiHYOLoquLKNInc
	 RLSsvYjZF60mkG9AxpHWctJXDpSJqJ52mo/gwXgEOU9d/lNcOpsO8IqgaNuas3i8FIMHU
	 mRK8r6pFfQMIYBBv9qjzN2tUji1CWNeDMlfW15vqmg8U26ukjxutAgBFF8WQXFN1+Ak0Q
	 1lnM9QoX1L739iKcrWJbD1vX2NmdtxHNoRQduagoNNMqCpabehVoeNIJsgE1VcNpxsA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793091438;
	h=X-Original-To:Received:Received:DKIM-Signature:Received:
	 X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:X-Mailing-List:
	 List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
	 List-Owner:Precedence:MIME-Version:References:In-Reply-To:From:Date:
	 X-Gmail-Original-Message-ID:X-Gm-Features:Message-ID:Subject:To:Cc:
	 Content-Type;
	bh=6wITKebm02DSzXpPmZ3P3V2j16CsSQYiy9lUQJxJN8U=;
	b=UHDYogCLe2NwNCCzlFeJ/UkLCUk0KCU22oqnSm7Cbq907DC0foVoltCKnKcWP6VqNmJk
	 sLSzYbZJMkLpMmOsNVKW/+e+DAQrTWPI0eldR9BGiOb9UhB3fpktjtiSlFsgyo7soDHdp
	 gc8LH16+skpqkdBzahFnK42ezEQ2bOB4NsSRJ5LS+YCs/OJ2rQH+AYIvJin7bpihmS8Z4
	 P6iwJKX9Plv6KsXlAIsfloLz5Vehko8n9rgHk3oHi1hhBDRGpD4Tdt0utLpgocz8mWEKu
	 7oYKA5AiJK3cg+f1YUi+hSviUD5Nlqy+ARnGpZr2ZpTQ3xcu0pT0oCIZK+yvQsvs5uA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=V4GW3Wuq;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 58338606A324;
	Tue, 27 Oct 2026 08:57:18 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=V4GW3Wuq
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793091437;
	b=QsvGxSHDl4AA1wSwIiK23or7aAh7dKSDBno/klkqq9nZAl6DjKDVZSxiW4ZsawL7eh5E
	 QocR6gKap1UGNtqGi0xXIKFBjiZrG+QG9/p4PDIhn7wpJj5y6X7gGDqUQ9CPVT6xpztLt
	 xiGnJ2QhLa1ewHKVvbIcg8vcmPDtJ5LaFGvCRY74AXp88XaZTyIEYX5DxfDUYaE0zDclt
	 7/cfmpU8YzCRv7XKILFNXHKcqBXhbJsVmQGEDLNosLsI1x06HBJYlSo5B2yXkrlBvB/kc
	 xg4s9XvOqdCnonpqHe/G+uvtqAtWR4upLfaYbH2Owt2vOGW0sb7dNGi0WXP3BsN359Q==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793091437;
	h=Received:DKIM-Signature:Received:X-Forwarded-Encrypted:
	 X-Gm-Message-State:X-Received:MIME-Version:References:In-Reply-To:
	 From:Date:X-Gmail-Original-Message-ID:X-Gm-Features:Message-ID:
	 Subject:To:Cc:Content-Type;
	bh=6wITKebm02DSzXpPmZ3P3V2j16CsSQYiy9lUQJxJN8U=;
	b=Imes6GD1CuEOdLXRhzVK5o0o0DNo2vfObigmPugjBtN55RVYdDsejKxUmTyN5rTAq13G
	 AO4qbhTzTcQWqexfw80y4OQccRIf++Y2ZxVyB44a2Sj1MnMQYxDzpdPPxzu745zfrNk+O
	 0EAaXeziibmiM8gLodRNJ+pVsX0qrASUM8skpkKC7dXYmTWTI1+7dliZbrwvoowYCMDYE
	 XkORX3KhmrzCXXU3ed/7uktD4Kpzj4OYJnazv1wby7/cb/XPecjU8Ab0/n4UxPnEU+pI5
	 9QqUuWUQ6EQSvEBrk4bewA7SLgttNFuOt7ht/lU6z2xI/SnnTHY6f0lB97hiqHkCaiQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=V4GW3Wuq;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 00867606A336
	for <netdev@vger.kernel.org>; Tue, 27 Oct 2026 08:57:16 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F18C1F031EB
	for <netdev@vger.kernel.org>; Tue, 27 Oct 2026 08:57:16 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1793091436;
	bh=6wITKebm02DSzXpPmZ3P3V2j16CsSQYiy9lUQJxJN8U=;
	h=References:In-Reply-To:From:Date:Subject:To:Cc;
	b=V4GW3WuqA1XYC/547F3eUifA0z7vD2uXvpN63zCquHskOT2Zo493D1JHPzLZlRnkq
	 VNCh8MnVlTRqRqx7mFV4t1BjhzjIPwf4lbFj2lV28Q6rxYC+jgV7QxW+YFHZfUdBDx
	 1lhX/yGO+8Uz5KApL5qQ8gqEIbSbzOhyoh3eqn3Ug3Yhkw2WSoTQKFpT919Iu5feu8
	 62+632WqXlG3Qyu1rccUppgRDQmGOebR3y8hlBj3RW2Ip7GuDLCmHe+6zff8jXHhWc
	 p0Kzq3iBNmgcL4Z+TI3GssdSxUbcRPle7SmpmRxfnsBSkinvo0uaTd/7BwS8rzLyd7
	 1uUzVMiY81BRw==
X-Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-c34bff61551so569741866b.2
        for <netdev@vger.kernel.org>; Tue, 27 Oct 2026 01:57:16 -0700 (PDT)
X-Forwarded-Encrypted: i=1; AKwUvBzJrwrcktQKQOz7F4AZVVW09Yxg+A9LTue1fHZbsBDHkMrpOJh3nOXuooSFQWnIhToi7zOVmnY=@vger.kernel.org
X-Gm-Message-State: AFq9FYK3yQHWKKcw7Fkpy+nmFi0llvKNU5xzjhXBDrF2WCnpfou5RbCB
	jhksQ+vOJyARnsCKmn1x1sg28qJTjjp7Jy4PxtxPJuks+oXctoRsDX/o/2f7x0jurH2uj+QWG+X
	LCoaivaZGcQmMCCV9NxBAaJeduzX7EzQ=
X-Received: by 2002:a17:907:780a:b0:c49:9383:a28 with SMTP id
 a640c23a62f3a-c4993831289mr306624266b.35.1793091435523; Tue, 27 Oct 2026
 01:57:15 -0700 (PDT)
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261027065012.191348-2-chunyuzhiqiang@yinhe.ht>
X-Gmail-Original-Message-ID: <CAMZ6RqL-3EBC=hFmpRyxcD4YA3PiMMnC3o+bAxN+ABDGqCNX6g@mail.gmail.com>
X-Gm-Features: AclHuK_4fAhpPs6TY0ZmiWtv2y46siAzZORz3V1x1x_oFVRYvygyfl06H0jKtk0
X-Cc: netdev-bot+sinfo@kernel.org, netdev@vger.kernel.org, 
	linux-can@vger.kernel.org, mkl@pengutronix.de, kernel@pengutronix.de, 
	haibo.chen@oss.nxp.com, shawnguo@kernel.org, imx@lists.linux.dev, 
	stable@vger.kernel.org