<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/counter, branch v7.2-rc1</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v7.2-rc1</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v7.2-rc1'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-06-08T19:26:09+00:00</updated>
<entry>
<title>Merge tag 'counter-updates-for-7.2' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/wbg/counter into char-misc-next</title>
<updated>2026-06-08T19:26:09+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2026-06-08T19:26:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=099b02d3ddabc4b1764976670816621ee82ea656'/>
<id>urn:sha1:099b02d3ddabc4b1764976670816621ee82ea656</id>
<content type='text'>
William writes:

Counter updates for 7.2

Manual mutex lock logic is replaced by lock guards in intel-qep.
Additionally, devm_mutex_init() is now used in ftm-quaddec,
interrupt-cnt, and intel-qep to handle mutex cleanup automatically.

* tag 'counter-updates-for-7.2' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/wbg/counter:
  counter: intel-qep: Use devm_mutex_init()
  counter: interrupt-cnt: use devm_mutex_init()
  counter: ftm-quaddec: use devm_mutex_init()
  counter: intel-qep: Replace manual mutex logic with lock guards
</content>
</entry>
<entry>
<title>counter: intel-qep: Use devm_mutex_init()</title>
<updated>2026-05-27T22:16:46+00:00</updated>
<author>
<name>Ilpo Järvinen</name>
<email>ilpo.jarvinen@linux.intel.com</email>
</author>
<published>2026-05-20T11:18:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ca815bb87064a8f68b00eaf8872ef0d4a33a5bf7'/>
<id>urn:sha1:ca815bb87064a8f68b00eaf8872ef0d4a33a5bf7</id>
<content type='text'>
intel_qep_probe() calls mutex_init() but lacks the pairing
mutex_destroy() calls. Convert to devm_mutex_init() which handles
cleanup automatically.

Signed-off-by: Ilpo Järvinen &lt;ilpo.jarvinen@linux.intel.com&gt;
Reviewed-by: Joshua Crofts &lt;joshua.crofts1@gmail.com&gt;
Reviewed-by: Stepan Ionichev &lt;sozdayvek@gmail.com&gt;
Link: https://lore.kernel.org/r/20260520111813.3934-1-ilpo.jarvinen@linux.intel.com
Signed-off-by: William Breathitt Gray &lt;wbg@kernel.org&gt;
</content>
</entry>
<entry>
<title>counter: interrupt-cnt: use devm_mutex_init()</title>
<updated>2026-05-27T22:13:33+00:00</updated>
<author>
<name>Stepan Ionichev</name>
<email>sozdayvek@gmail.com</email>
</author>
<published>2026-05-23T18:44:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4d9a902be374aea023f2193f729c26612e56b542'/>
<id>urn:sha1:4d9a902be374aea023f2193f729c26612e56b542</id>
<content type='text'>
interrupt_cnt_probe() calls mutex_init() but neither this driver
nor the counter core issues a matching mutex_destroy() on unbind,
so the lock debug state is leaked.

Switch to devm_mutex_init() so the mutex is torn down in the same
devm scope it was set up in.

Signed-off-by: Stepan Ionichev &lt;sozdayvek@gmail.com&gt;
Reviewed-by: Joshua Crofts &lt;joshua.crofts1@gmail.com&gt;
Link: https://lore.kernel.org/r/20260523184418.7586-1-sozdayvek@gmail.com
Signed-off-by: William Breathitt Gray &lt;wbg@kernel.org&gt;
</content>
</entry>
<entry>
<title>counter: ftm-quaddec: use devm_mutex_init()</title>
<updated>2026-05-27T22:12:18+00:00</updated>
<author>
<name>Stepan Ionichev</name>
<email>sozdayvek@gmail.com</email>
</author>
<published>2026-05-23T18:43:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b400c076fe4b63576fa22fbb59078b030000970c'/>
<id>urn:sha1:b400c076fe4b63576fa22fbb59078b030000970c</id>
<content type='text'>
ftm_quaddec_probe() calls mutex_init() but neither the cleanup
action nor a remove callback issues a matching mutex_destroy(),
so the lock debug state is leaked on driver unbind.

