linux/drivers/counter
Cosmin Tanislav 2932095c11 counter: rz-mtu3-cnt: do not use struct rz_mtu3_channel's dev member
The counter driver can use HW channels 1 and 2, while the PWM driver can
use HW channels 0, 1, 2, 3, 4, 6, 7.

The dev member is assigned both by the counter driver and the PWM driver
for channels 1 and 2, to their own struct device instance, overwriting
the previous value.

The sub-drivers race to assign their own struct device pointer to the
same struct rz_mtu3_channel's dev member.

The dev member of struct rz_mtu3_channel is used by the counter
sub-driver for runtime PM.

Depending on the probe order of the counter and PWM sub-drivers, the
dev member may point to the wrong struct device instance, causing the
counter sub-driver to do runtime PM actions on the wrong device.

To fix this, use the parent pointer of the counter, which is assigned
during probe to the correct struct device, not the struct device pointer
inside the shared struct rz_mtu3_channel.

Cc: stable@vger.kernel.org
Fixes: 0be8907359 ("counter: Add Renesas RZ/G2L MTU3a counter driver")
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Link: https://lore.kernel.org/r/20260130122353.2263273-6-cosmin-gabriel.tanislav.xa@renesas.com
Signed-off-by: William Breathitt Gray <wbg@kernel.org>
2026-03-22 15:59:22 +09:00
..
104-quad-8.c counter: 104-quad-8: Fix incorrect return value in IRQ handler 2025-12-22 20:03:23 +09:00
counter-chrdev.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
counter-chrdev.h counter: Add character device interface 2021-10-17 10:53:52 +01:00
counter-core.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
counter-sysfs.c counter: i8254: Introduce the Intel 8254 interface library module 2023-06-08 10:11:17 -04:00
counter-sysfs.h counter: Internalize sysfs interface code 2021-10-17 10:52:58 +01:00
ftm-quaddec.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
i8254.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
intel-qep.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
interrupt-cnt.c counter: interrupt-cnt: Drop IRQF_NO_THREAD flag 2025-12-22 19:39:58 +09:00
Kconfig counter: ti-eqep: Allow eQEP driver to be built for K3 devices 2024-07-01 19:05:42 +09:00
Makefile counter: i8254: Introduce the Intel 8254 interface library module 2023-06-08 10:11:17 -04:00
microchip-tcb-capture.c counter: microchip-tcb-capture: Allow shared IRQ for multi-channel TCBs 2025-10-13 14:56:30 +09:00
rz-mtu3-cnt.c counter: rz-mtu3-cnt: do not use struct rz_mtu3_channel's dev member 2026-03-22 15:59:22 +09:00
stm32-lptimer-cnt.c counter: stm32-lptimer-cnt: fix error handling when enabling 2025-03-04 19:23:02 +09:00
stm32-timer-cnt.c counter: stm32-timer-cnt: add support for stm32mp25 2025-05-15 09:20:12 +09:00
ti-ecap-capture.c counter: ti-ecap-capture: Use devm_pm_runtime_enable() 2025-08-24 17:02:03 +09:00
ti-eqep.c counter: ti-eqep: add direction support 2025-02-05 13:22:04 +09:00