diff options
| author | ChunYuZhiQiang <chunyuzhiqiang@yinhe.ht> | 2026-10-27 14:50:12 +0800 |
|---|---|---|
| committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2026-11-03 19:54:30 +0100 |
| commit | f5128a76726105f398d7ee70ee523dd4f68d62f4 (patch) | |
| tree | a0cd96f6087470c9980e1d2ceca78bee671709af /include/uapi/linux/errqueue.h | |
| parent | 75332c410c8190d61499001c5516af977ca426c3 (diff) | |
can: dev: can_tdc_fill_info(): don't read automatic TDCV if interface is down
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>
Fixes: e8060f08cd69 ("can: netlink: add can_priv::do_get_auto_tdcv() to retrieve tdcv from device")
Link: https://patch.msgid.link/20261027065012.191348-2-chunyuzhiqiang@yinhe.ht
[mkl: fix open parenthesis alignment]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'include/uapi/linux/errqueue.h')
0 files changed, 0 insertions, 0 deletions