Switch to devm_mutex_init() so the mutex is torn down in the same
devm scope it was set up in.

Signed-off-by: Stepan Ionichev &lt;sozdayvek@gmail.com&gt;
Reviewed-by: Joshua Crofts &lt;joshua.crofts1@gmail.com&gt;
Link: https://lore.kernel.org/r/20260523184351.7567-1-sozdayvek@gmail.com
Signed-off-by: William Breathitt Gray &lt;wbg@kernel.org&gt;
</content>
</entry>
<entry>
<title>counter: intel-qep: Replace manual mutex logic with lock guards</title>
<updated>2026-05-15T06:17:40+00:00</updated>
<author>
<name>Joao Paulo Menezes Linaris</name>
<email>jplinaris@usp.br</email>
</author>
<published>2026-05-12T17:30:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ee4133b921a17b239ca617e9b0c16cad1277e9fd'/>
<id>urn:sha1:ee4133b921a17b239ca617e9b0c16cad1277e9fd</id>
<content type='text'>
Use guard() for handling mutex lock instead of locking and unlocking
mutex explicitly. This improves readability by eliminating the need for
gotos and by clearly indicating mutex will be locked only when
execution is in guard scope.

Signed-off-by: Joao Paulo Menezes Linaris &lt;jplinaris@usp.br&gt;
Co-developed-by: Guilherme Dias &lt;guilhermeabreu200105@usp.br&gt;
Signed-off-by: Guilherme Dias &lt;guilhermeabreu200105@usp.br&gt;
Reviewed-by: Ilpo Järvinen &lt;ilpo.jarvinen@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20260512173058.14858-1-jplinaris@usp.br
Signed-off-by: William Breathitt Gray &lt;wbg@kernel.org&gt;
</content>
</entry>
<entry>
<title>counter: Fix refcount leak in counter_alloc() error path</title>
<updated>2026-05-03T04:48:39+00:00</updated>
<author>
<name>Guangshuo Li</name>
<email>lgs201920130244@gmail.com</email>
</author>
<published>2026-04-13T13:46:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d9eeb0ea0d2de658663bfaa9c26eccdd8fd64440'/>
<id>urn:sha1:d9eeb0ea0d2de658663bfaa9c26eccdd8fd64440</id>
<content type='text'>
After device_initialize(), the lifetime of the embedded struct device
is expected to be managed through the device core reference counting.

In counter_alloc(), if dev_set_name() fails after device_initialize(),
the error path removes the chrdev, frees the ID, and frees the backing
allocation directly instead of releasing the device reference with
put_device(). This bypasses the normal device lifetime rules and may
leave the reference count of the embedded struct device unbalanced,
resulting in a refcount leak.

The issue was identified by a static analysis tool I developed and
confirmed by manual review.

Fix this by using put_device() in the dev_set_name() failure path and
let counter_device_release() handle the final cleanup.

