<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/counter, branch v5.16-rc1</title>
<subtitle>Linux Kernel (branches are rebased on master from time to time)</subtitle>
<id>https://sre.ring0.de/linux/atom?h=v5.16-rc1</id>
<link rel='self' href='https://sre.ring0.de/linux/atom?h=v5.16-rc1'/>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/'/>
<updated>2021-10-21T11:02:47Z</updated>
<entry>
<title>counter: Fix use-after-free race condition for events_queue_size write</title>
<updated>2021-10-21T11:02:47Z</updated>
<author>
<name>William Breathitt Gray</name>
<email>vilhelm.gray@gmail.com</email>
</author>
<published>2021-10-21T10:35:40Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=8ac33b8b6841e99a624ace543d92cbf598a91381'/>
<id>urn:sha1:8ac33b8b6841e99a624ace543d92cbf598a91381</id>
<content type='text'>
A race condition is possible when writing to events_queue_size where the
events kfifo is freed during the execution of a kfifo_in(), resulting in
a use-after-free. This patch prevents such a scenario by protecting the
events queue in operation with a spinlock and locking before performing
the events queue size adjustment.

The existing events_lock mutex is renamed to events_out_lock to reflect
that it only protects events queue out operations. Because the events
queue in operations can occur in an interrupt context, a new
events_in_lock spinlock is introduced and utilized.

Fixes: feff17a550c7 ("counter: Implement events_queue_size sysfs attribute")
Cc: David Lechner &lt;david@lechnology.com&gt;
Signed-off-by: William Breathitt Gray &lt;vilhelm.gray@gmail.com&gt;
Link: https://lore.kernel.org/r/20211021103540.955639-1-vilhelm.gray@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>counter: Cleanup lingering atomic.h includes</title>
<updated>2021-10-21T11:02:45Z</updated>
<author>
<name>William Breathitt Gray</name>
<email>vilhelm.gray@gmail.com</email>
</author>
<published>2021-10-21T10:35:14Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=310e75c72fefa3b0b4535f669c8b37c963a2dba5'/>
<id>urn:sha1:310e75c72fefa3b0b4535f669c8b37c963a2dba5</id>
<content type='text'>
With the removal of the chrdev_lock atomic flag, the counter-sysfs.c and
counter-chrdev.c no longer needs to include the atomic.h header file.

Signed-off-by: William Breathitt Gray &lt;vilhelm.gray@gmail.com&gt;
Link: https://lore.kernel.org/r/20211021103514.955622-1-vilhelm.gray@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>counter: drop chrdev_lock</title>
<updated>2021-10-19T09:36:28Z</updated>
<author>
<name>David Lechner</name>
<email>david@lechnology.com</email>
</author>
<published>2021-10-17T18:55:21Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=f5245a5fdf757f50a6c905fc16cceb1a6146ccf5'/>
<id>urn:sha1:f5245a5fdf757f50a6c905fc16cceb1a6146ccf5</id>
<content type='text'>
This removes the chrdev_lock from the counter subsystem. This was
intended to prevent opening the chrdev more than once. However, this
doesn't work in practice since userspace can duplicate file descriptors
and pass file descriptors to other processes. Since this protection
can't be relied on, it is best to just remove it.

Suggested-by: Greg KH &lt;gregkh@linuxfoundation.org&gt;
Acked-by: William Breathitt Gray &lt;vilhelm.gray@gmail.com&gt;
Signed-off-by: David Lechner &lt;david@lechnology.com&gt;
Link: https://lore.kernel.org/r/20211017185521.3468640-1-david@lechnology.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>counter/counter-sysfs: use sysfs_emit everywhere</title>
<updated>2021-10-19T07:40:49Z</updated>
<author>
<name>David Lechner</name>
<email>david@lechnology.com</email>
</author>
<published>2021-10-17T19:01:06Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=c3ed761c9e1e4987406671b326dab48a048614ee'/>
<id>urn:sha1:c3ed761c9e1e4987406671b326dab48a048614ee</id>
<content type='text'>
In the counter subsystem, we are already using sysfs_emit(), but there
were a few places where we were still using sprintf() in *_show()
functions. For consistency and added protections, use sysfs_emit()
everywhere.

