Re: [PATCH v7 0/5] Introduce the Counter character device interface

From: David Lechner
Date: Wed Dec 30 2020 - 18:35:09 EST


On 12/25/20 6:15 PM, William Breathitt Gray wrote:
Changes in v7:
- Implemented u32 enums; enum types can now be used directly for
callbacks and values
- Fixed refcount underflow bug
- Refactored all err check to check for err < 0; this should help
prevent future oversights on valid positive return valids
- Use mutex instead of raw_spin_lock in counter_chrdev_read();
kifo_to_user() can now safely sleep
- Renamed COUNTER_COMPONENT_DUMMY to COUNTER_COMPONENT_NONE to make
purpose more obvious
- Introduced a watch_validate() callback
- Consolidated the functionality to clear the watches to the
counter_clear_watches() function
- Reimplemented counter_push_event() as a void function; on error,
errno is returned via struct counter_event so that it can be handled
by userspace (because interrupt handlers can't do much for this)
- Renamed the events_config() callback to events_configure();
"events_config" could be confused as a read callback when this is
actually intended to configure the device for the requested events
- Reimplemented 104-QUAD-8 driver to use events_configure() and
watch_validate() callbacks; irq_trigger_enable sysfs attribute
removed because events_configure() now serves this purpose

The changes for this revision were much simpler compared to the previous
revisions. I don't have any further questions for this patchset, so it's
really just a search for possible bugs or regressions now. Please test
and verify this patchset on your systems, and ACK appropriately.


I'll wait for the next round to give my Reviewed-By, Tested-By but I've
rebased my WIP TI eQEP changes[1] on this and I haven't ran into any
problems yet.

[1]: https://github.com/dlech/linux/commits/bone-counter