Fixes: 4da08477ea1f ("counter: Set counter device name")
Cc: stable@vger.kernel.org
Signed-off-by: Guangshuo Li &lt;lgs201920130244@gmail.com&gt;
Link: https://lore.kernel.org/r/20260413134604.2861772-1-lgs201920130244@gmail.com
Signed-off-by: William Breathitt Gray &lt;wbg@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'v7.0-rc7' into char-misc-next</title>
<updated>2026-04-06T07:04:53+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2026-04-06T07:04:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a5210135489ae7bc1ef1cb4a8157361dd7b468cd'/>
<id>urn:sha1:a5210135489ae7bc1ef1cb4a8157361dd7b468cd</id>
<content type='text'>
We need the char/misc/iio/comedi fixes in here as well for testing

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>counter: rz-mtu3-cnt: do not use struct rz_mtu3_channel's dev member</title>
<updated>2026-03-22T06:59:22+00:00</updated>
<author>
<name>Cosmin Tanislav</name>
<email>cosmin-gabriel.tanislav.xa@renesas.com</email>
</author>
<published>2026-01-30T12:23:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2932095c114b98cbb40ccf34fc00d613cb17cead'/>
<id>urn:sha1:2932095c114b98cbb40ccf34fc00d613cb17cead</id>
<content type='text'>
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: 0be8907359df ("counter: Add Renesas RZ/G2L MTU3a counter driver")
Signed-off-by: Cosmin Tanislav &lt;cosmin-gabriel.tanislav.xa@renesas.com&gt;
Link: https://lore.kernel.org/r/20260130122353.2263273-6-cosmin-gabriel.tanislav.xa@renesas.com
Signed-off-by: William Breathitt Gray &lt;wbg@kernel.org&gt;
</content>
</entry>
<entry>
<title>counter: rz-mtu3-cnt: prevent counter from being toggled multiple times</title>
<updated>2026-03-22T06:59:22+00:00</updated>
<author>
<name>Cosmin Tanislav</name>
<email>cosmin-gabriel.tanislav.xa@renesas.com</email>
</author>
<published>2026-01-30T12:23:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=67c3f99bed6f422ba343d2b70a2eeeccdfd91bef'/>
<id>urn:sha1:67c3f99bed6f422ba343d2b70a2eeeccdfd91bef</id>
<content type='text'>
Runtime PM counter is incremented / decremented each time the sysfs
enable file is written to.

If user writes 0 to the sysfs enable file multiple times, runtime PM
usage count underflows, generating the following message.

rz-mtu3-counter rz-mtu3-counter.0: Runtime PM usage count underflow!

At the same time, hardware registers end up being accessed with clocks
off in rz_mtu3_terminate_counter() to disable an already disabled
channel.

If user writes 1 to the sysfs enable file multiple times, runtime PM
usage count will be incremented each time, requiring the same number of
0 writes to get it back to 0.

If user writes 0 to the sysfs enable file while PWM is in progress, PWM
is stopped without counter being the owner of the underlying MTU3
channel.

Check against the cached count_is_enabled value and exit if the user
is trying to set the same enable value.

Cc: stable@vger.kernel.org
Fixes: 0be8907359df ("counter: Add Renesas RZ/G2L MTU3a counter driver")
Signed-off-by: Cosmin Tanislav &lt;cosmin-gabriel.tanislav.xa@renesas.com&gt;
Link: https://lore.kernel.org/r/20260130122353.2263273-5-cosmin-gabriel.tanislav.xa@renesas.com
Signed-off-by: William Breathitt Gray &lt;wbg@kernel.org&gt;
</content>
</entry>
<entry>
<title>counter: sysfs: remove double return in counter_sysfs_attr_add()</title>
<updated>2026-03-21T13:41:51+00:00</updated>
<author>
<name>Cosmin Tanislav</name>
<email>cosmin-gabriel.tanislav.xa@renesas.com</email>
</author>
<published>2026-02-04T18:00:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cbf8db23fc58db8d516ebc7aa57c4563f36532b9'/>
<id>urn:sha1:cbf8db23fc58db8d516ebc7aa57c4563f36532b9</id>
<content type='text'>
sysfs attribute creation for counter extensions has been consolidated
into a single function, counter_sysfs_exts_add().

Inside counter_sysfs_attr_add(), although the code was changed to return
the result of counter_sysfs_exts_add(), an unreachable return 0;
statement was left at the end of the function.

Remove it.

Fixes: bb4bbbec664f ("counter: Consolidate Counter extension sysfs attribute creation")
Signed-off-by: Cosmin Tanislav &lt;cosmin-gabriel.tanislav.xa@renesas.com&gt;
Link: https://lore.kernel.org/r/20260204180032.514328-1-cosmin-gabriel.tanislav.xa@renesas.com
Signed-off-by: William Breathitt Gray &lt;wbg@kernel.org&gt;
</content>
</entry>
</feed>