Suggested-by: Greg KH &lt;gregkh@linuxfoundation.org&gt;
Acked-by: William Breathitt Gray &lt;vilhelm.gray@gmail.com&gt;
Signed-off-by: David Lechner &lt;david@lechnology.com&gt;
Link: https://lore.kernel.org/r/20211017190106.3472645-1-david@lechnology.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>counter: microchip-tcb-capture: Tidy up a false kernel-doc /** marking.</title>
<updated>2021-10-17T09:56:31Z</updated>
<author>
<name>Jonathan Cameron</name>
<email>Jonathan.Cameron@huawei.com</email>
</author>
<published>2021-09-30T17:03:47Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=fe90fcabc852378a808bea713064da6ed2058ad2'/>
<id>urn:sha1:fe90fcabc852378a808bea713064da6ed2058ad2</id>
<content type='text'>
Deals with
W=1 warning This comment starts with '/**', but isn't a kernel-doc comment.

Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Cc: Kamel Bouhara &lt;kamel.bouhara@bootlin.com&gt;
Cc: William Breathitt Gray &lt;vilhelm.gray@gmail.com&gt;
Acked-by: William Breathitt Gray &lt;vilhelm.gray@gmail.com&gt;
Link: https://lore.kernel.org/r/20210930170347.101153-1-jic23@kernel.org
</content>
</entry>
<entry>
<title>counter: 104-quad-8: Add IRQ support for the ACCES 104-QUAD-8</title>
<updated>2021-10-17T09:55:55Z</updated>
<author>
<name>William Breathitt Gray</name>
<email>vilhelm.gray@gmail.com</email>
</author>
<published>2021-09-29T03:16:06Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=7aa2ba0df651e3193c24b5da4887759ed788578c'/>
<id>urn:sha1:7aa2ba0df651e3193c24b5da4887759ed788578c</id>
<content type='text'>
The LSI/CSI LS7266R1 chip provides programmable output via the FLG pins.
When interrupts are enabled on the ACCES 104-QUAD-8, they occur whenever
FLG1 is active. Four functions are available for the FLG1 signal: Carry,
Compare, Carry-Borrow, and Index.

	Carry:
		Interrupt generated on active low Carry signal. Carry
		signal toggles every time the respective channel's
		counter overflows.

	Compare:
		Interrupt generated on active low Compare signal.
		Compare signal toggles every time respective channel's
		preset register is equal to the respective channel's
		counter.

	Carry-Borrow:
		Interrupt generated on active low Carry signal and
		active low Borrow signal. Carry signal toggles every
		time the respective channel's counter overflows. Borrow
		signal toggles every time the respective channel's
		counter underflows.

	Index:
		Interrupt generated on active high Index signal.

These four functions correspond respectivefly to the following four
Counter event types: COUNTER_EVENT_OVERFLOW, COUNTER_EVENT_THRESHOLD,
COUNTER_EVENT_OVERFLOW_UNDERFLOW, and COUNTER_EVENT_INDEX. Interrupts
push Counter events to event channel X, where 'X' is the respective
channel whose FLG1 activated.

This patch adds IRQ support for the ACCES 104-QUAD-8. The interrupt line
numbers for the devices may be configured via the irq array module
parameter.

Acked-by: Syed Nayyar Waris &lt;syednwaris@gmail.com&gt;
Signed-off-by: William Breathitt Gray &lt;vilhelm.gray@gmail.com&gt;
Link: https://lore.kernel.org/r/e3a28e100840e3a336fa93fce77445f0e9d9a674.1632884256.git.vilhelm.gray@gmail.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>counter: 104-quad-8: Replace mutex with spinlock</title>
<updated>2021-10-17T09:55:43Z</updated>
<author>
<name>William Breathitt Gray</name>
<email>vilhelm.gray@gmail.com</email>
</author>
<published>2021-09-29T03:16:05Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=09db4678bfbb429df259e1ce43854a0e2720c355'/>
<id>urn:sha1:09db4678bfbb429df259e1ce43854a0e2720c355</id>
<content type='text'>
This patch replaces the mutex I/O lock with a spinlock. This is in
preparation for a subsequent patch adding IRQ support for 104-QUAD-8
devices; we can't sleep in an interrupt context, so we'll need to use a
spinlock instead.

Acked-by: Syed Nayyar Waris &lt;syednwaris@gmail.com&gt;
Signed-off-by: William Breathitt Gray &lt;vilhelm.gray@gmail.com&gt;
Link: https://lore.kernel.org/r/3f74491dec66de10d062978bcb7b9c2b3bdea86c.1632884256.git.vilhelm.gray@gmail.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>counter: Implement events_queue_size sysfs attribute</title>
<updated>2021-10-17T09:55:01Z</updated>
<author>
<name>William Breathitt Gray</name>
<email>vilhelm.gray@gmail.com</email>
</author>
<published>2021-09-29T03:16:04Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=feff17a550c7120009d8ba9431426135661a731b'/>
<id>urn:sha1:feff17a550c7120009d8ba9431426135661a731b</id>
<content type='text'>
The events_queue_size sysfs attribute provides a way for users to
dynamically configure the Counter events queue size for the Counter
character device interface. The size is in number of struct
counter_event data structures. The number of elements will be rounded-up
to a power of 2 due to a requirement of the kfifo_alloc function called
during reallocation of the queue.

Cc: Oleksij Rempel &lt;o.rempel@pengutronix.de&gt;
Signed-off-by: William Breathitt Gray &lt;vilhelm.gray@gmail.com&gt;
Link: https://lore.kernel.org/r/c914b2db2ea0a2637633bcc3e86ded3c94783f2e.1632884256.git.vilhelm.gray@gmail.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>counter: Implement *_component_id sysfs attributes</title>
<updated>2021-10-17T09:54:48Z</updated>
<author>
<name>William Breathitt Gray</name>
<email>vilhelm.gray@gmail.com</email>
</author>
<published>2021-09-29T03:16:03Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=4bdec61d927b5db25f75fa377504d4e127c3682b'/>
<id>urn:sha1:4bdec61d927b5db25f75fa377504d4e127c3682b</id>
<content type='text'>
The Generic Counter chrdev interface expects users to supply component
IDs in order to select extensions for requests. In order for users to
know what component ID belongs to which extension this information must
be exposed. The *_component_id attribute provides a way for users to
discover what component ID belongs to which respective extension.

Cc: David Lechner &lt;david@lechnology.com&gt;
Cc: Gwendal Grignou &lt;gwendal@chromium.org&gt;
Cc: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: William Breathitt Gray &lt;vilhelm.gray@gmail.com&gt;
Link: https://lore.kernel.org/r/8961a11edbb882fc689e468194f5be75f572443e.1632884256.git.vilhelm.gray@gmail.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>counter: Implement signalZ_action_component_id sysfs attribute</title>
<updated>2021-10-17T09:54:36Z</updated>
<author>
<name>William Breathitt Gray</name>
<email>vilhelm.gray@gmail.com</email>
</author>
<published>2021-09-29T03:16:02Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=bb6264a61de84320e77a22b4b8f4babf240608c4'/>
<id>urn:sha1:bb6264a61de84320e77a22b4b8f4babf240608c4</id>
<content type='text'>
The Generic Counter chrdev interface expects users to supply component
IDs in order to select Synapses for requests. In order for users to know
what component ID belongs to which Synapse this information must be
exposed. The signalZ_action_component_id attribute provides a way for
users to discover what component ID belongs to the respective Synapse.

Cc: Gwendal Grignou &lt;gwendal@chromium.org&gt;
Cc: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reviewed-by: David Lechner &lt;david@lechnology.com&gt;
Signed-off-by: William Breathitt Gray &lt;vilhelm.gray@gmail.com&gt;
Link: https://lore.kernel.org/r/a6c81b2f1f5d0b8d59b1ebe4f0fed04914b07547.1632884256.git.vilhelm.gray@gmail.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
</feed>
